/* ============================================================
   MIYUX — Design tokens
   Ink-navy control deck, four category accents that carry real
   meaning across the site (music / growth / combat / social).
   ============================================================ */
:root {
  --ink: #0a0d15;
  --ink-2: #0f1420;
  --panel: #141a29;
  --panel-2: #1b2336;
  --line: #262f45;
  --paper: #edf0f7;
  --muted: #8e96ac;
  --muted-2: #626b83;

  --amber: #f2a93b;   /* music / energy */
  --amber-dim: #6b5427;
  --teal: #33c2a0;    /* garden / growth */
  --teal-dim: #205a4d;
  --rose: #ef6a82;    /* combat / rpg */
  --rose-dim: #5c2b36;
  --lilac: #9c8cf2;   /* social / family */
  --lilac-dim: #3c3564;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 20px 50px -20px rgba(0,0,0,0.6);

  --font-display: "Bricolage Grotesque", "Segoe UI", sans-serif;
  --font-body: "Inter", "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(60rem 40rem at 12% -10%, rgba(242,169,59,0.08), transparent 60%),
    radial-gradient(50rem 36rem at 100% 0%, rgba(156,140,242,0.07), transparent 55%),
    radial-gradient(46rem 40rem at 50% 120%, rgba(51,194,160,0.06), transparent 60%);
}

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--paper);
}

p { margin: 0; color: var(--muted); }

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 28px;
  position: relative;
  z-index: 1;
}

/* ---------------- Nav ---------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(10,13,21,0.78);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}
.brand-mark {
  width: 30px; height: 30px;
  border-radius: 9px;
  background: linear-gradient(145deg, var(--amber), var(--rose));
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  flex-shrink: 0;
}
.nav-links {
  display: flex;
  gap: 4px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
}
.nav-links a {
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  transition: color .2s, background .2s;
}
.nav-links a:hover { color: var(--paper); }
.nav-links a.active { background: var(--panel-2); color: var(--paper); }
.nav-cta {
  font-size: 0.85rem;
  font-weight: 700;
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--amber);
  color: #241a05;
  white-space: nowrap;
}
.nav-toggle { display: none; }

@media (max-width: 760px) {
  .nav-links { display: none; }
  .nav-toggle {
    display: grid; place-items: center;
    width: 38px; height: 38px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--paper);
  }
}

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.92rem;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn-amber { background: var(--amber); color: #241a05; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--paper); }
.btn-ghost:hover { border-color: var(--muted-2); }

/* ---------------- Eyebrow / tags ---------------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber);
  padding: 6px 12px;
  border: 1px solid var(--amber-dim);
  border-radius: 999px;
  background: rgba(242,169,59,0.06);
}
.eyebrow.teal { color: var(--teal); border-color: var(--teal-dim); background: rgba(51,194,160,0.06); }
.eyebrow.rose { color: var(--rose); border-color: var(--rose-dim); background: rgba(239,106,130,0.06); }
.eyebrow.lilac { color: var(--lilac); border-color: var(--lilac-dim); background: rgba(156,140,242,0.06); }

/* ---------------- Section scaffolding ---------------- */
section { position: relative; z-index: 1; padding: 96px 0; }
.section-head { max-width: 640px; margin-bottom: 48px; }
.section-head h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); margin-top: 14px; }
.section-head p { margin-top: 14px; font-size: 1.05rem; }

/* ================================================================
   Command console — the site's signature element. Every /command
   is shown the way it actually appears in Telegram: an inline
   keyboard button. Grouped into "keyboard grids" like the real UI.
   ================================================================ */
.deck {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 22px;
}
.deck-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 8px 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}
.deck-head h3 { font-size: 1.3rem; }
.deck-head .count { font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted-2); }
.deck-desc { padding: 0 8px 18px; margin-top: -8px; }

.keyboard { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 640px) { .keyboard { grid-template-columns: 1fr; } }

.key {
  display: block;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  transition: transform .14s ease, border-color .14s ease, background .14s ease;
}
.key:hover { transform: translateY(-2px); border-color: var(--muted-2); }
.key-cmd {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--paper);
  display: block;
}
.key-role {
  font-size: 0.83rem;
  color: var(--muted);
  margin-top: 4px;
  display: block;
}
.key.amber .key-cmd { color: var(--amber); }
.key.teal .key-cmd { color: var(--teal); }
.key.rose .key-cmd { color: var(--rose); }
.key.lilac .key-cmd { color: var(--lilac); }

/* ---------------- Footer ---------------- */
footer {
  border-top: 1px solid var(--line);
  padding: 48px 0 36px;
  position: relative; z-index: 1;
}
.footer-row {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 16px;
}
.footer-links { display: flex; gap: 24px; font-size: 0.86rem; color: var(--muted); }
.footer-links a:hover { color: var(--paper); }
.foot-note { font-size: 0.8rem; color: var(--muted-2); margin-top: 20px; font-family: var(--font-mono); }

/* ---------------- Reveal-on-scroll ---------------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: translateY(0); }

/* ================================================================
   Hero (home page)
   ================================================================ */
.hero { padding: 84px 0 60px; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }

