/* ============================================================
   MonsterSolver — shared design system
   Dark, premium, next-gen-AI. Violet → cyan neon accents.
   ============================================================ */

/* ---- Tokens ---------------------------------------------- */
:root {
  /* surfaces (dark default) */
  --bg:        #07070c;
  --bg-1:      #0c0c14;
  --bg-2:      #12121d;
  --bg-3:      #181826;
  --border:    rgba(255,255,255,0.08);
  --border-2:  rgba(255,255,255,0.14);

  /* text */
  --text:      #f4f4fb;
  --muted:     #9b9bb0;
  --faint:     #6c6c82;

  /* accents — driven by tweaks */
  --acc-1:     #8b5cf6;   /* violet */
  --acc-2:     #22d3ee;   /* cyan   */
  --acc-1-soft: color-mix(in srgb, var(--acc-1) 16%, transparent);
  --acc-2-soft: color-mix(in srgb, var(--acc-2) 16%, transparent);
  --grad: linear-gradient(105deg, var(--acc-1), var(--acc-2));

  /* GTO strategy colors */
  --raise:  #ff4d5e;
  --call:   #2bd47a;
  --fold:   #4d7dff;

  /* type */
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body:    "Manrope", system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, monospace;

  /* shape */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-xl: 30px;

  --shadow-glow: 0 0 0 1px var(--border), 0 20px 60px -20px rgba(0,0,0,0.7);
  --maxw: 1200px;

  --motion: 1;  /* 0 = off, scaled by tweaks */
}

[data-theme="light"] {
  --bg:        #f4f4f1;
  --bg-1:      #ffffff;
  --bg-2:      #f7f7f4;
  --bg-3:      #eeeeea;
  --border:    rgba(20,18,30,0.10);
  --border-2:  rgba(20,18,30,0.18);
  --text:      #14121e;
  --muted:     #56546a;
  --faint:     #8a889c;
  --shadow-glow: 0 0 0 1px var(--border), 0 18px 50px -24px rgba(40,30,80,0.28);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
}

/* ambient background glow */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(60vw 50vh at 18% -8%, var(--acc-1-soft), transparent 60%),
    radial-gradient(50vw 45vh at 95% 8%, var(--acc-2-soft), transparent 55%);
  opacity: 0.9;
}
[data-theme="light"] body::before { opacity: 0.55; }

main, header, footer { position: relative; z-index: 1; }

::selection { background: var(--acc-1); color: #fff; }

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }

/* ---- Typography ------------------------------------------ */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.04; letter-spacing: -0.02em; }
.display {
  font-size: clamp(2.8rem, 7vw, 5.6rem);
  letter-spacing: -0.035em;
  line-height: 0.98;
}
.h2 { font-size: clamp(2rem, 4.4vw, 3.4rem); letter-spacing: -0.03em; }
.h3 { font-size: clamp(1.3rem, 2.4vw, 1.7rem); }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--acc-2);
  font-weight: 500;
}
.lead { font-size: clamp(1.05rem, 1.7vw, 1.32rem); color: var(--muted); max-width: 56ch; }
.mono { font-family: var(--font-mono); }
.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ---- Layout ---------------------------------------------- */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }
section { padding: clamp(72px, 11vw, 140px) 0; }
.section-head { max-width: 64ch; margin-bottom: 56px; }
.section-head .lead { margin-top: 20px; }

