/* Website kit: base.css
   The shared foundation for every homepage. Do not edit per site: override the tokens in home.css.
   Sections: tokens, reset, type, layout, buttons and chips, header, menu, footer, entrance, reveal, depth, parallax,
   chapter, arrive, corridor, fan, film, 3D logo, ticker, ambient, accordion, motion off.
   Everything here is a mechanism. None of it has a colour, a typeface or a shape of its own: those come from the business.
   --night is the page background and --text the page text colour (a light page overrides both). */

/* ---------- Tokens (override in home.css) ---------- */
:root {
  --brand: #2f6bff;
  --brand-ink: #ffffff;
  --accent: #ffd43b;
  --night: #050b16;
  --night-2: #0b1730;
  --paper: #f3f6fb;
  --ink: #0a1222;
  --ink-soft: #4a5872;
  --text: #e8eefa;
  --text-soft: #9fb0cc;
  --line: rgba(255, 255, 255, 0.12);
  --line-dark: rgba(10, 18, 34, 0.12);
  --glass: rgba(9, 18, 36, 0.62);
  --header-bg: linear-gradient(to bottom, rgba(5, 11, 22, 0.7), rgba(5, 11, 22, 0.35));
  --header-solid: rgba(5, 11, 22, 0.94);
  --header-text: var(--text);
  --focus: #ffd43b;
  --footer-bg: #03070f;

  --font-display: "Inter Tight", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --r-sm: 12px;
  --r-md: 20px;
  --r-lg: 32px;
  --r-pill: 999px;

  --gutter: clamp(16px, 4vw, 48px);
  --max: 1320px;
  --header-h: 68px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  background: var(--night);
  color: var(--text);
  font: 400 1rem/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, svg, video, canvas { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
.sr-only {
  position: absolute !important; 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: 12px; z-index: 100; padding: 10px 16px; border-radius: var(--r-pill);
  background: var(--accent); color: var(--ink); font-weight: 600; text-decoration: none;
  transform: translateY(-160%); transition: transform 0.2s var(--ease);
}
.skip-link:focus { transform: none; }

/* ---------- Type ---------- */
.display, h1, h2 {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 0.95;
}
.t-hero { font-size: clamp(2.6rem, 6.2vw, 5.6rem); }
.t-section { font-size: clamp(2.1rem, 4.6vw, 4.2rem); }
.t-card { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; font-size: clamp(1.25rem, 1.8vw, 1.6rem); line-height: 1.1; }
.t-lede { font-size: clamp(1.05rem, 1.35vw, 1.25rem); color: var(--text-soft); max-width: 46ch; }
.t-small { font-size: 0.875rem; }
.stop { margin-left: 0.025em; }

/* ---------- Layout ---------- */
.container { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }
.section { padding-block: clamp(72px, 10vw, 140px); position: relative; overflow-x: clip; }
.section > .container { position: relative; z-index: 1; }
.section--paper { background: var(--paper); color: var(--ink); }
.section--paper .t-lede { color: var(--ink-soft); }
.stack > * + * { margin-top: var(--stack, 1rem); }

/* ---------- Buttons and chips ---------- */
.btn {
  --bg: var(--brand); --fg: var(--brand-ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  min-height: 48px; padding: 0 22px; border: 0; border-radius: var(--r-pill);
  background: var(--bg); color: var(--fg); font-weight: 600; text-decoration: none; white-space: nowrap;
  transition: transform 0.25s var(--ease), background-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(0, 0, 0, 0.25); }
.btn--ghost { --bg: rgba(255, 255, 255, 0.08); --fg: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.btn--ghost:hover { --bg: rgba(255, 255, 255, 0.14); }
.btn--accent { --bg: var(--accent); --fg: var(--ink); }
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.08); color: var(--text); box-shadow: inset 0 0 0 1px var(--line);
  transition: background-color 0.2s var(--ease);
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.16); }
.icon-btn svg { width: 20px; height: 20px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px;
  border: 0; border-radius: var(--r-pill); background: rgba(255, 255, 255, 0.07); color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line); font-size: 0.875rem; font-weight: 500; text-decoration: none;
  transition: background-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.chip:hover, .chip[aria-pressed="true"] { background: rgba(255, 255, 255, 0.16); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3); }
@media (max-width: 760px) { .chip { min-height: 44px; } }
.link-arrow { display: inline-flex; align-items: center; gap: 0.4em; font-weight: 600; text-decoration: none; }
.link-arrow::after { content: "\2192"; transition: transform 0.2s var(--ease); }
.link-arrow:hover::after { transform: translateX(3px); }

