@import url('https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700;800&family=Geist+Mono:wght@400;500;600&family=Noto+Sans+KR:wght@400;500;600;700&display=swap');

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

:root {
  --bg: #fafafa;
  --ink: #1a1a1a;
  --muted: #5a5a5a;
  --light-muted: #8a8a8a;
  --accent: #2c5282;
  --accent-light: #ebf2fa;
  --sage: #48755c;
  --amber: #b8860b;
  --red: #9b2c2c;
  --panel-bg: #ffffff;
  --radius: 8px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 2px 8px rgba(0,0,0,.06);
  --border: 1px solid #e5e5e5;
  --border-light: 1px solid #ebebeb;
  --max-width: 900px;
  --section-pad: clamp(2rem, 5vw, 3.5rem) clamp(1rem, 4vw, 2rem);
}

html {
  font-size: 100%;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Geist', 'Noto Sans KR', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color .15s;
}
a:hover { color: #1a365d; }
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

h1, h2, h3, h4 {
  font-family: 'Geist', sans-serif;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--ink);
}

img { max-width: 100%; height: auto; }

/* --- Utilities --- */
.eyebrow {
  font-family: 'Geist Mono', monospace;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
  display: block;
}

.panel {
  background: var(--panel-bg);
  border-radius: var(--radius);
  border: var(--border);
  box-shadow: var(--shadow-sm);
}

.reveal {
  opacity: 1;
  transform: none;
}
.js .reveal {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .4s ease, transform .4s ease;
}
.js .reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* --- Header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250,250,250,0.95);
  border-bottom: var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.6rem 1.25rem;
  gap: 1rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
  text-decoration: none;
}
.brand-mono {
  font-family: 'Geist Mono', monospace;
  font-weight: 700;
  font-size: 1rem;
  color: var(--accent);
}
.header-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.85rem;
  font-weight: 500;
}
.header-nav a { color: var(--muted); }
.header-nav a:hover { color: var(--ink); }

/* --- Sections --- */
section {
  padding: var(--section-pad);
}
section + section {
  border-top: var(--border-light);
}
.section-header {
  margin-bottom: 2rem;
}
.section-header h2 {
  font-size: clamp(1.4rem, 3vw, 1.8rem);
}

/* --- Section 1: About --- */
.korean-greeting {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: var(--border-light);
}

#about {
  padding-top: 4.5rem;
}
#about h1 {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  margin-bottom: 0.25rem;
  letter-spacing: -0.04em;
}
.about-affiliation {
  font-size: 1rem;
  color: var(--muted);
  margin-bottom: 1rem;
}
.about-thesis {
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--ink);
  margin-bottom: 1.5rem;
  max-width: 640px;
  font-weight: 500;
}
.about-facts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  max-width: 500px;
}
.fact {
  padding: 0.75rem;
  background: var(--panel-bg);
  border: var(--border);
  border-radius: var(--radius);
}
.fact-value {
  display: block;
  font-family: 'Geist Mono', monospace;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}
.fact-label {
  display: block;
  font-size: 0.72rem;
  font-family: 'Geist Mono', monospace;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .03em;
  margin-top: 0.15rem;
}
.fact-sub {
  display: block;
  font-size: 0.62rem;
  font-family: 'Geist Mono', monospace;
  color: var(--light-muted);
  margin-top: 0.1rem;
  line-height: 1.3;
}

/* --- Section 2: Clinical Problem --- */
.scenario-box {
  background: var(--panel-bg);
  border: var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-top: 1rem;
  max-width: 700px;
}
.scenario-box p {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 0.75rem;
}
.scenario-box p:last-child { margin-bottom: 0; }
.scenario-emphasis {
  color: var(--ink) !important;
  font-weight: 500;
}

/* --- Section 3: Proof Cards --- */
.proof-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 2.5rem;
}
.proof-card {
  background: var(--panel-bg);
  border: var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}
