/* ═══════════════════════════════════════════════════════════════════════════
   HB Studios UK — Shared Design System
   Japanese editorial / minimal vogue aesthetic
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Tokens ─────────────────────────────────────────────────────────────── */
:root {
  --red:  #c0192c;
  --red2: #e8213a;

  /* Dark (default) */
  --bg:       #060609;
  --s:        rgba(255,255,255,0.07);   /* surface */
  --s2:       rgba(255,255,255,0.12);   /* surface hover */
  --b:        rgba(255,255,255,0.14);   /* border */
  --bhi:      rgba(255,255,255,0.46);   /* border highlight */
  --t1:       rgba(255,255,255,0.96);
  --t2:       rgba(255,255,255,0.58);
  --t3:       rgba(255,255,255,0.34);
  --nav-bg:   rgba(8,8,12,0.58);
  --gs:       0 8px 40px rgba(0,0,0,0.38), inset 0 1px 0 rgba(255,255,255,0.26);
  --gsh:      0 20px 60px rgba(0,0,0,0.50), 0 0 40px rgba(192,25,44,0.12), inset 0 1px 0 rgba(255,255,255,0.36);
}

/* ── Light mode ─────────────────────────────────────────────────────────── */
:root.light {
  --bg:     #f0eeeb;
  --s:      rgba(255,255,255,0.72);
  --s2:     rgba(255,255,255,0.90);
  --b:      rgba(0,0,0,0.09);
  --bhi:    rgba(255,255,255,0.95);
  --t1:     rgba(10,10,14,0.96);
  --t2:     rgba(10,10,14,0.54);
  --t3:     rgba(10,10,14,0.32);
  --nav-bg: rgba(238,236,232,0.78);
  --gs:     0 6px 32px rgba(0,0,0,0.09), inset 0 1px 0 rgba(255,255,255,0.92);
  --gsh:    0 16px 48px rgba(0,0,0,0.13), 0 0 28px rgba(192,25,44,0.07), inset 0 1px 0 rgba(255,255,255,0.96);
}

/* ── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  background: var(--bg);
  color: var(--t1);
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background 0.35s, color 0.35s;
}

/* ── Animated background ────────────────────────────────────────────────── */
.anim-bg { position: fixed; inset: 0; z-index: 0; }
.anim-bg canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* ── Grain ──────────────────────────────────────────────────────────────── */
body::after {
  content: ''; position: fixed; inset: 0; z-index: 9999; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.022; mix-blend-mode: overlay;
}

/* ── Type helpers ───────────────────────────────────────────────────────── */
.fd  { font-family: 'Bebas Neue', sans-serif; }
.fm  { font-family: 'Space Mono', monospace; }
.fs  { font-family: 'Cormorant Garamond', serif; }
h1, h2, h3, h4 { color: var(--t1); line-height: 0.88; }
p   { color: var(--t2); line-height: 1.75; }
.t1 { color: var(--t1); } .t2 { color: var(--t2); } .t3 { color: var(--t3); }
.red { color: var(--red); }
.eyebrow {
  font-family: 'Space Mono', monospace; font-size: 0.56rem;
  text-transform: uppercase; letter-spacing: 0.22em; color: var(--red);
  margin-bottom: 0.9rem; display: block;
}

/* ── Loader ─────────────────────────────────────────────────────────────── */
#loader {
  position: fixed; inset: 0; background: var(--bg); z-index: 10000;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.8s ease, visibility 0.8s;
}
#loader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-inner { display: flex; flex-direction: column; align-items: center; position: relative; }
.loader-bg-text {
  font-family: 'Bebas Neue', sans-serif; font-size: 13rem; opacity: 0.04;
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  user-select: none; pointer-events: none; color: var(--t1); white-space: nowrap;
}
.loader-title {
  font-family: 'Bebas Neue', sans-serif; font-size: 2.2rem;
  letter-spacing: 0.4em; color: var(--t1); position: relative; z-index: 1;
}
.loader-bar { width: 140px; height: 1px; background: var(--b); margin-top: 1.4rem; position: relative; overflow: hidden; }
.loader-progress {
  position: absolute; left: 0; top: 0; height: 100%; width: 0%;
  background: var(--red); box-shadow: 0 0 10px rgba(192,25,44,0.7);
}
.loader-pct { margin-top: 10px; font-family: 'Space Mono', monospace; font-size: 0.7rem; color: var(--t3); }

