/* ==========================================================================
   Through the Dark Corridors of Time — marvelouslight.ca
   Palette: deep navy #0A202B · stone-blue field #6D88A1
            cream panels · lamp gold from the cover art
   The page moves from the dark of the corridor into open light.
   ========================================================================== */

/* ---------- 1. Tokens ---------- */

:root {
  /* colour */
  --bar:         #0A202B;   /* the bar at the top */
  --banner:      #0A202B;   /* hero, footer, dark bands */
  --banner-2:    #06171F;   /* recessed wells inside dark areas */
  --banner-3:    #123040;   /* cards on dark */
  --bg:          #6D88A1;   /* main page field */
  --bg-deep:     #5E7A94;   /* alternate field */
  --cream:       #F5F5E9;   /* the site cream — replaces white everywhere */
  --panel:       #F5F5E9;   /* cream content panel */
  --panel-2:     #E9E9DA;   /* recessed surface inside a panel */
  --panel-line:  #D5D5C2;   /* hairlines on cream */

  --paper:       #F5F5E9;   /* light text on navy — the site cream */
  --paper-dim:   #93A3AC;   /* muted text on the dark blue */
  --rule-dark:   #1E3D4E;   /* hairlines on the dark blue */

  --accent:      #E0D8C0;   /* accent + primary button */
  --accent-ink:  #0A202B;   /* text on the accent */
  --accent-dark: #14384A;   /* accent role on cream, where pale would vanish */

  --warm-ink:    #241E17;   /* body text on cream */
  --warm-ink-2:  #5C5145;   /* muted text on cream */
  --on-field:    #F5F5E9;   /* headings sitting directly on the blue field */

  /* type */
  --display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --body: "Karla", "Segoe UI", system-ui, -apple-system, sans-serif;

  /* measure + rhythm */
  --measure: 34rem;
  --gutter: clamp(1.25rem, 5vw, 4rem);
  --shell: 76rem;
  --section-y: clamp(4.5rem, 11vw, 9rem);
  --panel-y: clamp(2.5rem, 6vw, 4.5rem);
  --panel-x: clamp(1.5rem, 4vw, 3.5rem);

  --radius: 2px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* ---------- 2. Reset ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 7.2rem;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--warm-ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.75;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }
img { height: auto; }

h1, h2, h3, h4 {
  font-family: var(--display);
  font-variation-settings: "SOFT" 24, "WONK" 1, "opsz" 96;
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.018em;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0 0 1.15em; }
p:last-child { margin-bottom: 0; }

a { color: inherit; }

button { font: inherit; cursor: pointer; }

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

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; top: 0; left: 50%;
  transform: translate(-50%, -110%);
  z-index: 100;
  background: var(--accent); color: var(--accent-ink);
  padding: .7rem 1.4rem; font-weight: 700;
  text-decoration: none;
}
.skip-link:focus { transform: translate(-50%, 0); }

/* ---------- 3. Shell + section scaffolding ---------- */

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.band { padding-block: var(--section-y); }
.band--dark  { background: var(--banner);   color: var(--paper); }
.band--dark2 { background: var(--banner-2); color: var(--paper); }

/* On the blue field the content rides on a cream panel — the field itself is
   too mid-toned to carry body copy at accessible contrast. */
.band--light,
.band--light2 { background: var(--bg); color: var(--warm-ink); padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.band--light2 { background: var(--bg-deep); }

.band--light > .shell,
.band--light2 > .shell {
  background: var(--panel);
  padding-block: var(--panel-y);
  padding-inline: var(--panel-x);
  border-radius: 3px;
  box-shadow: 0 1.2rem 3rem rgba(20, 30, 40, .22);
}
.band--light2 > .shell { background: var(--panel-2); }

.band--light h1, .band--light h2, .band--light h3,
.band--light2 h1, .band--light2 h2, .band--light2 h3 { color: var(--warm-ink); }

/* The eyebrow is wayfinding, not decoration: it names which part of the
   corridor you are standing in. */
.eyebrow {
  font-family: var(--body);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--paper-dim);
  margin: 0 0 1.4rem;
  display: flex;
  align-items: center;
  gap: .85rem;
}
.hero .eyebrow { color: var(--bar); }
.hero .eyebrow::after { background: rgba(10, 32, 43, .35); }
.hero .btn--ghost { color: var(--bar); border-color: rgba(10, 32, 43, .45); }
.hero .btn--ghost:hover { border-color: var(--bar); color: var(--bar); }

