/* ============================================================
   Dấu Mốc — Marketing site
   Design tokens mirror the app's design system (ForestGreen /
   warm paper / Be Vietnam Pro) so the web feels like one brand.
   ============================================================ */

:root {
  --forest: #1F5E3B;
  --forest-dark: #163F28;
  --forest-tint: #E7EFE8;
  --paper: #F5EFE3;
  --paper-alt: #EFE4D2;
  --ink: #221F1A;
  --ink-soft: #5B564C;
  --sun: #E8933A;
  --rust: #8B4030;
  --white: #FFFFFF;

  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --shadow-soft: 0 20px 45px -25px rgba(22, 35, 26, 0.35);
  --shadow-card: 0 12px 30px -18px rgba(22, 35, 26, 0.25);
  --container-w: 1160px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Be Vietnam Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

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

.container {
  width: 100%;
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 24px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--forest);
  color: var(--white);
  padding: 12px 20px;
  border-radius: 0 0 8px 0;
  z-index: 200;
}
.skip-link:focus { left: 0; }

h1, h2, h3 {
  font-weight: 800;
  line-height: 1.15;
  margin: 0 0 16px;
  color: var(--ink);
}

h1 { font-size: clamp(2.1rem, 4.5vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.35rem); }
h3 { font-size: 1.15rem; margin-bottom: 8px; }

p { margin: 0 0 12px; color: var(--ink-soft); }

.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--forest);
  margin-bottom: 12px;
}
.eyebrow-center { display: block; text-align: center; }

.section-lead {
  font-size: 1.05rem;
  max-width: 640px;
}

.section-head {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 48px;
}
.section-head .section-lead { margin-left: auto; margin-right: auto; }

.text-stamp {
  color: var(--forest);
  position: relative;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 15px 28px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: var(--forest);
  color: var(--white);
  box-shadow: var(--shadow-card);
}
.btn-primary:hover { background: var(--forest-dark); }

.btn-ghost {
  background: transparent;
  color: var(--forest);
  border-color: var(--forest);
}
.btn-ghost:hover { background: var(--forest-tint); }

.btn-small { padding: 10px 20px; font-size: 0.9rem; }

.btn-store {
  flex-direction: column;
  gap: 2px;
  background: var(--ink);
  color: var(--white);
  padding: 12px 32px;
  border-radius: var(--radius-sm);
  cursor: default;
  opacity: 0.94;
}
.btn-store:hover { transform: none; }
.btn-store-eyebrow { font-size: 0.7rem; font-weight: 500; opacity: 0.75; }
.btn-store-title { font-size: 1.15rem; font-weight: 800; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(245, 239, 227, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(31, 94, 59, 0.1);
}

.header-inner {
  display: flex;
  align-items: center;
  height: 76px;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--forest);
}
.brand-word { letter-spacing: -0.01em; }

.main-nav {
  display: flex;
  gap: 32px;
  flex: 1;
  justify-content: center;
}
.main-nav a {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
  position: relative;
  padding: 6px 0;
}
.main-nav a:hover { color: var(--forest); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--ink);
  border-radius: 2px;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 72px 0 96px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 85% 10%, rgba(232, 147, 58, 0.16), transparent 45%),
    radial-gradient(circle at -5% 90%, rgba(31, 94, 59, 0.14), transparent 50%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}

.hero-sub {
  font-size: 1.1rem;
  max-width: 460px;
}

.hero-cta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin: 28px 0 18px;
}

.hero-note {
  font-size: 0.9rem;
  color: var(--forest);
  font-weight: 600;
}

.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
}

.hero-seal {
  position: absolute;
  width: 130px;
  bottom: -18px;
  left: -18px;
  filter: drop-shadow(0 10px 18px rgba(0,0,0,0.18));
}

/* ---------- Phone mockup frame ---------- */
.phone-frame {
  width: 260px;
  border-radius: 34px;
  padding: 10px;
  background: var(--ink);
  box-shadow: var(--shadow-soft);
  transform: rotate(-2deg);
}
.phone-frame img {
  border-radius: 24px;
  width: 100%;
}
.phone-frame-lg { width: 290px; }
.phone-frame-sm { width: 100%; max-width: 230px; transform: none; margin: 0 auto; }

/* ---------- Narrative strip ---------- */
.narrative {
  background: var(--forest);
  color: var(--white);
  padding: 56px 0;
}
.narrative-inner { text-align: center; max-width: 720px; margin: 0 auto; }
.narrative-line {
  font-size: clamp(1.3rem, 2.6vw, 1.8rem);
  font-weight: 700;
  color: var(--white);
  margin-bottom: 10px;
}
.narrative-sub { color: rgba(255,255,255,0.85); margin: 0; }

/* ---------- Sections ---------- */
.section { padding: 96px 0; }
.section-alt { background: var(--paper-alt); }

/* ---------- Loop steps (animated) ---------- */
.loop-wrap { position: relative; }

