/* ------------------------------------------------------------------
   Absolute Sound — Resonance
   Base: tokens, reset, type scale, spacing rhythm, shared components
   ------------------------------------------------------------------ */

:root {
  /* palette */
  --mist: #E9ECEA;
  --graphite: #23272A;
  --lake: #2F4F7A;
  --text-2: #5A6066;
  --text-2-dark: #A8AEB3;
  --line: rgba(35, 39, 42, .14);
  --line-dark: rgba(233, 236, 234, .16);
  --field-1: #EDEDE7;
  --field-2: #A9C2B0;
  --field-3: #6E8FB8;
  --field-4: #3C5B8A;

  --bg: var(--mist);
  --fg: var(--graphite);
  --fg-2: var(--text-2);
  --rule: var(--line);

  /* type */
  --f-display: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --f-body: "Hanken Grotesk", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --t-display: clamp(2.5rem, 5vw, 4.75rem);       /* 40 → 76 */
  --t-h2: clamp(2rem, 4vw, 3.6rem);                /* 32 → 58 */
  --t-statement: clamp(1.5rem, 2.1vw, 2rem);       /* 24 → 32 */
  --t-lead: 1.125rem;                              /* 18 */
  --t-body: .9375rem;                              /* 15 */
  --t-small: .8125rem;                             /* 13 */
  --t-label: .75rem;                               /* 12 */

  /* spacing rhythm (8 base) */
  --sp-1: 8px;
  --sp-2: 16px;
  --sp-3: 24px;
  --sp-4: 40px;
  --sp-5: 64px;
  --sp-6: 104px;
  --sp-7: 168px;
  --gutter: clamp(20px, 4.4vw, 64px);
  --section: clamp(104px, 11vw, 168px);
  --nav-h: 72px;

  /* sphere */
  --sphere: min(60vmin, 640px);

  --ease-out: cubic-bezier(.22, .61, .36, 1);
}

@media (max-width: 767px) {
  :root { --sphere: 62vw; --nav-h: 64px; --section: 88px; }
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: auto; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--f-body);
  font-size: var(--t-body);
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--lake); outline-offset: 4px; border-radius: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- type ---------- */
.display, .h2, .statement {
  font-family: var(--f-display);
  font-weight: 300;
  font-optical-sizing: auto;
  font-variation-settings: "opsz" 72;
  letter-spacing: -.02em;
  line-height: 1.06;
}
.display { font-size: var(--t-display); }
.h2 { font-size: var(--t-h2); }
.statement { font-size: var(--t-statement); line-height: 1.3; letter-spacing: -.012em; }
.display em, .h2 em, .statement em { font-style: italic; font-weight: 300; color: var(--lake); }
.lead { font-size: var(--t-lead); line-height: 1.5; color: var(--fg-2); }
.body { font-size: var(--t-body); line-height: 1.6; }
.small { font-size: var(--t-small); }
.label {
  font-size: var(--t-label);
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  line-height: 1.4;
}
.muted { color: var(--fg-2); }
.num { font-weight: 300; font-variant-numeric: tabular-nums; }
.measure { max-width: 34ch; }
.measure-l { max-width: 52ch; }

/* ---------- layout ---------- */
.wrap { padding-left: var(--gutter); padding-right: var(--gutter); }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--sp-3); }
.section { padding-top: var(--section); padding-bottom: var(--section); position: relative; }
.rule { border: 0; border-top: 1px solid var(--rule); margin: 0; }

/* ---------- ground + sphere (persistent, outside #page) ---------- */
#sphere-canvas {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: -1; pointer-events: none;
}
/* reduced motion: no scrubbed transforms; the sphere simply scrolls away with the hero */
html.reduced #sphere-canvas { position: absolute; top: 0; left: 0; height: 100vh; }
#sphere { /* proxy: animated by GSAP, read by the canvas */
  position: fixed; left: 0; top: 0;
  width: var(--sphere); height: var(--sphere);
  pointer-events: none; visibility: hidden;
}
.sphere-slot { pointer-events: none; }
/* no-JS fallback: a CSS sphere in the hero slot so the page still has its identity */
html:not(.js) .sphere-slot {
  background: radial-gradient(circle at 38% 34%, var(--field-1) 0%, var(--field-2) 32%, var(--field-3) 66%, var(--field-4) 100%);
  border-radius: 50%;
}

#page { position: relative; }
main { display: block; }

