@font-face {
  font-family: "Baloo 2";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/Baloo2-Bold.woff2") format("woff2");
}

@font-face {
  font-family: "Baloo 2";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("/fonts/Baloo2-ExtraBold.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --paper: #fff4dd;
  --ink: #26201a;
  --ink-2: #5c5347;
  --ink-3: #877b6b;
  --accent: #ff5c2b;
  --accent-hover: #ee4518;
  --sun: #ffd84d;
  --sun-hover: #ffe070;
  --rose: #ffb9cc;
  --sky: #a5dcff;
  --mint: #b9e6a6;
  --card: #fffdf7;
  --on-accent: var(--card);
  --on-sun: var(--ink);
  --dot-ink: #26201a1a;
  --shadow-ink: var(--ink);
  --border: 2px solid var(--ink);
  --shadow: 4px 4px 0 var(--shadow-ink);
  --shadow-lg: 6px 6px 0 var(--shadow-ink);
  --radius: 14px;
  --font-display: "Baloo 2", "Arial Rounded MT Bold", system-ui, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --gpt: #2c7aa8;
  --cg-empty: #f1e3c4;
  --cg-recovered: #ffb07a;
  --cell-size: 22px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--sun);
  color: var(--on-sun);
}

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--paper);
}

::-webkit-scrollbar-thumb {
  background: var(--ink);
  border: 2px solid var(--paper);
  border-radius: 999px;
}

.page {
  width: min(880px, 100%);
  margin: 0 auto;
  padding: 0 24px 72px;
}

.masthead {
  display: flex;
  align-items: center;
  padding: 34px 0 8px;
}

.masthead-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.mark {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  color: var(--ink);
  transform: rotate(-4deg);
}

.masthead-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(28px, 4.5vw, 36px);
  letter-spacing: -0.01em;
  line-height: 1.05;
  margin: 0;
}

.masthead-job,
.masthead-lede {
  margin: 6px 0 0;
  color: var(--ink-2);
  font-size: 16px;
  max-width: 42ch;
}

.masthead-job {
  color: var(--ink);
}

.status {
  border: var(--border);
  border-radius: 10px;
  background: var(--rose);
  box-shadow: 3px 3px 0 var(--shadow-ink);
  padding: 10px 14px;
  margin: 18px 0 0;
  font-size: 15px;
}

.status[hidden] {
  display: none;
}

.hero {
  padding: 18px 0 0;
}

.hero-card {
  background-color: var(--card);
  background-image: radial-gradient(var(--dot-ink) 1.5px, transparent 1.5px);
  background-size: 18px 18px;
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 26px 30px 28px;
  transform: rotate(-0.4deg);
}

.hero-label {
  margin: 0 0 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.hero-figure {
  display: inline-block;
  margin: 0;
  padding: 0 16px 4px;
  border-radius: 10px;
  background: var(--sun);
  color: var(--on-sun);
  font-family: var(--font-display);
  font-size: clamp(40px, 7.5vw, 68px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.05;
  transform: rotate(-1.2deg);
}

.hero-figure.is-changing {
  animation: pop-in 0.45s var(--ease);
}

.hero-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 34px;
  margin-top: 14px;
}

.hero-sub {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-3);
}

.beg {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex: none;
  min-height: 34px;
  padding: 6px 9px;
  border: var(--border);
  border-radius: 10px;
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 2px 2px 0 var(--shadow-ink);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  transition:
    transform 80ms,
    box-shadow 80ms,
    background 0.15s;
}

.beg-hands {
  font-size: 16px;
  line-height: 1;
}

.beg-count {
  min-width: 1ch;
  opacity: 0.78;
  font-variant-numeric: tabular-nums;
}

.beg:hover {
  background: var(--accent-hover);
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--shadow-ink);
}

.beg:active,
.beg.is-pleading {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 var(--shadow-ink);
}

.beg:disabled {
  cursor: wait;
  opacity: 0.7;
}

@media (width >= 641px) {
  .hero-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "label label"
      "figure plea"
      "footer footer";
    gap: 14px clamp(32px, 8vw, 120px);
  }

  .hero-label {
    grid-area: label;
    margin-bottom: 0;
  }

  .hero-figure {
    grid-area: figure;
    justify-self: start;
  }

  .hero-footer {
    display: contents;
  }

  .hero-footer .hero-sub {
    grid-area: footer;
    justify-self: start;
  }

  .hero-footer .beg {
    grid-area: plea;
    place-self: center end;
  }
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin: 34px 0 0;
  padding: 0;
}

