/* =========================================================================
   Mueezur Rehman — Portfolio 2026
   Design system + components
   ========================================================================= */

/* ---------- TOKENS ---------- */
:root {
  --bg:        #06070C;
  --bg-2:      #0A0C14;
  --bg-3:      #0F1119;
  --surface:   rgba(255,255,255,0.035);
  --surface-2: rgba(255,255,255,0.06);
  --surface-3: rgba(255,255,255,0.09);
  --border:    rgba(255,255,255,0.09);
  --border-2:  rgba(255,255,255,0.16);
  --text:      #F3F4F8;
  --text-2:    #B4BAC8;
  --muted:     #7B8294;
  --faint:     #4C5265;

  --primary:   #7C6CFF;
  --primary-2: #A78BFA;
  --primary-3: #5B4BE0;
  --cyan:      #22D3EE;
  --lime:      #A3E635;
  --pink:      #F472B6;
  --gold:      #FBBF24;

  --glow:      rgba(124,108,255,0.45);
  --glow-soft: rgba(124,108,255,0.16);

  --radius-sm: 10px;
  --radius:    16px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  --shadow-sm: 0 2px 8px rgba(0,0,0,0.35);
  --shadow:    0 18px 48px -20px rgba(0,0,0,0.8);
  --shadow-lg: 0 40px 90px -40px rgba(0,0,0,0.9);

  --max: 1200px;
  --nav-h: 72px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Space Grotesk', 'Inter', sans-serif;
  --font-serif: 'Instrument Serif', Georgia, serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

:root[data-theme="light"] {
  --bg:        #FAFAFB;
  --bg-2:      #F3F4F8;
  --bg-3:      #ECEEF4;
  --surface:   rgba(10,12,20,0.02);
  --surface-2: rgba(10,12,20,0.04);
  --surface-3: rgba(10,12,20,0.07);
  --border:    rgba(10,12,20,0.10);
  --border-2:  rgba(10,12,20,0.18);
  --text:      #0A0B12;
  --text-2:    #3A4054;
  --muted:     #646B7E;
  --faint:     #9AA1B2;

  --primary:   #5B4BE0;
  --primary-2: #7C6CFF;
  --primary-3: #4338CA;
  --cyan:      #0891B2;
  --lime:      #65A30D;
  --pink:      #DB2777;
  --gold:      #B45309;

  --glow:      rgba(91,75,224,0.30);
  --glow-soft: rgba(91,75,224,0.12);

  --shadow-sm: 0 2px 8px rgba(10,12,20,0.06);
  --shadow:    0 18px 48px -24px rgba(10,12,20,0.20);
  --shadow-lg: 0 40px 90px -40px rgba(10,12,20,0.28);
}

/* ---------- RESET / BASE ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
  -webkit-text-size-adjust: 100%;
}
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background 0.4s var(--ease), color 0.4s var(--ease);
}
img, svg { display: block; max-width: 100%; }
/* the width/height content attributes on <img> map to CSS width/height hints,
   so height must be reset to auto or aspect-ratio can never take effect */
img { height: auto; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
ul, ol { list-style: none; }
::selection { background: var(--primary); color: #fff; }

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 10px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--faint); }

/* ---------- TYPE ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
}
.display {
  font-size: clamp(2.6rem, 7vw, 5.2rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 0.98;
}
.h2 { font-size: clamp(2rem, 4.4vw, 3.4rem); letter-spacing: -0.035em; }
.h3 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); letter-spacing: -0.025em; }
.lead { font-size: clamp(1.05rem, 1.5vw, 1.22rem); color: var(--text-2); line-height: 1.65; }
.serif { font-family: var(--font-serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--primary-2);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: '';
  width: 22px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary-2));
}
.grad {
  background: linear-gradient(100deg, var(--primary-2), var(--cyan) 55%, var(--primary-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.mono { font-family: var(--font-mono); }

/* ---------- LAYOUT ---------- */
.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 22px; }
@media (min-width: 768px)  { .container { padding: 0 40px; } }
@media (min-width: 1200px) { .container { padding: 0 48px; } }

section { position: relative; padding: 88px 0; }
@media (min-width: 900px) { section { padding: 128px 0; } }

.sec-head { max-width: 720px; margin-bottom: 56px; }
.sec-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.sec-head .eyebrow { margin-bottom: 20px; }
.sec-head h2 { margin-bottom: 18px; }
.sec-head p { color: var(--text-2); }

/* ---------- BACKGROUND FX ---------- */
.fx {
  position: absolute; inset: 0;
  overflow: hidden; pointer-events: none;
  z-index: 0;
}
.aurora {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
}
:root[data-theme="light"] .aurora { opacity: 0.35; }
.grid-lines {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, var(--border) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 20%, transparent 75%);
  opacity: 0.5;
}
.noise {
  position: fixed; inset: 0; z-index: 9999; pointer-events: none; opacity: 0.022;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- PROGRESS ---------- */
.progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 120;
  background: transparent;
}
.progress span {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--cyan));
  box-shadow: 0 0 12px var(--glow);
}

/* ---------- NAV ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 110;
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, background 0.3s;
}
@supports not (backdrop-filter: blur(1px)) { .nav { background: var(--bg); } }
.nav.scrolled { border-bottom-color: var(--border); }
.nav-inner {
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.brand { display: flex; align-items: center; gap: 11px; font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; letter-spacing: -0.02em; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  display: grid; place-items: center;
  font-family: var(--font-serif); font-style: italic; font-size: 1.3rem;
  color: #fff;
  background: linear-gradient(140deg, var(--primary), var(--primary-3));
  box-shadow: 0 6px 18px -6px var(--glow);
  transition: transform 0.4s var(--ease);
}
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.05); }
.brand small { display: block; font-family: var(--font-mono); font-size: 0.58rem; letter-spacing: 0.14em; color: var(--muted); text-transform: uppercase; font-weight: 400; }

.nav-links { display: none; align-items: center; gap: 4px; }
@media (min-width: 940px) { .nav-links { display: flex; } }
.nav-links a {
  padding: 9px 14px; border-radius: 9px; font-size: 0.9rem; font-weight: 500;
  color: var(--text-2); transition: color 0.2s, background 0.2s;
}
.nav-links a:hover { color: var(--text); background: var(--surface-2); }
@media (min-width: 940px) and (max-width: 1160px) {
  .nav-links a { padding: 9px 10px; font-size: 0.85rem; }
  .kbd-hint { padding: 0 8px 0 10px; font-size: 0.78rem; }
  .kbd-hint kbd { display: none; }
}

.nav-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
  transition: all 0.2s;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-2); background: var(--surface-2); }
.icon-btn svg { width: 17px; height: 17px; }
.kbd-hint {
  display: none; align-items: center; gap: 8px; padding: 0 10px 0 12px; height: 40px;
  border: 1px solid var(--border); background: var(--surface); border-radius: 11px;
  color: var(--muted); font-size: 0.82rem; transition: all 0.2s;
}
.kbd-hint:hover { border-color: var(--border-2); color: var(--text-2); }
.kbd-hint svg { width: 15px; height: 15px; }
.kbd-hint kbd {
  font-family: var(--font-mono); font-size: 0.68rem; padding: 3px 6px; border-radius: 5px;
  background: var(--surface-3); color: var(--text-2); border: 1px solid var(--border);
}
@media (min-width: 940px) { .kbd-hint { display: flex; } }
@media (max-width: 939px) { #paletteBtn { display: none; } }

.menu-btn { display: grid; }
@media (min-width: 940px) { .menu-btn { display: none; } }
@media (max-width: 939px) { #navCta { display: none !important; } }
@media (max-width: 560px) { .brand small { display: none; } }

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 13px 22px; border-radius: 12px; font-size: 0.9rem; font-weight: 600;
  border: 1px solid transparent; white-space: nowrap; font-family: var(--font-sans);
  transition: transform 0.25s var(--ease), box-shadow 0.25s, background 0.25s, border-color 0.25s, color 0.25s;
}
.btn svg { width: 16px; height: 16px; transition: transform 0.3s var(--ease); flex-shrink: 0; }
.btn:hover svg { transform: translateX(3px); }
.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--primary-2), var(--primary-3));
  box-shadow: 0 10px 30px -12px var(--glow);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 18px 44px -14px var(--glow); }
.btn-ghost { color: var(--text); border-color: var(--border-2); background: var(--surface); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--text-2); transform: translateY(-2px); }
.btn-lg { padding: 16px 28px; font-size: 0.96rem; border-radius: 14px; }

/* ---------- PILL / BADGE ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 7px 15px 7px 12px; border-radius: 100px;
  border: 1px solid var(--border-2); background: var(--surface);
  font-size: 0.8rem; font-weight: 500; color: var(--text-2);
  font-family: var(--font-mono); letter-spacing: 0.02em;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 0 rgba(163,230,53,0.5); animation: pulse 2.4s infinite; }
@keyframes pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(163,230,53,0.5); }
  50%     { box-shadow: 0 0 0 7px rgba(163,230,53,0); }
}

/* ---------- CARD / GLASS ---------- */
.glass {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.45s var(--ease), border-color 0.35s, background 0.35s;
}
.card:hover { transform: translateY(-5px); border-color: var(--border-2); background: var(--surface-2); }
.card-glow::after {
  content: ''; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none;
  background: radial-gradient(240px 160px at var(--mx, 50%) var(--my, 0%), var(--glow-soft), transparent 70%);
  opacity: 0; transition: opacity 0.4s;
}
.card-glow:hover::after { opacity: 1; }

