:root {
  --bg: #f5f4f0;
  --surface: #fbfaf7;
  --ink: #1a1916;
  --ink-2: #4a4842;
  --muted: #8a877e;
  --line: #e2dfd6;
  --line-2: #d3cfc3;
  --accent: #0e6b43;
  --accent-soft: #e2efe7;
  --warn: #9a5b00;
  --hl: #fff1b8;
  --danger: #a3261b;
  --radius: 6px;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111110;
    --surface: #181816;
    --ink: #ecebe5;
    --ink-2: #b9b7ae;
    --muted: #7b796f;
    --line: #262522;
    --line-2: #33322d;
    --accent: #52c98a;
    --accent-soft: #15291e;
    --warn: #e0a54a;
    --hl: #3b3412;
    --danger: #f0786b;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "tnum";
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid var(--line);
}
.top .wrap { display: flex; align-items: center; gap: 16px; height: 52px; }
.brand { font: 500 13px/1 var(--mono); letter-spacing: -0.01em; display: flex; align-items: center; gap: 8px; }
.brand b { font-weight: 600; }
.brand .slash { color: var(--muted); }
.stats { color: var(--muted); font-size: 12.5px; margin-right: auto; }
.status {
  display: inline-flex; align-items: center; gap: 7px;
  font: 500 12px/1 var(--mono); color: var(--muted);
  padding: 6px 9px; border: 1px solid var(--line); border-radius: 999px;
}
.status i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.status.live { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.status.live i { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); animation: beat 2.4s ease-in-out infinite; }
.status.down { color: var(--warn); }
.status.down i { background: var(--warn); }
@keyframes beat { 50% { box-shadow: 0 0 0 5px transparent; } }

