/* =========================================================
   The Implant Master · Design System v2
   Brand: drnhan.vn palette  ·  Style: ~60% Apple
   ========================================================= */
:root {
  /* Brand (drnhan.vn) */
  --brand: #034e91;
  --brand-2: #08579a;
  --cyan: #2ca1c0;
  --sky: #26a5d6;
  --gold: #b58a00;
  --gold-soft: #f3e7c4;
  /* Apple neutrals */
  --ink: #1d1d1f;
  --ink-2: #424245;
  --muted: #6e6e73;
  --hair: #d2d2d7;
  --line: rgba(0, 0, 0, 0.08);
  --bg: #ffffff;
  --bg-2: #f5f5f7;
  --bg-3: #fbfbfd;
  --night: #000814;
  --night-2: #04172c;
  --grad: linear-gradient(90deg, #034e91 0%, #2ca1c0 100%);
  --radius: 18px;
  --radius-lg: 28px;
  --shadow: 0 30px 60px -30px rgba(3, 78, 145, 0.35);
  --shadow-sm: 0 4px 24px rgba(0, 0, 0, 0.06);
  --font: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', sans-serif;
  --ease: cubic-bezier(0.28, 0.11, 0.32, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 17px; line-height: 1.47; letter-spacing: -0.012em; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
h1, h2, h3, h4 { margin: 0 0 0.4em; font-weight: 700; letter-spacing: -0.03em; line-height: 1.07; }
h1 { font-size: clamp(2.6rem, 6.6vw, 5rem); letter-spacing: -0.04em; line-height: 1.04; }
h2 { font-size: clamp(2rem, 4.6vw, 3.5rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.6rem); letter-spacing: -0.02em; }
p { margin: 0 0 1em; }
sup.src a { color: var(--brand); font-size: 0.65em; font-weight: 600; margin-left: 2px; }
.container { width: min(1120px, 90%); margin: 0 auto; }
.wide { width: min(1320px, 94%); margin: 0 auto; }
.narrow { width: min(760px, 90%); margin: 0 auto; }
.center { text-align: center; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.gold-text { color: var(--gold); }
.muted { color: var(--muted); }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--brand); color: #fff; padding: 8px 16px; z-index: 999; }
.skip-link:focus { left: 10px; }
:focus-visible { outline: 3px solid rgba(44, 161, 192, 0.6); outline-offset: 2px; border-radius: 6px; }

/* ---------- Buttons & links ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 24px; border-radius: 980px; font-size: 17px; font-weight: 500; border: 0; cursor: pointer; transition: background 0.3s var(--ease), transform 0.3s var(--ease); line-height: 1.2; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-2); }
.btn-ghost { background: transparent; color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.btn-ghost:hover { background: var(--brand); color: #fff; }
.btn-light { background: #fff; color: var(--ink); }
.btn-sm { padding: 7px 15px; font-size: 14px; }
.link { color: var(--brand-2); font-weight: 500; display: inline-flex; align-items: center; gap: 4px; }
.link::after { content: '›'; font-size: 1.25em; line-height: 1; transition: transform 0.3s var(--ease); }
.link:hover::after { transform: translateX(3px); }
.link:hover { text-decoration: underline; }
.night .link { color: var(--sky); }

/* ---------- Nav (Apple-like) ---------- */
.site-header { position: sticky; top: 0; z-index: 100; height: 52px; background: rgba(251, 251, 253, 0.8); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid var(--line); }
.nav { height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 17px; color: var(--brand); letter-spacing: -0.02em; white-space: nowrap; }
.brand b { font-weight: 700; color: var(--cyan); }
.nav-menu { display: flex; align-items: center; gap: 30px; list-style: none; margin: 0; padding: 0; font-size: 13.5px; }
.nav-menu a:not(.btn) { color: var(--ink-2); transition: color 0.2s; }
.nav-menu a:not(.btn):hover, .nav-menu a.active { color: var(--brand); }
.nav-menu a.active { font-weight: 600; }
.nav-toggle { display: none; background: none; border: 0; width: 40px; height: 40px; cursor: pointer; position: relative; }
.nav-toggle span { position: absolute; left: 11px; right: 11px; height: 1.5px; background: var(--ink); transition: 0.3s var(--ease); }
.nav-toggle span:first-child { top: 16px; }
.nav-toggle span:last-child { top: 23px; }
.nav-toggle[aria-expanded='true'] span:first-child { transform: translateY(3.5px) rotate(45deg); }
.nav-toggle[aria-expanded='true'] span:last-child { transform: translateY(-3.5px) rotate(-45deg); }

/* ---------- Sections ---------- */
.section { padding: clamp(80px, 11vw, 140px) 0; position: relative; }
.section-tight { padding: clamp(56px, 7vw, 90px) 0; }
.bg-2 { background: var(--bg-2); }
.night { background: var(--night); color: #f5f5f7; }
.night .muted, .night .lead { color: #a1a1a6; }
.eyebrow { display: block; font-size: clamp(15px, 1.4vw, 19px); font-weight: 600; color: var(--cyan); margin-bottom: 10px; letter-spacing: -0.01em; }
.eyebrow.gold { color: var(--gold); }
.lead { font-size: clamp(1.1rem, 1.7vw, 1.4rem); color: var(--muted); line-height: 1.4; letter-spacing: -0.015em; font-weight: 400; }
.head { margin-bottom: clamp(40px, 6vw, 70px); }
.head.center { max-width: 820px; margin-left: auto; margin-right: auto; }
.head .lead { max-width: 640px; }
.head.center .lead { margin: 0 auto; }

/* ---------- Hero ---------- */
.hero { background: radial-gradient(900px 520px at 50% 72%, rgba(44, 161, 192, 0.16), transparent 70%), linear-gradient(#fbfbfd, #f2f5f9); text-align: center; padding: clamp(56px, 8vw, 90px) 0 0; overflow: hidden; }
.hero h1 { margin-bottom: 14px; }
.hero .lead { max-width: 640px; margin: 0 auto 26px; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; align-items: center; }
.hero-stage { position: relative; height: clamp(360px, 52vw, 600px); margin-top: 10px; }
.hero-stage canvas { width: 100% !important; height: 100% !important; }
.hero-chip { position: absolute; display: flex; gap: 10px; align-items: center; background: rgba(255, 255, 255, 0.78); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); padding: 10px 16px 10px 10px; border-radius: 980px; font-size: 13.5px; font-weight: 500; box-shadow: var(--shadow-sm); pointer-events: none; transition: opacity 0.5s; text-align: left; }
.hero-chip i { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: #fff; font-size: 12px; }
.hero-chip small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; }

/* ---------- Word reveal statement ---------- */
.statement { font-size: clamp(2rem, 5.2vw, 4.2rem); font-weight: 700; letter-spacing: -0.04em; line-height: 1.1; max-width: 1000px; margin: 0 auto; text-align: center; }
.statement .w { color: #d2d2d7; transition: color 0.4s var(--ease); }
.statement .w.on { color: var(--ink); }
.statement .w.hl.on { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Bento tiles ---------- */
.bento { display: grid; grid-template-columns: repeat(12, 1fr); gap: 20px; }
.tile { background: var(--bg); border-radius: var(--radius-lg); padding: clamp(26px, 3vw, 40px); position: relative; overflow: hidden; transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease); }
.bg-2 .tile { background: #fff; }
.tile:hover { transform: scale(1.012); box-shadow: var(--shadow-sm); }
.tile.span-3 { grid-column: span 3; } .tile.span-4 { grid-column: span 4; } .tile.span-5 { grid-column: span 5; }
.tile.span-6 { grid-column: span 6; } .tile.span-7 { grid-column: span 7; } .tile.span-8 { grid-column: span 8; } .tile.span-12 { grid-column: span 12; }
.tile.dark { background: var(--night-2); color: #f5f5f7; }
.tile.tile-brand { background: var(--brand); color: #fff; }
.tile .big { font-size: clamp(2.6rem, 5vw, 4.4rem); font-weight: 700; letter-spacing: -0.045em; line-height: 1; margin-bottom: 8px; }
.tile .big small { font-size: 0.45em; letter-spacing: -0.02em; }
.tile p { color: var(--muted); margin: 0; font-size: 16px; }
.tile.dark p, .tile.tile-brand p { color: rgba(255, 255, 255, 0.72); }
.tile .ic { font-size: 26px; color: var(--cyan); margin-bottom: 18px; display: block; }
.tile .strike { font-size: 14px; color: var(--muted); text-decoration: line-through; text-decoration-color: var(--cyan); text-decoration-thickness: 2px; display: block; margin-bottom: 6px; }
.tile.tile-brand .strike, .tile.dark .strike { color: rgba(255,255,255,.55); }

/* ---------- Interactive compare (smile + radar) ---------- */
.duo { display: grid; grid-template-columns: 1.05fr 1fr; gap: 24px; align-items: stretch; }
.panel { background: #fff; border-radius: var(--radius-lg); padding: clamp(20px, 2.6vw, 32px); position: relative; }
.bg-2 .panel { background: #fff; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.panel-head h3 { font-size: 19px; margin: 0; letter-spacing: -0.02em; }
.panel-head .muted { font-size: 13px; }
.smile-compare { position: relative; aspect-ratio: 4/5; border-radius: 20px; overflow: hidden; user-select: none; touch-action: pan-y; cursor: ew-resize; background: #1d1d1f; isolation: isolate; }
.smile-compare .layer { position: absolute; inset: 0; }
.smile-compare .layer img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; -webkit-user-drag: none; }
.smile-compare .after-layer { clip-path: inset(0 0 0 var(--pos, 50%)); }
.smile-compare .handle { position: absolute; top: 0; bottom: 0; left: var(--pos, 50%); width: 2px; margin-left: -1px; background: #fff; pointer-events: none; box-shadow: 0 0 12px rgba(0,0,0,.2); }
.smile-compare .knob { position: absolute; top: 50%; left: var(--pos, 50%); width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); display: grid; place-items: center; color: var(--brand); box-shadow: 0 6px 20px rgba(0,0,0,.18); pointer-events: none; font-size: 14px; transition: transform .2s var(--ease); }
.smile-compare.dragging .knob { transform: scale(1.12); }
.smile-compare .tag { position: absolute; top: 14px; padding: 5px 12px; border-radius: 980px; font-size: 12px; font-weight: 600; backdrop-filter: blur(8px); }
.smile-compare .tag.b { left: 14px; background: rgba(0,0,0,.45); color: #fff; }
.smile-compare .tag.a { right: 14px; background: rgba(255,255,255,.85); color: var(--brand); }
.compare-readout { display: flex; justify-content: space-between; margin-top: 14px; font-size: 13px; color: var(--muted); }
.compare-readout b { color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---------- Charts (generic) ---------- */
.chart { position: relative; width: 100%; touch-action: pan-y; user-select: none; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart text { font-family: var(--font); fill: var(--muted); font-size: 11.5px; letter-spacing: 0; }
.chart .grid line { stroke: rgba(0,0,0,.07); }
.chart .axis-label { font-size: 11px; fill: #86868b; }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart .crosshair { stroke: var(--ink); stroke-width: 1; stroke-dasharray: 3 3; opacity: .35; pointer-events: none; }
.chart .dot { transition: r .2s var(--ease); }
.chart:focus-visible { outline: 3px solid rgba(44,161,192,.5); outline-offset: 6px; border-radius: 12px; }
.tip { position: absolute; z-index: 5; pointer-events: none; background: rgba(29, 29, 31, 0.92); color: #fff; padding: 9px 12px; border-radius: 12px; font-size: 12.5px; line-height: 1.35; white-space: nowrap; transform: translate(-50%, calc(-100% - 14px)); transition: opacity .15s, left .08s linear, top .08s linear; box-shadow: 0 10px 30px rgba(0,0,0,.25); backdrop-filter: blur(10px); }
.tip b { font-weight: 600; font-variant-numeric: tabular-nums; }
.tip .k { color: #a1a1a6; font-size: 11px; display: block; margin-bottom: 2px; }
.tip .row { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.tip .sw { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.tip .up { color: #5fe0a0; } .tip .down { color: #ff8a80; }
.legend { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.legend button { display: inline-flex; align-items: center; gap: 8px; border: 0; background: var(--bg-2); border-radius: 980px; padding: 6px 12px; font-size: 13px; cursor: pointer; color: var(--ink); transition: opacity .2s, background .2s; }
.legend button[aria-pressed='false'] { opacity: .45; }
.legend .sw { width: 10px; height: 10px; border-radius: 50%; }
.night .legend button { background: rgba(255,255,255,.08); color: #f5f5f7; }
.readout { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: baseline; margin-top: 12px; font-size: 14px; color: var(--muted); min-height: 22px; }
.readout b { color: var(--ink); font-variant-numeric: tabular-nums; font-weight: 600; }
.night .readout b { color: #fff; }
.pill-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 980px; font-size: 12px; font-weight: 600; background: rgba(44,161,192,.12); color: var(--brand); }

/* Gantt */
.gantt-status { display: flex; align-items: center; gap: 14px; margin-top: 16px; flex-wrap: wrap; }
.progress { flex: 1; min-width: 160px; height: 6px; border-radius: 6px; background: var(--bg-2); overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--grad); width: 0; border-radius: inherit; }

/* Range (Apple-like) */
.range { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: transparent; cursor: pointer; margin: 0; }
.range::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(to right, var(--brand) 0%, var(--cyan) var(--fill, 0%), rgba(120,120,128,.24) var(--fill, 0%)); }
.range::-moz-range-track { height: 4px; border-radius: 4px; background: rgba(120,120,128,.24); }
.range::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--brand); }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; margin-top: -11px; border-radius: 50%; background: #fff; box-shadow: 0 0.5px 4px rgba(0,0,0,.12), 0 6px 13px rgba(0,0,0,.12), 0 0 0 .5px rgba(0,0,0,.04); transition: transform .15s; }
.range:active::-webkit-slider-thumb { transform: scale(1.12); }
.range::-moz-range-thumb { width: 26px; height: 26px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 0.5px 4px rgba(0,0,0,.12), 0 6px 13px rgba(0,0,0,.12); }
.night .range::-webkit-slider-runnable-track { background: linear-gradient(to right, var(--cyan) 0%, var(--sky) var(--fill, 0%), rgba(255,255,255,.18) var(--fill, 0%)); }

/* ---------- Story tiles ---------- */
.filter { display: inline-flex; gap: 4px; padding: 4px; background: var(--bg-2); border-radius: 980px; margin-bottom: 40px; flex-wrap: wrap; }
.filter button { border: 0; background: transparent; padding: 8px 18px; border-radius: 980px; font-size: 14px; cursor: pointer; color: var(--ink-2); transition: background .25s var(--ease), color .25s; }
.filter button.active { background: #fff; color: var(--ink); box-shadow: 0 2px 8px rgba(0,0,0,.08); font-weight: 600; }
.story-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.story-card { background: #fff; border-radius: var(--radius-lg); overflow: hidden; display: flex; flex-direction: column; transition: transform .5s var(--ease), box-shadow .5s var(--ease); }
.bg-2 .story-card { background: #fff; }
section:not(.bg-2) .story-card { background: var(--bg-2); }
.story-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.story-card.hide { display: none; }
.story-visual { position: relative; aspect-ratio: 1/1; overflow: hidden; background: #1d1d1f; }
.story-visual .years { position: absolute; left: 16px; bottom: 14px; color: #fff; }
.story-visual .years b { display: block; font-size: 2.4rem; font-weight: 700; letter-spacing: -0.04em; line-height: 1; text-shadow: 0 2px 20px rgba(0,0,0,.25); }
.story-visual .years span { font-size: 12.5px; opacity: .9; }
.story-visual .ins { position: absolute; top: 14px; right: 14px; background: rgba(255,255,255,.88); backdrop-filter: blur(8px); color: var(--brand); font-size: 12px; font-weight: 600; padding: 5px 11px; border-radius: 980px; }
.story-body { padding: 22px 24px 26px; display: flex; flex-direction: column; flex: 1; }
.story-meta { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.story-body h3 { font-size: 1.3rem; margin-bottom: 8px; }
.story-body p { color: var(--ink-2); font-size: 15px; flex: 1; margin-bottom: 14px; }
.story-body .bought { font-size: 14px; color: var(--brand); font-weight: 500; display: flex; gap: 8px; }
.story-body .bought i { color: var(--gold); margin-top: 3px; }

/* ---------- Story detail ---------- */
.story-hero { padding: clamp(48px, 7vw, 90px) 0 clamp(40px, 5vw, 60px); text-align: center; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.crumbs a:hover { color: var(--brand); }
.quote-xl { font-size: clamp(1.4rem, 2.8vw, 2.2rem); font-weight: 600; letter-spacing: -0.03em; line-height: 1.25; color: var(--ink); max-width: 820px; margin: 26px auto 0; }
.quote-xl::before { content: '“'; color: var(--cyan); }
.quote-xl::after { content: '”'; color: var(--cyan); }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 50px; }
.kpi { text-align: center; }
.kpi b { display: block; font-size: clamp(2.4rem, 5vw, 3.8rem); font-weight: 700; letter-spacing: -0.045em; line-height: 1; color: var(--brand); }
.kpi span { font-size: 14px; color: var(--muted); }
.ba-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.ba-card { border-radius: var(--radius-lg); padding: clamp(26px, 3vw, 40px); }
.ba-card.before { background: var(--bg-2); }
.ba-card.after { background: var(--brand); color: #fff; }
.ba-card h3 { font-size: 15px; letter-spacing: 0.02em; text-transform: uppercase; margin-bottom: 20px; font-weight: 600; opacity: .7; }
.ba-card ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.ba-card li { display: flex; gap: 14px; align-items: center; font-size: clamp(1.05rem, 1.6vw, 1.25rem); font-weight: 600; letter-spacing: -0.02em; }
.ba-card li i { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 13px; }
.ba-card.before li i { background: #e1e1e6; color: #86868b; }
.ba-card.after li i { background: rgba(255,255,255,.16); color: #fff; }
.ba-card.after li { color: #fff; }
.ba-card.before li { color: var(--ink-2); }
.turning { text-align: center; }
.turning .big-q { font-size: clamp(1.6rem, 3.6vw, 2.8rem); font-weight: 700; letter-spacing: -0.035em; line-height: 1.2; max-width: 900px; margin: 0 auto; }
.bought-banner { text-align: center; }
.bought-banner .big-q { font-size: clamp(2rem, 5vw, 4rem); font-weight: 700; letter-spacing: -0.045em; line-height: 1.08; max-width: 980px; margin: 0 auto; }
.treat-line { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 30px; }
.treat-line span { background: rgba(255,255,255,.1); color: #f5f5f7; border-radius: 980px; padding: 8px 16px; font-size: 14px; }

/* ---------- Topic / Lab ---------- */
.topic-hero { padding: clamp(48px, 7vw, 90px) 0 clamp(36px, 4vw, 50px); text-align: center; }
.topic-hero .lead { max-width: 680px; margin: 0 auto; }
.carousel { display: flex; gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 6px 5vw 30px; scrollbar-width: none; scroll-padding: 0 5vw; }
.carousel::-webkit-scrollbar { display: none; }
.carousel-nav { display: flex; justify-content: flex-end; gap: 12px; width: min(1120px, 90%); margin: 0 auto 6px; }
.carousel-nav button { width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgba(210,210,215,.6); color: var(--ink); cursor: pointer; transition: background .2s; }
.carousel-nav button:hover { background: var(--hair); }
.topic-card { flex: none; width: min(360px, 78vw); scroll-snap-align: start; border-radius: var(--radius-lg); background: #fff; padding: 30px; min-height: 420px; display: flex; flex-direction: column; position: relative; overflow: hidden; transition: transform .5s var(--ease); }
.topic-card:hover { transform: scale(1.015); }
.bg-2 .topic-card { background: #fff; }
.topic-card .k { font-size: 12px; font-weight: 600; color: var(--cyan); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px; }
.topic-card h3 { font-size: 1.6rem; margin-bottom: 6px; }
.topic-card p { color: var(--muted); font-size: 15px; }
.topic-card .art { margin-top: auto; height: 170px; display: grid; place-items: center; font-size: 90px; color: var(--brand); position: relative; }
.topic-card .art::before { content: ''; position: absolute; width: 180px; height: 180px; border-radius: 50%; background: radial-gradient(circle, rgba(44,161,192,.22), transparent 70%); }
.topic-card .art i { position: relative; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.topic-card .plus { position: absolute; right: 22px; bottom: 22px; width: 36px; height: 36px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-size: 15px; }
.topic-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.topic-grid .topic-card { width: auto; min-height: 380px; }

/* 3D viewer */
.viewer { background: radial-gradient(120% 90% at 50% 30%, #0b2a4d 0%, #04172c 45%, #000814 100%); color: #f5f5f7; border-radius: var(--radius-lg); overflow: hidden; position: relative; }
.viewer-stage { position: relative; height: clamp(380px, 56vw, 620px); }
.viewer-stage canvas { width: 100% !important; height: 100% !important; cursor: grab; touch-action: none; }
.viewer-stage canvas:active { cursor: grabbing; }
.viewer-loading { position: absolute; inset: 0; display: grid; place-items: center; font-size: 14px; color: #86868b; pointer-events: none; }
.viewer-loading.done { display: none; }
.viewer-hint { position: absolute; left: 20px; top: 18px; font-size: 12px; color: rgba(255,255,255,.5); display: flex; gap: 8px; align-items: center; pointer-events: none; }
.viewer-label { position: absolute; pointer-events: none; font-size: 12.5px; color: #f5f5f7; background: rgba(255,255,255,.1); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid rgba(255,255,255,.14); padding: 6px 12px; border-radius: 980px; white-space: nowrap; transform: translate(16px, -50%); transition: opacity .3s; }
.viewer-label::before { content: ''; position: absolute; left: -16px; top: 50%; width: 12px; height: 1px; background: rgba(255,255,255,.5); }
.viewer-label::after { content: ''; position: absolute; left: -20px; top: 50%; width: 5px; height: 5px; margin-top: -2.5px; border-radius: 50%; background: var(--sky); box-shadow: 0 0 0 3px rgba(38,165,214,.3); }
.viewer-label b { font-weight: 600; }
.viewer-label.active { background: var(--cyan); border-color: var(--cyan); }
.viewer-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 18px 22px; border-top: 1px solid rgba(255,255,255,.08); }
.viewer-bar .grow { flex: 1; min-width: 220px; }
.seg { display: inline-flex; padding: 3px; background: rgba(255,255,255,.08); border-radius: 980px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; color: #d2d2d7; padding: 8px 15px; border-radius: 980px; font-size: 13.5px; cursor: pointer; display: inline-flex; gap: 7px; align-items: center; transition: background .25s var(--ease), color .25s; }
.seg button:hover { color: #fff; }
.seg button.active, .seg button[aria-pressed='true'] { background: rgba(255,255,255,.92); color: var(--ink); }
.icon-btn { width: 40px; height: 40px; flex: none; border-radius: 50%; border: 0; background: rgba(255,255,255,.92); color: var(--ink); cursor: pointer; display: grid; place-items: center; font-size: 14px; transition: transform .2s; }
.icon-btn:hover { transform: scale(1.06); }
.scrub-wrap { position: relative; padding-top: 4px; }
.scrub-ticks { display: grid; font-size: 11px; color: #86868b; margin-top: 2px; }
.scrub-ticks span { text-align: center; transition: color .2s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 2px; cursor: pointer; }
.scrub-ticks span.active { color: #fff; font-weight: 600; }
.step-card { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; padding: 18px 22px 22px; border-top: 1px solid rgba(255,255,255,.08); min-height: 96px; }
.step-card .n { width: 54px; height: 54px; border-radius: 16px; background: var(--grad); display: grid; place-items: center; font-size: 22px; color: #fff; font-weight: 700; letter-spacing: -0.03em; }
.step-card h3 { font-size: 1.15rem; margin: 0 0 3px; }
.step-card p { margin: 0; color: #a1a1a6; font-size: 14.5px; }
.part-card { position: absolute; right: 18px; top: 18px; width: min(270px, calc(100% - 36px)); background: rgba(255,255,255,.1); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid rgba(255,255,255,.14); border-radius: 20px; padding: 18px 20px; font-size: 13.5px; transition: opacity .35s var(--ease), transform .35s var(--ease); }
.part-card.hidden { opacity: 0; transform: translateY(-8px); pointer-events: none; }
.part-card h4 { font-size: 17px; margin: 0 0 4px; letter-spacing: -0.02em; }
.part-card p { color: #c7c7cc; margin: 0 0 12px; }
.part-card dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; }
.part-card dt { color: #86868b; } .part-card dd { margin: 0; font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; }
.sync-chart { padding: 6px 22px 22px; border-top: 1px solid rgba(255,255,255,.08); }
.sync-chart .chart text { fill: #86868b; }
.sync-chart .chart .grid line { stroke: rgba(255,255,255,.08); }
.night .chart .crosshair, .viewer .chart .crosshair { stroke: #fff; }

/* Stats row */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.stat { background: var(--bg-2); border-radius: var(--radius-lg); padding: 30px; }
.bg-2 .stat { background: #fff; }
.stat b { display: block; font-size: clamp(2.2rem, 4.4vw, 3.4rem); font-weight: 700; letter-spacing: -0.045em; line-height: 1; margin-bottom: 10px; }
.stat span { color: var(--muted); font-size: 15px; }
.points { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.point { background: #fff; border-radius: 22px; padding: 22px; }
.point i { font-size: 22px; color: var(--cyan); margin-bottom: 14px; display: block; }
.point b { display: block; font-size: 17px; letter-spacing: -0.02em; margin-bottom: 2px; }
.point span { font-size: 14px; color: var(--muted); }
.point .num { font-size: 12px; color: var(--muted); font-weight: 600; float: right; }

/* Cost calculator */
.calc { display: grid; grid-template-columns: 340px 1fr; gap: 20px; }
.calc-controls { display: grid; gap: 14px; align-content: start; }
.opt { background: #fff; border-radius: 22px; padding: 18px 20px; }
.opt-head { display: flex; align-items: center; gap: 10px; font-weight: 600; margin-bottom: 8px; }
.opt-head .sw { width: 12px; height: 12px; border-radius: 50%; }
.opt label { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-top: 6px; }
.opt label b { color: var(--ink); font-variant-numeric: tabular-nums; }
.calc-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 18px; }
.calc-summary div { border-radius: 16px; background: var(--bg-2); padding: 14px 16px; }
.calc-summary small { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.calc-summary b { display: block; font-size: 1.5rem; letter-spacing: -0.035em; font-variant-numeric: tabular-nums; }
.calc-summary em { font-style: normal; font-size: 12px; color: var(--muted); }
.calc-summary .best { box-shadow: inset 0 0 0 2px var(--cyan); }
.horizon { display: flex; align-items: center; gap: 14px; font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.horizon input { flex: 1; }

/* Care dashboard */
.care { display: grid; grid-template-columns: 1fr 1.25fr; gap: 20px; }
.ring-wrap { display: flex; gap: 22px; align-items: center; }
.ring { width: 132px; height: 132px; flex: none; }
.ring circle { fill: none; stroke-width: 12; }
.ring .bg { stroke: var(--bg-2); }
.ring .fg { stroke: url(#ringGrad); stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dashoffset .25s var(--ease); }
.ring text { font-family: var(--font); font-weight: 700; font-size: 26px; fill: var(--ink); letter-spacing: -0.04em; }
.care-day { font-size: clamp(2.2rem, 4vw, 3rem); font-weight: 700; letter-spacing: -0.045em; line-height: 1; }
.care-phases { display: flex; gap: 6px; margin: 18px 0 6px; }
.care-phases span { flex: 1; height: 6px; border-radius: 6px; background: var(--bg-2); transition: background .3s; }
.care-phases span.done { background: rgba(3,78,145,.35); }
.care-phases span.on { background: var(--grad); }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.checklist label { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: 16px; background: var(--bg-2); cursor: pointer; transition: background .2s; font-weight: 500; }
.checklist input { appearance: none; -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--hair); display: grid; place-items: center; flex: none; margin: 0; transition: all .2s; cursor: pointer; }
.checklist input:checked { background: var(--brand); border-color: var(--brand); }
.checklist input:checked::after { content: ''; width: 6px; height: 11px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }
.checklist input:checked + span { color: var(--muted); text-decoration: line-through; }

/* FAQ */
.faq-list { border-top: 1px solid var(--hair); }
.faq-item { border-bottom: 1px solid var(--hair); }
.faq-item summary { cursor: pointer; list-style: none; padding: 24px 44px 24px 0; font-size: clamp(1.05rem, 1.6vw, 1.3rem); font-weight: 600; letter-spacing: -0.02em; position: relative; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: ''; position: absolute; right: 6px; top: 50%; width: 10px; height: 10px; border: solid var(--ink-2); border-width: 0 1.5px 1.5px 0; transform: translateY(-70%) rotate(45deg); transition: transform .3s var(--ease); }
.faq-item[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq-item .a { padding: 0 0 24px; color: var(--ink-2); max-width: 680px; }

/* Sources */
.sources { font-size: 12.5px; color: var(--muted); }
.sources ol { padding-left: 18px; margin: 0; display: grid; gap: 6px; }
.sources a { color: var(--brand-2); }
.sources a:hover { text-decoration: underline; }
.disclaimer { font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--hair); padding-top: 18px; margin-top: 40px; }

/* Share */
.share { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(30px, 5vw, 70px); align-items: center; }
.share form { display: grid; gap: 12px; }
.field { width: 100%; padding: 15px 18px; border-radius: 14px; border: 1px solid var(--hair); background: #fff; font-family: var(--font); font-size: 16px; color: var(--ink); transition: border .2s, box-shadow .2s; }
.field:focus { outline: 0; border-color: var(--cyan); box-shadow: 0 0 0 4px rgba(44,161,192,.18); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips label { cursor: pointer; }
.chips input { position: absolute; opacity: 0; pointer-events: none; }
.chips span { display: inline-block; padding: 9px 16px; border-radius: 980px; background: #fff; border: 1px solid var(--hair); font-size: 14px; transition: all .2s; }
.chips input:checked + span { background: var(--brand); color: #fff; border-color: var(--brand); }
.chips input:focus-visible + span { box-shadow: 0 0 0 4px rgba(44,161,192,.3); }
.consent { display: flex; gap: 10px; font-size: 13px; color: var(--muted); align-items: flex-start; }
.consent input { margin-top: 3px; accent-color: var(--brand); }
.form-msg { font-size: 14px; color: var(--brand); min-height: 20px; }

/* Manifesto */
.mani { padding: clamp(70px, 10vw, 130px) 0; border-bottom: 1px solid var(--line); text-align: center; }
.mani .n { font-size: 14px; font-weight: 600; color: var(--cyan); margin-bottom: 14px; display: block; }
.mani h2 { max-width: 900px; margin: 0 auto 14px; }
.mani p { max-width: 560px; margin: 0 auto; color: var(--muted); font-size: 1.15rem; }

/* Reveal */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.d1 { transition-delay: .08s; } .d2 { transition-delay: .16s; } .d3 { transition-delay: .24s; }

/* Footer (Apple-like) */
.site-footer { background: var(--bg-2); color: var(--muted); font-size: 12.5px; padding: 40px 0 26px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 30px; padding-bottom: 26px; border-bottom: 1px solid var(--hair); }
.site-footer h3 { font-size: 12.5px; color: var(--ink); font-weight: 600; letter-spacing: 0; margin-bottom: 10px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.site-footer a:hover { color: var(--ink); text-decoration: underline; }
.footer-bottom { padding-top: 18px; display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .tile.span-3 { grid-column: span 6; } .tile.span-4, .tile.span-5, .tile.span-7, .tile.span-8 { grid-column: span 12; }
  .story-grid, .topic-grid { grid-template-columns: repeat(2, 1fr); }
  .calc { grid-template-columns: 1fr; }
  .calc-controls { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 834px) {
  .nav-toggle { display: block; }
  .nav-menu { position: fixed; inset: 52px 0 auto 0; background: rgba(251,251,253,.97); backdrop-filter: blur(20px); flex-direction: column; align-items: flex-start; padding: 20px 7% 30px; gap: 20px; font-size: 20px; font-weight: 600; transform: translateY(-8px); opacity: 0; pointer-events: none; transition: all .35s var(--ease); border-bottom: 1px solid var(--line); }
  .nav-menu a:not(.btn) { color: var(--ink); }
  .nav-menu.open { transform: none; opacity: 1; pointer-events: auto; }
  .duo, .share, .care, .ba-grid { grid-template-columns: 1fr; }
  .calc-controls { grid-template-columns: 1fr; }
  .tile.span-6 { grid-column: span 12; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .story-grid, .topic-grid, .stats { grid-template-columns: 1fr; }
  .tile.span-3 { grid-column: span 12; }
  .kpis { gap: 10px; }
  .kpi span { font-size: 12px; }
  .calc-summary { grid-template-columns: 1fr; }
  .hero-chip { display: none; }
  .viewer-bar { padding: 14px 16px; }
  .seg button { padding: 7px 11px; font-size: 12.5px; }
  .part-card { top: auto; bottom: 14px; right: 14px; left: 14px; width: auto; }
  .footer-grid { grid-template-columns: 1fr; }
  .ring-wrap { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

/* Years-hidden bar list (home bento) */
.years-bars { display: grid; gap: 9px; }
.yb { display: grid; grid-template-columns: 74px 1fr 30px; gap: 12px; align-items: center; font-size: 13px; border-radius: 8px; transition: background .2s; padding: 2px 0; }
.yb:hover .yb-fill { filter: brightness(1.15); }
.yb:hover .yb-name { color: var(--brand); }
.yb-name { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.yb-track { height: 10px; background: var(--bg-2); border-radius: 10px; overflow: hidden; }
.yb-fill { display: block; height: 100%; width: 0; background: var(--grad); border-radius: inherit; transition: width 1.2s var(--ease); }
.reveal.in .yb-fill { width: var(--w); }
.yb b { font-variant-numeric: tabular-nums; text-align: right; }

/* Dark-section cards */
.night .topic-card { background: #1d1d1f; color: #f5f5f7; }
.night .topic-card p { color: #a1a1a6; }
.night .topic-card .plus { background: #f5f5f7; color: #1d1d1f; }
/* Absolute-positioned scrub ticks (non-linear time scales) */
.scrub-ticks.abs { display: block; position: relative; height: 16px; }
.scrub-ticks.abs span { position: absolute; top: 0; transform: translateX(-50%); padding: 0; }
.scrub-ticks.abs span:first-child { transform: none; }
.scrub-ticks.abs span:last-child { transform: translateX(-100%); }
.viewer .readout { color: #a1a1a6; }
.viewer .readout b { color: #fff; }
.viewer .legend button { background: rgba(255,255,255,.08); color: #f5f5f7; }
.viewer .tip { background: rgba(255,255,255,.95); color: #1d1d1f; }
.viewer .tip .k { color: #6e6e73; }
.viewer .tip .up { color: #0a8f55; } .viewer .tip .down { color: #c62828; }
.hero-chip { left: 0; top: 0; transform: translate(-50%, -50%); will-change: transform; }

.tile.tile-brand .big { font-size: clamp(3rem, 7vw, 6rem); }
.duo > .panel:first-child { display: flex; flex-direction: column; }
.duo > .panel:first-child .smile-compare { margin: auto 0; }
.chart svg text { user-select: none; }

/* ---------- Story photos (AI-generated illustrations) ---------- */
.story-visual .ph { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; transition: opacity .9s var(--ease), transform 1.2s var(--ease); }
.story-visual .ph-after { opacity: 0; }
.story-visual::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 55%, rgba(0,8,20,.62) 100%); pointer-events: none; }
.story-visual .years, .story-visual .ins, .story-visual .state, .story-visual .ai-tag { z-index: 2; }
.story-card:hover .story-visual .ph, .story-card:focus-within .story-visual .ph, .story-card.flip .story-visual .ph { transform: scale(1.035); }
.story-card:hover .story-visual .ph-after, .story-card:focus-within .story-visual .ph-after, .story-card.flip .story-visual .ph-after { opacity: 1; }
.story-visual .state { position: absolute; left: 14px; top: 14px; display: inline-flex; padding: 3px; gap: 2px; border-radius: 980px; background: rgba(0,0,0,.35); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.story-visual .state i { font-style: normal; font-size: 11.5px; font-weight: 600; padding: 4px 10px; border-radius: 980px; color: rgba(255,255,255,.75); transition: background .5s var(--ease), color .5s; }
.story-visual .state .st-b { background: rgba(255,255,255,.92); color: var(--ink); }
.story-card:hover .state .st-b, .story-card:focus-within .state .st-b, .story-card.flip .state .st-b { background: transparent; color: rgba(255,255,255,.75); }
.story-card:hover .state .st-a, .story-card:focus-within .state .st-a, .story-card.flip .state .st-a { background: var(--cyan); color: #fff; }
.ai-tag { position: absolute; right: 12px; bottom: 12px; z-index: 3; font-size: 10.5px; color: rgba(255,255,255,.8); background: rgba(0,0,0,.32); backdrop-filter: blur(6px); padding: 3px 8px; border-radius: 980px; letter-spacing: .01em; pointer-events: none; }
.smile-compare .ai-tag { bottom: 14px; right: 14px; }
.smile-compare .tag { z-index: 2; }
.smile-compare::after { content: ''; position: absolute; inset: auto 0 0 0; height: 18%; background: linear-gradient(transparent, rgba(0,0,0,.25)); pointer-events: none; }
.smile-compare .after-layer img { filter: saturate(1.04); }
.duo { align-items: center; }
.duo > .panel { height: 100%; }
.duo > .panel:first-child .smile-compare { margin: 0; }
@media (max-width: 834px) { .smile-compare { aspect-ratio: 4/5; max-height: 78vh; } }
