/* ==========================================================================
   SANFRAMEDIA — design system
   Editorial, kinetic, unapologetically bold.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Fonts (bundled — zero external requests)
   -------------------------------------------------------------------------- */
@font-face {
  font-family: 'Space Grotesk';
  src: url('../fonts/space-grotesk.woff2') format('woff2');
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: 'Instrument Serif';
  src: url('../fonts/instrument-serif.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Instrument Serif';
  src: url('../fonts/instrument-serif-italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('../fonts/inter.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

/* --------------------------------------------------------------------------
   Tokens
   -------------------------------------------------------------------------- */
:root {
  --ink: #0a0a0c;
  --ink-soft: #131318;
  --paper: #f4f1ea;
  --paper-soft: #eae6dc;
  --accent: #ff3d2e;
  --accent-deep: #d92819;
  --violet: #6c5bff;

  --font-display: 'Space Grotesk', 'Helvetica Neue', Arial, sans-serif;
  --font-serif: 'Instrument Serif', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --size-hero: clamp(2.9rem, 8.2vw, 8rem);
  --size-h2: clamp(2.1rem, 5.4vw, 4.6rem);
  --size-h3: clamp(1.4rem, 2.6vw, 2.1rem);
  --size-body: clamp(1rem, 1.1vw, 1.125rem);

  --pad-x: clamp(20px, 4.5vw, 76px);
  --pad-section: clamp(80px, 11vw, 170px);

  --ease-out: cubic-bezier(0.19, 1, 0.22, 1);
  --ease-swift: cubic-bezier(0.65, 0, 0.35, 1);
  --dur: 0.9s;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--size-body);
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  overflow-x: clip;
}

body.menu-open,
body.is-loading { overflow: hidden; }

img { max-width: 100%; height: auto; display: block; }

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0 0 1em; }

::selection { background: var(--accent); color: var(--paper); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

.skip-link {
  position: fixed;
  top: 10px; left: 10px;
  z-index: 10000;
  padding: 10px 18px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 100px;
  transform: translateY(-300%);
  transition: transform 0.3s var(--ease-out);
}
.skip-link:focus { transform: none; }

/* Section theming ---------------------------------------------------------- */
.theme-dark {
  --bg: var(--ink);
  --fg: var(--paper);
  --muted: rgba(244, 241, 234, 0.55);
  --line: rgba(244, 241, 234, 0.16);
  background: var(--bg);
  color: var(--fg);
}
.theme-light {
  --bg: var(--paper);
  --fg: var(--ink);
  --muted: rgba(10, 10, 12, 0.55);
  --line: rgba(10, 10, 12, 0.14);
  background: var(--bg);
  color: var(--fg);
}
.theme-accent {
  --bg: var(--accent);
  --fg: var(--ink);
  --muted: rgba(10, 10, 12, 0.6);
  --line: rgba(10, 10, 12, 0.22);
  background: var(--bg);
  color: var(--fg);
}

.wrap {
  padding-inline: var(--pad-x);
  max-width: 1680px;
  margin-inline: auto;
}

.section { padding-block: var(--pad-section); }

/* Film-grain overlay */
.grain {
  position: fixed;
  inset: -80px;
  z-index: 2000;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 0.9s steps(4) infinite;
}
@keyframes grain {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(-24px, 18px); }
  50%  { transform: translate(16px, -22px); }
  75%  { transform: translate(-12px, -14px); }
  100% { transform: translate(0, 0); }
}

/* --------------------------------------------------------------------------
   Typographic accents
   -------------------------------------------------------------------------- */
.fx {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.015em;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted, rgba(10,10,12,0.55));
  margin-bottom: clamp(20px, 3vw, 36px);
}
.eyebrow::before {
  content: '';
  width: 34px; height: 1px;
  background: var(--accent);
  flex: none;
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.04em;
  line-height: 1;
  white-space: nowrap;
}
.wordmark em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
}
.wordmark sup {
  font-size: 0.45em;
  font-family: var(--font-body);
  font-weight: 400;
  margin-left: 2px;
  opacity: 0.6;
}