.eyebrow::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rule-dark);
  max-width: 8rem;
}
.band--light .eyebrow,
.band--light2 .eyebrow { color: var(--warm-ink-2); }
.band--light .eyebrow::after,
.band--light2 .eyebrow::after { background: var(--panel-line); }

.h-section { font-size: clamp(1.95rem, 4.2vw, 3.1rem); }
.h-sub { font-size: clamp(1.25rem, 2.4vw, 1.6rem); }

.lede {
  font-size: clamp(1.15rem, 2vw, 1.35rem);
  line-height: 1.6;
  max-width: 38rem;
}

.prose { max-width: var(--measure); }

/* ---------- 4. Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  padding: .95rem 1.7rem;
  font-family: var(--body);
  font-size: .93rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--radius);
  transition: background-color .25s var(--ease), color .25s var(--ease),
              border-color .25s var(--ease), transform .25s var(--ease);
}
.btn:hover { transform: translateY(-2px); }

.btn--lamp {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.hero .btn--lamp,
.band--light .btn--lamp,
.band--light2 .btn--lamp { border-color: var(--bar); }
.btn--lamp:hover { background: #EEEEDF; border-color: #EEEEDF; }

.btn--ghost {
  background: transparent;
  color: var(--paper);
  border-color: var(--rule-dark);
}
.btn--ghost:hover { border-color: var(--paper-dim); color: var(--cream); }

.band--light .btn--ghost,
.band--light2 .btn--ghost { color: var(--warm-ink); border-color: var(--panel-line); }
.band--light .btn--ghost:hover,
.band--light2 .btn--ghost:hover { border-color: var(--warm-ink-2); color: var(--warm-ink); }

.btn--sm { padding: .6rem 1.1rem; font-size: .78rem; }

/* ---------- 5. Masthead ---------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bar);
  border-bottom: 1px solid rgba(255, 255, 255, .10);
}
.masthead__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 6.2rem;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: .85rem;
  text-decoration: none;
  color: var(--paper);
  font-family: var(--display);
  font-variation-settings: "SOFT" 24, "WONK" 1, "opsz" 20;
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: -.01em;
  line-height: 1.15;
}
/* the lit archway — used whole; the PNG carries its own soft edge */
.wordmark__mark {
  flex: none;
  width: auto;
  height: 4.4rem;
}
.wordmark span { max-width: 12ch; }

.nav { display: flex; align-items: center; gap: clamp(.9rem, 2vw, 1.9rem); }
.nav a {
  text-decoration: none;
  font-size: 1.01rem;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--paper-dim);
  transition: color .2s var(--ease);
  white-space: nowrap;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--paper); }
/* the button in the menu keeps its own colour, not the link colour */
.nav a.btn--lamp { color: var(--accent-ink); }
.nav a.btn--lamp:hover { color: var(--accent-ink); }
.nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: .45em; text-decoration-color: var(--accent-dark); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--rule-dark);
  border-radius: var(--radius);
  color: var(--paper);
  padding: .5rem .8rem;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

