*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg:        #050505;
  --surface:   #0a0a0a;
  --surface-2: #111111;
  --border:    #1c1c1c;
  --border-2:  #2a2a2a;
  --text:      #e8e8e8;
  --text-2:    #999999;
  --text-3:    #555555;
  --accent:    #00ff41;
  --accent-dim:#00cc33;
  --cyan:      #00d4ff;
  --orange:    #ff6b2b;
  --red:       #ff3b3b;
  --yellow:    #ffd600;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --font-sans: 'Inter', -apple-system, sans-serif;
  --max-w:     1600px;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 18px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
body { background: var(--bg); }
a { color: var(--accent); text-decoration: none; transition: opacity .15s; }
a:hover { opacity: .8; }
::selection { background: var(--accent); color: var(--bg); }

/* NAV */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(5,5,5,.85); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--max-w); margin: 0 auto; padding: 0 3.5rem;
  height: 60px; display: flex; align-items: center; justify-content: space-between;
}
.nav-logo { font-family: var(--font-mono); font-weight: 700; font-size: 1.25rem; color: var(--text); letter-spacing: -.02em; }
.nav-links { display: flex; gap: 1.8rem; font-family: var(--font-mono); font-size: .95rem; }
.nav-links a { color: var(--text-2); }
.nav-links a:hover { color: var(--text); opacity: 1; }
.nav-ext { color: var(--accent) !important; }

/* BUTTONS */
.btn {
  display: inline-block; font-family: var(--font-mono); font-size: 1rem; font-weight: 500;
  padding: .7rem 1.6rem; border-radius: 4px; border: 1px solid transparent;
  cursor: pointer; transition: all .15s; text-decoration: none;
}
.btn-primary { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-dim); border-color: var(--accent-dim); opacity: 1; }
.btn-ghost { background: transparent; color: var(--text-2); border-color: var(--border-2); }
.btn-ghost:hover { color: var(--text); border-color: var(--text-3); opacity: 1; }

/* SECTIONS */
.section { max-width: var(--max-w); margin: 0 auto; padding: 6rem 3.5rem; }
.section-label { font-family: var(--font-mono); font-size: 1.2rem; font-weight: 600; color: var(--accent); letter-spacing: .14em; margin-bottom: 1rem; }
.section-title { font-family: var(--font-mono); font-size: 2.4rem; font-weight: 700; color: var(--text); line-height: 1.2; margin-bottom: .85rem; letter-spacing: -.03em; }
.section-desc { color: var(--text-2); font-size: 1.1rem; line-height: 1.7; max-width: 720px; margin-bottom: 2.5rem; }

/* HERO */
.hero { padding-top: 10rem; padding-bottom: 6rem; text-align: center; display: flex; flex-direction: column; align-items: center; }
.hero-label { font-family: var(--font-mono); font-size: 1rem; color: var(--accent); letter-spacing: .15em; margin-bottom: 2rem; }
.hero-title { font-family: var(--font-mono); font-size: 5.5rem; font-weight: 800; line-height: 1; letter-spacing: -.06em; margin-bottom: 1.5rem; }
.hero-zip { color: var(--accent); }
.hero-llm { color: var(--text); }
.hero-subtitle { font-size: 1.3rem; color: var(--text-2); line-height: 1.6; margin-bottom: 1.5rem; }
.hero-authors { font-family: var(--font-mono); font-size: .95rem; color: var(--text-3); margin-bottom: 1.5rem; }
.hero-badges { display: flex; gap: .6rem; margin-bottom: 2.5rem; flex-wrap: wrap; justify-content: center; }
.badge { font-family: var(--font-mono); font-size: .78rem; font-weight: 600; padding: .35rem .8rem; border: 1px solid var(--border-2); border-radius: 3px; color: var(--text-2); letter-spacing: .04em; text-transform: uppercase; }
.hero-stats { display: flex; gap: 3rem; align-items: center; margin-bottom: 2.5rem; flex-wrap: wrap; justify-content: center; }
.hero-stat { text-align: center; }
.hero-stat-value { font-family: var(--font-mono); font-size: 2.5rem; font-weight: 700; color: var(--accent); }
.hero-stat-label { font-family: var(--font-mono); font-size: .85rem; color: var(--text-3); margin-top: .25rem; letter-spacing: .06em; }
.hero-stat-sep { width: 1px; height: 48px; background: var(--border-2); }
.hero-actions { display: flex; gap: 1rem; }

