:root {
  --bg: #f4fbf8;
  --bg2: #edf6ff;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-2: rgba(247, 255, 252, 0.95);
  --ink: #12243f;
  --ink-soft: #425978;
  --line: rgba(96, 138, 188, 0.22);
  --mint: #43c9af;
  --teal: #2d8f91;
  --blue: #6194ff;
  --shadow: 0 16px 36px rgba(74, 112, 153, 0.14);
  --radius: 18px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html,
body {
  margin: 0;
  padding: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 6%, rgba(67, 201, 175, 0.2), transparent 25%),
    radial-gradient(circle at 93% 3%, rgba(97, 148, 255, 0.2), transparent 24%),
    linear-gradient(145deg, var(--bg), var(--bg2));
}

html { scroll-behavior: smooth; }
body { line-height: 1.65; background-attachment: fixed; }

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.2;
  background-image:
    linear-gradient(rgba(120, 169, 219, 0.2) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 169, 219, 0.2) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(circle at center, black 25%, transparent 85%);
}

.container {
  width: min(1180px, calc(100% - 44px));
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(10px);
  background: rgba(241, 251, 255, 0.85);
  border-bottom: 1px solid rgba(108, 154, 204, 0.24);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
}

.brand {
  text-decoration: none;
  color: #12365f;
  font-family: Manrope, Inter, sans-serif;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(130deg, var(--mint), var(--blue));
  box-shadow: 0 0 0 5px rgba(67, 201, 175, 0.22), 0 0 24px rgba(67, 201, 175, 0.45);
}

