/* Thiên Thủy proposal deck — design tokens + slide components.
   Slides are authored on a fixed 1600x900 canvas and scaled to the viewport by deck.js. */
:root {
  --ink: #0F172A;
  --ink-2: #334155;
  --muted: #64748B;
  --line: #E2E8F0;
  --line-2: #CBD5E1;
  --bg: #EEF2F6;
  --surface: #FFFFFF;
  --surface-2: #F8FAFC;

  --primary: #0E7490;
  --primary-600: #0891B2;
  --primary-50: #ECFEFF;
  --primary-100: #CFFAFE;
  --navy: #0B2545;
  --navy-2: #13315C;

  --accent: #EA580C;
  --accent-50: #FFF7ED;
  --accent-100: #FFEDD5;
  --safe: #15803D;
  --safe-50: #F0FDF4;
  --danger: #DC2626;
  --danger-50: #FEF2F2;
  --warn: #B45309;
  --warn-50: #FFFBEB;
  --violet: #6D28D9;
  --violet-50: #F5F3FF;

  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 4px 16px rgba(15, 23, 42, .06);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --font: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  font-feature-settings: "tnum" 1;
}

/* ---------- Stage & scaling ---------- */
.stage { position: fixed; inset: 0; display: grid; place-items: center; }
.deck {
  position: relative;
  width: 1600px;
  height: 900px;
  transform-origin: center center;
  flex: none;
}
.slide {
  position: absolute; inset: 0;
  background: var(--surface);
  border-radius: 6px;
  box-shadow: 0 10px 40px rgba(15, 23, 42, .12);
  padding: 64px 80px 72px;
  display: flex; flex-direction: column;
  overflow: hidden;
  opacity: 0; visibility: hidden;
  transform: translateX(24px);
  transition: opacity .32s var(--ease), transform .32s var(--ease), visibility 0s linear .32s;
}
.slide.active { opacity: 1; visibility: visible; transform: none; transition: opacity .32s var(--ease), transform .32s var(--ease); }
.slide.prev { transform: translateX(-24px); }

