/* ===== Tokens ===== */
:root {
  --ink: #0B1416;
  --ink-2: #111E21;
  --ink-3: #18282C;
  --sand: #EDE4D0;
  --sand-2: #C9C0AC;
  --sand-dim: rgba(237, 228, 208, 0.58);
  --sand-faint: rgba(237, 228, 208, 0.32);
  --line: rgba(237, 228, 208, 0.14);
  --accent: #FF7A1A;

  --f-display: 'Bricolage Grotesque', ui-sans-serif, system-ui, sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-io: cubic-bezier(0.7, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);

  --gutter: max(clamp(16px, 3vw, 40px), env(safe-area-inset-left), env(safe-area-inset-right));
  --hdr-h: 72px;
  --hdr-fg: var(--sand);
  --page-bg: var(--ink);
  --page-fg: var(--sand);

  --t-xs: 12px;   /* mono labels */
  --t-sm: 15px;
  --t-md: 18px;
  --t-lg: clamp(22px, 2.2vw, 30px);
  --t-xl: clamp(34px, 4.6vw, 64px);
  --t-2xl: clamp(48px, 8vw, 128px);
  --t-3xl: clamp(64px, 13vw, 220px);
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }
body {
  margin: 0;
  background: var(--page-bg);
  color: var(--page-fg);
  font-family: var(--f-display);
  font-size: var(--t-md);
  line-height: 1.45;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color .6s var(--ease-out), color .6s var(--ease-out);
}
body.is-locked { overflow: hidden; }
img, canvas, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, h4, p, ol, ul, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
::selection { background: var(--accent); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
main:focus { outline: none; }

.skip {
  position: fixed; left: 12px; top: -60px; z-index: 300;
  background: var(--sand); color: var(--ink); padding: 10px 14px; border-radius: 999px;
  font: 500 var(--t-xs)/1 var(--f-mono); text-transform: lowercase; letter-spacing: .02em;
}
.skip:focus { top: 12px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }

/* ===== Type helpers ===== */
.mono { font-family: var(--f-mono); font-size: var(--t-xs); letter-spacing: .02em; text-transform: lowercase; font-weight: 500; }
.label { font-family: var(--f-mono); font-size: var(--t-xs); letter-spacing: .02em; text-transform: lowercase; color: var(--sand-dim); font-weight: 500; }
.display { font-weight: 700; letter-spacing: -0.035em; line-height: .92; font-variation-settings: "opsz" 96; }
.u-link { background: linear-gradient(currentColor, currentColor) 0 100% / 0% 1px no-repeat; transition: background-size .5s var(--ease-out); }
.u-link:hover, .u-link:focus-visible { background-size: 100% 1px; }
.u-link--on { background-size: 100% 1px; }
.u-link--on:hover { background-size: 0% 1px; background-position: 100% 100%; }

.wrap { padding-left: var(--gutter); padding-right: var(--gutter); }
.page { min-height: 100vh; min-height: 100svh; }

/* ===== Header ===== */
.hdr {
  position: fixed; inset: 0 0 auto 0; z-index: 120; height: var(--hdr-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--gutter); color: var(--hdr-fg);
  pointer-events: none; transition: transform .6s var(--ease-out);
}
.hdr > * { pointer-events: auto; }
.hdr.is-hidden { transform: translateY(-110%); }
body.menu-open .hdr { transform: none; }
/* Each item turns ink as the menu's circle reaches it, and back as it leaves (delays timed by app.js). */
.hdr__mark, .hdr__menu { color: var(--hdr-fg); transition: color .5s var(--ease-out); }
body.menu-open .hdr__mark, body.menu-open .hdr__menu { color: var(--ink); }
body.menu-open .hdr__mark, body.menu-closing .hdr__mark { transition: color .2s linear var(--hdr-mark-d, 0s); }
body.menu-open .hdr__menu, body.menu-closing .hdr__menu { transition: color .2s linear var(--hdr-btn-d, 0s); }
.hdr :focus-visible { outline-color: currentColor; }
/* Scrim behind the header once the page has scrolled (sits under the menu, z 110). */
.hdr-scrim {
  position: fixed; inset: 0 0 auto 0; z-index: 105; height: calc(var(--hdr-h) + 8px); pointer-events: none;
  background: linear-gradient(var(--hdr-bg, var(--page-bg)) 70%, transparent);
  opacity: 0; transition: opacity .35s var(--ease-out), transform .6s var(--ease-out);
}
.hdr-scrim.is-on { opacity: 1; }
.hdr-scrim.is-hidden { transform: translateY(-110%); }
.hdr__mark { display: inline-flex; align-items: baseline; gap: 3px; font-weight: 700; font-size: 19px; letter-spacing: -0.02em; overflow: hidden; padding: 10px 0; margin: -10px 0; }
.hdr__name { display: inline-block; transition: transform .6s var(--ease-out); }
.hdr__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--hdr-dot, var(--accent)); display: inline-block; transform: translateY(-1px); transition: transform .5s var(--ease-spring), background-color .2s linear; }
body.menu-open .hdr__dot { background: var(--accent); }
body.menu-open .hdr__dot, body.menu-closing .hdr__dot { transition: transform .5s var(--ease-spring), background-color .2s linear var(--hdr-mark-d, 0s); }
.hdr__mark:hover .hdr__dot { transform: translateY(-1px) scale(1.7); }
.hdr__menu { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 17px; letter-spacing: -0.01em; height: 44px; padding: 0 2px; }
.hdr__menu-dots { position: relative; width: 18px; height: 18px; display: inline-block; }
.hdr__menu-dots i {
  position: absolute; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%; background: currentColor;
  transition: transform .6s var(--ease-spring), width .5s var(--ease-out), border-radius .5s var(--ease-out), height .5s var(--ease-out), margin .5s var(--ease-out);
}
.hdr__menu-dots i:first-child { left: 0; }
.hdr__menu-dots i:last-child { right: 0; }
@media (hover: hover) and (pointer: fine) {
  body:not(.menu-open) .hdr__menu:hover .hdr__menu-dots i:first-child { transform: translateX(5.5px); }
  body:not(.menu-open) .hdr__menu:hover .hdr__menu-dots i:last-child { transform: translateX(-5.5px); }
}
body.menu-open .hdr__menu-dots i { width: 20px; height: 2px; margin-top: -1px; border-radius: 2px; left: -1px; right: auto; }
body.menu-open .hdr__menu-dots i:first-child { transform: rotate(45deg); }
body.menu-open .hdr__menu-dots i:last-child { transform: rotate(-45deg); }
.hdr__menu-label { display: inline-block; min-width: 2.7em; text-align: right; }

