/* =========================================================
   SUSHRUT STUDIOS — Electric Lime (themeable)
   Typography: Inter (display / body / mono) — Proxima/Helvetica-style grotesque
   Theming: data-accent (lime|cyan|magenta|amber) + data-theme (dark|light)
            on <html>, driven by assets/js/theme.js — see the THEMING block
            near the end of this file.
   ========================================================= */

/* --- Tokens ---
   Theming model:
   - data-accent on <html> selects the accent hue (lime | cyan | magenta | amber).
   - data-theme  on <html> selects the surface mode (dark default | light).
   - --accent      : the vivid hue, used for FILLS / gradients / glows.
   - --accent-ink  : the readable text/thin-outline color. Equals --accent in
                     dark mode (so dark is byte-for-byte unchanged); darkens to
                     --accent-deep in light mode where vivid lime/cyan is illegible.
   - *-rgb tokens let the hardcoded glow/shadow alphas follow the active accent.
   ========================================================= */
:root {
  /* Accent palette (lime — default). Overridden by [data-accent="…"].
     --accent-deep : readable-as-TEXT on white (AA) for light mode.
     --accent-mid  : vibrant-but-grounded tone for light-mode PARTICLES. */
  --accent:        #3fd6c8;
  --accent-2:      #2f9fd6;
  --accent-rgb:    63, 214, 200;
  --accent-2-rgb:  47, 159, 214;
  --accent-deep:   #0e6d68;
  --accent-mid:    #159b93;
  --accent-mid-rgb: 21, 155, 147;

  --bg:           #05080b;
  --bg-elev:      #080d11;
  --bg-card:      rgba(0, 0, 0, 0.5);
  --bg-card-hov:  rgba(var(--accent-rgb), 0.03);
  --border:       rgba(var(--accent-rgb), 0.1);
  --border-strong:rgba(var(--accent-rgb), 0.25);

  --accent-soft:  rgba(var(--accent-rgb), 0.08);
  --btn-line:     rgba(var(--accent-rgb), 0.30);  /* secondary-button frame (dim) */
  --accent-glow:  rgba(var(--accent-rgb), 0.5);
  --accent-ink:   var(--accent);    /* text/outline — dark mode = vivid accent */
  --accent-2-ink: var(--accent-2);

  /* Surface helpers (theme-aware so light mode can re-tint them) */
  --surface-glass: rgba(5, 8, 11, 0.85);  /* sticky header / overlays */
  --surface-deep:  rgba(0, 0, 0, 0.4);   /* deep insets, CTA wash */

  /* Particle field — read by particles.js / ambient.js. In dark mode the
     vivid accent glows on near-black; in light mode it switches to a strong
     dark green so grains stay clearly visible on the pale surface. */
  --particle-color: var(--accent);       /* hex, particles.js fill + glow */
  --particle-rgb:   var(--accent-rgb);   /* "r,g,b", ambient.js */
  --particle-trail: rgba(5, 5, 5, 0.55); /* home canvas fade */

  --text:         #ffffff;
  --text-muted:   #aeb9ae;  /* brightened for readability — ~9:1 on --bg (was 5.8:1) */
  --text-dim:     #96a296;  /* ~7:1 — small/footer text */
  --text-mid:     #c4cfc4;
  --danger:       #ff5a5a;

  --container: 1300px;
  --pad-x: clamp(20px, 5vw, 50px);
  --section-py: clamp(64px, 9vw, 110px);

  --t-fast: 200ms ease;
  --t-base: 300ms ease;
  --t-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

  --font-display: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body:    'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono:    'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
img, svg { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; background: none; border: none; outline: none; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* Visible keyboard focus (keyboard only — won't show on mouse click) */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Screen-reader-only — visually hidden, still in the a11y tree */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Skip-to-content link — appears only on keyboard focus */
.skip-link {
  position: absolute;
  left: 12px; top: -60px;
  z-index: 100;
  background: var(--accent);
  color: #000;
  padding: 10px 18px;
  font-family: var(--font-body);
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-size: 12px;
  transition: top var(--t-base);
}
.skip-link:focus { top: 12px; }

/* --- Base --- */
/* overflow-x:hidden must be on <html> too — with it only on <body>,
   absolutely-positioned decorative elements (.energy-wave glows, the home
   .particle-canvas, over-wide hero words) still stretch the root layout
   viewport, so phones render ~30-60px wider than the screen (360→420). */
html { overflow-x: hidden; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  font-size: 17px;
  line-height: 1.75;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Numeric displays — Inter has tabular figures; line them up. */
.stat-value, .stat-num, .case-metric .m-num, .m-num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* --- Background rays + waves on hero / page-hero --- */
.bg-effects {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.ray {
  position: absolute;
  top: 0;
  left: 50%;
  width: 2px;
  height: 100%;
  margin-left: -1px;            /* centre the 2px bar exactly on the 50% line */
  background: linear-gradient(180deg, var(--accent), transparent 72%);
  opacity: 0.18;
  transform-origin: top center; /* every ray pivots from the SAME point (50%, 0) */
  filter: blur(0.5px);
  animation: rayPulse 4s ease-in-out infinite;
}
/* All rays share the top-centre pivot and fan out in symmetric ± pairs, so the
   cone emanates from dead centre and spreads evenly to both sides.
   NB: use :nth-of-type, NOT :nth-child — .bg-effects' first child is the
   <canvas>, which would otherwise shift every ray rule by one (left-lean). */
.ray:nth-of-type(1) { transform: rotate(-38deg); animation-delay: 0s;   }
.ray:nth-of-type(2) { transform: rotate(-19deg); animation-delay: 0.6s; }
.ray:nth-of-type(3) { transform: rotate(0deg);   animation-delay: 1.2s; }
.ray:nth-of-type(4) { transform: rotate(19deg);  animation-delay: 1.8s; }
.ray:nth-of-type(5) { transform: rotate(38deg);  animation-delay: 2.4s; }
@keyframes rayPulse {
  0%, 100% { opacity: 0.16; }
  50%      { opacity: 0.32; }
}

/* Soft, blurred glow pulses — ambient light, not crisp wireframe rings. */
.energy-wave {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-soft), transparent 70%);
  filter: blur(8px);
  opacity: 0;
  animation: energyWave 5s ease-out infinite;
}
.energy-wave:nth-of-type(6) { animation-delay: 0s; }
.energy-wave:nth-of-type(7) { animation-delay: 1.7s; }
.energy-wave:nth-of-type(8) { animation-delay: 3.4s; }
@keyframes energyWave {
  0%   { width: 140px; height: 140px; opacity: 0.45; }
  100% { width: 820px; height: 820px; opacity: 0;    }
}

/* Light mode: the lime rays/waves glow too hot on a pale surface — switch to a
   muted dark-green and dial the whole effect back so it reads as a subtle hint. */
[data-theme="light"] .bg-effects { opacity: 0.28; }
[data-theme="light"] .ray {
  background: linear-gradient(180deg, var(--accent-deep), transparent 72%);
}
[data-theme="light"] .energy-wave {
  background: radial-gradient(circle, rgba(var(--accent-rgb), 0.06), transparent 70%);
}

/* Ambient drifting-particle canvas, scoped to a .page-hero (sub-pages).
   Sits inside .bg-effects, behind the rays and the hero copy. */
.page-hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  z-index: 0;
}
/* Keep hero copy above the ambient effects on sub-pages. */
.page-hero > .container { position: relative; z-index: 1; }

/* --- Typography --- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  line-height: 0.95;
  letter-spacing: 4px;
  color: var(--text);
}
h1 { font-size: clamp(2.8rem, 7vw, 5.5rem); letter-spacing: 6px; }
h2 { font-size: clamp(2rem, 4.5vw, 3.2rem); letter-spacing: 4px; }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); letter-spacing: 2px; font-weight: 600; }
h4 { font-size: 0.95rem; letter-spacing: 2px; font-weight: 600; }

p {
  color: var(--text-muted);
  margin: 0 0 1em;
  line-height: 1.75;
}
.lead {
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
  color: var(--text-mid);
  max-width: 640px;
  line-height: 1.7;
}
.accent { color: var(--accent-ink); text-shadow: 0 0 40px var(--accent-glow); }
.accent-2 { color: var(--accent-2-ink); }
.label-mono {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent-ink);
}

/* --- Layout --- */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--pad-x);
  padding-right: var(--pad-x);
  position: relative;
  z-index: 1;
}
main { position: relative; }
section { padding-top: var(--section-py); padding-bottom: var(--section-py); position: relative; }
.section-head { margin-bottom: clamp(40px, 6vw, 64px); max-width: 780px; }
.section-head .lead { margin-top: 18px; }

/* --- Header / Nav --- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--surface-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  /* vertical only — the `22px 0` shorthand was zeroing the container's
     horizontal padding, so the logo/hamburger sat flush against the screen
     edges on mobile. Keep --pad-x from .container. */
  padding-top: 22px;
  padding-bottom: 22px;
}
.logo {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 4px;
  color: var(--accent-ink);
  text-shadow: 0 0 20px var(--accent-glow);
  transition: all var(--t-base);
  text-transform: uppercase;
  display: flex; align-items: center; gap: 12px;
  white-space: nowrap;
}
.logo:hover {
  text-shadow: 0 0 40px var(--accent-glow);
  transform: scale(1.03);
}
/* Outlined chamfered badge with an angular S (SVG) */
.logo-mark {
  width: 40px; height: 40px;
  background: url('../img/logo-mark.svg') center / contain no-repeat;
  filter: drop-shadow(0 0 8px var(--accent-glow));
  flex-shrink: 0;
  transition: filter var(--t-base), transform var(--t-base);
}
.logo:hover .logo-mark {
  filter: drop-shadow(0 0 18px var(--accent-glow));
  transform: scale(1.05);
}