.stat-tile {
  margin: 0;
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 18px 16px;
  transition: transform 0.2s var(--ease);
}

.stat-tile--sun {
  background: var(--sun);
  transform: rotate(-1deg);
}

.stat-tile--rose {
  background: var(--rose);
  transform: rotate(0.8deg);
}

.stat-tile--sky {
  background: var(--sky);
  transform: rotate(-0.6deg);
}

.stat-tile:hover {
  transform: rotate(0deg) translateY(-3px);
}

.stat-tile dt {
  margin: 0 0 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.75;
}

.stat-tile dd {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(18px, 2.6vw, 28px);
  font-weight: 700;
  line-height: 1.15;
}

.stat-pair {
  display: grid;
  gap: 6px;
  font-size: clamp(14px, 2vw, 18px);
}

.model-tabs {
  margin-top: 34px;
}

.tablist {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.tab {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 10px 14px;
  border: var(--border);
  border-radius: 10px;
  background: var(--card);
  box-shadow: 2px 2px 0 var(--shadow-ink);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  text-align: left;
}

.tab:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--shadow-ink);
}

.tab[aria-selected="true"] {
  background: var(--sun);
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 var(--shadow-ink);
}

.tab-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tab-chance {
  font-variant-numeric: tabular-nums;
}

.board {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.tab-panel[hidden] {
  display: none;
}

.note {
  margin-top: 34px;
  background: var(--card);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px 8px;
}

.note h2 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1;
}

.note p {
  margin: 0 0 14px;
  color: var(--ink-2);
  font-size: 16px;
  max-width: 62ch;
}

.model-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  background: var(--card);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
}

.model-id h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1;
}

.model-logo {
  display: block;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.tab-name .model-logo {
  width: 22px;
  height: 22px;
}

.model-chance {
  margin: 8px 0 0;
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.model-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.vote {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  padding: 8px 12px;
  border: var(--border);
  border-radius: 10px;
  box-shadow: 2px 2px 0 var(--shadow-ink);
  background: var(--card);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  transition:
    transform 80ms,
    box-shadow 80ms,
    background 0.15s;
}

.vote-icon {
  display: grid;
  place-items: center;
}

.vote-count {
  min-width: 1.4ch;
  opacity: 0.78;
  font-variant-numeric: tabular-nums;
}

.vote--restore {
  background: var(--mint);
}

.vote--drop {
  background: var(--rose);
}

.vote:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--shadow-ink);
}

.vote:active,
.vote[aria-pressed="true"] {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 var(--shadow-ink);
}

.vote[aria-pressed="true"].vote--restore {
  background: #96d67d;
}

.vote[aria-pressed="true"].vote--drop {
  background: var(--accent);
  color: var(--on-accent);
}

.vote:disabled {
  cursor: wait;
  opacity: 0.7;
}

.burst {
  position: absolute;
  left: 50%;
  top: 0;
  z-index: 2;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--sun);
  box-shadow: 2px 2px 0 var(--shadow-ink);
  padding: 3px 7px 4px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  pointer-events: none;
  animation: burst 0.85s var(--ease) forwards;
}

.history,
.calendar {
  margin-top: 34px;
}

.section-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 18px;
}

.section-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1;
}

.section-sub {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-3);
}

.graph-legend,
.legend-item {
  display: flex;
  align-items: center;
}

.legend-item {
  gap: 8px;
}

.graph-legend {
  flex-wrap: wrap;
  gap: 5px 12px;
}

.legend-chip {
  display: inline-block;
  width: 11px;
  height: 11px;
  border: 1.5px solid var(--ink);
  border-radius: 3px;
  background: var(--cg-empty);
  vertical-align: -1px;
}

.legend-chip--gpt {
  background: var(--gpt);
}

.legend-chip--claude,
.legend-chip--nerfed {
  background: var(--accent);
}

.legend-chip--recovered {
  background: var(--cg-recovered);
}

.history-card,
.graph-card {
  background: var(--card);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px 14px;
}

.chart-readout,
.cg-live {
  margin: 0 0 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-2);
}

.chart-frame {
  position: relative;
}

.chart {
  display: block;
  width: 100%;
  height: auto;
}

.chart-line,
.chart-dot,
.chart-axis,
.chart-label,
.chart-end,
.chart-cursor {
  pointer-events: none;
}

.chart-axis {
  fill: none;
  stroke: var(--dot-ink);
  stroke-width: 1.5;
}

.chart-axis--mid {
  stroke: #26201a33;
}

.chart-label,
.chart-end {
  fill: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 11px;
}

