:root {
  --ink: #172321;
  --muted: #647873;
  --paper: #fbfbf8;
  --paper-2: #eef7f3;
  --surface: #ffffff;
  --line: #d9e7e0;
  --forest: #17675f;
  --teal: #228d82;
  --olive: #809343;
  --amber: #b76d2a;
  --red: #b94c3a;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

a {
  color: inherit;
}

img,
video {
  display: block;
  max-width: 100%;
}

.site-nav {
  align-items: center;
  background: rgba(247, 245, 239, 0.94);
  border-bottom: 1px solid rgba(217, 211, 197, 0.75);
  display: flex;
  gap: 28px;
  height: 64px;
  justify-content: space-between;
  left: 0;
  padding: 0 28px;
  position: sticky;
  right: 0;
  top: 0;
  z-index: 20;
}

.brand {
  align-items: center;
  display: inline-flex;
  font-weight: 720;
  gap: 10px;
  line-height: 1;
  text-decoration: none;
}

.brand-mark {
  background: var(--teal);
  border-radius: 7px;
  display: inline-block;
  height: 22px;
  position: relative;
  width: 22px;
}

.brand-mark::after {
  border-bottom: 3px solid #fff;
  border-right: 3px solid #fff;
  content: "";
  height: 9px;
  left: 7px;
  position: absolute;
  top: 4px;
  transform: rotate(40deg);
  width: 5px;
}

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

.nav-links a {
  color: #31413e;
  font-size: 0.94rem;
  font-weight: 620;
  text-decoration: none;
}

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

.nav-toggle {
  background: transparent;
  border: 0;
  display: none;
  height: 38px;
  padding: 8px;
  width: 42px;
}

.nav-toggle span {
  background: var(--ink);
  display: block;
  height: 2px;
  margin: 5px 0;
  width: 22px;
}

.hero-stage {
  background:
    linear-gradient(135deg, rgba(34, 141, 130, 0.14), transparent 38%),
    linear-gradient(180deg, #f7fbf8, #ffffff);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  position: relative;
}

.hero-content {
  color: var(--ink);
  max-width: 1160px;
  padding: 72px 28px 56px;
  position: relative;
  width: min(100%, 1180px);
  margin: 0 auto;
}

.eyebrow,
.section-kicker {
  color: var(--teal);
  font-size: 0.8rem;
  font-weight: 760;
  letter-spacing: 0.08em;
  margin: 0 0 14px;
  text-transform: uppercase;
}

.hero-content .eyebrow {
  color: var(--teal);
}

h1,
h2,
h3,
p {
  letter-spacing: 0;
}

h1 {
  font-size: 3.05rem;
  font-weight: 780;
  line-height: 1.08;
  margin: 0;
  max-width: 920px;
}

.hero-copy {
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.7;
  margin: 24px 0 0;
  max-width: 760px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.action-button {
  align-items: center;
  border: 1px solid rgba(34, 141, 130, 0.28);
  border-radius: 8px;
  display: inline-flex;
  font-weight: 720;
  gap: 10px;
  min-height: 46px;
  padding: 11px 16px;
  text-decoration: none;
}

.action-button.primary {
  background: var(--teal);
  color: #ffffff;
}

.action-button.secondary {
  color: var(--teal);
}

.action-button:hover {
  border-color: var(--teal);
  transform: translateY(-1px);
}

.button-mark {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 5px;
  font-size: 0.78rem;
  font-weight: 820;
  line-height: 1;
  padding: 5px 7px;
}

.hero-diagram {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 46px rgba(34, 75, 68, 0.1);
  margin: 34px 0 0;
  padding: 18px;
}

.hero-diagram img {
  margin: 0 auto;
  max-height: 560px;
  object-fit: contain;
}

.hero-stats {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 32px 0 0;
  max-width: 940px;
}

.hero-stats div {
  border-left: 3px solid var(--teal);
  padding-left: 14px;
}

.hero-stats dt {
  font-size: 1.65rem;
  font-weight: 780;
  line-height: 1;
}

.hero-stats dd {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.35;
  margin: 8px 0 0;
}

.section-block {
  padding: 72px 28px;
}

.section-block.light {
  background: var(--paper-2);
}

.section-block.dark {
  background: var(--forest);
  color: #ffffff;
}

.section-inner {
  margin: 0 auto;
  max-width: 1160px;
}

.two-column {
  display: grid;
  gap: 48px;
  grid-template-columns: minmax(240px, 0.88fr) minmax(0, 1.12fr);
}

h2 {
  font-size: 2.18rem;
  font-weight: 760;
  line-height: 1.16;
  margin: 0;
}

h3 {
  font-size: 1.08rem;
  font-weight: 760;
  line-height: 1.25;
  margin: 0 0 10px;
}

.body-copy p,
.section-heading p,
.result-panel p,
.metric-card p,
.video-card p {
  color: var(--muted);
  margin: 0;
}

.body-copy p + p {
  margin-top: 18px;
}

.dark .section-kicker {
  color: #9bd7c5;
}

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

.method-step {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
}

.method-step span {
  align-items: center;
  background: rgba(34, 141, 130, 0.12);
  border-radius: 999px;
  color: var(--teal);
  display: inline-flex;
  font-size: 0.82rem;
  font-weight: 780;
  height: 30px;
  justify-content: center;
  margin-bottom: 16px;
  width: 30px;
}

.method-step p {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
  margin: 0;
}

.method-details {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 20px;
}

.method-detail {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
}

.method-detail p {
  color: var(--muted);
  margin: 0;
}

.method-detail ul {
  color: var(--muted);
  margin: 16px 0 0;
  padding-left: 18px;
}

.method-detail li + li {
  margin-top: 8px;
}

.method-detail strong {
  color: var(--ink);
}

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

.metric-card,
.result-panel,
.video-card,
.table-block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
}

.metric-icon {
  align-items: center;
  background: rgba(28, 125, 115, 0.12);
  border-radius: 8px;
  color: var(--teal);
  display: inline-flex;
  height: 38px;
  justify-content: center;
  margin-bottom: 18px;
  width: 38px;
}

.metric-icon.warm {
  background: rgba(183, 109, 42, 0.13);
  color: var(--amber);
}

.metric-icon.cool {
  background: rgba(113, 129, 59, 0.14);
  color: var(--olive);
}

.figure-wrap {
  margin-top: 34px;
}

.figure-wrap img {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(48, 43, 32, 0.08);
  width: 100%;
}

.section-heading {
  max-width: 820px;
}

.section-heading p {
  margin-top: 18px;
}

.section-heading.compact {
  margin-bottom: 28px;
}

.result-panels {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 30px;
}

.tables-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  margin-top: 28px;
}

.table-block {
  overflow-x: auto;
}

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

th,
td {
  border-bottom: 1px solid #e7e1d4;
  padding: 9px 8px;
  text-align: right;
  white-space: nowrap;
}

th:first-child,
td:first-child,
th:nth-child(2),
td:nth-child(2) {
  text-align: left;
}

th {
  color: #485653;
  font-size: 0.78rem;
  font-weight: 760;
  text-transform: uppercase;
}

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

.video-card {
  padding: 0;
  overflow: hidden;
}

.video-card video {
  aspect-ratio: 16 / 9;
  background: #111;
  object-fit: cover;
  width: 100%;
}

.video-card h3,
.video-card p {
  padding-left: 18px;
  padding-right: 18px;
}

.video-card h3 {
  margin-bottom: 0;
  min-height: 3.2em;
  padding-bottom: 10px;
  padding-top: 18px;
}

.video-card p {
  padding-bottom: 20px;
}

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

.constraint-note span {
  color: var(--teal);
  display: block;
  font-size: 0.72rem;
  font-weight: 760;
  letter-spacing: 0.06em;
  margin-bottom: 5px;
  text-transform: uppercase;
}

.constraint-note code {
  background: rgba(34, 141, 130, 0.1);
  border-radius: 5px;
  color: var(--forest);
  display: inline-block;
  font-size: 0.78rem;
  margin-top: 6px;
  max-width: 100%;
  overflow-wrap: anywhere;
  padding: 3px 6px;
}

.artifact-list {
  display: grid;
  gap: 14px;
}

.artifact-row {
  align-items: center;
  background: rgba(255, 249, 234, 0.08);
  border: 1px solid rgba(255, 249, 234, 0.22);
  border-radius: 8px;
  display: flex;
  gap: 14px;
  padding: 16px;
  text-decoration: none;
}

.artifact-row:hover {
  background: rgba(255, 249, 234, 0.14);
}

.artifact-icon {
  align-items: center;
  background: #fff9ea;
  border-radius: 8px;
  color: var(--forest);
  display: inline-flex;
  flex: 0 0 38px;
  height: 38px;
  justify-content: center;
}

.artifact-row strong,
.artifact-row small {
  display: block;
}

.artifact-row small {
  color: #d6d0bf;
  margin-top: 2px;
}

.artifact-note {
  border-left: 3px solid #9bd7c5;
  color: #d6d0bf;
  margin-top: 8px;
  padding-left: 14px;
}

.citation-section {
  background: #f7fbf8;
  border-top: 1px solid var(--line);
}

.citation-inner {
  display: grid;
  gap: 22px;
}

.citation-heading {
  max-width: 720px;
}

.bibtex-panel {
  position: relative;
  width: 100%;
}

.bibtex-block {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-size: 0.88rem;
  line-height: 1.55;
  margin: 0;
  overflow-x: auto;
  padding: 22px 86px 22px 22px;
  white-space: pre;
  width: 100%;
}

.bibtex-block code {
  color: inherit;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.copy-button {
  background: var(--teal);
  border: 0;
  border-radius: 7px;
  color: #ffffff;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 720;
  min-width: 62px;
  padding: 8px 11px;
  position: absolute;
  right: 12px;
  top: 12px;
}

.copy-button:hover {
  background: var(--forest);
}

.copy-button.is-copied {
  background: var(--olive);
}

.site-footer {
  align-items: center;
  background: #ffffff;
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  font-size: 0.9rem;
  gap: 16px;
  justify-content: space-between;
  padding: 22px 28px;
}

@media (max-width: 960px) {
  .two-column,
  .method-flow,
  .method-details,
  .metrics-grid,
  .result-panels,
  .tables-grid,
  .video-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 2.36rem;
  }

  h2 {
    font-size: 1.82rem;
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .site-nav {
    padding: 0 18px;
  }

  .nav-toggle {
    display: block;
  }

  .nav-links {
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    display: none;
    flex-direction: column;
    gap: 0;
    left: 0;
    padding: 10px 18px 18px;
    position: absolute;
    right: 0;
    top: 64px;
  }

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

  .nav-links a {
    padding: 10px 0;
    width: 100%;
  }

  .hero-stage {
    min-height: auto;
  }

  .hero-content {
    padding: 58px 20px 42px;
  }

  h1 {
    font-size: 2rem;
  }

  .hero-copy {
    font-size: 1rem;
  }

  .section-block {
    padding: 56px 20px;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}
