/* Whaleland Inc. — site styles */

/* ---------- Tokens ---------- */
:root {
  --cream: #F2E9DB;
  --ink: #1D1A17;
  --stone: #504B47;
  --mist: #A8A8A8;
  --black: #000;
  --serif: ui-serif, "New York", "Iowan Old Style", Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, "Noto Serif", "Droid Serif", serif;
  --sans: system-ui, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --edge: clamp(1rem, 4.6vw, 4.5rem);
  --wide: 75rem;
  --gutter: clamp(16px, 1.8vw, 24px);
  color-scheme: light;

  /* The header, and the opening that builds it (site.js measures the real numbers) */
  --hh: 56px;                 /* header height */
  --lw: 124px;                /* lockup width */
  --i1: 40px; --i1a: 38px; --i1b: 100px;            /* 「Inc.」 becomes the header's line */
  --l-x: 50%; --l-s: 0.05;
  --wo0: 18px; --wo1: 38px; --wi0: 36px; --wi1: 66px; --bg0: 16px; --bg1: 50px;   /* 「Whaleland」 into the header's wordmark */
  --fold0: 8px; --fold1: 260px; --end0: cover 40%; --end1: cover 60%;                     /* the whale fall: the hero's arcs into their hole, the header's out of its own */
  --n1-0: 600px; --n1-1: 640px; --n2-0: 640px; --n2-1: 680px; --n3-0: 656px; --n3-1: 696px;   /* narrow screens: facts hand over */
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--cream); color: var(--ink); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.0625rem, 0.99rem + 0.36vw, 1.1875rem);
  line-height: 1.6;
  font-kerning: normal;
  font-variant-numeric: oldstyle-nums proportional-nums;
  text-rendering: optimizeLegibility;
  hanging-punctuation: first;
}
h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; }
h1, h2, h3 { font-weight: 400; text-wrap: balance; }
p, li, figcaption { text-wrap: pretty; }
img, svg { display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; border-radius: 2px; }
main:focus { outline: none; }
::selection { background: var(--stone); color: var(--cream); }
.nowrap { white-space: nowrap; }
.wrap { width: min(100% - 2 * var(--edge), var(--wide)); margin-inline: auto; }

.skip {
  position: absolute; left: var(--edge); top: 0.75rem; z-index: 30;
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 1rem;
  background: var(--cream); color: var(--ink);
  border: 1px solid var(--ink); border-radius: 4px;
  transform: translateY(calc(-100% - 1rem));
}
.skip:focus { transform: none; }

/* ---------- Header: the master lockup, from its two parts in their exact places (the kit's lockup, viewBox 143 467 732 85) ---------- */
.site-head { position: relative; }
.head-bg, .head-line { display: none; }
.head-row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0.25rem 0.75rem;
  min-height: calc(var(--hh) + 1rem);
}
.brand { display: inline-flex; align-items: center; min-height: 44px; border-radius: 2px; }
.lockup { position: relative; display: block; width: var(--lw); height: calc(var(--lw) * 85 / 732); }
.hm-place {
  position: absolute;
  left: calc(var(--lw) * 1.632 / 732);
  top: calc(var(--lw) * 4.549 / 732);
  width: calc(var(--lw) * 115.63 / 732);
}
.hmark { display: block; width: 100%; height: auto; overflow: visible; }
.hword {
  position: absolute;
  left: calc(var(--lw) * 144 / 732);
  top: calc(var(--lw) / 732);
  width: calc(var(--lw) * 587 / 732);
  height: auto;
  transform-origin: 0 50%;
}
.nav { margin-inline-start: auto; }
.nav ul { display: flex; flex-wrap: wrap; justify-content: flex-end; list-style: none; padding: 0; gap: 0 clamp(0rem, 1.4vw, 1.25rem); }
.nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding-inline: 0.4rem;
  font-size: clamp(1rem, 0.95rem + 0.2vw, 1.0625rem); text-decoration: none;
}
.nav a:hover { text-decoration: underline; text-decoration-thickness: 1px; }