.loop-track {
  position: absolute;
  top: 54px;
  left: 0;
  right: 0;
  height: 0;
  z-index: 0;
}
.loop-line {
  position: absolute;
  top: 0;
  left: 5%;
  right: 5%;
  height: 2px;
  background: repeating-linear-gradient(
    90deg,
    rgba(31,94,59,0.3) 0 10px,
    transparent 10px 18px
  );
}
.loop-dot {
  position: absolute;
  top: 0;
  left: 5%;
  width: 12px;
  height: 12px;
  margin-top: -5px;
  margin-left: -6px;
  border-radius: 50%;
  background: var(--sun);
  box-shadow: 0 0 0 5px rgba(232, 147, 58, 0.22);
  animation: loopDotTravel 5s linear infinite;
}

.loop-steps {
  position: relative;
  z-index: 1;
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
  counter-reset: step;
}
.loop-steps li {
  position: relative;
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 28px 20px;
  text-align: center;
  box-shadow: var(--shadow-card);
}
.loop-steps p { font-size: 0.9rem; margin: 0; }

.loop-steps .icon-badge { animation: loopPulse 5s ease-in-out infinite; }
.loop-step-1 .icon-badge { animation-delay: 0s; }
.loop-step-2 .icon-badge { animation-delay: 1s; }
.loop-step-3 .icon-badge { animation-delay: 2s; }
.loop-step-4 .icon-badge { animation-delay: 3s; }
.loop-step-5 .icon-badge { animation-delay: 4s; }

@keyframes loopDotTravel {
  0%   { left: 5%;  opacity: 0; }
  4%   { opacity: 1; }
  96%  { opacity: 1; }
  100% { left: 95%; opacity: 0; }
}

@keyframes loopPulse {
  0%, 100% { transform: scale(1); box-shadow: none; }
  6% { transform: scale(1.16); box-shadow: 0 0 0 9px rgba(232, 147, 58, 0.18); }
  20% { transform: scale(1); box-shadow: none; }
}

@media (max-width: 960px) {
  .loop-track { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .loop-dot { display: none; }
  .loop-steps .icon-badge { animation: none; }
}

/* ---------- Feature grid ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.feature-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 32px 28px;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-soft); }
.feature-card-accent { background: var(--forest); }
.feature-card-accent h3, .feature-card-accent p { color: var(--white); }
.feature-card p { font-size: 0.95rem; margin: 0; }
.feature-card-accent .icon-badge { background: rgba(255,255,255,0.16); color: var(--white); }

/* ---------- Icon badges (replace emoji) ---------- */
.icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--forest-tint);
  color: var(--forest);
  margin-bottom: 16px;
}
.icon-badge svg { width: 26px; height: 26px; }
.icon-badge-sm { width: 44px; height: 44px; border-radius: 13px; margin-bottom: 12px; }
.icon-badge-sm svg { width: 22px; height: 22px; }
.icon-badge-sun { background: rgba(232, 147, 58, 0.16); color: var(--sun); }
.cta-band .icon-badge { background: rgba(255,255,255,0.14); color: var(--white); margin: 0 auto 20px; }

/* ---------- Spotlight ---------- */
.spotlight-inner {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 64px;
  align-items: center;
}
.spotlight-visual { display: flex; justify-content: center; }

.check-list {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.check-list li {
  position: relative;
  padding-left: 30px;
  font-weight: 600;
  color: var(--ink);
}
.check-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--forest);
  font-weight: 800;
}

/* ---------- Gallery ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
.gallery-item { margin: 0; text-align: center; }
.gallery-item figcaption {
  margin-top: 18px;
  font-weight: 700;
  color: var(--forest);
}

/* ---------- Community ---------- */
.community-inner { text-align: center; max-width: 760px; margin: 0 auto; }
.community-quote {
  margin: 0 0 20px;
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 800;
  color: var(--rust);
  font-style: normal;
}
.community-lead { margin: 0 auto; }

/* ---------- CTA band ---------- */
.cta-band {
  background: linear-gradient(180deg, var(--forest) 0%, var(--forest-dark) 100%);
  color: var(--white);
  padding: 90px 0;
  text-align: center;
}
.cta-inner { max-width: 560px; margin: 0 auto; }
.cta-mark { margin: 0 auto 20px; filter: brightness(0) invert(1); opacity: 0.95; }
.cta-band h2 { color: var(--white); }
.cta-band p { color: rgba(255,255,255,0.85); margin-bottom: 28px; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  color: rgba(255,255,255,0.7);
  padding: 48px 0 32px;
}
.footer-inner { text-align: center; }
.footer-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--white);
  margin-bottom: 8px;
}
.footer-brand img { filter: brightness(0) invert(1); }
.footer-tagline { letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.8rem; margin-bottom: 24px; }
.footer-nav {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.footer-nav a { font-weight: 600; font-size: 0.9rem; }
.footer-nav a:hover { color: var(--white); }
.footer-copy { font-size: 0.82rem; margin: 0; }

/* ---------- Legal / long-form content pages ---------- */
.legal-hero {
  padding: 56px 0 40px;
  border-bottom: 1px solid rgba(31,94,59,0.12);
}
.legal-hero .eyebrow { margin-bottom: 10px; }
.legal-updated { font-size: 0.9rem; color: var(--ink-soft); margin: 0; }

.legal-body {
  padding: 56px 0 96px;
}
.legal-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 56px;
  align-items: start;
}

