:root {
  --bg: #d9dfc8;
  --surface: #fff7e6;
  --surface-alt: #eef2dc;
  --text: #182212;
  --muted: #4f5d43;
  --line: #9f845b;
  --accent: #557b39;
  --accent-strong: #294a24;
  --sun: #c28a3c;
  --rose: #7d5235;
  --wood: #684626;
  --shadow: 0 24px 60px rgb(55 42 26 / 18%);
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    linear-gradient(180deg, #cbd6b5 0, var(--bg) 360px),
    var(--bg);
  color: var(--text);
  line-height: 1.6;
}

a {
  color: inherit;
}

code {
  padding: 0.15rem 0.35rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgb(255 255 255 / 62%);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 4rem);
  border-bottom: 1px solid rgb(104 70 38 / 38%);
  background: rgb(41 74 36 / 94%);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 800;
  text-decoration: none;
  color: #fff7e6;
}

.brand-mark {
  width: 2.25rem;
  aspect-ratio: 1;
  flex: 0 0 auto;
  border-radius: 4px;
  background: url("../img/homeicon.png?v=2") center / contain no-repeat;
  box-shadow: 0 8px 18px rgb(12 28 10 / 18%);
}

main {
  overflow: hidden;
}

.profile-banner {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  padding: clamp(0.75rem, 2.5vw, 1.5rem) 0;
  background: var(--accent-strong);
}

.profile-banner-stack {
  display: grid;
  gap: 1rem;
  width: min(1120px, calc(100% - 2rem));
  margin-inline: auto;
}

.profile-banner-frame {
  width: 100%;
  aspect-ratio: 2.21519 / 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.profile-banner-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.identity-field,
.info-box {
  display: grid;
  gap: 0.3rem;
  border: 1px solid rgb(104 70 38 / 38%);
  border-radius: 8px;
  background: rgb(255 247 230 / 94%);
  box-shadow: 0 18px 42px rgb(55 42 26 / 20%);
}

.identity-field {
  width: 100%;
  padding: clamp(1rem, 3vw, 1.45rem);
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 18px 42px rgb(22 31 18 / 18%);
  font-size: clamp(2rem, 7vw, 5.25rem);
  font-weight: 900;
  line-height: 1;
  text-align: center;
  text-transform: none;
  overflow-wrap: anywhere;
}

.name-field {
  font-size: clamp(1.55rem, 7vw, 5.25rem);
  white-space: nowrap;
  overflow-wrap: normal;
}

.college-field {
  padding-inline: clamp(0.65rem, 2vw, 1.2rem);
  font-size: clamp(0.46rem, 2.35vw, 1.75rem);
  line-height: 1.08;
  white-space: nowrap;
  overflow-wrap: normal;
}

.profile-shell {
  width: min(1120px, calc(100% - 2rem));
  margin-inline: auto;
  padding-block: clamp(1.25rem, 4vw, 3rem) clamp(3rem, 8vw, 6rem);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: clamp(1.5rem, 4vw, 3rem);
}

.info-box {
  grid-template-rows: auto minmax(0, 1fr);
  height: 116px;
  padding: 1rem;
  border-color: var(--line);
  background: var(--surface-alt);
  color: var(--text);
  text-decoration: none;
}

.info-box span {
  color: var(--accent-strong);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.info-box strong,
.project-card strong {
  font-size: clamp(0.95rem, 1.3vw, 1.1rem);
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.info-box strong {
  align-self: end;
}

.resume-tile-image {
  align-self: center;
  justify-self: center;
  width: auto;
  max-width: 100%;
  max-height: 64px;
  min-height: 0;
  object-fit: contain;
}

.email-box strong {
  font-size: clamp(0.78rem, 1.08vw, 0.98rem);
  white-space: nowrap;
  overflow-wrap: normal;
}

.project-card strong {
  align-self: flex-start;
  width: 100%;
  text-align: left;
}

a.info-box:hover,
.project-card:hover {
  border-color: rgb(95 141 69 / 56%);
  transform: translateY(-2px);
  transition: border-color 160ms ease, transform 160ms ease;
}

.cover-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(290px, 380px);
  gap: clamp(1rem, 4vw, 2rem);
  align-items: start;
}

.about-me-field,
.project-panel,
.posterboard-panel,
.recent-messages-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 14px 34px rgb(55 42 26 / 14%);
}

.about-me-field {
  justify-self: start;
  width: 100%;
  padding: clamp(1.25rem, 4vw, 2.25rem);
}

.about-me-field h1 {
  max-width: none;
  margin-bottom: 1.25rem;
  font-size: clamp(2rem, 5vw, 3.75rem);
}

.about-me-field p:not(.eyebrow) {
  max-width: 74ch;
  color: var(--muted);
  font-size: clamp(1rem, 1.6vw, 1.12rem);
}

.about-preview {
  max-height: 5.6rem;
  margin-bottom: 0;
  overflow: hidden;
  mask-image: linear-gradient(to bottom, black 0%, black 28%, rgb(0 0 0 / 65%) 58%, transparent 100%);
}

.about-preview[hidden] {
  display: none;
}

.about-extra[hidden] {
  display: none;
}

.about-toggle {
  display: grid;
  place-items: center;
  width: 3rem;
  aspect-ratio: 1;
  margin: 1rem auto 0;
  border: 1px solid rgb(104 70 38 / 38%);
  border-radius: 999px;
  background: var(--accent-strong);
  color: var(--surface);
  font: inherit;
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.about-toggle:hover {
  background: var(--wood);
}

.about-toggle[aria-expanded="true"] span {
  transform: rotate(180deg);
}

.about-toggle span {
  transition: transform 160ms ease;
}

.image-carousel {
  display: grid;
  gap: 0.85rem;
  margin-top: clamp(1.5rem, 4vw, 2.25rem);
}

.carousel-frame {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-alt);
}

.carousel-track {
  display: flex;
  width: 100%;
  transition: transform 220ms ease;
}

.carousel-slide {
  flex: 0 0 100%;
  margin: 0;
}

.carousel-slide img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--surface-alt);
  object-fit: contain;
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  display: grid;
  place-items: center;
  width: 2.75rem;
  aspect-ratio: 1;
  border: 1px solid rgb(255 255 255 / 72%);
  border-radius: 999px;
  background: rgb(29 38 25 / 78%);
  color: white;
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1;
  transform: translateY(-50%);
  cursor: pointer;
}

