:root {
  --ink: #17231d;
  --paper: #f3f0e8;
  --acid: #c9ff48;
  --orange: #ff7043;
  --line: rgba(23, 35, 29, 0.18);
  --muted: #68736d;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, transparent 49.8%, rgba(23, 35, 29, 0.035) 50%, transparent 50.2%),
    var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.topbar, footer {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(24px, 5vw, 80px);
  border-bottom: 1px solid var(--ink);
  font: 700 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .13em;
}

.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 31px; height: 31px; background: var(--ink); color: var(--acid); }
.scope { padding: 8px 10px; border: 1px solid var(--ink); }

main { width: min(1240px, calc(100% - 40px)); margin: 0 auto; }
.hero { padding: clamp(70px, 10vw, 145px) 0 80px; }
.eyebrow { margin: 0 0 24px; font: 700 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .15em; color: var(--muted); }
h1 { max-width: 920px; margin: 0; font: 600 clamp(54px, 8.4vw, 118px)/.88 Georgia, serif; letter-spacing: -.055em; }
h1 em { color: var(--orange); font-weight: inherit; }
.lede { max-width: 560px; margin: 42px 0 0 auto; font-size: clamp(17px, 2vw, 22px); line-height: 1.45; }

.query-panel { display: grid; grid-template-columns: 100px 1fr; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.section-number { padding-top: 34px; font: 700 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.query-content { padding: 30px 0 36px; }
.query-content h2, .result h2 { margin: 0 0 28px; font: 600 clamp(34px, 4vw, 54px)/1 Georgia, serif; letter-spacing: -.035em; }
form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 14px; align-items: end; }
label span { display: block; margin: 0 0 8px; font: 700 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .12em; text-transform: uppercase; }
input, select, button { width: 100%; min-height: 54px; border: 1px solid var(--ink); border-radius: 0; font: inherit; }
input, select { padding: 0 15px; background: rgba(255,255,255,.4); color: var(--ink); }
button { width: auto; display: flex; gap: 28px; align-items: center; padding: 0 21px; background: var(--acid); color: var(--ink); font-weight: 750; cursor: pointer; }
button:hover { background: var(--ink); color: var(--acid); }
.custom-wrap { grid-column: 1 / 3; }
.hint { margin: 13px 0 0; color: var(--muted); font-size: 13px; }

.status { min-height: 70px; display: flex; align-items: center; color: var(--muted); font: 600 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.status.loading::after { content: ""; width: 8px; height: 8px; margin-left: 10px; background: var(--orange); animation: pulse .8s infinite alternate; }
@keyframes pulse { to { transform: scale(1.8); opacity: .35; } }

.result { padding: 30px 0 90px; border-top: 1px solid var(--ink); }
.result-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 40px; }
.latest { min-width: 220px; text-align: right; }
.latest span, .latest small { display: block; font: 700 10px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .12em; }
.latest strong { display: block; margin: 8px 0; font: 600 40px/1 Georgia, serif; }
.chart-shell { margin-top: 35px; padding: 18px; border: 1px solid var(--ink); background: rgba(255,255,255,.35); overflow: hidden; }
#chart { display: block; width: 100%; height: auto; }
.grid-line { stroke: var(--line); stroke-width: 1; }
.series-line { fill: none; stroke: var(--ink); stroke-width: 3; vector-effect: non-scaling-stroke; }
.series-fill { fill: url(#area-gradient); }
.point { fill: var(--orange); stroke: var(--paper); stroke-width: 2; vector-effect: non-scaling-stroke; }
.axis-label { fill: var(--muted); font: 22px ui-monospace, SFMono-Regular, Menlo, monospace; }

.metadata { display: grid; grid-template-columns: repeat(6, 1fr); margin: 18px 0 0; border: 1px solid var(--ink); border-right: 0; }
.metadata div { min-height: 92px; padding: 17px; border-right: 1px solid var(--ink); }
dt { color: var(--muted); font: 700 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .12em; text-transform: uppercase; }
dd { margin: 15px 0 0; font-size: 14px; overflow-wrap: anywhere; }
details { margin-top: 18px; border: 1px solid var(--ink); }
summary { padding: 17px; cursor: pointer; font-weight: 700; }
pre { max-height: 420px; overflow: auto; margin: 0; padding: 18px; border-top: 1px solid var(--ink); background: var(--ink); color: #e8f6e0; font-size: 12px; }
.source-link { display: inline-block; margin-top: 20px; color: var(--ink); font-weight: 750; text-decoration-thickness: 1px; text-underline-offset: 4px; }
footer { border-top: 1px solid var(--ink); border-bottom: 0; color: var(--muted); }

@media (max-width: 820px) {
  main { width: min(100% - 28px, 1240px); }
  .query-panel { grid-template-columns: 1fr; }
  .section-number { padding-top: 24px; }
  form { grid-template-columns: 1fr; }
  .custom-wrap { grid-column: auto; }
  .result-head { align-items: flex-start; }
  .latest { min-width: 0; }
  .metadata { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 520px) {
  .topbar { padding: 0 18px; }
  .scope { display: none; }
  .hero { padding-top: 60px; }
  h1 { font-size: 50px; }
  .lede { margin-top: 30px; }
  .result-head { display: block; }
  .latest { text-align: left; margin-bottom: 25px; }
}