/* Rockstar-style wordmark: SUSHRUT bold (white) + STUDIOS small lime tag */
.logo-name {
  display: flex;
  flex-direction: column;
  line-height: 0.82;
}
.logo-name-main {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 26px;
  letter-spacing: 3px;
  color: var(--text);
  text-shadow: none;
}
.logo-name-sub {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 6px;
  color: var(--accent-ink);
  margin-top: 5px;
  padding-left: 2px;
  text-shadow: 0 0 10px var(--accent-glow);
}
.logo:hover .logo-name-main { color: var(--accent-ink); }

/* Full brand lockup (mark + wordmark SVG). Dark variant (bright teal) shows on
   the dark UI; original (navy) swaps in for light mode. */
.logo-img { height: 64px; width: auto; display: block; transition: transform var(--t-base), filter var(--t-base); }
.logo:hover .logo-img { transform: scale(1.03); filter: drop-shadow(0 0 14px var(--accent-glow)); }
.logo-img-light { display: none; }
[data-theme="light"] .logo-img-dark { display: none; }
[data-theme="light"] .logo-img-light { display: block; }
/* Mobile: keep the logo LARGE and prominent for visibility (client 2026-07-24), and
   give it a soft resting glow so the teal mark + wordmark stand out clearly on the dark
   header rather than receding into it. */
@media (max-width: 480px) {
  .logo-img { height: 56px; filter: drop-shadow(0 0 10px var(--accent-glow)); }
  .nav { padding-top: 18px; padding-bottom: 18px; }
}

.nav-links { display: flex; align-items: center; gap: 36px; }
.nav-links a {
  font-size: 13px;
  color: var(--text); /* white in dark mode / near-black in light — readable, not dim */
  letter-spacing: 2px;
  text-transform: uppercase;
  transition: color var(--t-base);
  position: relative;
}
.nav-links a:hover, .nav-links a.active { color: var(--accent-ink); }

/* active link: a calm, static underline (no pulsing dot, no brackets) */
.nav-links a.active::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -8px;
  height: 2px;
  background: var(--accent-ink);
}

.nav-cta { display: flex; align-items: center; gap: 14px; }
/* "Work With Us" link that lives inside the mobile dropdown — hidden on
   desktop/tablet where the header CTA button is shown instead. Revealed only
   on phones (≤480px) where that CTA is hidden, so Contact stays reachable. */
.nav-contact-m { display: none; }
.nav-toggle {
  display: none;
  width: 40px; height: 40px;
  border: 1px solid var(--border-strong);
  cursor: pointer; position: relative;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
}
.nav-toggle span {
  position: absolute; left: 9px; right: 9px; height: 2px; background: var(--accent-ink);
  transition: transform var(--t-base), opacity var(--t-fast), top var(--t-base);
}
.nav-toggle span:nth-child(1) { top: 13px; }
.nav-toggle span:nth-child(2) { top: 19px; }
.nav-toggle span:nth-child(3) { top: 25px; }
.nav-toggle.open span:nth-child(1) { top: 19px; transform: rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { top: 19px; transform: rotate(-45deg); }

/* --- Buttons (clip-path chamfered corners) --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 38px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all var(--t-base);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
  white-space: nowrap;
}
/* Primary CTA fill = the main teal accent, so the button MATCHES the logo mark, the
   headings and the rest of the teal-forward site (client 2026-07-24: blue/gradient
   "not matching"). Hover brightens the same teal + adds a soft accent bloom rather than
   shifting hue, so it stays in-family. Theme-aware via --accent / --accent-rgb. */
.btn-primary {
  background: var(--accent);
  color: #000;
}
.btn-primary:hover {
  background: var(--accent);
  filter: brightness(1.08);
  box-shadow: 0 0 24px rgba(var(--accent-rgb), 0.42);
}
.btn-secondary {
  background: transparent;
  color: var(--accent-ink);
  border: none; /* a plain border gets clipped at the chamfered corners → broken outline */
}
/* Chamfered outline, drawn as explicit background layers (a plain border or
   a rectangular mask-ring both break at the corner cuts): four 2px edge
   segments that stop at the cuts, plus two "slashes" laid exactly along the
   chamfer diagonals (top-right + bottom-left). All six segments share the
   same dim --btn-line tone so the frame reads as one continuous outline
   (client 2026-07-13: no bright corners); the whole frame lights up together
   on hover. Uses ::before so it can't collide with the .btn-arrow ::after
   glyph. */
.btn-secondary::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    /* corner slashes on the two cut corners — same dim tone as the edges */
    linear-gradient(45deg,
      transparent calc(50% - 1.6px),
      var(--btn-line) calc(50% - 1.6px) calc(50% + 1.6px),
      transparent calc(50% + 1.6px)) top right / 12px 12px no-repeat,
    linear-gradient(45deg,
      transparent calc(50% - 1.6px),
      var(--btn-line) calc(50% - 1.6px) calc(50% + 1.6px),
      transparent calc(50% + 1.6px)) bottom left / 12px 12px no-repeat,
    /* dim frame edges — each stops where its cut corner begins */
    linear-gradient(var(--btn-line), var(--btn-line)) left top / calc(100% - 12px) 2px no-repeat,
    linear-gradient(var(--btn-line), var(--btn-line)) right bottom / calc(100% - 12px) 2px no-repeat,
    linear-gradient(var(--btn-line), var(--btn-line)) left top / 2px calc(100% - 12px) no-repeat,
    linear-gradient(var(--btn-line), var(--btn-line)) right bottom / 2px calc(100% - 12px) no-repeat;
}
.btn-secondary:hover {
  background: var(--accent-soft);
  --btn-line: var(--accent-ink);  /* the whole frame lights up on hover */
}
.btn-sm { padding: 11px 24px; font-size: 12px; letter-spacing: 2px; }
.btn-arrow::after {
  content: '→';
  transition: transform var(--t-fast);
}
.btn-arrow:hover::after { transform: translateX(4px); }

/* --- Hero (home) --- */
.hero {
  position: relative;
  padding: clamp(60px, 7vw, 100px) 0 clamp(80px, 10vw, 130px);
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 60px;
  align-items: center;
  min-height: 65vh;
}
.hero-content { max-width: 620px; position: relative; z-index: 2; }
.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  margin-bottom: 36px;
}
.stat {
  padding-left: 16px;
  border-left: 3px solid var(--accent);
  animation: statSlide 0.8s ease forwards;
  opacity: 0;
  transform: translateX(-30px);
}
.stat:nth-child(2) { animation-delay: 0.2s; }
.stat:nth-child(3) { animation-delay: 0.4s; }
.stat:nth-child(4) { animation-delay: 0.6s; }
@keyframes statSlide {
  to { opacity: 1; transform: translateX(0); }
}
.stat-value {
  font-family: var(--font-mono);
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 800;
  color: var(--accent-ink);
  line-height: 1;
  text-shadow: 0 0 20px var(--accent-glow);
  letter-spacing: 0;
}
.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-top: 8px;
}

/* Themed metric card (e.g. Project Spotlight "Aggregate impact") — chamfered
   corners + accent number, matching the rest of the card system. */
.stat-card {
  padding: clamp(28px, 3vw, 36px) 24px;
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: border-color var(--t-base), transform var(--t-base), box-shadow var(--t-base);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}
.stat-card:hover {
  border-color: var(--accent);
  transform: translateY(-5px);
  box-shadow: 0 16px 40px rgba(var(--accent-rgb), 0.12);
}
.stat-card .stat-num {
  font-family: var(--font-mono);
  font-size: clamp(2rem, 3.4vw, 2.8rem);
  font-weight: 800;
  line-height: 1;
  color: var(--accent-ink);
  text-shadow: 0 0 22px var(--accent-glow);
}
.stat-card .stat-label { margin-top: 12px; }

.hero-title {
  font-family: var(--font-display);
  /* Sized so the longest word ("EMPOWERING") fits the ~540px hero-content
     column at desktop widths — the old 8vw/6rem overflowed it (word was ~735px),
     forcing an ugly mid-word break. 5vw keeps it bold but always fits & wraps
     cleanly between words. */
  font-size: clamp(2.6rem, 5vw, 4.1rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: 5px;
  text-transform: uppercase;
  margin-bottom: 24px;
}
.hero-title .line {
  display: block;
  animation: slideInRight 0.8s ease forwards;
  opacity: 0;
  transform: translateX(50px);
}
.hero-title .line-1 { animation-delay: 0s; }
.hero-title .line-2 {
  color: var(--accent-ink);
  text-shadow: 0 0 40px var(--accent-glow);
  animation-delay: 0.2s;
}
@keyframes slideInRight {
  to { opacity: 1; transform: translateX(0); }
}

.hero-sub {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent-2-ink);
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-bottom: 20px;
  animation: fadeUp 1s ease 0.3s forwards;
  opacity: 0;
}
.hero-text {
  color: var(--text-muted);
  font-size: 17px;
  line-height: 1.75;
  margin-bottom: 36px;
  max-width: 520px;
  animation: fadeUp 1s ease 0.4s forwards;
  opacity: 0;
}
.hero-cta {
  display: flex; gap: 18px; flex-wrap: wrap;
  animation: fadeUp 1s ease 0.6s forwards;
  opacity: 0;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --- Particle canvas (home only) --- */
.particle-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 1;
  transition: opacity 600ms ease;
}
.has-particles main { position: relative; z-index: 2; }
.has-particles .hero-visual { display: none; }
/* Opacity and density are driven by JS per device profile in particles.js */