/* ---- Header / Nav ---------------------------------------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(16px);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background .3s;
}
.nav.scrolled { border-bottom-color: var(--border); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 74px; }
.brand { display: flex; align-items: center; gap: 6px; font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; letter-spacing: -0.02em; }
.brand .mark { width: 52px; height: 56px; flex: none; }
.brand .mark svg { width: 100%; height: 100%; display: block; }
.brand-text { display: inline-flex; flex-direction: column; line-height: 1.02; }
.brand-name { display: inline-flex; align-items: center; gap: 7px; }
.suits { font-size: 0.6em; letter-spacing: 1.5px; }
.suits .s-r { color: #ff5d6c; }
.brand-tag { font-family: var(--font-mono); font-weight: 500; font-size: 0.56rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); margin-top: 2px; }
.nav-links { display: flex; align-items: center; gap: 26px; }
.nav-links a { color: var(--muted); font-size: 0.95rem; font-weight: 500; transition: color .2s; }
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-cta { display: flex; align-items: center; gap: 14px; }
.nav-toggle { display: none; background: none; border: 0; color: var(--text); cursor: pointer; }

/* Language selector — compact CSP-safe <details> dropdown */
.lang { position: relative; }
.lang > summary {
  list-style: none; cursor: pointer; user-select: none;
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--muted); font-family: var(--font-mono);
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.05em;
  padding: 8px 12px; border-radius: 999px; border: 1px solid var(--border-2);
  transition: color .2s, border-color .2s;
}
.lang > summary::-webkit-details-marker { display: none; }
.lang > summary::marker { content: ""; }
.lang > summary:hover, .lang[open] > summary { color: var(--text); border-color: var(--text); }
.lang > summary svg { opacity: .85; flex: none; }
.lang-menu {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 60;
  display: flex; flex-direction: column; min-width: 156px;
  background: var(--bg-1); border: 1px solid var(--border); border-radius: 14px;
  padding: 6px; box-shadow: 0 18px 44px -14px rgba(0,0,0,0.65);
}
.lang-menu a {
  color: var(--muted); font-size: 0.92rem; font-weight: 500;
  padding: 9px 12px; border-radius: 9px; transition: background .15s, color .15s;
}
.lang-menu a:hover { color: var(--text); background: var(--bg-3); }
.lang-menu a.active { color: var(--text); background: color-mix(in srgb, var(--acc-1) 16%, transparent); }

/* ---- Buttons --------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-body); font-weight: 600; font-size: 0.97rem;
  padding: 13px 24px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border-2); color: var(--text);
  background: transparent; transition: transform .18s, border-color .2s, background .2s, box-shadow .25s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); border-color: var(--text); }
.btn-primary {
  border: 0; color: #fff;
  background: var(--grad);
  box-shadow: 0 8px 30px -8px var(--acc-1), 0 0 0 1px rgba(255,255,255,0.06) inset;
}
.btn-primary:hover { box-shadow: 0 14px 44px -8px var(--acc-1), 0 0 0 1px rgba(255,255,255,0.12) inset; }
[data-theme="light"] .btn-primary { color: #fff; }
.btn-lg { padding: 16px 30px; font-size: 1.04rem; }
.btn-arrow { transition: transform .2s; }
.btn:hover .btn-arrow { transform: translateX(3px); }

/* ---- Generic surfaces ------------------------------------ */
.panel {
  background: linear-gradient(180deg, var(--bg-1), var(--bg-2));
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.04em;
  padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--border-2); color: var(--muted);
  background: var(--bg-1);
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--acc-2); box-shadow: 0 0 10px var(--acc-2); }

/* ---- Reveal animation ------------------------------------ */
/* Default = visible (no-JS / frozen-transition environments never blank out). */
.reveal { opacity: 1; transform: none; }
html.has-js .reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s cubic-bezier(.2,.7,.2,1), transform .8s cubic-bezier(.2,.7,.2,1); }
html.has-js .reveal.in { opacity: 1; transform: none; }
.reveal[data-d="1"] { transition-delay: .08s; }
.reveal[data-d="2"] { transition-delay: .16s; }
.reveal[data-d="3"] { transition-delay: .24s; }
.reveal[data-d="4"] { transition-delay: .32s; }
.reveal[data-d="5"] { transition-delay: .40s; }
[data-motion="off"] .reveal { opacity: 1 !important; transform: none !important; transition: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html.has-js .reveal { opacity: 1; transform: none; transition: none; }
  * { animation-duration: .001ms !important; }
  html { scroll-behavior: auto; }
}

/* ---- Footer ---------------------------------------------- */
.footer { border-top: 1px solid var(--border); padding: 72px 0 40px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 40px; }
.footer h4 { font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--faint); margin-bottom: 18px; font-weight: 500; }
.footer ul { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.footer ul a { color: var(--muted); font-size: 0.95rem; transition: color .2s; }
.footer ul a:hover { color: var(--text); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--border); color: var(--faint); font-size: 0.85rem; flex-wrap: wrap; }
.newsletter { display: flex; gap: 8px; margin-top: 18px; max-width: 340px; }
.newsletter input { flex: 1; background: var(--bg-1); border: 1px solid var(--border-2); border-radius: 999px; padding: 11px 18px; color: var(--text); font-family: var(--font-body); font-size: 0.9rem; }
.newsletter input:focus { outline: none; border-color: var(--acc-2); }

