/* ============================================================
   Eyelax — Shared Design Tokens & Base Styles
   Brand colors sampled directly from the official logo files.
   Typography: Figtree (heading) + Noto Sans (body) — "Medical Clean"
   pairing, chosen for healthcare trust + full Vietnamese diacritic support.
   ============================================================ */

:root {
  /* ---- Brand color primitives (from logo) ---- */
  --color-primary: #2B52AA;
  --color-primary-600: #24468f;
  --color-primary-dark: #1B3877;
  --color-primary-deep: #0E2350;
  --color-cyan: #42A7E5;
  --color-cyan-light: #8FD3F4;
  --color-cyan-pale: #E7F5FD;
  --color-white: #FFFFFF;

  /* ---- Semantic tokens ---- */
  --bg-page: #F6FAFE;
  --bg-card: #FFFFFF;
  --bg-muted: #EFF6FC;
  --text-ink: #10254A;
  --text-soft: #4C5F7E;
  --text-faint: #7C8CA8;
  --border-soft: #DCEAF7;
  --border-strong: #B9D6EE;
  --color-success: #178A4C;
  --ring: #42A7E5;

  /* ---- Type ---- */
  --font-heading: 'Figtree', 'Noto Sans', sans-serif;
  --font-body: 'Noto Sans', 'Figtree', sans-serif;

  /* ---- Elevation ---- */
  --shadow-sm: 0 1px 2px rgba(14, 35, 80, 0.06);
  --shadow-md: 0 8px 24px rgba(14, 35, 80, 0.08);
  --shadow-lg: 0 20px 48px rgba(14, 35, 80, 0.14);
  --shadow-glow: 0 0 0 8px rgba(66, 167, 229, 0.12);
}

* { -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg-page);
  color: var(--text-ink);
  font-size: 16px;
  line-height: 1.6;
}

h1, h2, h3, h4, h5, .font-heading {
  font-family: var(--font-heading);
}

/* ---- Accessible focus states (WCAG AAA target) ---- */
a, button, input, textarea, select, [tabindex] {
  outline-offset: 2px;
}
a:focus-visible, button:focus-visible, input:focus-visible,
textarea:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--color-cyan);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---- Skip link ---- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--color-primary);
  color: #fff;
  padding: 12px 20px;
  z-index: 100;
  border-radius: 0 0 8px 0;
  font-weight: 600;
}
.skip-link:focus {
  left: 0;
}

/* ---- Scroll reveal (respects reduced motion) ---- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }
.reveal-delay-4 { transition-delay: 0.32s; }
.reveal-delay-5 { transition-delay: 0.4s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---- Header ---- */
#site-header {
  transition: box-shadow 0.3s ease, background-color 0.3s ease;
}
#site-header.is-scrolled {
  box-shadow: 0 2px 24px rgba(14, 35, 80, 0.09);
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-heading);
  font-weight: 600;
  border-radius: 999px;
  padding: 0.9rem 1.9rem;
  font-size: 0.95rem;
  min-height: 44px;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, background-color 0.25s ease, color 0.25s ease;
  cursor: pointer;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 10px 28px -8px rgba(43, 82, 170, 0.55);
}
.btn-primary:hover {
  background: var(--color-primary-600);
  transform: translateY(-2px);
  box-shadow: 0 16px 32px -8px rgba(43, 82, 170, 0.6);
}

.btn-cyan {
  background: var(--color-cyan);
  color: #fff;
  box-shadow: 0 10px 28px -8px rgba(66, 167, 229, 0.55);
}
.btn-cyan:hover {
  background: #2f96d6;
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border: 1.5px solid var(--border-strong);
}
.btn-outline:hover {
  background: var(--color-cyan-pale);
  border-color: var(--color-cyan);
  transform: translateY(-2px);
}

.btn-white {
  background: #fff;
  color: var(--color-primary);
}
.btn-white:hover {
  background: var(--color-cyan-pale);
  transform: translateY(-2px);
}

/* ---- Cards ---- */
.card-soft {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: 1.5rem;
  box-shadow: var(--shadow-md);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease, border-color 0.4s ease;
}
.card-soft:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}

/* ---- Eyebrow / section label ---- */
.eyebrow {
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-primary);
}

/* ---- Gradient text ---- */
.text-gradient {
  background: linear-gradient(100deg, var(--color-primary) 10%, var(--color-cyan) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---- Decorative eye motif (matches logo crescent) ---- */
.eye-mark {
  display: inline-block;
  width: 1em;
  height: 0.55em;
  border-bottom: 0.22em solid currentColor;
  border-radius: 0 0 999px 999px;
}

/* ---- Soft blurred blob background ---- */
.blob {
  position: absolute;
  border-radius: 999px;
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
}

/* ---- Floating animation ---- */
@keyframes float-slow {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-14px) rotate(1.2deg); }
}
.animate-float {
  animation: float-slow 7s ease-in-out infinite;
}

