/* ─── RESET ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

/* ─── TOKENS ─────────────────────────────────── */
:root {
  --orange:  #f97316;
  --orange2: #ea580c;
  --bg:      #050505;
  --bg2:     #0d0d0d;
  --bg3:     #141414;
  --bg4:     #1c1c1c;
  --border:  #1f1f1f;
  --border2: #2a2a2a;
  --text:    #ededed;
  --muted:   #4a4a4a;
  --muted2:  #333;
  --green:   #22c55e;
  --mono:    'JetBrains Mono', monospace;
  --sans:    'Space Grotesk', sans-serif;
}

[data-theme="light"] {
  --bg:      #fafafa;
  --bg2:     #f4f4f4;
  --bg3:     #ebebeb;
  --bg4:     #e0e0e0;
  --border:  #e0e0e0;
  --border2: #d0d0d0;
  --text:    #0a0a0a;
  --muted:   #aaaaaa;
  --muted2:  #cccccc;
}

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
.container { max-width: 1080px; margin: 0 auto; padding: 0 2rem; }

/* ─── NAV ─────────────────────────────────────── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 2.5rem; height: 56px;
  background: rgba(5,5,5,0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

[data-theme="light"] nav { background: rgba(250,250,250,0.85); }

.nav-brand { display: flex; align-items: center; gap: 2px; font-family: var(--mono); font-weight: 700; }
.brand-mark {
  background: var(--orange); color: #000;
  padding: 2px 6px; border-radius: 4px; font-size: 0.8rem; letter-spacing: 1px;
}
.brand-name { font-size: 0.9rem; color: var(--text); }

.nav-center { display: flex; gap: 2rem; }
.nav-center a {
  font-size: 0.8rem; color: var(--muted); font-family: var(--mono);
  transition: color 0.2s; letter-spacing: 0.5px;
}
.nav-center a:hover { color: var(--text); }

.nav-right { display: flex; align-items: center; gap: 1rem; }
.nav-version {
  font-family: var(--mono); font-size: 0.68rem; color: var(--muted);
  background: var(--bg3); border: 1px solid var(--border); border-radius: 4px; padding: 2px 8px;
}
.nav-gh {
  display: flex; align-items: center; gap: 6px; font-size: 0.78rem;
  color: var(--muted); transition: color 0.2s; font-family: var(--mono);
}
.nav-gh:hover { color: var(--text); }
.nav-theme {
  background: var(--bg3); border: 1px solid var(--border); border-radius: 6px;
  padding: 6px; cursor: pointer; color: var(--text); display: flex; align-items: center;
  transition: border-color 0.2s;
}
.nav-theme:hover { border-color: var(--orange); }
.sun-icon, .moon-icon { display: block; }
[data-theme="dark"]  .sun-icon  { display: none; }
[data-theme="dark"]  .moon-icon { display: block; }
[data-theme="light"] .moon-icon { display: none; }
[data-theme="light"] .sun-icon  { display: block; }

/* ─── HERO ────────────────────────────────────── */
.hero {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding-top: 56px;
  position: relative;
  overflow: hidden;
}

.hero-noise {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  opacity: 0.4;
}

.hero-left {
  padding: 5rem 4rem 5rem 3rem;
  display: flex; flex-direction: column; justify-content: center;
  border-right: 1px solid var(--border);
  position: relative; z-index: 1;
}

.hero-eyebrow {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 0.72rem; color: var(--muted);
  margin-bottom: 2rem; letter-spacing: 1px;
}

.eyebrow-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--orange);
  box-shadow: 0 0 8px var(--orange);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px var(--orange); }
  50% { opacity: 0.5; box-shadow: 0 0 20px var(--orange); }
}