.hero h1 {
  font-size: clamp(2.6rem, 5.2vw, 4rem);
  line-height: 1.04;
  margin-top: 18px;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(100deg, var(--amber), var(--rose) 60%, var(--lilac));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p.lede {
  margin-top: 22px;
  font-size: 1.14rem;
  max-width: 46ch;
  color: var(--muted);
}
.hero-actions { display: flex; gap: 12px; margin-top: 32px; flex-wrap: wrap; }

/* Phone mockup */
.phone {
  justify-self: center;
  width: min(340px, 100%);
  border-radius: 34px;
  padding: 12px;
  background: linear-gradient(160deg, #1a2135, #0d111c);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.phone-screen {
  background: var(--ink-2);
  border-radius: 24px;
  overflow: hidden;
  min-height: 460px;
  display: flex;
  flex-direction: column;
}
.phone-bar {
  padding: 16px 18px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}
.phone-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(145deg, var(--amber), var(--rose));
  flex-shrink: 0;
}
.phone-bar b { font-size: 0.92rem; }
.phone-bar span { display: block; font-size: 0.72rem; color: var(--teal); }
.phone-body { padding: 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.bubble {
  max-width: 82%;
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 0.86rem;
}
.bubble.in { background: var(--panel); align-self: flex-start; border-bottom-left-radius: 4px; color: var(--paper); }
.bubble.out {
  background: linear-gradient(135deg, var(--amber-dim), #4a3a1c);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  font-family: var(--font-mono);
  color: #ffd689;
}
.bubble.out .cursor { display: inline-block; width: 6px; height: 1em; background: #ffd689; margin-left: 2px; vertical-align: middle; animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }
.bubble.reply { background: var(--panel-2); align-self: flex-start; border-bottom-left-radius: 4px; opacity: 0; transform: translateY(6px); transition: opacity .3s, transform .3s; }
.bubble.reply.pop { opacity: 1; transform: translateY(0); }
.bubble.reply .tag { display: block; font-family: var(--font-mono); font-size: 0.68rem; color: var(--teal); margin-bottom: 3px; }

/* Two worlds split */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
@media (max-width: 760px) { .split { grid-template-columns: 1fr; } }
.split-card {
  border-radius: 22px;
  padding: 34px;
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}
.split-card.music { background: linear-gradient(155deg, rgba(242,169,59,0.13), var(--panel) 55%); }
.split-card.games { background: linear-gradient(155deg, rgba(156,140,242,0.13), var(--panel) 55%); }
.split-card h3 { font-size: 1.7rem; margin-top: 12px; }
.split-card p { margin-top: 12px; }
.split-card .btn { margin-top: 24px; }
.split-icon { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: .1em; text-transform: uppercase; }
.split-card.music .split-icon { color: var(--amber); }
.split-card.games .split-icon { color: var(--lilac); }

/* Pillar strip */
.pillars { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
@media (max-width: 900px) { .pillars { grid-template-columns: repeat(2, 1fr); } }
.pillar {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px 16px;
  text-align: center;
}
.pillar .glyph { font-size: 1.5rem; }
.pillar b { display: block; margin-top: 10px; font-size: 0.86rem; font-family: var(--font-display); }
.pillar span { display: block; margin-top: 4px; font-size: 0.74rem; color: var(--muted-2); }

/* Stat bar */
.statbar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
}
@media (max-width: 700px) { .statbar { grid-template-columns: repeat(2, 1fr); } }
.stat { background: var(--panel); padding: 26px 22px; }
.stat b { display: block; font-family: var(--font-display); font-size: 2rem; }
.stat span { font-size: 0.82rem; margin-top: 4px; display: block; }

/* Feature row (alternating) */
.feature-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  padding: 48px 0;
  border-top: 1px solid var(--line);
}
.feature-row:last-child { border-bottom: 1px solid var(--line); }
@media (max-width: 800px) { .feature-row { grid-template-columns: 1fr; gap: 22px; } }
.feature-row .visual {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 26px;
}
.mini-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mini-grid div {
  aspect-ratio: 1;
  border-radius: 8px;
  background: var(--panel-2);
  display: grid; place-items: center;
  font-size: 1.1rem;
  border: 1px solid var(--line);
}

/* ================================================================
   Reference-page layout (games.html / music.html)
   ================================================================ */
.ref-header { padding: 56px 0 40px; border-bottom: 1px solid var(--line); }
.ref-header h1 { font-size: clamp(2.1rem, 4vw, 3rem); margin-top: 14px; }
.ref-header p { margin-top: 14px; font-size: 1.05rem; max-width: 60ch; }

.ref-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 48px;
  align-items: start;
  padding: 56px 0 100px;
}
@media (max-width: 900px) { .ref-layout { grid-template-columns: 1fr; } }

.toc {
  position: sticky;
  top: 90px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
@media (max-width: 900px) {
  .toc { position: static; flex-direction: row; overflow-x: auto; gap: 8px; padding-bottom: 10px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
}
.toc a {
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  border-left: 2px solid transparent;
}
@media (max-width: 900px) { .toc a { border-left: none; border-bottom: 2px solid transparent; background: var(--panel); border-radius: 999px; } }
.toc a:hover { color: var(--paper); }
.toc a.current { color: var(--paper); border-left-color: var(--amber); background: var(--panel); }

.ref-section { scroll-margin-top: 90px; margin-bottom: 64px; }
.ref-section:last-child { margin-bottom: 0; }
.ref-section-head { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.ref-section-head .glyph2 {
  width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center; font-size: 1.3rem;
  border: 1px solid var(--line); flex-shrink: 0;
}
.ref-section-head h2 { font-size: 1.5rem; margin: 0; }
.ref-section > p.lede2 { margin: 10px 0 22px; max-width: 68ch; }