/* --- Scrollytelling stages --- */
.stage-section {
  min-height: 92vh;
  display: flex;
  align-items: center;
  padding: 80px 0;
  position: relative;
}
.stage-section .container { width: 100%; }
.stage-section .stage-content {
  max-width: 540px;
  width: 100%;
}
.stage-label {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 4px;
  color: var(--accent-ink);
  text-shadow: 0 0 12px var(--accent-glow);
  text-transform: uppercase;
  margin-bottom: 22px;
}
.stage-label::before {
  content: '';
  width: 36px; height: 1px;
  background: var(--accent-ink);
}
.stage-content h2,
.stage-content h1 {
  margin-bottom: 22px;
}
.stage-content .lead {
  margin-bottom: 32px;
}
.stage-mini-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 32px;
}
.stage-mini-grid .mini {
  padding: 18px 20px;
  border: 1px solid var(--border);
  background: var(--surface-deep);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
  transition: all var(--t-base);
}
.stage-mini-grid .mini:hover { border-color: var(--accent); background: rgba(var(--accent-rgb),0.04); }
.stage-mini-grid .mini h3 {
  font-size: 0.95rem;
  letter-spacing: 1.5px;
  margin-bottom: 6px;
  color: var(--text);
  font-weight: 600;
}
.stage-mini-grid .mini p {
  font-size: 0.85rem;
  margin: 0;
  color: var(--text-muted);
}

/* Section divider between stages and supplementary content */
.post-stages {
  position: relative;
  z-index: 3;
  background: var(--bg);
  border-top: 1px solid var(--border);
  margin-top: 40px;
}
@media (max-width: 980px) {
  .stage-section { min-height: auto; padding: 60px 0; }
  .stage-section .stage-content { max-width: 100%; }
}

/* --- Hero visual: hexagonal node network --- */
.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 460px;
  z-index: 2;
}
.hex-network {
  width: 460px;
  height: 460px;
  position: relative;
  animation: hexFloat 6s ease-in-out infinite;
}
@keyframes hexFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-12px) rotate(0.5deg); }
}

/* hex base shape */
.hex {
  position: absolute;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 11px;
  color: var(--accent);
  text-shadow: 0 0 10px var(--accent-glow);
  transition: transform 400ms ease, box-shadow 400ms ease;
}

/* center hex — filled with gradient, large */
.hex-center {
  width: 150px; height: 170px;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #000;
  font-size: 13px;
  letter-spacing: 3px;
  box-shadow: 0 0 80px var(--accent-glow);
  animation: hexCenterPulse 3s ease-in-out infinite;
  z-index: 3;
}
@keyframes hexCenterPulse {
  0%, 100% { box-shadow: 0 0 60px var(--accent-glow); }
  50%      { box-shadow: 0 0 120px rgba(var(--accent-rgb),0.7), 0 0 200px rgba(var(--accent-2-rgb),0.25); }
}

/* satellite hexes — outlined, smaller, animated */
.hex-sat {
  width: 92px; height: 105px;
  background: rgba(4, 8, 4, 0.7);
  border: 1px solid var(--accent);
  /* fake border via inner shape - use two clip-paths via box-shadow inset */
  box-shadow:
    inset 0 0 0 1px var(--accent),
    0 0 20px var(--accent-soft);
  animation: hexSatPulse 2.4s ease-in-out infinite;
  z-index: 2;
}
.hex-sat::after {
  content: '';
  position: absolute;
  inset: 6px;
  background: rgba(4, 8, 4, 0.85);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  z-index: -1;
}
@keyframes hexSatPulse {
  0%, 100% { opacity: 0.6; box-shadow: inset 0 0 0 1px var(--accent), 0 0 15px var(--accent-soft); }
  50%      { opacity: 1;   box-shadow: inset 0 0 0 1px var(--accent), 0 0 30px var(--accent-glow); }
}

/* 6 satellites positioned around the center hex */
.hex-1 { top: 4%;   left: 50%; transform: translateX(-50%);                  animation-delay: 0s;   }
.hex-2 { top: 22%;  right: 4%;                                                animation-delay: 0.3s; }
.hex-3 { bottom: 22%; right: 4%;                                              animation-delay: 0.6s; }
.hex-4 { bottom: 4%;  left: 50%; transform: translateX(-50%);                 animation-delay: 0.9s; }
.hex-5 { bottom: 22%; left: 4%;                                               animation-delay: 1.2s; }
.hex-6 { top: 22%;    left: 4%;                                               animation-delay: 1.5s; }

/* filled (alternating) satellites use mint instead of outline */
.hex-sat.filled {
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  box-shadow: 0 0 25px rgba(0,255,136,0.4);
  color: #000;
  opacity: 0.95;
}
.hex-sat.filled::after { display: none; }

/* connection lines from center to each satellite */
.hex-line {
  position: absolute;
  top: 50%; left: 50%;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
  transform-origin: left center;
  opacity: 0.4;
  z-index: 1;
  animation: lineFlow 2s linear infinite;
}
.hex-line::after {
  content: '';
  position: absolute;
  right: 0; top: 50%;
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  transform: translate(50%, -50%);
  box-shadow: 0 0 10px var(--accent);
  animation: dotPulse 2s ease-in-out infinite;
}
@keyframes lineFlow {
  0%   { opacity: 0.2; }
  50%  { opacity: 0.7; }
  100% { opacity: 0.2; }
}
@keyframes dotPulse {
  0%, 100% { transform: translate(50%, -50%) scale(1);   box-shadow: 0 0 6px var(--accent); }
  50%      { transform: translate(50%, -50%) scale(1.5); box-shadow: 0 0 16px var(--accent); }
}

/* 6 lines, rotated from center toward each satellite */
.hex-line-1 { width: 165px; transform: rotate(-90deg);  animation-delay: 0s;   }
.hex-line-2 { width: 175px; transform: rotate(-30deg);  animation-delay: 0.3s; }
.hex-line-3 { width: 175px; transform: rotate(30deg);   animation-delay: 0.6s; }
.hex-line-4 { width: 165px; transform: rotate(90deg);   animation-delay: 0.9s; }
.hex-line-5 { width: 175px; transform: rotate(150deg);  animation-delay: 1.2s; }
.hex-line-6 { width: 175px; transform: rotate(210deg);  animation-delay: 1.5s; }

/* --- Page hero (sub-pages) --- */
.page-hero {
  padding: clamp(70px, 11vw, 130px) 0 clamp(50px, 7vw, 90px);
  position: relative;
  overflow: hidden;
}
.page-hero h1 { max-width: 940px; }
.page-hero .lead { margin-top: 22px; }

/* --- Cards (generic) --- */
.card,
.pillar,
.value-card,
.team-card,
.blog-card,
.game-card,
.case-card,
.role-row,
.engine {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 30px;
  position: relative;
  transition: all var(--t-slow);
  overflow: hidden;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
}
.card::before,
.pillar::before,
.value-card::before,
.team-card::before,
.blog-card::before,
.game-card::before,
.case-card::before,
.role-row::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--t-base);
}
.card:hover, .pillar:hover, .value-card:hover, .team-card:hover,
.blog-card:hover, .game-card:hover, .case-card:hover, .role-row:hover {
  border-color: var(--accent);
  transform: translateY(-8px);
  box-shadow: 0 20px 50px rgba(var(--accent-rgb), 0.12);
}
/* Clickable hint — pillars and cards inside an <a> reveal "↗" on hover */
a.card, a.pillar, a.value-card { display: block; color: inherit; }
a.card::after, a.pillar::after, a.value-card::after, a.featured-tile::after {
  content: '↗';
  position: absolute;
  top: 18px; right: 22px;
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--accent-ink);
  opacity: 0;
  transform: translate(-4px, 4px);
  transition: all var(--t-base);
  z-index: 4;
}
a.card:hover::after, a.pillar:hover::after, a.value-card:hover::after, a.featured-tile:hover::after {
  opacity: 1;
  transform: translate(0, 0);
  text-shadow: 0 0 12px var(--accent-glow);
}
.card:hover::before, .pillar:hover::before, .value-card:hover::before, .team-card:hover::before,
.blog-card:hover::before, .game-card:hover::before, .case-card:hover::before, .role-row:hover::before {
  transform: scaleX(1);
}
.card h3, .pillar h3 { color: var(--text); transition: color var(--t-base); margin-bottom: 12px; }
.card:hover h3, .pillar:hover h3 { color: var(--accent-ink); }
.card p, .pillar p { color: var(--text-muted); }

.card-list { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border); }
.card-list li {
  padding: 8px 0;
  font-size: 1rem;
  color: var(--text-muted);
  display: flex; align-items: center; gap: 12px;
  letter-spacing: 0.3px;
}
.card-list li::before {
  content: '';
  width: 8px; height: 8px;
  background: var(--accent-ink);
  clip-path: polygon(0% 50%, 50% 0%, 50% 30%, 100% 30%, 100% 70%, 50% 70%, 50% 100%);
  flex-shrink: 0;
}

/* --- Pillar media header (image with title overlaid) — replaces the arrow
   icon on the Services cards. Set the image via inline --img. --- */
