:root {
  --bg: #f5f4ed;
  --surface: #faf9f3;
  --fg: #24231f;
  --muted: #66645b;
  --border: #cbc8bb;
  --accent: #1B365D;
  --tag: #E4ECF5;
  --serif: Charter, Georgia, Palatino, "Times New Roman", serif;
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
  --shadow: 0 4px 24px rgba(0,0,0,0.05);
}

* { box-sizing: border-box; }

html { background: var(--bg); scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--fg);
  background: var(--bg);
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-underline-offset: 0.2em; }

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 5px;
}

/* Language switching: default state (no data-lang, or data-lang="vi") shows Vietnamese only.
   Setting data-lang="en" on <html> shows English only. Content never mixes. */
html[data-lang="en"] .i18n-vi { display: none; }
html:not([data-lang="en"]) .i18n-en { display: none; }

.lang-switch { display: inline-flex; align-items: center; gap: 8px; }
.lang-btn {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  letter-spacing: inherit;
  color: var(--muted);
  cursor: pointer;
}
.lang-btn:hover { color: var(--fg); }
.lang-btn[data-lang-btn="vi"] { color: var(--fg); }
html[data-lang="en"] .lang-btn[data-lang-btn="vi"] { color: var(--muted); }
html[data-lang="en"] .lang-btn[data-lang-btn="en"] { color: var(--fg); }
.lang-sep { color: var(--muted); }

