:root {
  color-scheme: light;
  --paper: #e9e8e4;
  --card: #ffffff;
  --sunken: #f1f0ec;
  --line: #d9d8d2;
  --ink: #161510;
  --soft: #605f58;
  --accent: #cfc0f5;
  --yellow: #f3d565;
  --shadow: 0 1px 0 rgb(22 21 16 / 6%);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0e0d0c;
  --card: #1a1917;
  --sunken: #262420;
  --line: #34312c;
  --ink: #f2f1ec;
  --soft: #aaa89f;
  --accent: #cfc0f5;
  --yellow: #e7ca5d;
  --shadow: 0 1px 0 rgb(255 255 255 / 5%);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
  overflow-x: clip;
}

body {
  width: 100%;
  min-width: 320px;
  min-height: 100dvh;
  margin: 0;
  overflow-x: clip;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.page-shell {
  width: 100%;
  max-width: 1500px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 16px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  margin-bottom: 12px;
}

.brand {
  display: block;
  flex: none;
  border-radius: 6px;
  background: #161510;
  padding: 6px 9px;
}

.brand img {
  display: block;
  width: 142px;
  height: auto;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.archive-pill,
.icon-button {
  height: 36px;
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow);
}

.archive-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 0 14px;
  color: var(--soft);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.archive-pill span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 0 3px rgb(243 213 101 / 22%);
}

.icon-button {
  display: grid;
  width: 36px;
  place-items: center;
  border-radius: 50%;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition:
    background 160ms ease,
    transform 160ms ease;
}

.icon-button:hover {
  background: var(--sunken);
}

.icon-button:active {
  transform: scale(0.96);
}

.icon-button:focus-visible,
.tile[href]:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.theme-toggle svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-toggle .sun,
:root[data-theme="dark"] .theme-toggle .moon {
  display: none;
}

:root[data-theme="dark"] .theme-toggle .sun {
  display: block;
}

.archive-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: minmax(250px, 0.95fr) minmax(220px, 0.8fr);
  gap: 10px;
  min-height: calc(100dvh - 118px);
}

.tile {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.tile[href] {
  transition:
    transform 180ms ease,
    box-shadow 180ms ease;
}

.tile[href]:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgb(22 21 16 / 10%);
}

.eyebrow {
  margin: 0;
  color: var(--soft);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.hero-tile {
  grid-column: span 7;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(24px, 4vw, 54px);
}

.hero-tile h1 {
  max-width: 780px;
  margin: 14px 0 0;
  font-size: 96px;
  font-weight: 900;
  line-height: 0.84;
}

.hero-copy {
  width: 100%;
  max-width: 620px;
  margin: 28px 0 0;
  color: var(--soft);
  font-size: 18px;
  line-height: 1.5;
}

.match-tile {
  grid-column: span 5;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(22px, 3vw, 40px);
  border-color: #161510;
  background: #161510;
  color: #f7f6f1;
}

.match-meta {
  display: flex;
  justify-content: space-between;
  color: #a8a69f;
  font-size: 11px;
  font-weight: 800;
}

.teams {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  margin: 24px 0;
}

.team {
  display: grid;
  min-width: 0;
  justify-items: center;
  gap: 12px;
}

.team img {
  width: clamp(70px, 8vw, 110px);
  aspect-ratio: 3 / 2;
  border: 1px solid rgb(255 255 255 / 18%);
  border-radius: 6px;
  object-fit: cover;
}

.team strong {
  max-width: 100%;
  font-size: 32px;
  overflow-wrap: anywhere;
  text-align: center;
}

.versus {
  color: #8c8a83;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.match-tile > p {
  margin: 0;
  color: #a8a69f;
  font-size: 13px;
  text-align: center;
}

.format-tile {
  grid-column: span 4;
  padding: clamp(22px, 2.7vw, 38px);
}

.format-tile h2,
.archive-tile h2,
.token-tile h2 {
  margin: 10px 0 0;
  font-size: 40px;
  line-height: 0.98;
}

.format-tile ul {
  display: grid;
  gap: 8px;
  margin: 28px 0 0;
  padding: 0;
  color: var(--soft);
  font-size: 13px;
  list-style: none;
}

.format-tile li::before {
  content: "✓";
  margin-right: 9px;
  color: var(--ink);
  font-weight: 900;
}

.pool-tile {
  grid-column: span 3;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(22px, 2.7vw, 38px);
  border-color: transparent;
  background: var(--accent);
  color: #161510;
}

.pool-tile .eyebrow {
  color: #4f4669;
}

.pool-tile strong {
  font-size: 82px;
  line-height: 0.82;
}

.pool-tile small {
  font-size: 16px;
}

.pool-tile p {
  margin: 0;
  color: #4f4669;
  font-size: 13px;
  font-weight: 700;
}

.token-tile {
  grid-column: span 3;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(22px, 2.7vw, 38px);
}

.token-rule {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.token-rule strong {
  font-size: 32px;
}

.token-rule span {
  color: var(--soft);
  font-size: 12px;
  font-weight: 700;
}

.archive-tile {
  grid-column: span 2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(20px, 2.3vw, 32px);
  background: var(--yellow);
  color: #161510;
}

.archive-tile .eyebrow,
.archive-tile > p {
  color: #5a4d1f;
}

.archive-tile > p {
  margin: 18px 0 0;
  font-size: 12px;
  line-height: 1.45;
}

.archive-mark {
  display: flex;
  gap: 5px;
}

.archive-mark span {
  width: 8px;
  height: 8px;
  border: 2px solid #161510;
  border-radius: 50%;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 4px 0;
  color: var(--soft);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

@media (max-width: 980px) {
  .archive-grid {
    grid-template-rows: auto;
  }

  .hero-tile,
  .match-tile {
    grid-column: span 12;
    min-height: 360px;
  }

  .hero-tile h1 {
    font-size: 76px;
  }

  .team strong {
    font-size: 28px;
  }

  .format-tile h2,
  .archive-tile h2,
  .token-tile h2 {
    font-size: 36px;
  }

  .pool-tile strong {
    font-size: 72px;
  }

  .format-tile {
    grid-column: span 12;
  }

  .pool-tile,
  .token-tile,
  .archive-tile {
    grid-column: span 4;
    min-height: 250px;
  }
}

@media (max-width: 680px) {
  .page-shell {
    padding: 10px;
  }

  .archive-pill {
    display: none;
  }

  .brand img {
    width: 126px;
  }

  .archive-grid {
    display: flex;
    flex-direction: column;
  }

  .hero-tile {
    min-height: 390px;
  }

  .hero-tile h1 {
    font-size: 54px;
  }

  .hero-copy {
    font-size: 15px;
  }

  .match-tile {
    min-height: 330px;
  }

  .team strong {
    font-size: 20px;
  }

  .format-tile h2,
  .archive-tile h2,
  .token-tile h2 {
    font-size: 34px;
  }

  .pool-tile strong {
    font-size: 68px;
  }

  .token-rule strong {
    font-size: 30px;
  }

  .format-tile,
  .pool-tile,
  .token-tile,
  .archive-tile {
    min-height: 260px;
  }

  footer {
    flex-direction: column;
    gap: 4px;
  }
}

@media (max-width: 360px) {
  .hero-tile h1 {
    font-size: 48px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .icon-button,
  .tile[href] {
    transition: none;
  }
}
