/* ccreset — tech, clean, direct. Dark only. */
:root {
  --bg: #050608;
  --bg-2: #0a0c10;
  --surface: rgba(10, 12, 16, 0.62);
  --surface-2: rgba(16, 19, 25, 0.75);
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.16);
  --text: #eceef1;
  --muted: #9aa1ab;
  --dim: #5f6771;
  --green: #38d996;
  --amber: #f5b323;
  --red: #ff5c5c;
  --blue: #5aa9ff;
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --radius: 14px;
  --max: 1180px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* { box-sizing: border-box; }
html { color-scheme: dark; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
h1, h2, h3, h4, p, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; border-radius: 6px; }

/* Background: fluid ink canvas (ink.js) under a dark veil + faint grid. */
#ink { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -2; display: block; background: var(--bg); }
.bg {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(to bottom, rgba(5, 6, 8, 0.28), rgba(5, 6, 8, 0.55) 60%, rgba(5, 6, 8, 0.7));
}
.bg::after {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent 70%);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent 70%);
}

/* Top bar */
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  max-width: var(--max); margin: 0 auto; padding: 14px 24px;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.top::after {
  content: ""; position: absolute; left: 24px; right: 24px; bottom: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-2), transparent);
}
.brand { display: inline-flex; align-items: center; gap: 2px; }
.brand-word { font-family: var(--font-mono); font-weight: 600; font-size: 18px; letter-spacing: -0.02em; }
.brand-word.small { font-size: 14px; }
.cursor { width: 9px; height: 18px; background: var(--green); border-radius: 2px; animation: blink 1.1s steps(2) infinite; box-shadow: 0 0 12px rgba(56, 217, 150, 0.6); }
@keyframes blink { 50% { opacity: 0; } }
.top-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px;
  font-size: 12px; color: var(--muted); background: var(--surface);
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 10px var(--amber); }
.pill.live .dot { background: var(--green); box-shadow: 0 0 10px var(--green); }
.updated { font-size: 12px; color: var(--dim); }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 999px; padding: 2px; background: var(--surface); }
.seg-btn { padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 500; color: var(--muted); transition: background 0.2s, color 0.2s; }
.seg-btn.active { background: var(--text); color: #0a0c10; }

/* Layout */
main { max-width: var(--max); margin: 0 auto; padding: 0 24px 40px; }
.section { padding: 72px 0 0; }
.section-head { margin-bottom: 22px; }
.section-head.row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.h2 { font-family: var(--font-display); font-weight: 700; font-size: 26px; letter-spacing: -0.02em; }
.section-sub { color: var(--muted); margin-top: 6px; max-width: 640px; }
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.stack { display: grid; gap: 14px; }
.split { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; align-items: start; }

/* Hero */
.hero { padding: 64px 0 0; }
.eyebrow { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--green); }
.h1 {
  font-family: var(--font-display); font-weight: 700; letter-spacing: -0.035em; line-height: 1.02;
  font-size: clamp(38px, 6vw, 68px); margin-top: 14px; max-width: 14ch;
}
.lede { color: var(--muted); font-size: 17px; max-width: 620px; margin-top: 18px; }

/* Board of four */
.board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 40px; }
.tile {
  position: relative; overflow: hidden; text-align: left; width: 100%;
  padding: 20px 20px 18px; min-height: 250px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: transform 0.25s var(--ease), border-color 0.25s, background 0.25s;
}
.tile:hover { transform: translateY(-3px); border-color: var(--line-2); background: var(--surface-2); }
.tile::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: var(--tool); opacity: 0.9;
}
.tile::after {
  content: ""; position: absolute; width: 240px; height: 240px; right: -90px; top: -110px; border-radius: 50%;
  background: radial-gradient(closest-side, var(--tool), transparent);
  opacity: 0.12; filter: blur(10px); pointer-events: none;
}
.tile-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tool-name { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 700; font-size: 17px; }
.tool-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--tool); box-shadow: 0 0 10px var(--tool); flex: none; }
.vendor { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); }
.gauge-row { display: grid; grid-template-columns: 112px 1fr; gap: 14px; align-items: center; margin-top: 16px; }
.gauge { position: relative; width: 112px; height: 112px; }
.gauge svg { width: 112px; height: 112px; transform: rotate(-90deg); display: block; }
.gauge .track { fill: none; stroke: rgba(255, 255, 255, 0.08); stroke-width: 9; }
.gauge .arc { fill: none; stroke: var(--tool); stroke-width: 9; stroke-linecap: round; filter: drop-shadow(0 0 6px color-mix(in srgb, var(--tool) 70%, transparent)); transition: stroke-dashoffset 1.1s var(--ease); }
.gauge .val { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; font-family: var(--font-mono); font-weight: 600; font-size: 30px; letter-spacing: -0.04em; line-height: 1; }
.gauge .val .num { display: inline-flex; align-items: baseline; }
.gauge .val .cap { font-family: var(--font-body); font-weight: 400; font-size: 10px; letter-spacing: 0; color: var(--dim); margin-top: 4px; }
.gauge .val small { font-size: 13px; color: var(--muted); font-weight: 500; letter-spacing: 0; margin-left: 1px; }
.gauge-side { display: grid; gap: 7px; min-width: 0; align-content: center; }
.delta { font-family: var(--font-mono); font-size: 12px; color: var(--dim); }
.delta.up { color: var(--green); }
.delta.down { color: var(--red); }
.side-row { font-size: 12.5px; color: var(--muted); }
.side-row b { font-family: var(--font-mono); font-weight: 500; color: var(--text); font-size: 12px; }
.level { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; color: var(--lv); }
.level::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--lv); box-shadow: 0 0 8px var(--lv); }
.tile-meta { display: grid; gap: 6px; margin-top: 16px; font-size: 12.5px; color: var(--muted); }
.tile-meta div { display: flex; justify-content: space-between; gap: 8px; }
.tile-meta b { font-weight: 500; color: var(--text); font-family: var(--font-mono); font-size: 12px; }
.spark { display: block; width: 100%; height: 34px; margin-top: 14px; }
.spark path.area { fill: var(--tool); opacity: 0.12; }
.spark path.line { fill: none; stroke: var(--tool); stroke-width: 1.5; stroke-linejoin: round; }
.spark circle { fill: var(--tool); }