/* ---------- 6. Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  background: var(--bg);
  color: var(--bar);
  padding-block: clamp(3.5rem, 9vw, 7rem) clamp(4rem, 9vw, 7.5rem);
}

/* daylight opening up behind the book */
.hero::before {
  content: "";
  position: absolute;
  inset: -30% -12% auto auto;
  width: min(72vw, 48rem);
  aspect-ratio: 1;
  background: radial-gradient(circle,
      rgba(245, 245, 233, .32) 0%,
      rgba(245, 245, 233, .11) 40%,
      transparent 70%);
  pointer-events: none;
  animation: lamp 16s ease-in-out infinite alternate;
}
/* the field deepens toward the floor */
.hero::after {
  content: "";
  position: absolute;
  inset: auto -10% -40% -10%;
  height: 70%;
  background: radial-gradient(ellipse at 50% 100%,
      rgba(10, 32, 43, .22) 0%, transparent 68%);
  pointer-events: none;
}

@keyframes lamp {
  from { opacity: .70; transform: scale(.97); }
  to   { opacity: 1;   transform: scale(1.05); }
}

.hero__grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: center;
}

.hero__title {
  font-size: clamp(2.9rem, 8.4vw, 5.6rem);
  font-variation-settings: "SOFT" 30, "WONK" 1, "opsz" 144;
  font-weight: 400;
  line-height: .96;
  letter-spacing: -.028em;
  margin-bottom: 0;
  color: var(--bar);
}
.hero__title em {
  font-style: normal;
  display: block;
  color: var(--bar);
}

/* the subtitle, set the way it sits on the printed cover */
.hero__subtitle {
  display: block;
  margin-top: clamp(.9rem, 1.8vw, 1.35rem);
  font-family: var(--display);
  font-variation-settings: "SOFT" 40, "WONK" 0, "opsz" 40;
  font-size: clamp(1.5rem, 3vw, 2.08rem);
  font-style: italic;
  font-weight: 400;
  line-height: 1.28;
  letter-spacing: .005em;
  color: var(--cream);
}

.hero__byline {
  margin: clamp(.65rem, 1.4vw, 1rem) 0 0;
  font-family: var(--display);
  font-variation-settings: "SOFT" 30, "WONK" 0, "opsz" 40;
  font-size: clamp(1.35rem, 2.7vw, 1.85rem);
  font-style: normal;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -.005em;
  color: var(--bar);
}

.hero__deck {
  font-family: var(--display);
  font-variation-settings: "SOFT" 30, "WONK" 0, "opsz" 40;
  font-size: clamp(1.15rem, 2.3vw, 1.5rem);
  font-style: italic;
  line-height: 1.42;
  color: var(--bar);
  max-width: 30ch;
  margin: clamp(1.5rem, 3vw, 2.1rem) 0 2rem;
}

.hero__actions { display: flex; flex-wrap: wrap; gap: .85rem; }


.hero__cover { position: relative; justify-self: center; width: min(100%, 25rem); }
.hero__cover img {
  width: 100%;
  border-radius: 2px;
  box-shadow:
    -1.2rem 2.4rem 4.5rem rgba(8, 26, 36, .48),
    0 0 0 1px rgba(10, 32, 43, .35);
}
.hero__cover::after {
  content: "";
  position: absolute;
  left: 6%; right: 6%;
  bottom: -2.4rem;
  height: 3.5rem;
  background: radial-gradient(ellipse at center,
      rgba(10, 32, 43, .30) 0%, transparent 70%);
  filter: blur(7px);
  pointer-events: none;
}

/* ---------- 7. Content warning ---------- */

.warning {
  background: var(--banner-2);
  color: var(--paper);
  border-block: 1px solid var(--rule-dark);
  padding-block: 1.6rem;
}
.warning__inner {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.1rem;
  align-items: start;
  max-width: 54rem;
}
.warning svg { color: var(--accent); margin-top: .25rem; }
.warning p { font-size: .93rem; line-height: 1.65; color: #C6CFD5; margin: 0; }
.warning strong { color: var(--paper); font-weight: 700; }

/* ---------- 8. The book ---------- */

.book__grid {
  display: grid;
  grid-template-columns: minmax(0, 18rem) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}
.book__body { font-size: 1.09rem; max-width: 40rem; }
.book__body > p:first-of-type { font-size: 1.22rem; line-height: 1.62; color: var(--cream); }

/* A verse the book hangs on. Set as a plate on the wall, not a blockquote. */
.verse {
  margin: 2.75rem 0 0;
  padding: 1.9rem 0 0;
  border-top: 1px solid var(--rule-dark);
  font-family: var(--display);
  font-variation-settings: "SOFT" 40, "WONK" 1, "opsz" 60;
  font-size: clamp(1.2rem, 2.4vw, 1.55rem);
  font-style: italic;
  line-height: 1.45;
  color: var(--accent);
  max-width: 32ch;
}
.verse cite {
  display: block;
  margin-top: .9rem;
  font-family: var(--body);
  font-style: normal;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--paper-dim);
}