.carousel-arrow:hover {
  background: var(--accent-strong);
}

.carousel-arrow.previous {
  left: 0.75rem;
}

.carousel-arrow.next {
  right: 0.75rem;
}

.carousel-description {
  min-height: 5.25rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
  background: var(--surface-alt);
}

.carousel-description-text {
  display: none;
  margin: 0;
  color: var(--muted);
}

.carousel-description-text.active {
  display: block;
}

.project-panel {
  position: sticky;
  top: 6rem;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: var(--project-panel-height, auto);
  max-height: var(--project-panel-height, min(620px, calc(100vh - 12rem)));
  padding: 1rem;
}

.project-heading {
  padding: 0.25rem 0.25rem 0.9rem;
}

.project-heading .project-heading-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.project-heading h2 {
  font-size: clamp(1.45rem, 3vw, 2rem);
}

.project-list {
  display: grid;
  align-content: start;
  gap: 0.75rem;
  grid-auto-rows: max-content;
  min-height: 0;
  overflow-y: auto;
  padding-right: 0.35rem;
  scrollbar-color: var(--accent) rgb(95 141 69 / 14%);
}

.posterboard-panel {
  display: grid;
  align-content: start;
  gap: 1rem;
  width: 100%;
  padding: clamp(1.25rem, 4vw, 2.25rem);
}

.posterboard-panel h2 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.75rem);
}

.posterboard-panel > p {
  margin: 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.6vw, 1.12rem);
}

.posterboard-form {
  position: relative;
  display: grid;
  gap: 0.8rem;
}

.posterboard-form label {
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.posterboard-form textarea {
  width: 100%;
  min-height: 10rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
  background: var(--surface-alt);
  color: var(--text);
  font: inherit;
  line-height: 1.5;
  resize: vertical;
}

.posterboard-form textarea:focus {
  outline: 3px solid rgb(85 123 57 / 24%);
  outline-offset: 2px;
}

.posterboard-form .button {
  justify-self: start;
  min-width: 8rem;
}

.posterboard-success {
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  background: var(--surface-alt);
  color: var(--accent-strong) !important;
  font-weight: 800;
}

.posterboard-honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.recent-messages-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: var(--recent-messages-panel-height, auto);
  min-height: 0;
  padding: 1rem;
}

.message-list {
  display: grid;
  align-content: start;
  gap: 0.75rem;
  min-height: 0;
  padding-right: 0.35rem;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-color: var(--accent) rgb(95 141 69 / 14%);
}

.message-card {
  display: grid;
  align-content: start;
  gap: 0.75rem;
  width: 100%;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
  background: #fbf1d7;
}

