/* Common Practice — brand tokens (Tidewater palette) */
:root {
  --bg: #0F2A33;          /* deep teal ground */
  --teal: #1F7A8C;        /* gradient blob 1 */
  --blue: #2E5E9E;        /* gradient blob 2 */
  --mist: #9CCFD1;        /* soft highlight blob */
  --accent: #9FE3E7;      /* full stop, numerals, labels */
  --ink: #F4F7F5;         /* text */
  --cream: #F3F1EC;       /* dictionary page ground */
  --ink-2: rgba(244, 247, 245, 0.88);
  --ink-3: rgba(244, 247, 245, 0.75);
  --rule: rgba(244, 247, 245, 0.28);
  --serif: 'Instrument Serif', Georgia, serif;
  --sans: 'Hanken Grotesk', system-ui, sans-serif;
  --gutter: clamp(20px, 5vw, 72px);
  --ease: cubic-bezier(.2, .7, 0, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html.lenis, html.lenis body { height: auto; scroll-behavior: auto; }
body {
  margin: 0; color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased;
  /* Fallback if WebGL is unavailable: plain radial gradients, no CSS blur (blur is what caused the blocky banding) */
  background: radial-gradient(60% 70% at 15% 15%, rgba(31,122,140,.9), transparent 70%),
              radial-gradient(60% 70% at 75% 65%, rgba(46,94,158,.85), transparent 70%),
              var(--bg) fixed;
}
a { color: inherit; text-decoration: none; transition: opacity .3s; }
a:hover { opacity: 0.7; }
ol, ul { list-style: none; margin: 0; padding: 0; }
p { margin: 0; }
::selection { background: var(--accent); color: var(--bg); }

/* Background field: one fixed WebGL canvas behind everything, colours shift as you scroll */
.field { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100lvh; z-index: -1; display: block; background: var(--bg); }
.field.is-off { display: none; }

/* Grain: a pre-rendered noise tile (set by main.js). Static on purpose: no jitter */
.grain { position: fixed; inset: 0; z-index: 110; pointer-events: none; opacity: .045; background-size: 128px 128px; }

/* Loader (driven by main.js): line draws, sun rises, sun becomes the full stop, wordmark flies to the nav */
/* Mark and wordmark share one grid cell, so each is dead centre on its own (sunrise, then the held wordmark) */
.loader { position: fixed; inset: 0; z-index: 100; background: rgb(15, 42, 51); display: grid; place-items: center; pointer-events: none; }
.loader__mark, .loader__word { grid-area: 1 / 1; }
.loader__word { position: relative; z-index: 1; } /* letters sit in front of the sun as it glides across them */
.loader__mark { display: flex; flex-direction: column; align-items: center; }
/* The wrap holds the whole circle; a clip-path shows only the top half (the risen sun) until the glide opens it up */
.loader__sunwrap { width: 120px; height: 120px; margin-bottom: -60px; clip-path: inset(0 0 60px 0); position: relative; transform-origin: 50% 50%; }
.loader__sun { position: absolute; left: 0; top: 0; width: 120px; height: 120px; border-radius: 50%; background: var(--accent); transform: translateY(60px); }
.loader__line { width: 240px; height: 1.5px; background: var(--ink); transform: scaleX(0); }
.loader__word { font-family: var(--serif); font-size: clamp(36px, 11vw, 64px); line-height: 1; white-space: nowrap; transform-origin: 0 0; }
.loader__text { opacity: 0; display: inline-block; }
.loader__dot { display: inline-block; width: 0.14em; height: 0.14em; margin-left: 0.05em; border-radius: 50%; background: var(--accent); opacity: 0; }

/* Nav: fixed, travels with you. Wordmark collapses to "CP." once you scroll */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 80; height: 84px; padding: 25px var(--gutter) 0; display: flex; align-items: baseline; justify-content: space-between; pointer-events: none; transition: color .5s var(--ease); }
.nav > * { pointer-events: auto; }
.wordmark { font-family: var(--serif); font-size: 28px; display: inline-flex; align-items: baseline; white-space: nowrap; }
.wm-rest { display: inline-block; overflow: hidden; vertical-align: bottom; max-width: 5em; transition: max-width .9s var(--ease), opacity .6s var(--ease); }
.wm-rest + .wm-c { margin-left: 0; }
.is-compact .wm-rest { max-width: 0; opacity: 0; }
.is-compact .wordmark { font-size: 28px; }
.dot { color: var(--accent); }
.nav__links { display: flex; align-items: baseline; gap: 32px; font-size: 10.5px; letter-spacing: 0.2em; text-transform: uppercase; }

/* Section rail (right edge) */
.rail { position: fixed; right: calc(var(--gutter) * .45); top: 50%; transform: translateY(-50%); z-index: 70; display: flex; flex-direction: column; gap: 14px; font-size: 10px; letter-spacing: .22em; color: var(--ink-3); transition: color .5s; }
.rail li { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.rail li::after { content: ''; width: 10px; height: 1px; background: currentColor; transition: width .6s var(--ease), background .4s; }
.rail span { opacity: 0; transform: translateX(6px); transition: opacity .4s, transform .6s var(--ease); }
.rail li.is-active { color: var(--accent); }
.rail li.is-active::after { width: 28px; }
.rail li.is-active span { opacity: 1; transform: none; }

/* Screens */
.screen { min-height: 100vh; display: flex; flex-direction: column; padding: 84px var(--gutter) clamp(32px, 6vh, 60px); }
.eyebrow-row { position: relative; display: flex; justify-content: space-between; font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink-3); }

/* Editorial split (Layout A) */
.split { position: relative; flex: 1; display: grid; grid-template-columns: minmax(0, 660fr) 1px minmax(0, 508fr); column-gap: 60px; padding-top: clamp(40px, 9vh, 86px); }
.split--wide-left { grid-template-columns: minmax(0, 760fr) 1px minmax(0, 408fr); }
.split__left { display: flex; flex-direction: column; justify-content: space-between; gap: 48px; }
.split__right { display: flex; flex-direction: column; }
.divider { background: rgba(244, 247, 245, 0.3); margin-top: -50px; transform-origin: top; }

.display { margin: 0; font-family: var(--serif); font-weight: 400; font-size: clamp(52px, 6.7vw, 96px); line-height: 0.95; letter-spacing: -0.03em; }
.display--xl { font-size: clamp(60px, 9.7vw, 140px); line-height: 0.9; letter-spacing: -0.035em; }
.serif-md { font-family: var(--serif); font-size: 34px; }
.body { font-size: 20px; line-height: 1.6; color: var(--ink-2); max-width: 560px; }
.eyebrow { font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase; }
.accent { color: var(--accent); }
.muted { color: var(--ink-3); }
.stack { display: flex; flex-direction: column; gap: 22px; }

.cta { display: inline-flex; align-items: center; gap: 14px; font-size: 13px; letter-spacing: 0.22em; text-transform: uppercase; }
/* Phone CTA (replaces the nav link under 600px): plain spaced caps centred under the lanes, no outline.
   The padding is invisible and only there to keep a comfortable tap target. */
.hero-cta { display: none; align-self: center; margin-top: 28px; padding: 14px 20px; font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; white-space: nowrap; }
.hero-cta .dot { margin-left: 6px; }
.cta__line { display: inline-block; width: 40px; height: 1px; background: currentColor; transition: width .5s var(--ease); }
.cta:hover { opacity: 1; }
.cta:hover .cta__line { width: 72px; }

/* Landing (Layout B1): big centered headline, tagline, lanes in a quiet row along the base. No divider lines. */
.hero { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 40px; padding: 40px 0; }
.display--hero { font-size: clamp(56px, 8.9vw, 128px); line-height: 1.02; letter-spacing: -0.035em; max-width: 1300px; }
.hero__line { font-family: var(--serif); font-style: italic; font-size: clamp(28px, 3.2vw, 46px); line-height: 1.1; }
/* Tagline builds word by word once on load, "won't." lands last in the accent colour, then stays */
.rv { display: inline-block; opacity: 0; transform: translateY(18px); animation: rvIn 0.9s cubic-bezier(.2,.7,.2,1) var(--d, 0s) both; }
.rv--accent { color: var(--accent); }
@keyframes rvIn { to { opacity: 1; transform: translateY(0); } }
.lanes-row { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; max-width: 1040px; width: 100%; margin: 0 auto; text-align: center; }
.lanes-row li { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.num { font-size: 12px; letter-spacing: 0.22em; color: var(--accent); }
.lane__name { font-family: var(--serif); font-size: 34px; line-height: 1; transition: transform .7s var(--ease); }
.lane__name { position: relative; }
.lane__dot { position: absolute; left: 100%; opacity: 0; transition: opacity .4s; }
.lane__desc { font-size: 13px; line-height: 1.5; color: var(--ink-2); }
.lanes-row li:hover .lane__name { transform: translateY(-4px); }
.lanes-row li:hover .lane__dot { opacity: 1; }

/* Rolling statements (5 statements + duplicate of the first for a seamless loop) */
.roller { justify-content: center; gap: 26px; }
.roller__count { display: flex; align-items: center; gap: 12px; font-size: 12px; letter-spacing: 0.22em; color: var(--ink-3); }
.roller__num-window { height: 20px; overflow: hidden; display: inline-block; }
.roller__nums { display: block; animation: rollNum 17.5s cubic-bezier(.7,0,.2,1) infinite; }
.roller__nums span { display: block; height: 20px; line-height: 20px; }
.roller__rule { flex: 1; height: 1px; background: rgba(244, 247, 245, 0.3); }
.roller__window { --h: 300px; height: var(--h); overflow: hidden; border-bottom: 1px solid var(--rule); }
.roller__track { animation: roll 17.5s cubic-bezier(.7,0,.2,1) infinite; }
.roller__track li { height: var(--h); display: flex; flex-direction: column; justify-content: center; gap: 18px; }
.statement { font-family: var(--serif); font-style: italic; font-size: clamp(36px, 4.2vw, 60px); line-height: 1.04; letter-spacing: -0.01em; }
@keyframes roll { 0%,16% { transform: translateY(0); } 20%,36% { transform: translateY(calc(var(--h) * -1)); } 40%,56% { transform: translateY(calc(var(--h) * -2)); } 60%,76% { transform: translateY(calc(var(--h) * -3)); } 80%,96% { transform: translateY(calc(var(--h) * -4)); } 100% { transform: translateY(calc(var(--h) * -5)); } }
@keyframes rollNum { 0%,16% { transform: translateY(0); } 20%,36% { transform: translateY(-20px); } 40%,56% { transform: translateY(-40px); } 60%,76% { transform: translateY(-60px); } 80%,96% { transform: translateY(-80px); } 100% { transform: translateY(-100px); } }

/* Contact */
.contact { justify-content: space-between; gap: 48px; }
.email { font-family: var(--serif); font-size: 34px; border-bottom: 1px solid rgba(244, 247, 245, 0.5); padding-bottom: 10px; }
.socials { display: flex; gap: 28px; font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase; }
.footer-row { display: flex; justify-content: space-between; align-items: flex-end; }
.mark__sun { transform-origin: 85px 62px; transform: translateY(var(--rise, 0px)); }

/* Reveals (only when JS is running and motion is allowed) */
.w { display: inline-block; overflow: hidden; vertical-align: top; padding: 0 .06em .1em 0; margin: 0 -.06em -.1em 0; }
/* Italic display words need a roomier mask: the italic p/f descenders drop low and lean left */
.define__word .w { padding: 0 .1em .3em .12em; margin: 0 -.1em -.3em -.12em; }
.w__i { display: inline-block; }
/* Stacked scroll: every page pins, and the next one slides up over it (main.js sets --stick, --covered and the clip) */
main > section { position: sticky; top: var(--stick, 0px); transform-origin: 50% 0; }
@media (prefers-reduced-motion: no-preference) {
  main > section { transform: scale(calc(1 - .04 * var(--covered, 0))); filter: brightness(calc(1 - .45 * var(--covered, 0))); }
}

/* 02 Definition: cream dictionary page */
.define { min-height: 100vh; box-shadow: 0 -30px 70px rgba(3, 12, 16, .35); display: flex; align-items: center; padding: 120px var(--gutter) 90px; background: var(--cream); color: var(--bg); }
.define__inner { width: 100%; max-width: 1040px; margin: 0 auto; }
.define__word { margin: 0; font-family: var(--serif); font-style: italic; font-weight: 400; font-size: clamp(64px, 10.5vw, 156px); line-height: .95; letter-spacing: -0.025em; }
.define__meta { display: flex; align-items: baseline; gap: 26px; margin-top: 22px; }
.define__pron { font-family: var(--serif); font-size: 22px; color: rgba(15, 42, 51, .62); }
.define__pos { font-size: 11px; letter-spacing: .24em; text-transform: uppercase; color: rgba(15, 42, 51, .6); }
.define__rule { height: 1px; margin: 44px 0 40px; background: rgba(15, 42, 51, .14); transform-origin: left center; }
.define__list { display: grid; gap: 20px; }
.define__item { display: grid; grid-template-columns: 52px minmax(0, 1fr); align-items: baseline; }
.define__n { font-size: 11px; letter-spacing: .1em; color: rgba(15, 42, 51, .55); }
.define__text { font-family: var(--serif); font-size: clamp(30px, 4.2vw, 58px); line-height: 1.1; letter-spacing: -0.015em; }
.define__item--old .define__text { color: rgba(15, 42, 51, .42); transition: color 1s var(--ease); }
.define .dot { color: var(--teal); }
.define__aside { margin-top: clamp(64px, 14vh, 150px); text-align: right; font-family: var(--serif); font-style: italic; font-size: clamp(20px, 1.9vw, 26px); color: #1F4E5C; }
/* The strike draws left to right across the old definition (across line breaks too) */
.strike { background-image: linear-gradient(rgba(15, 42, 51, .78), rgba(15, 42, 51, .78)); background-repeat: no-repeat; background-position: 0 58%; background-size: 0% 2px; transition: background-size .9s cubic-bezier(.65, 0, .35, 1); }
.define__item--old.is-struck .strike { background-size: 100% 2px; }
.define__item--old.is-struck .define__text { color: rgba(15, 42, 51, .34); }

/* Nav over the cream page */
.on-light .nav { color: var(--bg); }
.on-light .nav .dot { color: var(--teal); }

/* 03 Close: back on the gradient */
.screen--close { align-items: center; text-align: center; }
.close { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 48px; padding-top: 40px; }
.close__cta { font-size: 11px; letter-spacing: .22em; text-transform: uppercase; padding: 14px 20px; }
.close__cta .dot { margin-left: 6px; }
.close__foot { width: 100%; display: flex; justify-content: space-between; align-items: flex-end; font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--ink-3); }

@media (prefers-reduced-motion: no-preference) {
  .js .w__i { transform: translateY(110%); transition: transform 1.2s var(--ease) calc(var(--i, 0) * 45ms); }
  .js .in .w__i { transform: none; }
  .js .define__word .w__i { transform: translateY(135%); }
  .js .define__word.in .w__i { transform: none; }
  .js [data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity 1s var(--ease) var(--d, 0s), transform 1.2s var(--ease) var(--d, 0s); }
  .js [data-reveal="line"] { transform: scaleY(0); }
  .js [data-reveal="hline"] { transform: scaleX(0); }
  .js [data-reveal].in { opacity: 1; transform: none; }
}

/* Mobile: stack the split */
@media (max-width: 1180px) { .rail { display: none; } }

@media (max-width: 900px) {
  .nav { height: 68px; padding-top: 20px; }
  .nav__links { gap: 20px; }
  .wordmark { font-size: 24px; }
  .screen { padding-top: 96px; }
  .split, .split--wide-left { grid-template-columns: 1fr; row-gap: 48px; }
  .divider { display: none; }
  .roller__window { --h: 260px; }
  .lanes-row { row-gap: 28px; column-gap: 24px; }
  .hero { gap: 28px; }
}

@media (max-width: 600px) {
  .define { padding-top: 110px; }
  .define__word { font-size: 14.6vw; white-space: nowrap; } /* one line on phones: the word runs ~5.9× its font size */
  .close__foot { font-size: 12.5px; letter-spacing: .16em; }
  .define__item { grid-template-columns: 30px minmax(0, 1fr); }
  .define__meta { gap: 16px; }
  .define__pron { font-size: 18px; }
  .define__aside { text-align: left; }
  .nav__links { display: none; }
  .hero-cta { display: inline-flex; margin-top: 20px; }
  /* Lanes a touch smaller and lower, so the tagline has room to breathe */
  /* three lanes stack in a centred column on phones (three across is too narrow for "Experiential") */
  .lanes-row { grid-template-columns: 1fr; margin-top: 24px; row-gap: 18px; }
  .lanes-row li { gap: 4px; }
  .lane__name { font-size: 26px; }
  .lane__desc { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .roller__track, .roller__nums, .rv { animation: none; }
  .strike, .define__item--old .define__text { transition: none; }
  .rv { opacity: 1; transform: none; }
  .loader { display: none; }
}