/* PIPELINE ACCORDION */
.pipeline-wrap { border: 1px solid var(--border); border-radius: 6px; background: var(--surface); padding: 2.5rem; }
.pipeline-controls { display: flex; gap: .75rem; margin-bottom: 2rem; }
.accordion-wrap { display: flex; flex-direction: column; gap: .6rem; }
.acc-panel { border: 1px solid var(--border); border-radius: 5px; overflow: hidden; transition: border-color .4s, box-shadow .4s; }
.acc-panel.active { border-color: var(--accent); box-shadow: 0 0 20px rgba(0,255,65,.06); }
.acc-header { display: flex; align-items: center; gap: 1rem; padding: .9rem 1.4rem; background: var(--surface-2); }
.acc-num { font-family: var(--font-mono); font-size: .82rem; color: var(--text-3); background: var(--bg); padding: .2rem .55rem; border-radius: 2px; font-weight: 600; }
.acc-title { font-family: var(--font-mono); font-size: 1rem; font-weight: 600; color: var(--text); }
.acc-desc { font-family: var(--font-mono); font-size: .85rem; color: var(--text-3); flex: 1; }
.acc-badge { font-family: var(--font-mono); font-size: .95rem; color: var(--accent); font-weight: 600; margin-left: auto; opacity: 0; transition: opacity .4s; white-space: nowrap; }
.acc-badge.show { opacity: 1; }
.acc-bar-wrap { padding: .5rem 1.4rem .8rem; background: var(--bg); }
.acc-bar { height: 10px; background: var(--surface-2); border-radius: 5px; overflow: hidden; }
.acc-fill { height: 100%; border-radius: 5px; transition: width 1s ease; }