/* ---------- Header (fixed, glass) ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--header-h);
  background: var(--header-bg); color: var(--header-text);
  backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%);
  box-shadow: inset 0 -1px 0 var(--line);
  transition: background-color 0.3s var(--ease);
}
html[data-scrolled] .site-header { background: var(--header-solid); }
.site-header .container { height: 100%; display: flex; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.brand__mark { width: 30px; height: 30px; }
.brand__logo { display: block; height: 36px; width: auto; }
.brand__name { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; letter-spacing: -0.01em; line-height: 1; }
.site-nav { display: flex; gap: 4px; margin-left: auto; }
.site-nav a {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: var(--r-pill);
  text-decoration: none; font-size: 0.94rem; font-weight: 500; color: var(--text-soft);
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); background: rgba(255, 255, 255, 0.08); }
.site-actions { display: flex; align-items: center; gap: 8px; }
.menu-btn { display: none; }
@media (max-width: 960px) {
  .site-nav { display: none; }
  .site-actions { margin-left: auto; }
  .menu-btn { display: inline-grid; }
}

/* ---------- Mobile menu ---------- */
.menu {
  position: fixed; inset: 0; z-index: 80; display: flex; flex-direction: column;
  padding: 16px var(--gutter) 32px; background: var(--brand); color: var(--brand-ink); overflow-y: auto;
}
.menu__top { display: flex; justify-content: space-between; align-items: center; min-height: calc(var(--header-h) - 16px); }
.menu__links { margin-top: 24px; display: grid; gap: 4px; }
.menu__links a {
  font-family: var(--font-display); font-weight: 800; letter-spacing: -0.03em; font-size: clamp(2rem, 9vw, 3.2rem);
  line-height: 1.1; text-decoration: none; padding-block: 6px;
}
.menu__more { margin-top: auto; padding-top: 32px; display: flex; flex-wrap: wrap; gap: 8px 20px; }
.menu__more a { text-decoration: none; opacity: 0.85; }
html[data-menu-open] { overflow: hidden; }

/* ---------- Footer ---------- */
.site-footer { background: var(--footer-bg); color: var(--text-soft); padding-block: 64px 40px; font-size: 0.94rem; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--text); text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: 1.3fr 2fr; gap: 48px; }
.footer-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 24px; }
.footer-links a { display: inline-flex; min-height: 28px; align-items: center; }
.footer-base {
  margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 12px 32px; justify-content: space-between; align-items: center; font-size: 0.84rem;
}
.motion-toggle {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px; border: 0;
  border-radius: var(--r-pill); background: rgba(255, 255, 255, 0.07); box-shadow: inset 0 0 0 1px var(--line); color: var(--text);
}
@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Entrance (first screen only, plays once on load) ----------
   .enter on the hero's parts, with style="--i: 0", 1, 2 for the order. */
html.js[data-motion="on"] .enter { animation: enter 0.7s var(--ease) both; animation-delay: calc(var(--i, 0) * 80ms + 80ms); }
@keyframes enter { from { opacity: 0; transform: translate3d(0, 22px, 0); } }

/* ---------- Reveal (scroll-position driven, reversible) ----------
   motion.js writes --r (0 to 1) on every [data-reveal]. Keep reveals out of pinned chapters.
   data-reveal="left", "right" or "zoom" changes where it comes from; a parent with data-stagger makes its reveals
   arrive one after another. */
[data-reveal] {
  --r: 1;
  opacity: var(--r);
  transform: translate3d(0, calc((1 - var(--r)) * 28px), 0);
}
[data-reveal="left"] { transform: translate3d(calc((1 - var(--r)) * -56px), 0, 0); }
[data-reveal="right"] { transform: translate3d(calc((1 - var(--r)) * 56px), 0, 0); }
[data-reveal="zoom"] { transform: scale(calc(0.92 + 0.08 * var(--r))); }
/* Hidden until motion.js writes --r inline (an inline value wins). If motion.js never arrives, the head script drops .js. */
html.js[data-motion="on"] [data-reveal] { --r: 0; }

/* ---------- Depth layers ----------
   motion.js writes --d (px) on every [data-depth]: how far its section has scrolled, times the depth.
   data-depth="0.3" drifts down at 30% of the scroll (reads as further away); negative values come forward.
   Never put data-depth and data-reveal on the same element (both use transform). */
[data-depth] { transform: translate3d(0, calc(var(--d, 0) * 1px), 0); will-change: transform; }

/* ---------- Parallax inside a frame ----------
   data-parallax on a picture whose parent has a fixed shape and overflow hidden: the picture drifts a little slower
   than its frame (motion.js writes --py). Not together with data-reveal or data-depth on the same element. */
[data-parallax] { transform: translate3d(0, calc(var(--py, 0) * 1px), 0) scale(1.14); will-change: transform; }
html:not(.js) [data-parallax], html[data-motion="off"] [data-parallax] { transform: none; }