.legal-toc {
  position: sticky;
  top: 96px;
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  box-shadow: var(--shadow-card);
}
.legal-toc p {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--forest);
  margin: 0 0 12px;
}
.legal-toc ol {
  margin: 0;
  padding-left: 18px;
  font-size: 0.88rem;
}
.legal-toc li { margin-bottom: 8px; }
.legal-toc a { color: var(--ink-soft); }
.legal-toc a:hover { color: var(--forest); }

.legal-content {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 44px 48px;
  box-shadow: var(--shadow-card);
  max-width: 780px;
}
.legal-content h2 {
  font-size: 1.3rem;
  margin-top: 40px;
  padding-top: 8px;
  scroll-margin-top: 96px;
}
.legal-content h2:first-child { margin-top: 0; }
.legal-content h3 {
  font-size: 1rem;
  margin-top: 24px;
}
.legal-content p, .legal-content li { color: var(--ink-soft); font-size: 0.98rem; }
.legal-content ul, .legal-content ol { padding-left: 22px; }
.legal-content li { margin-bottom: 8px; }
.legal-content strong { color: var(--ink); }
.legal-content a { color: var(--forest); text-decoration: underline; text-underline-offset: 2px; }

.legal-callout {
  background: var(--forest-tint);
  border-left: 4px solid var(--forest);
  border-radius: var(--radius-sm);
  padding: 18px 22px;
  margin: 20px 0;
}
.legal-callout p { margin: 0; color: var(--ink); font-size: 0.94rem; }
.legal-callout p + p { margin-top: 8px; }

.legal-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 24px;
  font-size: 0.92rem;
}
.legal-table th, .legal-table td {
  border: 1px solid rgba(31,94,59,0.18);
  padding: 10px 14px;
  text-align: left;
  vertical-align: top;
}
.legal-table th {
  background: var(--paper-alt);
  color: var(--ink);
  font-weight: 700;
}
.legal-table td { color: var(--ink-soft); }

.steps-list {
  counter-reset: steps;
  list-style: none;
  padding: 0;
  margin: 20px 0;
}
.steps-list li {
  counter-increment: steps;
  position: relative;
  padding: 4px 0 4px 44px;
  margin-bottom: 18px;
}
.steps-list li::before {
  content: counter(steps);
  position: absolute;
  left: 0;
  top: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--forest);
  color: var(--white);
  font-weight: 800;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 900px) {
  .legal-layout { grid-template-columns: 1fr; }
  .legal-toc { position: static; }
  .legal-content { padding: 32px 24px; }
}

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

.loop-steps li.reveal:nth-child(2) { transition-delay: 0.08s; }
.loop-steps li.reveal:nth-child(3) { transition-delay: 0.16s; }
.loop-steps li.reveal:nth-child(4) { transition-delay: 0.24s; }
.loop-steps li.reveal:nth-child(5) { transition-delay: 0.32s; }

.feature-grid .feature-card.reveal:nth-child(2) { transition-delay: 0.06s; }
.feature-grid .feature-card.reveal:nth-child(3) { transition-delay: 0.12s; }
.feature-grid .feature-card.reveal:nth-child(4) { transition-delay: 0.18s; }
.feature-grid .feature-card.reveal:nth-child(5) { transition-delay: 0.24s; }
.feature-grid .feature-card.reveal:nth-child(6) { transition-delay: 0.3s; }

.gallery-item.reveal:nth-child(2) { transition-delay: 0.1s; }
.gallery-item.reveal:nth-child(3) { transition-delay: 0.2s; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero-copy { order: 2; }
  .hero-visual { order: 1; margin-bottom: 12px; }
  .hero-sub { margin-left: auto; margin-right: auto; }
  .hero-cta { justify-content: center; }

  .spotlight-inner { grid-template-columns: 1fr; text-align: center; }
  .check-list { justify-items: center; }
  .check-list li { text-align: left; display: inline-block; }

  .loop-steps { grid-template-columns: repeat(2, 1fr); }

  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery { grid-template-columns: 1fr; max-width: 320px; margin: 0 auto; gap: 40px; }
}

@media (max-width: 720px) {
  .main-nav {
    position: absolute;
    top: 76px;
    left: 0;
    right: 0;
    background: var(--paper);
    flex-direction: column;
    align-items: center;
    gap: 0;
    padding: 8px 0 16px;
    border-bottom: 1px solid rgba(31,94,59,0.1);
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.2s ease, opacity 0.2s ease;
  }
  .main-nav.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .main-nav a { padding: 12px 0; width: 100%; text-align: center; }
  .nav-toggle { display: flex; }
  .header-actions .btn-small { display: none; }

  .loop-steps { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .section { padding: 64px 0; }
  .btn { width: 100%; }
  .hero-cta { flex-direction: column; }
  .hero-cta .btn { width: 100%; }
}
