/* =========================================================
   Lighthouse & Lantern Co.
   Palette sampled from the logo.
   ========================================================= */
:root {
  --navy: #022a4c;
  --navy-2: #0a2f55;
  --navy-deep: #021a31;
  --night: #010f1e;
  --gold: #c38c23;
  --gold-dark: #a8761c;
  --gold-light: #e8c36a;
  --flame: #f7e1a6;
  --cream: #f7f3ea;
  --paper: #fbf8f1;
  --ink: #13243a;
  --muted: #5a6778;

  --serif: "Libre Baskerville", Georgia, "Times New Roman", serif;
  --script: "Cormorant Garamond", Georgia, serif;
  --sans: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;

  --gutter: clamp(16px, 5vw, 48px);
  --maxw: 1160px;
  --radius: 14px;
  --ease: cubic-bezier(.22, .8, .24, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--night);
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.15; margin: 0; }
p { margin: 0; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; left: 16px; top: -60px; z-index: 100;
  background: var(--gold); color: var(--night); padding: .6rem 1rem; border-radius: 8px;
  font-weight: 700; text-decoration: none; transition: top .2s;
}
.skip-link:focus { top: 16px; }
:focus-visible { outline: 3px solid var(--gold-light); outline-offset: 3px; border-radius: 4px; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }

.eyebrow {
  font-family: var(--sans); font-weight: 700; font-size: .78rem;
  letter-spacing: .22em; text-transform: uppercase; color: var(--gold-dark);
  margin-bottom: 1rem;
}
.eyebrow--light { color: var(--gold-light); }
.section-title { font-size: clamp(1.9rem, 4.2vw, 3rem); color: var(--navy); max-width: 22ch; }
.section-title--light { color: var(--cream); }
.section-sub { margin-top: 1rem; color: var(--muted); max-width: 58ch; font-size: 1.1rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .9rem 1.5rem; border-radius: 999px; border: 2px solid transparent;
  font: 700 1rem/1 var(--sans); letter-spacing: .02em; text-decoration: none; cursor: pointer;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s, color .25s;
}
.btn:hover { transform: translateY(-2px); }
.btn--gold { background: var(--gold); color: var(--night); box-shadow: 0 0 0 0 rgba(232,195,106,.0); }
.btn--gold:hover { background: var(--gold-light); box-shadow: 0 8px 30px -6px rgba(232,195,106,.55); }
.btn--ghost { border-color: rgba(247,243,234,.5); color: var(--cream); }
.btn--ghost:hover { border-color: var(--cream); background: rgba(247,243,234,.08); }

/* =========================================================
   NAV
   ========================================================= */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .75rem var(--gutter);
  color: var(--cream);
  transition: background .35s, color .35s, box-shadow .35s, padding .35s;
}
.nav.is-solid {
  background: rgba(251,248,241,.92);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  color: var(--navy); box-shadow: 0 1px 0 rgba(2,42,76,.08); padding-block: .5rem;
}
@media (hover: none), (max-width: 860px) {
  .nav.is-solid { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(251,248,241,.985); }
}
.nav__brand { display: flex; align-items: center; gap: .75rem; text-decoration: none; min-width: 0; }
.nav__medallion {
  flex: none; width: 48px; height: 48px; border-radius: 50%;
  background: var(--cream); display: grid; place-items: center;
  box-shadow: 0 0 0 2px rgba(195,140,35,.6), 0 0 24px rgba(232,195,106,.25);
}
.nav__medallion img { width: 36px; height: auto; }
.nav__name { font-family: var(--serif); font-weight: 700; font-size: 1.05rem; white-space: nowrap; }
.nav__name em { font-style: normal; color: var(--gold-light); }
.nav.is-solid .nav__name em { color: var(--gold); }

.nav__links { display: flex; align-items: center; gap: 1.75rem; }
.nav__links a { text-decoration: none; font-weight: 600; font-size: .98rem; opacity: .9; }
.nav__links a:hover { opacity: 1; color: var(--gold-light); }
.nav.is-solid .nav__links a:hover { color: var(--gold-dark); }
.nav__links .nav__cta {
  padding: .55rem 1.1rem; border-radius: 999px; border: 2px solid var(--gold); opacity: 1;
}
.nav__links .nav__cta:hover { background: var(--gold); color: var(--night) !important; }