/* ---------- Opening: name, headline, intro, the mark over its shadow on the waterline, the facts ---------- */
.hero {
  /* The opening fills the first view on its own; its rhythm follows the window's height */
  --top: clamp(1.25rem, 6vh, 4rem);
  --mark-h: clamp(11rem, 46vh, 25rem);
  --breath: clamp(2rem, 6vh, 5rem);
  overflow-x: clip;
  display: flex; flex-direction: column;
  min-height: calc(100vh - var(--hh) - 1rem);           /* plain header: it sits above the opening */
  padding-top: var(--top);
}
@supports (height: 100svh) {
  .hero {
    --top: clamp(1.25rem, 6svh, 4rem);
    --mark-h: clamp(11rem, 46svh, 25rem);
    --breath: clamp(2rem, 6svh, 5rem);
    min-height: calc(100svh - var(--hh) - 1rem);
  }
}
.hero-grid {
  flex: 1 0 auto;
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-template-rows: auto auto 1fr auto auto;
  column-gap: var(--gutter);
}
.kicker { grid-column: 1 / -1; grid-row: 1; margin-bottom: clamp(0.75rem, 2.4vh, 1.75rem); font-size: 1.0625rem; line-height: 1.5; letter-spacing: 0.01em; }
.k-word { display: inline-block; }
/* 「Inc.」 and the bar it flattens into: the bar sits on the letters' own box, at their x-height middle */
.k-inc { position: relative; display: inline-block; }
.k-inc-txt { display: inline-block; transform-origin: 50% 60%; }
.inc-bar { position: absolute; left: 0; right: 0; top: 60%; height: 1px; margin-top: -0.5px; background: var(--mist); opacity: 0; }
.hero h1 { grid-column: 1 / -1; grid-row: 2; font-size: clamp(2.5rem, 1.2rem + 6.4vw, 4.75rem); font-size: min(clamp(2.5rem, 1.2rem + 6.4vw, 4.75rem), 10vh); line-height: 1.02; letter-spacing: -0.015em; }
.lead {
  grid-column: 1 / span 5; grid-row: 3; align-self: end;
  margin-top: var(--breath);
  padding-bottom: clamp(2rem, 4vw, 3.5rem);
  max-width: 30em;
  font-size: clamp(1.1875rem, 1rem + 0.75vw, 1.5rem); line-height: 1.45;
}
.hero-mark {
  grid-column: 7 / -1; grid-row: 3; align-self: end; justify-self: end;
  width: min(100%, calc(var(--mark-h) * 1.5489));       /* sized by the window's height too, so a short window breathes */
  margin-top: var(--breath);
  position: relative; z-index: 1;
}
/* The SVG's lower edge is the shadow's centre line: the mark rests on the waterline. */
.mark { display: block; width: 100%; height: auto; overflow: visible; }
.waterline { grid-column: 1 / -1; grid-row: 4; margin-inline: calc(50% - 50vw); border-top: 1px solid var(--black); }
.ticks {
  position: relative; height: 9px;
  background-image: linear-gradient(to right, var(--mist) 1px, transparent 1px), linear-gradient(to right, var(--mist) 1px, transparent 1px);
  background-size: calc((100% + var(--gutter)) / 12) 5px, calc((100% + var(--gutter)) / 4) 9px;
  background-repeat: repeat-x;
}
.ticks::after { content: ""; position: absolute; right: 0; top: 0; width: 1px; height: 9px; background: var(--mist); }
.facts {
  grid-column: 1 / -1; grid-row: 5;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9em), 1fr)); column-gap: var(--gutter); row-gap: 1.25rem;
  padding-top: clamp(0.875rem, 2.2vh, 1.5rem); padding-bottom: clamp(1.5rem, 6vh, 4.5rem);
}
.facts dt { font-style: italic; font-size: 0.9375rem; line-height: 1.4; color: var(--stone); }
.facts dd { font-size: 1.0625rem; line-height: 1.45; overflow-wrap: anywhere; }
.facts a { position: relative; }
.facts a::after { content: ""; position: absolute; left: -6px; right: -6px; top: 50%; height: 44px; translate: 0 -50%; }