/* ---------- 9. Endorsements ---------- */

.quotes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 1px;
  background: var(--rule-dark);
  border: 1px solid var(--rule-dark);
}
.quote {
  background: var(--banner);
  padding: clamp(1.6rem, 3vw, 2.4rem);
  margin: 0;
  display: flex;
  flex-direction: column;
}
.quote__text {
  font-family: var(--display);
  font-variation-settings: "SOFT" 30, "WONK" 0, "opsz" 30;
  font-size: 1.06rem;
  font-style: italic;
  line-height: 1.55;
  color: var(--cream);
  flex: 1;
  margin: 0 0 1.5rem;
}
.quote__by { font-size: .82rem; line-height: 1.5; color: var(--paper-dim); font-style: normal; }
.quote__by strong {
  display: block;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: .02em;
}

/* ---------- 10. The threshold — signature element ---------- */
/* Where the corridor opens. The doorway is filled with the blue field that
   carries the rest of the page. */

.threshold { background: var(--bg); line-height: 0; }

.threshold__wall {
  position: relative;
  height: clamp(7rem, 15vw, 11.5rem);
  background: var(--banner);
  overflow: hidden;
}
.threshold__wall::before {
  content: "";
  position: absolute;
  left: 50%; bottom: 0;
  transform: translateX(-50%);
  width: min(58rem, 95%);
  height: 130%;
  background: radial-gradient(ellipse at 50% 100%,
      rgba(224, 216, 192, .34) 0%,
      rgba(224, 216, 192, .12) 42%,
      transparent 68%);
}
.threshold__door {
  position: absolute;
  left: 50%; bottom: 0;
  transform: translateX(-50%);
  height: 76%;
  width: auto;
  z-index: 1;
}

/* ---------- 11. Plates (interior illustrations) ---------- */

.plates {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: clamp(1.5rem, 3vw, 2.5rem);
  margin-top: 3rem;
}

.plate { margin: 0; }

.plate__frame {
  position: relative;
  background: var(--panel-2);
  border: 1px solid var(--panel-line);
  padding: .7rem;
  transition: box-shadow .3s var(--ease), transform .3s var(--ease);
}
.band--light2 .plate__frame { background: var(--panel); }
/* 'auto 4/5' means: use the picture's real shape once known, and hold this
   much room before it loads — which stops the page jumping as thumbnails
   arrive and keeps anchor links landing where they should. */
.plate__frame img { width: 100%; border-radius: 1px; aspect-ratio: auto 4 / 5; }

.plate__btn {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  text-align: inherit;
}
.plate__btn:hover .plate__frame {
  transform: translateY(-3px);
  box-shadow: 0 1rem 2.2rem rgba(36, 30, 23, .2);
}

.plate figcaption { margin-top: .9rem; font-size: .87rem; line-height: 1.5; color: var(--warm-ink-2); }
/* Bold inside a caption stays in the flow of the sentence. This used to be
   display:block, from when a caption began with a title on its own line —
   which made every bold word start a new line. */
.plate figcaption b,
.plate figcaption strong { color: var(--warm-ink); font-weight: 700; }
.plate figcaption i,
.plate figcaption em { font-style: italic; }