.nav__toggle { display: none; background: none; border: 0; padding: 10px; cursor: pointer; color: inherit; }
.nav__bars, .nav__bars::before, .nav__bars::after {
  display: block; width: 24px; height: 2px; background: currentColor; border-radius: 2px;
  transition: transform .3s var(--ease), opacity .3s;
}
.nav__bars { position: relative; }
.nav__bars::before, .nav__bars::after { content: ""; position: absolute; left: 0; }
.nav__bars::before { top: -7px; } .nav__bars::after { top: 7px; }
.nav__toggle[aria-expanded="true"] .nav__bars { background: transparent; }
.nav__toggle[aria-expanded="true"] .nav__bars::before { transform: translateY(7px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] .nav__bars::after { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 1080px) {
  .nav__name { font-size: .95rem; }
  .nav__toggle { display: block; }
  .nav__links {
    position: absolute; top: 100%; left: 16px; right: 16px;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper); color: var(--navy); border-radius: var(--radius);
    box-shadow: 0 20px 40px -12px rgba(1,15,30,.45); padding: .5rem;
    opacity: 0; transform: translateY(-8px); pointer-events: none;
    transition: opacity .25s, transform .25s var(--ease);
  }
  .nav__links.is-open { opacity: 1; transform: none; pointer-events: auto; }
  .nav__links a { padding: .85rem 1rem; border-radius: 10px; }
  .nav__links a:hover { background: var(--cream); color: var(--navy); }
  .nav__links .nav__cta { margin-top: .25rem; text-align: center; }
}
@media (max-width: 380px) { .nav__name { display: none; } }

