/*
 * DrawSolver — landing page.
 * Dark operator-grade aesthetic, shared with the DrawSolver workstation:
 * layered surfaces, hairline borders, phosphor-cyan accent, IBM Plex,
 * 4-color deck. Sober, dense, precise — an instrument, not a brochure.
 */

/* ---- Self-hosted IBM Plex (OFL), same faces as the product ---- */
@font-face {
  font-family: 'IBM Plex Sans';
  src: url('/fonts/plex-sans-var.woff2') format('woff2');
  font-weight: 100 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('/fonts/plex-mono-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('/fonts/plex-mono-500.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('/fonts/plex-mono-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* ---- Design tokens (ported from the workstation) ---- */
:root {
  --bg-app: #0c0e12;
  --bg-panel: #14171d;
  --bg-elevated: #1a1e26;
  --bg-inset: #0a0c10;
  --bg-hover: #1f242d;

  --border: #232831;
  --border-strong: #2e3540;
  --border-faint: #1a1e25;

  --text-primary: #e6e9ef;
  --text-secondary: #a4adba;
  --text-muted: #8a94a4;
  --text-faint: #667082;

  --accent: #2fd3e4;
  --accent-dim: #0f3a42;
  --accent-text: #7fe7f2;

  --positive: #3fb950;
  --warn: #e3a008;
  --info: #4f8cff;

  /* 4-color deck */
  --suit-c: #4cc271;  --suit-c-dim: #0f2e1a;
  --suit-d: #5d9bff;  --suit-d-dim: #142647;
  --suit-h: #f2635a;  --suit-h-dim: #391614;
  --suit-s: #aeb8c8;  --suit-s-dim: #242b37;

  --font-sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'IBM Plex Mono', 'SF Mono', 'JetBrains Mono', 'Menlo', 'Consolas', ui-monospace, monospace;

  --radius-sm: 2px;
  --radius-md: 3px;
  --radius-lg: 4px;
  --radius-xl: 8px;

  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.5, 1);
  --dur-1: 90ms;
  --dur-2: 150ms;
  --dur-3: 240ms;

  --shadow-pop:
    0 12px 36px rgba(0, 0, 0, 0.6),
    0 4px 12px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(0, 0, 0, 0.4);
  --glow-accent:
    0 0 0 1px color-mix(in srgb, var(--accent) 55%, transparent),
    0 2px 18px color-mix(in srgb, var(--accent) 22%, transparent);

  --maxw: 1140px;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100%;
  /* Same faint top-down glow as the workstation, over flat near-black. */
  /* Glow anchored to the hero (not the viewport) — it scrolls away as you
     descend. background-attachment: fixed is deliberately avoided: on a long
     scrolling page it both re-centers the glow and breaks compositing. */
  background:
    radial-gradient(1200px 620px at 50% -180px, #12151d 0%, transparent 60%),
    var(--bg-app);
  background-repeat: no-repeat;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  font-variant-numeric: lining-nums tabular-nums;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, p { margin: 0; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; }

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums slashed-zero;
}

/* Uppercase mono label — the recurring "instrument" caption. */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-text);
}

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 28px;
}