/* =========================================================================
   HERO — editorial masthead + technical plate
   ========================================================================= */
.hero { padding-top: calc(var(--nav-h) + 40px); padding-bottom: 48px; overflow: hidden; }
.hero .fx .aurora.a1 { width: 640px; height: 640px; top: -240px; left: -140px; background: radial-gradient(circle, var(--primary), transparent 70%); }
.hero .fx .aurora.a2 { width: 520px; height: 520px; top: -180px; right: -180px; background: radial-gradient(circle, var(--cyan), transparent 70%); opacity: 0.32; }

/* masthead */
.hero-masthead {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 14px 20px; flex-wrap: wrap;
  padding-bottom: 16px; border-bottom: 1px solid var(--border-2);
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.14em;
  text-transform: uppercase; line-height: 1; color: var(--muted);
}
.hero-masthead .mh-block { display: inline-flex; align-items: center; gap: 9px; }
.hero-masthead b { color: var(--text); font-weight: 600; letter-spacing: 0.2em; }
.hero-masthead i { font-style: normal; color: var(--faint); letter-spacing: 0.1em; }
.hero-masthead .mh-k { color: var(--faint); }
.hero-masthead .mh-sep { display: none; width: 1px; height: 11px; background: var(--border-2); }
.hero-masthead .mh-right { margin-left: auto; color: var(--text-2); }
@media (min-width: 880px) { .hero-masthead .mh-sep { display: block; } }
@media (max-width: 559px) { .hero-masthead .mh-right { margin-left: 0; } }

/* two columns: copy | (rail + plate) */
.hero-inner { position: relative; z-index: 1; display: grid; gap: 44px; margin-top: 44px; }
@media (min-width: 1000px) { .hero-inner { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 56px; align-items: start; } }

.hero-side { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 20px; align-items: stretch; }
@media (min-width: 1000px) { .hero-side { grid-template-columns: 34px minmax(0, 380px); justify-content: end; } }

/* vertical rail */
.hero-rail { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.rail-line { width: 1px; flex: 1; min-height: 40px; background: linear-gradient(180deg, transparent, var(--border-2) 22%, var(--border-2) 78%, transparent); }
.rail-text {
  writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap;
  font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.24em;
  text-transform: uppercase; color: var(--faint);
}
.rail-idx { font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.16em; color: var(--primary-2); }

/* the rail only earns its place once there is room for a two-column hero */
@media (max-width: 639px) {
  .hero-side { grid-template-columns: minmax(0, 1fr); }
  .hero-rail { display: none; }
}

/* headline */
.hero-copy { min-width: 0; }
.hero h1 { font-size: clamp(2.4rem, 4.9vw, 4.25rem); line-height: 1.02; margin: 0 0 24px; }
.hero .lead { max-width: 540px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }

/* portrait plate */
.plate-wrap { margin: 0; width: 100%; max-width: 380px; justify-self: center; position: relative; }
/* tablet has room for a larger plate; from 1000px the grid track caps it at 380 again */
@media (min-width: 640px) { .plate-wrap { max-width: 440px; justify-self: start; } }
.plate {
  position: relative; transform-style: preserve-3d; will-change: transform;
  transition: transform 0.22s var(--ease);
}
.plate-frame {
  position: relative; border-radius: 7px; overflow: hidden;
  border: 1px solid var(--border-2); background: var(--bg-3);
  box-shadow: var(--shadow-lg);
}
/* subtle inner ring so the photo edge reads as a mounted plate */
.plate-frame::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.07), inset 0 -30px 50px -30px rgba(0,0,0,0.35);
}
.plate-frame img { display: block; width: 100%; height: auto; aspect-ratio: 4/5; object-fit: cover; object-position: 50% 17%; }

/* crop / registration marks */
.reg { position: absolute; width: 15px; height: 15px; z-index: 3; pointer-events: none; opacity: 0.85; border: 1px solid var(--primary-2); }
.reg.tl { top: -6px; left: -6px; border-right: 0; border-bottom: 0; }
.reg.tr { top: -6px; right: -6px; border-left: 0; border-bottom: 0; }
.reg.bl { bottom: -6px; left: -6px; border-right: 0; border-top: 0; }
.reg.br { bottom: -6px; right: -6px; border-left: 0; border-top: 0; }

.plate-cap {
  display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap;
  margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border);
  font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted);
}
.plate-cap .pc-k { color: var(--primary-2); }
.plate-cap .pc-v { color: var(--text-2); }
.plate-cap .pc-live { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; color: var(--faint); font-variant-numeric: tabular-nums; }
.plate-cap .dot { width: 6px; height: 6px; }

/* rotating "open to work" seal on the portrait plate */
.otw {
  position: absolute; right: 14px; bottom: 14px; z-index: 5;
  width: 124px; height: 124px; display: grid; place-items: center;
}
.otw::before {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  border: 1px solid var(--border-2);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: var(--shadow-lg);
}
.otw-ring {
  position: absolute; inset: 0; width: 100%; height: 100%;
  animation: otw-spin 18s linear infinite;
}
.otw-ring text {
  font-family: var(--font-mono); font-size: 10px; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase; fill: var(--text-2);
}
.otw-core {
  position: relative; width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(140deg, var(--primary), var(--cyan));
  box-shadow: 0 8px 22px rgba(124,108,255,0.45);
}
.otw-core svg { width: 17px; height: 17px; }
.otw-dot {
  position: absolute; top: -2px; right: -2px; width: 13px; height: 13px; border-radius: 50%;
  background: var(--lime); border: 2px solid var(--bg);
  animation: otw-pulse 2.6s ease-in-out infinite;
}
@keyframes otw-spin { to { transform: rotate(360deg); } }
@keyframes otw-pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.25); opacity: 0.7; } }
@media (max-width: 420px) {
  .otw { width: 96px; height: 96px; right: 10px; bottom: 10px; }
  .otw-core { width: 38px; height: 38px; }
  .otw-core svg { width: 15px; height: 15px; }
  .otw-ring text { font-size: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  .otw-ring, .otw-dot { animation: none; }
}

/* instrument board */
.hero-board { margin-top: 52px; padding-top: 32px; border-top: 1px solid var(--border); display: grid; gap: 28px; }
@media (min-width: 900px) { .hero-board { grid-template-columns: minmax(0, 1fr) 330px; gap: 48px; align-items: center; } }
.board-specs { display: grid; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 700px) { .board-specs { grid-template-columns: repeat(4, 1fr); } }
.spec { padding: 4px 20px; border-left: 1px solid var(--border); }
@media (max-width: 699px) {
  .spec:nth-child(odd) { border-left: 0; padding-left: 0; }
  .spec:nth-child(n + 3) { margin-top: 26px; }
}
.spec b { display: block; font-family: var(--font-display); font-size: clamp(1.6rem, 3.2vw, 2.15rem); font-weight: 700; letter-spacing: -0.035em; line-height: 1; }
.spec b em { font-style: normal; color: var(--primary-2); }
.spec span { display: block; margin-top: 9px; font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.11em; text-transform: uppercase; color: var(--muted); }

.board-viz { border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px 14px; background: var(--surface); }
.viz-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; font-family: var(--font-mono); font-size: 0.63rem; letter-spacing: 0.13em; text-transform: uppercase; color: var(--muted); }
.ratings { display: flex; gap: 5px; }
.ratings i { width: 7px; height: 7px; border-radius: 50%; background: var(--lime); opacity: 0.3; animation: blink 2.4s infinite; }
.ratings i:nth-child(2) { animation-delay: 0.35s; }
.ratings i:nth-child(3) { animation-delay: 0.7s; }
@keyframes blink { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }
.viz-foot { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); font-family: var(--font-mono); font-size: 0.63rem; color: var(--text-2); }