/* --------------------------------------------------------------------------
   Buttons & links
   -------------------------------------------------------------------------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 32px;
  border: 1px solid currentColor;
  border-radius: 100px;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  background: transparent;
  color: inherit;
  overflow: hidden;
  isolation: isolate;
  transition: color 0.45s var(--ease-swift), border-color 0.45s var(--ease-swift);
  will-change: transform;
}
.btn::after {
  content: '';
  position: absolute;
  inset: -2px;
  z-index: -1;
  background: var(--accent);
  border-radius: inherit;
  transform: translateY(102%);
  transition: transform 0.5s var(--ease-swift);
}
.btn:hover { color: var(--ink); border-color: var(--accent); }
.btn:hover::after { transform: translateY(0); }

.btn-solid {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--ink);
}
.btn-solid::after { background: var(--paper); }
.btn-solid:hover { border-color: var(--paper); }

.btn .arrow { transition: transform 0.4s var(--ease-out); }
.btn:hover .arrow { transform: translateX(5px); }

.link-line {
  position: relative;
  display: inline-block;
  padding-bottom: 2px;
}
.link-line::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.5s var(--ease-swift);
}
.link-line:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* --------------------------------------------------------------------------
   Preloader
   -------------------------------------------------------------------------- */
html.no-js .preloader { display: none; }

.preloader {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  color: var(--paper);
  transition: transform 0.9s var(--ease-swift);
}
.preloader.is-done { transform: translateY(-100%); }
.preloader-inner { text-align: center; overflow: hidden; }
.preloader .wordmark {
  display: block;
  font-size: clamp(2rem, 6vw, 4.2rem);
  transform: translateY(110%);
  animation: rise 0.9s var(--ease-out) 0.15s forwards;
}
.preloader-count {
  display: block;
  margin-top: 14px;
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.3em;
  color: var(--accent);
}
@keyframes rise {
  to { transform: translateY(0); }
}

/* --------------------------------------------------------------------------
   Custom cursor
   -------------------------------------------------------------------------- */
