/* Chronos demo page — shared visual language with demo/slides/styles.css
   (same palette + font tokens), rebuilt as a single responsive scrolling
   page rather than fixed 1280x720 slide canvases. */

:root {
  --purple:       #765186;
  --purple-deep:  #4a3155;
  --purple-soft:  #ede6f0;
  --ink:          #1a1420;
  --paper:        #f7f5f9;
  --accent:       #4ECDC4;   /* the single accent used across the whole deck + site */
  --accent-ink:   #0f7a72;   /* accent at text contrast on light backgrounds */
  --warn:         #FF6B6B;   /* reserved for "before" / removed diff lines only */
  --body:         #3b3444;
  --body-dim:     #6a6178;
  --font: Poppins, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Code", "JetBrains Mono", Consolas, "Courier New", monospace;
  --max: 1120px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

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

img { max-width: 100%; display: block; }

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

section { position: relative; overflow: hidden; }

.section-pad { padding: 72px 0; }

@media (max-width: 640px) {
  .section-pad { padding: 52px 0; }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--purple);
  margin: 0 0 14px;
}

.section--dark .eyebrow { color: var(--accent); }

h1, h2, h3 { margin: 0; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); }

h2.section-title {
  font-size: clamp(28px, 4.4vw, 42px);
  line-height: 1.14;
  max-width: 780px;
}