/* ---------- Sections: side heads, as on a printed page ---------- */
.section { padding-top: clamp(4rem, 10vw, 8.5rem); overflow-x: hidden; overflow-x: clip; }
.section-grid { display: grid; gap: 1.25rem 4rem; }
h2 { font-size: clamp(1.875rem, 1.35rem + 1.7vw, 2.625rem); line-height: 1.1; letter-spacing: -0.01em; }
h3 { font-size: clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem); font-style: italic; line-height: 1.25; }
.body { display: grid; gap: 1.5rem; max-width: 46rem; align-content: start; }
.body > p { max-width: 34em; }
.section-lead { font-size: clamp(1.1875rem, 1rem + 0.75vw, 1.5rem); line-height: 1.45; max-width: 28em; }

/* Two areas, and the bridge between them */
.areas { position: relative; display: grid; gap: 2rem 3rem; }
.area { position: relative; display: grid; gap: 0.5rem; align-content: start; }
.answer { display: none; position: absolute; background: var(--stone); }
.bridge { position: relative; }
.bridge-join { display: none; }

/* Zel.Q steps: a real sequence, so numbered */
.steps { list-style: none; padding: 0; counter-reset: step; display: grid; gap: 0.5rem; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 2rem minmax(0, 1fr); align-items: baseline; }
.steps li::before { content: counter(step); font-style: italic; font-size: 1.3em; line-height: 1; color: var(--stone); }

/* The example as a plate: the notification, with what it watches and where its link goes */
.plate { display: grid; gap: 1.25rem; justify-items: center; padding-top: clamp(1.5rem, 4vw, 3rem); }
.scene { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; }
.notice {
  position: relative; z-index: 1;
  width: min(86%, 24rem);
  display: grid; gap: 0.5rem;
  padding: 0.875rem 1rem 1rem;
  font-family: var(--sans); font-variant-numeric: normal; line-height: 1.35;
  background: var(--cream); border: 1px solid var(--ink); border-radius: 14px;
}
.notice-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.125rem 1rem; font-size: 0.8125rem; color: var(--stone); }
.notice-app { font-weight: 600; color: var(--ink); }
.notice-title { font-size: 1rem; font-weight: 600; }
.notice-open {
  justify-self: start; display: inline-flex; align-items: center; min-height: 2.25rem; padding-inline: 0.875rem;
  border-radius: 8px; background: var(--ink); color: var(--cream); font-size: 0.875rem; font-weight: 600;
}
.callout { position: relative; font-style: italic; font-size: 1rem; line-height: 1.4; color: var(--stone); max-width: 16em; }
.callout::after { content: ""; position: absolute; background: var(--stone); }
.callout::before { content: ""; position: absolute; width: 5px; height: 5px; border-radius: 50%; background: var(--stone); }
.callout-watch::before { right: calc(3rem - 2px); bottom: -2.5px; }
.callout-link::before { left: calc(3.25rem - 2px); top: -2.5px; }
.callout-watch { justify-self: end; text-align: right; padding-bottom: 1.5rem; }
.callout-watch::after { right: 3rem; bottom: 0; width: 1px; height: 1.125rem; }
.callout-link { justify-self: start; padding-top: 1.5rem; }
.callout-link::after { left: 3.25rem; top: 0; width: 1px; height: 1.125rem; }
.plate-caption { font-style: italic; font-size: 0.9375rem; color: var(--stone); text-align: center; }