/* ===== Menu overlay ===== */
.menu {
  position: fixed; inset: 0; z-index: 110; background: var(--sand); color: var(--ink);
  clip-path: circle(0px at var(--mx, 95%) var(--my, 4%));
  transition: clip-path .85s var(--ease-io);
  overflow: hidden auto; overscroll-behavior: contain;
}
/* On short screens the menu scrolls: its words pass under a sand band instead of the header. */
.menu::before {
  content: ""; display: block; position: sticky; top: 0; z-index: 3; pointer-events: none;
  height: calc(var(--hdr-h) + 8px); margin-bottom: calc(-8px - var(--hdr-h));
  background: linear-gradient(var(--sand) 72%, rgba(237, 228, 208, 0));
}
.menu :focus-visible { outline-color: var(--ink); }
.menu[hidden] { display: block; visibility: hidden; }
.menu.is-open { clip-path: circle(var(--mr, 150vmax) at var(--mx, 95%) var(--my, 4%)); visibility: visible; }
.menu__inner {
  position: relative; z-index: 2; min-height: 100%;
  display: grid; grid-template-columns: 1fr minmax(240px, 340px); gap: 48px;
  padding: calc(var(--hdr-h) + 4vh) var(--gutter) 40px;
}
.menu__list { display: flex; flex-direction: column; justify-content: center; gap: .02em; }
.menu__item { overflow: hidden; }
.menu__link {
  display: inline-flex; align-items: flex-start; gap: 18px;
  font-weight: 700; letter-spacing: -0.045em; line-height: .95; font-size: clamp(56px, 10.5vw, 168px);
  transform: translateY(105%); transition: transform .9s var(--ease-out), opacity .4s, color .3s;
}
.menu.is-open .menu__link { transform: translateY(0); }
.menu__num { font: 500 var(--t-xs)/1 var(--f-mono); letter-spacing: .06em; margin-top: .9em; opacity: .72; min-width: 2.2em; }
.menu__word { display: inline-block; position: relative; }
.menu__count { display: inline-block; font: 500 14px/1 var(--f-mono); vertical-align: top; margin-left: 8px; opacity: .72; letter-spacing: 0; }
/* Hovering a link dims the others (real hover only: a tap would leave every link dimmed). */
@media (hover: hover) and (pointer: fine) {
  .menu__list:has(.menu__link:hover) .menu__link:not(:hover):not(:focus-visible) { opacity: .28; }
}
/* The li clips the slide-up, which would clip an outline too: underline the focused word instead. */
.menu__link:focus-visible { outline: none; }
.menu__link:focus-visible .menu__word { text-decoration: underline; text-decoration-thickness: .05em; text-underline-offset: .06em; }
.menu__link[aria-current="page"] .menu__word::after {
  content: ""; position: absolute; left: calc(100% + .12em); top: .14em; width: .16em; height: .16em; border-radius: 50%; background: var(--accent);
}
.menu__side { display: flex; flex-direction: column; justify-content: flex-end; gap: 32px; padding-bottom: 8px;
  opacity: 0; transform: translateY(16px); transition: opacity .6s var(--ease-out) .35s, transform .8s var(--ease-out) .35s; }