/* ── Nav ────────────────────────────────────────────────────────────────── */
nav { position: fixed; top: 0; width: 100%; z-index: 100; padding: 0 1.5rem; }
.nav-pill {
  max-width: 1200px; margin: 10px auto;
  display: flex; align-items: center; justify-content: space-between;
  background: var(--nav-bg);
  backdrop-filter: blur(48px) saturate(180%); -webkit-backdrop-filter: blur(48px) saturate(180%);
  border: 1px solid var(--b); border-top-color: var(--bhi);
  border-radius: 20px; padding: 12px 22px;
  box-shadow: 0 4px 28px rgba(0,0,0,0.22), inset 0 1px 0 var(--bhi);
  transition: background 0.35s, border-color 0.35s;
}
.nav-logo { font-family: 'Bebas Neue', sans-serif; font-size: 1.25rem; letter-spacing: 0.06em; color: var(--t1); text-decoration: none; }
.nav-links {
  display: flex; gap: 1.6rem; align-items: center;
  font-family: 'Space Mono', monospace; font-size: 0.56rem;
  text-transform: uppercase; letter-spacing: 0.16em;
}
.nav-links a { color: var(--t2); text-decoration: none; transition: color 0.2s; position: relative; }
.nav-links a::after {
  content: ''; position: absolute; bottom: -3px; left: 0;
  width: 0; height: 1px; background: var(--red);
  transition: width 0.28s cubic-bezier(0.16,1,0.3,1);
}
.nav-links a:hover { color: var(--t1); }
.nav-links a:hover::after { width: 100%; }
.nav-links sup { font-size: 0.42rem; color: var(--red); }
.nav-cta {
  background: var(--red); color: #fff !important;
  padding: 7px 16px; border-radius: 10px;
  transition: background 0.2s, box-shadow 0.2s !important;
}
.nav-cta::after { display: none !important; }
.nav-cta:hover { background: var(--red2) !important; box-shadow: 0 0 16px rgba(192,25,44,0.4) !important; }
#theme-toggle {
  background: none; border: 1px solid var(--b); color: var(--t2); cursor: pointer;
  font-family: 'Space Mono', monospace; font-size: 0.52rem;
  text-transform: uppercase; letter-spacing: 0.12em;
  padding: 5px 11px; border-radius: 8px;
  display: flex; align-items: center; gap: 5px;
  transition: border-color 0.2s, color 0.2s;
}
#theme-toggle:hover { border-color: var(--bhi); color: var(--t1); }
#mobile-toggle {
  display: none; background: none; border: none; color: var(--t1);
  cursor: pointer; font-family: 'Space Mono', monospace;
  font-size: 0.56rem; text-transform: uppercase; letter-spacing: 0.15em;
}
@media (max-width: 900px) {
  .nav-links { display: none !important; }
  #mobile-toggle { display: block !important; }
}

/* ── Mobile menu ────────────────────────────────────────────────────────── */
#mobile-menu {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(6,6,9,0.95);
  backdrop-filter: blur(40px); -webkit-backdrop-filter: blur(40px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  transform: translateY(-100%); transition: transform 0.55s cubic-bezier(0.85,0,0.15,1);
}
:root.light #mobile-menu { background: rgba(240,238,235,0.97); }
#mobile-menu.active { transform: translateY(0); }
.mobile-close {
  position: absolute; top: 1.8rem; right: 1.8rem;
  background: none; border: none; color: var(--t3); cursor: pointer;
  font-family: 'Space Mono', monospace; font-size: 0.56rem;
  text-transform: uppercase; letter-spacing: 0.15em;
}
.mobile-links { display: flex; flex-direction: column; align-items: center; gap: 1.6rem; }
.mobile-links a {
  font-family: 'Bebas Neue', sans-serif; font-size: 3.2rem;
  color: var(--t1); text-decoration: none;
  transition: color 0.2s, transform 0.3s cubic-bezier(0.16,1,0.3,1);
}
.mobile-links a:hover { color: var(--red); transform: translateX(6px); }