.cursor,
.cursor-label {
  position: fixed;
  top: 0; left: 0;
  z-index: 9500;
  pointer-events: none;
  border-radius: 50%;
}
.cursor {
  width: 10px; height: 10px;
  margin: -5px 0 0 -5px;
  background: var(--accent);
  mix-blend-mode: difference;
  transition: transform 0.25s var(--ease-out), opacity 0.25s;
}
.cursor.is-hover { transform: scale(3.2); }
.cursor-label {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 92px; height: 92px;
  margin: -46px 0 0 -46px;
  background: var(--accent);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-align: center;
  transform: scale(0);
  transition: transform 0.35s var(--ease-out);
}
.cursor-label.is-on { transform: scale(1); }
@media (pointer: coarse) {
  .cursor, .cursor-label { display: none; }
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 5000;
  color: var(--paper);
  transition: transform 0.5s var(--ease-swift), background 0.4s, backdrop-filter 0.4s;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-block: 22px;
  max-width: none;
}
.site-header.is-scrolled {
  background: rgba(10, 10, 12, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.site-header.is-hidden { transform: translateY(-100%); }
/* Keep the brand + close (X) control above the opened overlay. */
body.menu-open .site-header {
  z-index: 6001;
  transform: none;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
body.menu-open .header-cta { visibility: hidden; }

.site-header .brand { display: inline-flex; color: inherit; }
.site-header .custom-logo { max-height: 40px; width: auto; }

.header-nav { display: flex; align-items: center; gap: 40px; }
.header-nav .menu {
  display: flex;
  gap: 30px;
  list-style: none;
  margin: 0; padding: 0;
}
.header-nav .menu a {
  position: relative;
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 500;
  padding-block: 6px;
}
.header-nav .menu a::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.45s var(--ease-swift);
}
.header-nav .menu a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}
.header-cta { white-space: nowrap; padding: 12px 24px; font-size: 0.85rem; }

/* Burger */
.burger {
  display: none;
  position: relative;
  z-index: 6001;
  width: 46px; height: 46px;
  border: 1px solid rgba(244, 241, 234, 0.3);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  color: var(--paper);
}
.burger span {
  position: absolute;
  left: 50%; top: 50%;
  width: 18px; height: 1.6px;
  background: currentColor;
  transition: transform 0.4s var(--ease-swift);
}
.burger span:nth-child(1) { transform: translate(-50%, calc(-50% - 4px)); }
.burger span:nth-child(2) { transform: translate(-50%, calc(-50% + 4px)); }
body.menu-open .burger span:nth-child(1) { transform: translate(-50%, -50%) rotate(45deg); }
body.menu-open .burger span:nth-child(2) { transform: translate(-50%, -50%) rotate(-45deg); }

/* Overlay menu */
.menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 6000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--pad-x);
  background: var(--ink);
  color: var(--paper);
  clip-path: inset(0 0 100% 0);
  visibility: hidden;
  transition: clip-path 0.7s var(--ease-swift), visibility 0s 0.7s;
}
body.menu-open .menu-overlay {
  clip-path: inset(0 0 0% 0);
  visibility: visible;
  transition: clip-path 0.7s var(--ease-swift), visibility 0s;
}
.menu-overlay .menu {
  list-style: none;
  margin: 0; padding: 0;
}
.menu-overlay .menu li { overflow: hidden; }
.menu-overlay .menu a {
  display: inline-block;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 7.5vw, 5.5rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.14;
  transform: translateY(110%);
  transition: transform 0.7s var(--ease-out), color 0.3s;
}
body.menu-open .menu-overlay .menu a { transform: translateY(0); }
.menu-overlay .menu li:nth-child(1) a { transition-delay: 0.10s; }
.menu-overlay .menu li:nth-child(2) a { transition-delay: 0.16s; }
.menu-overlay .menu li:nth-child(3) a { transition-delay: 0.22s; }
.menu-overlay .menu li:nth-child(4) a { transition-delay: 0.28s; }
.menu-overlay .menu li:nth-child(5) a { transition-delay: 0.34s; }
.menu-overlay .menu li:nth-child(6) a { transition-delay: 0.40s; }
.menu-overlay .menu a:hover {
  color: var(--accent);
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
}
.menu-overlay-meta {
  margin-top: clamp(30px, 6vh, 60px);
  display: flex;
  flex-wrap: wrap;
  gap: 12px 36px;
  color: rgba(244, 241, 234, 0.55);
  font-size: 0.9rem;
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: clip;
  padding-top: 120px;
}
.hero .wrap { position: relative; z-index: 3; width: 100%; }

.hero-blobs {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  filter: blur(clamp(50px, 7vw, 110px)) saturate(1.15);
  opacity: 0.85;
}
.hero-blobs i {
  position: absolute;
  border-radius: 50%;
  will-change: transform;
}
.hero-blobs i:nth-child(1) {
  width: 44vw; height: 44vw;
  right: -12vw; top: -14vw;
  background: radial-gradient(circle at 30% 30%, var(--accent), transparent 65%);
  animation: drift-a 17s ease-in-out infinite alternate;
}
.hero-blobs i:nth-child(2) {
  width: 36vw; height: 36vw;
  left: -10vw; bottom: -6vw;
  background: radial-gradient(circle at 70% 40%, var(--violet), transparent 62%);
  animation: drift-b 21s ease-in-out infinite alternate;
}
.hero-blobs i:nth-child(3) {
  width: 24vw; height: 24vw;
  left: 38vw; top: 18vh;
  background: radial-gradient(circle at 50% 50%, var(--accent-deep), transparent 60%);
  animation: drift-c 14s ease-in-out infinite alternate;
  opacity: 0.7;
}
@keyframes drift-a {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(-9vw, 11vh) scale(1.18); }
}
@keyframes drift-b {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(10vw, -9vh) scale(0.9) rotate(20deg); }
}
@keyframes drift-c {
  from { transform: translate(0, 0); }
  to   { transform: translate(-14vw, 10vh) scale(1.3); }
}

