@font-face {
  font-family: "Neucha";
  src: url("/assets/fonts/neucha-cyrillic.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Neucha";
  src: url("/assets/fonts/neucha-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --ink: #111111;
  --paper: #fffefb;
  --ground: #b9b9b9;
  --muted: #5a5a5a;
  --red: #e31b23;
  --yellow: #f5e947;
  --line: 3px;
  --radius: 22px 17px 24px 19px;
  color-scheme: light;
  font-family: "Neucha", Georgia, serif;
  font-size: 18px;
  line-height: 1.45;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--ground); }
img { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 2px; }
p { margin: 0 0 1rem; }
h1, h2, h3 { margin: 0; line-height: 1.02; letter-spacing: 0.01em; }
h1 { font-size: clamp(2.7rem, 7vw, 6.7rem); max-width: 12ch; }
h2 { font-size: clamp(2.1rem, 4.5vw, 4.3rem); }
h3 { font-size: clamp(1.45rem, 2vw, 2rem); }

.shell { width: min(1180px, calc(100% - 32px)); margin-inline: auto; }
.section { padding-block: clamp(64px, 10vw, 128px); }
.paper {
  background: var(--paper);
  border: var(--line) solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 7px 8px 0 var(--ink);
}
.eyebrow { margin: 0 0 10px; color: var(--muted); font-size: 0.95rem; letter-spacing: 0.1em; text-transform: uppercase; }
.skip-link { position: fixed; z-index: 100; top: 10px; left: 10px; padding: 10px 16px; transform: translateY(-180%); background: var(--paper); border: 3px solid var(--ink); }
.skip-link:focus { transform: none; }
:focus-visible { outline: 4px solid var(--yellow); outline-offset: 4px; }

.site-header { display: flex; align-items: end; justify-content: space-between; gap: 24px; padding-top: 20px; }
.brand { display: inline-flex; align-items: center; gap: 12px; font-size: 1.35rem; font-weight: 700; text-decoration: none; }
.brand img { width: 62px; height: 62px; object-fit: cover; border-radius: 16px; }
.brand-name { text-decoration: none; }
.cat-sound { width: 62px; height: 62px; padding: 0; cursor: pointer; background: transparent; border: 0; border-radius: 16px; transition: transform 140ms ease; }
.cat-sound:hover { transform: rotate(-3deg) scale(1.04); }
.cat-sound:active { transform: rotate(2deg) scale(0.96); }
nav { display: flex; align-items: end; gap: 8px; }
.tab { min-width: 135px; padding: 12px 18px 10px; text-align: center; text-decoration: none; background: #999; border: 3px solid var(--ink); border-radius: 13px 13px 14px 11px; }
.tab.active { padding-top: 18px; color: var(--ink); background: var(--paper); }

.hero { display: grid; grid-template-columns: 1fr; align-items: center; isolation: isolate; min-height: min(820px, calc(100dvh - 90px)); padding-block: clamp(56px, 8vw, 96px); }
.hero > .paper { grid-area: 1 / 1; width: min(68%, 780px); transition: transform 420ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 180ms ease; }
.hero-copy { position: relative; z-index: 1; justify-self: start; padding: clamp(28px, 5vw, 64px); transform: translateX(-2%) rotate(-0.6deg); }
.hero-copy.is-active { z-index: 2; transform: translate(-3%, -10px) rotate(-0.6deg); box-shadow: 7px 8px 0 var(--ink), 0 18px 32px rgb(0 0 0 / 0.48); }
.hero > .paper.is-leaving { z-index: 2; }
.hero > .paper.is-routing { animation-duration: 680ms; animation-timing-function: cubic-bezier(0.45, 0, 0.15, 1); animation-fill-mode: both; }
.hero-copy.is-routing { animation-name: hero-copy-around; }
.hero-shot.is-routing { animation-name: hero-shot-around; }
.lead { margin-top: 26px; max-width: 46ch; font-size: clamp(1.2rem, 2vw, 1.55rem); }
.actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 11px 20px 8px; font-size: 1.08rem; text-decoration: none; background: var(--paper); border: 3px solid var(--ink); border-radius: 14px 11px 15px 12px; box-shadow: 4px 4px 0 var(--ink); transition: transform 120ms ease, box-shadow 120ms ease; }
.button.primary { color: white; background: var(--ink); }
.button:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.hero-shot { z-index: 1; display: grid; grid-template-rows: 1fr auto; justify-self: end; margin: 0; overflow: hidden; transform: translateX(3%) rotate(1deg); }
.hero-shot.is-active { z-index: 2; transform: translate(4%, -16px) rotate(1deg); box-shadow: 7px 8px 0 var(--ink), 0 18px 32px rgb(0 0 0 / 0.48); }
.hero-shot img { width: 100%; height: auto; aspect-ratio: 1920 / 886; object-fit: contain; background: var(--paper); filter: contrast(1.05); }
.hero-shot figcaption { padding: 14px 18px 12px; border-top: 3px solid var(--ink); }

@keyframes hero-copy-around {
  0% { z-index: 1; transform: translateX(-2%) rotate(-0.6deg); }
  48% { z-index: 1; transform: translate(-45%, 18px) rotate(-1.4deg); }
  49% { z-index: 3; transform: translate(-45%, 18px) rotate(-1.4deg); }
  100% { z-index: 3; transform: translate(-3%, -10px) rotate(-0.6deg); }
}

@keyframes hero-shot-around {
  0% { z-index: 1; transform: translateX(3%) rotate(1deg); }
  48% { z-index: 1; transform: translate(45%, 18px) rotate(1.8deg); }
  49% { z-index: 3; transform: translate(45%, 18px) rotate(1.8deg); }
  100% { z-index: 3; transform: translate(4%, -16px) rotate(1deg); }
}

.section-heading { display: flex; align-items: center; gap: 24px; margin-bottom: 42px; }
.section-heading.compact { display: block; }
.number-bubble { display: grid; flex: 0 0 auto; width: 84px; height: 84px; place-items: center; font-size: 3.6rem; line-height: 1; background: var(--paper); border: 4px solid var(--ink); border-radius: 23px 19px 26px 21px; transform: rotate(-4deg); }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.step { min-height: 255px; padding: 30px; }
.step:nth-child(2) { transform: translateY(18px) rotate(0.5deg); }
.step > span { display: block; color: var(--red); font-size: 3rem; line-height: 1; }
.step h3 { margin: 22px 0 12px; }

.gallery-section { overflow: hidden; background: #949494; border-block: 3px solid var(--ink); }
.gallery { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(240px, 0.55fr); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 24px; height: clamp(440px, 48vw, 590px); }
.gallery figure { grid-column: 2; margin: 0; overflow: hidden; }
.gallery figure.is-featured { grid-column: 1; grid-row: 1 / span 2; order: -1; }
.gallery button { display: block; width: 100%; height: 100%; padding: 0; cursor: pointer; background: var(--paper); border: 0; }
.gallery img { width: 100%; height: 100%; object-fit: contain; }

.about-grid { display: grid; grid-template-columns: 1.3fr 0.7fr; gap: 34px; align-items: stretch; }
.about-copy { padding: clamp(28px, 5vw, 58px); }
.about-copy h2 { margin-bottom: 30px; }
.about-copy p:not(.eyebrow) { max-width: 62ch; font-size: 1.13rem; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); overflow: hidden; }
.stat { display: flex; min-height: 170px; flex-direction: column; justify-content: center; padding: 22px; text-align: center; }
.stat:nth-child(odd) { border-right: 3px solid var(--ink); }
.stat:nth-child(n + 3) { border-top: 3px solid var(--ink); }
.stat strong { color: var(--red); font-size: clamp(2.6rem, 5vw, 4.5rem); line-height: 1; }
.stat span { margin-top: 10px; }

.grant-section { background: var(--ink); }
.grant-card { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 42px; padding: clamp(28px, 5vw, 58px); box-shadow: 8px 8px 0 #747474; }
.grant-copy h2 { margin-bottom: 24px; }
.grant-copy p:last-child { max-width: 65ch; }
.grant-logos { display: grid; gap: 18px; align-content: center; }
.grant-logos img { width: 100%; max-height: 112px; padding: 12px; object-fit: contain; background: white; border: 2px solid var(--ink); border-radius: 10px; }

.contact { display: grid; grid-template-columns: 0.65fr 1.35fr; gap: 42px; align-items: start; }
.contact-card { display: grid; gap: 0; overflow: hidden; }
.contact-card > div { display: grid; gap: 4px; padding: 20px 24px; }
.contact-card > div + div { border-top: 3px solid var(--ink); }
.contact-card span, .contact-card small { color: var(--muted); }
.contact-card strong, .contact-card a { font-size: 1.2rem; }
.contact-links a + a { margin-top: 4px; }

footer { color: white; background: var(--ink); }
.footer-inner { display: flex; justify-content: space-between; gap: 24px; padding-block: 30px; }

.leaderboard-page { min-height: calc(100vh - 178px); padding-block: clamp(54px, 8vw, 100px); }
.leaderboard-intro { display: flex; align-items: center; justify-content: space-between; gap: 30px; margin-bottom: 36px; }
.leaderboard-intro h1 { margin-bottom: 18px; }
.leaderboard-intro img { width: 180px; height: 180px; object-fit: cover; border-radius: 42px; transform: rotate(3deg); }
.leaderboard-card { overflow: hidden; }
.board-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 22px; padding: 28px 34px 22px; border-bottom: 3px solid var(--ink); }
.board-heading span { color: var(--muted); }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: clamp(1rem, 2vw, 1.35rem); }
th, td { padding: 16px 34px 13px; text-align: left; border-bottom: 2px solid var(--ink); }
th:first-child, td:first-child { width: 17%; text-align: center; }
th:last-child, td:last-child { width: 26%; text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:nth-child(-n+3) td:first-child { color: var(--red); font-size: 1.35em; }
tbody tr:last-child td { border-bottom: 0; }
.empty-row { padding-block: 42px; text-align: center !important; color: var(--muted); }
.error-note { color: #9e1016; }
.board-note { display: flex; align-items: center; gap: 16px; margin: 30px 10px 0; }
.board-note span { display: grid; flex: 0 0 auto; width: 44px; height: 44px; place-items: center; color: var(--ink); font-size: 1.5rem; background: #d9d9d9; border: 3px solid var(--ink); border-radius: 50%; }
.board-note p { margin: 0; }

@media (max-width: 880px) {
  .hero, .about-grid, .grant-card, .contact { grid-template-columns: 1fr; }
  .hero { gap: 28px; min-height: auto; }
  .hero > .paper, .hero > .paper.is-active { grid-area: auto; width: 100%; transform: none; animation: none; }
  .steps { grid-template-columns: 1fr; }
  .step:nth-child(2) { transform: none; }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: auto auto; height: auto; }
  .gallery figure { grid-column: auto; }
  .gallery figure.is-featured { grid-column: 1 / -1; grid-row: auto; }
  .gallery figure.is-featured button { aspect-ratio: 16 / 8; }
  .gallery figure:not(.is-featured) button { aspect-ratio: 16 / 9; }
}

@media (max-width: 640px) {
  :root { font-size: 16px; }
  .shell { width: min(100% - 22px, 1180px); }
  .site-header { align-items: stretch; flex-direction: column; padding-top: 12px; }
  .brand img { width: 48px; height: 48px; }
  nav { width: 100%; }
  .tab { flex: 1; min-width: 0; padding-inline: 10px; }
  .hero { padding-top: 38px; }
  .hero-copy { padding: 26px 22px 34px; transform: none; }
  .hero-shot img { min-height: 250px; }
  .actions { flex-direction: column; }
  .button { width: 100%; }
  .section-heading { align-items: start; }
  .number-bubble { width: 62px; height: 62px; font-size: 2.6rem; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat { min-height: 135px; padding: 16px 10px; }
  .leaderboard-intro img { display: none; }
  .board-heading { align-items: start; flex-direction: column; padding: 22px 18px 16px; }
  th, td { padding: 14px 16px 11px; }
  th:first-child, td:first-child { width: 14%; }
  th:last-child, td:last-child { width: 32%; }
  .footer-inner { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
