/* ==========================================================================
   DevGenius Studio — main stylesheet
   Dark immersive theme · brand blue + white · glassmorphism
   ========================================================================== */

:root {
  --bg: #040a18;
  --bg-2: #081430;
  --blue: #2196f3;
  --blue-light: #4aaeff;
  --blue-deep: #1565c0;
  --cyan: #22e4ff;           /* Tessera accent */
  --white: #ffffff;
  --text: #e8f0ff;
  --muted: #9fb2cf;
  --faint: #6b7f9e;

  --glass: rgba(255, 255, 255, 0.055);
  --glass-hi: rgba(255, 255, 255, 0.09);
  --stroke: rgba(255, 255, 255, 0.11);
  --stroke-hi: rgba(120, 190, 255, 0.45);

  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.6);
  --glow: 0 0 0 1px rgba(74, 174, 255, 0.35), 0 12px 40px -8px rgba(33, 150, 243, 0.55);

  --font-display: "Fredoka", ui-rounded, "SF Pro Rounded", "Nunito", "Segoe UI Variable Display", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --header-h: 72px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; outline: none; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul[class], ol[class], .footer-col ul, .toc ol { list-style: none; }
::selection { background: rgba(33, 150, 243, 0.45); color: #fff; }

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

.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-link {
  position: fixed; top: 12px; left: 12px; z-index: 100;
  padding: 10px 16px; border-radius: 10px;
  background: var(--blue); color: #fff; font-weight: 600; text-decoration: none;
  transform: translateY(-160%); transition: transform 0.2s var(--ease);
}
.skip-link:focus { transform: none; }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 820px; }

/* ---------- Immersive backdrop ---------- */
.backdrop {
  position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(33, 150, 243, 0.18), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
}
/* Glows are soft radial gradients (no blur filter: blur on large animated
   layers is re-rasterised every frame and was the main cause of jank).
   They only move with translate, which the GPU compositor handles alone. */
.blob {
  position: absolute; border-radius: 50%;
  will-change: transform; backface-visibility: hidden;
}
.b1 { width: 900px; height: 900px; left: -380px; top: -360px; background: radial-gradient(closest-side, rgba(30,136,229,0.75), rgba(30,136,229,0.25) 50%, transparent); animation: drift1 22s ease-in-out infinite alternate; }
.b2 { width: 800px; height: 800px; right: -400px; top: 12%; background: radial-gradient(closest-side, rgba(34,228,255,0.2), rgba(34,228,255,0.06) 55%, transparent); animation: drift2 26s ease-in-out infinite alternate; }
.b3 { width: 1000px; height: 1000px; left: 18%; bottom: -560px; background: radial-gradient(closest-side, rgba(61,90,254,0.32), rgba(61,90,254,0.1) 55%, transparent); animation: drift3 30s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate3d(120px, 80px, 0); } }
@keyframes drift2 { to { transform: translate3d(-100px, 120px, 0); } }
@keyframes drift3 { to { transform: translate3d(-140px, -60px, 0); } }

.grid-floor {
  position: absolute; left: -50%; right: -50%; bottom: -10%; height: 60%;
  overflow: hidden;
  transform: perspective(600px) rotateX(62deg);
  transform-origin: bottom;
  -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,0.9), transparent 75%);
          mask-image: linear-gradient(to top, rgba(0,0,0,0.9), transparent 75%);
}
.grid-floor::before {
  content: ""; position: absolute; left: 0; right: 0; top: -56px; bottom: 0;
  background-image:
    linear-gradient(rgba(74, 174, 255, 0.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(74, 174, 255, 0.14) 1px, transparent 1px);
  background-size: 56px 56px;
  will-change: transform;
  animation: floor 6s linear infinite;
}
@keyframes floor { to { transform: translate3d(0, 56px, 0); } }

/* ---------- Glass primitive ---------- */
.glass {
  position: relative;
  background: linear-gradient(160deg, rgba(255,255,255,0.085), rgba(255,255,255,0.025));
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
          backdrop-filter: blur(18px) saturate(140%);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,0.08);
}