.proof-card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}
.proof-card h3 {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.proof-card-aim {
  font-family: 'Geist Mono', monospace;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--accent);
  background: var(--accent-light);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  white-space: nowrap;
}
.proof-card-question {
  font-size: 0.9rem;
  color: var(--muted);
  font-style: italic;
  margin-bottom: 0.5rem;
}
.proof-card-built {
  font-size: 0.9rem;
  color: var(--ink);
  margin-bottom: 0.5rem;
}
.proof-card-metric {
  font-family: 'Geist Mono', monospace;
  font-size: 0.8rem;
  color: var(--sage);
  font-weight: 600;
  margin-bottom: 0.4rem;
}
.proof-card-limitation {
  font-size: 0.8rem;
  color: var(--light-muted);
  margin-bottom: 0.4rem;
}
.proof-card-link {
  font-size: 0.78rem;
  font-family: 'Geist Mono', monospace;
}
.proof-card-codenote {
  color: var(--muted);
  font-style: italic;
}

/* --- Embedded Demo Panels --- */
.demo-panel {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed #e0e0e0;
}

/* Metric showcase (Card 2: Segmentation) */
.demo-metrics-row {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1rem;
}
.demo-metric-big {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.75rem 1.25rem;
  background: var(--accent-light);
  border: 1px solid #d0dff0;
  border-radius: var(--radius);
  min-width: 100px;
}
.demo-metric-value {
  font-family: 'Geist Mono', monospace;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.2;
}
.demo-metric-label {
  font-family: 'Geist Mono', monospace;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  margin-top: 0.15rem;
}

/* Pipeline diagram */
.demo-pipeline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}
.demo-pipeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-family: 'Geist Mono', monospace;
  color: var(--muted);
  font-weight: 500;
}
.demo-pipeline-icon {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  border: 1px solid #ddd;
}
.demo-icon-frame {
  background: linear-gradient(135deg, #e8e8e8 25%, #d0d0d0 25%, #d0d0d0 50%, #e8e8e8 50%, #e8e8e8 75%, #d0d0d0 75%);
  background-size: 8px 8px;
}
.demo-icon-model {
  background: linear-gradient(135deg, var(--accent-light), #c5d9f0);
  position: relative;
}
.demo-icon-model::after {
  content: 'AI';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Geist Mono', monospace;
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--accent);
}
.demo-icon-output {
  background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
  border-color: #a5d6a7;
}
.demo-pipeline-arrow {
  font-size: 1rem;
  color: var(--light-muted);
  font-weight: 300;
}

/* Demo note text */
.demo-note {
  font-size: 0.78rem;
  color: var(--light-muted);
  line-height: 1.5;
  font-style: italic;
}
.demo-visual-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}
.demo-visual-card {
  background: #fafafa;
  border: 1px solid #ebebeb;
  border-radius: 6px;
  overflow: hidden;
}
.demo-visual-card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.demo-visual-grid.demo-visual-grid--stacked {
  grid-template-columns: 1fr;
  max-width: 640px;
}
.demo-visual-card.demo-visual-card--stats img {
  aspect-ratio: auto;
  height: auto;
  object-fit: contain;
}
.demo-visual-card figcaption {
  padding: 0.55rem 0.65rem 0.65rem;
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--muted);
}
.demo-video-wrap {
  margin-bottom: 0.75rem;
}
.demo-video {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border: 1px solid #ebebeb;
  border-radius: 6px;
  background: #000;
}

/* Calibration diagram (Card 3: Validation) */
.demo-calibration-diagram {
  margin-bottom: 0.75rem;
}
.demo-cal-chart {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: 1fr auto;
  gap: 0.3rem;
  max-width: 220px;
}
.demo-cal-axis-y {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: 'Geist Mono', monospace;
  font-size: 0.55rem;
  color: var(--light-muted);
  text-transform: uppercase;
  letter-spacing: .03em;
  display: flex;
  align-items: center;
  justify-content: center;
}
.demo-cal-axis-x {
  grid-column: 2;
  font-family: 'Geist Mono', monospace;
  font-size: 0.55rem;
  color: var(--light-muted);
  text-transform: uppercase;
  letter-spacing: .03em;
  text-align: center;
}
.demo-cal-plot {
  position: relative;
  aspect-ratio: 1;
  background: #fafafa;
  border: 1px solid #e5e5e5;
  border-radius: 4px;
  overflow: hidden;
}
.demo-cal-perfect {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 141%;
  height: 2px;
  background: var(--sage);
  transform-origin: bottom left;
  transform: rotate(-45deg);
}
.demo-cal-typical {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  border-bottom: 2px dashed var(--amber);
  border-radius: 0 0 80% 0;
  clip-path: polygon(0 100%, 100% 0%, 100% 5%, 5% 100%);
}
.demo-cal-labels {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.demo-cal-label-text {
  font-family: 'Geist Mono', monospace;
  font-size: 7px;
  fill: var(--muted);
}

/* Demo tables */
.demo-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 0.75rem;
  font-size: 0.8rem;
}
.demo-table th {
  font-family: 'Geist Mono', monospace;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--muted);
  text-align: left;
  padding: 0.4rem 0.6rem;
  border-bottom: 2px solid #e5e5e5;
}
.demo-table td {
  padding: 0.35rem 0.6rem;
  border-bottom: 1px solid #f0f0f0;
  color: var(--ink);
  font-size: 0.8rem;
}
.demo-table-mono {
  font-family: 'Geist Mono', monospace;
  font-weight: 600;
}