.message-card time {
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.message-card p {
  margin: 0;
  color: var(--text);
  line-height: 1.6;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.message-carousel-empty {
  display: grid;
  place-items: center;
  min-height: 12rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
  background: var(--surface-alt);
  color: var(--muted);
  text-align: center;
}

.message-carousel-empty p {
  margin: 0;
}

.project-card {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-height: 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf1d7;
  color: var(--text);
  text-decoration: none;
}

.project-card img {
  flex: 0 0 auto;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid rgb(111 79 48 / 26%);
  border-radius: 6px;
  object-fit: cover;
}

.project-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.bird-hero {
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  overflow: hidden;
  padding: 20px;
  background: rgb(41 74 36 / 94%);
}

.bird-index-hero {
  min-height: clamp(300px, 42vw, 520px);
  padding: 0;
  background: var(--accent-strong);
}

.bird-index-hero > img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bird-hero-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: stretch;
  gap: 20px;
  margin-bottom: 20px;
}

.wiki-logo-link {
  display: block;
  width: calc(clamp(3.25rem, 7.5vw, 8rem) * 750 / 267);
  height: clamp(3.25rem, 7.5vw, 8rem);
  background: url("/static/img/wikipedia-banner.webp") center / contain no-repeat;
}

.bird-hero-content {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  width: 100%;
}

.bird-hero-summary {
  position: relative;
  align-self: center;
  min-width: 0;
  height: 50vh;
  min-height: 0;
}

.bird-hero-summary p {
  display: grid;
  align-content: center;
  width: 100%;
  height: 100%;
  margin: 0;
  border: 1px solid rgb(104 70 38 / 38%);
  border-radius: 8px;
  padding: clamp(1.25rem, 4vw, 3.25rem);
  background: rgb(255 247 230 / 92%);
  box-shadow: 0 18px 42px rgb(55 42 26 / 20%);
  color: var(--text);
  font-size: var(--wiki-summary-font-size, clamp(1.1rem, 2.25vw, 1.62rem));
  line-height: 1.5;
  text-align: center;
  overflow: hidden;
}

.bird-hero-image-box {
  position: relative;
  align-self: center;
  justify-self: end;
  width: calc(50vh * var(--bird-hero-image-ratio, 1.33));
  height: 50vh;
  min-height: 0;
  border: 1px solid rgb(255 255 255 / 32%);
  border-radius: 8px;
  background: var(--surface-alt);
  box-shadow: 0 18px 42px rgb(22 31 18 / 28%);
  overflow: hidden;
}

.bird-hero-image-stack,
.bird-hero-image-stack img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.bird-hero-image-stack img {
  object-fit: contain;
}

.bird-hero-image {
  opacity: 0;
  transition: opacity 900ms ease;
}

.bird-hero-image.active {
  opacity: 1;
}

.bird-hero-title {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  min-height: clamp(300px, 42vw, 520px);
  width: min(1120px, calc(100% - 2rem));
  margin-inline: auto;
}

.bird-index-hero .bird-hero-title {
  min-height: inherit;
}

.bird-hero-title h1,
.bird-title-link,
.bird-name-field h1 {
  width: max-content;
  max-width: 100%;
  border: 1px solid rgb(255 255 255 / 48%);
  border-radius: 8px;
  padding: clamp(1rem, 3vw, 1.5rem);
  background: rgb(255 248 234 / 90%);
  color: var(--text);
  font-size: clamp(2rem, 7vw, 5.25rem);
  font-weight: 900;
  line-height: 1.05;
  text-decoration: none;
  text-align: center;
  white-space: nowrap;
  overflow-wrap: normal;
  box-shadow: 0 18px 42px rgb(55 42 26 / 16%);
}

.bird-name-field {
  display: grid;
  justify-items: center;
  margin-bottom: 1.25rem;
}

.bird-name-field-top {
  height: clamp(3.25rem, 7.5vw, 8rem);
  margin-bottom: 0;
}

.bird-name-field-top .bird-title-link,
.bird-name-field-top h1 {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 0 clamp(1rem, 3vw, 2rem);
  font-size: clamp(1.7rem, 5vw, 4.5rem);
}

.bird-title-link:hover {
  color: var(--accent-strong);
}

.bird-page-shell {
  width: min(1120px, calc(100% - 2rem));
  margin-inline: auto;
  padding-block: clamp(2rem, 6vw, 4rem);
}

.recent-sightings,
.bird-directory {
  display: grid;
  gap: 1rem;
}

.bird-intro-card {
  display: grid;
  gap: 0;
  margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
  border: 1px solid rgb(104 70 38 / 58%);
  border-radius: 8px;
  background: #fbf1d7;
  box-shadow: 0 14px 34px rgb(55 42 26 / 14%);
  overflow: hidden;
}

.bird-intro-card .eyebrow {
  margin: 0;
  border-bottom: 1px solid rgb(104 70 38 / 42%);
  padding: 0.85rem 1rem;
  background: var(--surface-alt);
}

.bird-intro-copy {
  display: grid;
  gap: 0.85rem;
  padding: clamp(1.15rem, 3vw, 1.5rem);
  background: #fbf1d7;
}

.bird-intro-copy p {
  max-width: none;
  margin: 0;
  color: var(--muted);
}

.bird-directory {
  margin-top: clamp(2rem, 6vw, 4rem);
}

.bird-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.bird-section-heading h2 {
  font-size: clamp(1.7rem, 4vw, 2.8rem);
}

.latest-sighting-card,
.bird-grid-card,
.bird-photo-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 14px 34px rgb(24 33 31 / 8%);
}

.latest-sighting-card,
.bird-grid-card {
  display: grid;
  gap: 0.8rem;
  padding: 1rem;
  color: var(--text);
  text-decoration: none;
}

.latest-sighting-card {
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
  align-items: center;
}

.latest-sighting-card:hover,
.bird-grid-card:hover,
.back-link:hover {
  border-color: rgb(95 141 69 / 56%);
  transform: translateY(-2px);
  transition: border-color 160ms ease, transform 160ms ease;
}

.latest-sighting-card img,
.bird-grid-card img,
.bird-photo-card img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 6px;
  object-fit: cover;
}

.latest-sighting-card strong,
.bird-grid-card strong {
  font-size: 1.05rem;
  line-height: 1.2;
}

.latest-sighting-card p {
  margin: 0.5rem 0 0;
  color: var(--muted);
}

.bird-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.back-link {
  display: inline-flex;
  margin-bottom: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.7rem 0.9rem;
  background: var(--surface);
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
}

.bird-photo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.bird-photo-card {
  margin: 0;
  overflow: hidden;
}

.bird-photo-card img {
  border-radius: 0;
}

.bird-photo-card figcaption {
  padding: 0.85rem 1rem;
}

.bird-photo-card time {
  color: var(--muted);
  font-weight: 800;
}

.hero,
.page-hero,
.section,
.split-section,
.contact-layout,
.band {
  width: min(1120px, calc(100% - 2rem));
  margin-inline: auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  align-items: center;
  gap: clamp(2rem, 6vw, 5rem);
  min-height: calc(100vh - 76px);
  padding-block: clamp(4rem, 9vw, 7rem);
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.05;
}

h1 {
  max-width: 12ch;
  font-size: clamp(3.25rem, 12vw, 7.2rem);
}

h2 {
  font-size: clamp(2rem, 5vw, 3.5rem);
}

h3 {
  font-size: 1.15rem;
}

.hero-text,
.page-hero p,
.contact-panel p,
.split-section p {
  max-width: 64ch;
  color: var(--muted);
  font-size: 1.08rem;
}