.pillar-media {
  position: relative;
  height: 175px;
  margin: 0 0 24px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  border: 1px solid var(--border);
  background-color: #0a1420;        /* image set inline per card (background-image) */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}
.pillar-media::after {            /* scrim so the title stays readable on any image */
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 38%, rgba(0,0,0,0.78) 100%);
}
.pillar-media h3 {
  position: relative; z-index: 1;
  width: 100%;
  margin: 0;
  padding: 16px 18px;
  color: #fff;                    /* white over the dark image, both themes */
}
.pillar:hover .pillar-media h3 { color: #fff; }
.pillar-media + p { margin-top: 0; }

/* --- Pillar icon --- */
.pillar-icon {
  width: 60px; height: 60px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  clip-path: polygon(0% 50%, 50% 0%, 50% 30%, 100% 30%, 100% 70%, 50% 70%, 50% 100%);
  margin-bottom: 22px;
  box-shadow: 0 0 30px var(--accent-soft);
}

/* --- Grids --- */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
/* Grid items default to min-width:auto (min-content), so a single long word or
   URL can push a track wider than the viewport. Let them shrink instead. */
.grid-2 > *, .grid-3 > *, .grid-4 > * { min-width: 0; }

/* --- Services pillars — roomier rhythm than the generic card grid --- */
.pillar-grid { gap: clamp(20px, 2.4vw, 32px); }
.pillar-grid .pillar,
.pillar-codev .pillar { padding: clamp(30px, 3vw, 44px); }
.pillar-grid .pillar .card-list,
.pillar-codev .pillar .card-list { margin-top: 22px; padding-top: 22px; }
.pillar-grid .pillar .card-list li { padding: 9px 0; }
.pillar-codev { margin-top: clamp(20px, 2.4vw, 32px); }
.pillar-codev .pillar .grid-4 { margin-top: 28px; }

/* --- Stats inline grid (for stats below hero) --- */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  padding: 32px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-top: 56px;
}
.stat-strip .stat {
  border-left: 3px solid var(--accent);
  padding-left: 16px;
  opacity: 1;
  transform: none;
  animation: none;
}

/* --- Chips --- */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  --cut: 6px;
  position: relative;               /* border = seamless SVG frame injected by main.js */
  padding: 8px 18px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  user-select: none;
  transition: color var(--t-base), background-color var(--t-base), text-shadow var(--t-base);
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut),
                     100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
}
.chip:hover, .chip.active {
  --cut-edge: var(--accent);        /* inherited by the SVG stroke → frame lights up */
  color: var(--accent-ink);
  background-color: var(--accent-soft);
  text-shadow: 0 0 10px var(--accent-glow);
}

/* --- Studio intro prose (About page, client feedback #41) --- */
.about-intro { max-width: 760px; display: grid; gap: 20px; }
.about-intro .lead { margin: 0; }
.about-intro p { color: var(--text-mid); line-height: 1.8; font-size: 1.02rem; }
.about-mission { font-size: 1.2rem; color: var(--text); letter-spacing: 0.3px; }
.about-cta { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; margin-top: 10px; }
.about-cta > span { color: var(--text-mid); }

/* --- Founder cards --- */
.team-card { text-align: center; padding: 32px; }
/* Founder portrait photo (placeholder image set inline per card) */
.team-photo {
  width: 100%;
  aspect-ratio: 4 / 5;
  margin: 0 auto 22px;
  background-color: #0a1420;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border: 1px solid var(--border);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}
.team-avatar {
  width: 90px; height: 90px;
  margin: 0 auto 20px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  clip-path: polygon(0% 50%, 50% 0%, 50% 30%, 100% 30%, 100% 70%, 50% 70%, 50% 100%);
  display: grid; place-items: center;
  font-family: var(--font-mono);
  color: #000;
  font-size: 1.4rem;
  font-weight: 800;
  box-shadow: 0 0 40px var(--accent-soft);
}
.team-role {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent-ink);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin: 8px 0 14px;
  text-shadow: 0 0 10px var(--accent-glow);
}

/* --- Role list --- */
/* Vertical space between each job opening (client 2026-07-24) — the rows previously
   stacked flush against each other. */
.role-list { display: grid; gap: 18px; }
.role-row {
  display: grid;
  /* Fixed tag columns so the dept + location tags align into tidy columns down
     the whole list (each row is its own grid, so fixed widths line them up), with
     more breathing room between the title, tags and arrow (client feedback #39). */
  grid-template-columns: 1fr 150px 170px 24px;
  align-items: center;
  gap: 36px;
  padding: 30px 36px;
  cursor: pointer;
}
.role-row h3 { font-size: 1.15rem; margin-bottom: 6px; }
.role-row p { margin: 0; font-size: 0.95rem; }
.role-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 2px;
  text-transform: uppercase;
  text-align: right;
  white-space: nowrap;
}
.role-row:hover .role-tag { color: var(--accent-ink); }
.role-arrow { color: var(--accent-ink); font-size: 1.4rem; transition: transform var(--t-base); }
.role-row:hover .role-arrow { transform: translateX(6px); }

/* --- Case study --- */
.case-card {
  display: grid;
  grid-template-columns: 1fr 1.8fr;
  gap: 36px;
  padding: 36px;
  margin-bottom: 24px;
  align-items: start;            /* visual + content top-align, no stretch */
}
/* Tighter, less shouty title so the long names don't dominate the card */
.case-card h3 {
  font-size: clamp(1.1rem, 1.5vw, 1.3rem);
  letter-spacing: 1px;
  line-height: 1.2;
  margin-bottom: 14px;
}
.case-card > div > p { font-size: 0.97rem; margin-bottom: 0; }
.case-card .case-result { margin-top: 20px; }
.case-visual {
  aspect-ratio: 4/3;
  background:
    linear-gradient(135deg, var(--accent-soft), rgba(var(--accent-2-rgb), 0.04)),
    repeating-linear-gradient(45deg, var(--bg-elev), var(--bg-elev) 10px, transparent 10px, transparent 20px);
  position: relative;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
  border: 1px solid var(--border);
}
.case-visual::after {
  content: '⌑';
  position: absolute;
  inset: 0;
  display: grid; place-items: center;
  color: var(--accent-ink);
  font-size: 3rem;
  opacity: 0.4;
}
/* Project Spotlight — key facts grid (Game / Genre / Platform / Our Contribution) */
.case-specs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 24px;
  margin: 16px 0 20px;
  padding: 16px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.case-specs > div { display: grid; gap: 4px; }
.case-specs dt {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent-ink);
}
.case-specs dd { margin: 0; color: var(--text); font-size: 0.94rem; }
@media (max-width: 480px) { .case-specs { grid-template-columns: 1fr; } }

.case-meta { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.case-meta span {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 2px;
  text-transform: uppercase;
}
.case-meta span.tag {
  color: var(--accent-ink);
  border: 1px solid var(--accent);
  padding: 4px 10px;
}
.case-row { display: grid; grid-template-columns: auto 1fr; gap: 14px 24px; margin-top: 18px; }
.case-row dt {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent-ink);
  letter-spacing: 2px;
  text-transform: uppercase;
}
.case-row dd { margin: 0; color: var(--text-muted); }
.case-result {
  display: inline-block;
  margin-top: 18px;
  padding: 10px 22px;
  border: 1px solid var(--accent);
  font-family: var(--font-mono);
  color: var(--accent-ink);
  font-size: 0.85rem;
  letter-spacing: 2px;
  text-shadow: 0 0 10px var(--accent-glow);
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
}

/* --- Blog grid --- */
.blog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.blog-card { padding: 0; }
.blog-card .blog-thumb {
  aspect-ratio: 16/10;
  background:
    radial-gradient(circle at 30% 40%, var(--accent-soft), transparent 55%),
    linear-gradient(120deg, var(--bg-elev), var(--bg-card));
  border-bottom: 1px solid var(--border);
  position: relative;
}
.blog-thumb::before {
  content: '';
  position: absolute; left: 22px; top: 22px;
  width: 36px; height: 36px;
  border: 1px solid var(--accent);
  clip-path: polygon(0% 50%, 50% 0%, 50% 30%, 100% 30%, 100% 70%, 50% 70%, 50% 100%);
  box-shadow: 0 0 12px var(--accent-soft);
}
.blog-thumb::after {
  content: attr(data-label);
  position: absolute; left: 70px; top: 30px;
  font-family: var(--font-mono); font-size: 11px;
  color: var(--accent-ink); letter-spacing: 3px;
  text-shadow: 0 0 8px var(--accent-glow);
}
.blog-body { padding: 26px 28px; }
.blog-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.blog-body h3 { font-size: 1.2rem; margin-bottom: 12px; }
.blog-body p { font-size: 0.95rem; }
.read-more { color: var(--accent-ink); font-size: 12px; letter-spacing: 3px; text-transform: uppercase; font-weight: 700; margin-top: 14px; display: inline-block; }
.read-more:hover { text-shadow: 0 0 10px var(--accent-glow); }

/* --- Featured Work strip (home) --- */
.featured-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}
.featured-tile {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-deep);
  cursor: pointer;
  transition: all var(--t-slow);
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
}
.featured-tile::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--t-base);
}
.featured-tile:hover::before { transform: scaleX(1); }
.featured-tile:hover {
  border-color: var(--accent);
  transform: translateY(-10px);
  box-shadow: 0 25px 50px rgba(var(--accent-rgb),0.15);
}
.featured-thumb {
  height: 170px;
  position: relative;
  background: linear-gradient(135deg, rgba(var(--accent-rgb),0.12), rgba(var(--accent-2-rgb),0.05));
  display: grid; place-items: center;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.featured-thumb::before {
  content: '';
  position: absolute;
  width: 70px; height: 80px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  opacity: 0.7;
  transition: transform var(--t-slow), opacity var(--t-slow);
  box-shadow: 0 0 40px var(--accent-soft);
}
.featured-tile:hover .featured-thumb::before {
  transform: scale(1.15) rotate(15deg);
  opacity: 1;
}
.featured-num {
  position: absolute;
  top: 14px; left: 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--accent-ink);
  text-shadow: 0 0 8px var(--accent-glow);
}
.featured-info {
  padding: 22px 24px;
}
.featured-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 6px;
  transition: color var(--t-base);
}
.featured-tile:hover .featured-title { color: var(--accent-ink); }
.featured-genre {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent-ink);
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* --- Game cards (Original IP) --- */
.game-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; }
.game-card { padding: 0; }
.game-art {
  aspect-ratio: 16/9;
  position: relative;
  background:
    radial-gradient(circle at 70% 30%, var(--accent-soft), transparent 60%),
    linear-gradient(135deg, var(--bg-elev), var(--bg));
  border-bottom: 1px solid var(--border);
  display: grid; place-items: center;
  overflow: hidden;
}
.game-art::before {
  content: '';
  width: 50%; height: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  clip-path: polygon(0% 50%, 50% 0%, 50% 30%, 100% 30%, 100% 70%, 50% 70%, 50% 100%);
  opacity: 0.5;
  box-shadow: 0 0 60px var(--accent-soft);
}
.game-tag {
  position: absolute; top: 18px; left: 18px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent-ink);
  letter-spacing: 3px;
  padding: 5px 12px;
  border: 1px solid var(--accent);
  text-transform: uppercase;
  text-shadow: 0 0 8px var(--accent-glow);
}
.game-body { padding: 28px; }
.game-genre {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent-ink);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 14px;
  text-shadow: 0 0 8px var(--accent-glow);
}