/* Survival summary (Card 4: Staging) */
.demo-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.demo-stat {
  text-align: center;
  padding: 0.5rem;
  background: #fafafa;
  border: 1px solid #ebebeb;
  border-radius: 6px;
}
.demo-stat-value {
  display: block;
  font-family: 'Geist Mono', monospace;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
}
.demo-stat-label {
  display: block;
  font-family: 'Geist Mono', monospace;
  font-size: 0.58rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--muted);
  margin-top: 0.1rem;
}
.demo-table-compact td,
.demo-table-compact th {
  padding: 0.3rem 0.5rem;
}
.demo-highlight-good {
  color: var(--sage) !important;
}
.demo-highlight-bad {
  color: var(--red) !important;
}
.demo-table-vs {
  text-align: center;
  font-family: 'Geist Mono', monospace;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
  vertical-align: middle;
}
.demo-table-sub {
  display: block;
  font-size: 0.58rem;
  font-weight: 400;
  color: var(--light-muted);
  margin-top: 0.1rem;
}

/* --- Risk Map (kept from v1, adapted to new tone) --- */
.risk-map-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
.risk-controls {
  background: var(--panel-bg);
  border: var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.risk-controls h3 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}
.control-group {
  margin-bottom: 0.9rem;
}
.control-group label {
  display: block;
  font-family: 'Geist Mono', monospace;
  font-size: 0.68rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--muted);
  margin-bottom: 0.3rem;
}
.control-group select,
.control-group input[type="range"] {
  width: 100%;
  padding: 0.45rem 0.6rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-family: 'Geist', sans-serif;
  font-size: 0.9rem;
  background: #fff;
  color: var(--ink);
  outline: none;
  transition: border-color .15s;
  -webkit-appearance: none;
  appearance: none;
}
.control-group select { cursor: pointer; }
.control-group select:focus,
.control-group input[type="range"]:focus {
  border-color: var(--accent);
}
.control-group input[type="range"] {
  padding: 0;
  height: 5px;
  background: #e5e5e5;
  border-radius: 3px;
  border: none;
}
.control-group input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.range-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 0.25rem;
}
.range-value {
  font-family: 'Geist Mono', monospace;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
}

/* Stomach map */
.stomach-map-wrapper {
  background: var(--panel-bg);
  border: var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.stomach-map-container {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  background: #fafafa;
}
.stomach-shape {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 52%;
  height: 70%;
  border: 2px solid #ddd;
  border-radius: 38% 36% 32% 34% / 34% 42% 40% 38%;
  background: rgba(0,0,0,.01);
  pointer-events: none;
}

.station-marker {
  position: absolute;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid #ddd;
  background: #fff;
  color: var(--ink);
  font-family: 'Geist Mono', monospace;
  font-size: 0.65rem;
  font-weight: 600;
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: transform .15s, box-shadow .15s, border-color .15s;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  outline: none;
  padding: 0;
}
.station-marker:hover {
  transform: translate(-50%, -50%) scale(1.1);
  box-shadow: 0 2px 8px rgba(0,0,0,.1);
  z-index: 3;
}
.station-marker:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.station-marker.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(44,82,130,.15);
  transform: translate(-50%, -50%) scale(1.15);
  z-index: 4;
}
.station-marker.risk-low {
  background: var(--sage);
  color: #fff;
  border-color: var(--sage);
}
.station-marker.risk-moderate {
  background: var(--amber);
  color: #fff;
  border-color: var(--amber);
}
.station-marker.risk-high {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}