.hero-actions,
.band {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.78rem 1rem;
  border: 1px solid transparent;
  border-radius: 7px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.button.primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 14px 30px rgb(52 90 46 / 22%);
}

.button.primary:hover {
  background: var(--accent-strong);
}

.button.secondary {
  border-color: var(--line);
  background: rgb(255 248 234 / 74%);
  color: var(--text);
}

.hero-visual {
  min-height: 440px;
  border: 1px solid rgb(255 255 255 / 60%);
  border-radius: 8px;
  background:
    linear-gradient(140deg, rgb(255 255 255 / 62%), rgb(255 255 255 / 20)),
    linear-gradient(135deg, var(--accent-strong), var(--accent) 48%, var(--wood));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.browser-bar {
  display: flex;
  gap: 0.45rem;
  padding: 1rem;
  background: rgb(24 33 31 / 78%);
}

.browser-bar span {
  width: 0.72rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--sun);
}

.browser-bar span:nth-child(2) {
  background: var(--rose);
}

.browser-bar span:nth-child(3) {
  background: var(--accent);
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: 90px;
  gap: 1rem;
  padding: 1.5rem;
}

.preview-grid div {
  border-radius: 8px;
  background: rgb(255 255 255 / 68%);
  box-shadow: 0 12px 24px rgb(24 33 31 / 10%);
}

.preview-grid div:nth-child(1) {
  grid-column: span 6;
}

.preview-grid div:nth-child(2) {
  grid-column: span 3;
}

.preview-grid div:nth-child(3) {
  grid-column: span 3;
}

.preview-grid div:nth-child(4) {
  grid-column: span 6;
}

.section,
.split-section,
.contact-layout,
.band {
  padding-block: clamp(3rem, 8vw, 6rem);
}

.section-heading {
  display: grid;
  grid-template-columns: 0.65fr 1.35fr;
  gap: 2rem;
  align-items: start;
  margin-bottom: 2rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.feature-card,
.contact-form,
.contact-panel,
.stat-list div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 12px 28px rgb(24 33 31 / 8%);
}

.feature-card {
  padding: 1.4rem;
}

.feature-card p {
  margin-bottom: 0;
  color: var(--muted);
}

.band {
  justify-content: space-between;
  margin-bottom: 4rem;
  border-block: 1px solid var(--line);
}

.page-hero {
  padding-block: clamp(4rem, 10vw, 7rem) clamp(2rem, 5vw, 4rem);
}

.page-hero.compact {
  padding-bottom: 1rem;
}

.page-hero h1 {
  max-width: 16ch;
  font-size: clamp(2.5rem, 7vw, 5rem);
}

.split-section,
.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.75fr);
  gap: clamp(1.5rem, 5vw, 4rem);
  align-items: start;
}

.stat-list {
  display: grid;
  gap: 1rem;
  margin: 0;
}

.stat-list div {
  padding: 1.25rem;
}

.stat-list dt {
  color: var(--accent-strong);
  font-size: 2.4rem;
  font-weight: 900;
  line-height: 1;
}

.stat-list dd {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-weight: 700;
}

.contact-panel,
.contact-form {
  padding: clamp(1.25rem, 3vw, 2rem);
}

.contact-form {
  display: grid;
  gap: 1rem;
}

.contact-form label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-weight: 800;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.8rem 0.9rem;
  background: white;
  color: var(--text);
  font: inherit;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--accent);
  outline: 3px solid rgb(95 141 69 / 20%);
}

.success-message {
  border: 1px solid rgb(95 141 69 / 30%);
  border-radius: 6px;
  padding: 0.85rem 1rem;
  background: rgb(95 141 69 / 12%);
  color: var(--accent-strong);
  font-weight: 800;
}

.digit-reader-page {
  width: min(1180px, calc(100% - 2rem));
  margin-inline: auto;
  padding-block: clamp(2rem, 6vw, 4.5rem);
}

.digit-reader-intro {
  display: grid;
  gap: 0.85rem;
  max-width: 880px;
  margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
}

.digit-reader-intro h1 {
  max-width: none;
  font-size: clamp(2.7rem, 9vw, 6rem);
}

.digit-reader-intro .behind-title {
  font-size: clamp(2rem, 7vw, 4.6rem);
  white-space: nowrap;
}

.digit-reader-intro p:not(.eyebrow) {
  max-width: 72ch;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.5vw, 1.16rem);
}

.digit-draw-stage {
  display: grid;
  grid-template-columns: minmax(300px, 420px) minmax(0, 1fr);
  gap: clamp(1rem, 4vw, 2rem);
  align-items: stretch;
}

.digit-draw-panel,
.digit-help-panel,
.layer-notes,
.layer-visual {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 14px 34px rgb(55 42 26 / 12%);
}

.digit-draw-panel {
  display: grid;
  gap: 1rem;
  align-content: start;
  padding: clamp(1rem, 3vw, 1.4rem);
}

.digit-canvas-shell {
  display: grid;
  place-items: center;
  border: 1px solid rgb(104 70 38 / 42%);
  border-radius: 8px;
  padding: 0.75rem;
  background:
    linear-gradient(135deg, rgb(255 255 255 / 10%), rgb(255 255 255 / 0)),
    #152014;
}

#digit-canvas {
  display: block;
  width: min(100%, 280px);
  aspect-ratio: 1;
  border: 1px solid rgb(255 255 255 / 28%);
  border-radius: 6px;
  background: #050806;
  cursor: crosshair;
  touch-action: none;
}

.digit-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.digit-actions .button {
  width: 100%;
}