/* --- Forms --- */
.form { display: grid; gap: 18px; max-width: 640px; }
.form-row { display: grid; gap: 8px; }
.form-row label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--accent-ink);
  text-transform: uppercase;
  text-shadow: 0 0 8px var(--accent-glow);
}
.form-row input,
.form-row textarea,
.form-row select {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  padding: 15px 18px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.98rem;
  transition: all var(--t-fast);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
}
.form-row input:focus,
.form-row textarea:focus,
.form-row select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-soft);
}
/* Native <select> dropdown options render in an OS popup that would otherwise
   inherit the page's light text → unreadable. Force dark-on-white so the menu
   options are always legible regardless of theme. */
.form-row select option { color: #16210f; background: #ffffff; }
.form-row textarea { min-height: 140px; resize: vertical; }
.form-row.row-2 { grid-template-columns: 1fr 1fr; gap: 18px; }
.form-row.row-2 > div { display: grid; gap: 8px; }
.form-msg {
  padding: 14px 18px;
  font-size: 0.9rem;
  font-family: var(--font-mono);
  letter-spacing: 1px;
  display: none;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
}
/* borderless (display:none until submit, so it can't host the SVG frame; the bg tint +
   text colour carry the success/error state, and a plain border would break at the cut) */
.form-msg.success { display: block; background: var(--accent-soft); border: none; color: var(--accent-ink); }
.form-msg.error   { display: block; background: rgba(255,90,90,0.08); border: none; color: var(--danger); }

/* --- Newsletter --- */
.newsletter {
  background: linear-gradient(135deg, rgba(var(--accent-rgb),0.04), rgba(var(--accent-2-rgb),0.02));
  border: 1px solid var(--border);
  padding: 48px;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 32px;
  align-items: center;
  position: relative;
  overflow: hidden;
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
}
.newsletter::before {
  content: '';
  position: absolute; right: -120px; top: -120px;
  width: 320px; height: 320px;
  background: radial-gradient(circle, var(--accent-soft), transparent 70%);
  filter: blur(40px);
}
.newsletter h3 { font-size: 1.6rem; margin-bottom: 10px; position: relative; }
.newsletter p { position: relative; margin-bottom: 0; }
.newsletter-form {
  display: flex; gap: 10px; position: relative;
}
.newsletter-form input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  padding: 15px 22px;
  color: var(--text);
  font-size: 0.95rem;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
}
.newsletter-form input:focus { border-color: var(--accent); }

/* --- Value card variant (no large numbers, just headlines) --- */
.value-card { padding: 30px; }
.value-card h3 { font-size: 1.1rem; margin-bottom: 10px; }
.value-card p { color: var(--text-muted); font-size: 0.95rem; }

/* --- Engine row --- */
.engine-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.engine { padding: 30px 24px; text-align: center; cursor: default; }
.engine .engine-name {
  font-family: var(--font-display);
  font-size: 1.4rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 6px;
  transition: color var(--t-base);
}
.engine:hover .engine-name { color: var(--accent-ink); text-shadow: 0 0 20px var(--accent-glow); }
.engine .engine-desc {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* --- Global Presence --- */
.presence { display: grid; grid-template-columns: 1fr 1.4fr; gap: 48px; align-items: center; }
.presence-map {
  aspect-ratio: 16/10;
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  background-image:
    radial-gradient(circle at 22% 38%, var(--accent-ink) 2px, transparent 3px),
    radial-gradient(circle at 48% 28%, var(--accent-ink) 2px, transparent 3px),
    radial-gradient(circle at 68% 42%, var(--accent-ink) 2px, transparent 3px),
    radial-gradient(circle at 78% 55%, var(--accent-ink) 2px, transparent 3px),
    radial-gradient(circle at 34% 65%, var(--accent-ink) 2px, transparent 3px),
    radial-gradient(circle at 58% 70%, var(--accent-ink) 2px, transparent 3px),
    linear-gradient(135deg, var(--bg-card), var(--bg-elev));
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
}
.presence-map::after {
  content: 'GLOBAL NETWORK · 24/7 SUPPORT';
  position: absolute; bottom: 18px; left: 18px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--accent-ink);
  text-shadow: 0 0 8px var(--accent-glow);
}
.presence-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-top: 28px; }
.presence-stats .stat { padding-left: 16px; opacity: 1; transform: none; animation: none; }

/* --- Quote / Philosophy --- */
.quote {
  padding: 56px;
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
  position: relative;
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
}
.quote-text {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.2vw, 2.4rem);
  font-weight: 600;
  letter-spacing: 2px;
  line-height: 1.2;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 20px;
}
.quote-attr {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent-ink);
  letter-spacing: 3px;
  text-transform: uppercase;
  text-shadow: 0 0 10px var(--accent-glow);
}

/* --- CTA banner --- */
.cta-banner {
  text-align: center;
  padding: 80px 40px;
  background: radial-gradient(circle at 50% 0%, var(--accent-soft), transparent 60%), var(--surface-deep);
  border: 1px solid var(--border);
  position: relative;
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
}
.cta-banner h2 { max-width: 780px; margin: 0 auto 18px; }
.cta-banner .hero-cta { justify-content: center; opacity: 1; animation: none; }

/* --- Footer --- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 80px 0 32px;
  background: var(--bg-elev);
  position: relative; z-index: 1;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 56px;
}
.footer-col h3 {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--accent-ink);
  margin-bottom: 22px;
  text-shadow: 0 0 8px var(--accent-glow);
  font-weight: 600;
}
.footer-col ul li { margin-bottom: 12px; }
.footer-col ul a {
  font-size: 0.92rem;
  color: var(--text-muted);
  letter-spacing: 1px;
  transition: color var(--t-fast);
}
.footer-col ul a:hover { color: var(--accent-ink); }
.footer-brand p { font-size: 0.95rem; max-width: 320px; margin-top: 16px; }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 32px; border-top: 1px solid var(--border);
  font-size: 0.82rem; color: var(--text-dim);
  flex-wrap: wrap; gap: 16px;
  font-family: var(--font-mono);
  letter-spacing: 2px;
}
.socials { display: flex; gap: 10px; }
.socials a {
  --cut: 6px;
  position: relative;               /* border = seamless SVG frame injected by main.js (#36) */
  width: 36px; height: 36px;
  display: grid; place-items: center;
  color: var(--accent-ink);
  transition: color var(--t-fast), background-color var(--t-fast), box-shadow var(--t-fast);
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut),
                     100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
}
/* :not(.cut-frame) so the sizing here never hits the injected frame SVG */
.socials a svg:not(.cut-frame) { width: 17px; height: 17px; fill: currentColor; display: block; }
.socials a:hover { --cut-edge: var(--accent); background-color: var(--accent-soft); color: var(--accent); }

/* --- Direct contact --- */
.direct-contact { display: grid; gap: 4px; }
.direct-contact .dc-row {
  display: grid;
  /* minmax(0,1fr) lets the value track shrink below its content's min width —
     without it, long emails / the LinkedIn URL force the column past the
     viewport and get clipped on phones. */
  grid-template-columns: 140px minmax(0, 1fr);
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}
.direct-contact .dc-row dt {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--accent-ink);
  text-transform: uppercase;
  text-shadow: 0 0 8px var(--accent-glow);
}
.direct-contact .dc-row dd { margin: 0; color: var(--text); min-width: 0; overflow-wrap: anywhere; }

/* --- Misc utilities --- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mt-2 { margin-top: 16px; }
.mt-4 { margin-top: 32px; }
.mt-6 { margin-top: 48px; }
.mb-0 { margin-bottom: 0; }
.live-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent-ink);
  margin-right: 8px;
  box-shadow: 0 0 10px var(--accent);
  animation: livePulse 2s infinite;
}
@keyframes livePulse {
  0%,100% { opacity: 1; box-shadow: 0 0 10px var(--accent); }
  50%     { opacity: 0.5; box-shadow: 0 0 4px var(--accent); }
}

/* --- Responsive --- */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { min-height: 320px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .case-card { grid-template-columns: 1fr; }
  .blog-grid { grid-template-columns: repeat(2, 1fr); }
  .featured-strip { grid-template-columns: repeat(2, 1fr); }
  .engine-row { grid-template-columns: repeat(2, 1fr); }
  .newsletter { grid-template-columns: 1fr; padding: 32px; }
  .presence { grid-template-columns: 1fr; }
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
  .hero-stats { gap: 28px; }
}
/* Collapse nav to a hamburger early — 7 links + logo + CTA cram and clip
   between ~720–980px, so switch before that zone, not after it. */
