/* =========================================================
   tcm.ai — landing page
   Design system: "Clinical infrastructure, botanical restraint"
   ========================================================= */

:root {
  /* --- Palette: warm clinical neutrals + deep botanical green --- */
  --paper:        #F5F2EB;   /* warm off-white page */
  --paper-2:      #FBFAF5;   /* lifted card surface */
  --paper-3:      #EFEBE0;   /* recessed / banded surface */
  --ink:          #19231E;   /* near-black, green-tinted */
  --ink-soft:     #45514A;
  --ink-faint:    #828D85;
  --line:         rgba(25, 35, 30, 0.12);
  --line-strong:  rgba(25, 35, 30, 0.22);

  --green:        #1E4B3A;   /* primary deep pine */
  --green-deep:   #122E24;
  --green-bright: #2F7E5C;   /* data / accent green */
  --green-tint:   #E4ECE4;   /* soft fills, in-range band */
  --sage:         #88A48F;

  --clay:         #BD5B38;   /* warm accent — patient-facing */
  --clay-soft:    #F0DBCF;
  --amber:        #C98A2E;   /* data signal */

  /* --- Typography --- */
  --font-display: "Newsreader", Georgia, "Times New Roman", serif;
  --font-sans:    "Hanken Grotesk", system-ui, -apple-system, sans-serif;
  --font-mono:    "IBM Plex Mono", ui-monospace, "SF Mono", monospace;

  /* --- Geometry --- */
  --radius:       14px;
  --radius-sm:    9px;
  --radius-lg:    22px;
  --maxw:         1200px;
  --gutter:       clamp(20px, 5vw, 72px);

  --shadow-sm: 0 1px 2px rgba(25,35,30,0.05), 0 2px 8px rgba(25,35,30,0.04);
  --shadow-md: 0 2px 6px rgba(25,35,30,0.06), 0 18px 40px -16px rgba(25,35,30,0.18);
  --shadow-lg: 0 4px 12px rgba(25,35,30,0.08), 0 40px 80px -24px rgba(18,46,36,0.30);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Chinese mode swaps display font family */
:root[data-lang="zh"] {
  --font-display: "Noto Serif SC", "Newsreader", serif;
  --font-sans: "Noto Sans SC", "Hanken Grotesk", system-ui, sans-serif;
}

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

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

body {
  font-family: var(--font-sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  font-size: 17px;
  overflow-x: hidden;
}

::selection { background: var(--green); color: var(--paper-2); }

a { color: inherit; text-decoration: none; }

/* ---------------- Layout primitives ---------------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }

section { position: relative; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--green-bright);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow .num { color: var(--ink-faint); }
.eyebrow::before {
  content: "";
  width: 22px; height: 1px;
  background: var(--green-bright);
  display: inline-block;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 500; line-height: 1.08; letter-spacing: -0.015em; }
:root[data-lang="zh"] h1, :root[data-lang="zh"] h2, :root[data-lang="zh"] h3 { letter-spacing: 0; font-weight: 600; line-height: 1.2; }

.lead { color: var(--ink-soft); font-size: clamp(17px, 1.4vw, 20px); line-height: 1.6; text-wrap: pretty; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-sans);
  font-weight: 600; font-size: 15px;
  padding: 14px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .25s var(--ease), background .2s, box-shadow .25s, color .2s, border-color .2s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn .arr { transition: transform .25s var(--ease); }
.btn:hover .arr { transform: translateX(3px); }

.btn-green { background: var(--green); color: #F4F2EC; box-shadow: var(--shadow-sm); }
.btn-green:hover { background: var(--green-deep); box-shadow: var(--shadow-md); }

.btn-clay { background: var(--clay); color: #FBF3EE; box-shadow: var(--shadow-sm); }
.btn-clay:hover { filter: brightness(1.05); box-shadow: var(--shadow-md); }

.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--ink); background: rgba(25,35,30,0.03); }

.btn-sm { padding: 10px 16px; font-size: 14px; }

/* ---------------- Reveal on scroll ----------------
   Base state is VISIBLE (bulletproof: never hidden if JS/anim is
   throttled). The entrance is a layered enhancement that never
   drops opacity to 0, so frozen captures still show content. */
.reveal { opacity: 1; transform: none; }
.reveal.in { animation: riseIn .7s var(--ease) both; }
@keyframes riseIn {
  from { opacity: .35; transform: translateY(16px); }
  to   { opacity: 1;   transform: none; }
}
.reveal[data-d="1"].in { animation-delay: .07s; }
.reveal[data-d="2"].in { animation-delay: .14s; }
.reveal[data-d="3"].in { animation-delay: .21s; }
.reveal[data-d="4"].in { animation-delay: .28s; }
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal.in { animation: none; opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* Hero entrance: pure CSS, fires on load, stays visible */
@keyframes enterUp { from { opacity: .4; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.hero .reveal { animation: enterUp .8s var(--ease) both; }
.hero .reveal[data-d="1"] { animation-delay: .08s; }
.hero .reveal[data-d="2"] { animation-delay: .16s; }
.hero .reveal[data-d="3"] { animation-delay: .24s; }
.hero .reveal[data-d="4"] { animation-delay: .32s; }
@media (prefers-reduced-motion: reduce) { .hero .reveal { animation: none; } }

/* utility */
.mono { font-family: var(--font-mono); }
.hairline { height: 1px; background: var(--line); border: 0; }