.hero-grid-lines {
  position: absolute;
  inset: 0;
  z-index: 2;
  background-image:
    linear-gradient(to right, rgba(244,241,234,0.045) 1px, transparent 1px);
  background-size: 25% 100%;
  pointer-events: none;
}

.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(244, 241, 234, 0.6);
  margin-bottom: clamp(24px, 4vh, 44px);
}
.hero-eyebrow .dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2.2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.7); opacity: 0.45; }
}

.hero h1 {
  font-size: var(--size-hero);
  font-weight: 600;
  max-width: 14ch;
  color: var(--paper);
}
.hero h1 .fx { color: var(--accent); }

/* JS-split word reveal */
.split .w {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  padding-bottom: 0.12em;
  margin-bottom: -0.12em;
}
.split .wi {
  display: inline-block;
  transform: translateY(115%);
  transition: transform 1.1s var(--ease-out);
  transition-delay: calc(var(--wi, 0) * 55ms);
  will-change: transform;
}
.split.is-in .wi { transform: translateY(0); }

.hero-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-top: clamp(34px, 6vh, 64px);
  padding-block: 28px clamp(28px, 5vh, 48px);
  border-top: 1px solid rgba(244, 241, 234, 0.16);
}
.hero-sub {
  max-width: 46ch;
  color: rgba(244, 241, 234, 0.68);
  font-size: 1.02rem;
  margin: 0;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.scroll-cue {
  position: absolute;
  right: var(--pad-x);
  top: 46vh;
  z-index: 3;
  width: 1px; height: 72px;
  background: rgba(244, 241, 234, 0.25);
  overflow: hidden;
}
.scroll-cue::after {
  content: '';
  position: absolute;
  left: 0; top: 0;
  width: 100%; height: 40%;
  background: var(--accent);
  animation: cue 1.8s var(--ease-swift) infinite;
}
@keyframes cue {
  0% { transform: translateY(-110%); }
  60%, 100% { transform: translateY(260%); }
}

/* --------------------------------------------------------------------------
   Ticker marquee
   -------------------------------------------------------------------------- */
.ticker {
  position: relative;
  z-index: 4;
  padding-block: 18px;
  transform: rotate(-1.3deg) scale(1.03);
  margin-block: -12px;
  overflow: hidden;
  border-block: 1px solid var(--ink);
}
.ticker-track {
  display: flex;
  width: max-content;
  animation: marquee 26s linear infinite;
}
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-track ul {
  display: flex;
  align-items: center;
  gap: 0;
  list-style: none;
  margin: 0; padding: 0;
  flex: none;
}
.ticker-track li {
  display: flex;
  align-items: center;
  gap: 26px;
  padding-inline: 26px;
  font-family: var(--font-display);
  font-size: clamp(1rem, 1.7vw, 1.4rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  white-space: nowrap;
}
.ticker-track li::after {
  content: '✺';
  font-size: 0.85em;
  animation: spin 7s linear infinite;
}
@keyframes marquee {
  to { transform: translateX(-50%); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --------------------------------------------------------------------------
   Manifesto
   -------------------------------------------------------------------------- */
.manifesto-text {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 4vw, 3.4rem);
  font-weight: 500;
  line-height: 1.22;
  letter-spacing: -0.025em;
  max-width: 24ch;
  margin: 0;
}
.manifesto-text .word { opacity: 0.16; transition: opacity 0.4s linear; }
.manifesto-text .word.is-lit { opacity: 1; }
.manifesto-text .fx { color: var(--accent); }

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0 clamp(20px, 3vw, 48px);
  margin-top: clamp(60px, 9vw, 120px);
  border-top: 1px solid var(--line);
}
.stat {
  padding-top: clamp(24px, 3vw, 40px);
  border-right: 1px solid var(--line);
  padding-right: 20px;
}
.stat:last-child { border-right: 0; }
.stat-num {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 4.6rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stat-num sup {
  color: var(--accent);
  font-size: 0.5em;
  font-weight: 500;
}
.stat-label {
  margin-top: 10px;
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   Capabilities accordion
   -------------------------------------------------------------------------- */
.caps-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: clamp(40px, 6vw, 80px);
}
.caps-head h2 { font-size: var(--size-h2); max-width: 16ch; }
.caps-head p { max-width: 36ch; color: var(--muted); margin: 0; }

.acc { border-top: 1px solid var(--line); }
.acc-item { border-bottom: 1px solid var(--line); }
.acc-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: clamp(18px, 3vw, 44px);
  width: 100%;
  padding: clamp(22px, 3vw, 34px) 0;
  background: none;
  border: 0;
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
}
.acc-num {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.acc-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.4vw, 2.9rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.05;
  transition: transform 0.5s var(--ease-out), color 0.3s;
}
.acc-item:hover .acc-title { transform: translateX(14px); color: var(--accent); }
.acc-icon {
  position: relative;
  width: 44px; height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  flex: none;
  transition: background 0.4s, border-color 0.4s, transform 0.55s var(--ease-swift);
}
.acc-icon::before,
.acc-icon::after {
  content: '';
  position: absolute;
  left: 50%; top: 50%;
  width: 14px; height: 1.5px;
  background: currentColor;
  transform: translate(-50%, -50%);
  transition: transform 0.45s var(--ease-swift), background 0.3s;
}
.acc-icon::after { transform: translate(-50%, -50%) rotate(90deg); }
.acc-item.is-open .acc-icon {
  background: var(--accent);
  border-color: var(--accent);
  transform: rotate(225deg);
}
.acc-item.is-open .acc-icon::before,
.acc-item.is-open .acc-icon::after { background: var(--ink); }
.acc-item.is-open .acc-icon::after { transform: translate(-50%, -50%) rotate(0deg); }

.acc-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.6s var(--ease-swift);
}
.acc-item.is-open .acc-body { grid-template-rows: 1fr; }
.acc-body-inner {
  overflow: hidden;
  /* visibility removes collapsed panels from the accessibility tree */
  visibility: hidden;
  transition: visibility 0s 0.6s;
}
.acc-item.is-open .acc-body-inner {
  visibility: visible;
  transition-delay: 0s;
}
.acc-body-grid {
  display: grid;
  grid-template-columns: minmax(0, 52ch) 1fr;
  gap: 24px clamp(24px, 5vw, 80px);
  padding: 0 0 clamp(26px, 3vw, 40px) calc(0.85rem + clamp(18px, 3vw, 44px));
}
.acc-body p { color: var(--muted); margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-content: start; }
.chips span {
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 100px;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition: background 0.3s, color 0.3s, border-color 0.3s;
}
.chips span:hover {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}

/* --------------------------------------------------------------------------
   Work
   -------------------------------------------------------------------------- */
.work-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: clamp(44px, 6vw, 84px);
}
.work-head h2 { font-size: var(--size-h2); }
.work-head h2 .fx { color: var(--accent); }