/* ================================================================== */
/* Top bar                                                            */
/* ================================================================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-app) 82%, transparent);
  backdrop-filter: blur(10px) saturate(1.1);
}
.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}
.brand {
  display: inline-flex;
  align-items: center;
}
.brand__logo {
  height: 27px;
  width: auto;
  display: block;
}
.topnav {
  display: flex;
  align-items: center;
  gap: 26px;
  font-size: 13px;
}
.topnav a {
  color: var(--text-secondary);
  transition: color var(--dur-2) var(--ease-out);
}
.topnav a:hover { color: var(--text-primary); }
.topnav .btn { margin-left: 4px; }
@media (max-width: 720px) {
  .topnav .topnav__link { display: none; }
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.03em;
  padding: 9px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text-primary);
  cursor: pointer;
  white-space: nowrap;
  transition:
    background-color var(--dur-2) var(--ease-out),
    border-color var(--dur-2) var(--ease-out),
    box-shadow var(--dur-2) var(--ease-out),
    transform var(--dur-1) var(--ease-out);
}
.btn:hover { border-color: var(--text-faint); background: var(--bg-hover); }
.btn:active { transform: translateY(0.5px); }
.btn--primary {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: color-mix(in srgb, var(--accent) 12%, var(--bg-elevated));
  color: var(--accent-text);
}
.btn--primary:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 18%, var(--bg-elevated));
  box-shadow: var(--glow-accent);
}
.btn__arrow { transition: transform var(--dur-2) var(--ease-out); }
.btn:hover .btn__arrow { transform: translateX(2px); }

/* ================================================================== */
/* Hero                                                               */
/* ================================================================== */
.hero {
  position: relative;
  padding-top: 92px;
  padding-bottom: 64px;
  overflow: hidden;
}
/* Faint instrument grid, fading out downward. */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(color-mix(in srgb, var(--border) 55%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--border) 55%, transparent) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(115% 80% at 50% 0%, #000 0%, transparent 72%);
          mask-image: radial-gradient(115% 80% at 50% 0%, #000 0%, transparent 72%);
  opacity: 0.5;
  pointer-events: none;
}
.hero__inner { position: relative; }
.hero__eyebrow { margin-bottom: 22px; }
.hero h1 {
  font-size: clamp(2.1rem, 5.2vw, 3.5rem);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.022em;
  max-width: 17ch;
}
.hero h1 .accent { color: var(--accent-text); }
.hero__sub {
  margin-top: 22px;
  max-width: 60ch;
  font-size: clamp(1rem, 1.6vw, 1.12rem);
  line-height: 1.62;
  color: var(--text-secondary);
}
.hero__sub b { color: var(--text-primary); font-weight: 600; }
.hero__cta {
  margin-top: 34px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

/* ================================================================== */
/* Section scaffolding                                                */
/* ================================================================== */
section { position: relative; }
.section {
  padding-top: 72px;
  padding-bottom: 72px;
  border-top: 1px solid var(--border-faint);
}
.section__head { margin-bottom: 34px; max-width: 62ch; }
.section__head h2 {
  margin-top: 12px;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.12;
}
.section__head p {
  margin-top: 14px;
  color: var(--text-secondary);
  font-size: 1.02rem;
  line-height: 1.6;
}

/* ================================================================== */
/* Games — per-game drop cards (accordion)                            */
/* ================================================================== */
.gamelist { border-top: 1px solid var(--border); }
.gamecard { border-bottom: 1px solid var(--border); }
.gamecard__row {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 6px;
}
.gamecard__row::-webkit-details-marker { display: none; }
.gamecard__row:hover .gamecard__name { color: var(--accent-text); }
.gamecard__id { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; min-width: 0; }
.gamecard__name {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: color var(--dur-2) var(--ease-out);
}
.gamecard__tags { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.gtag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 3px 7px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-inset);
  white-space: nowrap;
}
.gtag--soon {
  color: var(--warn);
  border-style: dashed;
  border-color: color-mix(in srgb, var(--warn) 42%, var(--border));
}
.gamecard__right { display: flex; align-items: center; gap: 16px; flex: none; }
.gamecard__price {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}
.gamecard__chev {
  width: 10px; height: 10px;
  border-right: 1.5px solid var(--text-muted);
  border-bottom: 1.5px solid var(--text-muted);
  transform: rotate(45deg);
  transition: transform var(--dur-2) var(--ease-out);
  margin-bottom: 3px;
  flex: none;
}
.gamecard[open] .gamecard__chev { transform: rotate(-135deg); margin-bottom: -3px; }
.gamecard[open] .gamecard__name { color: var(--accent-text); }

.gamecard__panel { padding: 0 6px 24px; }
.gamecard[open] .gamecard__panel { animation: reveal-in var(--dur-3) var(--ease-out) both; }
.gc-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  padding: 22px 24px;
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-lg);
  background: var(--bg-panel);
}
.gc-col__h {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.gc-col__h--now { color: var(--accent-text); }
.gc-col__h--soon { color: var(--warn); }
.gc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.gc-list li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--text-secondary);
}
.gc-list li::before {
  flex: none;
  margin-top: 1px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
}
.gc-list--now li::before { content: '✓'; color: var(--accent); }
.gc-list--soon li { color: var(--text-muted); }
.gc-list--soon li::before { content: '→'; color: var(--warn); font-weight: 400; }

.gc-cta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}
.gc-cta__note {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-left: auto;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  color: var(--text-muted);
}
.btn:disabled:hover {
  border-color: var(--border-strong);
  background: var(--bg-elevated);
  box-shadow: none;
}

.pricing__note {
  margin-top: 24px;
  max-width: 80ch;
  font-size: 0.9rem;
  line-height: 1.62;
  color: var(--text-muted);
}
.pricing__note a { color: var(--accent-text); }