/* ---------- nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  height: var(--nav-h);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 0 var(--gutter);
  color: #fff; mix-blend-mode: difference;
  pointer-events: none;
  transition: transform .55s var(--ease-out), background-color .4s var(--ease-out), color .4s var(--ease-out);
}
.nav.is-hidden { transform: translateY(-102%); }
.nav > * { pointer-events: auto; }
/* tablets and phones: a mist ground once scrolled, so content never runs through the nav */
@media (max-width: 1023px) {
  .nav.is-scrolled { background: rgba(233, 236, 234, .94); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); mix-blend-mode: normal; color: var(--graphite); box-shadow: 0 1px 0 var(--rule); }
}
/* small phones: tighter nav */
@media (max-width: 420px) {
  .nav { padding: 0 16px; }
  .nav__brand { font-size: 1.2rem; }
  .nav__right { gap: 14px; }
  .nav__sound-text { display: none; }
}
.nav__brand { font-family: var(--f-display); font-weight: 300; font-size: 1.375rem; letter-spacing: -.01em; line-height: 1; justify-self: start; white-space: nowrap; }
.nav__links { display: flex; gap: var(--sp-3); justify-self: center; }
.nav__links a { font-size: var(--t-small); font-weight: 500; letter-spacing: .01em; }
.nav__right { justify-self: end; display: flex; align-items: center; gap: var(--sp-3); }
.nav__right .ul { font-size: var(--t-small); font-weight: 500; }
.nav__menu { display: none; font-size: var(--t-label); font-weight: 500; letter-spacing: .1em; text-transform: uppercase; padding: 8px 0; }
.nav a[aria-current="page"] { opacity: .55; }
.nav a[aria-current="page"].ul { background-size: 100% 1px; background-position: left bottom; }
@media (max-width: 1023px) {
  .nav { grid-template-columns: auto 1fr auto; }
  .nav__links { display: none; }
  .nav__right .nav__circle { display: none; }
  .nav__menu { display: inline-block; }
}

/* mobile menu sheet: slides up under the sphere */
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  height: 82vh; height: 82dvh;
  background: var(--mist);
  border-top: 1px solid var(--rule);
  transform: translateY(102%);
  visibility: hidden;
  display: flex; flex-direction: column;
  padding: 0 var(--gutter) var(--sp-4);
}
.sheet__head { height: 30vh; height: 30dvh; position: relative; }
.sheet__slot { position: absolute; left: 50%; top: 50%; width: 36vw; height: 36vw; transform: translate(-50%, -50%); }
.sheet__links { display: flex; flex-direction: column; gap: 0; margin-top: auto; }
.sheet__links a {
  font-family: var(--f-display); font-weight: 300; font-size: clamp(1.75rem, 8vw, 2.5rem); letter-spacing: -.02em; line-height: 1.15;
  padding: 6px 0; border-top: 1px solid var(--rule); display: flex; justify-content: space-between; align-items: baseline;
}
.sheet__links a span { font-family: var(--f-body); font-size: var(--t-label); letter-spacing: .1em; font-weight: 300; color: var(--fg-2); }
.sheet__links a[aria-current="page"] { color: var(--lake); }
.sheet__foot { display: flex; justify-content: space-between; margin-top: var(--sp-3); color: var(--fg-2); font-size: var(--t-small); }
.sheet__close { position: absolute; right: var(--gutter); top: var(--sp-3); font-size: var(--t-label); letter-spacing: .1em; text-transform: uppercase; font-weight: 500; padding: 8px 0; }
.sheet-scrim { position: fixed; inset: 0; z-index: 29; background: rgba(35, 39, 42, .28); opacity: 0; visibility: hidden; }
body.menu-open { overflow: hidden; }

/* ---------- links: underline draws left → right ---------- */
.ul {
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-size: 0% 1px;
  background-position: right bottom;
  padding-bottom: 2px;
  transition: background-size .45s var(--ease-out);
}
.ul:hover, .ul:focus-visible { background-size: 100% 1px; background-position: left bottom; }
.ul-arrow::after { content: "\2192"; display: inline-block; margin-left: .5em; transition: transform .45s var(--ease-out); }
.ul-arrow:hover::after { transform: translateX(4px); }
.lk { color: var(--lake); }

