/* ============================================================
   YKYMF STUDIO — shared design system
   "Games without the crap."
   One stylesheet powering the hub + every game page.
   Per-game accent is set by adding a theme class to <body>:
     .theme-studio | .theme-saltroad | .theme-matchforge | .theme-starlift
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  /* Canvas */
  --bg:        #0a0b10;
  --bg-2:      #0e0f16;
  --panel:     #13141d;
  --panel-2:   #171826;
  --line:      rgba(255, 255, 255, 0.09);
  --line-2:    rgba(255, 255, 255, 0.16);

  /* Ink */
  --ink:       #edeef4;
  --ink-2:     #b7bacb;
  --ink-3:     #7e8296;

  /* Studio accent (default). Games override --accent* below. */
  --accent:      #c6ff3d;   /* acid lime — honest, anti-corporate */
  --accent-2:    #9ce015;
  --accent-ink:  #0a0b10;   /* text that sits on the accent */
  --accent-soft: rgba(198, 255, 61, 0.14);
  --accent-glow: rgba(198, 255, 61, 0.30);

  /* Semantic */
  --good:  #43e08a;
  --bad:   #ff5a7a;

  /* Type */
  --font-display: "Space Grotesk", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-body:    "Space Grotesk", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Rhythm */
  --wrap: 1120px;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-pill: 999px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 10px 26px rgba(0, 0, 0, 0.35);
}

/* Per-game accents */
.theme-saltroad {
  --accent:      #ffc23a;   /* doubloon gold */
  --accent-2:    #ff9d2e;
  --accent-ink:  #241704;
  --accent-soft: rgba(255, 194, 58, 0.14);
  --accent-glow: rgba(255, 194, 58, 0.30);
}
.theme-matchforge {
  --accent:      #ff3d81;   /* forge magenta */
  --accent-2:    #ff7ab0;
  --accent-ink:  #2a0416;
  --accent-soft: rgba(255, 61, 129, 0.14);
  --accent-glow: rgba(255, 61, 129, 0.32);
}
.theme-starlift {
  --accent:      #5bc8ff;   /* ice blue */
  --accent-2:    #8fe0ff;
  --accent-ink:  #03151f;
  --accent-soft: rgba(91, 200, 255, 0.14);
  --accent-glow: rgba(91, 200, 255, 0.30);
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Ambient studio backdrop: faint accent auroras + a monospace grid nod to the reveal */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(60% 50% at 82% -6%, var(--accent-soft), transparent 60%),
    radial-gradient(46% 40% at 6% 8%, rgba(255,255,255,0.05), transparent 60%),
    linear-gradient(180deg, var(--bg-2), var(--bg) 42%);
  pointer-events: none;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255,255,255,0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.022) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(120% 90% at 50% 0%, #000 30%, transparent 78%);
  pointer-events: none;
}

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

/* ---------- Layout ---------- */
.wrap { width: min(var(--wrap), calc(100% - 2.5rem)); margin-inline: auto; }
.section { padding: clamp(3rem, 7vw, 6rem) 0; }
.section-tight { padding: clamp(2rem, 4vw, 3rem) 0; }
.stack > * + * { margin-top: 1rem; }

/* ---------- Type ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.6ch;
}
.eyebrow::before {
  content: "";
  width: 1.6rem; height: 1px;
  background: currentColor;
  opacity: 0.7;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
  color: #fff;
}
h1 { font-size: clamp(2.6rem, 6.4vw, 5rem); }
h2 { font-size: clamp(2rem, 4.4vw, 3.2rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.45rem); letter-spacing: -0.01em; }
.lead { font-size: clamp(1.08rem, 1.7vw, 1.35rem); color: var(--ink-2); max-width: 60ch; }
p { color: var(--ink-2); margin: 0 0 1rem; }
.muted { color: var(--ink-3); }
.balance { text-wrap: balance; }
strong { color: var(--ink); font-weight: 700; }
.accent-text { color: var(--accent); }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; height: 68px;
}
.brand { display: inline-flex; align-items: baseline; gap: 0.6ch; }
.brand-mark {
  font-family: var(--font-display);
  font-weight: 700; font-size: 1.22rem; letter-spacing: 0.02em; color: #fff;
}
.brand-mark b { color: var(--accent); font-weight: 700; }
.brand-tag {
  font-family: var(--font-mono);
  font-size: 0.6rem; letter-spacing: 0.26em; text-transform: uppercase;
  color: var(--ink-3);
}
.nav { display: flex; align-items: center; gap: 0.35rem; }
.nav a {
  font-size: 0.9rem; font-weight: 500; color: var(--ink-2);
  padding: 0.5rem 0.85rem; border-radius: var(--radius-pill);
  border: 1px solid transparent; transition: color .18s, border-color .18s, background .18s;
}
.nav a:hover { color: #fff; }
.nav a.is-active { color: #fff; border-color: var(--line-2); background: rgba(255,255,255,0.04); }
/* Discreet admin entry point — deliberately low-key. */
.nav a.nav-admin { color: var(--ink-3); font-size: 0.82rem; }
.nav a.nav-admin:hover { color: #fff; }
.nav a.nav-cta {
  color: var(--accent-ink); background: var(--accent);
  font-weight: 700; border-color: var(--accent);
}
.nav a.nav-cta:hover { background: var(--accent-2); border-color: var(--accent-2); color: var(--accent-ink); }
.nav-toggle {
  display: none; background: none; border: 1px solid var(--line-2);
  color: var(--ink); width: 42px; height: 42px; border-radius: 12px; cursor: pointer;
  font-size: 1.1rem; align-items: center; justify-content: center;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.6ch;
  font-family: var(--font-body); font-weight: 700; font-size: 0.98rem;
  padding: 0.85rem 1.4rem; border-radius: var(--radius-pill);
  border: 1px solid transparent; cursor: pointer;
  transition: transform .12s ease, background .18s, border-color .18s, color .18s;
  text-align: center; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 30px var(--accent-glow); }
.btn-primary:hover { background: var(--accent-2); }
.btn-ghost { border-color: var(--line-2); color: var(--ink); background: rgba(255,255,255,0.02); }
.btn-ghost:hover { border-color: var(--accent); color: #fff; }
.btn-arrow::after { content: "→"; font-family: var(--font-mono); transition: transform .18s; }
.btn-arrow:hover::after { transform: translateX(3px); }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.8rem; }

/* ---------- Cards / grids ---------- */
.grid { display: grid; gap: 1.1rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

.card {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: transform .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-3px); border-color: var(--line-2); }
.card h3 { color: #fff; }
.card p:last-child { margin-bottom: 0; }
.card .ic {
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--accent); display: block; margin-bottom: 0.8rem;
}

/* Panel = larger surface */
.panel {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.4rem, 3vw, 2.4rem);
  box-shadow: var(--shadow-sm);
}

