:root {
  --bg: #f7f5ef;
  --surface: #fffdf8;
  --surface-2: #f0ede5;
  --ink: #151513;
  --ink-soft: #4e4d46;
  --line: #d9d3c5;
  --accent: #0e6b63;
  --accent-soft: #d9f1ed;
  --accent-2: #d9653f;
  --shadow: 0 12px 40px rgba(20, 20, 16, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: radial-gradient(circle at 15% 10%, #fff6d8 0%, transparent 40%),
    radial-gradient(circle at 85% 15%, #d7efe8 0%, transparent 38%), var(--bg);
  color: var(--ink);
  font-family: "Source Serif 4", serif;
  line-height: 1.65;
  overflow-x: hidden;
}

h1,
h2,
h3,
.brand,
.btn,
.authors,
.tagline,
.equation {
  font-family: "Space Grotesk", sans-serif;
}

.bg-orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(80px);
  opacity: 0.38;
  pointer-events: none;
  z-index: -1;
}

.bg-orb-a {
  width: 340px;
  height: 340px;
  background: #ffd28a;
  top: -90px;
  left: -90px;
  animation: floatA 10s ease-in-out infinite;
}

.bg-orb-b {
  width: 420px;
  height: 420px;
  background: #9ad2c9;
  bottom: -140px;
  right: -140px;
  animation: floatB 14s ease-in-out infinite;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
  background: rgba(247, 245, 239, 0.85);
  border-bottom: 1px solid rgba(217, 211, 197, 0.7);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px min(5vw, 48px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.brand img {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

.nav-links {
  display: flex;
  gap: 22px;
}

.nav-links a {
  color: var(--ink-soft);
  text-decoration: none;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.95rem;
}

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

main {
  width: min(1120px, 92vw);
  margin: 34px auto 84px;
}

.hero {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 28px;
  align-items: center;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(145deg, #fffefb, #f4f0e6);
  box-shadow: var(--shadow);
}

.tagline {
  display: inline-block;
  margin: 0;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #0a5d54;
  font-size: 0.82rem;
  letter-spacing: 0.5px;
  font-weight: 700;
  text-transform: uppercase;
}

.hero h1 {
  margin: 16px 0 14px;
  font-size: clamp(1.8rem, 3.3vw, 3rem);
  line-height: 1.14;
  letter-spacing: -0.02em;
}

.authors {
  margin: 0 0 8px;
  color: var(--ink-soft);
  font-weight: 500;
}

.hero-summary {
  margin: 0;
  color: #282820;
  max-width: 64ch;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.15px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--accent);
  color: #f8fffd;
}

.btn-primary:hover {
  background: #095d55;
}

.btn-secondary {
  border-color: var(--line);
  color: #222;
  background: #fff;
}

.btn-secondary:hover {
  background: #f2eee4;
}

.btn-disabled {
  border-color: #d6d6cf;
  background: #ecebe4;
  color: #66665e;
  cursor: not-allowed;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.stats-grid article {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 12px 10px;
  background: #fff;
}

.stats-grid h3 {
  margin: 0;
  font-size: 1.22rem;
}

.stats-grid p {
  margin: 2px 0 0;
  font-size: 0.84rem;
  color: var(--ink-soft);
  line-height: 1.35;
}

.hero-visual {
  display: flex;
  justify-content: center;
}

.hero-visual img {
  width: min(100%, 390px);
  max-height: 500px;
  object-fit: contain;
  filter: drop-shadow(0 18px 24px rgba(16, 26, 22, 0.16));
}

.panel {
  margin-top: 28px;
  padding: 30px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel h2 {
  margin: 0 0 10px;
  font-size: clamp(1.4rem, 2.2vw, 2rem);
  letter-spacing: -0.01em;
}

.panel-lead {
  color: #2a2a26;
  margin: 0 0 14px;
}

figure {
  margin: 18px 0 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface-2);
}

figure img {
  display: block;
  width: 100%;
  height: auto;
}

figcaption {
  padding: 9px 12px 11px;
  font-size: 0.86rem;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
}

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

.takeaway-grid article {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  background: linear-gradient(145deg, #fffef8, #f6f3ea);
}

.takeaway-grid h3 {
  margin: 0 0 6px;
  font-size: 1.08rem;
}

.takeaway-grid p {
  margin: 0;
  color: #33322c;
}

.equation {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 14px;
  background: #eff8f6;
  border: 1px solid #cae8e2;
  color: #094c45;
  font-weight: 500;
}

.metric-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 16px;
}

.metric-notes {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(150deg, #fffcf2, #f7efe3);
  padding: 14px 16px;
}

.metric-notes h3 {
  margin: 6px 0 6px;
  font-size: 1rem;
}

.metric-notes ul {
  margin: 0 0 10px;
  padding-left: 20px;
}

.metric-notes li {
  margin: 5px 0;
}

.table-wrap {
  margin-top: 12px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
}

table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  background: #fff;
}

thead th {
  background: #e8f2ef;
  font-family: "Space Grotesk", sans-serif;
}

th,
td {
  border-bottom: 1px solid #ded9cc;
  padding: 10px 12px;
  text-align: left;
  font-size: 0.94rem;
}

tbody tr:nth-child(even) {
  background: #fbfaf6;
}

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

.selection-notes article {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: #fff;
}

.selection-notes h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}

pre {
  margin: 10px 0 12px;
  background: #12120f;
  color: #ece8de;
  border-radius: 12px;
  padding: 14px;
  overflow-x: auto;
  border: 1px solid #2b2a24;
}

.site-footer {
  width: min(1120px, 92vw);
  margin: 0 auto 40px;
  text-align: center;
  color: #5e5d55;
  font-size: 0.92rem;
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes floatA {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(16px);
  }
}

@keyframes floatB {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-14px);
  }
}

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .hero-visual {
    order: -1;
  }

  .hero-visual img {
    max-height: 360px;
  }

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

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

  .takeaway-grid,
  .selection-notes {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding: 10px 16px;
  }

  .nav-links {
    flex-wrap: wrap;
    gap: 10px 14px;
  }

  main {
    width: min(1120px, 94vw);
    margin-top: 20px;
  }

  .hero,
  .panel {
    padding: 20px;
    border-radius: 18px;
  }
}