/* BITX */
.bitx-wrap { border: 1px solid var(--border); border-radius: 6px; background: var(--surface); padding: 2.5rem; }
.bitx-controls { display: flex; gap: .75rem; margin-bottom: 2rem; }
.bitx-vis { display: flex; flex-direction: column; gap: 1.5rem; }
.bitx-step { border: 1px solid var(--border); border-radius: 4px; padding: 1.5rem; background: var(--bg); transition: opacity .4s, transform .4s; }
.bitx-step.hidden { display: none; }
.bitx-step.entering { animation: fadeSlideIn .5s ease forwards; }
@keyframes fadeSlideIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.bitx-step-label { font-family: var(--font-mono); font-size: .95rem; font-weight: 600; color: var(--text-2); margin-bottom: 1rem; letter-spacing: .04em; }
.bitx-row { display: flex; align-items: center; gap: 1rem; margin-bottom: .7rem; flex-wrap: wrap; }
.bitx-tag { font-family: var(--font-mono); font-size: .9rem; color: var(--text-3); min-width: 80px; text-align: right; }
.bitx-bits { display: flex; gap: 3px; }
.bit-cell {
  width: 30px; height: 34px; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: .9rem; font-weight: 600; border-radius: 3px;
  transition: background .3s, color .3s;
}
.bit-cell.sign { background: #2d1a1a; color: var(--red); }
.bit-cell.exp { background: #1a1a2d; color: var(--cyan); }
.bit-cell.mant { background: #1a2d1a; color: var(--accent); }
.bit-cell.zero { background: var(--surface-2); color: var(--text-3); }
.bit-cell.one { background: var(--accent); color: var(--bg); }
.bit-cell.changed { background: var(--yellow); color: var(--bg); animation: bitFlash .3s ease; }
@keyframes bitFlash { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.15); } }
.bit-sep { width: 4px; height: 34px; background: var(--border); border-radius: 1px; flex-shrink: 0; }
.bitx-val { font-family: var(--font-mono); font-size: .9rem; color: var(--text-2); white-space: nowrap; }
.bitx-compress-vis { display: flex; flex-direction: column; gap: 1.5rem; }
.compress-bar-group { display: flex; flex-direction: column; gap: .5rem; }
.compress-label { font-family: var(--font-mono); font-size: .9rem; color: var(--text-2); }
.compress-bar { height: 30px; border-radius: 4px; overflow: hidden; position: relative; background: var(--surface-2); }
.compress-bar-orig { position: absolute; top: 0; left: 0; height: 100%; width: 100%; background: var(--border-2); border-radius: 4px; transition: width .8s ease; }
.compress-bar-comp { position: absolute; top: 0; left: 0; height: 100%; width: 0%; background: var(--accent); border-radius: 4px; transition: width .8s ease .3s; }
.compress-bar-label-inside {
  position: absolute; top: 0; left: 0; height: 100%; display: flex; align-items: center;
  padding-left: .8rem; font-family: var(--font-mono); font-size: .8rem; color: var(--bg);
  font-weight: 600; pointer-events: none; z-index: 2;
}
.compress-ratio { font-family: var(--font-mono); font-size: .85rem; color: var(--text-3); margin-top: .2rem; }
.bitx-insight { margin-top: 1.2rem; font-family: var(--font-mono); font-size: .95rem; color: var(--accent); padding: 1rem 1.2rem; border-left: 3px solid var(--accent); background: rgba(0,255,65,.04); border-radius: 0 4px 4px 0; line-height: 1.6; }


/* BITX RAIN */
.rain-phase { margin-bottom: 1.5rem; }
.rain-phase.hidden { display: none; }
.rain-phase-label { font-family: var(--font-mono); font-size: .95rem; font-weight: 600; color: var(--text-2); margin-bottom: .8rem; letter-spacing: .04em; }
.rain-arrow { text-align: center; font-family: var(--font-mono); font-size: 1.1rem; color: var(--yellow); margin: .6rem 0; }
.rain-columns { display: flex; gap: 1.2rem; }
.rain-col { flex: 1; }
.rain-col-label { font-family: var(--font-mono); font-size: .88rem; font-weight: 600; margin-bottom: .5rem; }
.rain-rows { font-family: var(--font-mono); font-size: .88rem; line-height: 2.2; }
.rain-row { animation: fadeSlideIn .4s ease forwards; }
.rain-split-boxes { display: flex; gap: 1.2rem; }
.rain-dashed-box { flex: 1; border: 2px dashed var(--border-2); border-radius: 6px; padding: .8rem 1rem; }
.rain-box-label { font-family: var(--font-mono); font-size: .85rem; font-weight: 600; margin-bottom: .5rem; }
.rain-bit { font-family: var(--font-mono); font-size: .88rem; font-weight: 600; }
@media (max-width: 768px) {
  .rain-columns, .rain-split-boxes { flex-direction: column; }
}

/* BF16 EXPLORER */
.explorer-wrap { border: 1px solid var(--border); border-radius: 6px; background: var(--surface); padding: 2.5rem; }
.explorer-inputs { display: flex; gap: 2rem; margin-bottom: 2rem; align-items: flex-end; flex-wrap: wrap; }
.input-group { display: flex; flex-direction: column; gap: .5rem; }
.input-group label { font-family: var(--font-mono); font-size: .9rem; color: var(--text-3); }
.input-group input[type="number"] {
  font-family: var(--font-mono); font-size: 1.05rem; background: var(--bg);
  border: 1px solid var(--border-2); border-radius: 3px; color: var(--text);
  padding: .6rem .85rem; width: 160px; outline: none; transition: border-color .2s;
}
.input-group input[type="number"]:focus { border-color: var(--accent); }
.slider-group { flex: 1; min-width: 280px; }
#delta-display { color: var(--accent); font-weight: 600; }
input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 8px;
  border-radius: 4px; background: var(--surface-2); outline: none; margin: .6rem 0 .4rem;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 22px; height: 22px;
  border-radius: 50%; background: var(--accent); cursor: pointer; border: 2px solid var(--bg);
}
input[type="range"]::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%; background: var(--accent);
  cursor: pointer; border: 2px solid var(--bg);
}
.slider-labels { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: .8rem; color: var(--text-3); }
.explorer-display { display: flex; flex-direction: column; gap: .7rem; margin-bottom: 1.5rem; }
.explorer-row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.explorer-label { font-family: var(--font-mono); font-size: .9rem; color: var(--text-3); min-width: 80px; text-align: right; }
.explorer-bits { display: flex; gap: 3px; }
.explorer-val { font-family: var(--font-mono); font-size: .9rem; color: var(--text-2); white-space: nowrap; }
.explorer-divider { height: 1px; background: var(--border); margin: .5rem 0; }
.explorer-stats { display: flex; gap: 2.5rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.exp-stat { text-align: center; }
.exp-stat-value { font-family: var(--font-mono); font-size: 2.2rem; font-weight: 700; color: var(--accent); line-height: 1; }
.exp-stat-label { font-family: var(--font-mono); font-size: .8rem; color: var(--text-3); margin-top: .35rem; letter-spacing: .04em; }
.explorer-note { font-family: var(--font-mono); font-size: .88rem; color: var(--text-3); padding: .7rem 1rem; background: var(--bg); border-radius: 3px; border: 1px solid var(--border); }
.explorer-note code { color: var(--cyan); font-weight: 600; }

/* CODE */
.code-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media (max-width: 900px) { .code-grid { grid-template-columns: 1fr; } }
.code-block { border: 1px solid var(--border); border-radius: 6px; overflow: hidden; background: var(--surface); }
.code-header { display: flex; align-items: center; gap: .4rem; padding: .7rem 1.2rem; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.code-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--border-2); }
.code-title { font-family: var(--font-mono); font-size: .88rem; color: var(--text-3); margin-left: .5rem; }
.code-body { padding: 1.4rem; font-family: var(--font-mono); font-size: .85rem; line-height: 1.7; color: var(--text-2); overflow-x: auto; white-space: pre; tab-size: 4; }
.code-body .kw { color: #c678dd; }
.code-body .fn { color: #61afef; }
.code-body .ty { color: #e5c07b; }
.code-body .cm { color: #5c6370; }
.code-body .nu { color: #d19a66; }
.code-body .st { color: #98c379; }

/* DEMO COMPARISON */
.demo-wrap { border: 1px solid var(--border); border-radius: 6px; background: var(--surface); padding: 2.5rem; }
.demo-controls { display: flex; gap: .75rem; margin-bottom: 2rem; }
.demo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media (max-width: 900px) { .demo-grid { grid-template-columns: 1fr; } }
.demo-panel { border: 1px solid var(--border); border-radius: 6px; overflow: hidden; background: var(--bg); }
.demo-panel-head {
  display: flex; align-items: center; gap: .5rem;
  padding: .55rem 1rem; background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.demo-dots { display: flex; gap: .35rem; }
.demo-dot { width: 10px; height: 10px; border-radius: 50%; }
.demo-panel-title { font-family: var(--font-mono); font-size: .82rem; color: var(--text-3); margin-left: .3rem; }
.demo-tag {
  font-family: var(--font-mono); font-size: .72rem; font-weight: 600;
  padding: .15rem .5rem; border-radius: 2px; margin-left: auto;
  letter-spacing: .04em; text-transform: uppercase;
}
.demo-tag-zipnn { background: rgba(255,107,43,.15); color: var(--orange); border: 1px solid rgba(255,107,43,.3); }
.demo-tag-bitx { background: rgba(0,255,65,.1); color: var(--accent); border: 1px solid rgba(0,255,65,.25); }
.demo-panel-body { background: #0c0c0c; }
.demo-panel-body video { width: 100%; aspect-ratio: 16/9; object-fit: contain; display: block; }
.demo-timeline {
  display: flex; align-items: center; gap: 1rem; margin-top: 1.5rem;
  padding-top: 1rem; border-top: 1px solid var(--border);
}
.demo-time { font-family: var(--font-mono); font-size: .85rem; color: var(--text-3); min-width: 40px; }
.demo-progress {
  flex: 1; height: 6px; background: var(--surface-2); border-radius: 3px;
  overflow: hidden; cursor: pointer; position: relative;
}
.demo-progress-fill {
  height: 100%; background: var(--accent); border-radius: 3px;
  width: 0%; transition: width .15s linear;
}

/* FOOTER */
.footer { border-top: 1px solid var(--border); margin-top: 2rem; }
.footer-inner { max-width: var(--max-w); margin: 0 auto; padding: 3rem 2.5rem; display: flex; justify-content: space-between; align-items: flex-start; gap: 2rem; flex-wrap: wrap; }
.cite-label { font-family: var(--font-mono); font-size: .88rem; color: var(--text-3); letter-spacing: .08em; text-transform: uppercase; margin-bottom: .6rem; }
.cite-bib { font-family: var(--font-mono); font-size: .85rem; color: var(--text-2); line-height: 1.65; background: var(--surface); padding: 1.2rem; border-radius: 4px; border: 1px solid var(--border); white-space: pre; overflow-x: auto; }
.footer-links { display: flex; flex-direction: column; gap: .6rem; font-family: var(--font-mono); font-size: .95rem; }

/* RESPONSIVE */
@media (max-width: 768px) {
  .hero-title { font-size: 3rem; }
  .section-title { font-size: 1.6rem; }
  .accordion-wrap { gap: .4rem; }
  .acc-header { flex-wrap: wrap; gap: .5rem; }
  .hero-stats { flex-direction: column; gap: 1rem; }
  .hero-stat-sep { width: 40px; height: 1px; }
  .explorer-inputs { flex-direction: column; }
  .bit-cell { width: 24px; height: 28px; font-size: .8rem; }
  .nav-links { gap: 1rem; font-size: .85rem; }
}
