/* ============================================================
   Design System reference page — self-contained
   (tokens mirror main.css; page is standalone, no site chrome)
   ============================================================ */
:root {
  --font-sans: 'Be Vietnam Pro', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
  --bg:#0a0b0d; --bg-1:#101216; --bg-2:#16191e; --bg-3:#1d2128;
  --line:rgba(255,255,255,.09); --line-2:rgba(255,255,255,.05);
  --text:#eef0f3; --muted:#9aa1ab; --faint:#636a74;
  --acc:#c2f24d; --acc-dim:rgba(194,242,77,.12); --acc-line:rgba(194,242,77,.32);
  --fire:#ff6a3d; --fire-2:#ffb13d; --fire-dim:rgba(255,106,61,.14); --fire-line:rgba(255,106,61,.34);
  --fire-grad:linear-gradient(120deg,#ffb13d,#ff6a3d); --fire-ink:#1c0e05;
}
* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body { margin: 0; font-family: var(--font-sans); background: var(--bg); color: var(--text); line-height: 1.5; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
::selection { background: rgba(255,255,255,.18); }
.mono { font-family: var(--font-mono); }

/* striped image placeholder */
.ph { position: relative; background-color: var(--bg-2); background-image: repeating-linear-gradient(-45deg, rgba(255,255,255,.035) 0 1px, transparent 1px 11px); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.ph::after { content: attr(data-label); font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; color: var(--faint); text-align: center; padding: 0 12px; text-transform: uppercase; }

/* layout: sticky sidebar + content */
.shell { display: grid; grid-template-columns: 240px 1fr; gap: 0; max-width: 1280px; margin: 0 auto; }
.side { position: sticky; top: 0; align-self: start; height: 100vh; border-right: 1px solid var(--line); padding: 30px 24px; overflow-y: auto; }
.side .brand { font-family: var(--font-mono); font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 9px; margin-bottom: 8px; color: var(--text); }
.side .brand .sq { width: 11px; height: 11px; background: var(--acc); box-shadow: 0 0 12px var(--acc); }
.side .brand .prompt { color: var(--acc); font-size: 16px; line-height: 1; font-weight: 600; text-shadow: 0 0 10px rgba(194,242,77,.5); }
.side .tag { font-family: var(--font-mono); font-size: 11px; color: var(--faint); letter-spacing: .06em; margin-bottom: 26px; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav .grp { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); margin: 18px 0 7px; }
.side nav a { font-size: 13.5px; color: var(--muted); padding: 6px 10px; border-radius: 7px; transition: all .15s; border-left: 2px solid transparent; }
.side nav a:hover { color: var(--text); background: var(--bg-1); }
.side nav a.active { color: var(--acc); border-left-color: var(--acc); background: var(--acc-dim); }

.content { padding: 54px 56px 120px; min-width: 0; }
.hero-h { margin-bottom: 8px; }
.hero-h .eg { font-family: var(--font-mono); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--acc); }
.hero-h h1 { font-size: 44px; font-weight: 800; letter-spacing: -.03em; margin: 14px 0 0; }
.hero-h p { color: var(--muted); font-size: 16px; line-height: 1.65; max-width: 62ch; margin: 16px 0 0; }

section.sec { padding: 56px 0 0; scroll-margin-top: 20px; }
.sec-h { display: flex; align-items: baseline; gap: 14px; border-bottom: 1px solid var(--line); padding-bottom: 16px; margin-bottom: 30px; }
.sec-h .nn { font-family: var(--font-mono); font-size: 13px; color: var(--acc); }
.sec-h h2 { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin: 0; }
.sec-h .desc { color: var(--faint); font-size: 13.5px; margin-left: auto; max-width: 36ch; text-align: right; line-height: 1.5; }
.sub-h { font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); margin: 34px 0 16px; }

/* color grid */
.swatches { display: grid; grid-template-columns: repeat(auto-fill,minmax(168px,1fr)); gap: 14px; }
.sw { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--bg-1); }
.sw .chip { height: 78px; border-bottom: 1px solid var(--line); }
.sw .meta { padding: 12px 13px; }
.sw .meta .nm { font-size: 13px; font-weight: 600; }
.sw .meta .var { font-family: var(--font-mono); font-size: 11px; color: var(--acc); margin-top: 4px; }
.sw .meta .hex { font-family: var(--font-mono); font-size: 11px; color: var(--faint); margin-top: 2px; }

/* type scale */
.type-row { display: grid; grid-template-columns: 150px 1fr; gap: 24px; align-items: baseline; padding: 18px 0; border-bottom: 1px solid var(--line-2); }
.type-row:last-child { border-bottom: 0; }
.type-row .lab { font-family: var(--font-mono); font-size: 11.5px; color: var(--faint); line-height: 1.6; }
.type-row .lab b { color: var(--muted); display: block; font-weight: 500; }
.type-row .demo { min-width: 0; }

/* token table */
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th, .tbl td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line-2); }
.tbl th { font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); font-weight: 500; }
.tbl td.k { font-family: var(--font-mono); color: var(--acc); }
.tbl td.v { font-family: var(--font-mono); color: var(--muted); }
.tbl tr:last-child td { border-bottom: 0; }