/* Detail panel */
.risk-detail {
  background: var(--panel-bg);
  border: var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.detail-placeholder {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}
.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.detail-header h3 {
  font-size: 1rem;
  font-weight: 700;
}
.risk-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-family: 'Geist Mono', monospace;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.risk-badge.risk-low {
  background: rgba(72,117,92,.12);
  color: var(--sage);
}
.risk-badge.risk-moderate {
  background: rgba(184,134,11,.12);
  color: var(--amber);
}
.risk-badge.risk-high {
  background: rgba(155,44,44,.12);
  color: var(--red);
}
.risk-value-display {
  font-family: 'Geist Mono', monospace;
  font-size: 2rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
  margin-bottom: 0.5rem;
}
.risk-bar-container {
  width: 100%;
  height: 3px;
  background: #e5e5e5;
  border-radius: 2px;
  margin-bottom: 0.75rem;
  overflow: hidden;
}
.risk-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width .3s ease;
}
.risk-bar-fill.risk-low { background: var(--sage); }
.risk-bar-fill.risk-moderate { background: var(--amber); }
.risk-bar-fill.risk-high { background: var(--red); }

/* Recurrence & survival calculator card */
.proof-card-wide { grid-column: 1 / -1; }
.calc-layout { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.calc-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem 0.9rem; }
.calc-controls .control-group { margin-bottom: 0; }
.calc-controls .control-group:last-child { grid-column: 1 / -1; }
.calc-demo-tag {
  font-family: 'Geist Mono', monospace;
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: #856404;
  display: block;
  margin-bottom: 0.4rem;
}
.calc-result-row { display: flex; align-items: baseline; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.calc-result-row .risk-value-display { margin-bottom: 0; }
.risk-value-display.risk-low { color: var(--sage); }
.risk-value-display.risk-moderate { color: var(--amber); }
.risk-value-display.risk-high { color: var(--red); }
.calc-output-label {
  font-family: 'Geist Mono', monospace;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--muted);
}
@media (min-width: 700px) {
  .calc-layout { grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: center; }
}

/* Calibration toggle (validation card) */
.cal-toggle { display: flex; gap: 0.4rem; margin-bottom: 0.9rem; }
.cal-btn {
  flex: 1;
  padding: 0.4rem 0.3rem;
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-family: 'Geist Mono', monospace;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted);
  transition: background .15s, color .15s, border-color .15s;
}
.cal-btn:hover { border-color: var(--accent); }
.cal-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.cal-readout { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; margin-bottom: 0.75rem; }
.cal-metric { text-align: center; padding: 0.5rem 0.25rem; background: #fafafa; border-radius: 6px; }
.cal-metric-label {
  display: block;
  font-family: 'Geist Mono', monospace;
  font-size: 0.56rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--muted);
  margin-bottom: 0.2rem;
}
.cal-metric-value { display: block; font-family: 'Geist Mono', monospace; font-size: 1rem; font-weight: 700; color: var(--ink); }
.cal-metric-value.good { color: var(--sage); }
.cal-metric-value.warn { color: var(--amber); }
.cal-metric-value.bad { color: var(--red); }
.cal-slope-scale { position: relative; height: 6px; background: #e5e5e5; border-radius: 3px; margin: 0.25rem 0 0.85rem; }
.cal-slope-ideal { position: absolute; left: 25%; top: -3px; bottom: -3px; width: 2px; background: var(--ink); opacity: .45; }
.cal-slope-marker {
  position: absolute;
  top: 50%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
  transform: translate(-50%, -50%);
  transition: left .25s ease, background .25s;
}

/* Stage survival explorer (visualisation card) */
.stage-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.9rem; }
.stage-chip {
  padding: 0.3rem 0.55rem;
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-family: 'Geist Mono', monospace;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
  transition: background .15s, color .15s, border-color .15s;
}
.stage-chip:hover { border-color: var(--accent); }
.stage-chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.stage-detail { background: #fafafa; border-radius: 8px; padding: 0.85rem; }
.stage-detail-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; margin-bottom: 0.5rem; flex-wrap: wrap; }
.stage-detail-name { font-family: 'Geist Mono', monospace; font-size: 0.8rem; font-weight: 600; color: var(--ink); }
.stage-detail-os { font-family: 'Geist Mono', monospace; font-size: 1.3rem; font-weight: 700; color: var(--ink); }
.detail-note {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 0.75rem;
}
.risk-disclaimer {
  font-family: 'Geist Mono', monospace;
  font-size: 0.62rem;
  color: var(--light-muted);
  text-transform: uppercase;
  letter-spacing: .02em;
  border-top: 1px solid #ebebeb;
  padding-top: 0.6rem;
}
.risk-error {
  padding: 2rem;
  text-align: center;
  color: var(--red);
  font-size: 0.9rem;
}