.digit-status {
  min-height: 3.25rem;
  margin: 0;
  border: 1px solid rgb(95 141 69 / 30%);
  border-radius: 6px;
  padding: 0.8rem;
  background: rgb(95 141 69 / 11%);
  color: var(--accent-strong);
  font-weight: 800;
}

.digit-help-panel {
  display: grid;
  align-content: center;
  gap: 1rem;
  padding: clamp(1.25rem, 4vw, 2rem);
}

.digit-help-panel h2 {
  font-size: clamp(1.65rem, 4vw, 2.8rem);
}

.digit-help-panel ul {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
  font-size: 1.05rem;
}

.digit-slideshow {
  display: grid;
  gap: 1rem;
}

.digit-slideshow[hidden],
.digit-draw-stage[hidden] {
  display: none;
}

.digit-slide-topbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
  background: rgb(255 247 230 / 92%);
}

.digit-slide-topbar h2 {
  font-size: clamp(1.5rem, 4vw, 2.7rem);
}

.slide-nav-button {
  display: grid;
  place-items: center;
  width: 3rem;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--accent-strong);
  color: white;
  font: inherit;
  font-size: 1.25rem;
  font-weight: 900;
  cursor: pointer;
}

.slide-nav-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.digit-slide-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  gap: 1rem;
  align-items: start;
}

.layer-visual,
.layer-notes {
  min-height: 460px;
  padding: clamp(1rem, 3vw, 1.35rem);
}

.layer-visual {
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 1rem;
  overflow: auto;
}

.layer-notes {
  display: grid;
  align-content: start;
  gap: 1rem;
}

.layer-notes p {
  margin: 0;
  color: var(--muted);
}

.layer-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.layer-stat-grid div {
  display: grid;
  gap: 0.25rem;
  min-height: 76px;
  border: 1px solid rgb(104 70 38 / 32%);
  border-radius: 6px;
  padding: 0.75rem;
  background: var(--surface-alt);
}

.layer-stat-grid span {
  color: var(--accent-strong);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.layer-stat-grid strong {
  align-self: end;
  font-size: clamp(0.92rem, 1.4vw, 1.08rem);
  overflow-wrap: anywhere;
}

.pixel-grid,
.feature-map {
  display: grid;
  grid-template-columns: repeat(var(--grid-width), minmax(0, 1fr));
  width: min(100%, 360px);
  aspect-ratio: 1;
  border: 1px solid rgb(104 70 38 / 32%);
  border-radius: 6px;
  overflow: hidden;
  background: #050806;
}

.pixel-grid span,
.feature-map span {
  aspect-ratio: 1;
}

.feature-map-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(90px, 1fr));
  gap: 0.8rem;
  width: 100%;
}

.feature-map-grid figure {
  display: grid;
  gap: 0.35rem;
  margin: 0;
  justify-items: center;
}

.feature-map-grid figcaption {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.feature-map {
  width: 100%;
}

.neuron-bars {
  display: grid;
  gap: 0.38rem;
  width: 100%;
}

.neuron-row {
  display: grid;
  grid-template-columns: 3.2rem minmax(0, 1fr) 4.25rem;
  align-items: center;
  gap: 0.55rem;
}

.neuron-row span,
.neuron-row strong {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.neuron-row i {
  display: block;
  height: 0.8rem;
  border-radius: 999px;
  background: var(--accent);
}

.neuron-row i.negative {
  background: var(--rose);
}

.probability-grid {
  display: grid;
  grid-template-columns: repeat(10, minmax(44px, 1fr));
  gap: 0.6rem;
  width: 100%;
  min-height: 260px;
  align-items: end;
}

.probability-item {
  display: grid;
  grid-template-rows: auto minmax(120px, 1fr) auto;
  gap: 0.35rem;
  justify-items: center;
  height: 100%;
}

.probability-item span,
.probability-item strong {
  color: var(--muted);
  font-weight: 900;
}

.probability-item i {
  align-self: end;
  width: 100%;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, var(--sun), var(--accent));
}

.prediction-result {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  width: min(100%, 620px);
}

.prediction-result div {
  display: grid;
  gap: 0.65rem;
  justify-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
  background: var(--surface-alt);
}

.prediction-result span {
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.prediction-result img {
  width: min(100%, 180px);
  aspect-ratio: 1;
  border: 1px solid rgb(104 70 38 / 32%);
  border-radius: 6px;
  image-rendering: pixelated;
  background: #050806;
}

.prediction-result strong {
  display: grid;
  place-items: center;
  width: min(100%, 180px);
  aspect-ratio: 1;
  border: 1px solid rgb(104 70 38 / 32%);
  border-radius: 6px;
  background: #050806;
  color: white;
  font-size: clamp(5rem, 16vw, 8rem);
  line-height: 1;
}

.final-action-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
}

.weight-preview {
  display: grid;
  gap: 0.55rem;
}

.weight-preview h3 {
  font-size: 1.05rem;
}

.weight-sample {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.weight-sample span {
  border: 1px solid rgb(95 141 69 / 30%);
  border-radius: 5px;
  padding: 0.24rem 0.38rem;
  background: rgb(95 141 69 / 12%);
  color: var(--accent-strong);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.78rem;
  font-weight: 800;
}

.weight-sample span.negative {
  border-color: rgb(125 82 53 / 34%);
  background: rgb(125 82 53 / 12%);
  color: var(--rose);
}

.correction-layout {
  display: grid;
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
  gap: clamp(1rem, 4vw, 2rem);
  align-items: start;
}

.correction-preview-panel,
.correction-form,
.tech-section,
.tech-hero-grid article,
.pipeline-grid article,
.tech-list-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 14px 34px rgb(55 42 26 / 12%);
}

.correction-preview-panel,
.correction-form {
  display: grid;
  gap: 1rem;
  padding: clamp(1rem, 3vw, 1.4rem);
}

.correction-preview-frame {
  display: grid;
  place-items: center;
  border: 1px solid rgb(104 70 38 / 42%);
  border-radius: 8px;
  padding: 1rem;
  background: #050806;
}

.correction-preview-frame img {
  width: min(100%, 220px);
  aspect-ratio: 1;
  image-rendering: pixelated;
}

.correction-model-readout {
  display: grid;
  gap: 0.35rem;
  justify-items: center;
  border: 1px solid rgb(104 70 38 / 32%);
  border-radius: 8px;
  padding: 1rem;
  background: var(--surface-alt);
  text-align: center;
}

.correction-model-readout span,
.tech-hero-grid span,
.pipeline-grid span {
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.correction-model-readout strong {
  display: grid;
  place-items: center;
  width: 5rem;
  aspect-ratio: 1;
  border-radius: 8px;
  background: #050806;
  color: white;
  font-size: 4rem;
  line-height: 1;
}

.correction-model-readout p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.correction-form h2,
.tech-section h2 {
  font-size: clamp(1.55rem, 4vw, 2.7rem);
}

.digit-label-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.65rem;
}

.digit-label-grid label {
  cursor: pointer;
}

.digit-label-grid input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.digit-label-grid span {
  display: grid;
  place-items: center;
  min-height: 4.25rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-alt);
  color: var(--text);
  font-size: 2rem;
  font-weight: 900;
}