.section--dark h2.section-title,
.section--dark h1 { color: #fff; }

p.lede {
  font-size: clamp(17px, 1.6vw, 20px);
  line-height: 1.55;
  color: var(--body-dim);
  max-width: 720px;
  margin: 14px 0 0;
}

.section--dark p.lede { color: #bfb4cc; }

.rule {
  width: 84px;
  height: 6px;
  border-radius: 3px;
  background: var(--accent);
  margin: 22px 0 0;
}

/* ---------- background blobs (same signature as the deck) ---------- */

.blobs { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; }
.blob--accent { background: var(--accent); opacity: 0.14; }
.blob--purple { background: var(--purple); opacity: 0.12; }
.blob--ring   { background: none; border: 2px solid var(--accent); opacity: 0.28; }
.section--dark .blob--accent { opacity: 0.18; }
.section--dark .blob--purple { opacity: 0.5; }
.section--dark .blob--ring   { opacity: 0.32; }

.blob--tr  { width: 460px; height: 460px; top: -200px; right: -160px; }
.blob--bl  { width: 380px; height: 380px; bottom: -170px; left: -140px; }

.section > .wrap { position: relative; z-index: 1; }

/* ---------- header / hero ---------- */

.hero { background: var(--ink); color: #e8e2ee; padding: 56px 0 64px; }

.hero__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 40px;
}

.brand {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.01em;
}

.brand .dot { color: var(--accent); }

.gh-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 15px;
  font-weight: 600;
  color: #e8e2ee;
  text-decoration: none;
  border: 1.5px solid rgba(232, 226, 238, 0.28);
  border-radius: 999px;
  padding: 9px 18px;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.gh-link:hover { border-color: var(--accent); color: var(--accent); }
.gh-link svg { width: 18px; height: 18px; flex: none; }

@media (max-width: 480px) {
  /* stack brand + GitHub button instead of relying on flex-wrap's tight
     one-line fit — deliberate, not left to chance on very narrow phones */
  .hero__top { flex-direction: column; align-items: flex-start; gap: 14px; }
  .gh-link { align-self: stretch; justify-content: center; }
}

.hero h1 {
  font-size: clamp(44px, 9vw, 84px);
  line-height: 0.98;
  color: #fff;
}

.hero h1 .dot { color: var(--accent); }

.hero .lede { font-size: clamp(18px, 2.4vw, 26px); font-weight: 600; color: var(--accent); max-width: 640px; margin-top: 16px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
  background: rgba(78, 205, 196, 0.14);
  color: var(--accent);
  border: 1px solid rgba(78, 205, 196, 0.35);
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* ---------- loop / 5-step flow ---------- */

.flow {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: center;
  gap: 8px;
  margin-top: 40px;
}

.flow__step {
  flex: 1 1 160px;
  min-width: 150px;
  max-width: 210px;
  background: #fff;
  border: 1.5px solid rgba(118, 81, 134, 0.14);
  border-radius: 18px;
  box-shadow: 0 10px 24px rgba(26, 20, 32, 0.06);
  padding: 22px 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.flow__step--hero {
  background: var(--purple);
  border-color: var(--purple);
  box-shadow: 0 14px 30px rgba(74, 49, 85, 0.3);
}

.flow__ico {
  width: 54px; height: 54px; border-radius: 50%;
  background: rgba(78, 205, 196, 0.18);
  color: var(--accent-ink);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
}

.flow__step--hero .flow__ico { background: rgba(255,255,255,0.18); color: #fff; }
.flow__step .step-no { font-size: 13px; font-weight: 800; letter-spacing: 0.1em; color: var(--purple); }
.flow__step--hero .step-no { color: var(--accent); }
.flow__step h3 { font-size: 19px; }
.flow__step--hero h3 { color: #fff; }
.flow__step p { margin: 0; font-size: 15px; color: var(--body-dim); line-height: 1.35; }
.flow__step--hero p { color: rgba(255,255,255,0.85); }

.flow__arrow {
  display: flex; align-items: center; justify-content: center;
  color: var(--purple); opacity: 0.45; flex: 0 0 auto;
  width: 22px;
}

.flow__arrow svg { width: 20px; height: 20px; }

@media (max-width: 760px) {
  .flow { flex-direction: column; align-items: stretch; }
  .flow__step { max-width: none; }
  .flow__arrow { width: auto; transform: rotate(90deg); padding: 2px 0; }
}

.icon { width: 1em; height: 1em; }

/* ---------- headline stat ---------- */

.stat-section { background: var(--ink); color: #fff; text-align: center; }

.bignum {
  display: flex; align-items: center; justify-content: center; gap: clamp(20px, 5vw, 40px);
  font-weight: 800; line-height: 0.9; letter-spacing: -0.03em;
  margin-top: 8px;
}

.bignum .from { font-size: clamp(72px, 16vw, 168px); color: #fff; }
.bignum .to   { font-size: clamp(72px, 16vw, 168px); color: var(--accent); }
.bignum .arw  { font-size: clamp(36px, 8vw, 80px); color: #8d829c; display: flex; }
.bignum .arw svg { width: 0.7em; height: 0.7em; }

.stat-caption {
  max-width: 620px; margin: 32px auto 0;
  font-size: clamp(17px, 2.2vw, 22px); font-weight: 600; color: #d8cfe2; line-height: 1.5;
}

.stat-caption b { color: var(--accent); font-weight: 800; }

/* ---------- comparison chart + table ---------- */

.chart-frame {
  border: 1.5px solid rgba(118, 81, 134, 0.18);
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 12px 28px rgba(26, 20, 32, 0.08);
  margin-top: 36px;
}

.table-scroll { overflow-x: auto; margin-top: 28px; border-radius: 14px; border: 1.5px solid rgba(118, 81, 134, 0.16); }

table.metrics {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 15px;
  min-width: 560px;
}

table.metrics th, table.metrics td {
  padding: 13px 18px;
  text-align: right;
  border-bottom: 1px solid rgba(118, 81, 134, 0.12);
  white-space: nowrap;
}

table.metrics th:first-child, table.metrics td:first-child { text-align: left; white-space: normal; }

table.metrics thead th {
  background: var(--purple-soft);
  color: var(--purple-deep);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

table.metrics tbody tr:last-child td { border-bottom: none; }
table.metrics td.reduction { font-weight: 800; color: var(--accent-ink); }

.table-note {
  font-size: 14px;
  color: var(--body-dim);
  max-width: 760px;
  margin-top: 16px;
  line-height: 1.5;
}

.scroll-hint {
  display: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--purple);
  margin: 16px 0 -8px;
}

@media (max-width: 700px) {
  .scroll-hint { display: block; }
}

/* ---------- bug spotlights ---------- */

.bug {
  margin-top: 44px;
}

.bug:first-of-type { margin-top: 40px; }

.bug__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 16px;
  margin-bottom: 6px;
}

.bug__head h3 {
  font-size: clamp(20px, 2.6vw, 26px);
  color: var(--ink);
}

.bug__file {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--body-dim);
  background: var(--purple-soft);
  border-radius: 8px;
  padding: 3px 10px;
}

.bug__found {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--purple);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  border-radius: 999px;
  padding: 6px 14px;
}

.bug__found svg { width: 14px; height: 14px; flex: none; }

.diff-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 18px;
}

@media (max-width: 760px) {
  .diff-grid { grid-template-columns: 1fr; }
}

.code__bar {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  margin-bottom: 10px;
}
.code__bar svg { width: 16px; height: 16px; }
.code__bar--before { color: var(--warn); }
.code__bar--after { color: var(--accent); }

.code {
  background: #1e1e1e;
  border-radius: 12px;
  padding: 16px 18px;
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.6;
  color: #d4d4d4;
  overflow-x: auto;
}

.code pre { margin: 0; white-space: pre; }
.code .ln { display: block; padding: 1px 8px; border-left: 3px solid transparent; }
.code .ln--del { background: rgba(255, 107, 107, 0.16); border-left-color: var(--warn); }
.code .ln--add { background: rgba(78, 205, 196, 0.14); border-left-color: var(--accent); }

.c  { color: #6A9955; }
.cf { color: #C586C0; }
.s  { color: #CE9178; }
.f  { color: #DCDCAA; }
.n  { color: #B5CEA8; }
.v  { color: #9CDCFE; }

.callout {
  margin-top: 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(78, 205, 196, 0.13);
  border-left: 5px solid var(--accent);
  border-radius: 0 10px 10px 0;
  padding: 14px 18px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
}

.callout svg { width: 20px; height: 20px; color: var(--accent-ink); flex: none; margin-top: 2px; }
.callout code { font-family: var(--mono); font-size: 0.92em; }
.callout strong { color: var(--purple-deep); }

/* ---------- scoring model ---------- */

.formula {
  display: flex; align-items: flex-end; justify-content: center;
  gap: clamp(14px, 3vw, 30px); margin-top: 32px; flex-wrap: wrap;
}

.fbar { width: 150px; text-align: center; flex: none; }
.fbar__plot { height: 120px; display: flex; align-items: flex-end; }
.fbar__bar { width: 100%; border-radius: 10px 10px 3px 3px; background: var(--purple); }
.fbar--impact .fbar__bar { background: #9c7aab; }
.fbar--risk .fbar__bar { background: var(--accent); }
.fbar__name { margin-top: 12px; font-size: 18px; font-weight: 700; color: var(--ink); }
.fbar__sub { margin-top: 4px; font-size: 13px; line-height: 1.3; color: var(--body-dim); }

.fop { height: 120px; display: flex; align-items: center; font-size: 40px; font-weight: 800; color: var(--purple); opacity: 0.55; flex: none; }

.cite {
  margin-top: 30px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--body-dim);
  border-left: 4px solid rgba(118, 81, 134, 0.3);
  padding-left: 16px;
  max-width: 760px;
}
.cite em { color: var(--purple-deep); font-style: normal; font-weight: 700; }

/* ---------- footer ---------- */

footer {
  background: var(--ink);
  color: #b3a7c1;
  padding: 40px 0;
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 14px;
}

.footer-row a { color: var(--accent); text-decoration: none; font-weight: 600; }
.footer-links { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; }
.footer-links span.sep { opacity: 0.4; }
