/* Habit Haven site. Tokens first; dark mode redefines them only. */
:root {
  --bg: #FBF8F1;
  --surface: #FFFFFF;
  --surface-2: #F1F7F5;
  --text: #13231F;
  --muted: #55635F;
  --line: #E3ECE8;
  --brand: #0F766E;
  --brand-ink: #FFFFFF;
  --brand-soft: #CCF1EA;
  --accent: #B45309;
  --shadow: 0 1px 2px rgba(19, 35, 31, .06), 0 12px 32px rgba(19, 35, 31, .08);
  --radius: 22px;
  --font: ui-rounded, "SF Pro Rounded", "Hiragino Maru Gothic ProN", "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0E1715;
    --surface: #15211E;
    --surface-2: #1A2925;
    --text: #E8F2EF;
    --muted: #A3B4AF;
    --line: #26362F;
    --brand: #5EEAD4;
    --brand-ink: #062E2A;
    --brand-soft: #123B35;
    --accent: #FBBF24;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.6 var(--font); }
/* The rounded system face mis-stacks Vietnamese tone marks; use the regular one. */
:lang(vi) body, body:lang(vi) { font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2.3rem, 6vw, 3.8rem); font-weight: 800; }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.5rem); font-weight: 800; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 1em; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.narrow { width: min(760px, 100% - 32px); }
.center { text-align: center; }
.muted { color: var(--muted); font-size: .92rem; }
.eyebrow { color: var(--accent); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; margin-bottom: .6em; }
.section { padding: clamp(56px, 9vw, 104px) 0 0; }

.skip-link { position: absolute; left: -999px; top: 8px; background: var(--brand); color: var(--brand-ink); padding: 8px 14px; border-radius: 10px; z-index: 10; }
.skip-link:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 8px; }

/* Buttons: 44-48px tall targets */
.btn { white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px; border-radius: 999px; font-weight: 700; text-decoration: none; transition: transform .15s ease, box-shadow .15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--brand); color: var(--brand-ink); box-shadow: 0 8px 20px rgba(15, 118, 110, .28); }
.btn-ghost { color: var(--text); border: 2px solid var(--line); background: var(--surface); }
.btn-light { background: #FFFFFF; color: #0F766E; }
.btn-sm { min-height: 44px; padding: 0 18px; font-size: .95rem; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; gap: 24px; min-height: 64px; }
.brand { white-space: nowrap; display: inline-flex; align-items: center; gap: 10px; font-weight: 800; color: var(--text); text-decoration: none; }
.brand img { border-radius: 10px; }
.brand.small { font-size: .95rem; }
.brand.small img { border-radius: 6px; }
.main-nav { display: flex; gap: 22px; margin-left: auto; }
.main-nav a { color: var(--muted); text-decoration: none; font-weight: 600; padding: 10px 0; }
.main-nav a:hover { color: var(--text); }
@media (max-width: 760px) { .main-nav { display: none; } .header-inner { gap: 12px; } .header-inner .btn { margin-left: auto; padding: 0 14px; } }
@media (max-width: 360px) { .brand span { display: none; } }

/* Hero */
.hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; padding-top: clamp(32px, 6vw, 72px); }
.hero h1 .accent { color: var(--brand); }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 34em; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0 20px; }
.trust { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0 0 14px; }
.trust li { background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: .88rem; font-weight: 600; }
.store-note { color: var(--muted); font-size: .92rem; }
.hero-visual { position: relative; justify-self: center; }
.phone { width: min(340px, 78vw); border-radius: 44px; padding: 10px; background: #0B1412; box-shadow: var(--shadow), 0 40px 80px rgba(15, 118, 110, .18); }
.phone img { border-radius: 34px; }
.float { position: absolute; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 16px; padding: 10px 14px; font-size: .9rem; box-shadow: var(--shadow); white-space: nowrap; animation: bob 5s ease-in-out infinite; }
.float b { color: var(--brand); }
.float-a { top: 18%; left: -18%; }
.float-b { top: 46%; right: -14%; animation-delay: -1.6s; }
.float-c { bottom: 12%; left: -10%; animation-delay: -3.2s; }
@keyframes bob { 50% { transform: translateY(-8px); } }
@media (max-width: 880px) {
  .hero { grid-template-columns: 1fr; }
  .float-a { left: -4%; } .float-b { right: -4%; } .float-c { left: -2%; }
}

/* Features */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 32px; }
@media (max-width: 900px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.card p { color: var(--muted); margin: 0; }
.icon { width: 52px; height: 52px; display: grid; place-items: center; font-size: 1.6rem; border-radius: 16px; margin-bottom: 14px; background: color-mix(in srgb, var(--c) 14%, transparent); }

/* Steps */
.steps { list-style: none; padding: 0; margin: 32px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }
.steps li { background: var(--surface-2); border-radius: var(--radius); padding: 24px; }
.steps b { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); margin-bottom: 12px; }
.steps p { color: var(--muted); margin: 0; }