.spark { width: 100%; height: 96px; }
.spark path.line { fill: none; stroke: url(#sparkGrad); stroke-width: 2.4; stroke-linecap: round; }
.spark .area { fill: url(#sparkArea); }

/* measure tape — real ticks: 1px rules every 12px, taller + stronger every 60px */
.hero-tape {
  height: 24px; margin-top: 40px;
  border-top: 1px solid var(--border-2);
  background-image:
    repeating-linear-gradient(to right, rgba(124,108,255,0.72) 0 1px, transparent 1px 60px),
    repeating-linear-gradient(to right, rgba(124,108,255,0.30) 0 1px, transparent 1px 12px);
  background-size: 100% 16px, 100% 8px;
  background-position: 0 0, 0 0;
  background-repeat: repeat-x, repeat-x;
  mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
}

/* ---------- MARQUEE ---------- */
.marquee { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 26px 0; overflow: hidden; background: var(--bg-2); }
.marquee-track { display: flex; gap: 56px; width: max-content; animation: scroll-x 34s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-item { display: flex; align-items: center; gap: 10px; font-family: var(--font-mono); font-size: 0.85rem; letter-spacing: 0.06em; color: var(--muted); white-space: nowrap; text-transform: uppercase; }
.marquee-item svg { width: 16px; height: 16px; color: var(--primary-2); }
@keyframes scroll-x { to { transform: translateX(-50%); } }

/* =========================================================================
   SERVICES (bento)
   ========================================================================= */
.bento { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 720px)  { .bento { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .bento { grid-template-columns: repeat(3, 1fr); } }

.svc { padding: 28px; display: flex; flex-direction: column; gap: 16px; min-height: 100%; }
@media (min-width: 1040px) {
  .svc.wide { grid-column: span 2; }
  .svc.tall { grid-row: span 2; }
}
.svc-top { display: flex; align-items: center; justify-content: space-between; }
.svc-ico {
  width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--primary-2);
}
.svc-ico svg { width: 21px; height: 21px; }
.svc-idx { font-family: var(--font-mono); font-size: 0.7rem; color: var(--faint); letter-spacing: 0.1em; }
.svc h3 { font-size: 1.3rem; }
.svc p { color: var(--text-2); font-size: 0.92rem; line-height: 1.6; flex: 1; }
.svc-feats { display: grid; gap: 9px; padding-top: 16px; border-top: 1px solid var(--border); }
@media (min-width: 1040px) { .svc.wide .svc-feats { grid-template-columns: 1fr 1fr; gap: 9px 24px; } }
.feat { display: flex; gap: 9px; align-items: flex-start; font-size: 0.84rem; color: var(--text-2); }
.feat svg { width: 14px; height: 14px; color: var(--lime); flex-shrink: 0; margin-top: 4px; }
.svc-tag { font-family: var(--font-mono); font-size: 0.68rem; color: var(--muted); letter-spacing: 0.04em; }
.svc-flag {
  font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 100px; color: var(--bg); background: linear-gradient(90deg, var(--lime), var(--cyan));
  font-weight: 600;
}
.svc.featured { border-color: color-mix(in srgb, var(--primary) 45%, transparent); background: linear-gradient(180deg, var(--surface), var(--glow-soft)); }

/* =========================================================================
   WORK
   ========================================================================= */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 34px; }
.chip {
  padding: 8px 16px; border-radius: 100px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-2); font-size: 0.83rem; font-weight: 500;
  transition: all 0.2s;
}
.chip:hover { border-color: var(--border-2); color: var(--text); }
.chip.active { background: var(--text); color: var(--bg); border-color: var(--text); }

.work-grid { display: grid; grid-template-columns: 1fr; gap: 18px; }
@media (min-width: 720px)  { .work-grid { grid-template-columns: repeat(2, 1fr); } }
.project { display: flex; flex-direction: column; }
.project[hidden] { display: none; }

.project-media {
  position: relative; aspect-ratio: 16/10; overflow: hidden;
  background:
    radial-gradient(120% 120% at 12% 8%, var(--c1, var(--primary)), transparent 62%),
    radial-gradient(120% 120% at 88% 92%, var(--c2, var(--cyan)), transparent 60%),
    var(--bg-3);
}
.project-media::before {
  content: ''; position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.07) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.07) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse at center, #000, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000, transparent 78%);
}
/* real screenshot inside a project card */
.project-media.has-img::before { display: none; }
.project-media.has-img img {
  position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 0;
  transition: transform 0.7s var(--ease);
}
.project-media.has-img::after {
  content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(to bottom, rgba(6,7,12,0.44), rgba(6,7,12,0) 40%);
}
.project-media.has-img .project-mono { display: none; }
.project:hover .project-media.has-img img { transform: scale(1.04); }
.project-mono {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: clamp(3.4rem, 9vw, 5.4rem);
  color: rgba(255,255,255,0.94); letter-spacing: -0.05em;
  text-shadow: 0 20px 60px rgba(0,0,0,0.35);
  transition: transform 0.7s var(--ease);
}
.project:hover .project-mono { transform: scale(1.06); }
.project-flag {
  position: absolute; top: 14px; left: 14px; z-index: 2;
  font-family: var(--font-mono); font-size: 0.67rem; letter-spacing: 0.06em;
  padding: 6px 11px; border-radius: 100px; color: #fff;
  background: rgba(6,7,12,0.55); border: 1px solid rgba(255,255,255,0.18);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.project-arrow {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(6,7,12,0.55); border: 1px solid rgba(255,255,255,0.18); color: #fff;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transform: translateY(-6px) scale(0.9); opacity: 0; transition: all 0.35s var(--ease);
}
.project:hover .project-arrow { transform: translateY(0) scale(1); opacity: 1; }
.project-arrow svg { width: 16px; height: 16px; }

.project-body { padding: 26px; display: flex; flex-direction: column; gap: 14px; flex: 1; }
.project-cat { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--primary-2); }
.project h3 { font-size: 1.35rem; }
.project p { color: var(--text-2); font-size: 0.9rem; line-height: 1.6; flex: 1; }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 16px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.metric-num { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; letter-spacing: -0.02em; }
.metric-lbl { font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-family: var(--font-mono); font-size: 0.66rem; padding: 4px 10px; border-radius: 7px; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.project-cta { display: inline-flex; align-items: center; gap: 7px; font-size: 0.86rem; font-weight: 600; color: var(--primary-2); margin-top: 2px; }
.project-cta svg { width: 15px; height: 15px; transition: transform 0.3s var(--ease); }
.project:hover .project-cta svg { transform: translateX(4px); }

/* list of more projects */
.more { margin-top: 24px; border-top: 1px solid var(--border); }
.more-head { padding: 22px 0 10px; font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.more-row {
  display: grid; grid-template-columns: 34px 1fr auto; gap: 14px; align-items: center;
  padding: 16px 14px; border-bottom: 1px solid var(--border); border-radius: 12px;
  transition: background 0.25s, padding 0.3s var(--ease);
}
@media (min-width: 720px) { .more-row { grid-template-columns: 40px 1.4fr 1fr 1fr auto; } }
.more-row:hover { background: var(--surface); padding-left: 22px; }
.more-idx { font-family: var(--font-mono); font-size: 0.72rem; color: var(--faint); }
.more-name { font-weight: 600; font-size: 0.98rem; }
.more-cat { font-size: 0.85rem; color: var(--muted); display: none; }
.more-country { font-family: var(--font-mono); font-size: 0.74rem; color: var(--text-2); display: none; }
.more-row svg { width: 15px; height: 15px; color: var(--faint); transition: transform 0.3s; }
.more-row:hover svg { transform: translateX(4px); color: var(--primary-2); }
@media (min-width: 720px) { .more-cat, .more-country { display: block; } .more-row { grid-template-columns: 40px 1.4fr 1fr 1fr auto; } }

/* =========================================================================
   METRICS BAND
   ========================================================================= */
.band { background: var(--bg-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); overflow: hidden; }
.band-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; }
@media (min-width: 720px)  { .band-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1040px) { .band-grid { grid-template-columns: repeat(6, 1fr); gap: 20px; } }
.band-item { padding-top: 20px; border-top: 1px solid var(--border-2); }
.band-num { font-family: var(--font-display); font-size: clamp(1.7rem, 3.4vw, 2.4rem); font-weight: 700; letter-spacing: -0.035em; line-height: 1; }
.band-num em { font-style: normal; color: var(--primary-2); }
.band-lbl { margin-top: 8px; font-family: var(--font-mono); font-size: 0.63rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }

/* =========================================================================
   PROCESS
   ========================================================================= */
.timeline { position: relative; display: grid; gap: 4px; }
@media (min-width: 900px) { .timeline { grid-template-columns: repeat(4, 1fr); gap: 0; } }
.step { position: relative; padding: 30px 0; border-top: 1px solid var(--border); }
@media (min-width: 900px) {
  .step { padding: 34px 30px 34px 0; }
  .step:not(:last-child)::after { content: ''; position: absolute; top: 20px; bottom: 0; right: 15px; width: 1px; background: var(--border); }
}
.step-num {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.1em; color: var(--primary-2);
  margin-bottom: 18px;
}
.step-num::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 12px var(--glow); }
.step h3 { font-size: 1.22rem; margin-bottom: 10px; }
.step p { color: var(--text-2); font-size: 0.9rem; line-height: 1.6; margin-bottom: 14px; }
.step-out { font-family: var(--font-mono); font-size: 0.7rem; color: var(--muted); padding-top: 13px; border-top: 1px solid var(--border); }

/* =========================================================================
   TESTIMONIALS
   ========================================================================= */
.quotes { display: grid; gap: 18px; }
@media (min-width: 700px) { .quotes { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1080px) { .quotes { grid-template-columns: repeat(3, 1fr); } }
.quote { padding: 26px 26px 0; display: flex; flex-direction: column; gap: 16px; }
.quote-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.quote-company {
  font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.quote-geo {
  font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--faint); white-space: nowrap; flex-shrink: 0;
}
.quote-text { font-family: var(--font-serif); font-style: italic; font-size: 1.08rem; line-height: 1.55; color: var(--text); flex: 1; }
.quote-stars { display: flex; gap: 3px; color: var(--gold); margin: -6px 0 -4px; }
.quote-stars svg { width: 14px; height: 14px; }
.quote-author { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
  font-weight: 700; font-size: 0.8rem; color: #fff; letter-spacing: 0.02em;
  background: linear-gradient(140deg, var(--primary), var(--primary-3));
  box-shadow: 0 0 0 1px var(--border-2);
}
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.quote-name { display: block; font-weight: 600; font-size: 0.92rem; line-height: 1.2; }
.quote-role { display: block; font-size: 0.78rem; color: var(--muted); margin-top: 3px; }
.quote-proj {
  margin: auto -26px 0; padding: 13px 26px; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); background: var(--surface-2);
  transition: color 0.25s, background 0.25s;
}
.quote-proj span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quote-proj svg { width: 14px; height: 14px; flex-shrink: 0; transition: transform 0.3s var(--ease); }
.quote-proj:hover { color: var(--text); background: var(--surface); }
.quote-proj:hover svg { transform: translateX(3px); }

/* client wordmark band */
.client-band {
  margin: 28px 0 32px; padding: 16px 0;
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px;
}
.cb-label {
  font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--faint);
}
.cb-list { display: flex; flex-wrap: wrap; gap: 8px; }
.cb-item {
  font-size: 0.76rem; color: var(--text-2); letter-spacing: -0.005em;
  border: 1px solid var(--border); border-radius: 100px; padding: 6px 13px; background: var(--surface);
  transition: border-color 0.25s, color 0.25s;
}
.cb-item:hover { border-color: var(--border-2); color: var(--text); }