.sheet {
  width: min(1180px, calc(100% - 64px));
  margin: 32px auto;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.page-pad { padding-inline: clamp(32px, 6vw, 92px); }

.eyebrow {
  min-height: 54px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid var(--border);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  line-height: 1.2;
  text-transform: uppercase;
  color: var(--muted);
}

.eyebrow-center { color: var(--fg); }
.eyebrow-right { text-align: right; font-variant-numeric: tabular-nums; }

.hero {
  padding-top: clamp(70px, 10vw, 126px);
  padding-bottom: clamp(68px, 8vw, 104px);
  border-bottom: 1px solid var(--border);
}

.section-num {
  margin: 0 0 26px;
  color: var(--accent);
  font-size: 14px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

h1, h2, h3, p { margin-top: 0; }

h1 {
  max-width: 970px;
  margin-bottom: 36px;
  font-size: clamp(58px, 8.3vw, 104px);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 0.96;
  text-wrap: balance;
}

.accent { color: var(--accent); }

.tagline {
  max-width: 740px;
  margin-bottom: 36px;
  font-size: clamp(19px, 2.1vw, 23px);
  line-height: 1.45;
  color: var(--muted);
}

.tagline strong { color: var(--fg); font-weight: 500; }

.tags { display: flex; flex-wrap: wrap; gap: 10px; }

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 13px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
  color: var(--muted);
}

.manifesto-wrap {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: clamp(42px, 7vw, 92px);
  padding-top: 74px;
  padding-bottom: 74px;
  border-bottom: 1px solid var(--border);
}

.manifesto-kicker h2 {
  max-width: 400px;
  margin-bottom: 22px;
  font-size: clamp(30px, 4vw, 46px);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

.manifesto-kicker p {
  max-width: 360px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.quote {
  margin: 0;
  padding-left: clamp(24px, 3vw, 40px);
  border-left: 3px solid var(--accent);
}

.quote p {
  margin-bottom: 28px;
  font-size: clamp(19px, 2vw, 22px);
  line-height: 1.62;
}

.quote footer {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.proof {
  padding-top: 66px;
  padding-bottom: 66px;
  border-bottom: 1px solid var(--border);
}

.proof-labels,
.proof-line {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: clamp(18px, 4vw, 54px);
  align-items: baseline;
}

.proof-labels {
  margin-bottom: 17px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.proof-labels span:last-child { text-align: right; }

.proof-line {
  padding: 28px 0 25px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  font-size: clamp(34px, 5.7vw, 70px);
  letter-spacing: -0.035em;
  line-height: 1;
}

.proof-line .arrow { color: var(--muted); font-size: 0.64em; }
.proof-line .output { color: var(--accent); text-align: right; }

.download-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-top: 27px;
}

.download-note { margin: 0; color: var(--muted); font-size: 14px; }

.download-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 13px 19px;
  background: var(--accent);
  color: var(--surface);
  border: 1px solid var(--accent);
  box-shadow: var(--shadow);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-decoration: none;
  text-transform: uppercase;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--border);
}

.metric {
  min-height: 130px;
  padding: 33px clamp(20px, 3vw, 34px);
  border-right: 1px solid var(--border);
}

.metric:last-child { border-right: 0; }

.metric-value {
  display: block;
  margin-bottom: 12px;
  color: var(--accent);
  font-size: 25px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.metric-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.chapters { padding-top: 82px; padding-bottom: 84px; }

.chapter {
  display: grid;
  grid-template-columns: 82px 0.8fr 1.35fr;
  gap: clamp(24px, 4vw, 58px);
  padding: 48px 0 52px;
  border-top: 1px solid var(--border);
}

.chapter:first-of-type { margin-top: 39px; }

.section-title {
  margin-bottom: 16px;
  font-size: clamp(27px, 3vw, 32px);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.12;
}

.section-lede {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.chapter-body { font-size: 15px; line-height: 1.55; }
.chapter-body p:last-child { margin-bottom: 0; }

ul.dash { margin: 0; padding: 0; list-style: none; }
ul.dash li { position: relative; padding-left: 22px; }
ul.dash li + li { margin-top: 11px; }
ul.dash li::before { content: "—"; position: absolute; left: 0; color: var(--accent); }

.steps { counter-reset: steps; }
.step { position: relative; padding-left: 36px; }
.step + .step { margin-top: 17px; }
.step::before {
  counter-increment: steps;
  content: "0" counter(steps);
  position: absolute;
  left: 0;
  top: 0.1em;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.code {
  margin-top: 22px;
  padding: 18px 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.footer {
  padding-top: 72px;
  padding-bottom: 56px;
  border-top: 1px solid var(--border);
}

.footer-kicker {
  margin: 0 0 66px;
  font-size: clamp(76px, 14vw, 168px);
  font-weight: 500;
  letter-spacing: -0.065em;
  line-height: 0.78;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr repeat(3, 1fr);
  gap: clamp(28px, 5vw, 64px);
  padding-top: 34px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  line-height: 1.55;
}

.footer-grid h3 {
  margin-bottom: 13px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.footer-grid p { margin-bottom: 0; }
.footer-grid a { display: block; margin-bottom: 7px; overflow-wrap: anywhere; }
.numeric { font-variant-numeric: tabular-nums; }

@media (max-width: 980px) {
  .sheet { width: min(100% - 32px, 900px); margin: 16px auto; }
  .manifesto-wrap { grid-template-columns: 1fr 1.35fr; }
  .chapter { grid-template-columns: 54px 0.85fr 1.25fr; }
  .footer-grid { grid-template-columns: 1.2fr 1fr 1fr; }
  .footer-grid > :last-child { grid-column: 2 / -1; }
}

@media (max-width: 768px) {
  .page-pad { padding-inline: 30px; }
  .eyebrow { grid-template-columns: 1fr 1fr; }
  .eyebrow-center { display: none; }
  .manifesto-wrap { grid-template-columns: 1fr; }
  .manifesto-kicker p { max-width: 600px; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .metric:nth-child(2) { border-right: 0; }
  .metric:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  .chapter { grid-template-columns: 48px 1fr; }
  .chapter-body { grid-column: 2; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid > :last-child { grid-column: auto; }
}

@media (max-width: 560px) {
  .sheet { width: 100%; margin: 0; border-left: 0; border-right: 0; box-shadow: none; }
  .page-pad { padding-inline: 22px; }
  .eyebrow { gap: 12px; min-height: 50px; font-size: 10px; }
  .hero { padding-top: 62px; padding-bottom: 62px; }
  h1 { font-size: clamp(49px, 15.5vw, 70px); }
  .manifesto-wrap { padding-top: 58px; padding-bottom: 58px; }
  .proof-labels { grid-template-columns: 1fr 1fr; }
  .proof-labels span:nth-child(2) { display: none; }
  .proof-line { grid-template-columns: 1fr; gap: 16px; font-size: clamp(42px, 13vw, 62px); }
  .proof-line .arrow { transform: rotate(90deg); width: fit-content; }
  .proof-line .output { text-align: left; }
  .download-row { align-items: stretch; flex-direction: column; }
  .download-link { width: 100%; }
  .metrics { grid-template-columns: 1fr; }
  .metric, .metric:nth-child(2) { border-right: 0; border-bottom: 1px solid var(--border); }
  .metric:last-child { border-bottom: 0; }
  .chapter { grid-template-columns: 1fr; gap: 20px; }
  .chapter-body { grid-column: 1; }
  .footer-kicker { margin-bottom: 48px; }
  .footer-grid { grid-template-columns: 1fr; }
}

@media print {
  @page { size: A3 portrait; margin: 10mm; }
  html, body { background: var(--bg); print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .sheet { width: 100%; margin: 0; border: 1px solid var(--border); box-shadow: none; }
  .page-pad { padding-inline: 12mm; }
  .eyebrow { min-height: 10mm; }
  .hero { padding-top: 12mm; padding-bottom: 11mm; }
  .hero h1 { max-width: 230mm; margin-bottom: 7mm; font-size: 68px; }
  .tagline { margin-bottom: 6mm; font-size: 18px; }
  .manifesto-wrap, .proof { padding-top: 10mm; padding-bottom: 10mm; }
  .manifesto-wrap { gap: 12mm; }
  .manifesto-kicker h2 { font-size: 31px; }
  .quote p { font-size: 17px; line-height: 1.48; }
  .proof-line { padding-block: 5mm; font-size: 48px; }
  .metrics .metric { min-height: 24mm; padding: 6mm; }
  .chapters { padding-top: 10mm; padding-bottom: 9mm; }
  .chapter { gap: 7mm; padding: 5.5mm 0; }
  .section-title { font-size: 23px; }
  .section-lede, .chapter-body { font-size: 11.5px; line-height: 1.42; }
  .footer { padding-top: 9mm; padding-bottom: 9mm; }
  .footer-kicker { margin-bottom: 8mm; font-size: 92px; }
  .footer-grid { padding-top: 6mm; gap: 8mm; font-size: 10px; }
  .download-link { box-shadow: none; }
  .chapter, .proof, .metric, .footer-grid { break-inside: avoid; }
}