/* Cycle rules */
.cycles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 14px; }
.cycle { padding: 14px 16px; display: grid; grid-template-columns: 52px 1fr; gap: 12px; align-items: center; }
.cycle-ring { position: relative; width: 52px; height: 52px; }
.cycle-ring svg { width: 52px; height: 52px; transform: rotate(-90deg); display: block; }
.cycle-ring .track { fill: none; stroke: rgba(255, 255, 255, 0.08); stroke-width: 5; }
.cycle-ring .arc { fill: none; stroke: var(--tool); stroke-width: 5; stroke-linecap: round; }
.cycle-ring .val { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.cycle-title { font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.cycle-title .tool-dot { width: 6px; height: 6px; }
.cycle-line { font-family: var(--font-mono); font-size: 12px; color: var(--text); margin-top: 3px; }
.cycle-note { font-size: 12px; color: var(--dim); margin-top: 3px; line-height: 1.45; }

/* Triggers */
.trigger-card { padding: 18px 20px; }
.trigger-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.trigger-list { display: grid; gap: 10px; }
.trigger { display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: start; }
.trigger-ico {
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  border: 1px solid var(--line-2); background: var(--surface-2); font-family: var(--font-mono); font-size: 12px; color: var(--tool);
}
.trigger-title { font-weight: 500; }
.trigger-detail { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.src { font-family: var(--font-mono); font-size: 11px; color: var(--dim); margin-left: 6px; white-space: nowrap; }
.src:hover { color: var(--text); }
.milestone { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line); }
.milestone-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 13px; color: var(--muted); }
.milestone-row b { font-family: var(--font-mono); font-weight: 600; font-size: 18px; color: var(--text); }
.bar { position: relative; height: 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); margin-top: 10px; overflow: hidden; }
.bar > i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 999px; background: var(--tool); box-shadow: 0 0 14px var(--tool); transition: width 1s var(--ease); }
.milestone-note { font-size: 12.5px; color: var(--dim); margin-top: 8px; }
.empty { border: 1px dashed var(--line-2); border-radius: 10px; padding: 14px; color: var(--muted); font-size: 13.5px; }
.empty::before { content: "// "; font-family: var(--font-mono); color: var(--dim); }