/* =========================================================================
   FAQ
   ========================================================================= */
.faq { border-top: 1px solid var(--border); max-width: 880px; }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-q {
  width: 100%; text-align: left; background: none; border: 0; color: var(--text);
  padding: 24px 44px 24px 0; position: relative; font-family: var(--font-display);
  font-size: 1.08rem; font-weight: 600; letter-spacing: -0.01em;
}
.faq-q::after {
  content: '+'; position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  font-family: var(--font-mono); font-size: 1.3rem; color: var(--primary-2);
  transition: transform 0.3s var(--ease);
}
.faq-item.open .faq-q::after { transform: translateY(-50%) rotate(45deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height 0.4s var(--ease); }
.faq-a p { padding: 0 44px 26px 0; color: var(--text-2); font-size: 0.95rem; line-height: 1.7; }

/* =========================================================================
   CONTACT
   ========================================================================= */
.contact-wrap { display: grid; gap: 40px; }
@media (min-width: 940px) { .contact-wrap { grid-template-columns: 0.85fr 1.15fr; gap: 56px; align-items: start; } }
.c-list { display: grid; gap: 12px; }
.c-item { display: flex; gap: 16px; align-items: flex-start; padding: 20px; transition: all 0.3s; }
.c-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; background: var(--surface-2); border: 1px solid var(--border); color: var(--primary-2); }
.c-ico svg { width: 19px; height: 19px; }
.c-lbl { font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 5px; }
.c-val { font-size: 0.95rem; font-weight: 600; }
.c-val a:hover { color: var(--primary-2); }

.form-card { padding: 30px; }
@media (min-width: 768px) { .form-card { padding: 40px; } }
.form-card h3 { font-size: 1.4rem; margin-bottom: 6px; }
.form-card > p { color: var(--muted); font-size: 0.9rem; margin-bottom: 28px; }
.row { display: grid; gap: 18px; margin-bottom: 18px; }
@media (min-width: 620px) { .row.two { grid-template-columns: 1fr 1fr; } }
.field label { display: block; font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 9px; }
.field input, .field textarea, .field select {
  width: 100%; padding: 14px 16px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  font-family: var(--font-sans); font-size: 0.95rem; outline: none; transition: all 0.25s;
}
.field textarea { resize: vertical; min-height: 128px; }
.field select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%237B8294' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; padding-right: 42px; }
.field input::placeholder, .field textarea::placeholder { color: var(--muted); }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--primary); background: var(--bg-3); box-shadow: 0 0 0 4px var(--glow-soft); }
.submit {
  width: 100%; margin-top: 6px; padding: 16px; border: 0; border-radius: 12px;
  font-family: var(--font-sans); font-size: 0.95rem; font-weight: 600; color: #fff;
  background: linear-gradient(135deg, var(--primary-2), var(--primary-3));
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  box-shadow: 0 12px 32px -14px var(--glow); transition: transform 0.25s var(--ease), box-shadow 0.25s;
}
.submit:hover { transform: translateY(-2px); box-shadow: 0 20px 44px -16px var(--glow); }
.submit svg { width: 16px; height: 16px; }

/* =========================================================================
   CTA
   ========================================================================= */
.cta { position: relative; overflow: hidden; border-top: 1px solid var(--border); }
.cta .fx .aurora.a1 { width: 640px; height: 640px; top: -300px; left: 50%; transform: translateX(-50%); background: radial-gradient(circle, var(--primary), transparent 68%); }
.cta-inner { position: relative; z-index: 1; text-align: center; max-width: 760px; margin: 0 auto; }
.cta h2 { margin-bottom: 20px; }
.cta p { color: var(--text-2); margin-bottom: 34px; }
.cta-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.cta-actions .btn-ghost { background: var(--surface); }
.cta-note { margin-top: 22px; font-family: var(--font-mono); font-size: 0.76rem; color: var(--muted); letter-spacing: 0.04em; }

/* =========================================================================
   FOOTER
   ========================================================================= */
.footer { background: var(--bg-2); border-top: 1px solid var(--border); padding: 64px 0 28px; }
.footer-grid { display: grid; gap: 40px; margin-bottom: 44px; }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1.6fr 1fr 1fr 1.2fr; gap: 32px; } }
.f-brand h3 { font-size: 1.25rem; margin-bottom: 8px; }
.f-role { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 18px; }
.f-brand p { color: var(--text-2); font-size: 0.88rem; line-height: 1.65; max-width: 330px; margin-bottom: 22px; }
.f-social { display: flex; gap: 9px; }
.f-social a { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); transition: all 0.25s; }
.f-social a:hover { color: #fff; border-color: transparent; background: linear-gradient(140deg, var(--primary), var(--primary-3)); transform: translateY(-3px); }
.f-social svg { width: 17px; height: 17px; }
.f-col h4 { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 18px; font-weight: 500; }
.f-col ul { display: grid; gap: 11px; }
.f-col a { color: var(--text-2); font-size: 0.9rem; transition: color 0.2s, padding-left 0.25s; }
.f-col a:hover { color: var(--primary-2); padding-left: 4px; }
.f-bottom { border-top: 1px solid var(--border); padding-top: 26px; display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between; align-items: center; font-size: 0.82rem; color: var(--muted); }
.f-bottom .links { display: flex; gap: 20px; }
.f-bottom a:hover { color: var(--primary-2); }

/* =========================================================================
   FLOATING / OVERLAYS
   ========================================================================= */
.fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 130;
  width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center;
  color: #fff; background: linear-gradient(140deg, #25D366, #128C7E);
  box-shadow: 0 14px 34px -12px rgba(37,211,102,0.7);
  transition: transform 0.3s var(--ease);
}
.fab:hover { transform: translateY(-4px) scale(1.05); }
.fab svg { width: 24px; height: 24px; }

.to-top {
  position: fixed; right: 22px; bottom: 86px; z-index: 130;
  width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center;
  border: 1px solid var(--border-2); background: var(--bg-3); color: var(--text-2);
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: all 0.3s var(--ease);
}
.to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.to-top:hover { color: var(--text); border-color: var(--text-2); }
.to-top svg { width: 18px; height: 18px; }

.toast {
  position: fixed; right: 22px; bottom: 150px; z-index: 200;
  max-width: min(350px, calc(100vw - 44px)); padding: 15px 18px; border-radius: 14px; display: flex; gap: 12px; align-items: flex-start;
  background: var(--bg-3); border: 1px solid var(--border-2);
  box-shadow: var(--shadow-lg);
  /* must clear its own bottom offset, otherwise it stays on screen before the first toast */
  transform: translateY(calc(100% + 160px)); opacity: 0; pointer-events: none;
  transition: transform 0.5s var(--ease), opacity 0.35s var(--ease);
}
.toast.show { transform: translateY(0); opacity: 1; pointer-events: auto; }
.toast-ico { width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; background: linear-gradient(140deg, var(--lime), var(--cyan)); color: var(--bg); }
.toast-ico svg { width: 16px; height: 16px; }
.toast-title { font-weight: 600; font-size: 0.9rem; margin-bottom: 2px; }
.toast-msg { font-size: 0.8rem; color: var(--muted); }

