/* Nhà Phong Thuỷ — light design system (2026). Blue/cyan + ink black on paper, orange highlights.
   Glass header, aurora gradients, reveal-on-scroll, tilt cards, sticky lead CTA.
   All motion respects prefers-reduced-motion. */

@view-transition { navigation: auto; }

:root {
  --paper: #f5f8fc;
  --paper-2: #eaf1fa;
  --surface: #ffffff;
  --ink: #0a0f14;
  --ink-2: #172130;
  --muted: #556070;
  --line: rgba(10, 15, 12, 0.09);
  --blue: #0b5cd5;
  --blue-2: #1479f0;
  --cyan: #22c3e6;
  --blue-soft: #e3f0fd;
  --cyan-soft: #cdeefa;
  --orange: #ff7a1a;
  --orange-2: #ff9442;
  --orange-soft: #fff1e6;
  --warn: #b5483a;
  --radius: 22px;
  --ease: cubic-bezier(.2, .7, .1, 1);
  --shadow: 0 1px 2px rgba(10,15,20,.04), 0 12px 32px -14px rgba(10,15,20,.18);
  --shadow-lg: 0 30px 70px -30px rgba(10,15,20,.35);
  /* legacy tokens used by tool/chart templates */
  --bg: var(--paper);
  --bg-elev: var(--surface);
  --accent: var(--blue);
  --accent-soft: var(--cyan-soft);
  --good: #0b5cd5;
  --bad: #b5483a;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; }
body {
  font-family: "Be Vietnam Pro", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1000px 520px at 100% -10%, rgba(34,195,230,.16), transparent 60%),
    radial-gradient(800px 480px at -10% 10%, rgba(11,92,213,.08), transparent 60%),
    var(--paper);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: "Be Vietnam Pro", system-ui, sans-serif; letter-spacing: -0.02em; font-weight: 700; color: var(--ink); }
.serif { font-family: Literata, Georgia, serif; font-style: italic; font-weight: 600; letter-spacing: -0.01em; }
a { color: var(--blue); }
p { color: var(--muted); }
.wrap { width: min(100% - 2rem, 1160px); margin-left: auto; margin-right: auto; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(245, 248, 244, 0.72);
  backdrop-filter: blur(16px) saturate(160%); -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid var(--line);
  view-transition-name: npt-header;
}
.site-header .bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem 0; }
.brand { display: flex; align-items: center; gap: .6rem; color: var(--ink); text-decoration: none; font-weight: 800; letter-spacing: -0.01em; }
.brand img { width: 32px; height: 32px; border-radius: 9px; box-shadow: 0 0 0 1px var(--line); }
.site-header nav { display: flex; align-items: center; gap: 1.1rem; font-size: .92rem; }
.site-header nav a { color: var(--ink-2); text-decoration: none; opacity: .75; transition: opacity .2s; }
.site-header nav a:hover, .site-header nav a[aria-current="page"] { opacity: 1; }
.site-header .nav-cta { opacity: 1; }
.nav-toggle { display: none; }
@media (max-width: 860px) {
  .nav-toggle { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
  .site-header .bar { flex-wrap: wrap; }
  .site-header nav { display: none; width: 100%; flex-direction: column; align-items: stretch; gap: 0; padding-bottom: .6rem; }
  .site-header.open nav { display: flex; }
  .site-header nav a { padding: .7rem .2rem; border-bottom: 1px solid var(--line); opacity: 1; }
  .site-header nav .btn-pill { margin-top: .6rem; justify-content: center; }
}

/* ---------- buttons ---------- */
.btn-pill, .cta, button[type=submit], .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 2.9rem; padding: .7rem 1.35rem; border-radius: 999px; border: 0; cursor: pointer;
  font: inherit; font-weight: 700; font-size: .95rem; text-decoration: none; white-space: nowrap;
  background: var(--blue); color: #fff; position: relative; overflow: hidden;
  box-shadow: 0 10px 26px -12px rgba(11,92,213,.7), inset 0 1px 0 rgba(255,255,255,.25);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s;
}
.btn-pill:hover, .cta:hover, button[type=submit]:hover, .btn:hover { transform: translateY(-2px); background: var(--blue-2); color: #fff; box-shadow: 0 16px 34px -14px rgba(11,92,213,.8); }
.btn-pill::after, .cta::after, button[type=submit]::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-120%);
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.4) 50%, transparent 70%); transition: transform .8s var(--ease);
}
.btn-pill:hover::after, .cta:hover::after, button[type=submit]:hover::after { transform: translateX(120%); }
.btn-pill.dark, .cta.dark { background: var(--ink); box-shadow: 0 10px 26px -12px rgba(10,15,20,.6); }
.btn-pill.dark:hover, .cta.dark:hover { background: #1c2738; }
.btn-pill.ghost, .cta.secondary, .btn.secondary {
  background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line);
}
.btn-pill.ghost:hover, .cta.secondary:hover, .btn.secondary:hover { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--blue); }
.btn-pill.sm { min-height: 2.4rem; padding: .45rem 1rem; font-size: .88rem; }
.btn-pill .arr, .cta .arr { transition: transform .25s var(--ease); }
.btn-pill:hover .arr, .cta:hover .arr { transform: translateX(4px); }
.pulse { animation: pulse-ring 2.6s infinite; }
@keyframes pulse-ring { 0% { box-shadow: 0 0 0 0 rgba(20,121,240,.45), 0 10px 26px -12px rgba(11,92,213,.7); } 70% { box-shadow: 0 0 0 14px rgba(20,121,240,0), 0 10px 26px -12px rgba(11,92,213,.7); } 100% { box-shadow: 0 0 0 0 rgba(20,121,240,0); } }