@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(66, 167, 229, 0.45); }
  70% { box-shadow: 0 0 0 16px rgba(66, 167, 229, 0); }
  100% { box-shadow: 0 0 0 0 rgba(66, 167, 229, 0); }
}
.animate-pulse-ring {
  animation: pulse-ring 2.8s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.animate-marquee {
  animation: marquee 28s linear infinite;
}

/* ---- Counter number ---- */
.stat-number {
  font-family: var(--font-heading);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* ---- Language toggle ---- */
.lang-toggle {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--border-strong);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
  background: #fff;
}
.lang-toggle button {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  padding: 5px 11px;
  border-radius: 999px;
  color: var(--text-soft);
  min-height: auto;
  transition: background-color 0.25s ease, color 0.25s ease;
}
.lang-toggle button[aria-pressed="true"] {
  background: var(--color-primary);
  color: #fff;
}

/* Larger tap target on mobile — only the #mobile-nav instance is visible
   below 768px (the top-bar instance is `hidden md:block`), so this is safe
   to scope globally without affecting the desktop utility bar. */
@media (max-width: 767px) {
  .lang-toggle button {
    padding: 15px 18px;
    font-size: 0.76rem;
  }
}

/* ---- Mobile nav ---- */
#mobile-nav {
  transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
}
#mobile-nav.is-open {
  max-height: 720px;
  opacity: 1;
}

/* ---- Utility: no-scroll while mobile nav open ---- */
body.nav-open { overflow: hidden; }

/* ---- Section divider wave ---- */
.wave-divider { display: block; width: 100%; height: auto; }

/* ---- Testimonial quote mark ---- */
.quote-mark {
  font-family: Georgia, serif;
  line-height: 0.5;
}

/* ---- Table of ingredients ---- */
.ingredient-pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-soft);
  background: var(--bg-muted);
  color: var(--text-soft);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  font-size: 0.82rem;
}

/* ---- Routine step connector ---- */
.routine-line {
  background: repeating-linear-gradient(to bottom, var(--border-strong) 0 6px, transparent 6px 12px);
  width: 2px;
}

/* ============================================================
   Article / long-form reading typography ("Mắt thông thái" posts)
   Narrow column, generous line-height, soft caregiver tone.
   ============================================================ */
.article-body {
  font-size: 17px;
  line-height: 1.85;
  color: var(--text-soft);
}
@media (min-width: 640px) {
  .article-body { font-size: 18px; }
}
.article-body > p {
  margin-bottom: 1.5em;
}
.article-body h2 {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.5rem;
  line-height: 1.35;
  color: var(--text-ink);
  margin-top: 2.75rem;
  margin-bottom: 1rem;
}
@media (min-width: 640px) {
  .article-body h2 { font-size: 1.65rem; }
}
.article-body h2:first-child { margin-top: 0; }
.article-body ul, .article-body ol {
  margin: 0 0 1.5em 0;
  padding-left: 1.4em;
  display: flex;
  flex-direction: column;
  gap: 0.65em;
}
.article-body ul { list-style: none; padding-left: 0; }
.article-body ul > li {
  position: relative;
  padding-left: 1.75em;
}
.article-body ul > li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--color-cyan);
}
.article-body ol {
  list-style: none;
  counter-reset: article-ol;
  padding-left: 0;
}
.article-body ol > li {
  position: relative;
  padding-left: 2.5em;
  counter-increment: article-ol;
}
.article-body ol > li::before {
  content: counter(article-ol);
  position: absolute;
  left: 0;
  top: 0;
  width: 1.75em;
  height: 1.75em;
  border-radius: 999px;
  background: var(--color-cyan-pale);
  color: var(--color-primary);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.85em;
  display: flex;
  align-items: center;
  justify-content: center;
}
.article-body strong { color: var(--text-ink); font-weight: 700; }
.article-body a { color: var(--color-primary); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

/* ---- Tip / callout box within an article ---- */
.article-tip {
  background: var(--color-cyan-pale);
  border-left: 4px solid var(--color-cyan);
  border-radius: 0 1rem 1rem 0;
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
}
.article-tip p { margin: 0; color: var(--text-ink); }

/* ---- Consultation form success state ---- */
@keyframes consult-success-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.consult-success.flex {
  animation: consult-success-in 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
@media (prefers-reduced-motion: reduce) {
  .consult-success.flex { animation: none; }
}
