:root {
  --bg: #f6f7f4;
  --paper: #ffffff;
  --ink: #16211d;
  --muted: #5d6a64;
  --line: #d9e0dc;
  --green: #0f5d46;
  --green-dark: #0a3229;
  --blue: #214f9b;
  --rust: #a6532b;
  --gold: #d8a642;
  --soft-green: #e7f2ee;
  --soft-blue: #e8eef8;
  --shadow: 0 18px 50px rgba(19, 31, 27, 0.12);
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img,
svg,
video,
iframe {
  max-width: 100%;
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(217, 224, 220, 0.86);
  background: rgba(246, 247, 244, 0.94);
  backdrop-filter: blur(14px);
}

.nav-shell,
.section-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.nav-shell {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.15rem;
  text-decoration: none;
}

.brand-mark {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  font-weight: 800;
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
}

.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  width: 18px;
  height: 2px;
  display: block;
  background: currentColor;
  content: "";
}

.nav-toggle span {
  position: relative;
}

.nav-toggle span::before,
.nav-toggle span::after {
  position: absolute;
  left: 0;
}

.nav-toggle span::before {
  top: -6px;
}

.nav-toggle span::after {
  top: 6px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
}

.nav-links a {
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 700;
  text-decoration: none;
}

.nav-links a:hover {
  color: var(--ink);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 15px;
  border: 1px solid var(--green);
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

.button.secondary {
  border-color: rgba(15, 93, 70, 0.22);
  background: #fff;
  color: var(--green);
}

.hero {
  min-height: 680px;
  display: grid;
  align-items: stretch;
  background:
    linear-gradient(90deg, rgba(8, 28, 23, 0.92) 0%, rgba(8, 28, 23, 0.78) 42%, rgba(8, 28, 23, 0.18) 74%),
    url("/media/synthetic_dog_research_hero_1440.jpg") center right / cover no-repeat;
}

.hero-inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 56px 0 44px;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(360px, 0.78fr);
  gap: 32px;
  align-items: center;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero h1,
.page-hero h1 {
  margin: 0;
  color: #fff;
  font-size: 4rem;
  line-height: 1.02;
  letter-spacing: 0;
}

.hero .lede,
.page-hero .lede {
  max-width: 620px;
  margin: 18px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 1.13rem;
}

.metric-strip {
  margin: 26px 0 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.metric {
  min-height: 104px;
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
}

.metric strong {
  display: block;
  font-size: 1.72rem;
  line-height: 1.1;
}

.metric span {
  display: block;
  margin-top: 7px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.82rem;
  line-height: 1.35;
}

.hero .button-row {
  margin-top: 24px;
}

.hero .button.secondary {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}

.demo-frame {
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.demo-frame header {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.demo-frame header strong {
  font-size: 0.9rem;
}

.demo-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.demo-status::before {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #1aa96b;
  content: "";
}

.demo-viewport {
  height: 520px;
  position: relative;
  overflow: hidden;
  background: #f7fbff;
}

.demo-placeholder {
  height: 100%;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 12px;
  padding: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.94)),
    url("/media/synthetic_dog_research_hero_1440.jpg") center / cover no-repeat;
  text-align: center;
}

.demo-upload-icon {
  width: 70px;
  height: 70px;
  border: 1px solid rgba(33, 79, 155, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(33, 79, 155, 0.12), rgba(15, 93, 70, 0.1)),
    #fff;
  box-shadow: 0 14px 34px rgba(19, 31, 27, 0.16);
}

.demo-upload-icon::before {
  width: 28px;
  height: 22px;
  display: block;
  margin: 23px auto 0;
  border: 3px solid var(--blue);
  border-radius: 4px;
  content: "";
}

.demo-placeholder strong {
  color: var(--blue);
  font-size: 1.35rem;
}

.demo-placeholder span {
  max-width: 300px;
  color: var(--muted);
}

.demo-placeholder a {
  color: var(--green);
  font-weight: 800;
}

.demo-frame iframe {
  width: 100%;
  height: 100%;
  display: none;
  border: 0;
  background: #fff;
}

.demo-load {
  position: absolute;
  left: 50%;
  bottom: 18px;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--green);
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  font: inherit;
  font-weight: 800;
  transform: translateX(-50%);
  box-shadow: 0 12px 28px rgba(19, 31, 27, 0.18);
}

.demo-viewport.is-live .demo-placeholder,
.demo-viewport.is-live .demo-load {
  display: none;
}

.demo-viewport.is-live iframe {
  height: 1280px;
  display: block;
  transform: translateY(-640px);
}

main section {
  padding: 68px 0;
}

.section-kicker {
  margin: 0 0 10px;
  color: var(--rust);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h2 {
  max-width: 840px;
  margin: 0;
  font-size: 2.25rem;
  line-height: 1.14;
  letter-spacing: 0;
}

h3 {
  margin: 0;
  font-size: 1.24rem;
  line-height: 1.25;
  letter-spacing: 0;
}

.section-lede {
  max-width: 820px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1.04rem;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 0.55fr);
  gap: 34px;
  align-items: start;
}

.video-panel,
.plain-panel,
.table-panel,
.figure-panel,
.math-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 10px 34px rgba(19, 31, 27, 0.06);
  overflow: hidden;
}

.video-panel video {
  width: 100%;
  display: block;
  background: #000;
}