/* Slide chrome */
.slide-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.eyebrow {
  font-size: 15px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--primary); display: inline-flex; align-items: center; gap: 10px;
}
.eyebrow::before { content: ""; width: 28px; height: 3px; border-radius: 2px; background: var(--primary); }
.slide-foot {
  position: absolute; left: 80px; right: 80px; bottom: 26px;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; color: var(--muted);
  border-top: 1px solid var(--line); padding-top: 12px;
}
.slide-foot .brand { font-weight: 700; color: var(--ink-2); letter-spacing: .02em; }
.slide-foot .src { max-width: 1000px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

h1, h2, h3, h4 { letter-spacing: -.02em; line-height: 1.15; }
.title { font-size: 44px; font-weight: 800; color: var(--ink); max-width: 1300px; }
.title em { font-style: normal; color: var(--primary); }
.title .hl { font-style: normal; color: var(--accent); }
.subtitle { font-size: 21px; color: var(--muted); margin-top: 12px; max-width: 1250px; line-height: 1.5; font-weight: 400; }
.body { flex: 1; min-height: 0; margin-top: 32px; display: flex; flex-direction: column; gap: 22px; }

/* ---------- Layout helpers ---------- */
.row { display: flex; gap: 24px; }
.grid { display: grid; gap: 22px; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g5 { grid-template-columns: repeat(5, 1fr); }
.g6 { grid-template-columns: repeat(6, 1fr); }
.span2 { grid-column: span 2; }
.span3 { grid-column: span 3; }
.fill { flex: 1; min-height: 0; }
.center { align-items: center; }
.between { justify-content: space-between; }
.col { display: flex; flex-direction: column; gap: 14px; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 22px 24px;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 10px;
  min-width: 0;
}
.card.flat { box-shadow: none; background: var(--surface-2); }
.card h3 { font-size: 21px; font-weight: 700; }
.card h4 { font-size: 17px; font-weight: 700; }
.card p, .card li { font-size: 16.5px; line-height: 1.55; color: var(--ink-2); }
.card ul { padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.card .meta { font-size: 14px; color: var(--muted); }
.card.tone-primary { border-top: 4px solid var(--primary); }
.card.tone-accent { border-top: 4px solid var(--accent); }
.card.tone-safe { border-top: 4px solid var(--safe); }
.card.tone-danger { border-top: 4px solid var(--danger); }
.card.tone-violet { border-top: 4px solid var(--violet); }
.card.tone-warn { border-top: 4px solid var(--warn); }

.icon-badge {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: none;
  background: var(--primary-50); color: var(--primary);
}
.icon-badge svg { width: 22px; height: 22px; stroke-width: 2; }
.icon-badge.accent { background: var(--accent-50); color: var(--accent); }
.icon-badge.safe { background: var(--safe-50); color: var(--safe); }
.icon-badge.danger { background: var(--danger-50); color: var(--danger); }
.icon-badge.violet { background: var(--violet-50); color: var(--violet); }
.icon-badge.warn { background: var(--warn-50); color: var(--warn); }
.card-head { display: flex; align-items: center; gap: 14px; }

/* KPI tiles */
.kpi { padding: 20px 22px; gap: 4px; }
.kpi .label { font-size: 14.5px; color: var(--muted); font-weight: 600; }
.kpi .value { font-size: 40px; font-weight: 800; letter-spacing: -.03em; color: var(--ink); line-height: 1.1; }
.kpi .value small { font-size: 18px; font-weight: 600; color: var(--muted); margin-left: 4px; }
.kpi .delta { font-size: 14.5px; font-weight: 600; }
.up { color: var(--safe); } .down { color: var(--danger); } .neutral { color: var(--muted); }

/* Tags & chips */
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
  background: var(--primary-50); color: var(--primary); white-space: nowrap;
}
.tag.accent { background: var(--accent-50); color: var(--accent); }
.tag.safe { background: var(--safe-50); color: var(--safe); }
.tag.danger { background: var(--danger-50); color: var(--danger); }
.tag.warn { background: var(--warn-50); color: var(--warn); }
.tag.violet { background: var(--violet-50); color: var(--violet); }
.tag.gray { background: #F1F5F9; color: var(--ink-2); }

/* So-what callout */
.callout {
  display: flex; gap: 16px; align-items: flex-start;
  background: var(--navy); color: #fff; border-radius: var(--r-md); padding: 18px 24px;
}
.callout .k { font-size: 13px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #7DD3FC; white-space: nowrap; padding-top: 3px; }
.callout p { font-size: 18px; line-height: 1.5; color: #E2E8F0; }
.callout b { color: #fff; }
.callout.light { background: var(--primary-50); color: var(--ink); border: 1px solid var(--primary-100); }
.callout.light .k { color: var(--primary); }
.callout.light p { color: var(--ink-2); }
.callout.light b { color: var(--ink); }

/* Tables */
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 15.5px; }
.tbl th { text-align: left; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 10px 12px; border-bottom: 2px solid var(--line); background: var(--surface-2); }
.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--line); color: var(--ink-2); vertical-align: top; line-height: 1.45; }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tr:last-child td { border-bottom: none; }
.tbl b { color: var(--ink); }
.tbl-wrap { border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: var(--surface); }

/* Bars (inline horizontal) */
.hbar { height: 10px; border-radius: 6px; background: #F1F5F9; overflow: hidden; }
.hbar > span { display: block; height: 100%; border-radius: 6px; background: var(--primary); }
.hbar.accent > span { background: var(--accent); }
.hbar.danger > span { background: var(--danger); }

/* Chart container */
.chart-box { position: relative; flex: 1; min-height: 0; }
.chart-box canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; }
.chart-title { font-size: 16px; font-weight: 700; color: var(--ink); }
.chart-note { font-size: 13.5px; color: var(--muted); }

/* Big number */
.big { font-size: 72px; font-weight: 800; letter-spacing: -.04em; line-height: 1; }
.big.accent { color: var(--accent); } .big.primary { color: var(--primary); } .big.danger { color: var(--danger); }

/* Numbered steps */
.steps { display: grid; gap: 0; counter-reset: s; }
.step { display: grid; grid-template-columns: 56px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px dashed var(--line); }
.step:last-child { border-bottom: none; }
.step .n {
  width: 44px; height: 44px; border-radius: 50%; background: var(--primary); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 18px;
}
.step h4 { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.step p { font-size: 16px; color: var(--ink-2); line-height: 1.5; }

/* Timeline (LIVE session) */
.tl { display: flex; height: 64px; border-radius: 12px; overflow: hidden; }
.tl > div { display: flex; flex-direction: column; justify-content: center; padding: 0 12px; color: #fff; font-size: 14px; font-weight: 700; line-height: 1.25; }
.tl > div small { font-weight: 500; opacity: .85; font-size: 12.5px; }

/* Matrix */
.matrix { display: grid; grid-template-columns: 210px repeat(6, 1fr); gap: 6px; flex: 1; min-height: 0; }
.matrix .h { font-size: 14px; font-weight: 800; color: var(--ink); padding: 10px 10px; background: var(--surface-2); border-radius: 8px; display: flex; align-items: center; gap: 8px; line-height: 1.25; }
.matrix .h.col { flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; }
.matrix .h small { font-weight: 500; color: var(--muted); font-size: 12px; }
.matrix .c { font-size: 13px; line-height: 1.38; color: var(--ink-2); padding: 9px 10px; border-radius: 8px; border: 1px solid var(--line); background: #fff; }
.matrix .c.power { background: var(--accent-50); border-color: #FDBA74; color: var(--ink); font-weight: 600; }
.matrix .c.proven { box-shadow: inset 3px 0 0 var(--safe); }

/* Calendar */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; }
.cal .d { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #fff; display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.cal .d .day { font-size: 13px; font-weight: 800; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.cal .d h4 { font-size: 16px; font-weight: 700; line-height: 1.3; }
.cal .d p { font-size: 13.5px; color: var(--ink-2); line-height: 1.45; }
.cal .d.live { background: var(--navy); border-color: var(--navy); }
.cal .d.live .day { color: #7DD3FC; } .cal .d.live h4 { color: #fff; } .cal .d.live p { color: #CBD5E1; }

/* Pyramid */
.pyr { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.pyr > div { color: #fff; border-radius: 12px; padding: 16px 20px; text-align: center; }
.pyr h4 { font-size: 19px; font-weight: 800; }
.pyr p { font-size: 14.5px; opacity: .92; margin-top: 4px; line-height: 1.4; }

/* Gantt */
.gantt { display: grid; grid-template-columns: 220px repeat(12, 1fr); gap: 0; font-size: 14px; }
.gantt .gh { font-size: 12.5px; font-weight: 700; color: var(--muted); text-align: center; padding: 8px 0; border-bottom: 2px solid var(--line); }
.gantt .gl { font-weight: 700; color: var(--ink); padding: 10px 10px 10px 0; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; }
.gantt .gc { border-bottom: 1px solid var(--line); border-left: 1px dashed var(--line); position: relative; min-height: 50px; }
.gantt .bar {
  position: absolute; top: 8px; bottom: 8px; border-radius: 8px; color: #fff; font-size: 12.5px; font-weight: 700;
  display: flex; align-items: center; padding: 0 10px; white-space: nowrap; overflow: hidden; z-index: 1;
}

/* Section divider slides */
.slide.divider { background: var(--navy); color: #fff; justify-content: center; padding: 80px 110px; }
.slide.divider .num { font-size: 140px; font-weight: 800; color: rgba(255, 255, 255, .1); line-height: 1; letter-spacing: -.05em; }
.slide.divider h2 { font-size: 72px; font-weight: 800; letter-spacing: -.03em; margin-top: -30px; }
.slide.divider p { font-size: 24px; color: #CBD5E1; margin-top: 18px; max-width: 1050px; line-height: 1.5; }
.slide.divider .chips { display: flex; gap: 12px; margin-top: 40px; flex-wrap: wrap; }
.slide.divider .chips span { border: 1px solid rgba(255, 255, 255, .25); color: #E2E8F0; padding: 8px 16px; border-radius: 999px; font-size: 16px; font-weight: 600; }
.slide.divider .slide-foot { border-color: rgba(255, 255, 255, .12); color: #94A3B8; }
.slide.divider .slide-foot .brand { color: #E2E8F0; }

/* Cover */
.slide.cover { background: var(--navy); color: #fff; padding: 0; flex-direction: row; }
.cover .left { flex: 1.25; padding: 80px 90px; display: flex; flex-direction: column; justify-content: space-between; }
.cover .right { flex: 1; background: linear-gradient(160deg, var(--primary) 0%, var(--navy-2) 100%); padding: 70px 64px; display: flex; flex-direction: column; justify-content: center; gap: 18px; position: relative; overflow: hidden; }
.cover .right::after { content: ""; position: absolute; width: 520px; height: 520px; border-radius: 50%; border: 70px solid rgba(255, 255, 255, .06); right: -200px; bottom: -220px; }
.cover h1 { font-size: 64px; font-weight: 800; letter-spacing: -.035em; line-height: 1.08; }
.cover h1 span { color: #FDBA74; }
.cover .lead { font-size: 22px; color: #CBD5E1; margin-top: 22px; line-height: 1.5; max-width: 720px; }
.cover .stat { border-left: 3px solid #FDBA74; padding-left: 18px; position: relative; z-index: 1; }
.cover .stat b { font-size: 44px; font-weight: 800; display: block; letter-spacing: -.03em; }
.cover .stat span { font-size: 16px; color: #E0F2FE; }
.cover .meta { font-size: 15px; color: #94A3B8; display: flex; gap: 28px; }
.cover .meta b { color: #E2E8F0; font-weight: 600; }

/* Key message band */
.km { display: flex; align-items: stretch; border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); }
.km > div { flex: 1; padding: 28px 32px; display: flex; flex-direction: column; gap: 8px; }
.km .safe { background: var(--safe); color: #fff; }
.km .deal { background: var(--accent); color: #fff; }
.km h3 { font-size: 34px; font-weight: 800; letter-spacing: -.02em; }
.km p { font-size: 17px; opacity: .95; line-height: 1.5; }
.km .plus { flex: 0 0 64px; background: #fff; color: var(--ink); display: grid; place-items: center; font-size: 34px; font-weight: 800; padding: 0; }

/* Flow diagram */
.flow { display: flex; align-items: stretch; gap: 0; }
.flow .node { flex: 1; border-radius: var(--r-md); padding: 20px; display: flex; flex-direction: column; gap: 8px; border: 1px solid var(--line); background: #fff; }
.flow .arrow { flex: 0 0 44px; display: grid; place-items: center; color: var(--line-2); }
.flow .arrow svg { width: 28px; height: 28px; }

/* Progress meter list */
.meter-row { display: grid; grid-template-columns: 260px 1fr 90px; gap: 14px; align-items: center; font-size: 15.5px; }
.meter-row .v { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- Controls ---------- */
.ui { position: fixed; z-index: 50; }
.progress { top: 0; left: 0; height: 4px; background: var(--primary); transition: width .3s var(--ease); }
.controls {
  bottom: 14px; right: 22px; display: flex; gap: 8px; align-items: center;
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px; box-shadow: var(--shadow);
}
.controls button {
  width: 44px; height: 44px; border-radius: 50%; border: none; background: transparent; color: var(--ink-2);
  display: grid; place-items: center; cursor: pointer; transition: background .15s ease, color .15s ease;
}
.controls button:hover { background: var(--primary-50); color: var(--primary); }
.controls button:focus-visible, .toc a:focus-visible { outline: 3px solid var(--primary-600); outline-offset: 2px; }
.controls button svg { width: 20px; height: 20px; }
.controls .count { font-size: 14px; font-weight: 700; color: var(--ink-2); padding: 0 8px; min-width: 64px; text-align: center; font-variant-numeric: tabular-nums; }

.toc-panel {
  top: 0; left: 0; bottom: 0; width: 380px; background: #fff; border-right: 1px solid var(--line);
  box-shadow: 0 10px 40px rgba(15, 23, 42, .18); transform: translateX(-100%); transition: transform .25s var(--ease);
  padding: 24px 18px; overflow-y: auto; z-index: 60;
}
.toc-panel.open { transform: none; }
.toc-panel h3 { font-size: 15px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 0 10px 12px; }
.toc a {
  display: flex; gap: 12px; padding: 10px 10px; border-radius: 10px; text-decoration: none; color: var(--ink-2); font-size: 14.5px; line-height: 1.35; cursor: pointer;
}
.toc a:hover { background: var(--surface-2); }
.toc a.current { background: var(--primary-50); color: var(--primary); font-weight: 700; }
.toc a .i { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 22px; }
.toc a.sec { margin-top: 10px; font-weight: 800; color: var(--ink); }
.scrim { inset: 0; background: rgba(15, 23, 42, .4); opacity: 0; pointer-events: none; transition: opacity .2s ease; z-index: 55; }
.scrim.open { opacity: 1; pointer-events: auto; }

.hint { bottom: 24px; left: 24px; font-size: 13px; color: var(--muted); }
.hint kbd { font-family: var(--font); background: #fff; border: 1px solid var(--line-2); border-radius: 5px; padding: 1px 6px; font-size: 12px; }

@media (prefers-reduced-motion: reduce) {
  .slide, .slide.active, .progress, .toc-panel { transition: none !important; transform: none !important; }
}
@media (max-width: 760px) { .hint { display: none; } .controls { right: 50%; transform: translateX(50%); } }

/* Print: one slide per page */
@media print {
  @page { size: 1600px 900px; margin: 0; }
  body { overflow: visible; background: #fff; }
  .stage { position: static; display: block; }
  .deck { transform: none !important; width: 1600px; height: auto; }
  .slide { position: relative; opacity: 1; visibility: visible; transform: none; height: 900px; page-break-after: always; box-shadow: none; border-radius: 0; }
  .ui, .scrim, .toc-panel { display: none !important; }
}

/* Gantt month gridlines drawn once per row instead of per-cell borders */
.gantt .gc { border-left: none; background-image: repeating-linear-gradient(to right, transparent 0, transparent calc(100% / 12 - 1px), var(--line) calc(100% / 12 - 1px), var(--line) calc(100% / 12)); }

/* ---------- Readability pass: larger type to fill the 1600x900 canvas ---------- */
.card { gap: 12px; }
.card h3 { font-size: 24px; }
.card h4 { font-size: 19px; }
.card p, .card li { font-size: 18px; line-height: 1.55; }
.card .meta { font-size: 15px; }
.card > .tag, .card > span.tag { align-self: flex-start; }
.card.lg p, .card.lg li { font-size: 20.5px; line-height: 1.6; }
.card.lg ul { gap: 10px; }
.kpi .label { font-size: 16px; }
.kpi .delta { font-size: 15.5px; }
.tbl { font-size: 17px; }
.tbl th { font-size: 13.5px; }
.tbl td { padding: 12px 14px; }
.meter-row { font-size: 17px; }
.step p { font-size: 17.5px; }
.step h4 { font-size: 19px; }
.cal .d h4 { font-size: 18px; }
.cal .d p { font-size: 15px; }
.pyr h4 { font-size: 22px; }
.pyr p { font-size: 16px; }
.pyr > div { padding: 22px 24px; }
.flow .node p { font-size: 17px !important; }
.callout p { font-size: 19px; }
.gantt { font-size: 15.5px; }
.gantt .bar { font-size: 13.5px; }
.gantt .gc { min-height: 56px; }
.matrix .c { font-size: 13.5px; }
.tl > div { font-size: 15px; }
.tl > div small { font-size: 13px; }
.cover h1 { font-size: 58px; }
.tbl.compact td { padding: 8px 12px; font-size: 16px; } .tbl.compact th { padding: 8px 12px; }