.digit-label-grid input:checked + span {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
  color: white;
}

.digit-label-grid input:focus-visible + span {
  outline: 3px solid rgb(95 141 69 / 28%);
  outline-offset: 2px;
}

.correction-actions,
.behind-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.tech-hero-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: clamp(1.25rem, 4vw, 2rem);
}

.tech-hero-grid article,
.pipeline-grid article,
.tech-list-grid article,
.tech-section {
  display: grid;
  gap: 0.7rem;
  align-content: start;
  padding: clamp(1rem, 3vw, 1.35rem);
}

.tech-hero-grid strong {
  font-size: clamp(1.45rem, 3vw, 2.15rem);
  line-height: 1.05;
}

.tech-hero-grid p,
.tech-section p,
.pipeline-grid p,
.tech-list-grid li {
  margin: 0;
  color: var(--muted);
}

.tech-section {
  margin-top: 1rem;
}

.pipeline-grid,
.tech-list-grid {
  display: grid;
  gap: 1rem;
}

.pipeline-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.tech-list-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pipeline-grid span {
  display: grid;
  place-items: center;
  width: 2.5rem;
  aspect-ratio: 1;
  border-radius: 999px;
  background: var(--accent-strong);
  color: white;
}

.tech-list-grid ul {
  display: grid;
  gap: 0.55rem;
  margin: 0;
  padding-left: 1.1rem;
}

.socialcodex-page {
  --social-bg: #10171d;
  --social-panel: #17232a;
  --social-panel-2: #202c33;
  --social-line: #3d5657;
  --social-text: #f6f0de;
  --social-muted: #bac7bd;
  --social-cyan: #62c4bd;
  --social-gold: #d8a24c;
  --social-red: #d97963;
  --social-green: #86bf73;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  padding-bottom: clamp(3rem, 8vw, 6rem);
  background:
    linear-gradient(180deg, #122026 0, var(--social-bg) 420px),
    var(--social-bg);
  color: var(--social-text);
}

.socialcodex-page .eyebrow {
  color: var(--social-cyan);
}

.socialcodex-hero,
.socialcodex-dashboard,
.socialcodex-artifacts,
.socialcodex-notes {
  width: min(1180px, calc(100% - 2rem));
  margin-inline: auto;
}

.socialcodex-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 390px);
  gap: clamp(1rem, 4vw, 2rem);
  align-items: end;
  padding-block: clamp(3rem, 8vw, 6rem) clamp(2rem, 5vw, 3rem);
}

.socialcodex-hero h1 {
  max-width: none;
  color: var(--social-text);
  font-size: clamp(1.15rem, 5.3vw, 4.35rem);
  letter-spacing: -0.035em;
  white-space: nowrap;
}

.socialcodex-hero p:not(.eyebrow),
.socialcodex-notes p,
.artifact-grid figcaption {
  color: var(--social-muted);
}

.socialcodex-hero-copy {
  display: grid;
  gap: 1rem;
}

.socialcodex-hero-copy p:not(.eyebrow) {
  max-width: 72ch;
  margin: 0;
  font-size: clamp(1rem, 1.6vw, 1.14rem);
}

.socialcodex-hero-action {
  align-self: end;
  justify-self: start;
}

.socialcodex-hero-panel {
  display: grid;
  gap: 0.7rem;
  border: 1px solid var(--social-line);
  border-radius: 8px;
  padding: 1rem;
  background: rgb(23 35 42 / 88%);
  box-shadow: 0 24px 60px rgb(0 0 0 / 30%);
}

.socialcodex-hero-panel div,
.showdown-model-card,
.showdown-feed,
.showdown-matrix,
.class-win-card,
.artifact-grid figure,
.socialcodex-notes article {
  border: 1px solid var(--social-line);
  border-radius: 8px;
  background: var(--social-panel);
}