/* Contact: a little more room above, scaled by the window's height */
#contact { padding-top: clamp(5rem, 13vh, 10rem); }
/* Contact */
.contact-line { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; }
.address {
  display: inline-flex; align-items: center; min-height: 44px;
  font-size: clamp(1.5rem, 0.8rem + 4vw, 3.25rem); line-height: 1.1; letter-spacing: -0.01em;
  text-decoration-thickness: 1px; text-underline-offset: 0.14em;
  overflow-wrap: anywhere;
}
.copy {
  display: inline-grid; align-items: center; justify-items: center;
  min-height: 44px; min-width: 44px; padding: 0 1.125rem;
  font: inherit; font-size: 1rem; color: var(--ink);
  background: transparent; border: 1px solid var(--ink); border-radius: 999px;
  cursor: pointer;
}
.copy:hover, .copy[data-state="copied"] { background: var(--ink); color: var(--cream); }
.copy > span { grid-area: 1 / 1; }
.copy-done, .copy[data-state="copied"] .copy-idle { visibility: hidden; }
.copy[data-state="copied"] .copy-done { visibility: visible; }
.copy-status { font-size: 0.9375rem; font-style: italic; color: var(--stone); min-height: 1.6em; }

/* Footer: a second waterline, where the mark comes back up beside the email */
.foot {
  --ew: clamp(10rem, 40vw, 19rem);
  position: relative;
  /* The mark's own space above the line, with room to breathe (decision 234: the scroll room comes from above, not from an empty footer) */
  margin-top: calc(var(--ew) * 0.6456 + clamp(2.5rem, 9vh, 6.5rem));
  border-top: 1px solid var(--black);
}
.end-mark {
  position: absolute; left: 50%; top: calc(-0.5px - var(--ew) * 0.645627);
  width: var(--ew); margin-left: calc(var(--ew) / -2); aspect-ratio: 594 / 399;
}
/* The copyright alone, under the mark: centred on the ellipse (cx 1504), which sits one unit left of the box's centre (1505) */
.foot-inner {
  padding-block: calc(var(--ew) * 12.843 / 594 + 1.5rem) clamp(2.5rem, 5vh, 4rem);   /* the copyright as the mark's caption, 1.5rem under its shadow; a modest margin below */
  text-align: center; font-size: 0.9375rem; color: var(--stone);
}
.foot-inner p { padding-right: calc(var(--ew) * 2 / 594); }