@media (max-width: 960px) {
  .nav-links {
    position: fixed;
    inset: 110px 0 auto 0;   /* aligns under the taller header (64px logo) */
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg-elev);
    padding: 24px var(--pad-x);
    border-bottom: 1px solid var(--border);
    /* Hide via visibility + fade + small slide, NOT translateY(-110%): the panel is
       fixed at top:110px, so -110% of its own (short) height didn't clear the header —
       the last item peeked in at the top and covered the logo. visibility is height-
       independent, so the closed menu is always fully hidden regardless of item count. */
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform var(--t-base), opacity var(--t-base), visibility var(--t-base);
  }
  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
  .nav-links a {
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
  }
  .nav-links a::before, .nav-links a::after { display: none; }
  .nav-toggle { display: block; }
  .nav-cta .btn { display: none; }
  .nav-cta .btn.btn-primary { display: inline-flex; padding: 9px 18px; font-size: 11px; }
}
/* Phones (≤480px): the inline "Work With Us" CTA + hamburger together exceed
   the screen width, so the hamburger was clipped off the right edge. Hide the
   CTA button here — the hamburger takes the corner — and surface "Work With
   Us" as a highlighted item inside the dropdown so Contact stays reachable. */
@media (max-width: 480px) {
  .nav-cta .btn.btn-primary { display: none; }
  .nav-links a.nav-contact-m {
    display: block;
    margin-top: 8px;
    color: var(--accent-ink);
    font-weight: 700;
    border-bottom: none;
  }
}
@media (max-width: 720px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-row.row-2 { grid-template-columns: 1fr; }
  .game-grid { grid-template-columns: 1fr; }
  .blog-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .case-card { padding: 28px; gap: 24px; }
  .role-row { grid-template-columns: 1fr; gap: 8px; padding: 22px; }
  /* single-column stack on phones — tags left-align under the title again */
  .role-row .role-tag { text-align: left; }
  .role-row .role-arrow { justify-self: end; margin-top: -34px; }
  .quote { padding: 36px 24px; }
  .stat-strip { grid-template-columns: 1fr 1fr; }
  .hero-stats { gap: 24px; }
  .newsletter-form { flex-direction: column; }
  .newsletter-form .btn { width: 100%; justify-content: center; }
}

/* --- Small phones (≤480px): the display-heading clamp floors (h1 2.8rem,
   .hero-title 3rem) are wider than the screen for long single words like
   "DEVELOPMENT", which then clip. Shrink the floors + trim letter-spacing so
   headings fit without mid-word breaks. Covers iPhone SE → Pro Max & Androids. */
@media (max-width: 480px) {
  h1 { font-size: clamp(2rem, 8.5vw, 2.8rem); letter-spacing: 3px; }
  h2 { letter-spacing: 2px; }
  /* mobile-only safety net: allow an over-long single word to break rather than
     clip the narrow viewport. Never active on desktop (would split mid-word). */
  h1, h2, h3, .hero-title, .page-hero h1 { overflow-wrap: break-word; }
  .hero-title { font-size: clamp(2.3rem, 10vw, 3rem); letter-spacing: 3px; }
  .page-hero h1 { letter-spacing: 3px; }
  /* trim button padding/spacing so long labels fit */
  .btn { padding: 14px 22px; letter-spacing: 2px; }
  .btn-sm { padding: 10px 18px; letter-spacing: 1.5px; }
  /* stack the "reach us directly" rows: mono label above the value */
  .direct-contact .dc-row { grid-template-columns: 1fr; gap: 4px; }
  /* stack the two-up mini cards + shrink engine labels so nothing clips */
  .stage-mini-grid { grid-template-columns: 1fr; }
  .engine { padding: 22px 10px; }
  .engine .engine-name { font-size: 1.05rem; letter-spacing: 1px; }
  .engine .engine-desc { letter-spacing: 1px; }
  .nav-links { top: 92px; }   /* aligns under the phone header (56px logo + 18px pad) */
}
@media (max-width: 380px) {
  h1 { font-size: clamp(1.75rem, 8vw, 2.3rem); letter-spacing: 2px; }
  .hero-title { font-size: clamp(2rem, 9vw, 2.5rem); letter-spacing: 2px; }
  /* tighten the hero stat row + case-metric labels so they fit tiny phones */
  .hero-stats { gap: 16px 22px; }
  .case-metric .m-label { letter-spacing: 1px; overflow-wrap: anywhere; }
}

/* Buttons on phones: labels + the 38px side padding overflow narrow containers
   (e.g. .hero-cta inside a padded .cta-banner) and were clipped by the button's
   overflow:hidden. Allow labels to wrap, make CTAs full-width, and reduce the
   banner's side padding so buttons get the room they need. */
@media (max-width: 600px) {
  .btn { white-space: normal; word-break: break-word; line-height: 1.25; }
  .cta-banner { padding: 56px 22px; }
  .hero-cta { width: 100%; gap: 14px; }
  .hero-cta .btn { width: 100%; }
}

/* --- Scroll reveal helper (used by JS) --- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 600ms ease, transform 600ms ease;
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* =========================================================
   THEMING — accent palettes + light mode
   ========================================================= */

/* --- Accent palettes (hue swap; surfaces unchanged) --- */
[data-accent="cyan"] {
  --accent:        #25e6ff;
  --accent-2:      #4d8bff;
  --accent-rgb:    37, 230, 255;
  --accent-2-rgb:  77, 139, 255;
  --accent-deep:   #0b6f88;
  --accent-mid:    #1093b3;
  --accent-mid-rgb: 16, 147, 179;
}
[data-accent="magenta"] {
  --accent:        #ff45b1;
  --accent-2:      #b14dff;
  --accent-rgb:    255, 69, 177;
  --accent-2-rgb:  177, 77, 255;
  --accent-deep:   #b3006e;
  --accent-mid:    #cc1f86;
  --accent-mid-rgb: 204, 31, 134;
}
[data-accent="amber"] {
  --accent:        #ffb000;
  --accent-2:      #ff6a2c;
  --accent-rgb:    255, 176, 0;
  --accent-2-rgb:  255, 106, 44;
  --accent-deep:   #8a5a00;
  --accent-mid:    #a87400;
  --accent-mid-rgb: 168, 116, 0;
}
[data-accent="emerald"] {
  --accent:        #18e08a;
  --accent-2:      #00ffd0;
  --accent-rgb:    24, 224, 138;
  --accent-2-rgb:  0, 255, 208;
  --accent-deep:   #117a4a;
  --accent-mid:    #149e60;
  --accent-mid-rgb: 20, 158, 96;
}
[data-accent="blue"] {
  --accent:        #3b9bff;
  --accent-2:      #7c6bff;
  --accent-rgb:    59, 155, 255;
  --accent-2-rgb:  124, 107, 255;
  --accent-deep:   #1560c0;
  --accent-mid:    #1f7ad6;
  --accent-mid-rgb: 31, 122, 214;
}
[data-accent="violet"] {
  --accent:        #a36bff;
  --accent-2:      #e26bff;
  --accent-rgb:    163, 107, 255;
  --accent-2-rgb:  226, 107, 255;
  --accent-deep:   #6a28c2;
  --accent-mid:    #8a3fd9;
  --accent-mid-rgb: 138, 63, 217;
}
[data-accent="rose"] {
  --accent:        #ff5a7a;
  --accent-2:      #ff8f6b;
  --accent-rgb:    255, 90, 122;
  --accent-2-rgb:  255, 143, 107;
  --accent-deep:   #b21240;
  --accent-mid:    #d62357;
  --accent-mid-rgb: 214, 35, 87;
}

/* --- Light mode --- a calmer surface skin. Vivid accent is kept for fills
   (buttons, icon shapes, top-bars) but text/thin outlines fall back to the
   readable --accent-deep via --accent-ink, and glows are dropped. --- */