/* Map legend */
.map-legend {
  display: flex;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  border-top: 1px solid #ebebeb;
  justify-content: center;
  flex-wrap: wrap;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.68rem;
  font-family: 'Geist Mono', monospace;
  color: var(--muted);
}
.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.legend-dot.low { background: var(--sage); }
.legend-dot.moderate { background: var(--amber); }
.legend-dot.high { background: var(--red); }

/* Scaffold banner */
.scaffold-banner {
  background: #fffbeb;
  border: 1px solid #f0d060;
  border-radius: 6px;
  padding: 0.6rem 0.9rem;
  font-size: 0.8rem;
  line-height: 1.5;
  margin-top: 0.5rem;
  max-width: 640px;
}

/* --- Section 4: PhD Plan --- */
.timeline-list {
  list-style: none;
  position: relative;
  padding-left: 2rem;
  max-width: 640px;
}
.timeline-list::before {
  content: '';
  position: absolute;
  left: 0.75rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #e5e5e5;
}
.timeline-item {
  position: relative;
  padding-bottom: 1.5rem;
  padding-left: 1rem;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: '';
  position: absolute;
  left: -1.35rem;
  top: 0.3rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  z-index: 2;
}
.timeline-date {
  font-family: 'Geist Mono', monospace;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--accent);
  margin-bottom: 0.2rem;
  display: block;
}
.timeline-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}
.timeline-desc {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.6;
}

/* --- Section 5: Why Prof. Lee --- */
.why-content {
  max-width: 640px;
}
.why-content p {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.75;
  margin-bottom: 0.75rem;
}
.why-content p:last-child { margin-bottom: 0; }
.why-list {
  list-style: none;
  margin-top: 1rem;
}
.why-list li {
  font-size: 0.9rem;
  color: var(--muted);
  padding: 0.4rem 0;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}
.why-list li:last-child { border-bottom: none; }
.why-list .why-check {
  color: var(--sage);
  font-weight: 600;
  flex-shrink: 0;
}

/* --- Section 6: Contact --- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  max-width: 640px;
}
.contact-item {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}
.contact-label {
  font-family: 'Geist Mono', monospace;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--muted);
  min-width: 80px;
}
.contact-value {
  font-size: 0.9rem;
}
.downloads-list {
  list-style: none;
  margin-top: 1rem;
}
.downloads-list li {
  padding: 0.4rem 0;
  font-size: 0.9rem;
}
.downloads-list li span {
  color: var(--light-muted);
  font-size: 0.8rem;
}

/* --- Footer --- */
.site-footer {
  background: #f5f5f5;
  border-top: var(--border);
  padding: 1.5rem 1.25rem;
  text-align: center;
}
.footer-text {
  font-size: 0.78rem;
  color: var(--light-muted);
  max-width: var(--max-width);
  margin: 0 auto;
}
.footer-text a {
  color: var(--muted);
}