/* ---------- Pinned chapter ----------
   A tall section with a sticky stage. motion.js writes --p (0 to 1) and data-step on the section. */
.chapter { position: relative; height: var(--chapter-h, 400vh); --p: 0; }
.chapter__stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
html:not(.js) .chapter, html[data-motion="off"] .chapter { height: auto; --p: 1; }
html:not(.js) .chapter__stage, html[data-motion="off"] .chapter__stage { position: relative; height: auto; min-height: 100vh; }

/* ---------- Arrive (inside a .chapter__stage) ----------
   Anything with .arrive comes in when the chapter's progress passes its --at (0 to 0.85) and goes back out on reverse.
   data-from="left|right|below|fade" sets where from; --span is how long it takes (default 0.14 of the chapter).
   Use it on the lines of a headline (a span per line), then on the copy, the facts, a picture. */
.arrive {
  --a0: clamp(0, calc((var(--p) - var(--at, 0)) / var(--span, 0.14)), 1);
  --a: calc(var(--a0) * var(--a0) * (3 - 2 * var(--a0)));
  opacity: var(--a);
  transform: translate3d(calc((1 - var(--a)) * var(--fx, 0px)), calc((1 - var(--a)) * var(--fy, 4vh)), 0);
}
span.arrive { display: block; }
.arrive[data-from="left"] { --fx: -12vw; --fy: 0px; }
.arrive[data-from="right"] { --fx: 12vw; --fy: 0px; }
.arrive[data-from="below"] { --fy: 9vh; }
.arrive[data-from="fade"] { --fy: 0px; }

/* ---------- Photo corridor (inside a .chapter__stage) ----------
   Rounded photos stacked in the centre spread outward with a slight 3D turn as --p grows, and gather back on reverse.
   Each .corridor__item sets where it ends: --x and --y (use vw and vh), optional --ry (turn), --w (width), --at (when it
   starts, 0 to 0.6). On phones it reads --mx, --my and --mw instead, so give both. Keep final positions clear of the caption. */
.corridor { position: absolute; inset: 0; perspective: 1400px; }
.corridor__item {
  --t0: clamp(0, calc((var(--p) - var(--at, 0.08)) / 0.5), 1);
  --t: calc(var(--t0) * var(--t0) * (3 - 2 * var(--t0)));
  position: absolute; left: 50%; top: 50%; width: var(--w, 24vw); aspect-ratio: 4 / 5; margin: 0;
  border-radius: var(--r-lg); overflow: hidden; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  transform: translate(-50%, -50%) translate3d(calc(var(--t) * var(--x, 0vw)), calc(var(--t) * var(--y, 0vh)), 0)
    rotateY(calc(var(--t) * var(--ry, 0deg))) rotate(calc((1 - var(--t)) * var(--tilt, 0deg))) scale(calc(0.7 + 0.3 * var(--t)));
}
.corridor__item img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 760px) {
  .corridor__item { width: var(--mw, 42vw); --x: var(--mx, 0vw); --y: var(--my, 0vh); --ry: 0deg; }
}

/* ---------- Photo fan (inside a .chapter__stage) ----------
   A row of pictures that starts as a tight stack and fans out sideways with a turn as --p grows.
   Each .fan__item sets --slot: 0 for the centre, -1 and 1 beside it, -2 and 2 outside (five or seven read best).
   --w is a picture's width, --gap how far apart they end, --fan-h the height of the row. Phones use --mw and --mgap. */
.fan { position: relative; height: var(--fan-h, 54vh); perspective: 1300px; }
.fan__item {
  --s0: clamp(0, calc((var(--p) - var(--at, 0.04)) / var(--span, 0.62)), 1);
  --s: calc(var(--s0) * var(--s0) * (3 - 2 * var(--s0)));
  --dist: max(var(--slot, 0), calc(-1 * var(--slot, 0)));
  --side: clamp(-1, calc(var(--slot, 0) * 100), 1);
  position: absolute; left: 50%; top: 50%; width: var(--w, 20vw); aspect-ratio: 4 / 5; margin: 0;
  border-radius: var(--r-lg); overflow: hidden; box-shadow: 0 30px 70px rgba(0, 0, 0, 0.4);
  z-index: calc(10 - var(--dist));
  opacity: calc(1 - var(--dist) * 0.28 * (1 - var(--s)));
  transform: translate(-50%, -50%) translateX(calc(var(--slot, 0) * (1.4vw + var(--s) * var(--gap, 17vw))))
    rotateY(calc(var(--side) * -1 * (5deg + var(--s) * 15deg))) scale(calc(1 - var(--dist) * (0.15 - 0.07 * var(--s))));
}
.fan__item img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 760px) {
  .fan { height: var(--fan-h-m, 46vh); }
  .fan__item { width: var(--mw, 52vw); --gap: var(--mgap, 40vw); }
}