/* empty state — shown until the artwork file is dropped in */
.plate__frame.is-empty { padding: 0; border-style: dashed; }
.plate__frame.is-empty img { display: none; }
.plate__frame.is-empty::before {
  content: attr(data-empty);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  aspect-ratio: var(--ratio, 4 / 5);
  padding: 1.5rem;
  font-family: var(--body);
  font-size: .78rem;
  line-height: 1.6;
  letter-spacing: .04em;
  color: var(--warm-ink-2);
  background: repeating-linear-gradient(135deg,
      transparent 0 10px, rgba(211, 201, 182, .5) 10px 20px);
}

/* a section title carried on a navy bar across the top of its panel */
.section-head {
  background: var(--banner);
  color: var(--cream);
  margin: calc(-1 * var(--panel-y)) calc(-1 * var(--panel-x)) var(--panel-y);
  padding: clamp(1.9rem, 4vw, 2.9rem) var(--panel-x);
  border-radius: 3px 3px 0 0;
}
.band--light .section-head h1,
.band--light .section-head h2,
.band--light2 .section-head h1,
.band--light2 .section-head h2 { color: var(--cream); }
.band--light .section-head .eyebrow,
.band--light2 .section-head .eyebrow { color: var(--accent); margin-bottom: 1.1rem; }
.band--light .section-head .eyebrow::after,
.band--light2 .section-head .eyebrow::after { background: var(--rule-dark); }
.section-head > :last-child { margin-bottom: 0; }

/* gallery states + teaser */
.gallery-note {
  grid-column: 1 / -1;
  margin: 0;
  padding: 1.4rem 0;
  font-size: .95rem;
  line-height: 1.6;
  color: var(--warm-ink-2);
}
.plates--teaser { margin-top: 2.5rem; }

/* wide figures — the blueprint and the system map */
.figures { display: grid; gap: clamp(2.5rem, 5vw, 4rem); margin-top: 3rem; }
.figure { margin: 0; }
.figure__title {
  font-family: var(--display);
  font-variation-settings: "SOFT" 24, "WONK" 1, "opsz" 40;
  font-size: clamp(1.45rem, 3vw, 2rem);
  font-weight: 600;
  letter-spacing: -.012em;
  color: var(--warm-ink);
  margin: 0 0 .8rem;
}
.figure__intro {
  max-width: var(--measure);
  font-size: 1.02rem;
  line-height: 1.7;
  color: var(--warm-ink-2);
  margin: 0 0 1.6rem;
}
.figure figcaption {
  font-size: .87rem;
  color: var(--warm-ink-2);
}
.figure .plate__frame { --ratio: 4 / 5; }
/* the diagrams are tall; held to the same width as a gallery thumbnail they
   stay scannable instead of pushing the next one off the screen */
.figure .plate__btn { max-width: min(100%, 15.4rem); }
.figure figcaption { margin-top: .9rem; }

/* ---------- 12. Lightbox ---------- */
/* The Blueprint is a table-sized document. Fitting it on screen is only the
   starting point — the viewer has to zoom and pan or it is no use.
   The dialog is a flex column: the bar takes the height it needs and the
   stage takes everything left over, so the controls can never be clipped. */

.lightbox {
  border: 0;
  padding: 0;
  width: min(98vw, 100rem);
  max-width: 98vw;
  background: var(--banner);
  color: var(--paper);
  overflow: hidden;
}
.lightbox[open] {
  display: flex;
  flex-direction: column;
  height: 96vh;
  height: 96dvh;          /* dvh accounts for mobile browser chrome */
  max-height: 96vh;
  max-height: 96dvh;
}
.lightbox::backdrop { background: rgba(6, 20, 28, .95); }

.lightbox__stage {
  flex: 1 1 auto;
  min-height: 0;          /* lets the stage shrink instead of pushing the bar out */
  overflow: auto;
  overscroll-behavior: contain;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    repeating-conic-gradient(rgba(255,255,255,.03) 0% 25%, transparent 0% 50%)
    50% / 24px 24px;
  touch-action: pinch-zoom;
}
.lightbox__stage.is-zoomed { align-items: start; justify-content: start;
  touch-action: pan-x pan-y pinch-zoom; }