/* Gallery: horizontal scroll with snap, keyboard-scrollable */
.gallery { display: flex; gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 28px max(16px, calc((100% - 1120px) / 2)) 24px; scrollbar-width: thin; }
.gallery figure { flex: 0 0 auto; width: min(260px, 70vw); margin: 0; scroll-snap-align: center; }
.gallery img { border-radius: 28px; border: 1px solid var(--line); box-shadow: var(--shadow); }
.gallery figcaption { text-align: center; font-weight: 700; margin-top: 12px; }

/* Garden */
.garden { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.garden p { color: var(--muted); font-size: 1.08rem; }
.stages { display: flex; gap: 14px; list-style: none; padding: 0; margin: 20px 0 0; flex-wrap: wrap; }
.stages li { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 12px 16px 12px 12px; display: flex; align-items: center; gap: 10px; font-weight: 700; }
.stages img { width: 52px; height: 52px; }
.garden-hero { justify-self: center; width: min(420px, 80vw); filter: drop-shadow(0 24px 40px rgba(15, 118, 110, .25)); }
@media (max-width: 800px) { .garden { grid-template-columns: 1fr; } .garden-hero { order: -1; width: min(260px, 60vw); } }

/* Privacy */
.privacy-card { background: linear-gradient(160deg, var(--brand-soft), var(--surface)); border: 1px solid var(--line); border-radius: 28px; padding: clamp(28px, 5vw, 48px); }
.checks { list-style: none; padding: 0; margin: 16px 0 18px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 24px; }
@media (max-width: 640px) { .checks { grid-template-columns: 1fr; } }
.checks li { padding-left: 32px; position: relative; font-weight: 600; }
.checks li::before { content: "✓"; position: absolute; left: 0; top: 2px; width: 22px; height: 22px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-size: .8rem; }

/* FAQ */
details { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 4px 20px; margin-top: 12px; }
summary { cursor: pointer; font-weight: 700; padding: 12px 0; min-height: 48px; display: flex; align-items: center; gap: 12px; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; margin-left: auto; font-size: 1.4rem; color: var(--brand); transition: transform .2s; }
details[open] summary::after { transform: rotate(45deg); }
details p { color: var(--muted); }

/* Final CTA */
.final-cta { background: linear-gradient(135deg, #0F766E, #134E4A); color: #ECFDF5; border-radius: 32px; padding: clamp(36px, 6vw, 64px); text-align: center; display: grid; justify-items: center; gap: 4px; }
.final-cta img { border-radius: 18px; margin-bottom: 12px; }
.final-cta p { color: #CCFBF1; }

/* Footer */
.site-footer { margin-top: clamp(56px, 9vw, 104px); border-top: 1px solid var(--line); padding: 28px 0 40px; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; }
.footer-inner nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.footer-inner nav a { color: var(--muted); text-decoration: none; font-weight: 600; padding: 10px 0; }
.footer-inner .muted { margin: 0; width: 100%; }
.lang { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; font-weight: 600; color: var(--muted); }
.lang select { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; min-height: 44px; padding: 0 10px; }

.to-top { position: fixed; right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--brand); color: var(--brand-ink); font-size: 1.2rem; box-shadow: var(--shadow); cursor: pointer; }

/* Simple content pages (privacy, 404) */
.page { padding: 48px 0 0; }
.page h1 { font-size: clamp(2rem, 5vw, 2.8rem); }
.page h2 { font-size: 1.35rem; margin-top: 1.6em; }
.page li { margin-bottom: .4em; }