.menu.is-open .menu__side { opacity: 1; transform: none; }
.menu__label { font: 500 var(--t-xs)/1 var(--f-mono); letter-spacing: .02em; text-transform: lowercase; opacity: .72; margin-bottom: 12px; }
.menu__currently li { font-size: 18px; line-height: 1.35; padding: 7px 0; border-top: 1px solid rgba(11, 20, 22, .14); }
.menu__currently li:last-child { border-bottom: 1px solid rgba(11, 20, 22, .14); }
.menu__email { display: inline-block; padding: 9px 0; margin: -9px 0; font-size: 22px; font-weight: 600; letter-spacing: -0.015em; }
.menu__clocks { font: 500 14px/1.7 var(--f-mono); }
.menu__field { position: absolute; inset: auto 0 0 0; width: 100%; height: 34vh; z-index: 1; pointer-events: none; opacity: .9; }

/* ===== Cursor ===== */
.cursor { position: fixed; left: 0; top: 0; z-index: 400; pointer-events: none; display: none; }
@media (hover: hover) and (pointer: fine) {
  .cursor { display: block; }
}
.cursor__dot { position: absolute; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: var(--cursor-dot, var(--accent)); transition: opacity .2s, transform .3s var(--ease-out); }
.cursor__ring {
  position: absolute; width: 84px; height: 84px; margin: -42px 0 0 -42px; border-radius: 50%;
  background: var(--accent); color: var(--ink);
  display: grid; place-items: center; text-align: center;
  transform: scale(0); transition: transform .45s var(--ease-out);
}
.cursor__label { font: 500 11px/1.15 var(--f-mono); letter-spacing: .02em; text-transform: lowercase; padding: 0 10px; opacity: 0; transition: opacity .2s; }
.cursor.is-active .cursor__ring { transform: scale(1); }
.cursor.is-active .cursor__label { opacity: 1; transition-delay: .08s; }
.cursor.is-active .cursor__dot { opacity: 0; }
.cursor.is-hidden .cursor__dot, .cursor.is-hidden .cursor__ring { opacity: 0; }
.cursor.is-down .cursor__dot { transform: scale(.6); }
.cursor.is-down .cursor__ring { transform: scale(.9); }

/* ===== Curtain (page transition) ===== */
.curtain { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 200; pointer-events: none; }
.curtain.is-active { pointer-events: all; }

/* ===== Toast ===== */
/* Sits in the header band, centred between the name and Menu (no page puts copy there), and drops in from above.
   Too narrow for that gap: just under the header instead. */
