
/* ==========================================
   BECKINGHAM — SHARED DESIGN SYSTEM
   Reflections · Study · Music
   ========================================== */

/* 1. DESIGN VARIABLES */

:root {
  /* Colours */
  --paper: #f8f7f3;
  --surface: #fffdf9;
  --cream: #f0efe9;
  --ink: #293731;
  --muted: #65766c;
  --accent: #557669;
  --accent-dark: #365e52;
  --accent-light: #edf3ec;
  --line: #e2e2da;
  --blue: #eaf0f5;
  --link: #36695e;
  --link-hover: #1c453d;

  /* Typography */
  --font-reading: Georgia, "Times New Roman", serif;
  --font-ui: Arial, Helvetica, sans-serif;

  /* Layout */
  --page-width: 920px;
  --reading-width: 690px;
  --page-padding: 28px;

  /* Corners */
  --radius-small: 8px;
  --radius-card: 12px;
  --radius-large: 16px;

  /* Spacing */
  --space-small: 12px;
  --space-medium: 24px;
  --space-large: 40px;
  --space-section: 56px;
}

/* 2. GLOBAL RESET */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 25px;
  scrollbar-gutter: stable;
}

body {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 0 var(--page-padding) 100px;
  background: var(--paper);
  color: var(--ink);
  font: 19px/1.75 var(--font-reading);
  overflow-wrap: break-word;
}

img,
svg {
  max-width: 100%;
}

/* 3. LINKS AND FOCUS */

a {
  color: var(--link);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--link-hover);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* 4. TYPOGRAPHY */

h1,
h2,
h3,
h4,
h5 {
  color: var(--ink);
}

h1 {
  margin: 0 0 22px;
  font-family: var(--font-reading);
  font-size: clamp(38px, 6vw, 65px);
  font-weight: normal;
  line-height: 1.12;
  letter-spacing: -.035em;
}

h2 {
  margin: 55px 0 17px;
  font-family: var(--font-reading);
  font-size: clamp(29px, 4vw, 41px);
  font-weight: normal;
  line-height: 1.2;
  letter-spacing: -.02em;
}

h3 {
  margin: 48px 0 22px;
  color: var(--accent);
  font: 600 14px/1.5 var(--font-ui);
  text-transform: uppercase;
  letter-spacing: .12em;
}

h4 {
  margin: 0 0 18px;
  font: 600 23px/1.4 var(--font-reading);
}

h5 {
  margin: 0 0 13px;
  color: var(--accent);
  font: 700 11px/1.5 var(--font-ui);
  text-transform: uppercase;
  letter-spacing: .12em;
}

p {
  margin: 12px 0;
}

/* 5. STANDARD PAGE HEADERS */

body > header {
  position: relative;
  padding: 66px 0 42px;
  border-bottom: 1px solid var(--line);
}

.header-sprig {
  display: block;
  width: 132px;
  height: auto;
  margin: 0 0 24px;
}

.header-eyebrow {
  margin: 0 0 25px;
  color: var(--accent);
  font: 700 11px/1.4 var(--font-ui);
  letter-spacing: .22em;
  text-transform: uppercase;
}

body > header .subtitle {
  margin: 0 0 28px;
  color: var(--accent);
  font: 17px/1.6 var(--font-ui);
}

body > header
  :where(p:not(.subtitle):not(.header-eyebrow):not(.entry-meta):not(.archive-meta)) {
  max-width: 760px;
  font-size: 20px;
  line-height: 1.75;
}

/* 6. COLLECTION LANDING HEADERS */

body > header.collection-header {
  margin: 0;
  padding: 48px 0 36px;
}

body > header.collection-header .header-eyebrow {
  margin: 0 0 22px;
  font: 700 14px/1.4 var(--font-ui);
  letter-spacing: .18em;
}

body > header.collection-header h1 {
  max-width: none;
  margin: 0 0 22px;
  font-size: clamp(34px, 5.6vw, 54px);
  line-height: 1.15;
  text-wrap: balance;
}

body > header.collection-header
  p:not(.header-eyebrow):not(.archive-meta) {
  max-width: 760px;
  margin: 0;
  color: var(--ink);
  font: 19px/1.75 var(--font-reading);
}

body > header.collection-header
  :is(.header-sprig, .music-art) {
  display: block;
  width: 132px;
  height: auto;
  margin: 0 0 24px;
}

/* 7. SHARED COMPONENTS */

.surface-card {
  padding: var(--space-medium);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
}

.muted {
  color: var(--muted);
}

.reading-width {
  max-width: var(--reading-width);
}

.ui-text {
  font-family: var(--font-ui);
}

.section-divider {
  margin: var(--space-section) 0;
  border: 0;
  border-top: 1px solid var(--line);
}

/* 8. ACCESSIBILITY */

.skip-link {
  position: absolute;
  top: -60px;
  left: 10px;
  z-index: 1000;
  padding: 10px 14px;
  background: var(--surface);
  color: var(--ink);
}

.skip-link:focus {
  top: 10px;
}

/* 9. MOBILE */

@media (max-width: 650px) {
  :root {
    --page-padding: 19px;
  }

  body {
    padding-bottom: 70px;
    font-size: 17px;
  }

  body > header {
    padding: 42px 0 28px;
  }

  .header-sprig {
    width: 108px;
    margin-bottom: 20px;
  }

  body > header
    :where(p:not(.subtitle):not(.header-eyebrow):not(.entry-meta):not(.archive-meta)) {
    font-size: 18px;
  }

  body > header.collection-header {
    padding: 32px 0 28px;
  }

  body > header.collection-header .header-eyebrow {
    margin-bottom: 20px;
    font-size: 13px;
  }

  body > header.collection-header h1 {
    margin-bottom: 20px;
  }

  body > header.collection-header
    p:not(.header-eyebrow):not(.archive-meta) {
    font-size: 18px;
  }

  body > header.collection-header
    :is(.header-sprig, .music-art) {
    width: 108px;
    margin-bottom: 20px;
  }

  h4 {
    font-size: 21px;
  }
}

/* 10. REDUCED MOTION */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* 11. PRINT */

@media print {
  body {
    max-width: none;
    padding: 0;
    background: white;
    font-size: 11pt;
  }

  body > header,
  body > header.collection-header {
    padding: 0 0 20px;
  }

  .header-sprig,
  .skip-link,
  body > header.collection-header
    :is(.header-sprig, .music-art) {
    display: none;
  }

  a {
    color: inherit;
  }
}

/* Reading comfort without changing the established typefaces */
.journal-entry, .reflection-poem { max-width:var(--reading-width); }
.reflection-poem { line-height:1.78; }
.journal-entry header .subtitle { max-width:60ch; line-height:1.6; }
@media(max-width:650px) { body { font-size:17px; line-height:1.72; } .reflection-poem { line-height:1.78; } }
@media(prefers-reduced-motion:reduce) { html { scroll-behavior:auto; } }

/* A quiet, browser-native fade between pages on this same site.
   No navigation interception or animation library is needed.
   Unsupported browsers keep ordinary, instant navigation. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }

  ::view-transition-old(root) {
    animation: 150ms ease-in both oha-page-fade-out;
  }
  ::view-transition-new(root) {
    animation: 230ms ease-out both oha-page-fade-in;
  }
}
@keyframes oha-page-fade-out {
  from { opacity: 1; }
  to { opacity: 0; }
}
@keyframes oha-page-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