/* command palette */
.palette {
  position: fixed; inset: 0; z-index: 300; display: none;
  background: rgba(4,5,10,0.6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  padding: 14vh 18px 0;
}
.palette.open { display: block; animation: fade 0.2s ease; }
@keyframes fade { from { opacity: 0; } }
.palette-box {
  max-width: 560px; margin: 0 auto; background: var(--bg-3);
  border: 1px solid var(--border-2); border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-lg); animation: rise 0.3s var(--ease);
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.palette-input-wrap { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.palette-input-wrap svg { width: 18px; height: 18px; color: var(--muted); flex-shrink: 0; }
#paletteInput { flex: 1; background: none; border: 0; outline: none; color: var(--text); font-family: var(--font-sans); font-size: 1rem; }
#paletteInput::placeholder { color: var(--faint); }
.palette-list { max-height: 340px; overflow-y: auto; padding: 8px; }
.palette-item {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 11px;
  background: none; border: 0; color: var(--text-2); font-size: 0.92rem; text-align: left;
}
.palette-item svg { width: 16px; height: 16px; color: var(--muted); }
.palette-item .pi-k { margin-left: auto; font-family: var(--font-mono); font-size: 0.68rem; color: var(--faint); }
.palette-item:hover, .palette-item.active { background: var(--surface-2); color: var(--text); }
.palette-empty { padding: 24px; text-align: center; color: var(--muted); font-size: 0.9rem; }

/* keyboard shortcuts sheet */
.sheet {
  position: fixed; inset: 0; z-index: 310; display: none;
  background: rgba(4,5,10,0.6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  padding: 12vh 18px 18px;
}
.sheet.open { display: block; animation: fade 0.2s ease; }
.sheet-box {
  max-width: 520px; margin: 0 auto; background: var(--bg-3);
  border: 1px solid var(--border-2); border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-lg); animation: rise 0.3s var(--ease);
}
.sheet-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 20px 22px; border-bottom: 1px solid var(--border);
}
.sheet-head h3 { font-family: var(--font-display); font-size: 1.02rem; font-weight: 600; letter-spacing: -0.01em; }
.sheet-head p { font-size: 0.8rem; color: var(--muted); margin-top: 4px; }
.sheet-x {
  width: 30px; height: 30px; flex-shrink: 0; display: grid; place-items: center;
  border: 1px solid var(--border); border-radius: 9px; background: none; color: var(--muted);
  transition: color 0.2s, border-color 0.2s;
}
.sheet-x:hover { color: var(--text); border-color: var(--border-2); }
.sheet-x svg { width: 14px; height: 14px; }
.sheet-grid { padding: 6px 22px 18px; }
.sheet-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 11px 0; border-bottom: 1px solid var(--border);
  font-size: 0.86rem; color: var(--text-2);
}
.sheet-row:last-child { border-bottom: 0; }
.keys { display: flex; gap: 5px; }
kbd {
  font-family: var(--font-mono); font-size: 0.64rem; line-height: 1; padding: 5px 7px;
  border: 1px solid var(--border-2); border-bottom-width: 2px; border-radius: 6px;
  background: var(--surface-2); color: var(--text);
}
.kbd-link {
  display: inline-flex; align-items: center; gap: 7px; background: none; border: 0; padding: 0;
  color: inherit; font: inherit; cursor: pointer; transition: color 0.2s;
}
.kbd-link:hover { color: var(--primary-2); }
.kbd-link kbd { padding: 3px 5px; font-size: 0.6rem; }

/* mobile menu */
@media (max-width: 939px) {
  .nav-links.open {
    display: flex; flex-direction: column; align-items: stretch; gap: 2px;
    position: fixed; top: calc(var(--nav-h) + 8px); left: 14px; right: 14px;
    padding: 12px; background: var(--bg-3); border: 1px solid var(--border-2);
    border-radius: var(--radius); box-shadow: var(--shadow-lg); z-index: 109;
  }
  .nav-links.open a { padding: 13px 14px; font-size: 1rem; }
}

/* ---------- REVEAL ---------- */
/* Keyframes (not `transition`) so the entrance never hijacks component hover transitions. */
html.js .reveal:not(.in) { opacity: 0; transform: translateY(22px); }
html.js .reveal.in { animation: revealIn 0.7s var(--ease) backwards; animation-delay: var(--delay, 0s); }
@keyframes revealIn {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  html.js .reveal, html.js .reveal:not(.in) { opacity: 1 !important; transform: none !important; animation: none !important; }
}

/* =========================================================================
   CASE STUDY PAGES
   ========================================================================= */
.case-hero { padding-top: calc(var(--nav-h) + 56px); padding-bottom: 40px; overflow: hidden; }
.case-hero .fx .aurora.a1 { width: 620px; height: 620px; top: -280px; left: -140px; background: radial-gradient(circle, var(--primary), transparent 70%); }
.case-hero .fx .aurora.a2 { width: 520px; height: 520px; top: -200px; right: -180px; background: radial-gradient(circle, var(--cyan), transparent 70%); opacity: 0.3; }
.crumb { display: flex; align-items: center; gap: 9px; font-family: var(--font-mono); font-size: 0.76rem; color: var(--muted); margin-bottom: 26px; position: relative; z-index: 1; }
.crumb a:hover { color: var(--primary-2); }
.crumb svg { width: 13px; height: 13px; }
.case-hero h1 { font-size: clamp(2.2rem, 5.4vw, 3.9rem); letter-spacing: -0.04em; max-width: 900px; margin-bottom: 22px; position: relative; z-index: 1; }
.case-hero .lead { max-width: 680px; position: relative; z-index: 1; }

.case-meta { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; margin-top: 44px; padding-top: 34px; border-top: 1px solid var(--border); position: relative; z-index: 1; }
@media (min-width: 760px) { .case-meta { grid-template-columns: repeat(4, 1fr); } }
.case-meta .k { font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 7px; }
.case-meta .v { font-size: 0.95rem; font-weight: 600; }

.case-cover { position: relative; margin-top: 48px; }
.case-cover .cover {
  position: relative; aspect-ratio: 21/9; border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--border);
  background:
    radial-gradient(120% 130% at 10% 10%, var(--c1, var(--primary)), transparent 60%),
    radial-gradient(120% 130% at 90% 90%, var(--c2, var(--cyan)), transparent 58%),
    var(--bg-3);
}
.case-cover .cover::before {
  content: ''; position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.08) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.08) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: radial-gradient(ellipse at center, #000, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000, transparent 80%);
}
.case-cover .cover span {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; letter-spacing: -0.05em;
  font-size: clamp(3rem, 10vw, 7rem); color: rgba(255,255,255,0.95);
}
/* Real product screenshot used as the case-study cover */
.case-cover .cover.has-shot { aspect-ratio: 1919/906; background: var(--bg-3); }
.case-cover .cover.has-shot::before { display: none; }
.case-cover .cover.has-shot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; }
@media (max-width: 640px) { .case-cover .cover.has-shot { aspect-ratio: 4/3; } }

.case-body { padding: 72px 0 0; }
.case-grid { display: grid; gap: 56px; }
@media (min-width: 900px) { .case-grid { grid-template-columns: 220px 1fr; gap: 64px; align-items: start; } }
.case-nav { display: none; position: sticky; top: calc(var(--nav-h) + 24px); }
@media (min-width: 900px) { .case-nav { display: block; } }
.case-nav h5 { font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 16px; font-weight: 500; }
.case-nav a { display: block; padding: 8px 0; font-size: 0.88rem; color: var(--text-2); border-left: 2px solid var(--border); padding-left: 14px; transition: all 0.25s; }
.case-nav a:hover, .case-nav a.active { color: var(--primary-2); border-left-color: var(--primary); }

.prose { max-width: 720px; }
.prose h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin: 54px 0 18px; letter-spacing: -0.03em; }
.prose h2:first-child { margin-top: 0; }
.prose .eyebrow { margin-bottom: 14px; }
.prose p { color: var(--text-2); font-size: 1.02rem; line-height: 1.78; margin-bottom: 18px; }
.prose ul { display: grid; gap: 12px; margin: 22px 0; }
.prose li { display: flex; gap: 12px; color: var(--text-2); font-size: 0.98rem; line-height: 1.65; }
.prose li::before {
  content: ''; flex-shrink: 0; width: 7px; height: 7px; margin-top: 9px; border-radius: 2px;
  background: linear-gradient(140deg, var(--primary-2), var(--cyan));
}
.prose li svg { width: 17px; height: 17px; color: var(--lime); flex-shrink: 0; margin-top: 5px; }
.prose strong { color: var(--text); font-weight: 600; }

.result-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin: 30px 0; }
@media (min-width: 700px) { .result-cards { grid-template-columns: repeat(4, 1fr); } }
.result-card { padding: 24px 20px; text-align: center; }
.result-card .n { font-family: var(--font-display); font-size: clamp(1.6rem, 4vw, 2.3rem); font-weight: 700; letter-spacing: -0.03em; color: var(--primary-2); line-height: 1; }
.result-card .l { margin-top: 9px; font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); }