/* People */
.people { padding: 18px 20px; }
.people h3, .panel-title { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); }
.person { display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.person:last-child { border-bottom: 0; padding-bottom: 4px; }
.avatar {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--font-mono); font-weight: 600; font-size: 14px; color: var(--text);
  background: var(--surface-2); border: 2px solid var(--tool); box-shadow: 0 0 18px color-mix(in srgb, var(--tool) 45%, transparent);
}
.person-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 500; }
.person-name .alias { color: var(--muted); font-weight: 400; }
.handle { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.handle:hover { color: var(--text); }
.person-role { font-size: 13px; color: var(--muted); margin-top: 2px; }
.key { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; padding: 2px 6px; border-radius: 4px; background: var(--tool); color: #06110c; font-weight: 600; }
.person-last { font-size: 12px; color: var(--dim); margin-top: 4px; }

/* Timeline */
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 5px 11px; border: 1px solid var(--line); border-radius: 999px; font-size: 12.5px; color: var(--muted); background: var(--surface); transition: 0.2s; display: inline-flex; align-items: center; gap: 6px; }
.chip:hover { border-color: var(--line-2); color: var(--text); }
.chip.active { background: var(--text); color: #0a0c10; border-color: var(--text); }
.chip .tool-dot { width: 6px; height: 6px; box-shadow: none; }
.events { border-top: 1px solid var(--line); }
.event { display: grid; grid-template-columns: 96px 130px 1fr; gap: 14px; align-items: baseline; padding: 14px 0; border-bottom: 1px solid var(--line); }
.event-date { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); }
.event-tool { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 500; }
.event-body { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.kind { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; padding: 2px 7px; border-radius: 4px; border: 1px solid var(--k); color: var(--k); }
.event-title { font-size: 14.5px; }
.events .empty { margin-top: 14px; }

/* Tool tabs + panel */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tab { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--muted); font-weight: 500; transition: 0.2s; }
.tab:hover { border-color: var(--line-2); color: var(--text); }
.tab.active { color: var(--text); border-color: var(--tool); box-shadow: inset 0 0 0 1px var(--tool), 0 0 24px color-mix(in srgb, var(--tool) 25%, transparent); }
.tab .pct { font-family: var(--font-mono); font-size: 12px; color: var(--dim); }
.tab.active .pct { color: var(--tool); }
.tool-panel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.tool-panel .panel { padding: 18px 20px; min-width: 0; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.why-total { font-family: var(--font-mono); font-size: 28px; font-weight: 600; letter-spacing: -0.03em; }
.why-total small { font-size: 12px; color: var(--muted); font-weight: 400; letter-spacing: 0; margin-left: 6px; }
.contrib { display: grid; gap: 10px; }
.contrib-row { display: grid; grid-template-columns: minmax(0, 1fr) 64px; gap: 10px; align-items: center; }
.contrib-row > div { min-width: 0; }
.contrib-label { font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: baseline; min-width: 0; }
.contrib-label .when { font-family: var(--font-mono); font-size: 11.5px; color: var(--dim); flex: none; }
.contrib-label .what { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contrib-bar { height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); overflow: hidden; margin-top: 5px; }
.contrib-bar > i { display: block; height: 100%; width: 0; background: var(--tool); border-radius: 999px; transition: width 0.9s var(--ease); }
.contrib-val { font-family: var(--font-mono); font-size: 12.5px; text-align: right; color: var(--text); }
.contrib-row.prior .contrib-bar > i { background: var(--dim); }
.why-note { font-size: 12.5px; color: var(--dim); margin-top: 14px; }
.signal { padding: 12px 0; border-bottom: 1px solid var(--line); }
.signal:last-child { border-bottom: 0; }
.signal-head { display: flex; gap: 8px; align-items: center; font-size: 12.5px; color: var(--muted); }
.signal-text { margin-top: 4px; font-size: 14px; }
.rule { border-left: 2px solid var(--tool); padding: 8px 12px; background: var(--surface-2); border-radius: 0 8px 8px 0; font-size: 14px; }
.defs { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.def-group h4 { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); margin-bottom: 8px; }
.def { padding: 6px 0; border-top: 1px solid var(--line); font-size: 13px; }
.def b { font-weight: 500; display: block; }
.def span { color: var(--muted); }
.accounts { display: grid; gap: 6px; }
.acct { display: grid; grid-template-columns: 26px auto 1fr; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; font-size: 12.5px; color: var(--muted); background: var(--surface); transition: 0.2s; min-width: 0; }
.acct:hover { border-color: var(--line-2); color: var(--text); }
.acct.primary { border-color: color-mix(in srgb, var(--tool) 55%, transparent); background: color-mix(in srgb, var(--tool) 6%, transparent); }
.acct .avatar { width: 26px; height: 26px; font-size: 10px; border-width: 1.5px; box-shadow: none; }
.acct .handle { color: var(--text); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.acct .role { color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }

/* Method */
.method { display: grid; grid-template-columns: 1.3fr 1fr; gap: 14px; align-items: start; }
.steps { display: grid; gap: 10px; }
.step { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.step-n { font-family: var(--font-mono); font-size: 12px; color: var(--green); padding-top: 2px; }
.step p { font-size: 14px; color: var(--muted); }
.step p b { color: var(--text); font-weight: 500; }
.formula { padding: 18px 20px; }
.formula-line { font-size: 15px; letter-spacing: 0.01em; }
.formula-legend { font-size: 12.5px; color: var(--muted); margin-top: 10px; }
.disclaimer { color: var(--dim); font-size: 12.5px; margin-top: 22px; max-width: 760px; }

/* Footer */
.foot { max-width: var(--max); margin: 0 auto; padding: 22px 24px 40px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 12.5px; }
.foot-left { display: flex; align-items: center; gap: 10px; }
.foot-links { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); }
.foot-links a:hover { color: var(--text); }
.api-chip { font-size: 11.5px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); }

/* Motion */
.reveal { opacity: 0; transform: translateY(10px); animation: reveal 0.6s var(--ease) forwards; }
@keyframes reveal { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { animation: none; opacity: 1; transform: none; }
  .cursor { animation: none; }
  .bar > i, .contrib-bar > i, .tile, .gauge .arc { transition: none; }
}

/* Responsive */
@media (max-width: 1024px) {
  .board, .cycles { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .split, .tool-panel, .method, .defs { grid-template-columns: 1fr; }
  .event { grid-template-columns: 90px 1fr; }
  .event-body { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .top { padding: 12px 16px; }
  .updated { display: none; }
  main { padding: 0 16px 32px; }
  .hero { padding-top: 40px; }
  .section { padding-top: 56px; }
  .board, .cycles { grid-template-columns: 1fr; }
  .tile { min-height: 0; }
  .event { grid-template-columns: 1fr; gap: 6px; }
  .foot { padding: 20px 16px 32px; }
}