/* ---------- surfaces ---------- */
.card, .panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.panel { padding: 1.3rem 1.4rem; }
input, select {
  border-radius: 12px; border: 1px solid rgba(10,15,20,.14); background: #fff; color: var(--ink);
  transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(20,121,240,.15); }
.consent { display: flex; gap: .65rem; align-items: flex-start; margin: .4rem 0 1rem; padding: .8rem .9rem; border-radius: 14px;
  background: var(--blue-soft); color: var(--ink-2); font-size: .9rem; line-height: 1.5; cursor: pointer; }
.consent input { width: 1.15rem; height: 1.15rem; margin: .15rem 0 0; flex: none; accent-color: var(--blue); }
.consent strong { color: var(--blue); }

.eyebrow { display: inline-flex; align-items: center; gap: .5rem; font-size: .76rem; font-weight: 700; letter-spacing: .16em;
  text-transform: uppercase; color: var(--blue); margin: 0 0 .8rem; }
.eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 4px rgba(255,122,26,.22); }
.chip { display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .75rem; border-radius: 999px; font-size: .8rem; font-weight: 600;
  background: var(--blue-soft); color: var(--blue); }
.grad { background: linear-gradient(100deg, var(--blue) 0%, var(--blue-2) 45%, #0a0f14 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- reveal & tilt ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }
.tilt { transition: transform .5s var(--ease); transform-style: preserve-3d; }
.spot { position: relative; isolation: isolate; }
.spot::before { content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1; opacity: 0; transition: opacity .3s;
  background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 50%), rgba(34,195,230,.18), transparent 50%); }
.spot:hover::before { opacity: 1; }

/* ---------- phone ---------- */
.phone { position: relative; width: 260px; aspect-ratio: 9 / 19.2; border-radius: 42px; padding: 9px; background: #0a0f14;
  box-shadow: 0 0 0 1px rgba(10,15,20,.2), var(--shadow-lg); }