.stack { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0; }
.stack .tag { font-size: 0.72rem; padding: 6px 13px; }

.pull-quote {
  margin: 34px 0; padding: 28px 30px; border-left: 2px solid var(--primary);
  background: var(--surface); border-radius: 0 var(--radius) var(--radius) 0;
}
.pull-quote p { font-family: var(--font-serif); font-style: italic; font-size: 1.28rem; line-height: 1.5; color: var(--text); margin-bottom: 12px; }
.pull-quote cite { font-style: normal; font-family: var(--font-mono); font-size: 0.76rem; color: var(--muted); }

.gallery { display: grid; grid-template-columns: 1fr; gap: 16px; margin: 30px 0; }
@media (min-width: 700px) { .gallery { grid-template-columns: 1fr 1fr; } }
.gallery .frame { aspect-ratio: 4/3; border-radius: var(--radius); border: 1px solid var(--border); display: grid; place-items: center; font-family: var(--font-mono); font-size: 0.74rem; color: var(--muted); letter-spacing: 0.08em;
  background: radial-gradient(120% 120% at 20% 10%, var(--glow-soft), transparent 60%), var(--bg-2); }

/* Screenshot gallery — full-width product shots with a caption strip */
.gallery.gallery-shots { grid-template-columns: 1fr; gap: 20px; }
.gallery.gallery-shots .frame {
  aspect-ratio: auto; display: block; margin: 0; padding: 0; overflow: hidden; text-align: left;
  transition: transform 0.35s var(--ease), border-color 0.35s var(--ease);
}
.gallery.gallery-shots .frame:hover { transform: translateY(-3px); border-color: var(--border-2); }
.gallery.gallery-shots .frame img { display: block; width: 100%; height: auto; }
.gallery.gallery-shots .frame figcaption {
  display: block; padding: 13px 18px; border-top: 1px solid var(--border); background: var(--bg-2);
  font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}

.next-proj { margin-top: 72px; padding-top: 40px; border-top: 1px solid var(--border); }
.next-proj a { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 30px; transition: all 0.35s var(--ease); }
.next-proj a:hover { transform: translateY(-4px); border-color: var(--border-2); }
.next-proj .k { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.next-proj .t { font-family: var(--font-display); font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 700; letter-spacing: -0.03em; }
.next-proj svg { width: 26px; height: 26px; color: var(--primary-2); flex-shrink: 0; transition: transform 0.3s var(--ease); }
.next-proj a:hover svg { transform: translateX(6px); }

/* =========================================================================
   3D CUBE
   ========================================================================= */
.cube-section .sec-head { margin-bottom: 24px; }
.cube-stage { display: grid; place-items: center; min-height: 340px; perspective: 1100px; }
.cube {
  position: relative; width: 200px; height: 200px;
  transform-style: preserve-3d; cursor: grab; touch-action: none;
}
.cube:active { cursor: grabbing; }
.cube-face {
  position: absolute; inset: 0; display: grid; place-content: center; gap: 7px;
  text-align: center; padding: 18px; border-radius: 18px;
  border: 1px solid var(--border-2);
  background: linear-gradient(160deg, var(--surface-2), var(--surface)), var(--bg-3);
  box-shadow: inset 0 0 46px var(--glow-soft);
  backface-visibility: hidden;
}
.cube-face b { font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--primary-2); font-weight: 500; }
.cube-face span { font-family: var(--font-display); font-size: 0.96rem; font-weight: 600; color: var(--text); line-height: 1.3; }
.cube-hint { text-align: center; font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted); margin-top: 26px; letter-spacing: 0.05em; }
.cube-glow { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 380px; height: 380px; border-radius: 50%; background: radial-gradient(circle, var(--glow-soft), transparent 68%); pointer-events: none; }

.cube-face.f1 { transform: translateZ(100px); }
.cube-face.f2 { transform: rotateY(180deg) translateZ(100px); }
.cube-face.f3 { transform: rotateY(90deg) translateZ(100px); }
.cube-face.f4 { transform: rotateY(-90deg) translateZ(100px); }
.cube-face.f5 { transform: rotateX(90deg) translateZ(100px); }
.cube-face.f6 { transform: rotateX(-90deg) translateZ(100px); }
@media (max-width: 620px) {
  .cube { width: 160px; height: 160px; }
  .cube-face.f1 { transform: translateZ(80px); }
  .cube-face.f2 { transform: rotateY(180deg) translateZ(80px); }
  .cube-face.f3 { transform: rotateY(90deg) translateZ(80px); }
  .cube-face.f4 { transform: rotateY(-90deg) translateZ(80px); }
  .cube-face.f5 { transform: rotateX(90deg) translateZ(80px); }
  .cube-face.f6 { transform: rotateX(-90deg) translateZ(80px); }
  .cube-glow { width: 280px; height: 280px; }
}

/* =========================================================================
   ABOUT — dossier: identity card + field notes + changelog
   ========================================================================= */
.dossier { display: grid; gap: 40px; }
@media (min-width: 960px) { .dossier { grid-template-columns: 320px minmax(0, 1fr); gap: 56px; align-items: start; } }

/* identity card */
.idcard { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.idc-portrait { position: relative; }
.idc-portrait img { display: block; width: 100%; height: auto; aspect-ratio: 4/5; object-fit: cover; object-position: 50% 17%; }
.idc-body { padding: 20px; }
.idc-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--border-2); }
.idc-k { font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--primary-2); }
.idc-badge { display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--lime); }
.idc-badge .dot { width: 6px; height: 6px; }
.idc-rows { display: grid; }
.idc-row { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 0.87rem; }
.idc-row:last-child { border-bottom: 0; padding-bottom: 4px; }
.idc-row > span { font-family: var(--font-mono); font-size: 0.58rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); padding-top: 4px; }
.idc-row b { font-weight: 600; color: var(--text); }
.idc-sign { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border-2); font-family: var(--font-serif); font-style: italic; font-size: 1.85rem; line-height: 1; color: var(--primary-2); }

/* field notes */
.notes { min-width: 0; }
.notes-lede { font-size: clamp(1.12rem, 1.7vw, 1.32rem); line-height: 1.65; color: var(--text); }
.note { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 18px; padding: 26px 0; border-top: 1px solid var(--border); }
.note:first-of-type { margin-top: 34px; }
.note-mark { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--text); color: var(--bg); font-family: var(--font-mono); font-size: 0.7rem; font-weight: 500; }
.note h3 { font-size: 1.06rem; margin-bottom: 8px; }
.note p { color: var(--text-2); font-size: 0.99rem; line-height: 1.75; }
.note p strong { color: var(--text); font-weight: 600; }

/* capability matrix */
.matrix { margin-top: 32px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.matrix-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 15px 20px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.matrix-head .mh-k { font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--primary-2); }
.matrix-head .mh-sub { font-family: var(--font-mono); font-size: 0.63rem; color: var(--muted); }
.matrix-grid { display: grid; }
@media (min-width: 620px) { .matrix-grid { grid-template-columns: repeat(2, 1fr); } }
.mx-item { display: grid; gap: 5px; padding: 15px 20px; border-top: 1px solid var(--border); }
@media (min-width: 620px) {
  .mx-item:nth-child(-n + 2) { border-top: 0; }
  .mx-item:nth-child(even) { border-left: 1px solid var(--border); }
}
.mx-k { font-family: var(--font-mono); font-size: 0.58rem; letter-spacing: 0.13em; text-transform: uppercase; color: var(--muted); }
.mx-v { font-size: 0.9rem; font-weight: 500; color: var(--text-2); line-height: 1.5; }

/* changelog */
.log { margin-top: 68px; }
.log-head { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; padding-bottom: 18px; border-bottom: 1px solid var(--border-2); }
.log-head .lh-k { font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--primary-2); }
.log-head .lh-title { font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; letter-spacing: -0.025em; }
.log-list { display: grid; list-style: none; }
.log-item { display: grid; grid-template-columns: 1fr; gap: 8px; padding: 22px 0; border-bottom: 1px solid var(--border); }
@media (min-width: 720px) { .log-item { grid-template-columns: 92px 76px minmax(0, 1fr); gap: 24px; align-items: baseline; } }
.li-year { display: inline-flex; align-items: center; font-family: var(--font-mono); font-size: 0.86rem; color: var(--primary-2); }
.li-year::before { content: ''; flex: none; width: 6px; height: 6px; border-radius: 50%; margin-right: 10px; background: var(--primary); box-shadow: 0 0 10px var(--glow); }
.li-tag { justify-self: start; font-family: var(--font-mono); font-size: 0.58rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--border-2); border-radius: 100px; padding: 3px 10px; }
.li-body h4 { font-size: 1.05rem; margin-bottom: 6px; }
.li-body p { color: var(--text-2); font-size: 0.93rem; line-height: 1.7; }

/* =========================================================================
   INTERACTIVE MODULES — console, architecture map, solution finder, spy rail
   ========================================================================= */

