/* ============================================================================
 * base.css — Design tokens, reset, typography, layout primitives
 * vuvietthanh.top — premium editorial / financial intelligence
 * ==========================================================================*/

/* ---------- Design tokens ------------------------------------------------- */
:root {
  /* Palette */
  --ink: #0B0D0F;           /* primary dark */
  --charcoal: #16191D;      /* dark section bg */
  --charcoal-2: #1D2126;
  --warm-white: #F5F2EB;    /* warm light bg */
  --white: #FFFFFF;
  --muted: #8C9095;         /* secondary text */
  --muted-2: #B4B8BD;
  --gold: #B89B61;          /* champagne accent — dùng tiết chế */
  --gold-soft: rgba(184, 155, 97, 0.14);
  --line: rgba(255, 255, 255, 0.10);
  --line-dark: rgba(11, 13, 15, 0.12);

  /* Semantic (default = dark theme surfaces) */
  --bg: var(--ink);
  --bg-elev: var(--charcoal);
  --fg: var(--warm-white);
  --fg-dim: var(--muted);
  --border: var(--line);

  /* Typography */
  --font-display: "Playfair Display", "Lora", Georgia, serif;
  --font-body: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Fluid type scale (clamp) */
  --fs-eyebrow: clamp(0.72rem, 0.68rem + 0.2vw, 0.82rem);
  --fs-body: clamp(1rem, 0.96rem + 0.25vw, 1.1rem);
  --fs-lead: clamp(1.12rem, 1rem + 0.7vw, 1.45rem);
  --fs-h4: clamp(1.1rem, 1rem + 0.6vw, 1.4rem);
  --fs-h3: clamp(1.4rem, 1.15rem + 1.3vw, 2.1rem);
  --fs-h2: clamp(1.9rem, 1.4rem + 2.6vw, 3.4rem);
  --fs-h1: clamp(2.6rem, 1.6rem + 5.2vw, 6.4rem);
  --fs-display: clamp(3rem, 1.5rem + 8vw, 8.5rem);

  /* Spacing / layout */
  --container: 1240px;
  --container-narrow: 820px;
  --gutter: clamp(1.15rem, 0.6rem + 2.4vw, 2.6rem);
  --section-y: clamp(4.5rem, 3rem + 7vw, 9.5rem);
  --radius: 4px;
  --radius-lg: 10px;
  --radius-xl: 18px;

  /* Elevation */
  --shadow-sm: 0 1px 2px rgba(0,0,0,.18);
  --shadow: 0 18px 50px -24px rgba(0,0,0,.55);
  --shadow-gold: 0 24px 60px -30px rgba(184,155,97,.45);

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur: 0.6s;
}

/* ---------- Reset --------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: clip;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.7;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  min-height: 100vh;
}

img, picture, svg, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
ul, ol { list-style: none; padding: 0; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 2px; }

/* ---------- Typography ---------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
/* Tiếng Việt: dấu chồng cần line-height thoáng hơn cho heading lớn */
h1 { font-size: var(--fs-h1); line-height: 1.08; padding-bottom: .04em; }
h2 { font-size: var(--fs-h2); line-height: 1.14; padding-bottom: .04em; }
h3 { font-size: var(--fs-h3); line-height: 1.2; }
h4 { font-size: var(--fs-h4); line-height: 1.3; }
p { text-wrap: pretty; }

.display {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--fs-display);
  line-height: 1.02;
  letter-spacing: -0.02em;
  padding-bottom: .05em;
}

.eyebrow {
  font-family: var(--font-body);
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--gold);
  display: inline-flex;
  align-items: center;
  gap: .7rem;
}
.eyebrow::before {
  content: "";
  width: 28px; height: 1px;
  background: var(--gold);
  opacity: .7;
}
.eyebrow.no-rule::before { display: none; }

.lead { font-size: var(--fs-lead); line-height: 1.55; color: var(--muted-2); font-weight: 300; }
.muted { color: var(--fg-dim); }
.serif { font-family: var(--font-display); }
.gold { color: var(--gold); }

/* Pull quote editorial */
.pullquote {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 1rem + 1.9vw, 2.35rem);
  line-height: 1.34;
  font-style: italic;
  letter-spacing: -0.01em;
  padding-bottom: .08em;
}

/* ---------- Layout primitives -------------------------------------------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.container.narrow { max-width: var(--container-narrow); }
.section { padding-block: var(--section-y); position: relative; }
.section.tight { padding-block: clamp(3rem, 2rem + 4vw, 5.5rem); }

/* Theme surfaces — xen kẽ sáng/tối tạo nhịp */
.surface-dark  { --bg: var(--ink);        --bg-elev: var(--charcoal);  --fg: var(--warm-white); --fg-dim: var(--muted); --border: var(--line);      background: var(--ink);  color: var(--warm-white); }
.surface-char  { --bg: var(--charcoal);   --bg-elev: var(--charcoal-2);--fg: var(--warm-white); --fg-dim: var(--muted); --border: var(--line);      background: var(--charcoal); color: var(--warm-white); }
.surface-light { --bg: var(--warm-white); --bg-elev: var(--white);     --fg: var(--ink);        --fg-dim: #5c6066;       --border: var(--line-dark); background: var(--warm-white); color: var(--ink); }

.surface-light .eyebrow { color: #9a7f45; }
.surface-light .eyebrow::before { background: #9a7f45; }
.surface-light .lead { color: #4a4e54; }

/* Grid helpers */
.grid { display: grid; gap: var(--gutter); }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .cols-3, .cols-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px)  { .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; } }

.stack > * + * { margin-top: 1.1rem; }
.stack-lg > * + * { margin-top: 1.9rem; }
.flow > * + * { margin-top: clamp(2.6rem, 2rem + 2vw, 4rem); }

.measure { max-width: 56ch; }
.center { text-align: center; }
.center.measure { margin-inline: auto; }

/* Section heading block */
.section-head { max-width: 760px; }
.section-head.center { margin-inline: auto; }
.section-head .eyebrow { margin-bottom: 1.1rem; }
.section-head h2 + p { margin-top: 1.1rem; }

/* Divider */
.rule { height: 1px; background: var(--border); border: 0; }
.rule-gold { height: 1px; width: 56px; background: var(--gold); border: 0; }

/* Utilities */
.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.nowrap { white-space: nowrap; }
.tnum { font-variant-numeric: tabular-nums; }

/* Skip link */
.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 200;
  background: var(--gold); color: var(--ink); padding: .6rem 1rem; border-radius: var(--radius);
  font-weight: 600; transition: top .2s var(--ease);
}
.skip-link:focus { top: 1rem; }