/* Pills / chips */
.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip {
  font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.02em;
  padding: 0.35rem 0.8rem; border-radius: var(--radius-pill);
  border: 1px solid var(--line-2); color: var(--ink-2);
  background: rgba(255,255,255,0.02);
}

/* ---------- Hero ---------- */
.hero { padding: clamp(3rem, 8vw, 6.5rem) 0 clamp(2.5rem, 5vw, 4rem); }
.hero-grid { display: grid; gap: clamp(1.5rem, 4vw, 3rem); align-items: center; }
@media (min-width: 900px) { .hero-grid.split { grid-template-columns: 1.05fr 0.95fr; } }
.hero h1 { margin-bottom: 1rem; }
.hero .lead { margin-bottom: 1.6rem; }
.hero-note {
  font-family: var(--font-mono); font-size: 0.8rem; color: var(--ink-3);
  margin-top: 1.3rem; letter-spacing: 0.02em;
}

/* Device / art frame for screenshots */
.frame {
  border: 1px solid var(--line-2);
  border-radius: 22px;
  background: linear-gradient(180deg, var(--panel-2), var(--bg-2));
  padding: 0.6rem;
  box-shadow: var(--shadow);
}
.frame img { border-radius: 16px; width: 100%; height: auto; }
.shots { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.shot figcaption {
  font-family: var(--font-mono); font-size: 0.76rem; color: var(--ink-3);
  text-align: center; margin-top: 0.7rem;
}

/* ---------- The No-Crap Pledge (brand spine) ---------- */
.pledge { border-radius: var(--radius); }
.pledge-head { text-align: center; margin-bottom: 1.8rem; }
.pledge-grid { display: grid; gap: 0.7rem; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.pledge-item {
  display: flex; align-items: center; gap: 0.8rem;
  padding: 0.85rem 1rem; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: rgba(255,255,255,0.015);
  font-size: 0.96rem;
}
.pledge-item .mark {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; font-family: var(--font-mono);
  font-weight: 700; font-size: 0.9rem;
}
.pledge-no .mark  { background: rgba(255,90,122,0.14); color: var(--bad); border: 1px solid rgba(255,90,122,0.35); }
.pledge-yes .mark { background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent); }
.pledge-no .txt   { color: var(--ink-2); text-decoration: line-through; text-decoration-color: rgba(255,90,122,0.6); text-decoration-thickness: 2px; }
.pledge-yes .txt  { color: var(--ink); font-weight: 600; }

/* Compact pledge strip for game pages */
.pledge-strip {
  display: flex; flex-wrap: wrap; gap: 0.5rem 0.7rem; align-items: center;
  justify-content: center;
}
.pledge-strip .tag {
  font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.02em;
  padding: 0.4rem 0.75rem; border-radius: var(--radius-pill);
  border: 1px dashed var(--line-2); color: var(--ink-2);
}
.pledge-strip .tag.no::before  { content: "✕ "; color: var(--bad); }
.pledge-strip .tag.yes { border-style: solid; border-color: var(--accent); color: var(--ink); }
.pledge-strip .tag.yes::before { content: "✓ "; color: var(--accent); }

/* ---------- Games grid (hub) ---------- */
.game-card {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 0.9rem;
  border-radius: var(--radius); border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  padding: 1.6rem; min-height: 240px;
  transition: transform .2s ease, border-color .2s ease;
}
.game-card::after {
  content: ""; position: absolute; inset: -1px -1px auto -1px; height: 4px;
  background: linear-gradient(90deg, var(--gc-accent, var(--accent)), transparent 70%);
}
.game-card:hover { transform: translateY(-4px); border-color: var(--line-2); }
.game-card .kind {
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--gc-accent, var(--accent));
}
.game-card h3 { font-size: 1.7rem; }
.game-card .status {
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-3);
  border: 1px solid var(--line-2); border-radius: var(--radius-pill);
  padding: 0.2rem 0.6rem; align-self: flex-start;
}
.game-card .go { margin-top: auto; color: var(--gc-accent, var(--accent)); font-weight: 700; font-family: var(--font-mono); font-size: 0.85rem; }
.game-card .go::after { content: " →"; }
.gc-saltroad   { --gc-accent: #ffc23a; }
.gc-matchforge { --gc-accent: #ff3d81; }
.gc-starlift   { --gc-accent: #5bc8ff; }
.gc-pasgeti    { --gc-accent: #c6ff3d; }

/* ---------- Steps / numbered lists ---------- */
.steps { display: grid; gap: 1rem; padding: 0; margin: 0; list-style: none; counter-reset: step; }
.steps li {
  display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: start;
  padding-bottom: 1rem; border-bottom: 1px solid var(--line);
}
.steps li:last-child { border-bottom: 0; padding-bottom: 0; }
.steps li::before {
  counter-increment: step; content: counter(step, decimal-leading-zero);
  font-family: var(--font-mono); font-size: 0.85rem; color: var(--accent);
  border: 1px solid var(--accent); border-radius: 8px; padding: 0.15rem 0.5rem;
}
.steps li strong { display: block; color: #fff; font-size: 1.05rem; }

/* ---------- FAQ ---------- */
.faq details {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 0.4rem 1.1rem; background: rgba(255,255,255,0.015); margin-bottom: 0.7rem;
}
.faq summary {
  cursor: pointer; list-style: none; padding: 0.7rem 0;
  font-weight: 600; color: #fff; display: flex; justify-content: space-between; gap: 1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--font-mono); color: var(--accent); }
.faq details[open] summary::after { content: "–"; }
.faq details[open] summary { border-bottom: 1px solid var(--line); }
.faq p { padding-top: 0.8rem; margin-bottom: 0.8rem; }

/* ---------- CTA band ---------- */
.cta-band { text-align: center; border-radius: var(--radius); position: relative; overflow: hidden; }
.cta-band .btn-row { justify-content: center; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: clamp(2.5rem, 5vw, 4rem) 0 2.5rem; margin-top: 2rem; }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: 1.4fr 1fr 1fr; }
.footer-grid .brand-mark { font-size: 1.4rem; }
.footer-col h4 {
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--ink-3); margin-bottom: 0.9rem;
}
.footer-col a { display: block; color: var(--ink-2); padding: 0.28rem 0; transition: color .15s; }
.footer-col a:hover { color: var(--accent); }
.footer-contact { font-size: 0.92rem; color: var(--ink-2); }
.footer-contact a { color: var(--ink); border-bottom: 1px dashed var(--line-2); }
.footer-bottom {
  display: flex; flex-wrap: wrap; gap: 0.8rem; justify-content: space-between;
  margin-top: 2.5rem; padding-top: 1.6rem; border-top: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 0.78rem; color: var(--ink-3);
}
.footer-pledge { color: var(--ink-3); }
.footer-pledge b { color: var(--accent); font-weight: 600; }

/* ---------- Policy / legal / support ---------- */
.policy { max-width: 78ch; }
.policy h2 { font-size: clamp(1.3rem, 2.4vw, 1.7rem); margin-top: 2.2rem; }
.policy h3 { margin-top: 1.6rem; }
.policy p, .policy li { color: var(--ink-2); }
.policy ul { padding-left: 1.2rem; }
.policy li { margin-bottom: 0.5rem; }
.policy a { color: var(--accent); border-bottom: 1px solid var(--accent-soft); }
.contact-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.7rem; }
.contact-list li {
  display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; padding: 0.9rem 1.1rem;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: rgba(255,255,255,0.015);
}
.contact-list .label { font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); min-width: 8rem; }
.contact-list a { color: var(--accent); }

/* ---------- Motion ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .card, .game-card, .btn { transition: none; }
}
/* No-JS safety: if scripting is unavailable, never hide content. */
@media (scripting: none) {
  .reveal { opacity: 1 !important; transform: none !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand-col { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .nav { display: none; }
  .nav-toggle { display: inline-flex; }
  .site-header.open .nav {
    display: flex; position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0.3rem;
    padding: 1rem 1.25rem 1.4rem; background: var(--bg-2);
    border-bottom: 1px solid var(--line);
  }
  .site-header.open .nav a { padding: 0.75rem 0.9rem; }
  .footer-grid { grid-template-columns: 1fr; }
}