.work-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(28px, 4vw, 64px) clamp(24px, 4vw, 56px);
}
/* margin (not transform) so the reveal animation's transform can't wipe the offset */
.work-grid > *:nth-child(even) { margin-top: clamp(30px, 6vw, 90px); }

.work-card { display: block; }
.work-media {
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  aspect-ratio: 4 / 5;
  background: var(--ink-soft);
}
.work-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 1.1s var(--ease-out), filter 0.6s;
}
.work-card:hover .work-media img {
  transform: scale(1.07) rotate(0.4deg);
  filter: saturate(1.15);
}
.work-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10,10,12,0.35), transparent 45%);
  opacity: 0;
  transition: opacity 0.5s;
}
.work-card:hover .work-media::after { opacity: 1; }
.work-tag {
  position: absolute;
  top: 16px; left: 16px;
  z-index: 2;
  padding: 8px 15px;
  border-radius: 100px;
  background: rgba(244, 241, 234, 0.92);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transform: translateY(-6px);
  opacity: 0;
  transition: transform 0.45s var(--ease-out), opacity 0.45s;
}
.work-card:hover .work-tag { transform: none; opacity: 1; }

.work-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  margin-top: 20px;
}
.work-meta h3 {
  font-size: var(--size-h3);
  font-weight: 600;
  letter-spacing: -0.02em;
}
.work-meta .client {
  font-size: 0.85rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.work-card .work-meta h3 {
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 2px;
  background-repeat: no-repeat;
  background-position: left bottom;
  transition: background-size 0.55s var(--ease-swift);
}
.work-card:hover .work-meta h3 { background-size: 100% 2px; }

.work-more { margin-top: clamp(50px, 7vw, 90px); text-align: center; }

/* --------------------------------------------------------------------------
   Clients marquee (outline text, two directions)
   -------------------------------------------------------------------------- */
.clients { overflow: hidden; padding-block: clamp(40px, 6vw, 80px) var(--pad-section); }
.clients-row {
  display: flex;
  width: max-content;
  animation: marquee 38s linear infinite;
}
.clients-row.is-reverse { animation-direction: reverse; }
.clients-row ul {
  display: flex;
  list-style: none;
  margin: 0; padding: 0;
  flex: none;
}
.clients-row li {
  padding-inline: clamp(20px, 3vw, 44px);
  font-family: var(--font-display);
  font-size: clamp(3rem, 7.5vw, 7rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  white-space: nowrap;
  color: transparent;
  -webkit-text-stroke: 1px rgba(244, 241, 234, 0.34);
  transition: color 0.4s, -webkit-text-stroke-color 0.4s;
}
.clients-row li:hover {
  color: var(--accent);
  -webkit-text-stroke-color: var(--accent);
}

/* --------------------------------------------------------------------------
   News
   -------------------------------------------------------------------------- */
.news-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: clamp(40px, 5vw, 70px);
}
.news-head h2 { font-size: var(--size-h2); }

.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(24px, 3vw, 48px);
}
.news-card { display: flex; flex-direction: column; }
.news-media {
  overflow: hidden;
  border-radius: 6px;
  aspect-ratio: 16 / 11;
  background: var(--paper-soft);
}
.news-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 1s var(--ease-out);
}
.news-card:hover .news-media img { transform: scale(1.06); }
.news-tag {
  margin: 18px 0 10px;
  font-family: var(--font-display);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}