[data-theme="light"] {
  --bg:            #f3f5f8;
  --bg-elev:       #ffffff;
  --bg-card:       #ffffff;
  --bg-card-hov:   rgba(var(--accent-rgb), 0.06);
  --border:        rgba(12, 20, 8, 0.14);
  --border-strong: rgba(12, 20, 8, 0.26);

  --accent-soft:   rgba(var(--accent-rgb), 0.14);
  --accent-glow:   transparent;            /* removes neon text-shadows */
  --accent-ink:    var(--accent-deep);
  --accent-2-ink:  var(--accent-deep);

  --surface-glass:  rgba(244, 246, 240, 0.85);
  --surface-deep:   rgba(12, 20, 8, 0.04);

  /* Grains follow the active accent's mid tone — clean + visible on white,
     never muddy. (Lime → #3f8f14, cyan → teal, etc.) */
  --particle-color: var(--accent-mid);
  --particle-rgb:   var(--accent-mid-rgb);
  --particle-trail: rgba(244, 246, 240, 0.5);

  --text:        #0c1408;
  --text-muted:  #3a4636;   /* darkened for stronger contrast on light bg */
  --text-dim:    #4b554a;
  --text-mid:    #2c3526;

  /* Vivid accents wash out on the pale surface — use a neutral dark frame. */
  --btn-line:    rgba(12, 20, 8, 0.35);
}
/* In light mode, soften the heavy drop shadows that were tuned for black. */
[data-theme="light"] .card:hover,
[data-theme="light"] .pillar:hover,
[data-theme="light"] .value-card:hover,
[data-theme="light"] .team-card:hover,
[data-theme="light"] .blog-card:hover,
[data-theme="light"] .game-card:hover,
[data-theme="light"] .case-card:hover,
[data-theme="light"] .role-row:hover,
[data-theme="light"] .featured-tile:hover {
  box-shadow: 0 18px 40px rgba(12, 20, 8, 0.10);
}
/* Light-mode buttons: keep readable contrast on the vivid fill. */
[data-theme="light"] .btn-primary { color: #06140a; }

/* =========================================================
   THEME CONTROL — floating accent swatches + light/dark toggle (bottom-right)
   ========================================================= */
.theme-fab {
  position: fixed;
  right: clamp(14px, 2.5vw, 28px);
  bottom: clamp(14px, 2.5vw, 28px);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  max-width: min(92vw, 340px);
  background: var(--surface-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-strong);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
}
.theme-fab .swatches { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.theme-swatch {
  width: 22px; height: 22px;
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: 50%;
  background: var(--sw, #3fd6c8);
  transition: transform var(--t-fast), box-shadow var(--t-fast);
  padding: 0;
}
.theme-swatch:hover { transform: scale(1.15); }
.theme-swatch[aria-pressed="true"] {
  border-color: var(--text);
  box-shadow: 0 0 0 2px var(--bg), 0 0 12px var(--sw);
}
.theme-divider { width: 1px; height: 24px; background: var(--border-strong); }
.theme-mode {
  width: 34px; height: 28px;
  display: grid; place-items: center;
  cursor: pointer;
  color: var(--accent-ink);
  border: 1px solid var(--border-strong);
  clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 6px 100%, 0 calc(100% - 6px));
  transition: color var(--t-fast), border-color var(--t-fast);
  font-size: 15px; line-height: 1;
}
.theme-mode:hover { border-color: var(--accent); color: var(--accent); }
/* Desktop/tablet: the full bar shows; the collapse toggle is hidden. */
.theme-fab-toggle { display: none; }
@media (max-width: 720px) {
  .theme-fab { padding: 8px 10px; gap: 7px; }
  .theme-swatch { width: 19px; height: 19px; }
}
/* Phones (≤600px): collapse the switcher to a single round button so it never
   overlaps form fields / page content. Tapping it (JS toggles .open) reveals
   the swatches + light/dark toggle as a compact card above the button. */
@media (max-width: 600px) {
  .theme-fab {
    right: 16px; bottom: 16px;
    flex-direction: column; align-items: flex-end; gap: 10px;
    padding: 0; max-width: none;
    background: none; border: none;
    -webkit-backdrop-filter: none; backdrop-filter: none;
    clip-path: none;
  }
  /* collapsed state — hide the controls, show only the round toggle */
  .theme-fab .swatches,
  .theme-fab .theme-divider,
  .theme-fab .theme-mode { display: none; }
  .theme-fab-toggle {
    display: grid; place-items: center; order: 2;
    width: 48px; height: 48px; border-radius: 50%;
    background: var(--surface-glass);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    border: 1px solid var(--border-strong);
    color: var(--accent-ink); cursor: pointer;
    font-size: 21px; line-height: 1;
    box-shadow: 0 6px 20px rgba(0,0,0,.4);
  }
  /* expanded state — swatches card + mode button appear above the toggle */
  .theme-fab.open .swatches {
    display: flex; flex-wrap: wrap; justify-content: flex-end; order: 1;
    gap: 11px; padding: 14px; max-width: min(80vw, 264px);
    background: var(--surface-glass);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    /* only chamfered here (mobile, open) — borderless so the cut corners can't break;
       the glass background defines the card edge */
    border: none;
    clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
  }
  .theme-fab.open .theme-mode { display: grid; order: 1; width: 48px; height: 40px; }
  .theme-fab.open .theme-swatch { width: 26px; height: 26px; }
}

/* =========================================================
   PROJECT SPOTLIGHT — expandable deep-dive accordion
   ========================================================= */
.case-actions { margin-top: 22px; }
/* .case-toggle is a standard .btn btn-secondary btn-sm in the markup (client
   2026-07-13: one button style site-wide — its old bespoke 1px border broke
   at the chamfer cuts). Only the chevron behaviour lives here. */
.case-toggle .chev { transition: transform var(--t-base); font-size: 0.9em; }
.case-toggle[aria-expanded="true"] .chev { transform: rotate(180deg); }

/* Animated open/close via max-height (cheap, no JS measuring). */
.case-detail {
  grid-column: 1 / -1;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height var(--t-slow), opacity var(--t-slow), margin-top var(--t-slow);
}
.case-detail.open {
  max-height: 1600px;
  opacity: 1;
  margin-top: 28px;
}
.case-detail-inner {
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.case-detail h4 {
  color: var(--accent-ink);
  font-family: var(--font-mono);
  letter-spacing: 3px;
  margin-bottom: 14px;
}
.case-detail h4:not(:first-child) { margin-top: 30px; }
/* Process timeline */
.case-steps { display: grid; gap: 16px; margin-top: 6px; }
.case-step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: start;
}
.case-step .step-num {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--accent-ink);
  border: 1px solid var(--border-strong);
  width: 38px; height: 38px;
  display: grid; place-items: center;
  flex-shrink: 0;
  clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 6px 100%, 0 calc(100% - 6px));
}
.case-step .step-body h5 {
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 4px;
}
.case-step .step-body p { margin: 0; font-size: 0.95rem; }
/* Outcome metric grid inside the deep-dive */
.case-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 8px;
}
.case-metric {
  padding: 20px;
  min-width: 0;
  border: 1px solid var(--border);
  background: var(--surface-deep);
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
}
.case-metric .m-num {
  font-family: var(--font-mono);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--accent-ink);
  line-height: 1;
}
.case-metric .m-label {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 8px;
}
/* Visual gallery placeholders */
.case-gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 6px; }
/* Clickable image tile that opens the lightbox/slider */
.case-shot {
  position: relative;
  aspect-ratio: 16/10;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  border: 1px solid var(--border);
  background-color: #0a1420;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex; align-items: flex-end;
  transition: border-color var(--t-base), transform var(--t-base);
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
}
.case-shot:hover, .case-shot:focus-visible { border-color: var(--accent); transform: translateY(-2px); }
.case-shot::after {                 /* zoom affordance */
  content: '⤢';
  position: absolute; top: 7px; right: 9px;
  font-size: 14px; color: #fff;
  opacity: 0; transition: opacity var(--t-fast);
  text-shadow: 0 1px 4px rgba(0,0,0,0.7);
}
.case-shot:hover::after, .case-shot:focus-visible::after { opacity: 1; }
.case-shot span {
  position: relative; z-index: 1;
  margin: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #fff;
  background: rgba(0,0,0,0.55);
  padding: 3px 7px;
}
@media (max-width: 720px) {
  .case-metrics, .case-gallery { grid-template-columns: 1fr 1fr; }
}

/* =========================================================
   LIGHTBOX — full-screen image viewer / slider
   ========================================================= */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: clamp(20px, 5vw, 64px);
  background: rgba(2, 5, 2, 0.93);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity var(--t-base);
}
.lightbox.open { opacity: 1; }
.lightbox[hidden] { display: none; }   /* author display:flex would otherwise override [hidden] */
.lb-stage {
  margin: 0;
  max-width: min(1100px, 92vw);
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.lb-img {
  max-width: 100%; max-height: 78vh; width: auto; height: auto;
  background: #0a1420;
  /* replaced <img> can't host the SVG frame; a plain border would break at the cut
     corners, so just chamfer the image itself — the photo is the content, no outline. */
  border: none;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
}
.lb-caption {
  font-family: var(--font-mono);
  font-size: 12px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--accent);
}
.lb-close, .lb-nav {
  position: absolute;
  background: transparent; color: #fff; cursor: pointer; line-height: 1;
  border: 1px solid var(--border-strong);
  transition: color var(--t-fast), border-color var(--t-fast), background var(--t-fast);
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
}
.lb-close { top: clamp(14px,2.5vw,26px); right: clamp(14px,2.5vw,26px); width: 44px; height: 44px; font-size: 18px; }
.lb-nav { top: 50%; transform: translateY(-50%); width: 52px; height: 52px; font-size: 28px; }
.lb-prev { left: clamp(10px,2.5vw,30px); }
.lb-next { right: clamp(10px,2.5vw,30px); }
.lb-close:hover, .lb-nav:hover { color: var(--accent); border-color: var(--accent); background: rgba(var(--accent-rgb),0.08); }
.lb-counter {
  position: absolute; bottom: clamp(14px,3vw,28px); left: 50%; transform: translateX(-50%);
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 2px; color: var(--text-mid);
}
@media (max-width: 600px) { .lb-nav { width: 42px; height: 42px; font-size: 22px; } }
@media (prefers-reduced-motion: reduce) { .lightbox { transition: none; } }

/* --- Respect reduced-motion for the new interactive bits --- */
@media (prefers-reduced-motion: reduce) {
  .case-detail { transition: none; }
  .theme-fab, .theme-swatch, .theme-mode, .case-toggle { transition: none; }
}

/* =========================================================
   SCROLL DOTS — vertical pagination rail (home page, desktop)
   ========================================================= */