.iconbtn {
  display: inline-grid; place-items: center; width: 32px; height: 32px;
  border: 1px solid transparent; border-radius: var(--radius); background: none; color: var(--ink-2);
}
.iconbtn:hover { border-color: var(--line); background: var(--surface); }
.iconbtn[aria-pressed="true"] { color: var(--accent); }
.iconbtn svg { width: 17px; height: 17px; }
.link { color: var(--ink-2); text-decoration: none; font-size: 13px; }
.link:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- latest ---------- */
.latest {
  margin: 28px 0 8px;
  display: grid; grid-template-columns: auto 1fr; gap: 6px 32px; align-items: end;
}
.latest .label { grid-column: 1 / -1; font: 500 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.bigcode {
  font: 600 clamp(44px, 9vw, 76px)/0.95 var(--mono);
  letter-spacing: 0.04em; padding: 0; border: 0; background: none; text-align: left;
  position: relative;
}
.bigcode:hover { color: var(--accent); }
.bigcode.none { color: var(--muted); font: 500 15px/1.4 var(--sans); letter-spacing: 0; cursor: default; }
.bigcode.none:hover { color: var(--muted); }
.latest .meta { padding-bottom: 6px; min-width: 0; }
.latest .meta p { margin: 0 0 6px; color: var(--ink-2); max-width: 62ch; overflow-wrap: anywhere; }
.latest .meta .sub { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: 12.5px; }
.latest.stale .bigcode { color: var(--muted); }
.age { font-family: var(--mono); }
.age.fresh { color: var(--accent); }

/* ---------- toolbar ---------- */
.toolbar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  margin: 28px 0 0; padding: 12px 0; border-top: 1px solid var(--line);
}
.search { position: relative; flex: 1 1 260px; max-width: 380px; }
.search svg { position: absolute; left: 10px; top: 50%; width: 15px; height: 15px; transform: translateY(-50%); color: var(--muted); }
.search input {
  width: 100%; height: 34px; padding: 0 10px 0 32px;
  border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface);
}
.search input::placeholder { color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  height: 28px; padding: 0 10px; border-radius: 999px;
  border: 1px solid var(--line-2); background: transparent; color: var(--ink-2);
  font: 500 12px/1 var(--mono);
}
.chip:hover { background: var(--surface); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip small { opacity: .6; margin-left: 4px; font-size: 11px; }

/* ---------- list ---------- */
.day {
  position: sticky; top: 52px; z-index: 2;
  display: flex; justify-content: space-between;
  padding: 18px 0 8px; background: var(--bg);
  font: 500 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.rows { list-style: none; margin: 0; padding: 0; }
.row {
  display: grid;
  grid-template-columns: 74px 118px 86px minmax(0, 1fr);
  gap: 16px; align-items: baseline;
  padding: 11px 8px; margin: 0 -8px;
  border-bottom: 1px solid var(--line);
  border-radius: 2px;
}
.row:hover { background: var(--surface); }
.row.new { animation: hl 3.5s ease-out; }
@keyframes hl { 0%, 25% { background: var(--hl); } 100% { background: transparent; } }
.time { font: 12.5px/1.4 var(--mono); color: var(--muted); }
.code {
  justify-self: start;
  font: 600 17px/1.2 var(--mono); letter-spacing: .03em;
  padding: 2px 6px; margin: -2px -6px; border: 0; border-radius: 4px; background: none;
  position: relative;
}
.code:hover { background: var(--accent-soft); color: var(--accent); }
.code.none { color: var(--line-2); font-weight: 400; cursor: default; }
.code.none:hover { background: none; color: var(--line-2); }
.row.old .code:not(.none) { color: var(--ink-2); font-weight: 500; }
.card { font: 12.5px/1.4 var(--mono); color: var(--ink-2); white-space: nowrap; }
.card.none { color: var(--line-2); }
.text { min-width: 0; color: var(--ink-2); }
.text .t { color: var(--ink); font-weight: 500; margin-right: 6px; }
.text .b { overflow-wrap: anywhere; }
mark { background: none; color: var(--ink); font-weight: 600; }
.row .app { display: block; margin-top: 2px; font-size: 11.5px; color: var(--muted); }

.copied::after {
  content: "disalin"; position: absolute; left: 100%; top: 50%; transform: translateY(-50%);
  margin-left: 8px; font: 500 11px/1 var(--mono); color: var(--accent); letter-spacing: 0;
  animation: fade 1.4s forwards;
}
@keyframes fade { 70% { opacity: 1; } 100% { opacity: 0; } }

.empty { padding: 64px 0; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--ink-2); font-weight: 500; margin-bottom: 4px; }
.more { display: block; margin: 20px auto 48px; height: 34px; padding: 0 16px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface); color: var(--ink-2); }
.more:hover { color: var(--ink); }
.more[hidden] { display: none; }
.foot { padding: 0 0 40px; color: var(--muted); font-size: 12px; text-align: center; }

@media (max-width: 680px) {
  .wrap { padding: 0 16px; }
  .stats { display: none; }
  .brand { margin-right: auto; }
  .latest { grid-template-columns: 1fr; gap: 10px; }
  .row { grid-template-columns: auto 1fr auto; gap: 4px 12px; }
  .row .code { grid-row: 1; grid-column: 1; }
  .row .card { grid-row: 1; grid-column: 2; }
  .row .time { grid-row: 1; grid-column: 3; justify-self: end; }
  .row .text { grid-row: 2; grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; } }

/* ---------- docs ---------- */
.docs { padding: 40px 0 64px; max-width: 760px; }
.docs h1 { font: 600 22px/1.3 var(--sans); margin: 0 0 6px; letter-spacing: -0.01em; }
.docs h2 { font: 500 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 36px 0 12px; }
.docs h3 { font: 600 14px/1.4 var(--mono); margin: 24px 0 6px; }
.docs h3 .m { display: inline-block; min-width: 44px; color: var(--accent); }
.docs p, .docs li { color: var(--ink-2); max-width: 66ch; }
.docs code { font: 12.5px var(--mono); background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; }
.docs pre { font: 12.5px/1.6 var(--mono); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; overflow-x: auto; }
.docs pre code { border: 0; padding: 0; background: none; }
.docs table { border-collapse: collapse; width: 100%; font-size: 13px; }
.docs td, .docs th { text-align: left; padding: 7px 10px 7px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.docs th { font: 500 11px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.docs td:first-child { font-family: var(--mono); white-space: nowrap; }