/* ---------- Film ----------
   .film-bg fills its parent (give the parent position: relative): the still first, then the silent loop over it.
   <div class="film-bg"><img src="still" alt=""><video data-film muted loop playsinline preload="metadata" poster="still" src="loop"></video></div>
   motion.js plays it only in view with motion on, and fades to the still at the loop point. Put your own scrim on top. */
.film-bg { position: absolute; inset: 0; overflow: hidden; }
.film-bg > img, .film-bg > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.film-bg > video { opacity: 0; transition: opacity 0.45s linear; }
.film-bg > video[data-playing]:not([data-seam]) { opacity: 1; }
html[data-motion="off"] .film-bg > video { opacity: 0; }
/* The full film, opened by any [data-film-open="id"]. */
.film-dialog { width: min(92vw, 1100px); max-width: none; padding: 0; border: 0; border-radius: var(--r-md); background: #000; overflow: visible; }
.film-dialog::backdrop { background: rgba(0, 0, 0, 0.82); }
.film-dialog video { display: block; width: 100%; max-height: 82vh; border-radius: inherit; background: #000; }
.film-dialog [data-film-close] { position: absolute; right: 0; top: -54px; }

/* ---------- 3D logo (assets/js/logo3d.js) ----------
   The flat logo shows until the 3D one is ready, and stays if it never is. Size the box in home.css (width, or height). */
.logo3d { position: relative; aspect-ratio: var(--logo-aspect, 1.3); }
.logo3d > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; transition: opacity 0.5s linear; }
.logo3d > canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 0.6s linear; cursor: grab; touch-action: pan-y; }
.logo3d.has-3d > canvas { opacity: 1; }
.logo3d.has-3d > img { opacity: 0; }

/* ---------- Ticker ----------
   <p class="ticker"><span class="ticker__track"><span>Phrase one</span><span>Phrase two</span></span></p>
   motion.js repeats the phrases to fill the width and sets the speed (data-speed on .ticker, pixels a second, default 60). */
.ticker { overflow: hidden; white-space: nowrap; margin: 0; }
.ticker__track { display: inline-flex; }
.ticker__track > * { flex: none; margin-right: var(--ticker-gap, 2.5rem); }
html.js[data-motion="on"] .ticker[data-ready] .ticker__track { animation: ticker 40s linear infinite; }
@keyframes ticker { to { transform: translate3d(-50%, 0, 0); } }

/* ---------- Ambient layer ----------
   <div class="ambient" style="--tile: url('data:image/svg+xml,...'); --tile-w: 120px; --tile-h: 104px"></div> as the first
   child of a .section or .chapter__stage: a quiet repeating pattern that drifts by exactly one tile, so it never jumps.
   You draw the tile, from the business's own world. --ambient-o is its strength, --drift-x and --drift-y (0, 1 or -1)
   the direction, --ambient-speed the time for one tile. */
.ambient {
  position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; opacity: var(--ambient-o, 0.5);
  -webkit-mask-image: var(--ambient-mask, linear-gradient(to bottom, transparent, #000 16%, #000 84%, transparent));
  mask-image: var(--ambient-mask, linear-gradient(to bottom, transparent, #000 16%, #000 84%, transparent));
}
.ambient::before {
  content: ""; position: absolute; inset: calc(-1 * var(--tile-h, var(--tile-w, 120px))) calc(-1 * var(--tile-w, 120px));
  background: var(--tile) 0 0 / var(--tile-w, 120px) var(--tile-h, var(--tile-w, 120px));
}
html.js[data-motion="on"] .ambient[data-inview]::before { animation: ambient-drift var(--ambient-speed, 50s) linear infinite; }
@keyframes ambient-drift {
  to { transform: translate3d(calc(var(--tile-w, 120px) * var(--drift-x, 1)), calc(var(--tile-h, var(--tile-w, 120px)) * var(--drift-y, 0)), 0); }
}

/* ---------- Accordion (native details; give them the same name="" so one closes when another opens) ---------- */
.accordion > details { border-top: 1px solid var(--line); }
.accordion > details:last-child { border-bottom: 1px solid var(--line); }
.accordion summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; cursor: pointer; list-style: none;
  font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; letter-spacing: -0.01em;
}
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after { content: "+"; flex: none; font-weight: 400; font-size: 1.6rem; line-height: 1; transition: transform 0.25s var(--ease); }
.accordion details[open] > summary::after { transform: rotate(45deg); }
.accordion details > :not(summary) { padding-bottom: 22px; max-width: 62ch; }

/* ---------- Motion off ---------- */
html[data-motion="off"] *, html[data-motion="off"] *::before, html[data-motion="off"] *::after {
  animation-duration: 0.001s !important; animation-iteration-count: 1 !important; transition-duration: 0.001s !important;
}
