/* ==========================================================================
   MAGAS Brand Guidelines — interactive site
   Design system + shell. Source of truth: Figma k3KDQS3KCz2rZiIBEZpb2I,
   page "Brand Playbook" (382:265). Sizes follow the 1920px Figma canvas and
   scale with the window (1 figma px = 100vw / 1920), clamped for small screens.
   ========================================================================== */

:root {
  /* Brand palette (Figma fills) */
  --m-purple: #652FEA;
  --m-violet: #7E69F5;
  --m-purple-deep: #4C1CC2;
  --m-navy: #0E133C;
  --m-navy-2: #151A4A;
  --m-lilac: #9FADD3;
  --m-lilac-2: #C1CFF3;
  --m-lilac-3: #EAF1FF;
  --m-steel: #8B99BE;
  --m-white: #FBFBFF;
  --m-ink: #0E133C;

  /* Semantic */
  --bg: var(--m-white);
  --fg: var(--m-ink);
  --fg-soft: rgba(14, 19, 60, .72);
  --line: rgba(14, 19, 60, .14);
  --tile: rgba(14, 19, 60, .045);   /* info tiles: fill, no stroke */
  --accent: var(--m-purple);

  /* Type */
  --font-display: "Sora", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Sora", ui-sans-serif, system-ui, sans-serif;
  --font-plex: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --font-ar: "IBM Plex Sans Arabic", "Sora", sans-serif;

  /* figma px → fluid */
  --fx: calc(100vw / 1920);
  --t-mega: clamp(56px, calc(248 * var(--fx)), 248px);
  --t-display: clamp(44px, calc(128 * var(--fx)), 128px);
  --t-h1: clamp(40px, calc(96 * var(--fx)), 96px);
  --t-h2: clamp(32px, calc(64 * var(--fx)), 64px);
  --t-h3: clamp(24px, calc(40 * var(--fx)), 40px);
  --t-h4: clamp(20px, calc(32 * var(--fx)), 32px);
  --t-lead: clamp(18px, calc(28 * var(--fx)), 28px);
  --t-body: clamp(16px, calc(22 * var(--fx)), 22px);
  --t-small: clamp(14px, calc(18 * var(--fx)), 18px);
  --t-micro: clamp(12px, calc(14 * var(--fx)), 14px);

  /* Space */
  --gutter: clamp(20px, calc(120 * var(--fx)), 120px);
  --s-1: clamp(4px, calc(8 * var(--fx)), 8px);
  --s-2: clamp(8px, calc(16 * var(--fx)), 16px);
  --s-3: clamp(12px, calc(24 * var(--fx)), 24px);
  --s-4: clamp(16px, calc(32 * var(--fx)), 32px);
  --s-5: clamp(24px, calc(48 * var(--fx)), 48px);
  --s-6: clamp(32px, calc(64 * var(--fx)), 64px);
  --s-7: clamp(48px, calc(96 * var(--fx)), 96px);
  --s-8: clamp(64px, calc(140 * var(--fx)), 140px);

  --r-chip: 6px;
  --r-card: clamp(14px, calc(24 * var(--fx)), 24px);
  --r-panel: clamp(20px, calc(40 * var(--fx)), 40px);

  --ease: cubic-bezier(.16, 1, .3, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
  --bar-h: clamp(64px, calc(96 * var(--fx)), 96px);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: auto; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: var(--font-body); font-size: var(--t-body); line-height: 1.55;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility; overflow-x: hidden;
}
img, svg, video { 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, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
::selection { background: var(--m-purple); color: #fff; }
:focus-visible { outline: 2px solid var(--m-purple); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- view transitions between chapters ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .45s var(--ease-io) both; }
::view-transition-new(root) { animation: vt-in .7s var(--ease) both; }
@keyframes vt-out { to { opacity: 0; transform: scale(.985); filter: blur(6px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(24px); } }
::view-transition-group(chapter-title) { animation-duration: .7s; animation-timing-function: var(--ease); }

/* ---------- type ---------- */
.t-mega { font: 700 var(--t-mega)/.9 var(--font-display); letter-spacing: -.045em; }
.t-display { font: 700 var(--t-display)/.95 var(--font-display); letter-spacing: -.035em; }
.t-h1 { font: 600 var(--t-h1)/1.02 var(--font-display); letter-spacing: -.03em; }
.t-h2 { font: 600 var(--t-h2)/1.08 var(--font-display); letter-spacing: -.025em; }
.t-h3 { font: 600 var(--t-h3)/1.15 var(--font-display); letter-spacing: -.015em; }
.t-h4 { font: 600 var(--t-h4)/1.25 var(--font-display); letter-spacing: -.01em; }
.t-lead { font-size: var(--t-lead); line-height: 1.45; }
.t-small { font-size: var(--t-small); line-height: 1.5; }
.t-micro { font-size: var(--t-micro); line-height: 1.4; letter-spacing: .02em; }
.t-eyebrow { font: 600 var(--t-micro)/1.2 var(--font-display); letter-spacing: .14em; text-transform: uppercase; }
.t-soft { color: var(--fg-soft); }
.t-ar { font-family: var(--font-ar); direction: rtl; unicode-bidi: isolate; }
.balance { text-wrap: balance; }
.pretty { text-wrap: pretty; }

/* ---------- themes (sections) ---------- */
.th-white  { --bg: #fff; --fg: var(--m-navy); --fg-soft: rgba(14,19,60,.7); --line: rgba(14,19,60,.14); --tile: rgba(14,19,60,.045); background: var(--bg); color: var(--fg); }
.th-paper  { --bg: var(--m-white); --fg: var(--m-navy); --fg-soft: rgba(14,19,60,.7); --line: rgba(14,19,60,.14); --tile: rgba(101,47,234,.06); background: var(--bg); color: var(--fg); }
.th-navy   { --bg: var(--m-navy); --fg: #fff; --fg-soft: rgba(255,255,255,.72); --line: rgba(255,255,255,.16); --tile: rgba(255,254,255,.06); background: var(--bg); color: var(--fg); }
.th-purple { --bg: var(--m-purple); --fg: #fff; --fg-soft: rgba(255,255,255,.8); --line: rgba(255,255,255,.22); --tile: rgba(255,255,255,.09); background: var(--bg); color: var(--fg); }
.th-lilac  { --bg: var(--m-lilac); --fg: var(--m-navy); --fg-soft: rgba(14,19,60,.75); --line: rgba(14,19,60,.18); --tile: rgba(255,255,255,.28); background: var(--bg); color: var(--fg); }
.th-ink    { --bg: #05061A; --fg: #fff; --fg-soft: rgba(255,255,255,.7); --line: rgba(255,255,255,.14); --tile: rgba(255,255,255,.05); background: var(--bg); color: var(--fg); }

/* ---------- layout ---------- */
.wrap { padding-inline: var(--gutter); }
.sec { position: relative; padding-block: var(--s-8); overflow: clip; }
.sec--tight { padding-block: var(--s-7); }
.sec--screen { min-height: 100svh; display: flex; flex-direction: column; justify-content: center; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-6); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-4); }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-4); }
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--s-7); align-items: start; }
.stack > * + * { margin-top: var(--s-3); }
.stack-lg > * + * { margin-top: var(--s-5); }
.measure { max-width: 46ch; }
.measure-wide { max-width: 64ch; }
@media (max-width: 900px) {
  .grid-2, .grid-3, .split { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* section head: title left, brand-shape cluster right (Figma pattern) */
.sec-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-5); margin-bottom: var(--s-6); }
.sec-head .t-h2 { max-width: 18ch; }
.sec-num { font: 500 var(--t-micro)/1 var(--font-display); letter-spacing: .14em; color: var(--fg-soft); display: block; margin-bottom: var(--s-2); }

/* ---------- brand shapes ---------- */
.shape { width: 1em; height: 1em; flex: none; }
.shapes { display: inline-flex; gap: .55em; align-items: center; font-size: clamp(18px, calc(31 * var(--fx)), 31px); }
.shapes .shape { transition: transform .6s var(--ease); }
.shapes:hover .shape:nth-child(1) { transform: rotate(-90deg); }
.shapes:hover .shape:nth-child(2) { transform: rotate(90deg) scale(1.1); }
.shapes:hover .shape:nth-child(3) { transform: rotate(45deg); }
.shapes:hover .shape:nth-child(4) { transform: rotate(180deg); }
.shapes--grid { display: inline-grid; grid-template-columns: repeat(2, 1em); gap: .45em; }
.shapes--col { flex-direction: column; }

/* ---------- plus list (Figma "+" bullets) ---------- */
.plus-list { display: grid; gap: .55em; }
.plus-list li { position: relative; padding-left: 1.6em; }
.plus-list li::before {
  content: ""; position: absolute; left: 0; top: .45em; width: .8em; height: .8em;
  background: currentColor; opacity: .9;
  -webkit-mask: linear-gradient(#000 0 0) center/100% 1.5px no-repeat, linear-gradient(#000 0 0) center/1.5px 100% no-repeat;
          mask: linear-gradient(#000 0 0) center/100% 1.5px no-repeat, linear-gradient(#000 0 0) center/1.5px 100% no-repeat;
}

/* ---------- chips (Figma 6px pills) ---------- */
.chip {
  display: inline-flex; align-items: center; gap: .5em; white-space: nowrap;
  padding: .42em .8em; border-radius: var(--r-chip);
  font: 400 clamp(13px, calc(20 * var(--fx)), 20px)/1.2 var(--font-display);
  background: var(--m-lilac); color: var(--m-navy);
  transition: background .25s, color .25s, transform .35s var(--ease), box-shadow .35s;
}
a.chip, button.chip { cursor: pointer; }
a.chip:hover, button.chip:hover { background: #fff; transform: translateY(-2px); box-shadow: 0 10px 24px -12px rgba(14,19,60,.5); }
.chip.is-active, .chip[aria-current="true"], .chip[aria-pressed="true"] { background: var(--m-navy); color: #fff; }
.chip--purple { background: var(--m-purple); color: #fff; }
.chip--navy { background: var(--m-navy); color: #fff; }
.chip--white { background: #fff; color: var(--m-navy); }
.chip--ghost { background: rgba(255,255,255,.14); color: #fff; backdrop-filter: blur(8px); }
.chips { display: flex; flex-wrap: wrap; gap: clamp(8px, calc(22 * var(--fx)), 22px); }
.chips--center { justify-content: center; }

/* ---------- buttons / interactive surfaces (stroke = state) ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .6em; padding: .85em 1.3em; border-radius: 999px;
  font: 600 var(--t-small)/1 var(--font-display); background: var(--m-purple); color: #fff;
  transition: transform .35s var(--ease), background .25s, box-shadow .35s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 16px 30px -14px rgba(101,47,234,.8); }
.btn--ghost { background: transparent; color: var(--fg); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn--ghost:hover { box-shadow: inset 0 0 0 1.5px var(--fg); }
.ctrl {
  border-radius: 12px; box-shadow: inset 0 0 0 1.5px var(--line); padding: .7em 1em;
  transition: box-shadow .25s, background .25s, transform .3s var(--ease);
}
.ctrl:hover { box-shadow: inset 0 0 0 1.5px var(--fg); }
.ctrl[aria-pressed="true"], .ctrl.is-active { background: var(--fg); color: var(--bg); box-shadow: none; }

/* info tile: light fill, NO stroke */
.tile { background: var(--tile); border-radius: var(--r-card); padding: var(--s-4); }

/* ---------- fluted glass (Figma "Group 35" panel) ---------- */
.glass {
  position: relative; isolation: isolate; overflow: hidden; border-radius: var(--r-panel);
  background: linear-gradient(180deg, rgba(101,47,234,.92) 0%, rgba(101,47,234,.62) 55%, rgba(101,47,234,.32) 100%);
  -webkit-backdrop-filter: blur(28px) saturate(1.2); backdrop-filter: blur(28px) saturate(1.2);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.22), 0 40px 120px -40px rgba(14,19,60,.7);
  color: #fff;
}
.glass::before { /* flutes */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  --flute: clamp(22px, calc(43 * var(--fx)), 43px);
  background:
    repeating-linear-gradient(90deg,
      rgba(255,255,255,.0) 0, rgba(255,255,255,.07) calc(var(--flute) * .45),
      rgba(255,255,255,.0) calc(var(--flute) - 1.5px),
      rgba(255,255,255,.34) calc(var(--flute) - 1px), rgba(255,255,255,.0) var(--flute));
  mix-blend-mode: soft-light;
}
.glass::after { /* pointer sheen */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: var(--sheen-o, 0);
  background: radial-gradient(40% 70% at var(--mx, 50%) var(--my, 30%), rgba(255,255,255,.35), transparent 70%);
  mix-blend-mode: overlay; transition: opacity .6s;
}
.glass:hover { --sheen-o: 1; }
.glass--navy { background: linear-gradient(180deg, rgba(14,19,60,.88), rgba(14,19,60,.55)); }

/* ---------- top bar ---------- */
.bar {
  position: fixed; inset: 0 0 auto 0; z-index: 60; height: var(--bar-h);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding-inline: var(--gutter);
  color: #fff; pointer-events: none; transition: color .4s, transform .5s var(--ease);
}
.bar > * { pointer-events: auto; }
.bar.on-light { color: var(--m-navy); }
.bar.is-hidden { transform: translateY(-110%); }
.bar__logo { display: inline-flex; align-items: center; justify-self: start; gap: .7em; }
.bar__logo svg { height: clamp(34px, calc(59 * var(--fx)), 59px); width: auto; transition: transform .6s var(--ease); }
.bar__logo:hover svg { transform: rotate(-8deg) scale(1.06); }
.bar__shapes { justify-self: center; }
.bar__right { justify-self: end; display: flex; align-items: center; gap: var(--s-4); font-size: var(--t-small); }
.bar__right b { font-weight: 700; }
.bar__menu {
  display: inline-flex; align-items: center; gap: .6em; padding: .55em .95em; border-radius: 999px;
  background: rgba(255,255,255,.14); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.28); font: 500 var(--t-micro)/1 var(--font-display); letter-spacing: .06em;
  transition: background .3s, box-shadow .3s;
}
.bar.on-light .bar__menu { background: rgba(14,19,60,.06); box-shadow: inset 0 0 0 1px rgba(14,19,60,.2); }
.bar__menu:hover { background: rgba(255,255,255,.26); }
.bar__menu i { display: grid; gap: 3px; }
.bar__menu i::before, .bar__menu i::after { content: ""; width: 14px; height: 1.5px; background: currentColor; border-radius: 2px; }
.bar__back { display: inline-flex; align-items: center; gap: .45em; font: 500 var(--t-small)/1 var(--font-display); }
.bar__back svg { width: 1em; transition: transform .35s var(--ease); }
.bar__back:hover svg { transform: translateX(-4px); }
@media (max-width: 720px) { .bar__shapes, .bar__credit { display: none; } .bar { grid-template-columns: 1fr auto; } }

/* scroll progress */
.progress { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 70; transform-origin: 0 50%; transform: scaleX(var(--p, 0)); background: linear-gradient(90deg, var(--m-violet), var(--m-purple)); }

/* ---------- chapter index overlay ---------- */
.index {
  position: fixed; inset: 0; z-index: 90; display: grid; grid-template-rows: auto 1fr auto; padding: var(--s-5) var(--gutter);
  background: rgba(14,19,60,.86); -webkit-backdrop-filter: blur(30px) saturate(1.3); backdrop-filter: blur(30px) saturate(1.3);
  color: #fff; opacity: 0; visibility: hidden; transition: opacity .5s var(--ease), visibility 0s .5s;
}
.index.is-open { opacity: 1; visibility: visible; transition: opacity .5s var(--ease); }
.index__top { display: flex; justify-content: space-between; align-items: center; }
.index__close { display: inline-flex; align-items: center; gap: .6em; padding: .6em 1em; border-radius: 999px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.3); font: 500 var(--t-micro)/1 var(--font-display); letter-spacing: .06em; }
.index__close:hover { background: rgba(255,255,255,.12); }
.index__list { align-self: center; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--s-7); }
.index__item {
  display: grid; grid-template-columns: 3.2em 1fr auto; align-items: center; gap: var(--s-3);
  padding: clamp(10px, calc(18 * var(--fx)), 18px) 0; border-bottom: 1px solid rgba(255,255,255,.12);
  font: 600 var(--t-h4)/1.1 var(--font-display); letter-spacing: -.01em;
  opacity: 0; transform: translateY(18px); transition: color .25s, padding .4s var(--ease);
}
.index.is-open .index__item { opacity: 1; transform: none; transition: opacity .6s var(--ease) calc(var(--i) * 40ms + 100ms), transform .7s var(--ease) calc(var(--i) * 40ms + 100ms), color .25s, padding .4s var(--ease); }
.index__item small { font: 500 var(--t-micro)/1 var(--font-display); letter-spacing: .1em; color: var(--m-lilac); }
.index__item .arrow { width: 1em; opacity: 0; transform: translateX(-10px); transition: .35s var(--ease); }
.index__item:hover { color: var(--m-lilac-2); padding-left: .4em; }
.index__item:hover .arrow { opacity: 1; transform: none; }
.index__item[aria-current="page"] { color: var(--m-violet); }
.index__peek { position: fixed; z-index: -1; width: min(34vw, 520px); aspect-ratio: 3/2; border-radius: var(--r-card); overflow: hidden; pointer-events: none; opacity: 0; transform: scale(.9) rotate(-3deg); transition: opacity .35s, transform .5s var(--ease); left: 0; top: 0; }
.index__peek.is-on { opacity: .9; transform: scale(1) rotate(-3deg); }
.index__peek img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 900px) { .index__list { grid-template-columns: 1fr; } .index__peek { display: none; } }

/* ---------- chapter hero (Figma: fluted card on purple) ---------- */
.ch-hero { position: relative; min-height: 100svh; display: grid; padding: calc(var(--bar-h) + var(--s-3)) var(--gutter) var(--s-5); background: var(--m-purple); color: #fff; overflow: clip; }
.ch-hero .glass { display: grid; place-items: center; text-align: center; padding: var(--s-7) var(--s-5); min-height: calc(100svh - var(--bar-h) - var(--s-3) - var(--s-5)); }
.ch-hero__media { position: absolute; inset: 0; z-index: -2; display: grid; place-items: center; pointer-events: none; }
.ch-hero__media img { width: min(62%, 980px); height: auto; object-fit: contain; filter: drop-shadow(0 50px 60px rgba(14,19,60,.35)); will-change: transform; }
.ch-hero__title { view-transition-name: chapter-title; font: 700 var(--t-display)/.95 var(--font-display); letter-spacing: -.035em; text-shadow: 0 10px 50px rgba(14,19,60,.25); }
.ch-hero__num { font: 500 var(--t-micro)/1 var(--font-display); letter-spacing: .2em; text-transform: uppercase; opacity: .8; margin-bottom: var(--s-3); }
.ch-hero__chips { margin-top: var(--s-5); }
.ch-hero__chips .chip { background: rgba(255,255,255,.92); }
.ch-hero__chips .chip:hover { background: #fff; }
.ch-hero__cue { position: absolute; left: 50%; bottom: var(--s-4); transform: translateX(-50%); font: 500 var(--t-micro)/1 var(--font-display); letter-spacing: .14em; text-transform: uppercase; opacity: .7; display: grid; justify-items: center; gap: .8em; }
.ch-hero__cue::after { content: ""; width: 1px; height: 36px; background: linear-gradient(#fff, transparent); animation: cue 2.2s var(--ease) infinite; transform-origin: top; }
@keyframes cue { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

/* ---------- section rail (right) ---------- */
.rail { position: fixed; right: clamp(10px, 1.6vw, 28px); top: 50%; transform: translateY(-50%); z-index: 55; display: grid; gap: 10px; }
.rail a { position: relative; display: block; width: 10px; height: 10px; }
.rail a::before { content: ""; position: absolute; inset: 2px; border-radius: 2px; transform: rotate(45deg); background: currentColor; opacity: .35; transition: opacity .3s, inset .3s var(--ease), background .3s; }
.rail a.is-active::before { opacity: 1; inset: 0; background: var(--m-purple); }
.rail a span { position: absolute; right: 22px; top: 50%; transform: translate(6px, -50%); white-space: nowrap; padding: .35em .7em; border-radius: 6px; font: 500 12px/1 var(--font-display); background: var(--m-navy); color: #fff; opacity: 0; pointer-events: none; transition: .3s var(--ease); }
.rail a:hover span, .rail a:focus-visible span { opacity: 1; transform: translate(0, -50%); }
.rail { color: var(--rail-c, var(--m-navy)); }
@media (max-width: 900px) { .rail { display: none; } }

/* ---------- chapter footer (Figma: purple band, prev / next) ---------- */
.ch-foot { display: grid; grid-template-columns: 1fr 1fr; background: var(--m-purple); color: #fff; }
.ch-foot a { position: relative; display: grid; gap: .5em; padding: var(--s-7) var(--gutter); overflow: hidden; isolation: isolate; }
.ch-foot a + a { text-align: right; justify-items: end; box-shadow: inset 1px 0 0 rgba(255,255,255,.18); }
.ch-foot small { font: 500 var(--t-micro)/1 var(--font-display); letter-spacing: .14em; text-transform: uppercase; opacity: .75; }
.ch-foot strong { display: inline-flex; align-items: center; gap: .45em; font: 600 var(--t-h3)/1.1 var(--font-display); letter-spacing: -.015em; }
.ch-foot svg { width: .9em; transition: transform .45s var(--ease); }
.ch-foot a::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--m-purple-deep); transform: scaleY(0); transform-origin: bottom; transition: transform .6s var(--ease); }
.ch-foot a:hover::before { transform: scaleY(1); }
.ch-foot a:first-child:hover svg { transform: translateX(-8px); }
.ch-foot a:last-child:hover svg { transform: translateX(8px); }
.site-foot { display: flex; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; padding: var(--s-4) var(--gutter); font-size: var(--t-micro); background: var(--m-navy); color: rgba(255,255,255,.7); }
.site-foot b { color: #fff; }

/* ---------- reveal (JS adds .is-in; no-JS shows everything) ---------- */
.js [data-reveal] { opacity: 0; transform: translateY(32px); transition: opacity 1s var(--ease), transform 1.1s var(--ease); transition-delay: calc(var(--d, 0) * 1ms); }
.js [data-reveal].is-in { opacity: 1; transform: none; }
.js [data-reveal="scale"] { transform: scale(.94); }
.js [data-reveal="left"] { transform: translateX(-40px); }
.split-line { display: block; overflow: hidden; padding-bottom: .06em; margin-bottom: -.06em; }
.split-line > span { display: inline-block; will-change: transform; }

/* ---------- cursor (precision ring) ---------- */
.cursor { position: fixed; left: 0; top: 0; z-index: 100; pointer-events: none; mix-blend-mode: difference; }
.cursor__dot, .cursor__ring { position: absolute; left: 0; top: 0; border-radius: 50%; transform: translate(-50%, -50%); }
.cursor__dot { width: 6px; height: 6px; background: #fff; }
.cursor__ring { width: 34px; height: 34px; box-shadow: inset 0 0 0 1.5px #fff; transition: width .35s var(--ease), height .35s var(--ease), border-radius .35s var(--ease), transform .35s var(--ease); }
.cursor.is-link .cursor__ring { width: 58px; height: 58px; border-radius: 12px; transform: translate(-50%, -50%) rotate(45deg); }
.cursor.is-down .cursor__ring { width: 24px; height: 24px; }
.cursor__label { position: absolute; left: 22px; top: 18px; white-space: nowrap; font: 600 11px/1 var(--font-display); letter-spacing: .1em; text-transform: uppercase; color: #fff; opacity: 0; transition: opacity .25s; }
.cursor.has-label .cursor__label { opacity: 1; }
@media (hover: none), (pointer: coarse) { .cursor { display: none; } }

/* ---------- toast (copy feedback) ---------- */
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 120; transform: translate(-50%, 20px); opacity: 0; padding: .8em 1.2em; border-radius: 999px; background: var(--m-navy); color: #fff; font: 500 var(--t-small)/1 var(--font-display); box-shadow: 0 20px 40px -18px rgba(14,19,60,.7); transition: .45s var(--ease); pointer-events: none; display: flex; gap: .6em; align-items: center; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast i { width: 14px; height: 14px; border-radius: 3px; background: var(--sw, var(--m-purple)); box-shadow: inset 0 0 0 1px rgba(255,255,255,.4); }

/* ---------- lightbox ---------- */
.lb { position: fixed; inset: 0; z-index: 110; display: grid; grid-template-rows: 1fr auto; place-items: center; padding: var(--s-5); background: rgba(5,6,26,.92); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); color: #fff; opacity: 0; visibility: hidden; transition: opacity .4s var(--ease), visibility 0s .4s; }
.lb.is-open { opacity: 1; visibility: visible; transition: opacity .4s var(--ease); }
.lb img { max-width: 92vw; max-height: 78vh; border-radius: var(--r-card); object-fit: contain; box-shadow: 0 40px 100px -30px #000; }
.lb__cap { display: flex; align-items: center; gap: var(--s-4); font-size: var(--t-small); }
.lb__btn { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; box-shadow: inset 0 0 0 1px rgba(255,255,255,.3); }
.lb__btn:hover { background: rgba(255,255,255,.12); }
.lb__btn svg { width: 18px; }
.lb__close { position: absolute; top: var(--s-4); right: var(--s-4); }

/* ---------- media helpers ---------- */
.media { position: relative; overflow: hidden; border-radius: var(--r-card); background: var(--tile); }
.media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.media--zoom:hover img { transform: scale(1.05); }
.media--contain img { object-fit: contain; }
.zoomable { cursor: zoom-in; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
  .cursor { display: none; }
}

/* brand-shape colours: dark surfaces = white/lilac, light surfaces = navy/purple (Figma) */
.shapes { --sa: #fff; --sb: var(--m-lilac); }
.th-white .shapes, .th-paper .shapes, .th-lilac .shapes, .bar.on-light .shapes, .shapes.on-light { --sa: var(--m-navy); --sb: var(--m-purple); }
.sh-a { color: var(--sa); } .sh-b { color: var(--sb); }

/* index overlay: compact rows, scroll if the window is short */
.index { overflow-y: auto; overscroll-behavior: contain; gap: var(--s-4); }
.index__list { align-content: center; }
.index__item { font-size: clamp(18px, calc(30 * var(--fx)), 30px); padding: clamp(10px, calc(16 * var(--fx)), 16px) 0; }
.index__list { grid-template-rows: repeat(6, auto); grid-auto-flow: column; }
.index__item { font-size: clamp(20px, calc(40 * var(--fx)), 40px); }
@media (max-width: 900px) { .index__list { grid-template-rows: none; grid-auto-flow: row; } }