.chart-end--gpt {
  fill: var(--gpt);
  font-weight: 700;
}

.chart-end--claude {
  fill: var(--accent);
  font-weight: 700;
}

.chart-line {
  fill: none;
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-line--gpt {
  stroke: var(--gpt);
}

.chart-line--claude {
  stroke: var(--accent);
}

.chart-fill--gpt {
  fill: color-mix(in srgb, var(--gpt) 18%, transparent);
}

.chart-fill--claude {
  fill: color-mix(in srgb, var(--accent) 16%, transparent);
}

.chart-dot {
  stroke: var(--ink);
  stroke-width: 1.5;
}

.chart-dot--gpt {
  fill: var(--gpt);
}

.chart-dot--claude {
  fill: var(--accent);
}

.chart-draw .chart-line {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: chart-draw 0.9s var(--ease) forwards;
}

.chart-cursor {
  stroke: var(--ink);
  stroke-width: 1.5;
  stroke-dasharray: 3 4;
}

.chart-tip {
  position: absolute;
  z-index: 2;
  max-width: 260px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.45;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 10px));
}

.chart-tip[hidden] {
  display: none;
}

.cg-container {
  display: flex;
  gap: 8px;
  max-width: 100%;
  position: relative;
}

.cg-weekdays {
  display: grid;
  flex: none;
  gap: 4px;
  grid-template-rows: 20px repeat(7, var(--cell-size));
}

.cg-weekday {
  display: flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
}

.cg-scroll {
  max-width: 100%;
  margin: -4px;
  padding: 4px;
  overflow: auto hidden;
  scrollbar-width: thin;
}

.cg-grid {
  display: grid;
  gap: 4px;
  width: max-content;
  position: relative;
  grid-template-columns: repeat(27, var(--cell-size));
  grid-template-rows: 20px repeat(7, var(--cell-size));
}

.cg-month {
  align-self: start;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
}

.cg-cell {
  width: var(--cell-size);
  height: var(--cell-size);
  padding: 0;
  border: none;
  border-radius: 6px;
  background: var(--cg-empty);
  cursor: pointer;
  transition: transform 0.15s var(--ease);
}

.cg-cell[data-mark="nerfed"],
.cg-cell[data-mark="recovered"] {
  border: 1.5px solid var(--ink);
  box-shadow: 1.5px 1.5px 0 var(--shadow-ink);
}

.cg-cell[data-mark="nerfed"] {
  background: var(--accent);
}

.cg-cell[data-mark="recovered"] {
  background: var(--cg-recovered);
}

.cg-cell:hover,
.cg-cell:focus-visible {
  transform: scale(1.18);
}

.cg-cell--future {
  cursor: default;
  background: transparent;
}

.cg-cell--future:hover,
.cg-cell--future:focus-visible {
  transform: none;
}

.stamp {
  margin: 36px 0 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: rotate(-1.2deg) scale(0.85);
  }
  to {
    opacity: 1;
    transform: rotate(-1.2deg) scale(1);
  }
}

@keyframes burst {
  0% {
    opacity: 1;
    transform: translate(-50%, 0) scale(0.8);
  }
  70% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -56px) scale(1.05);
  }
}

@media (width <= 640px) {
  .page {
    padding: 0 16px 56px;
  }

  .masthead {
    padding-top: 24px;
  }

  .mark {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }

  .hero-card {
    padding: 20px 18px 22px;
  }

  .hero-footer {
    gap: 10px;
  }

  .stat-row {
    gap: 12px;
  }

  .stat-tile {
    padding: 10px 12px 12px;
  }

  .stat-tile dt {
    font-size: 9px;
    letter-spacing: 0.04em;
  }

  .stat-tile dd {
    font-size: 16px;
  }

  .model-row {
    grid-template-columns: 1fr;
    padding: 16px;
    gap: 14px;
  }

  .model-actions {
    justify-content: stretch;
  }

  .vote {
    flex: 1;
    justify-content: center;
  }

  .tab {
    font-size: 18px;
    min-height: 48px;
    padding: 8px 12px;
  }

  .note {
    padding: 16px 16px 4px;
  }

  .note h2 {
    font-size: 22px;
  }

  .history-card,
  .graph-card {
    padding: 16px 14px 12px;
  }

  .section-head h2 {
    font-size: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-figure,
  .burst,
  .stat-tile,
  .beg,
  .vote,
  .tab,
  .chart-draw .chart-line,
  .cg-cell {
    animation: none;
    transition: none;
  }
}

@keyframes chart-draw {
  to {
    stroke-dashoffset: 0;
  }
}