/* ---------- shared module layout ---------- */
.hint {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted);
}
.hint svg { width: 14px; height: 14px; flex-shrink: 0; color: var(--primary-2); }
.mod-grid { display: grid; gap: 30px; }
.mod-grid > *, .finder-grid > * { min-width: 0; }
@media (min-width: 980px) { .mod-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 48px; align-items: start; } }
.mod-aside { display: grid; gap: 16px; align-content: start; }
.mod-note {
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--surface); padding: 22px;
}
.mod-note .k {
  display: block; margin-bottom: 9px;
  font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.15em;
  text-transform: uppercase; color: var(--primary-2);
}
.mod-note h3 { font-size: 1.05rem; margin-bottom: 9px; }
.mod-note p { color: var(--text-2); font-size: 0.92rem; line-height: 1.7; }
.mod-note ul { display: grid; gap: 8px; margin-top: 14px; list-style: none; }
.mod-note li { display: flex; gap: 10px; align-items: flex-start; font-size: 0.88rem; color: var(--text-2); }
.mod-note li svg { width: 14px; height: 14px; flex-shrink: 0; margin-top: 4px; color: var(--lime); }

/* ---------- console / terminal ---------- */
.console-shell {
  border: 1px solid var(--border-2); border-radius: var(--radius-lg);
  background: var(--surface); overflow: hidden; box-shadow: var(--shadow-lg);
}
.console-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; padding: 11px 16px;
  border-bottom: 1px solid var(--border); background: var(--surface-2);
}
.console-lights { display: flex; gap: 6px; flex-shrink: 0; }
.console-lights i { width: 10px; height: 10px; border-radius: 50%; background: #FF5F57; }
.console-lights i:nth-child(2) { background: #FEBC2E; }
.console-lights i:nth-child(3) { background: #28C840; }
.console-title {
  font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted);
}
.console-live {
  margin-left: auto; display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--lime); white-space: nowrap;
}
.console-body {
  padding: 18px; max-height: 430px; overflow-y: auto; overscroll-behavior: contain;
  font-family: var(--font-mono); font-size: 0.84rem; line-height: 1.8;
}
.console-line { white-space: pre-wrap; overflow-wrap: anywhere; }
.console-line + .console-line { margin-top: 3px; }
.console-gap { height: 9px; }
.console-body a { color: var(--primary-2); text-decoration: underline; text-underline-offset: 3px; }
.c-prompt { color: var(--primary-2); }
.c-cmd { color: var(--text); }
.c-dim { color: var(--muted); }
.c-faint { color: var(--faint); }
.c-ok { color: var(--lime); }
.c-key { color: var(--cyan); }
.c-warn { color: #FEBC2E; }
.c-err { color: #FF6B6B; }
.console-kv { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 3px 16px; }
.console-kv dt { color: var(--primary-2); }
.console-kv dd { margin: 0; color: var(--text-2); }
@media (max-width: 520px) {
  .console-kv { grid-template-columns: minmax(0, 1fr); }
  .console-kv dd { margin-bottom: 7px; }
}
.console-foot { background: var(--surface-2); border-top: 1px solid var(--border); padding: 12px 18px 15px; }
.console-form { display: flex; align-items: center; gap: 10px; }
.console-form .c-prompt { flex-shrink: 0; }
.console-input {
  flex: 1; min-width: 0; background: none; border: 0; outline: 0; padding: 0;
  font-family: var(--font-mono); font-size: 0.84rem; color: var(--text);
  caret-color: var(--primary-2);
}
.console-input::placeholder { color: var(--faint); }
.console-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 13px; }
.console-chip {
  font-family: var(--font-mono); font-size: 0.7rem; padding: 6px 11px; border-radius: 100px;
  border: 1px solid var(--border-2); background: var(--surface); color: var(--text-2);
  transition: color 0.2s, border-color 0.2s, transform 0.2s var(--ease);
}
.console-chip:hover { color: var(--text); border-color: var(--primary-2); transform: translateY(-2px); }
.console-chip:focus-visible { outline: 2px solid var(--primary-2); outline-offset: 2px; }

/* ---------- architecture map ---------- */
.arch-flow { position: relative; display: grid; gap: 12px; list-style: none; }
.arch-node {
  position: relative; display: grid; grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 14px; align-items: center; width: 100%; text-align: left;
  padding: 13px 16px; border-radius: 14px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface);
  transition: border-color 0.25s var(--ease), background 0.25s, transform 0.25s var(--ease);
}
.arch-node:not(:last-child)::after {
  content: ''; position: absolute; left: 33px; bottom: -12px; width: 1px; height: 12px;
  background: var(--border-2);
}
.arch-ico {
  width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--primary-2);
  transition: background 0.25s, color 0.25s, border-color 0.25s;
}
.arch-ico svg { width: 17px; height: 17px; }
.arch-name { display: block; font-weight: 600; font-size: 0.95rem; }
.arch-sub { display: block; margin-top: 3px; font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.06em; color: var(--muted); }
.arch-cost {
  font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 100px; border: 1px solid var(--border-2); color: var(--lime); white-space: nowrap;
}
.arch-node:hover { border-color: var(--primary-2); transform: translateX(3px); }
.arch-node:focus-visible { outline: 2px solid var(--primary-2); outline-offset: 2px; }
.arch-node.active { border-color: var(--primary-2); background: var(--surface-2); }
.arch-node.active .arch-ico { background: var(--primary); border-color: transparent; color: #fff; }
@media (max-width: 520px) {
  .arch-node { grid-template-columns: 36px minmax(0, 1fr); }
  .arch-cost { grid-column: 2; justify-self: start; margin-top: 7px; }
}
.arch-panel { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); padding: 24px; }
@media (min-width: 980px) { .arch-panel { position: sticky; top: calc(var(--nav-h) + 28px); } }
.arch-panel-k {
  display: block; font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--primary-2);
}
.arch-panel h3 { font-size: 1.22rem; margin: 10px 0 12px; }
.arch-panel > p, .arch-detail > p { color: var(--text-2); font-size: 0.95rem; line-height: 1.75; }
.arch-detail[hidden] { display: none; }
.arch-list { display: grid; gap: 9px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border); list-style: none; }
.arch-list li { display: flex; gap: 10px; align-items: flex-start; font-size: 0.89rem; color: var(--text-2); }
.arch-list li svg { width: 15px; height: 15px; flex-shrink: 0; margin-top: 4px; color: var(--lime); }
.arch-total {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border-2);
}
.arch-total .k {
  font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.13em;
  text-transform: uppercase; color: var(--muted);
}
.arch-total .v { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; letter-spacing: -0.03em; }

/* ---------- solution finder ---------- */
.finder-grid { display: grid; gap: 34px; }
@media (min-width: 1000px) { .finder-grid { grid-template-columns: minmax(0, 1.06fr) minmax(0, 0.94fr); gap: 48px; align-items: start; } }
.finder-step { padding-top: 24px; border-top: 1px solid var(--border); }
.finder-step:first-child { padding-top: 0; border-top: 0; }
.finder-step + .finder-step { margin-top: 24px; }
.finder-label { display: flex; align-items: center; gap: 12px; margin-bottom: 15px; }
.finder-num {
  flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: var(--text); color: var(--bg); font-family: var(--font-mono); font-size: 0.66rem; font-weight: 500;
}
.finder-label h3 { font-size: 1.02rem; }
.finder-label .hint { margin-left: auto; }
.finder-opts { display: flex; flex-wrap: wrap; gap: 9px; }
.finder-opt {
  padding: 11px 16px; border-radius: 12px; border: 1px solid var(--border-2);
  background: var(--surface); color: var(--text-2); font-size: 0.89rem; text-align: left;
  transition: color 0.2s, border-color 0.2s, background 0.2s, transform 0.2s var(--ease);
}
.finder-opt:hover { color: var(--text); border-color: var(--primary-2); transform: translateY(-2px); }
.finder-opt:focus-visible { outline: 2px solid var(--primary-2); outline-offset: 2px; }
.finder-opt[aria-pressed="true"] {
  color: var(--text); border-color: var(--primary-2); background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--primary-2);
}
.finder-result { border: 1px solid var(--border-2); border-radius: var(--radius-lg); background: var(--surface); overflow: hidden; }
@media (min-width: 1000px) { .finder-result { position: sticky; top: calc(var(--nav-h) + 28px); } }
.finder-head { padding: 22px 24px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.finder-head .hint { margin-bottom: 11px; }
.finder-head h3 { font-family: var(--font-display); font-size: 1.4rem; font-weight: 700; letter-spacing: -0.03em; }
.finder-head p { margin-top: 9px; color: var(--text-2); font-size: 0.91rem; line-height: 1.65; }
.finder-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 620px) { .finder-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.fstat { padding: 15px 20px; border-top: 1px solid var(--border); }
.fstat .k {
  display: block; font-family: var(--font-mono); font-size: 0.56rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted);
}
.fstat .v { margin-top: 6px; font-family: var(--font-display); font-size: 1.12rem; font-weight: 700; letter-spacing: -0.02em; }
.finder-block { padding: 18px 24px; border-top: 1px solid var(--border); }
.finder-block > .k {
  display: block; margin-bottom: 11px; font-family: var(--font-mono); font-size: 0.56rem;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}