/* =========================================================
   HERO — night sea, stars, sweeping beam, waves
   Every moving piece is its own element animated with transform/opacity only,
   so the GPU compositor handles it and nothing repaints per frame.
   ========================================================= */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: flex; align-items: center;
  padding: 7rem var(--gutter) 9rem;
  background:
    radial-gradient(ellipse 60% 50% at 78% 30%, rgba(232,195,106,.10), transparent 70%),
    linear-gradient(180deg, #010b17 0%, var(--navy-deep) 45%, var(--navy) 100%);
  color: var(--cream);
  overflow: hidden; isolation: isolate;
}
.hero__stars { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.hero__twinkles { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.twinkle {
  position: absolute; width: 3px; height: 3px; border-radius: 50%;
  background: #fff3cf; box-shadow: 0 0 6px 1px rgba(247,225,166,.55);
  opacity: .15; will-change: opacity;
  animation: twinkle var(--d, 3s) ease-in-out var(--delay, 0s) infinite alternate;
}
@keyframes twinkle { to { opacity: 1; } }

.hero__copy { position: relative; z-index: 3; max-width: 640px; margin-left: max(0px, calc((100vw - var(--maxw)) / 2)); }
.hero__title { font-size: clamp(2.4rem, 6vw, 4.6rem); letter-spacing: -.01em; }
.glow-word {
  display: inline-block; /* own layer: the glow flickers without repainting the headline */
  font-family: var(--script); font-style: italic; font-weight: 600; font-size: 1.12em;
  color: var(--flame);
  text-shadow: 0 0 18px rgba(247,225,166,.55), 0 0 42px rgba(232,195,106,.35);
  will-change: opacity;
  animation: flicker 5s infinite;
}
.hero__lead { margin-top: 1.4rem; font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: rgba(247,243,234,.82); max-width: 50ch; }
.hero__actions { display: flex; flex-wrap: wrap; gap: .9rem; margin-top: 2.2rem; }

/* The lighthouse box has the SVG's 200:420 ratio; the lamp sits at (50%, 18.1%). */
.lighthouse {
  position: absolute; z-index: 1;
  right: max(4vw, calc((100vw - var(--maxw)) / 2));
  bottom: 60px;
  height: min(78vh, 720px); aspect-ratio: 200 / 420;
  pointer-events: none;
}
.lighthouse__tower, .lighthouse__rays { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.lighthouse__rays { will-change: opacity; animation: rays 3s ease-in-out infinite; }
.lighthouse__beam {
  /* a soft wedge pointing left from the lamp; scaleX sweeps it around */
  position: absolute; right: 50%; top: calc(18.1% - 28vw);
  width: 170vw; height: 56vw;
  transform-origin: 100% 50%;
  background: conic-gradient(from 261deg at 100% 50%,
    rgba(247,225,166,0) 0deg, rgba(247,225,166,.9) 4deg, rgba(247,225,166,.9) 14deg, rgba(247,225,166,0) 18deg, rgba(247,225,166,0) 360deg);
  -webkit-mask-image: linear-gradient(to left, #000 0%, rgba(0,0,0,.33) 35%, transparent 100%);
          mask-image: linear-gradient(to left, #000 0%, rgba(0,0,0,.33) 35%, transparent 100%);
  will-change: transform, opacity;
  animation: sweep 9s linear infinite;
}
.lighthouse__flash {
  position: absolute; left: 50%; top: 18.1%; width: 60%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, #fff6d8 0, rgba(247,225,166,.7) 30%, rgba(232,195,106,0) 70%);
  opacity: .35; transform: translate(-50%, -50%);
  will-change: transform, opacity;
  animation: flash 9s linear infinite;
}

@keyframes sweep {
  0%   { transform: scaleX(1);    opacity: .9; }
  22%  { transform: scaleX(.08);  opacity: 1; }
  25%  { transform: scaleX(0);    opacity: 1; }
  28%  { transform: scaleX(-.08); opacity: 1; }
  50%  { transform: scaleX(-1);   opacity: .9; }
  72%  { transform: scaleX(-.1);  opacity: .15; }
  75%  { transform: scaleX(0);    opacity: 0; }
  78%  { transform: scaleX(.1);   opacity: .15; }
  100% { transform: scaleX(1);    opacity: .9; }
}
/* the flash fires when the beam points at the viewer (25%) */
@keyframes flash {
  0%, 17%, 33%, 100% { opacity: .35; transform: translate(-50%, -50%) scale(1); }
  25% { opacity: 1; transform: translate(-50%, -50%) scale(2.4); }
}
@keyframes rays { 0%, 100% { opacity: .7; } 50% { opacity: 1; } }
@keyframes flicker {
  0%, 100% { opacity: 1; } 42% { opacity: .92; } 44% { opacity: 1; } 71% { opacity: .88; } 73% { opacity: 1; }
}

/* Each layer spans two wave periods (352 units at 150 units per viewport width);
   sliding it by half its own width moves exactly one period, so the loop is seamless. */
.waves {
  position: absolute; left: 0; bottom: -1px; z-index: 2;
  width: 100%; height: 16vh; min-height: 100px; max-height: 170px;
  overflow: hidden; pointer-events: none;
}
.waves__layer {
  position: absolute; top: 0; left: -117.333%; width: 234.667%; max-width: none; height: 100%;
  will-change: transform;
  animation: wave-move 20s cubic-bezier(.55,.5,.45,.5) infinite;
}
.waves__layer:nth-child(1) { animation-delay: -2s; animation-duration: 7s; }
.waves__layer:nth-child(2) { animation-delay: -3s; animation-duration: 10s; }
.waves__layer:nth-child(3) { animation-delay: -4s; animation-duration: 13s; }
.waves__layer:nth-child(4) { animation-delay: -5s; animation-duration: 20s; }
@keyframes wave-move { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(50%, 0, 0); } }

.scroll-cue {
  position: absolute; left: 50%; bottom: 28px; z-index: 4; transform: translateX(-50%);
  width: 26px; height: 42px; border: 2px solid rgba(247,243,234,.55); border-radius: 14px;
}
.scroll-cue span {
  position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px;
  border-radius: 2px; background: var(--gold-light); animation: cue 1.8s var(--ease) infinite;
}
@keyframes cue { 0% { transform: translateY(0); opacity: 1; } 80% { transform: translateY(14px); opacity: 0; } 100% { opacity: 0; } }

@media (max-width: 860px) {
  .hero { align-items: flex-start; padding-top: 7.5rem; padding-bottom: calc(40vh + 90px); }
  .lighthouse { height: 40vh; right: 6vw; bottom: 50px; }
  .scroll-cue { display: none; }
}
@media (max-width: 860px) and (max-height: 700px) {
  /* short phones (iPhone SE class): keep the tower clear of the buttons */
  .hero { padding-bottom: calc(34vh + 84px); }
  .lighthouse { height: 34vh; }
}

/* =========================================================
   SEEK — a lantern in the dark
   The darkness is a canvas (drawn at reduced resolution, only when the light moves),
   so moving the light never repaints a full-screen CSS gradient.
   ========================================================= */
.seek { position: relative; background: var(--night); color: var(--cream); }
.seek__stage {
  position: relative; height: 100vh; height: 100svh; min-height: 560px;
  display: grid; place-items: center; overflow: hidden;
}
.seek--pointer .seek__stage { cursor: none; }
/* touch: the section is taller than the screen and the stage pins while you scroll */
.seek--scroll { height: 260vh; height: 260svh; }
.seek--scroll .seek__stage { position: sticky; top: 0; }

.seek__content { position: relative; width: 100%; height: 100%; display: grid; place-items: center; padding: 4rem var(--gutter); }
.seek__line {
  position: relative; z-index: 1; max-width: 16ch; text-align: center;
  font-size: clamp(2rem, 5.4vw, 4.2rem); font-weight: 400;
}
.seek__line em { font-family: var(--script); font-weight: 600; color: var(--flame); font-size: 1.12em; }
.seek__words { list-style: none; margin: 0; padding: 0; position: absolute; inset: 0; }
.seek__words li {
  position: absolute; left: var(--x); top: var(--y); transform: translate(-50%, -50%);
  font-family: var(--script); font-style: italic; font-weight: 600;
  font-size: clamp(1.1rem, 2.2vw, 1.8rem); color: var(--gold-light); white-space: nowrap;
}
.seek__dark { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; pointer-events: none; }
.seek__lantern {
  position: absolute; left: 0; top: 0; z-index: 3; width: 46px; height: auto; pointer-events: none;
  transform-origin: 50% 6%; transform: translate(-200px, -200px);
  filter: drop-shadow(0 0 14px rgba(255,211,107,.7));
  will-change: transform;
}
.seek__flame { transform-box: fill-box; transform-origin: 50% 100%; animation: flame .18s ease-in-out infinite alternate; }
@keyframes flame { from { transform: scale(1, 1); } to { transform: scale(.94, 1.06); } }

.seek__hint {
  position: absolute; bottom: 2.25rem; left: 0; right: 0; z-index: 4; text-align: center; padding: 0 var(--gutter);
  font-size: .8rem; letter-spacing: .2em; text-transform: uppercase; color: rgba(232,195,106,.8);
  transition: opacity .6s; display: none;
}
.seek--pointer .seek__hint, .seek--scroll .seek__hint { display: block; }
.seek__hint > span { display: none; }
.seek--pointer .seek__hint-pointer, .seek--scroll .seek__hint-scroll { display: inline; }
.seek--scroll .seek__hint-scroll::after { content: " ↓"; }
.seek.is-found .seek__hint { opacity: 0; }

@media (max-width: 600px) {
  .seek__words li:nth-child(n+7) { display: none; }
  .seek__words li { left: clamp(20%, var(--x), 80%); } /* keep edge words fully on screen */
  .seek__words li:nth-child(6) { left: 50%; top: 84%; }
  .seek__lantern { width: 40px; }
}

/* =========================================================
   MISSION — dawn
   ========================================================= */
.mission {
  position: relative; overflow: hidden;
  padding: clamp(7rem, 16vw, 12rem) 0 clamp(5rem, 10vw, 8rem);
  background: linear-gradient(180deg,
    var(--night) 0%, #0e2a4a 10%, #6b5a5a 20%, #d9a867 27%, #f3dfb4 34%, var(--cream) 44%, var(--cream) 100%);
}
.mission__sun {
  position: absolute; left: 50%; top: 22%; width: min(900px, 140vw); aspect-ratio: 1;
  transform: translate(-50%, calc(-50% + var(--sun, 120px)));
  background: radial-gradient(circle, rgba(255,236,190,.95) 0, rgba(247,225,166,.55) 12%, rgba(247,225,166,0) 45%);
  pointer-events: none; will-change: transform;
}
.mission .container { position: relative; }
.mission__lead { margin-top: 1.5rem; font-size: clamp(1.1rem, 1.8vw, 1.3rem); max-width: 60ch; color: var(--ink); }
.pillars {
  list-style: none; padding: 0; margin: 3.5rem 0 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.25rem;
}
.pillar {
  background: rgba(251,248,241,.8); border: 1px solid rgba(2,42,76,.08); border-radius: var(--radius);
  padding: 1.6rem; color: var(--navy);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.pillar:hover { transform: translateY(-4px); box-shadow: 0 18px 40px -20px rgba(2,42,76,.35); }
.pillar svg { width: 44px; height: 44px; margin-bottom: 1rem; }
.pillar h3 { font-size: 1.12rem; margin-bottom: .5rem; }
.pillar p { color: var(--muted); font-size: 1rem; }
.pullquote {
  margin: 4rem auto 0; max-width: 860px; text-align: center; position: relative;
  font-family: var(--script); font-style: italic; font-weight: 500;
  font-size: clamp(1.5rem, 3vw, 2.2rem); line-height: 1.35; color: var(--navy);
}
.pullquote::before {
  content: ""; display: block; width: 64px; height: 2px; margin: 0 auto 1.5rem;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

/* =========================================================
   AUTHOR — arched portrait + lantern, signature writes itself
   ========================================================= */
.author {
  position: relative; overflow: hidden; isolation: isolate;
  padding: clamp(7rem, 12vw, 10rem) 0 clamp(7rem, 12vw, 10rem);
  background:
    radial-gradient(ellipse 45% 55% at 24% 48%, rgba(232,195,106,.16), transparent 70%),
    linear-gradient(180deg, var(--navy) 0%, var(--navy-deep) 100%);
  color: var(--cream);
}
.author__wave { position: absolute; left: 0; width: 100%; height: clamp(44px, 6vw, 90px); pointer-events: none; }
.author__wave--top { top: -1px; }
.author__wave--bottom { bottom: -1px; }

.author__grid {
  position: relative;
  display: grid; grid-template-columns: minmax(280px, 5fr) 7fr;
  gap: clamp(2.5rem, 6vw, 5.5rem); align-items: start;
}

.author__portrait { position: sticky; top: 110px; margin: 0; justify-self: center; width: 100%; max-width: 420px; }
.author__portrait::before { /* lantern glow behind the window */
  content: ""; position: absolute; inset: -18% -22%; z-index: -1;
  background: radial-gradient(closest-side, rgba(232,195,106,.28), transparent);
}
.author__arch {
  position: relative; aspect-ratio: 4 / 5;
  border-radius: 50% 50% 16px 16px / 40% 40% 16px 16px; /* round-top window, like the lighthouse's */
  overflow: hidden; background: #595c5b;
  box-shadow: 0 0 0 6px var(--navy-deep), 0 0 0 8px rgba(195,140,35,.9), 0 30px 60px -20px rgba(0,0,0,.6);
}
.author__arch img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; }
.author__lantern {
  position: absolute; right: -6%; bottom: -5%; width: clamp(64px, 18%, 84px); height: auto;
  filter: drop-shadow(0 0 16px rgba(255,211,107,.65));
  transform-origin: 50% 6%; animation: lantern-sway 5s ease-in-out infinite;
}
@keyframes lantern-sway { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }

.author__body { min-width: 0; }
.author__roles {
  list-style: none; margin: 1.1rem 0 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: .5rem;
  font-size: .74rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-light);
}
.author__roles li {
  padding: .35rem .75rem; border-radius: 999px;
  border: 1px solid rgba(232,195,106,.45); background: rgba(232,195,106,.07);
}

.author__bio { margin-top: 1.8rem; }
.author__bio p, .author__more-inner p { color: rgba(247,243,234,.84); font-size: 1.08rem; max-width: 62ch; }
.author__bio p + p, .author__more-inner p { margin-top: 1.1rem; }
.author__bio .author__lead { font-family: var(--serif); font-size: clamp(1.15rem, 1.8vw, 1.35rem); line-height: 1.55; color: var(--cream); }

/* Expandable rest-of-bio (grid-rows 0fr → 1fr). Only collapses when JS is present. */
.author__more { display: grid; grid-template-rows: 1fr; }
.author__more-inner { min-height: 0; overflow: hidden; }
.js .author__more { grid-template-rows: 0fr; transition: grid-template-rows .7s var(--ease); }
.js .author__more.is-open { grid-template-rows: 1fr; }
.js .author__more:not(.is-open) .author__more-inner { visibility: hidden; transition: visibility 0s .7s; }

.author__toggle {
  display: none; align-items: center; gap: .5rem; margin-top: 1.4rem;
  background: none; border: 0; padding: .5rem 0; cursor: pointer;
  font: 700 1rem var(--sans); color: var(--gold-light);
  border-bottom: 2px solid rgba(232,195,106,.4);
}
.js .author__toggle { display: inline-flex; }
.author__toggle:hover { color: var(--flame); border-bottom-color: var(--flame); }
.author__toggle svg { width: 20px; height: 20px; transition: transform .4s var(--ease); }
.author__toggle[aria-expanded="true"] svg { transform: rotate(180deg); }

.author__creed { margin: 2.6rem 0 0; padding-top: 2rem; border-top: 1px solid rgba(232,195,106,.25); max-width: 34em; }
.author__creed p {
  font-family: var(--script); font-style: italic; font-weight: 600;
  font-size: clamp(1.45rem, 2.6vw, 2rem); line-height: 1.3; color: var(--flame);
}
.author__creed footer { margin-top: 1.4rem; }
.author__sign { display: block; width: min(380px, 86%); padding: 4px 0; }
.author__sign img { width: 100%; height: auto; }
/* signature "writes" left to right once it scrolls into view */
.js .sign-reveal { clip-path: inset(0 100% 0 0); transition: clip-path 2.6s cubic-bezier(.55,.05,.35,1) .35s; }
.js .sign-reveal.is-visible { clip-path: inset(0 0 0 0); }

@media (max-width: 900px) {
  .author { text-align: left; }
  .author__grid { grid-template-columns: 1fr; gap: 3rem; }
  .author__portrait { position: relative; top: auto; max-width: min(78vw, 360px); }
  .author__body { max-width: 640px; margin: 0 auto; width: 100%; }
}

/* =========================================================
   BOOKS — CSS 3D covers
   (technique from scastiel's 3D book CSS generator)
   ========================================================= */
.books { background: var(--cream); padding: clamp(4rem, 9vw, 7rem) 0; }
.shelf {
  margin-top: 3.5rem; display: grid; gap: 3rem 2rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.book-card { display: flex; flex-direction: column; align-items: center; text-align: center; }
.book3d {
  --w: 200px; --h: 300px; --t: 34px;
  position: relative; width: var(--w); height: var(--h);
  transform-style: preserve-3d; transform: perspective(1200px) rotateY(-32deg);
  transition: transform .8s var(--ease);
  margin: 1rem 0 2.2rem;
}
.book3d:hover, .book3d:focus { transform: perspective(1200px) rotateY(0deg) translateY(-10px); }
.book3d::before { /* page block */
  content: ""; position: absolute; top: 3px; left: 0;
  width: var(--t); height: calc(var(--h) - 6px);
  transform: translateX(calc(var(--w) - var(--t) / 2 - 3px)) rotateY(90deg) translateX(calc(var(--t) / 2));
  background: linear-gradient(90deg, #fff 0%, #f1ece0 5%, #fff 10%, #f1ece0 15%, #fff 20%, #f1ece0 25%, #fff 30%, #f1ece0 35%, #fff 40%, #f1ece0 45%, #fff 50%, #f1ece0 55%, #fff 60%, #f1ece0 65%, #fff 70%, #f1ece0 75%, #fff 80%, #f1ece0 85%, #fff 90%, #f1ece0 95%, #fff 100%);
}
.book3d::after { /* back cover */
  content: ""; position: absolute; inset: 0; transform: translateZ(calc(var(--t) / -2));
  background: var(--back, var(--navy-deep)); border-radius: 0 3px 3px 0;
  box-shadow: -14px 10px 40px 4px rgba(2,26,49,.35);
}
.book3d__cover {
  position: absolute; inset: 0; transform: translateZ(calc(var(--t) / 2));
  border-radius: 0 3px 3px 0; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: 1.4rem 1rem 1rem; text-align: center;
  box-shadow: inset 4px 0 6px -2px rgba(0,0,0,.35), inset -1px 0 0 rgba(255,255,255,.15);
}
.book3d__cover::after { /* spine crease */
  content: ""; position: absolute; top: 0; bottom: 0; left: 10px; width: 2px;
  background: rgba(0,0,0,.18); box-shadow: 1px 0 0 rgba(255,255,255,.12);
}
.cover__kicker { font-size: .66rem; letter-spacing: .2em; text-transform: uppercase; font-weight: 700; }
.cover__title { font-family: var(--serif); font-weight: 700; font-size: 1.35rem; line-height: 1.15; }
.cover__art { width: 70%; max-height: 120px; }
.cover__imprint { font-size: .62rem; letter-spacing: .14em; text-transform: uppercase; opacity: .75; }

.cover--lantern { background: radial-gradient(circle at 50% 62%, #2b4e7a 0, var(--navy) 45%, var(--night) 100%); color: var(--flame); }
.cover--keeper  { background: linear-gradient(160deg, var(--navy-2), var(--navy-deep)); color: var(--cream); }
.cover--keeper .cover__title { color: var(--gold-light); }
.cover--harbor  { background: repeating-linear-gradient(0deg, transparent 0 22px, rgba(2,42,76,.05) 22px 23px), var(--paper); color: var(--navy); }
.book-card:nth-child(3) .book3d { --back: #e7dfcc; }

.book-card__meta h3 { font-size: 1.3rem; color: var(--navy); margin: .5rem 0; }
.book-card__meta p { color: var(--muted); max-width: 32ch; margin: 0 auto; }
.tag { display: inline-block; font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-dark); }
.status {
  display: inline-block; margin-top: 1rem; padding: .35rem .8rem; border-radius: 999px;
  font-size: .8rem; font-weight: 700; color: var(--navy); background: rgba(195,140,35,.15);
}

/* =========================================================
   WORD — scripture that lights up on scroll
   ========================================================= */
.word {
  background: radial-gradient(ellipse at 50% 120%, rgba(195,140,35,.18), transparent 60%), var(--navy);
  color: var(--cream); padding: clamp(6rem, 14vw, 10rem) var(--gutter);
}
.word__verse { margin: 0 auto; max-width: 980px; text-align: center; }
.word__text { font-family: var(--serif); font-size: clamp(1.8rem, 4.6vw, 3.6rem); line-height: 1.3; }
.word__text .w {
  color: rgba(247,243,234,.16); transition: color .5s, text-shadow .5s;
}
.word__text .w.is-lit { color: var(--flame); text-shadow: 0 0 24px rgba(232,195,106,.45); }
.word cite {
  display: block; margin-top: 2rem; font-style: normal; font-weight: 700;
  letter-spacing: .22em; text-transform: uppercase; font-size: .85rem; color: var(--gold-light);
}

/* =========================================================
   GOODS — tilt cards
   ========================================================= */
.goods { background: var(--paper); padding: clamp(4rem, 9vw, 7rem) 0; }
.goods__grid {
  margin-top: 3rem; display: grid; gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}
.good {
  --rx: 0deg; --ry: 0deg; --gx: 50%; --gy: 50%;
  position: relative; overflow: hidden; display: block; text-decoration: none;
  background: #fff; border-radius: var(--radius); padding: 1.25rem 1.25rem 1.6rem;
  border: 1px solid rgba(2,42,76,.08);
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform .5s var(--ease), box-shadow .5s var(--ease);
  box-shadow: 0 10px 30px -18px rgba(2,42,76,.3);
}
.good.is-tilting { transition: transform .08s linear, box-shadow .3s; box-shadow: 0 30px 50px -24px rgba(2,42,76,.45); }
.good h3 { font-size: 1.15rem; color: var(--navy); margin: 1.2rem 0 .4rem; }
.good p { color: var(--muted); font-size: .98rem; }
.good__glare {
  position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(circle at var(--gx) var(--gy), rgba(255,244,214,.55), transparent 55%);
  mix-blend-mode: soft-light;
}
.good.is-tilting .good__glare { opacity: 1; }
.good__art {
  height: 200px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(160deg, var(--cream), #efe6d2);
}
.poster {
  width: 118px; height: 160px; background: var(--navy); border: 6px solid #fff;
  outline: 2px solid #d9cdb2; box-shadow: 0 10px 18px -8px rgba(0,0,0,.4);
  display: grid; place-items: center; text-align: center;
  font-family: var(--serif); font-weight: 700; color: var(--cream); font-size: 1rem; line-height: 1.1;
  background-image: radial-gradient(circle at 50% 30%, rgba(232,195,106,.35), transparent 60%);
}
.poster em { font-family: var(--script); color: var(--gold-light); font-size: 1.5em; }
.bookmark {
  position: relative; width: 52px; height: 170px; background: var(--gold); border-radius: 3px 3px 0 0;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 90%, 0 100%);
  display: grid; place-items: center; text-align: center;
  font-family: var(--script); font-style: italic; font-weight: 600; color: var(--night); font-size: .95rem; line-height: 1.1;
  box-shadow: 0 10px 18px -8px rgba(0,0,0,.4);
}
.notecard {
  width: 150px; height: 110px; background: #fff; border-radius: 4px; transform: rotate(-4deg);
  display: grid; place-items: center; text-align: center;
  font-family: var(--script); font-style: italic; font-weight: 600; color: var(--navy); font-size: 1.4rem; line-height: 1;
  box-shadow: 6px 6px 0 -1px var(--cream), 6px 6px 0 0 #d9cdb2, 0 12px 20px -10px rgba(0,0,0,.35);
  border-top: 5px solid var(--gold);
}
.journal {
  position: relative; width: 120px; height: 160px; border-radius: 4px 10px 10px 4px;
  background: linear-gradient(90deg, #011a31 0 10px, var(--navy) 10px);
  display: grid; place-items: center; color: var(--gold-light);
  font-family: var(--serif); font-size: .9rem; letter-spacing: .08em;
  box-shadow: 0 12px 20px -10px rgba(0,0,0,.5);
}
.journal::after { /* elastic band */
  content: ""; position: absolute; top: 0; bottom: 0; right: 18px; width: 5px; background: var(--gold);
}

/* =========================================================
   LETTER — sky lanterns
   ========================================================= */
.letter {
  position: relative; overflow: hidden; isolation: isolate;
  padding: clamp(6rem, 12vw, 9rem) 0;
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-deep) 60%, var(--night) 100%);
  color: var(--cream); text-align: center;
}
.letter__inner { display: flex; flex-direction: column; align-items: center; }
.letter__lead { margin-top: 1.2rem; max-width: 52ch; color: rgba(247,243,234,.8); font-size: 1.1rem; }
.letter__form {
  margin-top: 2.2rem; width: 100%; max-width: 640px;
  display: grid; grid-template-columns: 1fr 1.4fr auto; gap: .6rem;
  padding: .5rem; border-radius: 999px;
  background: rgba(247,243,234,.08); border: 1px solid rgba(247,243,234,.18);
}
.letter__form input {
  min-width: 0; border: 0; background: transparent; color: var(--cream);
  font: 400 1rem var(--sans); padding: .8rem 1rem; border-radius: 999px;
}
.letter__form input::placeholder { color: rgba(247,243,234,.55); }
.letter__form input:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 0; background: rgba(247,243,234,.06); }
.letter__form input[aria-invalid="true"] { box-shadow: inset 0 0 0 2px #e98b6d; }
.letter__status { min-height: 1.6em; margin-top: 1rem; color: var(--gold-light); font-weight: 600; }
.letter__fine { font-size: .85rem; color: rgba(247,243,234,.5); }
@media (max-width: 640px) {
  .letter__form { grid-template-columns: 1fr; border-radius: 20px; }
  .letter__form .btn { width: 100%; }
}

.letter__sky { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.sky-lantern {
  position: absolute; bottom: -80px; width: var(--s, 22px); aspect-ratio: 3 / 4;
  border-radius: 40% 40% 18% 18% / 30% 30% 12% 12%;
  background: radial-gradient(ellipse at 50% 80%, #fff3c9 0, #f6c55f 35%, #d9822b 80%);
  box-shadow: 0 0 18px 4px rgba(246,197,95,.45), 0 0 60px 10px rgba(246,197,95,.15);
  opacity: 0;
  animation: rise var(--d, 18s) linear var(--delay, 0s) infinite;
}
.sky-lantern--released {
  position: fixed; z-index: 60; width: 40px; animation: release 5.5s cubic-bezier(.35,.1,.5,1) forwards;
}
@keyframes rise {
  0% { transform: translate(0, 0) rotate(-3deg); opacity: 0; }
  8% { opacity: var(--o, .8); }
  50% { transform: translate(var(--drift, 20px), -60vh) rotate(3deg); }
  90% { opacity: var(--o, .8); }
  100% { transform: translate(calc(var(--drift, 20px) * -1), -120vh) rotate(-2deg); opacity: 0; }
}
@keyframes release {
  0% { transform: translate(-50%, 0) scale(1); opacity: 0; }
  10% { opacity: 1; }
  100% { transform: translate(calc(-50% + 60px), -110vh) scale(.35); opacity: 0; }
}

/* =========================================================
   FOOTER
   ========================================================= */
.footer { background: var(--cream); padding: 3.5rem 0; border-top: 4px solid var(--gold); }
.footer__inner { display: flex; align-items: center; gap: 2.5rem; flex-wrap: wrap; }
.footer__logo { width: 170px; height: auto; }
.footer__text { flex: 1; min-width: 240px; }
.footer__tag { font-family: var(--script); font-style: italic; font-weight: 600; font-size: 1.6rem; color: var(--navy); }
.footer__links { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; margin: 1rem 0; }
.footer__links a { color: var(--navy); font-weight: 600; text-decoration: none; }
.footer__links a:hover { color: var(--gold-dark); text-decoration: underline; }
.footer__copy { color: var(--muted); font-size: .9rem; }
@media (max-width: 600px) { .footer__inner { flex-direction: column; text-align: center; } .footer__links { justify-content: center; } }

/* =========================================================
   Scroll reveal
   ========================================================= */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.js .reveal.is-visible { opacity: 1; transform: none; }
.pillars .reveal:nth-child(2), .shelf .reveal:nth-child(2), .goods__grid .reveal:nth-child(2) { transition-delay: .1s; }
.pillars .reveal:nth-child(3), .shelf .reveal:nth-child(3), .goods__grid .reveal:nth-child(3) { transition-delay: .2s; }
.pillars .reveal:nth-child(4), .goods__grid .reveal:nth-child(4) { transition-delay: .3s; }

/* Off-screen sections stop animating (class set by an IntersectionObserver) */
[data-anim].is-offscreen, [data-anim].is-offscreen * { animation-play-state: paused !important; }

/* =========================================================
   Reduced motion: keep the light, drop the movement
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .lighthouse__beam { transform: scaleX(1); opacity: .6; }
  .seek__stage { cursor: auto; }
  .seek__stage::after { content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; background: radial-gradient(ellipse at center, transparent 30%, rgba(1,15,30,.7) 100%); }
  .seek__dark, .seek__lantern, .seek__hint { display: none !important; }
  .twinkle { opacity: .6; }
  .sky-lantern { animation: none; opacity: .6; bottom: var(--rest, 20%); }
  .js .reveal { opacity: 1; transform: none; }
  .js .sign-reveal { clip-path: none; }
  .word__text .w { color: var(--flame); }
}