.news-card h3 {
  font-size: 1.35rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
  transition: color 0.3s;
}
.news-card:hover h3 { color: var(--accent-deep); }
.news-date {
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   CTA + Footer
   -------------------------------------------------------------------------- */
.cta {
  position: relative;
  overflow: clip;
  text-align: center;
  padding-block: clamp(90px, 13vw, 190px);
}
.cta h2 {
  font-size: clamp(2.6rem, 7vw, 6.8rem);
  max-width: 15ch;
  margin-inline: auto;
}
.cta .fx { font-size: 1.04em; }
.cta p {
  max-width: 44ch;
  margin: 26px auto 40px;
  color: var(--muted);
  font-size: 1.05rem;
}
.cta .btn { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.cta .btn::after { background: var(--paper); }
.cta .btn:hover { color: var(--ink); }
.cta-orbit {
  position: absolute;
  inset: auto auto -40% 50%;
  width: 130vw; height: 130vw;
  transform: translateX(-50%);
  border: 1px solid rgba(10, 10, 12, 0.14);
  border-radius: 50%;
  pointer-events: none;
}
.cta-orbit::before {
  content: '';
  position: absolute;
  inset: 6vw;
  border: 1px dashed rgba(10, 10, 12, 0.14);
  border-radius: 50%;
  animation: spin 60s linear infinite;
}

.site-footer { padding-top: clamp(60px, 8vw, 110px); }
.footer-top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px clamp(24px, 4vw, 70px);
  padding-bottom: clamp(50px, 7vw, 90px);
}
.footer-tagline {
  margin-top: 18px;
  max-width: 30ch;
  color: var(--muted);
}
.footer-col h4 {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 20px;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 12px; }
.footer-col a { font-family: var(--font-display); font-weight: 500; }
.footer-col address { font-style: normal; color: var(--muted); line-height: 1.8; }

.footer-mark {
  overflow: hidden;
  border-top: 1px solid var(--line);
  padding-block: clamp(20px, 3vw, 40px) 0;
}
.footer-mark .giant {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.6rem, 10.4vw, 12rem);
  letter-spacing: -0.04em;
  line-height: 0.95;
  user-select: none;
}
.footer-mark .giant span {
  display: inline-block;
  transition: transform 0.5s var(--ease-out), color 0.35s;
  transition-delay: calc(var(--l) * 14ms);
}
.footer-mark:hover .giant span {
  transform: translateY(-10%);
  color: var(--accent);
}
.footer-legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 30px;
  padding-block: 26px 30px;
  font-size: 0.82rem;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   Inner pages
   -------------------------------------------------------------------------- */