.lightbox__stage img {
  display: block;
  margin: auto;
  user-select: none;
  -webkit-user-drag: none;
}

.lightbox__bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem 1rem;
  flex-wrap: wrap;
  padding: .7rem 1rem;
  border-top: 1px solid var(--rule-dark);
  font-size: .87rem;
  color: var(--paper-dim);
}
/* A gallery caption can run to several sentences of dialogue, so let it wrap
   and scroll rather than pushing the controls off the bottom. */
.lightbox__caption {
  min-width: 0;
  flex: 1 1 18rem;
  max-height: 5.4em;
  overflow-y: auto;
  line-height: 1.5;
  padding-right: .5rem;
}
.lightbox__caption b, .lightbox__caption strong { color: var(--paper); font-weight: 700; }
.lightbox__caption i, .lightbox__caption em { font-style: italic; }

/* shown only where a finger is the pointer */
.lightbox__hint { display: none; font-size: .74rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--paper-dim); opacity: .8; }
@media (hover: none) and (pointer: coarse) {
  .lightbox__hint.is-many { display: block; }
}
.lightbox__nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .4rem;
  flex: none;
  flex-wrap: wrap;
}
.lightbox__pos, .lightbox__zoom {
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--paper-dim);
  min-width: 3.2rem;
  text-align: center;
}

.lightbox__btn, .lightbox__close {
  background: none;
  border: 1px solid var(--rule-dark);
  color: var(--paper);
  border-radius: var(--radius);
  padding: .42rem .8rem;
  font-family: var(--body);
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-decoration: none;
  line-height: 1.4;
  white-space: nowrap;
  cursor: pointer;
}
.lightbox__btn:hover, .lightbox__close:hover { border-color: var(--accent); color: var(--accent); }
.lightbox__close { border-color: var(--accent); }

/* Narrow screens: the caption takes its own line and the controls tighten up,
   so everything including Close stays on screen. */
@media (max-width: 46rem) {
  .lightbox { width: 100vw; max-width: 100vw; }
  .lightbox[open] { height: 100vh; height: 100dvh; max-height: 100dvh; }
  .lightbox__bar { padding: .6rem .7rem; gap: .5rem; }
  .lightbox__caption {
    flex: 1 1 100%;
    order: -1;
    font-size: .8rem;
    line-height: 1.4;
    max-height: 2.8em;
    overflow: hidden;
  }
  .lightbox__nav { flex: 1 1 100%; justify-content: space-between; gap: .35rem; }
  .lightbox__btn, .lightbox__close { padding: .5rem .6rem; font-size: .7rem; letter-spacing: .04em; }
  .lightbox__pos, .lightbox__zoom { min-width: 0; font-size: .66rem; letter-spacing: .06em; }
}

/* Very narrow: drop the label that matters least rather than let the row wrap
   into a third line. */
@media (max-width: 26rem) {
  .lightbox__pos { display: none; }
  [data-lb-tab] { display: none; }
}

/* ---------- 13. About ---------- */

.about__grid {
  display: grid;
  grid-template-columns: minmax(0, 20rem) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}
.about__portrait { background: var(--panel-2); border: 1px solid var(--panel-line); padding: .7rem; }
.about__portrait img { width: 100%; }
.about__body { max-width: 38rem; font-size: 1.06rem; }
.about__body h2 { margin-bottom: 1.3rem; }

/* ---------- 14. Buy ---------- */

.buy { background: var(--banner); color: var(--paper); position: relative; overflow: hidden; }
.buy::before {
  content: "";
  position: absolute;
  inset: auto 0 -60% 0;
  height: 100%;
  background: radial-gradient(ellipse at 50% 100%,
      rgba(224, 216, 192, .26) 0%, transparent 62%);
  pointer-events: none;
}
.buy__inner { position: relative; z-index: 1; text-align: center; max-width: 44rem; margin-inline: auto; }
.buy h2 { font-size: clamp(2rem, 5vw, 3.2rem); margin-bottom: 1.1rem; color: var(--cream); }
.buy p { color: var(--paper-dim); margin-bottom: 2rem; }
.buy .btn--lamp { font-size: 1rem; padding: 1.15rem 2.6rem; }
.buy__formats {
  margin-top: 1.6rem;
  font-size: .8rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #7F8F99;
}