/* ---------- Motion: only with the script and when motion is welcome; otherwise the page rests, with a plain header ---------- */
@media (prefers-reduced-motion: no-preference) {
  html.js { scroll-padding-top: var(--hh-real, var(--hh)); }   /* in-page jumps and focus land below the fixed header, at its real height */

  /* The first screen is the opening alone. The header is a fixed layer that gathers itself from the opening's parts. */
  html.js .site-head { position: fixed; top: 0; left: 0; right: 0; z-index: 20; overflow: hidden; padding-block: 2px; }
  html.js .site-head a:focus-visible { outline-offset: -3px; }   /* inside the link, so the header never cuts a ring */
  html.js .head-row { min-height: var(--hh); }
  html.js .head-bg { display: block; position: absolute; inset: 0; z-index: -1; background: var(--cream); }
  html.js .head-line { display: block; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--mist); transform-origin: var(--l-x) 50%; }
  html.js .hero { min-height: 100vh; padding-top: calc(var(--hh) + var(--top)); }   /* the header starts empty, over the opening */
  @supports (height: 100svh) { html.js .hero { min-height: 100svh; } }

  /* Every part follows the scroll position, so scrolling back plays it backwards.
     --anim the keyframes, --tl the timeline (the page's scroll, or the element whose place in the view drives it), --r0/--r1 the range. */
  /* Everything enters the header through its lower edge, as the whale does: */
  .k-inc-txt { --anim: inc-letters; --tl: scroll(root block); --r0: 0px; --r1: var(--i1); }   /* 「Inc.」 greys, then flattens in place … */
  .inc-bar { --anim: inc-bar; --tl: scroll(root block); --r0: 0px; --r1: var(--i1); }         /* … into a bar on its own box … */
  .head-line { --anim: line-born; --tl: scroll(root block); --r0: var(--i1a); --r1: var(--i1b); }   /* … which the header's line takes over at the edge, and stretches */
  .k-word { --anim: word-out; --tl: scroll(root block); --r0: var(--wo0); --r1: var(--wo1); }  /* 「Whaleland」 goes into the edge … */
  .hword { --anim: word-in; --tl: scroll(root block); --r0: var(--wi0); --r1: var(--wi1); }    /* … and the wordmark comes up in the header */
  .head-bg { --anim: head-bg; --tl: scroll(root block); --r0: var(--bg0); --r1: var(--bg1); }

  .fall, .hm-rise, .hm-open, .hole-close, .f1, .f2, .f3, .f4, .n1, .n2, .n3 { --tl: scroll(root block); --r0: var(--fold0); --r1: var(--fold1); }
  .fall { --anim: whale-down; }        /* the whale goes down into its own shadow … */
  .hm-open { --anim: hole-open; }      /* … a hole opens beside the name … */
  .hm-rise { --anim: whale-up; }       /* … and it comes up there, in step */
  .hole-close { --anim: none; }        /* the hero's shadow stays: the place where the whale fell */
  .f1 { --anim: fact-1; } .f2 { --anim: fact-2; } .f3 { --anim: fact-3; } .f4 { --anim: fact-4; }
  .n1 { --anim: nav-1; } .n2 { --anim: nav-2; } .n3 { --anim: nav-3; }   /* Company → Work, Product → Zel.Q, Contact → Contact */

  /* At the end, the same portal the other way: the header's mark goes down, the mark by the email comes up */
  .end-open, .end-rise, .hm-sink { --tl: --endmark; --r0: var(--end0); --r1: var(--end1); }   /* on the end mark's own view: site.js sizes it to at least 112 px, ending where the footer is 78 % in */
  .hm-close { --tl: --close; --r0: entry 80%; --r1: entry 92%; }
  .end-open { --anim: hole-open; } .end-rise { --anim: whale-up; } .hm-sink { --anim: whale-down; } .hm-close { --anim: hole-shut; }

  /* 一鲸落，万物生: after the fall, the work section's bracket grows into place */
  .answer-l, .answer-r { --anim: draw-y; --tl: --work; --r0: cover 14%; --r1: cover 30%; }
  .answer-lb, .answer-rb { --anim: draw-x; --tl: --work; --r0: cover 26%; --r1: cover 40%; }
  .bridge-join { --anim: draw-y; --tl: --bridge; --r0: cover 8%; --r1: cover 22%; }

  @supports (animation-timeline: view()) {
    html.js .areas { view-timeline: --work block; }
    html.js .bridge { view-timeline: --bridge block; }
    html.js .foot { view-timeline: --close block; }
    html.js .end-mark { view-timeline: --endmark block; view-timeline-inset: 0; }
    html.js :is(.areas, .bridge, .foot) { view-timeline-inset: 0; }   /* the header's scroll-padding must not shift them */
    html.js .sd {
      animation-name: var(--anim);
      animation-duration: 1ms; animation-duration: auto;
      animation-timing-function: linear;
      animation-fill-mode: both;
      animation-timeline: var(--tl);
      animation-range: var(--r0) var(--r1);
    }
    /* The header's mark follows the footer's timeline, which needs timeline-scope; site.js drives everything where it's missing */
    html.js :is(.hm-sink, .hm-close) { animation-name: none; }
    @supports (timeline-scope: --close) {
      html.js body { timeline-scope: --close, --endmark; }
      html.js :is(.hm-sink, .hm-close) { animation-name: var(--anim); }
    }
  }
  /* Without both, site.js scrubs the same animations from one passive scroll listener. */
  html.js.sd-js .sd {
    animation-name: var(--anim);
    animation-duration: 1000ms;
    animation-timing-function: linear;
    animation-fill-mode: both;
    animation-delay: 0s;
    animation-play-state: paused;
    animation-timeline: auto;
    animation-range: normal;
  }
  /* When the header's mark has fully risen, its arcs hop once, gently, black first; then they rest exactly as the master. */
  html.js .hmark.bob .hm-bob { animation: bob 560ms both; }
  html.js .hmark.bob .hm-bob-2 { animation-delay: 70ms; }
  html.js .hmark.bob .hm-bob-1 { animation-delay: 140ms; }
  /* Whatever takes keyboard focus shows, whatever the scroll position. */
  html.js .site-head:focus-within :is(.head-bg, .head-line, .hword, .nav li),
  html.js .facts > div:focus-within {
    animation: none;
    opacity: 1;
    transform: none;
  }
  /* Narrow screens: each fact hands over to its nav item as it slides under the header */
  @media (max-width: 61.99rem) {
    html.js :is(.f1, .f2, .f3, .f4) { --anim: none; }
    html.js .n1 { --anim: nav-in; --r0: var(--n1-0); --r1: var(--n1-1); }
    html.js .n2 { --anim: nav-in; --r0: var(--n2-0); --r1: var(--n2-1); }
    html.js .n3 { --anim: nav-in; --r0: var(--n3-0); --r1: var(--n3-1); }
  }
}