/* ---------- pill buttons: fill slides up ---------- */
.pill {
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 44px; padding: 0 22px;
  border: 1px solid currentColor; border-radius: 999px;
  font-size: var(--t-label); font-weight: 500; letter-spacing: .1em; text-transform: uppercase;
  line-height: 1; white-space: nowrap;
  transition: color .45s var(--ease-out), border-color .45s var(--ease-out);
}
.pill::before {
  content: ""; position: absolute; inset: -1px; z-index: -1; border-radius: inherit;
  background: var(--graphite);
  transform: translateY(102%);
  transition: transform .5s var(--ease-out);
}
.pill:hover, .pill:focus-visible { color: var(--mist); border-color: var(--graphite); }
.pill:hover::before, .pill:focus-visible::before { transform: translateY(0); }
.pill--solid { background: var(--graphite); color: var(--mist); border-color: var(--graphite); }
.pill--solid::before { background: var(--lake); }
.pill--solid:hover { border-color: var(--lake); }
.dark .pill { color: var(--mist); }
.dark .pill::before { background: var(--mist); }
.dark .pill:hover, .dark .pill:focus-visible { color: var(--graphite); border-color: var(--mist); }
.pill--sm { min-height: 36px; padding: 0 16px; }

/* ---------- eyebrow + heading block ---------- */
.kicker { display: flex; align-items: center; gap: 12px; color: var(--fg-2); margin-bottom: var(--sp-3); }
.kicker::before { content: ""; width: 20px; height: 1px; background: currentColor; opacity: .6; }
.dark .kicker { color: var(--text-2-dark); }

/* ---------- SplitText masks ---------- */
.split-line { overflow: hidden; }
.js .reveal-y { opacity: 0; }
.js .reveal-y.is-in { opacity: 1; }
html.js.reduced .reveal-y { opacity: 1; }

/* ---------- logo normalisation ---------- */
.logo { display: block; width: 100%; height: 100%; object-fit: contain; }
.logo-tile { position: relative; display: grid; place-items: center; overflow: hidden; }
.logo-tile .logo { filter: grayscale(1) contrast(1.1); mix-blend-mode: multiply; transition: filter .4s var(--ease-out); }
.logo-tile:hover .logo, .logo-tile.is-color .logo { filter: none; }
/* logos that come on a black background: crop the black away by showing them on dark grounds only */
.logo-tile--onlight [data-logo-bg="dark"] { filter: grayscale(1) invert(1) contrast(1.1); mix-blend-mode: multiply; }
.logo-tile--onlight:hover [data-logo-bg="dark"] { filter: invert(1); }
.logo-tile--ondark .logo { filter: grayscale(1) invert(1); mix-blend-mode: screen; }
.logo-tile--ondark [data-logo-bg="dark"] { filter: grayscale(1); mix-blend-mode: screen; }
.logo-tile--ondark:hover .logo { filter: invert(1); }
.logo-tile--ondark:hover [data-logo-bg="dark"] { filter: none; }

/* ---------- footer (dark) ---------- */
.dark { --fg: var(--mist); --fg-2: var(--text-2-dark); --rule: var(--line-dark); color: var(--mist); }
.footer { padding-top: var(--section); padding-bottom: var(--sp-4); position: relative; background: var(--graphite); }
/* while the sphere is in the footer the canvas is lifted to z 1: the footer's content sits above it */
.footer > * { position: relative; z-index: 2; }
.footer__cta { min-height: 52vh; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; }
.footer__cta .h2 { max-width: 16ch; }
.footer__cta .lead { margin-top: var(--sp-3); }
.footer__cta .pill { margin-top: var(--sp-4); }
.footer__cols { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--sp-3); row-gap: var(--sp-4); padding-top: var(--sp-5); margin-top: var(--sp-6); border-top: 1px solid var(--rule); }
.footer__col { grid-column: span 3; }
.footer__col .label { color: var(--fg-2); margin-bottom: var(--sp-2); display: block; }
.footer__col li { line-height: 1.7; }
.footer__col a { display: inline-block; }
.footer__bottom { display: flex; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; margin-top: var(--sp-6); color: var(--fg-2); font-size: var(--t-small); }
.footer__legal { display: flex; gap: var(--sp-3); }
@media (max-width: 767px) {
  .footer__col { grid-column: span 6; }
}

/* ---------- utilities ---------- */
.hide-desktop { display: none; }
@media (max-width: 1023px) { .hide-desktop { display: block; } .hide-mobile { display: none !important; } }
.js .lazy-fade { opacity: 0; }
.js .lazy-fade.is-in { opacity: 1; }
html.js.reduced .lazy-fade { opacity: 1; }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
  .js .reveal-y, .js .lazy-fade { opacity: 1; }
}