.finder-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.finder-case {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 16px 24px; border-top: 1px solid var(--border); background: var(--surface-2);
}
.finder-case .fc-k {
  font-family: var(--font-mono); font-size: 0.56rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted);
}
.finder-case .fc-v { font-weight: 600; font-size: 0.94rem; }
.finder-case a { margin-left: auto; }
.finder-actions { display: flex; flex-wrap: wrap; gap: 12px; padding: 20px 24px; border-top: 1px solid var(--border); }

/* ---------- inside the build ---------- */
.anat-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.anat-tab {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 10px 15px; border: 1px solid var(--border); border-radius: 100px;
  background: var(--surface); color: var(--muted);
  font-size: 0.82rem; font-weight: 600;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.anat-tab .at-n {
  font-family: var(--font-mono); font-size: 0.58rem; letter-spacing: 0.1em;
  color: var(--faint); transition: color 0.2s;
}
.anat-tab:hover { color: var(--text); border-color: var(--border-2); }
.anat-tab.active { color: var(--text); background: var(--bg-3); border-color: var(--border-2); }
.anat-tab.active .at-n { color: var(--primary-2); }
.anat-tab:focus-visible { outline: 2px solid var(--primary-2); outline-offset: 2px; }
.anat-hint {
  display: inline-flex; align-items: center; gap: 8px; margin-left: auto;
  font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted);
}
.anat-hint svg { width: 13px; height: 13px; color: var(--primary-2); }
@media (max-width: 820px) { .anat-hint { display: none; } }

.anat-frame {
  border: 1px solid var(--border-2); border-radius: var(--radius-lg);
  overflow: hidden; background: var(--surface);
}
.anat-top {
  display: flex; align-items: center; gap: 14px; padding: 10px 14px;
  border-bottom: 1px solid var(--border); background: var(--surface-2);
}
.anat-dots { display: flex; gap: 5px; flex-shrink: 0; }
.anat-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--border-2); }
.anat-url {
  display: inline-flex; align-items: center; gap: 7px; min-width: 0;
  padding: 5px 12px; border: 1px solid var(--border); border-radius: 100px;
  background: var(--bg); font-family: var(--font-mono); font-size: 0.62rem;
  letter-spacing: 0.02em; color: var(--muted); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.anat-url-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--lime); flex-shrink: 0; }
.anat-live {
  display: inline-flex; align-items: center; gap: 7px; margin-left: auto;
  font-family: var(--font-mono); font-size: 0.56rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--lime);
}
.anat-live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 4px rgba(163, 230, 53, 0.12); }

.anat-view { display: none; position: relative; }
.anat-view.active { display: block; animation: anatIn 0.4s var(--ease); }
@keyframes anatIn { from { opacity: 0.3; } to { opacity: 1; } }
.anat-view img { display: block; width: 100%; height: auto; }

.hs {
  position: absolute; left: var(--x); top: var(--y); transform: translate(-50%, -50%);
  width: 27px; height: 27px; border-radius: 50%;
  display: grid; place-items: center; z-index: 2;
  border: 1px solid rgba(255, 255, 255, 0.68);
  background: rgba(9, 13, 20, 0.82); color: #fff;
  font-family: var(--font-mono); font-size: 0.62rem; font-weight: 600;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  transition: background 0.2s, border-color 0.2s, transform 0.2s, opacity 0.2s;
}
.hs::before {
  content: ''; position: absolute; inset: -7px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.5); opacity: 0; transition: opacity 0.2s;
}
.hs:hover { transform: translate(-50%, -50%) scale(1.12); }
.hs.is-active { background: linear-gradient(140deg, var(--primary-2), var(--primary-3)); border-color: transparent; }
.hs.is-active::before { opacity: 1; animation: hsPulse 2.2s var(--ease) infinite; }
@keyframes hsPulse {
  0% { transform: scale(1); opacity: 0.85; }
  70% { transform: scale(1.7); opacity: 0; }
  100% { transform: scale(1.7); opacity: 0; }
}
.anat-view.has-active .hs:not(.is-active) { opacity: 0.72; }

.hs-label {
  position: absolute; left: 50%; bottom: calc(100% + 10px);
  transform: translateX(-50%) translateY(4px);
  padding: 5px 9px; border-radius: 7px;
  background: #0A0E14; color: #fff; border: 1px solid rgba(255, 255, 255, 0.14);
  font-family: var(--font-mono); font-size: 0.58rem; letter-spacing: 0.06em;
  text-transform: uppercase; white-space: nowrap; opacity: 0; pointer-events: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  transition: opacity 0.18s, transform 0.18s;
}
.hs.is-active .hs-label { opacity: 1; transform: translateX(-50%) translateY(0); }
.hs[data-side="bottom"] .hs-label { top: calc(100% + 10px); bottom: auto; }
.hs[data-side="left"] .hs-label {
  left: auto; right: calc(100% + 10px); top: 50%; bottom: auto;
  transform: translateY(-50%) translateX(4px);
}
.hs.is-active[data-side="left"] .hs-label { transform: translateY(-50%) translateX(0); }
.hs[data-side="right"] .hs-label {
  left: calc(100% + 10px); top: 50%; bottom: auto;
  transform: translateY(-50%) translateX(-4px);
}
.hs.is-active[data-side="right"] .hs-label { transform: translateY(-50%) translateX(0); }
@media (max-width: 760px) {
  .hs { width: 21px; height: 21px; font-size: 0.54rem; }
  .hs-label { display: none; }
}

.anat-bottom {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
  padding: 12px 16px; border-top: 1px solid var(--border); background: var(--surface-2);
}
.anat-stack { display: flex; flex-wrap: wrap; gap: 6px; }
.anat-stack span {
  padding: 3px 8px; border: 1px solid var(--border); border-radius: 100px;
  background: var(--bg); font-family: var(--font-mono); font-size: 0.56rem;
  letter-spacing: 0.06em; color: var(--text-2);
}
.anat-meta {
  font-family: var(--font-mono); font-size: 0.56rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted);
}
.anat-link {
  display: inline-flex; align-items: center; gap: 6px; margin-left: auto;
  font-size: 0.82rem; font-weight: 600; color: var(--text);
}
.anat-link svg { width: 14px; height: 14px; transition: transform 0.25s var(--ease); }
.anat-link:hover svg { transform: translateX(3px); }
@media (max-width: 640px) {
  .anat-meta { display: none; }
  .anat-link { margin-left: 0; }
}

.anat-notes {
  display: none; margin-top: 14px; gap: 1px;
  border: 1px solid var(--border); border-radius: 14px; overflow: hidden;
  background: var(--border);
}
.anat-notes.active { display: grid; }
@media (min-width: 900px) { .anat-notes.active { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 600px) and (max-width: 899px) { .anat-notes.active { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.anote {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  min-width: 0; padding: 18px 18px 16px; text-align: left;
  background: var(--bg); transition: background 0.2s;
}
.anote:hover { background: var(--surface-2); }
.anote.is-active { background: var(--surface-2); box-shadow: inset 0 2px 0 var(--primary-2); }
.an-n { font-family: var(--font-mono); font-size: 0.58rem; letter-spacing: 0.12em; color: var(--muted); }
.anote.is-active .an-n { color: var(--primary-2); }
.an-t { font-size: 0.9rem; font-weight: 600; letter-spacing: -0.01em; color: var(--text); }
.an-d { font-size: 0.78rem; line-height: 1.6; color: var(--muted); }
.an-spec {
  margin-top: auto; padding-top: 8px;
  font-family: var(--font-mono); font-size: 0.54rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted);
}

/* ---------- section spy rail ---------- */
.spy {
  position: fixed; right: 16px; top: 50%; transform: translateY(-50%); z-index: 100;
  display: none; flex-direction: column; gap: 1px; padding: 9px 7px; border-radius: 14px;
  border: 1px solid var(--border); background: var(--bg-3);
  background: color-mix(in srgb, var(--bg-3) 84%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
@media (min-width: 1300px) { .spy { display: flex; } }
.spy a { position: relative; display: grid; place-items: center; width: 22px; height: 20px; border-radius: 7px; }
.spy a::after {
  content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--border-2);
  transition: background 0.22s, transform 0.22s var(--ease), box-shadow 0.22s;
}
.spy a span {
  position: absolute; right: calc(100% + 10px); top: 50%; transform: translateY(-50%) translateX(6px);
  padding: 5px 10px; border-radius: 8px; white-space: nowrap;
  background: var(--bg-3); border: 1px solid var(--border-2);
  font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-2); opacity: 0; pointer-events: none;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}
.spy a:hover span, .spy a:focus-visible span { opacity: 1; transform: translateY(-50%) translateX(0); }
.spy a:hover::after { background: var(--text-2); }
.spy a:focus-visible { outline: 2px solid var(--primary-2); outline-offset: 2px; }
.spy a.active::after { background: var(--primary); transform: scale(1.45); box-shadow: 0 0 10px var(--glow); }