.page-hero {
  position: relative;
  overflow: clip;
  padding: clamp(150px, 22vh, 240px) 0 clamp(50px, 8vw, 90px);
}
.page-hero h1 {
  font-size: clamp(2.6rem, 7.5vw, 7rem);
  max-width: 16ch;
  color: var(--paper);
}
.page-hero h1 .fx { color: var(--accent); }
.page-hero .hero-blobs { opacity: 0.55; }
.page-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 34px;
  margin-top: 28px;
  color: rgba(244, 241, 234, 0.6);
  font-size: 0.9rem;
}

.prose { max-width: 72ch; }
.prose > * + * { margin-top: 1.2em; }
.prose h2, .prose h3 { margin-top: 1.8em; letter-spacing: -0.02em; }
.prose h2 { font-size: 1.9rem; }
.prose h3 { font-size: 1.4rem; }
.prose a { color: var(--accent-deep); text-decoration: underline; text-underline-offset: 3px; }
.prose img { border-radius: 6px; }
.prose blockquote {
  margin: 1.6em 0;
  padding-left: 24px;
  border-left: 3px solid var(--accent);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.3em;
  line-height: 1.4;
}
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li { margin-bottom: 0.4em; }
.prose .wp-block-image figcaption {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 8px;
}

.entry-hero-img {
  overflow: hidden;
  border-radius: 8px;
  margin-bottom: clamp(36px, 5vw, 60px);
}
.entry-hero-img img { width: 100%; }

/* Case study */
.case-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: clamp(30px, 5vw, 80px);
  align-items: start;
}
.case-facts {
  position: sticky;
  top: 110px;
  display: grid;
  gap: 22px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.case-facts dt {
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.case-facts dd {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
}

/* Archive grids reuse .work-grid / .news-grid */
.archive-intro { margin-bottom: clamp(40px, 6vw, 80px); }

.pagination {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: clamp(50px, 7vw, 80px);
  font-family: var(--font-display);
}
.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px; height: 44px;
  padding-inline: 10px;
  border: 1px solid var(--line);
  border-radius: 50%;
}
.pagination .page-numbers.current,
.pagination .page-numbers:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--ink);
}

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: clamp(40px, 6vw, 100px);
}
.contact-mail {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.6vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  word-break: break-word;
}
.contact-list { list-style: none; margin: 34px 0 0; padding: 0; }
.contact-list li {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-block: 16px;
  border-bottom: 1px solid var(--line);
}
.contact-list .k {
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  align-self: center;
}