/* Cursor spotlight (JS sets --mx/--my) */
.spot { overflow: hidden; isolation: isolate; transition: border-color 0.3s var(--ease), transform 0.35s var(--ease), background 0.3s; }
.spot::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, -40%), rgba(74, 174, 255, 0.18), transparent 45%);
  opacity: 0; transition: opacity 0.3s;
}
.spot:hover::before { opacity: 1; }
.spot:hover { border-color: var(--stroke-hi); }
a.spot:hover, .lift:hover { transform: translateY(-4px); }

/* ---------- Typography ---------- */
h1, h2, h3, .display { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; color: var(--white); }
h1 { font-size: clamp(2.4rem, 6vw, 4.4rem); }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.7rem); }
h3 { font-size: 1.2rem; letter-spacing: -0.01em; }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.22rem); color: var(--muted); max-width: 620px; }
.muted { color: var(--muted); }
.grad {
  background: linear-gradient(100deg, #ffffff 0%, var(--blue-light) 45%, var(--cyan) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 999px;
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  color: #cfe6ff; background: rgba(33, 150, 243, 0.14); border: 1px solid rgba(74, 174, 255, 0.3);
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--blue-light); box-shadow: 0 0 10px var(--blue-light); animation: pulse 2.2s ease-in-out infinite; }
.chip.cyan { color: #c9fbff; background: rgba(34, 228, 255, 0.1); border-color: rgba(34, 228, 255, 0.35); }
.chip.cyan .dot { background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
@keyframes pulse { 50% { transform: scale(1.5); opacity: 0.55; } }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--glass-hi);
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 24px; border-radius: 999px;
  font-weight: 600; font-size: 0.98rem; text-decoration: none; white-space: nowrap;
  background: var(--btn-bg); color: var(--white);
  border: 1px solid var(--stroke);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s, border-color 0.25s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { transform: translateY(-2px); border-color: var(--stroke-hi); }
.btn:active { transform: translateY(0) scale(0.97); }
.btn-primary {
  background: linear-gradient(135deg, var(--blue-light), var(--blue) 55%, var(--blue-deep));
  border-color: transparent; box-shadow: var(--glow);
}
.btn-primary:hover { box-shadow: 0 0 0 1px rgba(74,174,255,0.6), 0 16px 48px -8px rgba(33,150,243,0.8); }
.btn-ghost { -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.btn-sm { min-height: 40px; padding: 0 18px; font-size: 0.9rem; }
.btn .arrow { transition: transform 0.25s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }
.ripple {
  position: absolute; border-radius: 50%; pointer-events: none;
  background: rgba(255,255,255,0.45); transform: scale(0);
  animation: ripple 0.6s var(--ease) forwards;
}
@keyframes ripple { to { transform: scale(1); opacity: 0; } }
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; }
.link-btn { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; padding: 0; }
.link-btn:hover { color: var(--white); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  transition: background 0.3s, border-color 0.3s, box-shadow 0.3s;
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled {
  background: rgba(6, 14, 32, 0.62);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
          backdrop-filter: blur(18px) saturate(150%);
  border-bottom-color: var(--stroke);
  box-shadow: 0 10px 30px -12px rgba(0,0,0,0.5);
}
.nav { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--white); }
.dg-mark { width: 38px; height: 38px; border-radius: 11px; box-shadow: 0 6px 20px -6px rgba(33,150,243,0.8); transition: transform 0.4s var(--ease); }
.brand:hover .dg-mark { transform: rotate(-8deg) scale(1.06); }
.brand-word { font-family: var(--font-display); font-size: 1.12rem; font-weight: 500; letter-spacing: 0.01em; }
.brand-word b { font-weight: 800; letter-spacing: 0.04em; }

.nav-panel { display: flex; align-items: center; gap: 22px; }
.nav-links { display: flex; align-items: center; gap: 4px; padding: 5px; border-radius: 999px; background: rgba(255,255,255,0.04); border: 1px solid var(--stroke); }
.nav-link {
  display: block; padding: 8px 16px; border-radius: 999px;
  font-size: 0.93rem; font-weight: 500; color: var(--muted); text-decoration: none;
  transition: color 0.2s, background 0.25s;
}
.nav-link:hover { color: var(--white); background: rgba(255,255,255,0.06); }
.nav-link.is-active { color: var(--white); background: rgba(33,150,243,0.22); box-shadow: inset 0 0 0 1px rgba(74,174,255,0.35); }

.nav-toggle { display: none; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--stroke); background: var(--glass); }
.bars { display: grid; gap: 5px; width: 20px; margin: 0 auto; }
.bars i { display: block; height: 2px; border-radius: 2px; background: #fff; transition: transform 0.3s var(--ease), opacity 0.2s; }
.nav-open .bars i:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-open .bars i:nth-child(2) { opacity: 0; }
.nav-open .bars i:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav-panel {
    position: fixed; top: calc(var(--header-h) + 8px); left: 16px; right: 16px;
    flex-direction: column; align-items: stretch; gap: 14px; padding: 16px;
    border-radius: var(--radius); border: 1px solid var(--stroke);
    background: rgba(8, 18, 40, 0.88);
    -webkit-backdrop-filter: blur(22px); backdrop-filter: blur(22px);
    box-shadow: var(--shadow);
    opacity: 0; visibility: hidden; transform: translateY(-10px) scale(0.98);
    transition: opacity 0.25s var(--ease), transform 0.3s var(--ease), visibility 0s 0.3s;
  }
  .nav-open .nav-panel { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
  .nav-open .site-header { background: rgba(6, 14, 32, 0.9); }
  .nav-links { flex-direction: column; align-items: stretch; border-radius: var(--radius-sm); background: none; border: 0; padding: 0; }
  .nav-link { padding: 12px 16px; border-radius: 12px; font-size: 1rem; }
  .nav-cta { width: 100%; }
}

/* ---------- Sections ---------- */
.section { padding: clamp(64px, 9vw, 120px) 0; position: relative; }
.section-tight { padding: clamp(40px, 6vw, 72px) 0; }
.section-head { max-width: 680px; margin-bottom: 48px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head .chip { margin-bottom: 18px; }
.section-head h2 + p { margin-top: 16px; color: var(--muted); font-size: 1.06rem; }

.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 960px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ---------- Hero ---------- */
.hero { padding: clamp(48px, 8vw, 96px) 0 clamp(64px, 8vw, 110px); }
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero h1 { margin: 22px 0 22px; }
.hero .btn-row { margin-top: 34px; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 28px; margin-top: 44px; padding-top: 28px; border-top: 1px solid var(--stroke); }
.hero-stats div { display: grid; }
.hero-stats strong { font-family: var(--font-display); font-size: 1.4rem; color: var(--white); }
.hero-stats span { font-size: 0.86rem; color: var(--faint); }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }

/* Hero showcase card */
.showcase { perspective: 1200px; }
.showcase-card {
  padding: 22px; transform-style: preserve-3d;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.5s var(--ease);
}
.showcase-media {
  position: relative; aspect-ratio: 1 / 1; border-radius: 16px; overflow: hidden;
  background:
    radial-gradient(circle at 30% 20%, rgba(255,255,255,0.35), transparent 40%),
    linear-gradient(150deg, #5c6b80, #222a36);
  display: grid; place-items: center;
}
.showcase-media .tessera-art { width: 100%; height: 100%; object-fit: cover; }
.showcase-media::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, transparent 55%, rgba(4,10,24,0.85));
}
.showcase-logo { position: absolute; left: 18px; right: 18px; bottom: 16px; z-index: 2; transform: translateZ(40px); }
.showcase-logo .tessera-logo { width: 62%; }
.showcase-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.showcase-meta p { font-size: 0.9rem; color: var(--muted); }
.float { animation: float 7s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-12px); } }