/* spec card wrapper */
.demo-card { border: 1px solid var(--line); border-radius: 14px; background: var(--bg-1); padding: 30px; }
.demo-grid { display: grid; gap: 20px; }
.row { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.note { font-family: var(--font-mono); font-size: 12px; color: var(--faint); margin-top: 14px; line-height: 1.6; }
.note b { color: var(--acc); font-weight: 400; }

/* ===== component styles (mirror the real site) ===== */
.btn { display: inline-flex; white-space: nowrap; align-items: center; gap: 9px; font-size: 15px; font-weight: 700; padding: 14px 22px; border-radius: 10px; cursor: pointer; border: 0; transition: transform .15s, box-shadow .15s, border-color .15s, background .15s; font-family: var(--font-sans); }
.btn-pri { background: var(--fire-grad); color: var(--fire-ink); }
.btn-pri:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(255,106,61,.32); }
.btn-acc { background: var(--acc); color: var(--bg); }
.btn-ghost { border: 1px solid var(--line); color: var(--text); background: transparent; }
.btn-ghost:hover { border-color: var(--acc-line); background: var(--acc-dim); }
.btn-mono { font-family: var(--font-mono); font-size: 13px; font-weight: 600; color: var(--fire-ink); background: var(--fire-grad); padding: 9px 16px; border-radius: 7px; }
.btn-sm { font-size: 13px; padding: 9px 15px; }

.pill { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--acc); background: var(--acc-dim); border: 1px solid var(--acc-line); border-radius: 100px; padding: 6px 14px; }
.pill.fire { color: var(--fire); background: var(--fire-dim); border-color: var(--fire-line); }
.pill .live { width: 7px; height: 7px; border-radius: 50%; background: var(--acc); box-shadow: 0 0 10px var(--acc); }
.pill.fire .live { background: var(--fire); box-shadow: 0 0 10px var(--fire); }
.tag-mono { font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--acc); }
.eyebrow-demo { font-family: var(--font-mono); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--acc); }

.card-d { background: var(--bg-1); border: 1px solid var(--line); border-radius: 14px; padding: 26px; transition: border-color .2s, transform .2s; max-width: 300px; }
.card-d:hover { border-color: var(--acc-line); transform: translateY(-3px); }
.card-d .ix { font-family: var(--font-mono); font-size: 12px; color: var(--faint); }
.card-d h3 { font-size: 18px; font-weight: 600; margin: 16px 0 7px; }
.card-d p { color: var(--muted); font-size: 14px; line-height: 1.6; margin: 0; }

.field { margin-bottom: 14px; max-width: 360px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 7px; }
.inp { font-family: var(--font-sans); font-size: 14.5px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 9px; padding: 13px 14px; color: var(--text); width: 100%; transition: border-color .15s; }
.inp:focus { outline: none; border-color: var(--acc-line); }
.inp::placeholder { color: var(--faint); }

.term { background: #0c0e11; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; max-width: 440px; }
.term .bar { display: flex; align-items: center; gap: 8px; padding: 11px 14px; border-bottom: 1px solid var(--line); background: var(--bg-1); }
.term .bar i { width: 10px; height: 10px; border-radius: 50%; background: #2c3138; }
.term .bar .tt { font-family: var(--font-mono); font-size: 11.5px; color: var(--faint); margin-left: 6px; }
.term .body { padding: 15px 16px; font-family: var(--font-mono); font-size: 13px; line-height: 1.9; }
.term .c { color: var(--faint); } .term .o { color: var(--text); } .term .p { color: var(--acc); } .term .m { color: var(--muted); }
.cursor { display: inline-block; width: 7px; height: 14px; background: var(--acc); vertical-align: -2px; animation: bk 1.1s steps(1) infinite; }
@keyframes bk { 50%{opacity:0} }

.acc { border: 1px solid var(--line); border-radius: 12px; background: var(--bg-1); overflow: hidden; max-width: 520px; }
.acc-h { display: flex; align-items: center; gap: 14px; padding: 18px 20px; cursor: pointer; user-select: none; }
.acc-h .mi { font-family: var(--font-mono); font-size: 13px; color: var(--acc); }
.acc-h .mt { font-size: 16px; font-weight: 600; flex: 1; }
.acc-h .chev { color: var(--muted); transition: transform .25s; }
.acc.open .acc-h .chev { transform: rotate(180deg); color: var(--acc); }
.acc-b { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.acc.open .acc-b { max-height: 160px; }
.acc-b p { margin: 0; padding: 0 20px 20px 48px; color: var(--muted); font-size: 14px; line-height: 1.6; }

.ph-demo { aspect-ratio: 16/9; border-radius: 11px; max-width: 340px; }

.glow-demo { position: relative; height: 120px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--bg-1); display: flex; align-items: center; justify-content: center; }
.glow-demo::before { content: ""; position: absolute; top: -60%; left: 50%; transform: translateX(-50%); width: 340px; height: 280px; background: radial-gradient(circle,var(--fire-dim),transparent 65%); }
.glow-demo span { position: relative; font-family: var(--font-mono); font-size: 12px; color: var(--muted); }

.dd { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.dd .box2 { border: 1px solid var(--line); border-radius: 12px; padding: 20px; background: var(--bg-1); }
.dd .box2 .hd { font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.dd .ok .hd { color: var(--acc); } .dd .no .hd { color: var(--fire); }
.dd ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 9px; }
.dd li { font-size: 13.5px; color: var(--muted); line-height: 1.5; padding-left: 20px; position: relative; }
.dd .ok li::before { content: "✓"; position: absolute; left: 0; color: var(--acc); font-family: var(--font-mono); }
.dd .no li::before { content: "✗"; position: absolute; left: 0; color: var(--fire); font-family: var(--font-mono); }

code.inline { font-family: var(--font-mono); font-size: .88em; color: var(--acc); background: var(--acc-dim); border: 1px solid var(--acc-line); border-radius: 5px; padding: 1px 6px; }

@media (prefers-reduced-motion: reduce) { * { animation-duration: .001ms !important; transition-duration: .001ms !important; } }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .content { padding: 40px 24px 80px; }
  .sec-h .desc { display: none; }
  .dd { grid-template-columns: 1fr; }
}