/* Forms (works with Contact Form 7 / WPForms markup) */
.prose input[type='text'],
.prose input[type='email'],
.prose input[type='tel'],
.prose textarea {
  width: 100%;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  transition: border-color 0.3s;
}
.prose input:focus,
.prose textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.prose input[type='submit'],
.prose button[type='submit'] {
  padding: 16px 34px;
  border: 0;
  border-radius: 100px;
  background: var(--accent);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.3s var(--ease-out), background 0.3s;
}
.prose input[type='submit']:hover,
.prose button[type='submit']:hover {
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-2px);
}

/* Comments */
.comments-area {
  max-width: 72ch;
  margin-top: clamp(50px, 7vw, 90px);
  padding-top: clamp(30px, 4vw, 50px);
  border-top: 1px solid var(--line);
}
.comments-title { font-size: 1.5rem; margin-bottom: 24px; }
.comment-list { list-style: none; margin: 0 0 30px; padding: 0; }
.comment-list .comment { padding: 20px 0; border-bottom: 1px solid var(--line); }
.comment-list .avatar { border-radius: 50%; float: left; margin-right: 14px; }
.comment-list .comment-metadata { font-size: 0.8rem; color: var(--muted); }
.comment-list .reply { font-size: 0.85rem; }
.comment-form label {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 500;
}
.comment-form input[type='text'],
.comment-form input[type='email'],
.comment-form input[type='url'],
.comment-form textarea {
  width: 100%;
  padding: 14px 16px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
}
.comment-form input:focus,
.comment-form textarea:focus { outline: none; border-color: var(--accent); }
.comment-form .submit {
  padding: 14px 30px;
  border: 0;
  border-radius: 100px;
  background: var(--accent);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 600;
  cursor: pointer;
}

/* 404 */
.error-hero {
  min-height: 88svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 20px;
  padding-top: 90px;
}
.error-hero .code {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(6rem, 22vw, 19rem);
  line-height: 1;
  letter-spacing: -0.05em;
  color: transparent;
  -webkit-text-stroke: 2px var(--accent);
  animation: pulse 3s ease-in-out infinite;
}

/* --------------------------------------------------------------------------
   Scroll reveals
   -------------------------------------------------------------------------- */
/* Reveal-gated content is only hidden when JS is definitely running. */
html.js [data-reveal] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
  transition-delay: calc(var(--i, 0) * 80ms);
}
html.js [data-reveal='clip'] {
  transform: none;
  clip-path: inset(0 0 100% 0);
  transition: opacity var(--dur) var(--ease-out), clip-path 1.1s var(--ease-swift);
}
html.js [data-reveal='left'] { transform: translateX(-40px); }
html.js [data-reveal].is-in {
  opacity: 1;
  transform: none;
  clip-path: inset(0 0 0% 0);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .header-nav .menu { display: none; }
  .burger { display: block; }
  .caps-head, .work-head, .news-head { flex-direction: column; align-items: flex-start; }
  .case-layout { grid-template-columns: 1fr; }
  .case-facts { position: static; }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .hero-foot { flex-direction: column; align-items: flex-start; }
  .scroll-cue { display: none; }
  .header-cta { display: none; }
  .stats { grid-template-columns: 1fr 1fr; gap: 30px; }
  .stat { border-right: 0; padding-right: 0; }
  .work-grid { grid-template-columns: 1fr; }
  .work-grid > *:nth-child(even) { margin-top: 0; }
  .news-grid { grid-template-columns: 1fr; }
  .acc-body-grid { grid-template-columns: 1fr; padding-left: 0; }
  .footer-top { grid-template-columns: 1fr; gap: 34px; }
}

/* --------------------------------------------------------------------------
   Reduced motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  [data-reveal],
  .split .wi,
  .manifesto-text .word {
    opacity: 1 !important;
    transform: none !important;
    clip-path: none !important;
  }
  .grain, .cursor, .cursor-label, .preloader { display: none !important; }
}