/* ── Glass card ─────────────────────────────────────────────────────────── */
.gc {
  background: var(--s);
  backdrop-filter: blur(40px) saturate(180%); -webkit-backdrop-filter: blur(40px) saturate(180%);
  border: 1px solid var(--b); border-top-color: var(--bhi);
  border-radius: 18px; box-shadow: var(--gs);
  transition: all 0.40s cubic-bezier(0.16,1,0.3,1);
  position: relative; overflow: hidden;
}
.gc::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(138deg, rgba(255,255,255,0.10) 0%, rgba(255,255,255,0.02) 55%, transparent 100%);
  pointer-events: none;
}
.gc::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(108deg, transparent 28%, rgba(255,255,255,0.055) 46%, rgba(255,255,255,0.10) 52%, rgba(255,255,255,0.055) 58%, transparent 74%);
  transform: translateX(-120%); transition: transform 0.70s cubic-bezier(0.16,1,0.3,1); pointer-events: none;
}
.gc:hover {
  background: var(--s2); border-top-color: var(--bhi); transform: translateY(-5px);
  box-shadow: var(--gsh);
}
.gc:hover::after { transform: translateX(120%); }
/* light mode card text fix */
:root.light .gc { color: var(--t1); }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: 'Space Mono', monospace; font-size: 0.60rem;
  text-transform: uppercase; letter-spacing: 0.16em;
  text-decoration: none; border-radius: 14px;
  padding: 14px 26px; cursor: pointer; border: none;
  transition: all 0.28s cubic-bezier(0.16,1,0.3,1);
  white-space: nowrap; position: relative; overflow: hidden;
  color: var(--t1);
}
.btn-p {  /* primary */
  background: var(--red); color: #fff !important;
  box-shadow: 0 4px 20px rgba(192,25,44,0.28);
}
.btn-p:hover {
  background: var(--red2);
  box-shadow: 0 0 28px rgba(192,25,44,0.55), 0 8px 24px rgba(0,0,0,0.28);
  transform: translateY(-3px);
}
.btn-g { /* ghost */
  background: var(--s); border: 1px solid var(--b); border-top-color: var(--bhi);
  backdrop-filter: blur(28px); -webkit-backdrop-filter: blur(28px);
  box-shadow: var(--gs); color: var(--t1) !important;
}
.btn-g:hover {
  background: var(--s2); border-top-color: var(--bhi);
  box-shadow: var(--gsh); transform: translateY(-2px);
}

/* ── Layout ─────────────────────────────────────────────────────────────── */
.pw  { position: relative; z-index: 1; } /* page wrap */
.sec { padding: 6rem 2rem; max-width: 1200px; margin: 0 auto; }
.alt {
  position: relative; padding: 5rem 0;
  background: var(--s); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid var(--b); border-bottom: 1px solid var(--b);
}
.alt > .inner { max-width: 1200px; margin: 0 auto; padding: 0 2rem; }

/* ── Case study stats ───────────────────────────────────────────────────── */
.cs-stats {
  display: grid; grid-template-columns: repeat(4,1fr);
  gap: 1px; background: var(--b); border-radius: 14px; overflow: hidden; margin-top: 2.5rem;
}
.cs-stat { background: var(--s); padding: 1.4rem 1rem; text-align: center; }
.cs-stat-n { font-family: 'Bebas Neue', sans-serif; font-size: 2.4rem; color: var(--red); line-height: 1; display: block; }
.cs-stat-l { font-family: 'Space Mono', monospace; font-size: 0.47rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--t3); margin-top: 0.35rem; display: block; }