.scroll-dots {
  position: fixed;
  right: clamp(12px, 1.8vw, 26px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 55;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 16px;
}
.scroll-dot {
  position: relative;
  width: 12px; height: 12px;
  padding: 0;
  border-radius: 50%;
  border: 1.5px solid var(--text-mid);
  background: transparent;
  cursor: pointer;
  transition: border-color var(--t-base), background var(--t-base), transform var(--t-base);
}
.scroll-dot:hover { border-color: var(--accent); }
.scroll-dot[aria-current="true"] {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
  transform: scale(1.18);
}
/* hover/focus label tooltip */
.dot-label {
  position: absolute;
  right: 24px; top: 50%;
  transform: translateY(-50%) translateX(6px);
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text);
  background: var(--surface-glass);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 6px 11px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-fast), transform var(--t-fast);
  clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 6px 100%, 0 calc(100% - 6px));
}
.scroll-dot:hover .dot-label,
.scroll-dot:focus-visible .dot-label {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}
@media (max-width: 768px) { .scroll-dots { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .scroll-dot { transition: none; }
  .dot-label { transition: none; }
}

/* =========================================================
   PLACEHOLDER MEDIA — consistent image placeholders across every card
   thumbnail (replaces the old CSS hexagon/diamond/⌑ shapes), matching the
   Services card style. Swap the SVGs in assets/img/placeholders/ for real
   key art later. Images cycle so a grid isn't visually identical.
   ========================================================= */
.blog-thumb, .featured-thumb, .game-art, .case-visual {
  background-image: url('../img/placeholders/svc-1.svg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
/* retire the decorative shapes that used to stand in for imagery */
.blog-thumb::before, .featured-thumb::before, .game-art::before { display: none; }
.case-visual::after { display: none; }

/* Insights blog thumbnails */
.blog-card:nth-of-type(2) .blog-thumb { background-image: url('../img/placeholders/svc-2.svg'); }
.blog-card:nth-of-type(3) .blog-thumb { background-image: url('../img/placeholders/svc-3.svg'); }
.blog-card:nth-of-type(4) .blog-thumb { background-image: url('../img/placeholders/svc-4.svg'); }
.blog-card:nth-of-type(5) .blog-thumb { background-image: url('../img/placeholders/svc-5.svg'); }
.blog-card:nth-of-type(6) .blog-thumb { background-image: url('../img/placeholders/svc-2.svg'); }
/* Home featured-work tiles */
.featured-tile:nth-of-type(1) .featured-thumb { background-image: url('../img/placeholders/svc-2.svg'); }
.featured-tile:nth-of-type(2) .featured-thumb { background-image: url('../img/placeholders/svc-3.svg'); }
.featured-tile:nth-of-type(3) .featured-thumb { background-image: url('../img/placeholders/svc-4.svg'); }
.featured-tile:nth-of-type(4) .featured-thumb { background-image: url('../img/placeholders/svc-5.svg'); }
/* Original IP game art */
.game-card:nth-of-type(1) .game-art { background-image: url('../img/placeholders/svc-2.svg'); }
.game-card:nth-of-type(2) .game-art { background-image: url('../img/placeholders/svc-4.svg'); }
/* Project Spotlight visuals */
.case-card:nth-of-type(1) .case-visual { background-image: url('../img/placeholders/svc-3.svg'); }
.case-card:nth-of-type(2) .case-visual { background-image: url('../img/placeholders/svc-5.svg'); }
.case-card:nth-of-type(3) .case-visual { background-image: url('../img/placeholders/svc-1.svg'); }

/* =========================================================
   CHAMFER FRAME — cut top-right + bottom-left corners with a
   border on ALL edges (incl. the two diagonals), matching the
   button corner-cut. Non-invasive: straight-edge borders come
   from `border`; the two diagonal border lines are painted as
   background-image gradients pinned to the TR + BL corner boxes,
   so no pseudo-elements are consumed. --accent-driven → themeable.
   ========================================================= */
:root {
  --cut: 12px;
  --cut-bw: 1.5px;                            /* border width, all edges */
  --cut-edge: rgba(var(--accent-rgb), 0.38);  /* refined teal frame — subtle, not loud */
  /* Diagonal corner line for FORM FIELDS (can't host an SVG child) — cards use the
     seamless SVG stroke below instead. */
  --cut-line: linear-gradient(to top right,
      transparent calc(50% - var(--cut-bw)), var(--cut-edge) calc(50% - var(--cut-bw)),
      var(--cut-edge) 50%, transparent 50%);

  /* Seamless chamfered frame drawn ENTIRELY as background-image layers — the same
     six-segment technique as .btn-secondary (4 straight edges that each stop at the
     cut, + 2 diagonal slashes filling the cut corners). Unlike `border`, background
     paints INSIDE the clip-path, so every edge meets the cut cleanly with no broken
     corner (client feedback #35/#36/#38). Works on replaced elements (input/select/
     textarea) that can't host an SVG child. Each consumer sets its own --cut and may
     flip --cut-edge (e.g. → accent on focus/hover). */
  --cut-frame:
    linear-gradient(45deg, transparent calc(50% - var(--cut-bw)),
      var(--cut-edge) calc(50% - var(--cut-bw)) calc(50% + var(--cut-bw)),
      transparent calc(50% + var(--cut-bw))),
    linear-gradient(45deg, transparent calc(50% - var(--cut-bw)),
      var(--cut-edge) calc(50% - var(--cut-bw)) calc(50% + var(--cut-bw)),
      transparent calc(50% + var(--cut-bw))),
    linear-gradient(var(--cut-edge), var(--cut-edge)),
    linear-gradient(var(--cut-edge), var(--cut-edge)),
    linear-gradient(var(--cut-edge), var(--cut-edge)),
    linear-gradient(var(--cut-edge), var(--cut-edge));
  --cut-frame-pos: top right, bottom left, left top, right bottom, left top, right bottom;
  --cut-frame-size:
    var(--cut) var(--cut), var(--cut) var(--cut),
    calc(100% - var(--cut)) var(--cut-bw), calc(100% - var(--cut)) var(--cut-bw),
    var(--cut-bw) calc(100% - var(--cut)), var(--cut-bw) calc(100% - var(--cut));
}
/* Every chamfered box: cut its own shape (12px, !important beats higher-specificity
   component rules) + establish a positioning context + the neon-bloom glow. The
   VISIBLE border is drawn by a foreground overlay `.cut-frame` (injected by
   main.js) so it renders on TOP of card content — incl. full-bleed images and
   gradient washes that previously hid the diagonal corner border. */
.cut,
.card, .stat-card, .engine, .quote, .case-metric, .mini,
.team-card, .role-row, .value-card, .pillar,
.blog-card, .game-card, .case-card, .featured-tile,
.cta-banner, .newsletter {
  position: relative;
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut),
                     100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut))) !important;
  /* the SVG frame is the ONLY border — kill each component's own border so its
     clipped edge + hover brightening don't fight the frame (black seam on hover). */
  border: none !important;
  /* no resting glow — keeps dense pages clean; the bloom is a hover-only accent */
  transition: transform var(--t-base), filter var(--t-base);
}
/* Foreground frame overlay — a single continuous SVG stroke around the chamfer
   (built + kept sized by main.js). One unbroken path = uniform width on every
   edge incl. both diagonals, with NO seams/black gaps at the corner junctions.
   Painted above everything so no image/wash can cover the cut border. */
svg.cut-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
  overflow: visible;
}
svg.cut-frame path {
  fill: none;
  stroke: var(--cut-edge);
  stroke-width: var(--cut-bw);
}
/* Small chamfered UI chrome (mobile hamburger, theme switcher, lightbox controls) —
   kill their own plain 1px border so ONLY the seamless SVG frame draws (main.js frames
   them, incl. the JS-built ones via its MutationObserver). Hover lights the stroke to
   accent, replacing the old border-color:accent hover. .theme-fab is position:fixed and
   .lb-* are position:absolute already, so they stay positioned for the inset frame. */
.nav-toggle, .theme-fab, .theme-mode, .lb-close, .lb-nav, .dot-label,
.pillar-media {
  border: none !important;
}
/* --cut must match each element's clip-path cut so the SVG frame path aligns */
.nav-toggle { --cut: 8px; }
.theme-fab  { --cut: 10px; }
.theme-mode { --cut: 6px; position: relative; }
.lb-close, .lb-nav { --cut: 8px; }
.dot-label { --cut: 6px; }
.nav-toggle:hover, .theme-mode:hover, .lb-close:hover, .lb-nav:hover {
  --cut-edge: var(--accent);
}
/* hover: lift + intensified teal bloom (the restored "wow") */
.card:hover, .stat-card:hover, .engine:hover, .quote:hover, .case-metric:hover, .mini:hover,
.team-card:hover, .role-row:hover, .value-card:hover, .pillar:hover,
.blog-card:hover, .game-card:hover, .case-card:hover, .featured-tile:hover,
.cta-banner:hover, .newsletter:hover {
  transform: translateY(-6px);
  filter: drop-shadow(0 0 14px rgba(var(--accent-rgb), 0.30));
}

/* Additional chamfered boxes (smaller / varying cut sizes) that also get the
   seamless SVG frame. Own border removed so only the frame draws; JS reads each
   element's --cut so the SVG path matches the clip. */
.case-result, .case-visual, .team-photo, .presence-map, .case-shot, .step-num {
  position: relative;
  border: none !important;
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut),
                     100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut))) !important;
}
.case-result, .case-visual, .team-photo, .presence-map, .case-shot { --cut: 10px; }
.step-num { --cut: 6px; }

/* Form controls (input/select/textarea) are REPLACED elements — they can't host the
   single-stroke SVG chamfer frame the cards use, and every CSS-only border trick either
   gaps at the diagonals or thickens the cut corners (client re-flagged 2026-07-24). Fix:
   main.js wraps each control at runtime in a `.field-frame` span, which DOES carry the
   exact same seamless SVG frame as the cards → uniform-width border on all edges + both
   diagonals, identical to the rest of the site. The control itself is borderless and
   inherits the wrapper's clip so its fill never pokes past the frame. */
.field-frame {
  position: relative;
  display: block;
  --cut: 8px;
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut),
                     100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
}
.field-frame > input,
.field-frame > select,
.field-frame > textarea {
  display: block;
  width: 100%;
  border: none !important;
  clip-path: none !important;   /* the wrapper clips the chamfer now */
}
.newsletter-form .field-frame { flex: 1; }
/* focus: light the frame stroke to accent (+ the label already glows) */
.field-frame.is-focus > svg.cut-frame path { stroke: var(--accent); }