.hero-headline {
  font-size: clamp(3rem, 6vw, 5.5rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -3px;
  margin-bottom: 1.8rem;
}

.line-1 {
  display: block;
  color: var(--orange);
  font-style: italic;
}

.line-2 { display: block; }

.hero-desc {
  font-size: 0.9rem; color: var(--muted); line-height: 1.8;
  margin-bottom: 2.5rem; max-width: 420px;
}

.hero-desc code {
  font-family: var(--mono); font-size: 0.82rem;
  background: var(--bg3); border: 1px solid var(--border);
  padding: 1px 6px; border-radius: 4px; color: var(--orange);
}

.hero-actions { display: flex; gap: 12px; margin-bottom: 3rem; flex-wrap: wrap; }

.cta-primary {
  font-family: var(--mono); font-size: 0.82rem; font-weight: 700;
  background: var(--orange); color: #000;
  padding: 0.7rem 1.5rem; border-radius: 6px;
  letter-spacing: 0.5px; transition: opacity 0.15s, transform 0.1s;
  display: inline-block;
}
.cta-primary:hover { opacity: 0.85; transform: translateY(-1px); }

.cta-ghost {
  font-family: var(--mono); font-size: 0.82rem;
  color: var(--muted); border: 1px solid var(--border2);
  padding: 0.7rem 1.5rem; border-radius: 6px;
  transition: color 0.15s, border-color 0.15s;
  display: inline-block;
}
.cta-ghost:hover { color: var(--text); border-color: var(--muted); }

.hero-stats { display: flex; align-items: center; gap: 1.5rem; }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat-num {
  font-family: var(--mono); font-size: 1.4rem; font-weight: 700;
  color: var(--text); line-height: 1;
}
.stat-label { font-size: 0.68rem; color: var(--muted); letter-spacing: 1px; }
.stat-divider { width: 1px; height: 32px; background: var(--border2); }

/* ─── EDITOR ─────────────────────────────────── */
.hero-right {
  background: var(--bg2);
  display: flex; align-items: center; justify-content: center;
  padding: 4rem 3rem; position: relative; z-index: 1;
}

.editor {
  width: 100%; max-width: 520px;
  border: 1px solid var(--border2);
  border-radius: 12px; overflow: hidden;
  box-shadow: 0 0 0 1px var(--border), 0 40px 80px rgba(0,0,0,0.6);
}

.editor-titlebar {
  display: flex; align-items: center; gap: 10px;
  padding: 0.7rem 1rem; background: var(--bg3);
  border-bottom: 1px solid var(--border);
}
.editor-dots { display: flex; gap: 6px; }
.ed-dot { width: 12px; height: 12px; border-radius: 50%; }
.ed-dot.red    { background: #ff5f57; }
.ed-dot.yellow { background: #febc2e; }
.ed-dot.green  { background: #28c840; }
.editor-filename {
  font-family: var(--mono); font-size: 0.72rem; color: var(--muted);
  margin-left: 4px; flex: 1;
}
.editor-lang {
  font-family: var(--mono); font-size: 0.62rem; color: var(--muted2);
  background: var(--bg4); padding: 2px 8px; border-radius: 4px;
}

.editor-body {
  display: flex; background: var(--bg2);
  padding: 1.2rem 0; min-height: 220px;
}

.editor-lines {
  display: flex; flex-direction: column; gap: 2px;
  padding: 0 1rem; user-select: none; min-width: 40px;
}
.editor-lines span {
  font-family: var(--mono); font-size: 0.72rem;
  color: var(--muted2); text-align: right; line-height: 1.7;
}

.editor-code {
  flex: 1; padding-right: 1rem; overflow-x: auto;
}

.code-line {
  font-family: var(--mono); font-size: 0.75rem;
  line-height: 1.7; white-space: nowrap;
}

.ec-comment { color: #444; }
.ec-tag     { color: #60a5fa; }
.ec-attr    { color: #f97316; }
.ec-str     { color: #22c55e; }
.ec-prop    { color: #e879f9; }
.ec-muted   { color: #555; }

.typed-line { background: rgba(249,115,22,0.05); border-left: 2px solid var(--orange); padding-left: 4px; }
.injected-line { background: rgba(232,121,249,0.05); }

#typed-classes { color: #22c55e; }

.editor-preview {
  border-top: 1px solid var(--border);
  padding: 0.8rem 1rem;
  display: flex; align-items: center; gap: 1rem;
  background: var(--bg3);
}
.preview-label {
  font-family: var(--mono); font-size: 0.6rem;
  color: var(--muted); letter-spacing: 2px; flex-shrink: 0;
}
.preview-box {
  font-family: var(--mono); font-size: 0.8rem; font-weight: 700;
  padding: 6px 14px; border-radius: 6px;
  background: #1a1a1a; color: white;
  transition: all 0.4s ease;
}

/* ─── MARQUEE ─────────────────────────────────── */
.marquee-wrap {
  overflow: hidden; border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg2); padding: 0.8rem 0;
}
.marquee {
  display: flex; gap: 2rem; width: max-content;
  animation: marquee 25s linear infinite;
}
.marquee span {
  font-family: var(--mono); font-size: 0.72rem;
  color: var(--muted); white-space: nowrap; letter-spacing: 1px;
}
.marquee .dot { color: var(--orange); }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ─── WHY ─────────────────────────────────────── */
.why-section { padding: 7rem 0; border-bottom: 1px solid var(--border); }

.section-label {
  font-family: var(--mono); font-size: 0.72rem; color: var(--orange);
  letter-spacing: 2px; margin-bottom: 1rem;
}
.section-title {
  font-size: clamp(2rem, 4vw, 3.2rem); font-weight: 700;
  letter-spacing: -1.5px; line-height: 1.1; margin-bottom: 1rem;
}
.section-sub { font-size: 0.85rem; color: var(--muted); line-height: 1.8; margin-bottom: 3rem; }

.why-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1px; background: var(--border); border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden; margin-bottom: 3rem;
}
.why-card {
  background: var(--bg); padding: 2rem;
  transition: background 0.2s;
}
.why-card:hover { background: var(--bg2); }
.why-number {
  font-family: var(--mono); font-size: 2.5rem; font-weight: 700;
  color: var(--border2); line-height: 1; margin-bottom: 1rem;
}
.why-card h3 {
  font-size: 1rem; font-weight: 700; margin-bottom: 0.6rem; letter-spacing: -0.3px;
}
.why-card p { font-size: 0.78rem; color: var(--muted); line-height: 1.8; }

/* diff table */
.diff-table {
  border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
  font-family: var(--mono); font-size: 0.78rem;
}
.diff-header {
  display: grid; grid-template-columns: 1fr 140px 140px;
  padding: 0.7rem 1.5rem; background: var(--bg3);
  border-bottom: 1px solid var(--border); color: var(--muted);
  font-size: 0.68rem; letter-spacing: 1px;
}
.diff-row {
  display: grid; grid-template-columns: 1fr 140px 140px;
  padding: 0.7rem 1.5rem; border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.diff-row:last-child { border-bottom: none; }
.diff-row:hover { background: var(--bg2); }
.diff-row span:first-child { color: var(--muted); }
.col-uv  { color: var(--green); text-align: center; }
.col-tw  { color: var(--muted); text-align: center; }
.col-uv.bad  { color: var(--green); }
.col-tw.bad2 { color: #ef4444; }

/* ─── PLAYGROUND ──────────────────────────────── */
.pg-section { padding: 7rem 0; border-bottom: 1px solid var(--border); background: var(--bg2); }

.pg-layout {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 2rem; align-items: start;
}

.pg-controls { display: flex; flex-direction: column; gap: 1.2rem; }

#pg-input {
  width: 100%; background: var(--bg); border: 1px solid var(--border2);
  border-radius: 8px; padding: 0.75rem 1rem;
  font-family: var(--mono); font-size: 0.82rem; color: var(--text);
  outline: none; transition: border-color 0.2s;
}
#pg-input:focus { border-color: var(--orange); }
#pg-input::placeholder { color: var(--muted); }

.pg-chip-groups { display: flex; flex-direction: column; gap: 0.6rem; }
.chip-group-label {
  font-family: var(--mono); font-size: 0.62rem; color: var(--muted);
  letter-spacing: 2px; text-transform: uppercase;
}
.chip-group { display: flex; flex-wrap: wrap; gap: 5px; }
.chip-group span {
  font-family: var(--mono); font-size: 0.68rem;
  background: var(--bg3); border: 1px solid var(--border2);
  border-radius: 5px; padding: 3px 10px;
  cursor: pointer; color: var(--muted); transition: all 0.15s;
}
.chip-group span:hover { border-color: var(--orange); color: var(--orange); background: rgba(249,115,22,0.06); }

.pg-proof {
  background: var(--bg); border: 1px solid var(--border2);
  border-radius: 8px; padding: 0.8rem 1rem;
}
.proof-label {
  font-family: var(--mono); font-size: 0.62rem; color: var(--orange);
  letter-spacing: 1px; margin-bottom: 0.4rem; display: block;
}
#pg-injected {
  font-family: var(--mono); font-size: 0.72rem; color: var(--muted);
  display: block; word-break: break-all; line-height: 1.6;
}

.pg-preview { display: flex; flex-direction: column; gap: 1rem; }

.pg-canvas {
  position: relative; min-height: 200px;
  background: linear-gradient(135deg, #f97316 0%, #3b82f6 50%, #a855f7 100%);
  border-radius: 12px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.pg-orb { position: absolute; border-radius: 50%; filter: blur(50px); opacity: 0.6; }
.pg-o1 { width: 200px; height: 200px; background: #f97316; top: -60px; left: -60px; }
.pg-o2 { width: 180px; height: 180px; background: #3b82f6; bottom: -50px; right: -50px; }
.pg-o3 { width: 140px; height: 140px; background: #a855f7; top: 30%; left: 30%; }
#pg-box {
  position: relative; z-index: 2;
  padding: 1rem 2rem; border-radius: 8px;
  background: #111; color: white;
  font-family: var(--mono); font-weight: 700;
  transition: all 0.3s; text-align: center;
}

.pg-devtools {
  background: var(--bg); border: 1px solid var(--border2); border-radius: 8px; overflow: hidden;
}
.dt-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 0.5rem 0.8rem; background: var(--bg3); border-bottom: 1px solid var(--border);
}
.dt-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border2); }
.dt-title { font-family: var(--mono); font-size: 0.62rem; color: var(--muted); margin-left: 4px; }
.dt-body { padding: 0.6rem 0.8rem; }
.dt-line { font-family: var(--mono); font-size: 0.7rem; line-height: 1.8; }
.dt-line.indent { padding-left: 1rem; }
.dt-line.indent2 { padding-left: 2rem; }
.dt-tag  { color: #60a5fa; }
.dt-attr { color: #f97316; }
.dt-str  { color: #22c55e; }
.dt-muted { color: var(--muted); }
#dt-css { color: #e879f9; }

/* ─── DOCS ────────────────────────────────────── */
.docs-section { padding: 7rem 0; border-bottom: 1px solid var(--border); }

.install-row { display: flex; gap: 6px; margin: 1.5rem 0 0; }
.install-tab {
  font-family: var(--mono); font-size: 0.75rem;
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: 6px; padding: 0.45rem 1rem;
  color: var(--muted); cursor: pointer; transition: all 0.2s;
}
.install-tab.active { border-color: var(--orange); color: var(--orange); background: rgba(249,115,22,0.06); }

.code-block {
  margin: 1rem 0 2.5rem;
  background: var(--bg2); border: 1px solid var(--border2); border-radius: 10px; overflow: hidden;
}
.code-block.hidden { display: none; }
.cb-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.6rem 1rem; background: var(--bg3); border-bottom: 1px solid var(--border);
  font-family: var(--mono); font-size: 0.68rem; color: var(--muted);
}
.cb-header button {
  background: var(--bg4); border: 1px solid var(--border2); border-radius: 4px;
  padding: 2px 10px; font-family: var(--mono); font-size: 0.65rem;
  color: var(--muted); cursor: pointer; transition: color 0.15s;
}
.cb-header button:hover { color: var(--text); }
.code-block pre { padding: 1.2rem; font-size: 0.78rem; line-height: 1.9; color: var(--muted); white-space: pre-wrap; }

.ref-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
}
.ref-card { background: var(--bg); }
.ref-head {
  padding: 0.7rem 1rem; background: var(--bg2);
  border-bottom: 1px solid var(--border);
  font-family: var(--mono); font-size: 0.72rem; color: var(--orange);
  letter-spacing: 1px;
}
.ref-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 5px 1rem; border-bottom: 1px solid var(--border);
  font-family: var(--mono); font-size: 0.7rem; color: var(--muted);
}
.ref-row:last-child { border-bottom: none; }
.ref-row code { color: #60a5fa; background: var(--bg3); padding: 1px 6px; border-radius: 3px; }
.ref-row.more { color: var(--orange); font-size: 0.65rem; }
.ref-highlight .ref-head { color: #e879f9; }

/* ─── FOOTER ──────────────────────────────────── */
footer { padding: 2rem 0; border-top: 1px solid var(--border); }
.footer-inner {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 1rem;
}
.footer-brand { display: flex; align-items: center; gap: 8px; }
.footer-tag { font-size: 0.75rem; color: var(--muted); font-family: var(--mono); }
.footer-links { display: flex; align-items: center; gap: 1.2rem; font-family: var(--mono); font-size: 0.75rem; color: var(--muted); }
.footer-links a:hover { color: var(--text); }
.version-pill {
  background: var(--bg3); border: 1px solid var(--border2);
  border-radius: 100px; padding: 2px 10px; font-size: 0.65rem; color: var(--muted);
}
.footer-credit { font-family: var(--mono); font-size: 0.72rem; color: var(--muted); }

/* ─── RESPONSIVE ──────────────────────────────── */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; min-height: auto; }
  .hero-left { padding: 4rem 1.5rem 2rem; border-right: none; border-bottom: 1px solid var(--border); }
  .hero-right { padding: 2rem 1.5rem 4rem; }
  nav { padding: 0 1.5rem; }
  .nav-center { display: none; }
  .pg-layout { grid-template-columns: 1fr; }
  .diff-header, .diff-row { grid-template-columns: 1fr 100px 100px; }
}

/* ─── ANIMATIONS ──────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-left > * {
  animation: fadeUp 0.6s ease forwards;
  opacity: 0;
}
.hero-eyebrow   { animation-delay: 0.1s; }
.hero-headline  { animation-delay: 0.2s; }
.hero-desc      { animation-delay: 0.3s; }
.hero-actions   { animation-delay: 0.4s; }
.hero-stats     { animation-delay: 0.5s; }