/* ---- Range matrix (shared) ------------------------------- */
.matrix {
  display: grid;
  grid-template-columns: repeat(13, 1fr);
  gap: 3px;
  aspect-ratio: 1;
  width: 100%;
}
.cell {
  position: relative;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: clamp(6px, 0.95vw, 11px);
  font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.85);
  cursor: pointer;
  overflow: hidden;
  background: var(--bg-3);
  transition: transform .12s, box-shadow .12s;
}
.cell .mix { position: absolute; inset: 0; display: flex; }
.cell .mix span { display: block; height: 100%; }
.cell .lab { position: relative; z-index: 2; mix-blend-mode: normal; text-shadow: 0 1px 2px rgba(0,0,0,0.55); }
.cell:hover { transform: scale(1.18); z-index: 5; box-shadow: 0 0 0 2px var(--text), 0 8px 20px rgba(0,0,0,0.5); }
.cell.pair { box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18); }

/* legend */
.legend { display: flex; gap: 20px; flex-wrap: wrap; font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

/* ---- Utility --------------------------------------------- */
.center { text-align: center; }

/* ---- Code blocks / terminal ------------------------------ */
:root {
  --tok-key:  var(--acc-1);
  --tok-str:  #2bd47a;
  --tok-num:  #ffb648;
  --tok-fn:   var(--acc-2);
  --tok-com:  var(--faint);
  --tok-punc: var(--muted);
  --tok-prop: #e7e7f5;
}
.code {
  background: #08080e; border: 1px solid var(--border-2); border-radius: var(--r-lg);
  overflow: hidden; box-shadow: 0 30px 70px -36px rgba(0,0,0,0.85);
}
[data-theme="light"] .code { background: #0d0d16; }
.code-bar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,0.07); background: rgba(255,255,255,0.02); }
.code-dots { display: flex; gap: 7px; }
.code-dots i { width: 11px; height: 11px; border-radius: 50%; display: block; background: #2a2a38; }
.code-file { font-family: var(--font-mono); font-size: 0.74rem; color: var(--faint); margin-left: 6px; }
.code-copy { margin-left: auto; font-family: var(--font-mono); font-size: 0.7rem; color: var(--muted); border: 1px solid var(--border-2); background: transparent; border-radius: 7px; padding: 5px 10px; cursor: pointer; transition: color .2s, border-color .2s; }
.code-copy:hover { color: #fff; border-color: var(--text); }
.code pre { margin: 0; padding: 20px; overflow-x: auto; }
.code code { font-family: var(--font-mono); font-size: 0.83rem; line-height: 1.7; color: #c9c9e0; display: block; white-space: pre; }
.code .ln { color: #3a3a4c; user-select: none; }
.tok-key { color: var(--tok-key); }
.tok-str { color: var(--tok-str); }
.tok-num { color: var(--tok-num); }
.tok-fn  { color: var(--tok-fn); }
.tok-com { color: var(--tok-com); font-style: italic; }
.tok-punc{ color: var(--tok-punc); }
.tok-prop{ color: var(--tok-prop); }
.tok-method { color: var(--acc-2); font-weight: 600; }

/* code tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid rgba(255,255,255,0.07); padding: 6px 8px 0; background: rgba(255,255,255,0.02); flex-wrap: wrap; }
.tab { font-family: var(--font-mono); font-size: 0.76rem; color: var(--muted); background: transparent; border: 0; padding: 9px 14px; cursor: pointer; border-radius: 8px 8px 0 0; border-bottom: 2px solid transparent; transition: color .18s; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--acc-2); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* endpoint pill */
.endpoint { display: inline-flex; align-items: center; gap: 12px; font-family: var(--font-mono); font-size: 0.92rem; background: var(--bg-1); border: 1px solid var(--border-2); border-radius: 999px; padding: 10px 18px; }
.method { font-weight: 700; padding: 3px 10px; border-radius: 6px; font-size: 0.78rem; letter-spacing: 0.04em; }
.method.post { background: color-mix(in srgb, var(--call) 22%, transparent); color: #7df5b0; }
.method.get { background: color-mix(in srgb, var(--fold) 24%, transparent); color: #9bb8ff; }
.method.del { background: color-mix(in srgb, var(--raise) 22%, transparent); color: #ff97a3; }
.path { color: var(--text); }

.mx-auto { margin-left: auto; margin-right: auto; }
.grid { display: grid; }
.flex { display: flex; }
.stat-num { font-family: var(--font-display); font-weight: 700; font-size: clamp(2.4rem, 5vw, 3.6rem); line-height: 1; letter-spacing: -0.03em; }

/* ---- Responsive ------------------------------------------ */
@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-toggle { display: inline-flex; }
  .nav.open .nav-links {
    display: flex; flex-direction: column; gap: 18px;
    position: absolute; top: 74px; left: 0; right: 0;
    background: var(--bg-1); border-bottom: 1px solid var(--border);
    padding: 24px 28px;
  }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 560px) {
  .container { padding: 0 18px; }
  .footer-grid { grid-template-columns: 1fr; }
  .nav-cta .btn:not(.btn-primary) { display: none; }
}

/* ============================================================
   Demo-video showcase ("A look inside") — shared by /download
   and the home page (markup: public/_demo_videos.html, popup JS:
   initDemoVideos in site.js).
   ============================================================ */
.shots { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.shots .shot-main, .shots .shot-side { width: 100%; border: 1px solid var(--border-2); border-radius: 16px; background: var(--bg-2); display: grid; place-items: center; font-family: var(--font-mono); font-size: 0.76rem; color: var(--faint); }
.shot-main { height: 460px; }
.shot-side { height: 222px; }
/* two videos side by side (shorter so each ~half-width box stays landscape) */
.shots-multi { grid-template-columns: 1fr 1fr; }
.shots-multi .shot-main { height: 340px; }
.shots-note { font-family: var(--font-mono); font-size: 0.75rem; line-height: 1.7; color: var(--muted); text-align: center; max-width: 78ch; margin: 34px auto 0; }

/* poster trigger → popup player.
   Selector must out-specify `.shots .shot-main` (0,2,0), which sets display:grid
   and a `background` shorthand that would otherwise reset size/position to auto —
   leaving the poster un-covered/off-center and the badge in top-aligned grid rows. */
.shots .shot-main.video-trigger { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 0; cursor: pointer; overflow: hidden; position: relative; background-color: var(--bg-2); background-size: cover; background-position: center; background-repeat: no-repeat; transition: transform .2s, box-shadow .2s; }
.video-trigger::before { content: ""; position: absolute; inset: 0; background: rgba(7,7,12,0.5); transition: background .2s; }
.video-trigger:hover { transform: translateY(-2px); box-shadow: var(--shadow-glow); }
.video-trigger:hover::before { background: rgba(7,7,12,0.32); }
.video-trigger .play-badge { position: relative; z-index: 1; width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--grad); box-shadow: 0 12px 34px -8px var(--acc-1); padding-left: 4px; }
.video-trigger .play-label { position: relative; z-index: 1; font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.04em; color: #fff; }

.video-modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 16px; }
.video-modal[hidden] { display: none; }
.video-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.82); backdrop-filter: blur(6px); }
/* largest 16:9 box that fits the viewport: the calc() bounds height to 90vh,
   the 94vw bounds width, min() takes whichever binds — always maximal, never
   letterboxed, never overflowing. JS overrides aspect-ratio/width per clip. */
.video-box { position: relative; width: min(94vw, calc(90vh * 16 / 9)); aspect-ratio: 16 / 9; max-height: 90vh; background: #000; border: 1px solid var(--border-2); border-radius: 16px; overflow: hidden; box-shadow: 0 40px 110px -30px #000; }
.video-box video { width: 100%; height: 100%; display: block; object-fit: contain; background: #000; }
.video-x { position: absolute; top: 10px; right: 10px; z-index: 2; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border-2); background: color-mix(in srgb, var(--bg-1) 80%, transparent); color: var(--text); cursor: pointer; font-size: 1rem; line-height: 1; }
.video-x:hover { border-color: var(--text); }

@media (max-width: 820px) {
  .shots, .shots-multi { grid-template-columns: 1fr; }
  .shots .shot-main, .shots .shot-side { height: 300px; }
}