/* ---------- 15. Resources page ---------- */

.crisis {
  background: var(--banner);
  color: var(--paper);
  border-left: 4px solid var(--accent);
  padding: clamp(1.4rem, 3vw, 2rem);
  border-radius: 2px;
}
.crisis h3 { font-size: 1.25rem; color: var(--accent); margin-bottom: .7rem; }
.crisis p { color: var(--paper); font-size: .95rem; }
.crisis ul { list-style: none; padding: 0; margin: 1.1rem 0 0; display: grid; gap: .7rem; }
.crisis li { font-size: .93rem; color: var(--paper); }
.crisis li b { color: var(--accent); font-weight: 700; }
.crisis a { color: var(--paper); }

.res-list {
  list-style: none;
  padding: 0;
  margin: 2.2rem 0 0;
  display: grid;
  gap: 1px;
  background: var(--panel-line);
  border-block: 1px solid var(--panel-line);
}
.res-list > li { background: var(--panel); padding: 1.5rem 0; }

.res-item { display: block; }
.res-item h3 {
  font-family: var(--display);
  font-variation-settings: "SOFT" 24, "WONK" 1, "opsz" 40;
  font-size: clamp(1.2rem, 2.4vw, 1.5rem);
  font-weight: 600;
  letter-spacing: -.01em;
  line-height: 1.2;
  margin: 0 0 .45rem;
}
.res-item h3 a {
  color: var(--warm-ink);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-dark);
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
.res-item h3 a:hover { color: var(--accent-dark); }
.res-by {
  font-size: 1rem;
  line-height: 1.5;
  color: var(--warm-ink);
  margin: 0 0 .3rem;
}
.res-note {
  font-size: .93rem;
  line-height: 1.6;
  color: var(--warm-ink-2);
  margin: 0;
  max-width: var(--measure);
}
.res-meta {
  display: inline-block;
  margin-top: .7rem;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--warm-ink-2);
  border: 1px solid var(--panel-line);
  border-radius: 2px;
  padding: .2rem .6rem;
}

.disclaimer {
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--panel-line);
  font-size: .87rem;
  line-height: 1.65;
  color: var(--warm-ink-2);
  max-width: 44rem;
}

/* ---------- 16. Contact form ---------- */

.contact__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: start;
}

.form { display: grid; gap: 1.4rem; }
.field { display: grid; gap: .45rem; }
.field > label {
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--warm-ink-2);
}
.field input, .field select, .field textarea {
  font: inherit;
  font-size: 1rem;
  color: var(--warm-ink);
  background: #FBFBF2;
  border: 1px solid var(--panel-line);
  border-radius: var(--radius);
  padding: .85rem 1rem;
  width: 100%;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.field textarea { min-height: 11rem; resize: vertical; line-height: 1.6; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent-dark);
  box-shadow: 0 0 0 3px rgba(20, 56, 74, .22);
  outline: none;
}
.field .hint { font-size: .84rem; color: var(--warm-ink-2); }

.check {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .8rem;
  align-items: start;
  font-size: .92rem;
  line-height: 1.55;
  color: var(--warm-ink-2);
}
.check input { width: 1.1rem; height: 1.1rem; margin-top: .28rem; accent-color: var(--accent-dark); }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-note {
  font-size: .87rem;
  line-height: 1.6;
  color: var(--warm-ink);
  padding: 1.1rem 1.2rem;
  background: var(--panel-2);
  border-left: 3px solid var(--accent-dark);
}
.band--light2 .form-note { background: var(--panel); }