/* ---------- Tessera wordmark (text fallback) ---------- */
.tessera-wordmark {
  display: inline-flex; font-family: var(--font-display); font-weight: 800;
  font-size: clamp(2.4rem, 6vw, 4.2rem); letter-spacing: 0.02em; line-height: 1;
  color: #f2f5f9; -webkit-text-stroke: 2px #05070c; paint-order: stroke fill;
  text-shadow: 0 4px 0 #05070c, 0 10px 30px rgba(0,0,0,0.45);
}
.tessera-wordmark .ss { color: var(--cyan); }
.tessera-wordmark.sm { font-size: 1.9rem; -webkit-text-stroke-width: 1.5px; text-shadow: 0 3px 0 #05070c; }
.tessera-logo { width: min(440px, 100%); height: auto; filter: drop-shadow(0 12px 30px rgba(0,0,0,0.45)); }

/* ---------- CSS voxel scene (art fallback) ---------- */
.voxel-scene { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; perspective: 900px; }
.cube {
  --s: 90px; --c: var(--blue);
  position: absolute; width: var(--s); height: var(--s); transform-style: preserve-3d;
  animation: spin 16s linear infinite;
}
.cube i { position: absolute; inset: 0; border: 1px solid rgba(255,255,255,0.35); background: var(--c); }
.cube i:nth-child(1) { transform: translateZ(calc(var(--s) / 2)); filter: brightness(1.05); }
.cube i:nth-child(2) { transform: rotateY(180deg) translateZ(calc(var(--s) / 2)); filter: brightness(0.6); }
.cube i:nth-child(3) { transform: rotateY(90deg) translateZ(calc(var(--s) / 2)); filter: brightness(0.8); }
.cube i:nth-child(4) { transform: rotateY(-90deg) translateZ(calc(var(--s) / 2)); filter: brightness(0.75); }
.cube i:nth-child(5) { transform: rotateX(90deg) translateZ(calc(var(--s) / 2)); filter: brightness(1.3); }
.cube i:nth-child(6) { transform: rotateX(-90deg) translateZ(calc(var(--s) / 2)); filter: brightness(0.5); }
.c1 { --s: 120px; --c: #2196f3; left: 30%; top: 26%; }
.c2 { --s: 64px; --c: #22e4ff; left: 12%; top: 12%; animation-duration: 20s; animation-direction: reverse; }
.c3 { --s: 52px; --c: #e8eef7; right: 12%; top: 18%; animation-duration: 13s; }
.c4 { --s: 76px; --c: #1565c0; right: 18%; bottom: 26%; animation-duration: 24s; }
@media (max-width: 600px) { .voxel-scene { transform: scale(0.62); } }
@keyframes spin { from { transform: rotateX(-24deg) rotateY(0deg); } to { transform: rotateX(-24deg) rotateY(360deg); } }

/* ---------- Cards ---------- */
.card { padding: 30px; }
.card h3 { margin: 18px 0 10px; }
.card p { color: var(--muted); font-size: 0.98rem; }
.icon {
  width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center;
  background: linear-gradient(140deg, rgba(74,174,255,0.3), rgba(33,150,243,0.08));
  border: 1px solid rgba(74,174,255,0.35); color: #d8ecff;
  transition: transform 0.4s var(--ease);
}
.icon svg { width: 26px; height: 26px; }
.card:hover .icon { transform: translateY(-3px) rotate(-6deg); }
.icon.cyan { background: linear-gradient(140deg, rgba(34,228,255,0.28), rgba(34,228,255,0.05)); border-color: rgba(34,228,255,0.4); color: #d4fdff; }

/* About: big brand mark */
.brand-panel { display: grid; place-items: center; padding: 20px; }
.dg-hero {
  width: min(240px, 70%); height: auto; border-radius: 22%;
  box-shadow: 0 30px 80px -20px rgba(33,150,243,0.9), 0 0 0 1px rgba(255,255,255,0.15);
  animation: float 7s ease-in-out infinite;
}

/* Feature band */
.feature-band { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: center; padding: clamp(28px, 5vw, 56px); }
.feature-band .tags { margin: 24px 0 30px; }
@media (max-width: 900px) { .feature-band { grid-template-columns: 1fr; } }

.tags { display: flex; flex-wrap: wrap; gap: 10px; }
.tag {
  font-size: 0.84rem; padding: 6px 12px; border-radius: 10px;
  background: rgba(255,255,255,0.05); border: 1px solid var(--stroke); color: var(--text);
  transition: border-color 0.2s, background 0.2s;
}
.tag:hover { border-color: var(--stroke-hi); background: rgba(33,150,243,0.12); }

.check-list { display: grid; gap: 14px; }
.check-list li { display: flex; gap: 12px; align-items: flex-start; color: var(--muted); }
.check-list li::before {
  content: ""; flex: none; width: 22px; height: 22px; margin-top: 2px; border-radius: 7px;
  background: rgba(33,150,243,0.2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23bfe0ff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center / 14px no-repeat;
  border: 1px solid rgba(74,174,255,0.4);
}
.check-list strong { color: var(--white); font-weight: 600; }

/* CTA panel */
.cta {
  text-align: center; padding: clamp(40px, 7vw, 80px) 24px; overflow: hidden;
  background:
    radial-gradient(600px 240px at 50% 0%, rgba(33,150,243,0.35), transparent 70%),
    linear-gradient(160deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02));
}
.cta h2 { max-width: 640px; margin: 0 auto 16px; }
.cta p { color: var(--muted); max-width: 520px; margin: 0 auto 30px; }
.cta .btn-row { justify-content: center; }

/* Page hero (inner pages) */
.page-hero { padding: clamp(48px, 8vw, 96px) 0 clamp(24px, 4vw, 40px); }
.page-hero h1 { margin: 18px 0 16px; font-size: clamp(2.2rem, 5vw, 3.6rem); }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 10px; font-size: 0.88rem; color: var(--faint); }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--white); }

/* ---------- Tabs (game modes) ---------- */
.tabs { display: grid; grid-template-columns: 300px 1fr; gap: 22px; }
.tab-list { display: grid; gap: 10px; align-content: start; }
.tab {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  padding: 16px 18px; border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.03); border: 1px solid var(--stroke); color: var(--muted);
  transition: background 0.25s, border-color 0.25s, color 0.25s, transform 0.25s var(--ease);
}
.tab:hover { color: var(--white); transform: translateX(4px); }
.tab[aria-selected="true"] { color: var(--white); background: rgba(33,150,243,0.16); border-color: rgba(74,174,255,0.5); box-shadow: inset 3px 0 0 var(--blue-light); }
.tab .num { font-family: var(--font-display); font-weight: 700; color: var(--blue-light); width: 26px; }
.tab-panel { padding: clamp(26px, 4vw, 44px); min-height: 280px; }
.tab-panel[hidden] { display: none; }
.tab-panel.is-entering { animation: panelIn 0.45s var(--ease); }
.tab-panel h3 { font-size: 1.8rem; margin: 18px 0 12px; }
.tab-panel p { color: var(--muted); max-width: 560px; }
@keyframes panelIn { from { opacity: 0; transform: translateY(12px); } }
@media (max-width: 860px) {
  .tabs { grid-template-columns: 1fr; }
  .tab-list { grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
  .tab:hover { transform: none; }
}

/* ---------- FAQ ---------- */
.faq { display: grid; gap: 12px; }
.faq details { border-radius: var(--radius-sm); overflow: hidden; }
.faq summary {
  list-style: none; cursor: pointer; padding: 20px 56px 20px 22px; position: relative;
  font-weight: 600; color: var(--white);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 22px; top: 50%; width: 12px; height: 12px; margin-top: -8px;
  border-right: 2px solid var(--blue-light); border-bottom: 2px solid var(--blue-light);
  transform: rotate(45deg); transition: transform 0.3s var(--ease);
}
.faq details[open] summary::after { transform: rotate(225deg); margin-top: -2px; }
.faq .answer { padding: 0 22px 22px; color: var(--muted); }
.faq details[open] .answer { animation: panelIn 0.35s var(--ease); }
.faq a, .card a.inline, .prose a { color: #9fd1ff; text-underline-offset: 3px; }

/* ---------- Contact ---------- */
.contact-card { padding: clamp(28px, 4vw, 44px); }
.email-box {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 22px 0 8px; padding: 10px 10px 10px 20px; border-radius: 999px;
  background: rgba(0,0,0,0.25); border: 1px solid var(--stroke);
}
.email-box a { flex: 1; min-width: 0; font-family: var(--font-display); font-size: clamp(1.05rem, 2.4vw, 1.4rem); font-weight: 600; color: var(--white); text-decoration: none; overflow-wrap: anywhere; }
.topic { display: flex; flex-direction: column; gap: 6px; padding: 22px; text-decoration: none; }
.topic strong { color: var(--white); display: flex; justify-content: space-between; align-items: center; }
.topic span { color: var(--muted); font-size: 0.93rem; }
.topic .arrow { transition: transform 0.25s var(--ease); color: var(--blue-light); }
.topic:hover .arrow { transform: translateX(4px); }

/* ---------- Legal ---------- */
.read-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60; }
.read-progress span { display: block; height: 100%; width: 100%; transform-origin: left; transform: scaleX(0); background: linear-gradient(90deg, var(--blue-light), var(--cyan)); box-shadow: 0 0 12px var(--blue); }
.meta-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.meta-chips li { padding: 7px 14px; border-radius: 999px; font-size: 0.88rem; background: var(--glass); border: 1px solid var(--stroke); color: var(--white); }
.meta-chips li span { color: var(--faint); margin-right: 6px; }
.legal-section { padding-top: 24px; }
.legal-wrap { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 28px; align-items: start; }
.legal-wrap:has(.toc[hidden]) { grid-template-columns: minmax(0, 1fr); max-width: 900px; }
.toc { position: sticky; top: calc(var(--header-h) + 20px); padding: 20px; border-radius: var(--radius-sm); }
.toc-title { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); margin-bottom: 12px; }
.toc ol { display: grid; gap: 2px; }
.toc a { display: block; padding: 7px 10px; border-radius: 9px; font-size: 0.88rem; color: var(--muted); text-decoration: none; line-height: 1.35; transition: color 0.2s, background 0.2s; }
.toc a:hover { color: var(--white); background: rgba(255,255,255,0.05); }
.toc a.is-current { color: var(--white); background: rgba(33,150,243,0.18); }
@media (max-width: 960px) { .legal-wrap { grid-template-columns: 1fr; } .toc { display: none; } }

.legal-doc { padding: clamp(26px, 5vw, 56px); }
.legal-doc > :first-child { margin-top: 0; }
.legal-doc h2 { font-size: clamp(1.3rem, 2.4vw, 1.6rem); margin: 44px 0 14px; padding-top: 28px; border-top: 1px solid var(--stroke); }
.legal-doc h2:first-of-type { border-top: 0; padding-top: 0; }
.legal-doc h3 { font-size: 1.08rem; margin: 26px 0 8px; color: #d7e9ff; }
.legal-doc p, .legal-doc li { color: #c3d1e6; }
.legal-doc p { margin: 0 0 14px; }
.legal-doc ul, .legal-doc ol { margin: 0 0 16px; padding-left: 22px; display: grid; gap: 8px; }
.legal-doc li::marker { color: var(--blue-light); }
.legal-doc strong { color: var(--white); }
.legal-doc a { color: #9fd1ff; text-underline-offset: 3px; }
.legal-doc a:hover { color: #fff; }
.legal-doc .accent { color: var(--cyan); }
.legal-doc .callout { padding: 18px 20px; border-radius: var(--radius-sm); background: rgba(33,150,243,0.1); border: 1px solid rgba(74,174,255,0.3); margin-bottom: 22px; }
.legal-doc .callout p:last-child { margin: 0; }
.legal-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-top: 28px; }
.link-card { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-radius: var(--radius-sm); text-decoration: none; color: var(--white); font-weight: 600; }
.link-card span:last-child { color: var(--blue-light); transition: transform 0.25s var(--ease); }
.link-card:hover span:last-child { transform: translateX(4px); }

/* ---------- 404 ---------- */
.notfound { min-height: 62vh; display: grid; place-items: center; text-align: center; padding: 64px 0; }
.notfound .code { font-family: var(--font-display); font-size: clamp(6rem, 20vw, 11rem); font-weight: 800; line-height: 1; }
.notfound p { color: var(--muted); margin: 14px auto 30px; max-width: 460px; }
.notfound .btn-row { justify-content: center; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 40px; padding: 56px 0 28px; border-top: 1px solid var(--stroke); background: linear-gradient(180deg, rgba(4,10,24,0), rgba(4,10,24,0.7)); }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 32px; }
.footer-brand p { color: var(--muted); font-size: 0.93rem; margin-top: 16px; max-width: 320px; }
.footer-col h2 { font-family: var(--font-body); font-size: 0.76rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); margin-bottom: 14px; }
.footer-col ul { display: grid; gap: 10px; }
.footer-col a { color: var(--muted); text-decoration: none; font-size: 0.94rem; transition: color 0.2s; overflow-wrap: anywhere; }
.footer-col a:hover { color: var(--white); }
.footer-col .link-btn { font-size: 0.94rem; }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--stroke); font-size: 0.86rem; color: var(--faint); }
.to-top { color: var(--muted); text-decoration: none; }
.to-top:hover { color: var(--white); }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 80;
  padding: 12px 20px; border-radius: 999px; font-weight: 600; font-size: 0.93rem;
  background: rgba(10, 24, 52, 0.9); border: 1px solid var(--stroke-hi); color: #fff;
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  box-shadow: var(--glow);
  opacity: 0; transform: translate(-50%, 16px); pointer-events: none;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Scroll reveal ---------- */
.js [data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); transition-delay: var(--d, 0s); }
.js [data-reveal].is-in { opacity: 1; transform: none; }

/* ---------- Reduced motion ---------- */
@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; }
  .js [data-reveal] { opacity: 1; transform: none; }
}

/* Older browsers without backdrop-filter: make glass more opaque */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: rgba(14, 28, 58, 0.92); }
  .site-header.is-scrolled { background: rgba(6, 14, 32, 0.96); }
}

/* ---------- Mobile performance overrides (keep last) ---------- */
/* Phones & tablets: backdrop blur on many cards is costly on mobile GPUs and
   barely visible over the smooth background, so use a tinted fill instead.
   The header keeps a solid tint. Moving grid is desktop-only. */
@media (max-width: 1024px), (hover: none) {
  .glass, .btn-ghost, .toast {
    -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  .glass { background: linear-gradient(160deg, rgba(34, 56, 98, 0.55), rgba(14, 26, 54, 0.6)); }
  .site-header.is-scrolled, .nav-open .site-header {
    -webkit-backdrop-filter: none; backdrop-filter: none;
    background: rgba(6, 14, 32, 0.94);
  }
  .nav-panel { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(8, 18, 40, 0.97); }
  .grid-floor::before { animation: none; }
  .float { animation: none; }
}