/* ── Perf table ─────────────────────────────────────────────────────────── */
.pt { width: 100%; border-collapse: collapse; }
.pt th, .pt td {
  padding: 0.9rem 1.4rem; font-family: 'Space Mono', monospace; font-size: 0.56rem;
  text-transform: uppercase; letter-spacing: 0.08em;
  border-bottom: 1px solid var(--b); color: var(--t2);
}
.pt th { color: var(--t3); letter-spacing: 0.15em; font-weight: 400; }
.pt .vb { font-family: 'Bebas Neue', sans-serif; font-size: 1.2rem; color: rgba(255,120,120,0.85); }
.pt .vg { font-family: 'Bebas Neue', sans-serif; font-size: 1.2rem; color: var(--red); }
.pt tr:hover td { background: rgba(255,255,255,0.02); }
:root.light .pt .vb { color: rgba(180,50,50,0.85); }

/* ── Form ───────────────────────────────────────────────────────────────── */
.fl { font-family: 'Space Mono', monospace; font-size: 0.52rem; text-transform: uppercase; letter-spacing: 0.15em; color: var(--t3); }
.fi {
  background: transparent; border: none; border-bottom: 1px solid var(--b);
  color: var(--t1); font-family: 'Inter', sans-serif; font-size: 0.9rem; font-weight: 300;
  padding: 0.75rem 0; width: 100%; outline: none; transition: border-color 0.2s;
}
.fi:focus { border-bottom-color: var(--red); }
.fi::placeholder { color: var(--t3); }
.fi option { background: #111; color: #fff; }
:root.light .fi option { background: #f0eeeb; color: #0a0a0e; }
.sub-btn {
  width: 100%; background: var(--red); color: #fff; border: none;
  border-radius: 12px; padding: 1.1rem;
  font-family: 'Space Mono', monospace; font-size: 0.62rem;
  text-transform: uppercase; letter-spacing: 0.18em; cursor: pointer;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}
.sub-btn:hover { background: var(--red2); transform: translateY(-2px); box-shadow: 0 0 20px rgba(192,25,44,0.4); }

/* ── Speed rings ────────────────────────────────────────────────────────── */
.sr { transition: stroke-dashoffset 1.8s cubic-bezier(0.16,1,0.3,1); }
.sr.go { stroke-dashoffset: var(--off,0); }

/* ── Footer ─────────────────────────────────────────────────────────────── */
footer { padding: 4rem 2rem 2rem; border-top: 1px solid var(--b); }
footer a { color: var(--t2); text-decoration: none; display: inline-block; transition: color 0.2s, transform 0.2s; }
footer a:hover { color: var(--t1); transform: translateX(3px); }

/* ── Scrollbar ──────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--red); border-radius: 2px; box-shadow: 0 0 6px rgba(192,25,44,0.5); }

/* ── Marquee ────────────────────────────────────────────────────────────── */
@keyframes scrollX { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.mq { overflow: hidden; white-space: nowrap; display: flex; }
.mq-i { display: flex; animation: scrollX 28s linear infinite; }
.mq-i:hover { animation-play-state: paused; }

/* ── GSAP init states ───────────────────────────────────────────────────── */
.su { opacity: 0; }
.hw { display: inline-block; overflow: hidden; line-height: 0.88; }
.hwi { display: inline-block; transform: translateY(110%); line-height: 0.88; }
.hf { opacity: 0; transform: translateY(18px); }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .nav-links { display: none !important; }
  #mobile-toggle { display: block !important; }
}
@media (max-width: 768px) {
  .sec { padding: 3.5rem 1.25rem; }
  .alt { padding: 3rem 0; }
  .alt > .inner { padding: 0 1.25rem; }
  .cs-stats { grid-template-columns: repeat(2,1fr); }
  footer { padding: 2.5rem 1.25rem 1.5rem; }
  .nav-pill { margin: 8px; padding: 10px 16px; }
  h1 { font-size: clamp(3rem,10vw,5rem) !important; }
  h2 { font-size: clamp(2.2rem,8vw,3.5rem) !important; }
  .two-col { grid-template-columns: 1fr !important; gap: 2rem !important; }
}
@media (max-width: 480px) {
  .sec { padding: 2.5rem 1rem; }
  .btn { padding: 12px 20px; font-size: 0.55rem; }
}