.aside-card {
  background: var(--panel-2);
  border: 1px solid var(--panel-line);
  padding: clamp(1.5rem, 3vw, 2.2rem);
}
.band--light2 .aside-card { background: var(--panel); }
.aside-card + .aside-card { margin-top: 1.5rem; }
.aside-card h3 { font-size: 1.25rem; margin-bottom: .8rem; }
.aside-card p { font-size: .95rem; line-height: 1.65; color: var(--warm-ink-2); }
.aside-card a { color: var(--warm-ink); text-decoration-color: var(--accent-dark); text-underline-offset: .25em; }

/* ---------- 17. Footer ---------- */

.footer {
  background: var(--banner);
  color: var(--paper-dim);
  border-top: 1px solid var(--rule-dark);
  padding-block: clamp(3rem, 6vw, 4.5rem) 2.5rem;
  font-size: .9rem;
}
.footer__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr));
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
.footer h4 {
  font-family: var(--body);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--paper);
  margin-bottom: 1.1rem;
}
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.footer a { color: var(--paper-dim); text-decoration: none; }
.footer a:hover { color: var(--accent); }
.footer__blurb { max-width: 26rem; line-height: 1.7; }
.footer__blurb strong em {
  display: block;
  font-style: italic;
  font-size: .95rem;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--paper-dim);
  margin-top: .3rem;
}
.footer__blurb strong {
  display: block;
  font-family: var(--display);
  font-variation-settings: "SOFT" 24, "WONK" 1, "opsz" 30;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--paper);
  letter-spacing: -.01em;
  margin-bottom: .7rem;
  line-height: 1.15;
}
.footer__base {
  margin-top: clamp(2.5rem, 5vw, 4rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule-dark);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  justify-content: space-between;
  font-size: .82rem;
  color: #8796A0;
}

/* ---------- 18. Scroll reveal ---------- */

.reveal { opacity: 0; transform: translateY(1.4rem); }
.reveal.is-in {
  opacity: 1;
  transform: none;
  transition: opacity .8s var(--ease), transform .8s var(--ease);
}

/* ---------- 19. Responsive ---------- */

@media (max-width: 62rem) {
  .hero__grid { grid-template-columns: 1fr; text-align: left; }
  .hero__cover { grid-row: 1; width: min(100%, 17rem); justify-self: start; }
  .book__grid, .about__grid, .contact__grid { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .footer__blurb { grid-column: 1 / -1; }
  .figure figcaption { grid-template-columns: 1fr; }
  .crisis li { grid-template-columns: 1fr; }
}

/* The menu collapses well before phone width. With seven items the bar needs
   about 1100px to lay out flat; below that it used to run off the side of the
   page and scroll sideways. Measured, not guessed: overflow began at 1050px. */
@media (max-width: 70rem) {
  .nav {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bar);
    border-bottom: 1px solid rgba(255, 255, 255, .10);
    padding: .5rem var(--gutter) 1.4rem;
  }
  .nav.is-open { display: flex; }
  .nav a { padding: .85rem 0; border-bottom: 1px solid rgba(255, 255, 255, .12); font-size: .95rem; }
  .nav .btn { margin-top: 1rem; justify-content: center; }
  .nav-toggle { display: block; }
  .masthead__inner { position: relative; }

  /* with the links tucked away there is room for the title to sit on one or
     two lines instead of being squeezed into four */
  .wordmark span { max-width: none; }
}

@media (max-width: 46rem) {
  .wordmark__mark { height: 3.8rem; }
  .wordmark span { max-width: 14ch; font-size: .95rem; }
  .res-item { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr; }
  .band--light > .shell, .band--light2 > .shell { border-radius: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .btn:hover, .plate__btn:hover .plate__frame { transform: none; }
}

@media print {
  .masthead, .nav, .btn, .threshold { display: none; }
  body { background: #fff; color: #000; }
}

/* focus ring flips on the light half, where pale cream would vanish */
.band--light :focus-visible,
.band--light2 :focus-visible,
.hero :focus-visible { outline-color: var(--accent-dark); }
