:root {
  --bg: #eef2f7;
  --surface: #fbfcfe;
  --surface-soft: #f3f6fa;
  --section-a: #f8fbff;
  --section-b: #f2f6fb;
  --line: #d2dae5;
  --text: #19212b;
  --muted: #243140;
  --accent: #274b78;
  --accent-soft: #e5edf6;
  --max-width: 1080px;
  --radius-lg: 18px;
  --radius-md: 12px;
  --shadow: 0 12px 28px rgba(25, 33, 43, 0.06);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans", sans-serif;
  line-height: 1.6;
}

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

a {
  color: inherit;
  text-decoration: none;
}

.page-shell {
  width: min(calc(100% - 28px), var(--max-width));
  margin: 0 auto;
  padding-bottom: 60px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 0 14px;
  border-bottom: 1px solid var(--line);
}

.brand {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
  color: var(--muted);
  font-size: 0.92rem;
}

.home-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1;
}

.hero,
.section {
  padding-top: 38px;
}

.section {
  position: relative;
  margin-top: 28px;
  padding: 34px 24px 28px;
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

main > .section:nth-of-type(odd) {
  background: var(--section-a);
}

main > .section:nth-of-type(even) {
  background: var(--section-b);
}

.section::before {
  content: "";
  display: block;
  width: min(100%, 920px);
  height: 1px;
  margin: 0 auto 26px;
  background: linear-gradient(
    90deg,
    rgba(39, 75, 120, 0) 0%,
    rgba(39, 75, 120, 0.22) 18%,
    rgba(39, 75, 120, 0.34) 50%,
    rgba(39, 75, 120, 0.22) 82%,
    rgba(39, 75, 120, 0) 100%
  );
}

.eyebrow,
.section-kicker {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero {
  text-align: center;
}

.hero h1,
.section-heading h2 {
  margin: 0;
  font-family: "Castoro", serif;
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.12;
}

.hero h1 {
  width: 100%;
  max-width: 100%;
  margin-inline: auto;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  white-space: normal;
  text-wrap: pretty;
}

.hero-summary,
.section-lead,
.section-note,
.authors,
.affiliations,
.notes,
.mini-card p,
.point-card p,
.conclusion-card p,
.figure-card figcaption,
.site-footer,
.stat-card span {
  color: var(--muted);
}

.hero-summary {
  max-width: 62ch;
  margin: 18px auto;
  font-size: 1rem;
  line-height: 1.7;
}

.tldr-box {
  max-width: 760px;
  margin: 20px auto 0;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #fbfcfe 0%, #f2f6fb 100%);
  box-shadow: var(--shadow);
  text-align: left;
}

.tldr-label {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.tldr-box .hero-summary {
  max-width: none;
  margin: 0;
}

.author-block {
  margin-bottom: 18px;
}

.authors,
.affiliations {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 16px;
  margin: 0 0 8px;
  font-size: 0.96rem;
}

.notes {
  margin: 0;
  font-size: 0.88rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
}

.button.ghost {
  background: rgba(251, 252, 254, 0.78);
}

.button.disabled {
  color: var(--muted);
  background: var(--surface-soft);
  cursor: default;
}

.section-heading {
  margin-bottom: 12px;
  text-align: center;
}

.section-heading h2 {
  width: 100%;
  max-width: 100%;
  margin-inline: auto;
  font-size: clamp(1.18rem, 1.7vw, 1.4rem);
  font-weight: 700;
  line-height: 1.45;
  font-family: "Noto Sans", sans-serif;
  letter-spacing: 0;
  text-wrap: pretty;
}

.section-lead,
.section-note {
  margin-inline: auto;
  text-align: center;
  width: 100%;
}

.section-lead {
  max-width: 68ch;
  margin-bottom: 12px;
  font-size: 0.98rem;
  line-height: 1.68;
}

.reference-figure {
  max-width: 280px;
  margin: 0 auto 20px;
  text-align: center;
}

.reference-figure img {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.reference-figure figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.section-note {
  max-width: 64ch;
  margin-bottom: 20px;
  font-size: 0.92rem;
  line-height: 1.62;
}

.compare-grid,
.mini-grid,
.method-points,
.stat-grid,
.conclusion-grid {
  display: grid;
  gap: 18px;
}

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

.compare-card,
.mini-card,
.point-card,
.stat-card,
.conclusion-card,
.figure-card,
.placeholder-box {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.compare-card {
  padding: 16px;
}

.card-topline {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: nowrap;
}

.card-topline h3,
.mini-card h3,
.conclusion-card h3 {
  margin: 0;
  font-size: 1rem;
  flex: 1 1 auto;
  min-width: 0;
}

.card-topline span {
  color: var(--muted);
  font-size: 0.84rem;
  text-align: right;
  flex: 0 1 auto;
  white-space: nowrap;
}

.pca-footnote {
  margin-top: 12px;
  font-size: 0.82rem;
  line-height: 1.55;
}

.compare-frame {
  --position: 58%;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  aspect-ratio: 1 / 1;
  background: #e1e8f1;
}

.compare-base,
.compare-overlay img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.compare-overlay {
  position: absolute;
  inset: 0;
  overflow: hidden;
  clip-path: inset(0 calc(100% - var(--position)) 0 0);
}

.compare-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--position);
  width: 0;
  pointer-events: none;
}

.compare-divider::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -1px;
  width: 2px;
  background: rgba(255, 255, 255, 0.95);
}

.compare-divider span {
  position: absolute;
  top: 50%;
  left: 0;
  width: 30px;
  height: 30px;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.96);
  background: rgba(31, 75, 122, 0.92);
}

.compare-tag {
  position: absolute;
  top: 12px;
  z-index: 2;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(251, 252, 254, 0.96);
  color: var(--text);
  font-size: 0.76rem;
  font-weight: 600;
}

.compare-tag.left {
  left: 12px;
}

.compare-tag.right {
  right: 12px;
}

.compare-range {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
}

.split-section {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.section-copy,
.mini-grid,
.method-summary,
.experiment-summary,
.citation-block {
  max-width: 860px;
  margin-inline: auto;
}

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

.mini-card,
.point-card,
.conclusion-card {
  padding: 18px 20px;
}

.mini-card p,
.point-card p,
.conclusion-card p {
  margin: 8px 0 0;
  font-size: 0.96rem;
  line-height: 1.65;
}

.figure-card {
  max-width: 920px;
  margin-inline: auto;
  padding: 12px;
}

.figure-card img {
  width: 100%;
  border-radius: 10px;
}

.figure-card figcaption {
  padding: 12px 4px 4px;
  font-size: 0.92rem;
  line-height: 1.6;
  text-wrap: pretty;
}

.method-summary,
.experiment-summary {
  max-width: 860px;
  margin: 0 auto;
}

.method-summary p,
.experiment-summary p {
  margin: 0 0 12px;
  font-size: 0.98rem;
  line-height: 1.7;
  color: var(--muted);
}

.method-summary p:last-child,
.experiment-summary p:last-child {
  margin-bottom: 0;
}

.method-summary strong,
.experiment-summary strong {
  color: var(--text);
}

.citation-block {
  position: relative;
  padding: 8px 0 0;
}

.citation-block pre {
  margin: 0;
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.92rem;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  background: transparent;
}

.copy-button {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font: inherit;
}

.site-footer {
  padding-top: 28px;
  border-top: 1px solid var(--line);
  margin-top: 42px;
  font-size: 0.9rem;
}

.site-footer p {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0;
}

.site-footer a {
  color: var(--accent);
  font-weight: 600;
}

@media (max-width: 900px) {
  .compare-grid,
  .mini-grid,
  .stat-grid,
  .conclusion-grid {
    grid-template-columns: 1fr;
  }

  .card-topline {
    flex-direction: column;
    align-items: flex-start;
  }

  .card-topline span {
    text-align: left;
  }
}

@media (max-width: 760px) {
  .page-shell {
    width: min(calc(100% - 20px), var(--max-width));
  }

  .section {
    padding: 28px 16px 22px;
  }

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

  .site-nav {
    gap: 12px;
  }

  .hero h1 {
    font-size: clamp(1.7rem, 6vw, 2.2rem);
  }
}