.phone::before { content: ""; position: absolute; top: 17px; left: 50%; width: 74px; height: 20px; transform: translateX(-50%); background: #000; border-radius: 20px; z-index: 2; }
.phone img { width: 100%; height: 100%; object-fit: cover; object-position: top; border-radius: 34px; display: block; background: #f6f1ea; }
.float { animation: float 7s ease-in-out infinite; }
@keyframes float { 0%,100% { transform: translateY(0) rotate(var(--r, 0deg)); } 50% { transform: translateY(-12px) rotate(var(--r, 0deg)); } }

/* ---------- sticky lead bar ---------- */
.lead-bar { position: fixed; left: 50%; bottom: 1rem; z-index: 45; transform: translate(-50%, 140%);
  display: flex; align-items: center; gap: .8rem; padding: .55rem .55rem .55rem 1.1rem; border-radius: 999px;
  background: rgba(10,15,20,.92); color: #fff; box-shadow: var(--shadow-lg); backdrop-filter: blur(10px);
  transition: transform .5s var(--ease); width: max-content; max-width: calc(100% - 1.5rem); }
.lead-bar.show { transform: translate(-50%, 0); }
.lead-bar span { font-size: .88rem; color: #d6e2f0; }
.lead-bar b { color: #fff; }
.lead-bar .x { background: transparent; border: 0; color: #9fb0c6; cursor: pointer; font-size: 1.1rem; padding: 0 .3rem; }
@media (max-width: 600px) { .lead-bar span.long { display: none; } .lead-bar { bottom: 4.6rem; } }

/* ---------- footer ---------- */
.site-footer { background: var(--ink); color: #b8c4d6; margin-top: 4rem; padding: 3rem 0 2rem; border: 0; }
.site-footer a { color: #e3ecf7; text-decoration: none; }
.site-footer a:hover { color: var(--cyan); }
.site-footer p { color: #93a2b8; }
.foot-grid { display: grid; gap: 1.6rem; grid-template-columns: 1.5fr repeat(3, 1fr); }
.foot-grid h4 { color: #fff; margin: 0 0 .7rem; font-size: .95rem; }
.foot-grid ul { list-style: none; padding: 0; margin: 0; }
.foot-grid li { margin: .4rem 0; font-size: .92rem; }
.foot-note { border-top: 1px solid rgba(255,255,255,.1); margin-top: 2rem; padding-top: 1.2rem; font-size: .82rem; }
@media (max-width: 760px) { .foot-grid { grid-template-columns: 1fr 1fr; } .foot-grid > :first-child { grid-column: 1 / -1; } }

/* ---------- tool pages ---------- */
.tool-hero { position: relative; }
.page-glyph { position: absolute; right: 0; top: -1rem; z-index: -1; pointer-events: none; user-select: none;
  font-family: "Be Vietnam Pro", sans-serif; font-weight: 800; font-size: clamp(3.5rem, 9vw, 7rem); line-height: 1; letter-spacing: -0.04em;
  white-space: nowrap; color: transparent; -webkit-text-stroke: 1.5px rgba(11,92,213,.16); }
@media (min-width: 1100px) { .page-glyph { right: -26rem; top: .5rem; } }
@media (max-width: 1099px) { .page-glyph { display: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  @view-transition { navigation: none; }
}

/* ---------- app CTA card (tool & guide pages) ---------- */
.app-cta-card { display: grid; grid-template-columns: 1.3fr .7fr; gap: 1rem; align-items: center; overflow: hidden;
  margin: 2rem 0 1rem; padding: 1.8rem 1.8rem 0; border-radius: 28px; color: #fff;
  background: radial-gradient(600px 300px at 90% 0%, rgba(34,195,230,.35), transparent 60%), linear-gradient(160deg, #0d1726, #0a0f14); }
.app-cta-card h2 { color: #fff; margin: .2rem 0 .6rem; font-size: clamp(1.35rem, 2.6vw, 1.8rem); }
.app-cta-card p { color: #b8c4d6; }
.app-cta-text { padding-bottom: 1.8rem; }
.app-cta-shot { align-self: end; display: flex; justify-content: center; height: 230px; overflow: hidden; }
.app-cta-shot .phone { width: 190px; }
.app-cta-card .btn-pill.ghost { background: rgba(255,255,255,.08); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); }
@media (max-width: 640px) { .app-cta-card { grid-template-columns: 1fr; padding: 1.4rem 1.4rem 0; } .app-cta-shot { height: 170px; } }
input[type=checkbox], input[type=radio] { width: auto; max-width: none; margin-bottom: 0; }
label:has(> input[type=checkbox]) { display: flex; align-items: center; gap: .5rem; }

/* ---------- orange highlight ---------- */
.btn-pill.orange, .cta.orange { background: linear-gradient(135deg, var(--orange-2), var(--orange)); color: #fff;
  box-shadow: 0 12px 28px -12px rgba(255,122,26,.75), inset 0 1px 0 rgba(255,255,255,.3); }
.btn-pill.orange:hover, .cta.orange:hover { background: linear-gradient(135deg, #ffa35c, #ff8a33); color: #fff; box-shadow: 0 18px 36px -14px rgba(255,122,26,.85); }
.pulse { animation: pulse-orange 2.6s infinite; }
@keyframes pulse-orange { 0% { box-shadow: 0 0 0 0 rgba(255,122,26,.45); } 70% { box-shadow: 0 0 0 14px rgba(255,122,26,0); } 100% { box-shadow: 0 0 0 0 rgba(255,122,26,0); } }
.hl { color: var(--orange); }
.chip.orange { background: var(--orange-soft); color: #c2560a; }