.nav nav { display: flex; gap: 10px; flex-wrap: wrap; }
.nav nav a {
  text-decoration: none;
  color: #4b698d;
  border-radius: 999px;
  padding: 5px 10px;
  font-weight: 500;
  transition: color 0.2s ease, background 0.2s ease;
}
.nav nav a:hover { color: #1e4776; background: rgba(112, 167, 224, 0.2); }
.nav nav a.active { color: #fff; background: linear-gradient(125deg, #43c9af, #6194ff); }

.btn {
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(125deg, #43c9af, #6194ff);
  box-shadow: 0 9px 22px rgba(97, 148, 255, 0.2);
}
.btn-soft {
  background: rgba(236, 246, 255, 0.9);
  color: #345885;
  border: 1px solid rgba(115, 160, 211, 0.3);
  box-shadow: none;
}
.btn-soft.active {
  color: #fff;
  background: linear-gradient(125deg, #43c9af, #6194ff);
  border-color: transparent;
}

h1, h2, h3 { margin: 0 0 10px; line-height: 1.2; }
h1 {
  font-family: Manrope, Inter, sans-serif;
  font-size: clamp(2rem, 4.8vw, 3.4rem);
  letter-spacing: -0.02em;
}
h2 { font-size: clamp(1.45rem, 2.6vw, 2.05rem); }
h3 { font-size: 1.04rem; }
p, li { color: var(--ink-soft); }

.hero {
  display: grid;
  grid-template-columns: 1.08fr 1fr;
  gap: 16px;
  align-items: center;
  padding: 34px 0 16px;
}
.hero-bottom { grid-column: 1 / -1; }

.hero-insight {
  grid-column: 1 / -1;
  margin-top: 2px;
}

.hero-mini-left img {
  max-width: 66%;
  margin: 0 auto;
}

.hero-mini-right img {
  max-width: 88%;
  margin: 0 auto;
}

.hero-bottom .figure-card img {
  height: 250px;
  max-height: 250px;
}

.pill {
  display: inline-flex;
  margin: 0 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(97, 148, 255, 0.35);
  background: rgba(67, 201, 175, 0.18);
  color: #1f6d69;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 5px 11px;
}
.subtitle { font-size: 1.03rem; }

.author-hero {
  margin-top: 12px;
  border: 1px solid rgba(118, 164, 215, 0.3);
  border-radius: 12px;
  background: linear-gradient(150deg, rgba(232, 248, 255, 0.9), rgba(243, 255, 250, 0.92));
  padding: 10px 12px;
}
.author-hero-names {
  margin: 0;
  color: #224c76;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.5;
}
.author-hero-affils {
  margin: 6px 0 0;
  color: #5878a0;
  font-size: 0.84rem;
}
.author-hero-affils span { display: block; }

.hero-highlight {
  margin-top: 10px;
  border-left: 3px solid var(--teal);
  border-radius: 0 8px 8px 0;
  background: linear-gradient(90deg, rgba(45, 143, 145, 0.15), transparent);
  padding: 6px 0 6px 10px;
}
.cta { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 10px; }

.card {
  background: linear-gradient(165deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 15px;
  transition: transform 0.24s ease, border-color 0.24s ease;
}
.card:hover { transform: translateY(-2px); border-color: rgba(102, 155, 209, 0.35); }

.figure-card { padding: 11px; overflow: hidden; }
.figure-card img {
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: 660px;
  object-fit: contain;
  display: block;
  border-radius: 12px;
  border: 1px solid rgba(124, 169, 214, 0.33);
  background: rgba(255, 255, 255, 0.78);
  cursor: zoom-in;
}
.hero-figure img { max-height: 560px; }
.figure-card figcaption {
  margin-top: 8px;
  border-top: 1px dashed rgba(119, 160, 205, 0.28);
  padding: 8px 4px 2px;
  color: #507097;
  font-size: 0.9rem;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 8px;
}
.metrics article {
  border: 1px solid rgba(114, 160, 210, 0.27);
  border-radius: 14px;
  background: rgba(246, 252, 255, 0.92);
  text-align: center;
  padding: 10px 8px;
}
.metrics h3 {
  margin-bottom: 2px;
  color: #21527c;
  font-size: clamp(0.96rem, 1.45vw, 1.24rem);
}
.metrics p { margin: 0; font-size: 0.81rem; }

.section { padding: 36px 0 8px; scroll-margin-top: 92px; }
.grid2, .grid3 {
  display: grid;
  gap: 16px;
  align-items: start;
}
.grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.method-flow .card { position: relative; }
.method-flow .card:not(:last-child)::after {
  content: "→";
  position: absolute;
  right: -14px;
  top: 50%;
  transform: translateY(-50%);
  color: #6d9aca;
  font-weight: 700;
  opacity: 0.65;
}

.table-scroll {
  margin-top: 10px;
  overflow-x: auto;
  border: 1px solid rgba(114, 157, 203, 0.24);
  border-radius: 12px;
  background: rgba(248, 253, 255, 0.84);
}
.wide-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}
.wide-table.compact { min-width: 700px; }
.wide-table th,
.wide-table td {
  border-bottom: 1px solid rgba(120, 162, 208, 0.2);
  padding: 8px 10px;
  text-align: left;
  font-size: 0.85rem;
  color: #35567f;
  white-space: nowrap;
}
.wide-table th { white-space: normal; }
.wide-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: rgba(233, 245, 255, 0.97);
  color: #214d7a;
}
.wide-table th:first-child,
.wide-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: rgba(241, 249, 255, 0.98);
  box-shadow: 1px 0 0 rgba(121, 164, 208, 0.24);
}
.wide-table thead th:first-child { z-index: 4; }
.wide-table td.best,
.wide-table .best-row td {
  background: rgba(92, 205, 179, 0.22);
  color: #1a5a66;
  font-weight: 700;
}

.result-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0 10px;
}
.result-panel { display: none; margin-top: 10px; }
.result-panel.show { display: block; animation: fadeIn 0.22s ease; }

.note {
  margin: 8px 0 0;
  font-size: 0.86rem;
  color: #6688ac;
}

.tradeoff-grid {
  align-items: stretch;
}

.tradeoff-card {
  display: flex;
  flex-direction: column;
}

.tradeoff-card img {
  height: 300px;
  max-height: 300px;
}

.tradeoff-card .figure-card img {
  object-position: center;
}
ul { margin: 8px 0 0; padding-left: 18px; }

.resource-card { min-height: 118px; }
.contact-card { margin-top: 14px; }
.contact-link {
  color: #22877e;
  text-decoration: none;
  font-weight: 600;
}
.contact-link:hover { text-decoration: underline; }

.footer { margin-top: 24px; padding: 12px 0 24px; }
.footer p {
  margin: 0;
  text-align: center;
  color: #5f7d9f;
  font-size: 0.9rem;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(16, 33, 55, 0.76);
}
.lightbox.show { display: flex; }
.lightbox img {
  max-width: min(1240px, 95vw);
  max-height: 90vh;
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(15, 31, 51, 0.45);
}
.lightbox-close {
  position: absolute;
  top: 12px;
  right: 20px;
  border: 0;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  font-size: 1.5rem;
  cursor: pointer;
  color: #16385f;
  background: #d7edff;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1080px) {
  .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .method-flow .card::after { display: none; }
}

@media (max-width: 820px) {
  .hero, .grid2, .grid3 { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .container { width: calc(100% - 26px); }
  .metrics { grid-template-columns: 1fr; }
  .nav { flex-wrap: wrap; row-gap: 8px; }
  .nav nav {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: thin;
  }
}