.socialcodex-hero-panel div {
  display: grid;
  gap: 0.25rem;
  min-height: 90px;
  padding: 1rem;
  background: var(--social-panel-2);
}

.socialcodex-hero-panel span,
.showdown-model-card dt,
.class-win-card dt,
.post-feed-topline span,
.post-feed-topline strong {
  color: var(--social-cyan);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.socialcodex-hero-panel strong {
  align-self: end;
  color: var(--social-text);
  font-size: clamp(1.55rem, 4vw, 2.4rem);
  line-height: 1;
}

.socialcodex-dashboard {
  display: grid;
  gap: 1rem;
  border: 1px solid rgb(98 196 189 / 18%);
  border-radius: 8px;
  padding: clamp(1rem, 3vw, 1.25rem);
  background: rgb(12 19 23 / 72%);
}

.socialcodex-dashboard-head,
.showdown-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.socialcodex-dashboard-head h2,
.showdown-section-heading h2 {
  color: var(--social-text);
  font-size: clamp(1.55rem, 4vw, 2.7rem);
}

.socialcodex-refresh-button:disabled {
  cursor: progress;
  opacity: 0.72;
}

.live-status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.live-status-grid div {
  display: grid;
  gap: 0.35rem;
  min-height: 86px;
  border: 1px solid var(--social-line);
  border-radius: 8px;
  padding: 0.85rem;
  background: var(--social-panel);
}

.live-status-grid span {
  color: var(--social-cyan);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.live-status-grid strong {
  align-self: end;
  color: var(--social-text);
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.showdown-scoreboard {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.showdown-model-card {
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
}

.showdown-model-card.leading {
  border-color: rgb(98 196 189 / 74%);
}

.model-card-topline {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 0.75rem;
}

.model-card-topline h3 {
  color: var(--social-text);
}

.model-card-topline span {
  border: 1px solid rgb(98 196 189 / 42%);
  border-radius: 999px;
  padding: 0.22rem 0.55rem;
  background: rgb(98 196 189 / 12%);
  color: var(--social-cyan);
  font-size: 0.72rem;
  font-weight: 900;
}

.showdown-model-card dl,
.class-win-card dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  margin: 0;
}

.showdown-model-card dl div,
.class-win-card dl div {
  min-height: 72px;
  border: 1px solid rgb(61 86 87 / 68%);
  border-radius: 6px;
  padding: 0.7rem;
  background: var(--social-panel-2);
}

.showdown-model-card dd,
.class-win-card dd {
  margin: 0.2rem 0 0;
  color: var(--social-text);
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1;
}

.showdown-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(420px, 1.08fr);
  gap: 1rem;
  align-items: stretch;
}

.showdown-feed,
.showdown-matrix,
.class-wins-section,
.socialcodex-artifacts,
.socialcodex-notes article {
  padding: clamp(1rem, 3vw, 1.25rem);
}

.showdown-feed,
.showdown-matrix {
  height: clamp(32rem, 48vw, 38rem);
}

.showdown-section-heading {
  margin-bottom: 1rem;
}

.showdown-section-heading > span {
  flex: 0 0 auto;
  border: 1px solid rgb(216 162 76 / 40%);
  border-radius: 999px;
  padding: 0.35rem 0.65rem;
  color: var(--social-gold);
  font-weight: 900;
}

.post-feed-list {
  display: grid;
  gap: 0.75rem;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 0.35rem;
  scrollbar-gutter: stable;
}

.showdown-feed {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}

.post-feed-card {
  display: grid;
  gap: 0.55rem;
  border: 1px solid rgb(61 86 87 / 74%);
  border-radius: 8px;
  padding: 0.9rem;
  background: var(--social-panel-2);
}

.post-feed-card.fresh {
  border-color: rgb(216 162 76 / 68%);
  box-shadow: inset 4px 0 0 var(--social-gold);
}

.post-feed-topline,
.post-prediction-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.post-feed-topline {
  justify-content: space-between;
}

.post-feed-card h3 {
  color: var(--social-text);
  font-size: 1.05rem;
}

.post-feed-card h3 a {
  color: inherit;
  text-decoration-color: rgb(98 196 189 / 52%);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.post-feed-card p {
  margin: 0;
  color: var(--social-muted);
}

.post-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.post-meta-row span {
  border: 1px solid rgb(61 86 87 / 82%);
  border-radius: 999px;
  padding: 0.22rem 0.5rem;
  color: var(--social-muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.post-prediction-row span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid rgb(61 86 87 / 90%);
  border-radius: 999px;
  padding: 0.28rem 0.55rem;
  color: var(--social-muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.post-prediction-row span.correct {
  border-color: rgb(134 191 115 / 44%);
  color: #c8e8bd;
}

.post-prediction-row span.miss {
  border-color: rgb(217 121 99 / 40%);
  color: #efc3b8;
}

.post-prediction-row span.winner {
  box-shadow: inset 0 -3px 0 var(--social-gold);
}

.matrix-model-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.matrix-tab {
  min-height: 2.6rem;
  border: 1px solid var(--social-line);
  border-radius: 7px;
  background: var(--social-panel-2);
  color: var(--social-muted);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.matrix-tab.active,
.matrix-tab:hover {
  border-color: var(--social-cyan);
  background: rgb(98 196 189 / 14%);
  color: var(--social-text);
}

.matrix-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.confusion-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  color: var(--social-text);
}

.confusion-table caption {
  margin-bottom: 0.5rem;
  color: var(--social-muted);
  text-align: left;
}

.confusion-table th,
.confusion-table td {
  border: 1px solid rgb(61 86 87 / 78%);
  padding: 0.65rem;
  text-align: center;
}

.confusion-table th {
  background: #101a20;
  color: var(--social-cyan);
  font-size: 0.76rem;
}

.confusion-table td {
  background:
    linear-gradient(180deg, rgb(98 196 189 / calc(var(--intensity) * 0.48)), rgb(98 196 189 / calc(var(--intensity) * 0.22))),
    var(--social-panel-2);
}

.confusion-table td.matrix-hit {
  background:
    linear-gradient(180deg, rgb(134 191 115 / calc(var(--intensity) * 0.54)), rgb(134 191 115 / calc(var(--intensity) * 0.26))),
    var(--social-panel-2);
}

.confusion-table td strong,
.confusion-table td span {
  display: block;
}

.confusion-table td strong {
  font-size: 1.05rem;
}

.confusion-table td span {
  color: var(--social-muted);
  font-size: 0.75rem;
}

.class-wins-section {
  border: 1px solid var(--social-line);
  border-radius: 8px;
  background: var(--social-panel);
}

.class-wins-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem;
}

.class-win-card {
  display: grid;
  gap: 0.75rem;
  padding: 0.85rem;
}

.class-win-card h3 {
  color: var(--social-text);
  font-size: 1rem;
}

.class-win-card dl {
  grid-template-columns: 1fr;
}

.class-win-card dl div {
  min-height: 58px;
}

.class-win-card dd {
  font-size: 1.05rem;
}

.class-win-bar {
  display: grid;
  grid-template-columns: var(--distilbert) var(--forest) var(--linear);
  height: 0.7rem;
  overflow: hidden;
  border-radius: 999px;
  background: var(--social-panel-2);
}

.class-win-bar.single {
  grid-template-columns: var(--accuracy) 1fr;
}

.class-win-bar.single span {
  background: var(--social-cyan);
}

.class-win-bar .distilbert {
  background: var(--social-cyan);
}

.class-win-bar .forest {
  background: var(--social-gold);
}

.class-win-bar .linear {
  background: var(--social-red);
}

.socialcodex-artifacts {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
  border: 1px solid var(--social-line);
  border-radius: 8px;
  background: var(--social-panel);
}

.artifact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.artifact-grid figure {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  overflow: hidden;
}

.artifact-grid img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 11;
  border-bottom: 1px solid var(--social-line);
  background: white;
  object-fit: contain;
}

.artifact-grid figcaption {
  padding: 0 0.9rem 0.9rem;
  font-size: 0.92rem;
}

.socialcodex-notes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.socialcodex-notes article {
  display: grid;
  gap: 0.75rem;
}

.socialcodex-notes h2 {
  color: var(--social-text);
  font-size: clamp(1.55rem, 4vw, 2.4rem);
}

.socialcodex-notes p {
  margin: 0;
}

@media (max-width: 780px) {
  .site-header {
    align-items: flex-start;
  }

  .hero,
  .section-heading,
  .split-section,
  .contact-layout {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: 3rem;
  }

  .hero-visual {
    min-height: 320px;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .info-grid,
  .cover-layout {
    grid-template-columns: 1fr;
  }

  .project-panel {
    position: static;
    display: block;
    height: auto;
    max-height: none;
  }

  .recent-messages-panel {
    height: auto;
  }

  .message-list {
    max-height: 420px;
  }

  .project-list {
    max-height: 420px;
  }

  .bird-grid,
  .bird-photo-grid {
    grid-template-columns: 1fr;
  }

  .bird-section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .latest-sighting-card {
    grid-template-columns: 1fr;
  }

  .bird-hero-content {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .bird-hero-summary {
    height: 50vh;
    min-height: 0;
  }

  .bird-hero-image-box {
    width: calc(50vh * var(--bird-hero-image-ratio, 1.33));
    height: 50vh;
    min-height: 0;
  }

  .digit-draw-stage,
  .digit-slide-layout,
  .correction-layout,
  .tech-hero-grid,
  .pipeline-grid,
  .tech-list-grid,
  .socialcodex-hero,
  .live-status-grid,
  .showdown-scoreboard,
  .showdown-main-grid,
  .class-wins-grid,
  .artifact-grid,
  .socialcodex-notes {
    grid-template-columns: 1fr;
  }

  .layer-visual,
  .layer-notes {
    min-height: auto;
  }

  .feature-map-grid {
    grid-template-columns: repeat(2, minmax(90px, 1fr));
  }

  .probability-grid {
    grid-template-columns: repeat(5, minmax(44px, 1fr));
  }

  .matrix-model-tabs {
    grid-template-columns: 1fr;
  }

  .correction-actions .button,
  .behind-actions .button {
    flex: 1 1 180px;
  }
}

@media (max-width: 520px) {
  .hero-actions,
  .band {
    align-items: stretch;
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .profile-shell {
    width: min(100% - 1rem, 1120px);
  }

  .profile-banner-stack {
    width: min(100% - 1rem, 1120px);
  }

  .info-box {
    height: 96px;
  }

  .digit-slide-topbar {
    grid-template-columns: 1fr 1fr;
  }

  .digit-slide-topbar div {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .slide-nav-button {
    grid-row: 2;
    width: 100%;
    aspect-ratio: auto;
    min-height: 2.75rem;
    border-radius: 7px;
  }

  .layer-stat-grid,
  .prediction-result {
    grid-template-columns: 1fr;
  }

  .probability-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .digit-label-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .final-action-row .button,
  .correction-actions .button,
  .behind-actions .button {
    width: 100%;
  }
}