/* The portal. In the mark's own units: 394 takes the tall tips well below the shadow's centre line, where the clip ends them,
   and the ellipse is drawn over what goes in. The arcs narrow a little as they pass, so their tips go into the black. */
.fall, .hm-rise, .hm-sink, .end-rise { transform-box: view-box; transform-origin: 1504px 0; }
.hole-close, .hm-open, .hm-close, .end-open { transform-box: fill-box; transform-origin: 50% 50%; }
/* Depth is linear in the progress, so the header's rise (the same frames reversed) mirrors the fall exactly.
   The arcs gather in towards the hole's centre before their outer ends reach the line: at each depth, every point
   that crosses the line lies within 240 of the hole's 263-unit half-width. */
@keyframes whale-down {
  0%, 6% { transform: none; }
  34% { transform: translate(0px, 117.4px); }
  53% { transform: translate(0px, 197px) scale(0.94, 1); }
  62.4% { transform: translate(0px, 236.4px) scale(0.86, 1); }
  70% { transform: translate(0px, 268.3px) scale(0.79, 1); }
  100% { transform: translate(0px, 394px) scale(0.79, 1); }
}
@keyframes whale-up {
  0%, 6% { transform: translate(0px, 394px) scale(0.79, 1); }
  36% { transform: translate(0px, 268.3px) scale(0.79, 1); }
  43.6% { transform: translate(0px, 236.4px) scale(0.86, 1); }
  53% { transform: translate(0px, 197px) scale(0.94, 1); }
  72% { transform: translate(0px, 117.4px); }
  100% { transform: none; }
}
@keyframes hole-open {
  0% { transform: scale(0.2, 0.5); opacity: 0; }
  6%, 100% { transform: none; opacity: 1; }
}
@keyframes hole-shut { from { transform: none; opacity: 1; } to { transform: scale(0.2, 0.5); opacity: 0; } }
@keyframes hole-close {
  0%, 90% { transform: none; opacity: 1; }
  100% { transform: scale(0.2, 0.5); opacity: 0; }
}
/* 「Inc.」: grey, then flat in place; its bar holds until the header's line takes over at the same box, then stretches across */
@keyframes inc-letters {
  0% { opacity: 1; transform: none; }
  50% { opacity: 0.42; transform: none; }
  85% { opacity: 0.42; transform: scaleY(0.06); }
  92%, 100% { opacity: 0; transform: scaleY(0.04); }
}
@keyframes inc-bar {
  0%, 62% { opacity: 0; }
  85%, 97% { opacity: 1; }
  100% { opacity: 0; }
}
@keyframes line-born {
  0% { opacity: 0; transform: scaleX(var(--l-s)); }
  4% { opacity: 1; transform: scaleX(var(--l-s)); }
  100% { opacity: 1; transform: none; }
}
@keyframes head-bg { from { opacity: 0; } to { opacity: 1; } }
/* A soft, damped spring, in the mark's own units (60 ≈ 3 px at 1440) */
@keyframes bob {
  0% { transform: none; animation-timing-function: cubic-bezier(0.3, 0, 0.3, 1); }
  28% { transform: translateY(-60px); animation-timing-function: cubic-bezier(0.45, 0, 0.55, 1); }
  60% { transform: translateY(10px); animation-timing-function: cubic-bezier(0.45, 0, 0.55, 1); }
  82% { transform: translateY(-3px); animation-timing-function: cubic-bezier(0.45, 0, 0.55, 1); }
  100% { transform: none; }
}
@keyframes word-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes word-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
/* Each destination always has one fully readable entry: the nav label comes in first, then its fact goes */
@keyframes fact-1 { 0%, 22% { opacity: 1; transform: none; } 36%, 100% { opacity: 0; transform: translateY(-14px); } }
@keyframes fact-2 { 0%, 30% { opacity: 1; transform: none; } 44%, 100% { opacity: 0; transform: translateY(-14px); } }
@keyframes fact-3 { 0%, 44% { opacity: 1; transform: none; } 58%, 100% { opacity: 0; transform: translateY(-14px); } }
@keyframes fact-4 { 0%, 66% { opacity: 1; transform: none; } 80%, 100% { opacity: 0; transform: translateY(-14px); } }
@keyframes nav-1 { 0%, 8% { opacity: 0; transform: translateY(10px); } 22%, 100% { opacity: 1; transform: none; } }
@keyframes nav-2 { 0%, 30% { opacity: 0; transform: translateY(10px); } 44%, 100% { opacity: 1; transform: none; } }
@keyframes nav-3 { 0%, 52% { opacity: 0; transform: translateY(10px); } 66%, 100% { opacity: 1; transform: none; } }
@keyframes nav-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes draw-y { from { transform: scaleY(0); } }
@keyframes draw-x { from { transform: scaleX(0); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 47.99rem) {
  .bridge { padding-top: 1.75rem; }
  .bridge-join { display: block; position: absolute; left: 0.5rem; top: 0; width: 1px; height: 1.25rem; background: var(--stone); transform-origin: 50% 0; }
  .ticks { background-size: calc((100% + var(--gutter)) / 4) 5px, calc((100% + var(--gutter)) / 2) 9px; }
}
@media (max-width: 22.49rem) {
  :root { --lw: 100px; }
  .head-row { gap: 0.25rem; }
  .nav a { padding-inline: 0.25rem; font-size: 0.9375rem; }       /* Work stays: every section keeps a way in */
}
@media (max-width: 61.99rem) {
  .hero-grid { grid-template-rows: auto auto auto auto auto auto; align-content: center; }
  .lead { grid-column: 1 / -1; grid-row: 3; padding-bottom: 0; margin-top: clamp(1rem, 2.5vh, 1.75rem); max-width: 34ch; }
  .hero { --mark-h: clamp(9rem, 22vh, 15rem); --breath: clamp(1.25rem, 3.5vh, 2.5rem); }
  @supports (height: 100svh) { .hero { --mark-h: clamp(9rem, 22svh, 15rem); --breath: clamp(1.25rem, 3.5svh, 2.5rem); } }
  .hero-mark { grid-column: 1 / -1; grid-row: 4; width: min(100%, 34rem, calc(var(--mark-h) * 1.5489)); justify-self: end; margin-top: var(--breath); }
  .waterline { grid-row: 5; }
  .facts { grid-row: 6; }
}
@media (max-height: 35rem) and (min-width: 34rem) and (max-width: 61.99rem) {
  .hero { --top: clamp(0.5rem, 3vh, 1rem); --mark-h: 40vh; --breath: clamp(0.75rem, 3vh, 1.25rem); }
  @supports (height: 100svh) { .hero { --top: clamp(0.5rem, 3svh, 1rem); --mark-h: 40svh; --breath: clamp(0.75rem, 3svh, 1.25rem); } }
  .hero-grid { grid-template-rows: auto auto 1fr auto auto; align-content: normal; }
  .kicker { margin-bottom: 0.375rem; }
  .lead { grid-column: 1 / span 7; grid-row: 3; align-self: end; margin-top: var(--breath); padding-bottom: 0.5rem; font-size: 1rem; max-width: 30em; }
  .hero-mark { grid-column: 8 / -1; grid-row: 3; align-self: end; width: min(100%, calc(var(--mark-h) * 1.5489)); margin-top: var(--breath); }
  .waterline { grid-row: 4; }
  .facts { grid-row: 5; }
}
@media (min-width: 48rem) {
  :root { --hh: 64px; --lw: 168px; }
  .areas { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding-bottom: 1.25rem; }
  .answer { display: block; }
  .answer-l, .answer-r { bottom: 0; width: 1px; height: 1.25rem; transform-origin: 50% 0; }
  .answer-l { left: calc((100% - 3rem) / 4); }
  .answer-r { right: calc((100% - 3rem) / 4); }
  .answer-lb, .answer-rb { bottom: 0; height: 1px; }
  .answer-lb { left: calc((100% - 3rem) / 4); right: 50%; transform-origin: 0 50%; }
  .answer-rb { left: 50%; right: calc((100% - 3rem) / 4); transform-origin: 100% 50%; }
  .bridge { width: min(100%, 30em); justify-self: center; padding-top: 1rem; }
  .bridge-join { display: block; position: absolute; left: 50%; top: -1.5rem; width: 1px; height: 2.125rem; background: var(--stone); transform-origin: 50% 0; }
}
@media (min-width: 62rem) {
  :root { --lw: 200px; }
  .section-grid { grid-template-columns: 15rem minmax(0, 1fr); }
  .steps { margin-left: -2rem; }
  .plate { grid-column: 1 / -1; }
  .scene {
    grid-template-columns: minmax(0, 1fr) 24rem minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    column-gap: 3rem;
    justify-items: stretch;
  }
  .notice { grid-column: 2; grid-row: 1 / span 3; grid-template-rows: subgrid; width: auto; }
  .callout { height: 0; align-self: center; display: flex; align-items: center; max-width: none; padding: 0; }
  .callout::after { top: 0; width: 3rem; height: 1px; }
  .callout-watch { grid-column: 3; grid-row: 1; justify-self: start; text-align: left; }
  .callout-watch::after { right: auto; left: -3rem; bottom: auto; }
  .callout-watch::before { right: auto; bottom: auto; left: calc(-3rem - 2.5px); top: -2.5px; }
  .callout-link::before { left: auto; top: -2.5px; right: calc(-3rem - 2.5px); }
  .callout-link { grid-column: 1; grid-row: 3; justify-self: end; text-align: right; }
  .callout-link::after { left: auto; right: -3rem; }
  .callout > span { display: block; max-width: 15em; }
}

/* Short and wide windows (landscape phones): the end view holds Contact, the mark, its line and the copyright.
   Width counts too, so large default type on a portrait phone never gets the side head. */
@media (max-height: 35rem) and (min-width: 34rem) {
  .foot { --ew: clamp(6rem, 25vh, 19rem); margin-top: calc(var(--ew) * 0.6456 + 1.75rem); }
  #contact { padding-top: clamp(3rem, 10vh, 5rem); }
  .foot-inner { padding-block: calc(var(--ew) * 12.843 / 594 + 1rem) 1.5rem; }
  #contact .section-grid { grid-template-columns: minmax(0, 9rem) minmax(0, 1fr); column-gap: 1.5rem; }   /* a side head, as on wide screens */
  #contact .body { gap: 0.75rem; }
  .address { font-size: 1.75rem; }
}