.panel-body {
  padding: 18px;
}

.plain-panel {
  padding: 18px;
}

.plain-panel p,
.math-panel p {
  margin: 8px 0 0;
  color: var(--muted);
}

.proof-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 26px;
}

.proof-item {
  min-height: 122px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.proof-item strong {
  display: block;
  color: var(--green);
  font-size: 1.8rem;
  line-height: 1.1;
}

.proof-item span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.88rem;
}

.figure-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 28px;
}

.figure-panel {
  padding: 18px;
  overflow-x: auto;
}

.figure-panel img {
  width: 100%;
  height: auto;
  display: block;
  background: #fff;
}

.figure-panel figcaption {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.reviewer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  margin-top: 24px;
}

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

.table-panel h3 {
  margin: 0;
  padding: 16px 18px 0;
  font-size: 1.05rem;
}

table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  font-size: 0.94rem;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

td strong {
  color: var(--green);
}

.note-list {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}

.note-list li {
  padding-left: 18px;
  border-left: 3px solid var(--green);
  color: var(--muted);
}

.math-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.math-panel {
  padding: 18px;
}

.formula {
  margin: 14px 0 0;
  padding: 12px;
  border-radius: 8px;
  background: #f0f4f2;
  color: var(--green-dark);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.86rem;
  line-height: 1.5;
  overflow-x: auto;
}

.callout-band {
  background: var(--green-dark);
  color: #fff;
}

.callout-band .section-kicker {
  color: #f2c95e;
}

.callout-band .section-lede {
  color: rgba(255, 255, 255, 0.78);
}

.callout-band .button.secondary {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.32);
  color: #fff;
}

.link-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}

.link-grid a {
  min-height: 106px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  text-decoration: none;
}

.link-grid strong {
  display: block;
}

.link-grid span {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.9rem;
}

.page-hero {
  background:
    linear-gradient(90deg, rgba(8, 28, 23, 0.92), rgba(8, 28, 23, 0.72)),
    url("/media/synthetic_dog_research_hero_1440.jpg") center / cover no-repeat;
  color: #fff;
  padding: 72px 0;
}

.page-hero .section-shell {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(300px, 0.5fr);
  gap: 28px;
  align-items: end;
}

.page-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.site-footer {
  padding: 32px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

@media (max-width: 980px) {
  .hero {
    min-height: auto;
  }

  .hero-inner,
  .split,
  .page-hero .section-shell {
    grid-template-columns: 1fr;
  }

  .hero-inner {
    padding: 42px 0 34px;
  }

  .hero h1,
  .page-hero h1 {
    font-size: 3rem;
  }

  .metric-strip,
  .proof-grid,
  .figure-grid,
  .math-grid,
  .link-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .demo-viewport {
    height: 470px;
  }
}

@media (max-width: 700px) {
  .nav-shell,
  .section-shell,
  .hero-inner {
    width: min(100% - 24px, 1180px);
  }

  .nav-shell {
    min-height: 62px;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .nav-links {
    position: absolute;
    left: 12px;
    right: 12px;
    top: 62px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
    overflow: hidden;
  }

  .nav-links.is-open {
    display: flex;
  }

  .nav-links a {
    min-height: 46px;
    display: flex;
    align-items: center;
    padding: 0 14px;
    border-bottom: 1px solid var(--line);
  }

  .nav-links a:last-child {
    border-bottom: 0;
  }

  .hero {
    background:
      linear-gradient(180deg, rgba(8, 28, 23, 0.96) 0%, rgba(8, 28, 23, 0.82) 54%, rgba(8, 28, 23, 0.64) 100%),
      url("/media/synthetic_dog_research_hero_1440.jpg") center top / cover no-repeat;
  }

  .hero-inner {
    padding: 32px 0;
    gap: 22px;
  }

  .hero h1,
  .page-hero h1 {
    font-size: 2.42rem;
  }

  .hero .lede,
  .page-hero .lede,
  .section-lede {
    font-size: 1rem;
  }

  .metric-strip,
  .proof-grid,
  .figure-grid,
  .math-grid,
  .link-grid,
  .page-stats {
    grid-template-columns: 1fr;
  }

  .metric {
    min-height: 86px;
  }

  .demo-viewport {
    height: 430px;
  }

  main section {
    padding: 48px 0;
  }

  h2 {
    font-size: 1.82rem;
  }

  .button-row,
  .button {
    width: 100%;
  }

  .button {
    justify-content: center;
  }

  table {
    min-width: 0;
  }

  thead {
    display: none;
  }

  tbody,
  tr,
  td {
    display: block;
    width: 100%;
  }

  tr {
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
  }

  tr:last-child {
    border-bottom: 0;
  }

  td {
    display: grid;
    grid-template-columns: minmax(98px, 0.82fr) minmax(0, 1.18fr);
    gap: 12px;
    padding: 8px 12px;
    border-bottom: 0;
    font-size: 0.88rem;
    word-break: break-word;
  }

  td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
  }

  .page-hero {
    padding: 48px 0;
  }

  .figure-panel {
    padding: 12px;
  }

  .reviewer-grid,
  .reviewer-grid-compact {
    grid-template-columns: 1fr;
  }

  .summary-figures {
    display: none;
  }

  .table-panel h3 {
    padding: 14px 12px 2px;
    font-size: 1rem;
  }
}