/* --- Responsive: >= 768px --- */
@media (min-width: 768px) {
  .about-facts {
    grid-template-columns: repeat(4, 1fr);
  }

  .proof-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .risk-map-layout {
    grid-template-columns: 220px 1fr 240px;
    align-items: start;
  }

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

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

  .transfer-gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* --- Responsive: <= 560px --- */
@media (max-width: 560px) {
  .header-nav { display: none; }

  .about-facts {
    grid-template-columns: 1fr 1fr;
  }
}

/* SISVSE transfer overlay gallery */
.transfer-gallery {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid #d9e4ef;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #f8fbff 0%, #f4f7fa 100%);
}
.transfer-gallery-header {
  display: grid;
  gap: 0.25rem;
  margin-bottom: 0.8rem;
}
.transfer-gallery-header h4 {
  font-size: 0.92rem;
  letter-spacing: -0.01em;
}
.transfer-gallery-header p {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.55;
  max-width: 65ch;
}
.transfer-gallery-grid {
  display: grid;
  gap: 0.75rem;
}
.transfer-figure {
  overflow: hidden;
  border: 1px solid #dde5ee;
  border-radius: 10px;
  background: #fff;
}
.transfer-figure img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.transfer-figure figcaption {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.65rem;
  font-size: 0.75rem;
  color: var(--muted);
  border-top: 1px solid #edf1f5;
}
.transfer-figure figcaption strong {
  color: var(--ink);
}
.transfer-figure figcaption span {
  font-family: 'Geist Mono', monospace;
  color: var(--accent);
}

/* Mobile overflow hardening */
.proof-card,
.demo-panel,
.demo-table,
.risk-panel,
.contact-card {
  min-width: 0;
}
.proof-card,
.demo-note,
.proof-card-metric,
.proof-card-link {
  overflow-wrap: anywhere;
}
.demo-table {
  table-layout: fixed;
  overflow-wrap: anywhere;
}
.demo-table th,
.demo-table td {
  word-break: break-word;
}
@media (max-width: 560px) {
  .container { padding: 0 1rem; }
  .proof-card { padding: 1rem; }
  .demo-panel { overflow-x: visible; }
  .demo-metrics-row { gap: 0.75rem; flex-wrap: wrap; }
  .demo-metric-big { flex: 1 1 120px; min-width: 0; padding: 0.6rem 0.75rem; }
  .demo-table { font-size: 0.68rem; table-layout: auto; }
  .demo-table th,
  .demo-table td { padding: 0.35rem 0.28rem; }
  .demo-table-mono { font-size: 0.64rem; }
}

/* --- Print --- */
@media print {
  body { background: #fff; font-size: 10pt; }
  .site-header { position: static; border-bottom: 2px solid #000; background: #fff; }
  .header-nav { display: none !important; }
  section { padding: 1rem 0; break-inside: avoid; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .proof-cards { grid-template-columns: 1fr 1fr; }
  .risk-map-layout { grid-template-columns: 1fr; }
  .scaffold-banner { border: 1px solid #999; background: #f9f9f9; }
  a { color: var(--ink); text-decoration: underline; }
  a::after { content: " (" attr(href) ")"; font-size: 0.7em; color: #888; }
  a[href^="#"]::after, a[href^="mailto:"]::after { content: none; }
  .site-footer { border-top: 1px solid #ccc; }
}
.transfer-figure figcaption strong,
.transfer-figure figcaption span {
  white-space: nowrap;
}
.transfer-figure figcaption {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.16rem;
}
.transfer-figure figcaption span {
  font-size: 0.68rem;
}

.detail-source-note {
  margin-top: 0.7rem;
  padding-top: 0.7rem;
  border-top: 1px solid #e6edf5;
  color: var(--light-muted);
  font-size: 0.74rem;
  line-height: 1.55;
}

.state-link-button {
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid #cbd9e8;
  border-radius: 8px;
  background: #f8fbff;
  color: var(--accent);
  font-family: 'Geist Mono', monospace;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.state-link-button:hover {
  background: #eef5fc;
  border-color: #a9c2dc;
}
.state-link-button:active {
  transform: translateY(1px);
}
.state-link-note {
  margin-top: 0.4rem;
  color: var(--light-muted);
  font-size: 0.68rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.risk-provenance-note {
  margin-top: 0.5rem;
  max-width: 680px;
  color: var(--light-muted);
  font-size: 0.76rem;
  line-height: 1.55;
}
.risk-provenance-note a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* --- Mobile table → stacked cards (<= 768px) --- */
@media (max-width: 768px) {
  .demo-table,
  .demo-table-compact {
    display: block;
    width: 100%;
    border: none;
    table-layout: auto;
    white-space: normal;
  }
  .demo-table thead,
  .demo-table-compact thead {
    display: none;
  }
  .demo-table tbody,
  .demo-table-compact tbody {
    display: block;
  }
  .demo-table tr,
  .demo-table-compact tr {
    display: block;
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
  }
  .demo-table td,
  .demo-table-compact td {
    display: block;
    text-align: left;
    padding: 0.3rem 0;
    border: none;
    white-space: normal;
    word-break: break-word;
  }
  .demo-table td::before,
  .demo-table-compact td::before {
    content: attr(data-label);
    display: block;
    font-weight: 600;
    font-size: 0.7rem;
    color: var(--muted, #6c757d);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.15rem;
  }
  .demo-table td[data-label=""]::before,
  .demo-table-compact td[data-label=""]::before,
  .demo-table td:not([data-label])::before,
  .demo-table-compact td:not([data-label])::before {
    display: none;
  }
}