@media (max-width: 680px) {
  .gc-cols { grid-template-columns: 1fr; gap: 22px; }
  .gc-cta__note { margin-left: 0; }
}

/* ================================================================== */
/* Approach                                                           */
/* ================================================================== */
.approach {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1px;
  background: var(--border-faint);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
}
.approach__cell {
  background: var(--bg-panel);
  padding: 24px 22px 26px;
}
.approach__num {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--accent-text);
}
.approach__cell h3 {
  margin-top: 14px;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.approach__cell p {
  margin-top: 9px;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text-muted);
}

/* ================================================================== */
/* FAQ                                                                */
/* ================================================================== */
.faq { max-width: 860px; }
.faq details {
  border-top: 1px solid var(--border);
}
.faq details:last-of-type { border-bottom: 1px solid var(--border); }
.faq summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 4px;
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  transition: color var(--dur-2) var(--ease-out);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { color: var(--accent-text); }
.faq__chev {
  flex: none;
  width: 11px; height: 11px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform var(--dur-2) var(--ease-out);
  opacity: 0.7;
  margin-bottom: 3px;
}
.faq details[open] .faq__chev { transform: rotate(-135deg); margin-bottom: -3px; }
.faq__answer {
  padding: 0 4px 22px;
  max-width: 74ch;
  color: var(--text-secondary);
  font-size: 0.98rem;
  line-height: 1.68;
}
.faq__answer p + p { margin-top: 12px; }
.faq details[open] .faq__answer { animation: reveal-in var(--dur-3) var(--ease-out) both; }

/* ================================================================== */
/* Contact                                                            */
/* ================================================================== */
.contact {
  position: relative;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  padding: 40px;
  background:
    radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--accent) 8%, transparent), transparent 60%),
    linear-gradient(180deg, var(--bg-elevated), var(--bg-panel));
  overflow: hidden;
}
.contact h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  max-width: 20ch;
}
.contact p {
  margin-top: 14px;
  max-width: 56ch;
  color: var(--text-secondary);
  line-height: 1.62;
}
.contact__links {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.clink {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 13px 18px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg-inset);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    border-color var(--dur-2) var(--ease-out),
    background-color var(--dur-2) var(--ease-out),
    transform var(--dur-1) var(--ease-out);
}
.clink[data-copied='1'] { border-color: color-mix(in srgb, var(--positive) 60%, transparent); }
.clink[data-copied='1'] .clink__k { color: var(--positive); }
.clink:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: var(--bg-hover);
  transform: translateY(-2px);
}
.clink__icon {
  width: 30px; height: 30px; flex: none;
  display: grid; place-items: center;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--accent-text);
}
.clink__icon svg { width: 16px; height: 16px; }
.clink__meta { display: flex; flex-direction: column; line-height: 1.3; }
.clink__k {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.clink__v { font-size: 0.98rem; font-weight: 500; color: var(--text-primary); }

/* ================================================================== */
/* Footer                                                             */
/* ================================================================== */
.foot {
  border-top: 1px solid var(--border-faint);
  padding: 34px 0 48px;
}
.foot__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--text-faint);
}
.foot__inner a { color: var(--text-muted); }
.foot__inner a:hover { color: var(--text-secondary); }
.foot__links { display: flex; gap: 20px; flex-wrap: wrap; align-items: center; }
.foot__copy {
  font-family: inherit;
  font-size: inherit;
  letter-spacing: inherit;
  color: var(--text-muted);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: color var(--dur-2) var(--ease-out);
}
.foot__copy:hover { color: var(--text-secondary); }
.foot__copy[data-copied='1'] { color: var(--positive); }

/* ================================================================== */
/* Load reveal — never gates visibility (worst case: dimmed + 6px low) */
/* ================================================================== */
@keyframes reveal-in {
  from { opacity: 0.5; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
.reveal { animation: reveal-in var(--dur-3) var(--ease-out) both; }
.hero__inner > * { animation: reveal-in 520ms var(--ease-out) both; }
.hero__eyebrow { animation-delay: 40ms; }
.hero h1 { animation-delay: 90ms; }
.hero__sub { animation-delay: 160ms; }
.hero__cta { animation-delay: 230ms; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.001ms !important;
  }
  .trace__path { stroke-dashoffset: 0; }
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
  .wrap { padding-inline: 20px; }
  .hero { padding-top: 64px; }
  .contact { padding: 28px 22px; }
  .game { padding: 18px; }
}