.toast {
  position: fixed; left: 50%; top: calc(var(--hdr-h) + 4px); z-index: 300;
  transform: translate(-50%, calc(-100% - var(--hdr-h) - 16px)); visibility: hidden; pointer-events: none;
  background: var(--sand); color: var(--ink); border-radius: 999px; padding: 12px 18px;
  font: 500 var(--t-xs)/1 var(--f-mono); letter-spacing: .02em; text-transform: lowercase;
  transition: transform .6s var(--ease-spring), visibility 0s linear .6s; display: flex; gap: 10px; align-items: center;
}
.toast::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.toast.is-on { transform: translate(-50%, 0); visibility: visible; transition-delay: 0s; }
@media (min-width: 500px) {
  .toast { top: calc(var(--hdr-h) / 2); transform: translate(-50%, calc(-50% - var(--hdr-h))); }
  .toast.is-on { transform: translate(-50%, -50%); }
}
body.menu-open .toast { background: var(--ink); color: var(--sand); }

/* ===== Reveal ===== */
/* Clip only the bottom edge (where words slide in from): side bearings and ascenders stay whole. */
[data-split] .w { display: inline-block; vertical-align: top; padding-bottom: .08em; margin-bottom: -.08em; clip-path: inset(-.4em -.25em 0 -.25em); }
[data-split] .wi { display: inline-block; transform: translateY(105%); transition: transform 1s var(--ease-out); transition-delay: calc(var(--i, 0) * 38ms + var(--d, 0ms)); }
[data-split].is-in .wi { transform: none; }
[data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease-out), transform 1.1s var(--ease-out); transition-delay: var(--d, 0ms); }
[data-reveal].is-in { opacity: 1; transform: none; }
[data-line] { position: relative; }
[data-line]::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--line); transform: scaleX(0); transform-origin: left; transition: transform 1.2s var(--ease-out); transition-delay: var(--d, 0ms); }
[data-line].is-in::before { transform: none; }
@media (forced-colors: active) { [data-line]::before { forced-color-adjust: none; background: GrayText; } }

/* ===== Footer (shared) ===== */
.foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 28px var(--gutter) calc(32px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); color: var(--sand-dim); }
.foot a:hover { color: var(--sand); }
.foot__top { display: inline-block; padding: 14px 0; margin: -14px 0; }
/* Three columns so the middle line sits on the page centre whatever the outer widths. */
@media (min-width: 720px) {
  .foot { display: grid; grid-template-columns: minmax(max-content, 1fr) auto minmax(max-content, 1fr); }
  .foot > :nth-child(2) { justify-self: center; }
  .foot > :last-child { justify-self: end; }
}
/* Too narrow for one centred row: name and "Back to top" share the first, the places get their own. */
@media (min-width: 521px) and (max-width: 719px) {
  .foot { display: grid; grid-template-columns: 1fr auto; row-gap: 12px; }
  .foot > :nth-child(2) { grid-column: 1 / -1; order: 3; justify-self: center; }
}
@media (max-width: 520px) { .foot { row-gap: 8px; } .foot > span:nth-child(2) { display: none; } }

/* ===== Responsive ===== */
@media (max-width: 820px) {
  :root { --hdr-h: 60px; }
  .hdr__mark { font-size: 17px; }
  .menu__inner { grid-template-columns: 1fr; gap: 36px; padding-top: calc(var(--hdr-h) + 24px); }
  .menu__list { justify-content: flex-start; }
  .menu__link { font-size: clamp(52px, 17vw, 96px); gap: 10px; }
  .menu__side { justify-content: flex-start; gap: 24px; }
  .menu__field { height: 22vh; }
}
@media (max-height: 520px) {
  .menu__inner { padding-top: calc(var(--hdr-h) + 8px); padding-bottom: 24px; gap: 32px; }
  .menu__link { font-size: clamp(40px, 14vh, 88px); }
  .menu__side { gap: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; transition-delay: 0ms !important; }
  [data-split] .wi, [data-reveal] { transform: none; opacity: 1; }
  .menu { transition: none; }
}
