/* ============================================================
   The Way Home — shared styles
   Fonts: Fraunces (display) + Be Vietnam Pro (body)
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&family=Be+Vietnam+Pro:wght@300;400;500;600;700&display=swap');

:root { color-scheme: light; }

html { scroll-behavior: smooth; }
body {
  font-family: 'Be Vietnam Pro', system-ui, sans-serif;
  background-color: #E9DFCB;
  color: #2A331E;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.font-display { font-family: 'Fraunces', Georgia, serif; }

::selection { background: #E59A45; color: #fff; }

/* Deepen terracotta used as TEXT so it reads clearly on cream / white.
   (Accent lines, underlines and icons keep the brighter #C67B4E via their own hex,
   so the brand accent stays vivid where contrast isn't a concern.) */
.text-terracotta { color: #8E4220; }

/* Section eyebrow kickers (e.g. "SỰ HIỆN DIỆN") carry each section's key label.
   Make them a touch larger and less letter-spaced so they read easily — Vietnamese
   diacritics need the breathing room. Applies to every eyebrow site-wide. */
.uppercase.tracking-\[0\.18em\] {
  font-size: 0.9375rem;
  letter-spacing: 0.08em;
}

/* Mobile hero: shorter section so the 16:9 background video isn't cropped to a thin strip */
@media (max-width: 639px) {
  #twh-heart { display: none; }
  /* Mobile hero: full 16:9 video on top, text below — no cropping */
  #hero { min-height: 0; flex-direction: column; justify-content: flex-start; padding-top: 5.25rem; padding-bottom: 2.5rem; }
  #heroVideo { position: static; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
  #hero > div.absolute { display: none; }
  #hero > a[href="#mission"] { display: none; }
  #heroContent { padding-top: 1.75rem; padding-bottom: 0; }
}

/* ---------- i18n: show only the active language ---------- */
html[lang="vi"] [data-en] { display: none; }
html[lang="en"] [data-vi] { display: none; }

/* ---------- Scroll-reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  filter: blur(6px);
  transition: opacity .8s cubic-bezier(.16,.84,.44,1), transform .8s cubic-bezier(.16,.84,.44,1), filter .8s cubic-bezier(.16,.84,.44,1);
}
.reveal.is-visible { opacity: 1; transform: none; filter: blur(0); }
.reveal[data-delay="1"] { transition-delay: .08s; }
.reveal[data-delay="2"] { transition-delay: .16s; }
.reveal[data-delay="3"] { transition-delay: .24s; }
.reveal[data-delay="4"] { transition-delay: .32s; }
.reveal[data-delay="5"] { transition-delay: .40s; }

/* ---------- Floating blobs ---------- */
@keyframes twh-float { 0%,100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-22px) scale(1.04); } }
.blob { animation: twh-float 9s ease-in-out infinite; will-change: transform; }
.blob.b2 { animation-duration: 12s; animation-delay: -3s; }
.blob.b3 { animation-duration: 14s; animation-delay: -6s; }

/* ---------- Gradient text ---------- */
.text-gradient {
  background: linear-gradient(120deg,#1F534F 0%, #5E7C56 45%, #C67B4E 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- Animated underline link ---------- */
.link-grow { position: relative; }
.link-grow::after {
  content:''; position:absolute; left:0; bottom:-4px; height:2px; width:0;
  background:#C67B4E; transition:width .3s ease; border-radius:2px;
}
.link-grow:hover::after, .link-grow[aria-current="page"]::after { width:100%; }

/* Underline-on-hover anchored at the bottom (no pseudo / no positioning — safe inside stretched-link cards) */
.uline { background-image: linear-gradient(#C67B4E, #C67B4E); background-position: 0 100%; background-size: 0 2px; background-repeat: no-repeat; transition: background-size .3s ease; }
.uline:hover { background-size: 100% 2px; }

/* Footer keyword links: a firefly lights up, text drifts, a gold underline draws */
.foot-link { position: relative; display: inline-block; transition: color .25s ease, transform .3s cubic-bezier(.16,.84,.44,1); }
.foot-link::before {
  content: ''; position: absolute; left: -13px; top: 50%; width: 5px; height: 5px; margin-top: -2.5px;
  border-radius: 50%; background: #F0DBA8; box-shadow: 0 0 9px 2px rgba(240,219,150,.8);
  opacity: 0; transform: scale(.4); transition: opacity .3s ease, transform .35s cubic-bezier(.16,.84,.44,1);
}
.foot-link::after {
  content: ''; position: absolute; left: 0; bottom: -3px; height: 1px; width: 0;
  background: linear-gradient(90deg, #E5C77E, rgba(229,199,126,0));
  transition: width .35s cubic-bezier(.16,.84,.44,1);
}
.foot-link:hover { transform: translateX(9px); }
.foot-link:hover::before { opacity: 1; transform: scale(1); }
.foot-link:hover::after { width: 100%; }
@media (prefers-reduced-motion: reduce) { .foot-link:hover { transform: none; } }

/* Footer flower garden — delicate line-art that blooms when the footer is hovered */
#twh-footer footer { position: relative; overflow: hidden; isolation: isolate; }
.foot-garden { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; color: #EADFC2; }
.foot-flower {
  position: absolute; opacity: 0; transform: translate(-50%, -50%) scale(0) rotate(-35deg); transform-origin: center;
  transition: transform .85s cubic-bezier(.16,.84,.44,1) var(--d,0s), opacity .7s ease var(--d,0s);
}
.foot-flower svg { width: 100%; height: 100%; display: block; }
#twh-footer footer:hover .foot-flower { opacity: var(--o,.12); transform: translate(-50%, -50%) scale(1) rotate(0deg); }
@media (prefers-reduced-motion: reduce) { .foot-flower { transition-duration: .01ms; } }
@media (hover: none), (pointer: coarse) { .foot-garden { display: none; } }

/* ---------- YouTube / video facade ---------- */
.yt-facade { cursor: pointer; }
.yt-facade .yt-play { transition: transform .25s ease, background-color .25s ease; }
.yt-facade:hover .yt-play { transform: scale(1.08); background-color: #C0392B; }

/* ---------- Accordion (FAQ) ---------- */
.acc-panel { max-height: 0; overflow: hidden; transition: max-height .35s ease; }
.acc-item[data-open="true"] .acc-panel { max-height: 480px; }
.acc-item.acc-lg[data-open="true"] .acc-panel { max-height: 2400px; }
.acc-item[data-open="true"] .acc-icon { transform: rotate(45deg); }
.acc-icon { transition: transform .3s ease; }

/* ---------- Active mobile nav state ---------- */
.nav-link[aria-current="page"] { color: #1F534F; }
.mobile-link[aria-current="page"] { background: #F1E7D8; color: #1F534F; }

/* ---------- Forms ---------- */
.field {
  width: 100%; border-radius: 9999px; background: #fff;
  border: 1px solid #E7DAC6; padding: .85rem 1.25rem; color: #33402B;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.field:focus { outline: none; border-color: #5E7C56; box-shadow: 0 0 0 4px rgba(94,124,86,.18); }
.field::placeholder { color: #9c9285; }
textarea.field { border-radius: 1.25rem; resize: vertical; min-height: 120px; }

/* ---------- Hand-crafted micro-interactions ---------- */
:root { --twh-ease: cubic-bezier(.16,.84,.44,1); }

/* "Expensive" media card: lift + slow image zoom + accent line draw */
.card-x { position: relative; transition: transform .55s var(--twh-ease), box-shadow .55s var(--twh-ease); }
.card-x:hover { transform: translateY(-6px); box-shadow: 0 30px 60px -26px rgba(31,83,79,.38); }
.card-x__media img, .card-x__media svg { transition: transform 1.1s var(--twh-ease), opacity .5s ease; transform-origin: center; will-change: transform; }
.card-x:hover .card-x__media img, .card-x:hover .card-x__media svg { transform: scale(1.07); }
.card-x::after {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, #E59A45, #C67B4E);
  transform: scaleX(0); transform-origin: left;
  transition: transform .55s var(--twh-ease);
}
.card-x:hover::after { transform: scaleX(1); }

/* Quiet lift (cards without media) */
.card-lift { transition: transform .5s var(--twh-ease), box-shadow .5s var(--twh-ease); }
.card-lift:hover { transform: translateY(-5px); box-shadow: 0 26px 52px -28px rgba(31,83,79,.34); }

/* Avatar reacts to its parent card hover */
.avatar-ring { transition: transform .5s var(--twh-ease), box-shadow .5s ease; }
.card-lift:hover .avatar-ring { transform: translateY(-2px) scale(1.05); box-shadow: 0 0 0 6px rgba(229,154,69,.18), 0 14px 26px -12px rgba(31,83,79,.32); }

/* Arrow slides on hover (self or parent card) */
.arrow-link svg { transition: transform .35s var(--twh-ease); }
.arrow-link:hover svg, .group:hover .arrow-link svg { transform: translateX(4px); }

/* Pill fills warmly on hover */
.pill { transition: background-color .3s ease, color .3s ease, transform .3s var(--twh-ease), box-shadow .3s ease; cursor: default; }
.pill:hover { background-color: #1F534F; color: #FAF5EE; transform: translateY(-2px); box-shadow: 0 9px 20px -10px rgba(31,83,79,.55); }

@media (hover: none) {
  .card-x:hover, .card-lift:hover { transform: none; }
  .card-x:hover::after { transform: scaleX(0); }
  .pill:hover { transform: none; }
}

/* ---------- Firefly cursor glow ---------- */
#twh-glow {
  position: fixed; left: 0; top: 0; width: 320px; height: 320px;
  margin: -160px 0 0 -160px; border-radius: 50%;
  pointer-events: none; z-index: 45; opacity: 0;
  transition: opacity .6s ease;
  background: radial-gradient(circle, rgba(255,214,138,0.22) 0%, rgba(229,154,69,0.12) 38%, rgba(229,154,69,0) 66%);
  mix-blend-mode: screen; will-change: transform;
}
#twh-glow::after {
  content: ''; position: absolute; left: 50%; top: 50%;
  width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%;
  background: #FFE9C2; box-shadow: 0 0 10px 3px rgba(255,221,150,0.75);
  animation: twh-firefly 2.4s ease-in-out infinite;
}
@keyframes twh-firefly { 0%,100% { opacity: .55; transform: scale(.85); } 50% { opacity: 1; transform: scale(1.15); } }
body.twh-glow-on #twh-glow { opacity: 1; }

/* Cards & components gain a soft firefly halo on hover (fine-pointer only) */
@media (hover: hover) and (pointer: fine) {
  .card-x, .card-lift, .pill, .yt-facade, .acc-item { transition: filter .35s var(--twh-ease); }
  .card-x:hover, .card-lift:hover, .pill:hover, .yt-facade:hover, .acc-item:hover {
    filter: drop-shadow(0 0 16px rgba(229,154,69,0.32));
  }
}
@media (hover: none), (pointer: coarse) { #twh-glow { display: none !important; } }

/* ---------- Elegant botanical line-art (behind all content) ---------- */
#twh-garden {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden;
  background-color: #20302a;
}
#twh-garden::before {
  content: ''; position: absolute; inset: -16px; z-index: 0;
  background: url('../img/forest-bg.webp') center / cover no-repeat;
  filter: blur(1.6px);
  transform: scale(1.03);
}
/* Cream fog over the forest — thinned around the cursor to reveal the forest beneath */
#twh-garden .twh-veil {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(140% 122% at 50% 38%, rgba(239,230,213,.93) 0%, rgba(239,230,213,.90) 44%, rgba(239,230,213,.80) 62%, rgba(239,230,213,.16) 100%);
  -webkit-mask: radial-gradient(circle 175px at var(--mx, -300px) var(--my, -300px), rgba(0,0,0,.14) 0%, rgba(0,0,0,.42) 44%, #000 78%);
  mask: radial-gradient(circle 175px at var(--mx, -300px) var(--my, -300px), rgba(0,0,0,.14) 0%, rgba(0,0,0,.42) 44%, #000 78%);
}

/* Keep loose dark text legible when the cursor spotlight reveals dark forest behind it.
   The halo is the same cream as the veil → invisible on the normal cream background, and
   only appears as a soft glow once the forest shows through. It is reset inside opaque
   cards / panels / header / footer, where no forest is exposed, so that text stays crisp. */
.text-ink, .text-mutedink, .text-pine, .text-terracotta {
  text-shadow:
    1px 0 0 rgba(239,230,213,.95), -1px 0 0 rgba(239,230,213,.95),
    0 1px 0 rgba(239,230,213,.95), 0 -1px 0 rgba(239,230,213,.95),
    1px 1px 0 rgba(239,230,213,.9), -1px -1px 0 rgba(239,230,213,.9),
    1px -1px 0 rgba(239,230,213,.9), -1px 1px 0 rgba(239,230,213,.9);
}
[class*="bg-white"], [class*="bg-cream"], [class*="bg-sand"], [class*="bg-honey"], [class*="bg-pine"], [class*="bg-sage"], [class*="bg-terracotta"],
[class*="bg-white"] *, [class*="bg-cream"] *, [class*="bg-sand"] *, [class*="bg-honey"] *, [class*="bg-pine"] *, [class*="bg-sage"] *, [class*="bg-terracotta"] *,
.card-x *, .card-lift *, .acc-item *, #twh-header *, #twh-footer * {
  text-shadow: none;
}
#twh-garden .sprig { position: absolute; height: auto; color: #A8895E; opacity: .42; transition: filter .45s ease; }
#twh-garden .cre   { position: absolute; height: auto; color: #A8895E; transition: filter .45s ease; }
#twh-garden .react.lit { filter: brightness(1.45) drop-shadow(0 0 12px rgba(216,180,120,.5)); }

/* Moon */
#twh-garden .moon {
  position: absolute; top: 7%; right: 14%;
  width: clamp(46px, 6vw, 76px); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 40% 38%, #F6EFDD, #E7D9B4 62%, #D7C594 100%);
  box-shadow: 0 0 52px 18px rgba(231,217,180,.18);
  opacity: .55;
}

/* Gold dust / fireflies */
#twh-garden .ff { position: absolute; animation: twh-ffdrift var(--d, 26s) ease-in-out infinite; }
#twh-garden .ff i {
  display: block; width: 6px; height: 6px; border-radius: 50%;
  background: #F4E0AE; box-shadow: 0 0 9px 2px rgba(229,201,135,.6); opacity: .24;
  animation: twh-ffblink var(--b, 6s) ease-in-out infinite;
  transition: box-shadow .45s ease, opacity .45s ease, transform .45s ease;
}
#twh-garden .ff.lit i { opacity: 1; box-shadow: 0 0 18px 6px rgba(235,205,140,.9); transform: scale(1.6); }

/* Gentle motions */
.cre-flutter  { animation: twh-flutter 15s ease-in-out infinite; }
.cre-flutter2 { animation: twh-flutter2 18s ease-in-out infinite; }
.cre-hover { animation: twh-hover 15s ease-in-out infinite; }
.cre-glide { animation: twh-glide 22s ease-in-out infinite; }
.cre-bob   { animation: twh-bob 8s ease-in-out infinite; }
@keyframes twh-hover { 0%,100% { transform: translate(0,0); } 33% { transform: translate(14px,8px); } 66% { transform: translate(-10px,10px); } }
@keyframes twh-glide { 0%,100% { transform: translate(0,0); } 50% { transform: translate(38px,-14px); } }
@keyframes twh-bob   { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* Scroll-down cue (course curriculum hint) */
@keyframes twh-scrolldown { 0%,100% { transform: translateY(0); } 50% { transform: translateY(6px); } }
.twh-scrollcue { animation: twh-scrolldown 1.5s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .twh-scrollcue { animation: none; } }

@keyframes twh-ffdrift { 0%,100% { transform: translate(0,0); } 25% { transform: translate(16px,-26px); } 50% { transform: translate(-14px,-40px); } 75% { transform: translate(-20px,-16px); } }
@keyframes twh-ffblink { 0%,100% { opacity: .2; } 50% { opacity: .62; } }
@keyframes twh-flutter  { 0%,100% { transform: translate(0,0) rotate(-2deg); } 50% { transform: translate(14px,-12px) rotate(3deg); } }
@keyframes twh-flutter2 { 0%,100% { transform: translate(0,0) rotate(2deg); } 50% { transform: translate(-14px,-10px) rotate(-3deg); } }

@media (prefers-reduced-motion: reduce) {
  #twh-garden .ff, #twh-garden .cre { animation: none !important; }
  #twh-garden .ff i { opacity: .24 !important; }
}

/* Reserve space for the mobile quick-action bar (phones only) */
@media (max-width: 639px) {
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
}

/* Whole-card click (stretched link over the card) */
.card-link::before { content: ''; position: absolute; inset: 0; z-index: 3; }

/* Thank-you firefly overlay (elegant) */
#twh-thanks {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center;
  pointer-events: none; opacity: 0; transition: opacity .6s ease;
  background: radial-gradient(circle at 50% 42%, rgba(26,48,46,.88), rgba(9,19,17,.96));
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}
#twh-thanks.show { opacity: 1; }
#twh-thanks .twh-stage { display: flex; flex-direction: column; align-items: center; gap: 1.15rem; padding: 0 1.2rem; max-width: min(90vw, 780px); }
#twh-thanks .twh-rule { width: 0; height: 1px; background: linear-gradient(90deg, transparent, #E9C77E 50%, transparent); transition: width 1s cubic-bezier(.16,.84,.44,1) .25s; }
#twh-thanks.reveal-on .twh-rule { width: min(62vw, 380px); }
#twh-thanks .tx {
  text-align: center; font-family: 'Fraunces', Georgia, serif; font-weight: 600; line-height: 1.32;
  font-size: clamp(22px, 4.4vw, 42px);
  background: linear-gradient(100deg, #E9C77E 0%, #FBEFD0 22%, #FFF8E8 30%, #FBEFD0 40%, #E2BE74 64%);
  background-size: 230% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 20px rgba(233,199,126,.45));
  opacity: 0; transform: scale(.95) translateY(8px);
  transition: opacity 1s ease, transform 1s cubic-bezier(.16,.84,.44,1);
}
#twh-thanks.reveal-on .tx { opacity: 1; transform: none; animation: twh-shimmer 4.5s ease-in-out 1s infinite; }
#twh-thanks .tx .en { display: block; margin-top: .6rem; font-size: .56em; font-style: italic; opacity: .9; }
#twh-thanks .twh-logo {
  margin-top: .55rem; font-family: 'Fraunces', Georgia, serif; font-weight: 600;
  font-size: clamp(13px, 1.9vw, 18px); letter-spacing: .42em; text-indent: .42em; text-transform: uppercase;
  background: linear-gradient(100deg, #E9C77E 0%, #FBEFD0 22%, #FFF8E8 30%, #FBEFD0 40%, #E2BE74 64%);
  background-size: 230% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 12px rgba(233,199,126,.40));
  opacity: 0; transform: translateY(8px);
  transition: opacity .9s ease .15s, transform .9s ease .15s;
}
#twh-thanks.reveal-on .twh-logo { opacity: 1; transform: none; }
@keyframes twh-shimmer { 0% { background-position: 130% 0; } 100% { background-position: -30% 0; } }
#twh-thanks .fly {
  position: absolute; border-radius: 50%;
  background: radial-gradient(circle, #FFF3D4, #F0D89C 60%, rgba(240,216,156,0));
  box-shadow: 0 0 12px 3px rgba(255,224,150,.7);
  transition: transform 1.25s cubic-bezier(.22,.7,.2,1), opacity .7s ease;
}
#twh-thanks .fly.ember { animation: twh-emberglow 2.8s ease-in-out infinite; }
@keyframes twh-emberglow { 0%,100% { opacity: .35; } 50% { opacity: .95; } }

/* Heart attractor on the navbar */
#twh-heart { position: relative; }
#twh-heart svg { position: relative; z-index: 1; transform-origin: center; animation: twh-beat 3.4s ease-in-out infinite; }
#twh-heart::before {
  content: ''; position: absolute; inset: -5px; border-radius: 9999px; z-index: 0; pointer-events: none;
  background: radial-gradient(circle, rgba(229,154,69,.40), transparent 68%);
  opacity: 0; transition: opacity .4s ease;
}
#twh-heart::after {
  content: ''; position: absolute; inset: 0; border-radius: 9999px; z-index: 0; pointer-events: none;
  border: 1.5px solid rgba(229,154,69,.6); opacity: 0;
}
#twh-heart.near::before, #twh-heart:hover::before { opacity: 1; }
#twh-heart.near::after, #twh-heart:hover::after { animation: twh-ripple 1.7s ease-out infinite; }
#twh-heart .sp {
  position: absolute; left: 50%; top: 54%; width: 4px; height: 4px; border-radius: 50%; z-index: 2;
  background: #FFE9C2; box-shadow: 0 0 6px 2px rgba(255,221,150,.8); opacity: 0; pointer-events: none;
}
#twh-heart.near .sp, #twh-heart:hover .sp { animation: twh-spark 1.5s ease-out var(--d, 0s) infinite; }
@keyframes twh-beat { 0%,72%,100% { transform: scale(1); } 78% { transform: scale(1.15); } 84% { transform: scale(1); } 90% { transform: scale(1.09); } 96% { transform: scale(1); } }
@keyframes twh-ripple { 0% { transform: scale(.75); opacity: .65; } 100% { transform: scale(1.9); opacity: 0; } }
@keyframes twh-spark { 0% { transform: translate(-50%, -50%); opacity: 0; } 18% { opacity: 1; } 100% { transform: translate(calc(-50% + var(--x, 0px)), -190%); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  #twh-heart svg, #twh-heart::after, #twh-heart .sp { animation: none !important; }
}

/* ---------- Animal of the day ---------- */
#twh-animal {
  position: fixed; z-index: 30; width: clamp(50px, 6vw, 86px); height: auto;
  padding: 0; border: 0; background: none; cursor: pointer; color: #CBA86B;
  opacity: .55; pointer-events: auto;
  filter: drop-shadow(0 0 10px rgba(203,168,107,.4));
  transition: opacity .4s ease, filter .4s ease;
  animation: twh-animal-idle 6s ease-in-out infinite;
}
#twh-animal svg { width: 100%; height: auto; display: block; }
#twh-animal::before {
  content: ''; position: absolute; inset: -14%; border-radius: 50%;
  border: 2px solid rgba(233,199,126,.55); opacity: 0; pointer-events: none;
}
#twh-animal.near { opacity: 1; filter: drop-shadow(0 0 20px rgba(233,199,126,.8)); }
@media (hover: hover) { #twh-animal:hover { opacity: 1; filter: drop-shadow(0 0 20px rgba(233,199,126,.8)); } }
#twh-animal.near { animation: twh-animal-hop 1s ease-in-out infinite; }
#twh-animal.near::before { animation: twh-animal-ring 1.5s ease-out infinite; }
@keyframes twh-animal-idle { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes twh-animal-hop  { 0%,100% { transform: translateY(0) scale(1); } 30% { transform: translateY(-11px) scale(1.06); } 60% { transform: translateY(0) scale(1); } }
@keyframes twh-animal-ring { 0% { transform: scale(.7); opacity: .7; } 100% { transform: scale(1.55); opacity: 0; } }

/* Mascot contextual guide bubble */
.twh-guide {
  position: fixed; z-index: 46; max-width: 240px; display: flex; align-items: flex-start; gap: 3px;
  opacity: 0; visibility: hidden; transform: translateY(-50%) scale(.92);
  transition: opacity .45s ease, transform .45s cubic-bezier(.16,.84,.44,1); pointer-events: none;
}
.twh-guide.show { opacity: 1; visibility: visible; transform: translateY(-50%) scale(1); pointer-events: auto; }
.twh-guide-go {
  position: relative; display: inline-flex; align-items: center; gap: 9px; text-align: left;
  background: rgba(250,245,238,.97); color: #2A331E; border: 0; border-radius: 1.05rem;
  padding: .68rem .9rem; font-family: inherit; font-weight: 500; font-size: 14px; line-height: 1.45; cursor: pointer;
  box-shadow: 0 18px 44px -16px rgba(0,0,0,.55);
}
.twh-guide-go svg { width: 17px; height: 17px; flex: 0 0 auto; color: #8E4220; transition: transform .3s ease; }
.twh-guide-go:hover svg { transform: translateX(3px); }
.twh-guide.gl .twh-guide-go::before { content: ''; position: absolute; left: -7px; top: 50%; transform: translateY(-50%); border: 7px solid transparent; border-right-color: rgba(250,245,238,.97); border-left: 0; }
.twh-guide.gr .twh-guide-go::before { content: ''; position: absolute; right: -7px; top: 50%; transform: translateY(-50%); border: 7px solid transparent; border-left-color: rgba(250,245,238,.97); border-right: 0; }
.twh-guide-x { flex: 0 0 auto; margin-top: 2px; width: 20px; height: 20px; border: 0; border-radius: 50%; background: rgba(42,51,30,.12); color: #2A331E; font-size: 15px; line-height: 1; cursor: pointer; }
.twh-guide-x:hover { background: rgba(42,51,30,.24); }

/* Spotlight pulse for guided targets */
@keyframes twh-spot { 0% { box-shadow: 0 0 0 0 rgba(229,154,69,.5); } 70% { box-shadow: 0 0 0 18px rgba(229,154,69,0); } 100% { box-shadow: 0 0 0 0 rgba(229,154,69,0); } }
.twh-spot { animation: twh-spot 1.3s ease-out 2; }
@media (prefers-reduced-motion: reduce) {
  .twh-guide { transition: opacity .3s ease; transform: translateY(-50%); }
  .twh-guide.show { transform: translateY(-50%); }
  .twh-spot { animation: none; outline: 2px solid rgba(229,154,69,.6); outline-offset: 3px; }
}

/* ---------- Letter from the animal ---------- */
#twh-letter {
  position: fixed; inset: 0; z-index: 110; display: grid; place-items: center; padding: 1.2rem;
  opacity: 0; transition: opacity .45s ease; pointer-events: auto;
  background: radial-gradient(circle at 50% 38%, rgba(26,42,38,.72), rgba(11,20,18,.88));
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
#twh-letter.show { opacity: 1; }
#twh-letter .paper {
  position: relative; max-width: min(92vw, 540px); max-height: 86vh; overflow: auto;
  background: linear-gradient(#FBF4E6, #F4EAD4); border: 1px solid #E7D9B8; border-radius: 1.25rem;
  padding: clamp(1.7rem, 4.5vw, 2.8rem); box-shadow: 0 44px 90px -34px rgba(0,0,0,.6);
  transform: translateY(16px) scale(.97); transition: transform .55s cubic-bezier(.16,.84,.44,1);
}
#twh-letter.show .paper { transform: none; }
#twh-letter .lt-eyebrow { font-family: 'Fraunces', Georgia, serif; font-style: italic; color: #A8895E; font-size: 15px; margin-bottom: .55rem; }
#twh-letter .lt-body { font-family: 'Be Vietnam Pro', sans-serif; color: #4A4234; font-size: clamp(15px, 2.1vw, 17px); line-height: 1.95; }
#twh-letter .lt-sign { margin-top: 1.4rem; font-family: 'Fraunces', Georgia, serif; font-weight: 600; color: #1F534F; }
#twh-letter .close {
  position: absolute; top: .6rem; right: .7rem; width: 34px; height: 34px; border-radius: 9999px;
  border: 0; background: rgba(31,83,79,.08); color: #4A4234; font-size: 22px; line-height: 1; cursor: pointer;
  transition: background .2s ease;
}
#twh-letter .close:hover { background: rgba(31,83,79,.16); }

@media (prefers-reduced-motion: reduce) {
  #twh-animal, #twh-animal.near { animation: none !important; }
}

/* ---------- Utilities ---------- */
.no-scroll { overflow: hidden; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1 !important; transform: none !important; filter: none !important; transition: none !important; }
  .card-x:hover, .card-lift:hover, .card-x:hover .card-x__media img, .card-x:hover .card-x__media svg, .card-lift:hover .avatar-ring,
  .arrow-link:hover svg, .group:hover .arrow-link svg, .pill:hover { transform: none !important; }
  .card-x:hover::after { transform: scaleX(0) !important; }
  .blob { animation: none !important; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* ---------- Blog article ---------- */
#reading-bar {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60;
  background: linear-gradient(90deg, #5E7C56, #E59A45);
  transform: scaleX(0); transform-origin: 0 50%;
  transition: transform .1s linear; pointer-events: none;
}
.article-prose > p {
  margin-top: 1.35rem;
  font-size: 1.0625rem;
  line-height: 1.9;
  color: #343C27;
}
.article-prose > p:first-child { margin-top: 0; }
.article-prose h2 {
  margin-top: 3rem;
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  font-size: clamp(1.5rem, 1.2rem + 1.4vw, 1.95rem);
  line-height: 1.2;
  color: #2A331E;
  scroll-margin-top: 6rem;
}
.article-figure { margin: 2.25rem 0; }
.article-figure figcaption,
.article-prose figcaption {
  margin-top: .65rem;
  text-align: center;
  font-size: .8125rem;
  color: #6f7659;
}
.article-quote {
  margin: 2.25rem 0;
  padding: .35rem 0 .35rem 1.4rem;
  border-left: 4px solid #E59A45;
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-size: 1.3rem;
  line-height: 1.5;
  color: #2A331E;
}
.article-callout {
  margin: 2.5rem 0;
  padding: 1.4rem 1.5rem;
  border: 1px solid #d9c9b0;
  border-left: 4px solid #5E7C56;
  border-radius: 1rem;
  background: #FBF6EE;
  color: #343C27;
}
.article-related { margin-top: 3.25rem; }
/* FAQ accordion */
.article-faq {
  border: 1px solid #E7D9C4;
  border-radius: .85rem;
  background: #fff;
  overflow: hidden;
}
.article-faq > summary {
  list-style: none;
  cursor: pointer;
  padding: 1rem 1.15rem;
  font-weight: 600;
  color: #2A331E;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.article-faq > summary::-webkit-details-marker { display: none; }
.article-faq > summary::after {
  content: '+';
  font-family: 'Fraunces', serif;
  font-size: 1.4rem;
  line-height: 1;
  color: #5E7C56;
  transition: transform .25s ease;
}
.article-faq[open] > summary::after { transform: rotate(45deg); }
.article-faq > p {
  margin: 0;
  padding: 0 1.15rem 1.1rem;
  font-size: .95rem;
  line-height: 1.75;
  color: #343C27;
}
@media (max-width: 639px) {
  .article-prose > p { font-size: 1rem; line-height: 1.8; }
  .article-quote { font-size: 1.15rem; }
}

/* ---------- Article read-aloud (TTS) ---------- */
.tts-bar { margin-top: .25rem; margin-bottom: 1.75rem; display: flex; align-items: center; gap: .5rem; }
.tts-btn {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .6rem 1.15rem; border: none; border-radius: 999px;
  background: #1F534F; color: #FAF5EE;
  font-family: inherit; font-weight: 600; font-size: .95rem; line-height: 1;
  cursor: pointer; box-shadow: 0 8px 18px -10px rgba(20,60,57,.7);
  transition: background .2s ease, transform .15s ease;
}
.tts-btn:hover { background: #143C39; }
.tts-btn:active { transform: scale(.97); }
.tts-btn svg { width: 1.05rem; height: 1.05rem; flex: none; }
.tts-stop {
  display: none; align-items: center; justify-content: center;
  width: 2.4rem; height: 2.4rem; border: 1px solid #E7D9C4; border-radius: 999px;
  background: #fff; color: #5E7C56; cursor: pointer; transition: background .2s ease, color .2s ease;
}
.tts-stop svg { width: .95rem; height: .95rem; }
.tts-stop:hover { background: #F1E7D8; color: #143C39; }
.tts-bar.tts-active .tts-stop { display: inline-flex; }
.tts-progress { display: none; flex: 1; min-width: 64px; max-width: 220px; height: 5px; border-radius: 999px; background: #E7D9C4; overflow: hidden; }
.tts-bar.tts-has-progress.tts-active .tts-progress { display: block; }
.tts-progress > i { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, #5E7C56, #E59A45); transition: width .25s linear; }
.tts-reading {
  /* no cream highlight box — the read-along position is shown by gentle auto-scroll */
  border-radius: 3px;
}
@media (prefers-reduced-motion: reduce) {
  .tts-reading { transition: none; }
}

/* ---------- Blog article: clean white background ---------- */
body.twh-article { background: #ffffff; }
body.twh-article #twh-garden,
body.twh-article .twh-garden { display: none !important; }
/* Emphasised phrases inside articles */
.article-prose strong { color: #2A331E; font-weight: 600; }
.article-prose em { font-style: italic; }

/* On the white article background the cream text-outline (meant for the forest bg)
   turns into a blurry cream halo around letters — remove it so text is crisp. */
body.twh-article .text-ink,
body.twh-article .text-mutedink,
body.twh-article .text-pine,
body.twh-article .text-terracotta,
body.twh-article .article-prose,
body.twh-article .article-prose * {
  text-shadow: none;
}
/* Drop the cream pill behind the category label (looks washed out on white) */
body.twh-article article header [class~="bg-sand"] {
  background: transparent;
  padding-left: 0;
  padding-right: 0;
}
/* Breadcrumb & meta separators: visible (not cream) on white */
body.twh-article [class~="text-sand"] { color: #B7A98E; }
/* Cream callout / author boxes → soft neutral instead of cream */
body.twh-article .article-callout { background: #F5F7F3; }
body.twh-article [class~="bg-sand/50"] { background: #F5F7F3; }

/* ---------- Course CTA (conversion block) ---------- */
.course-cta {
  position: relative; overflow: hidden;
  margin: 3rem 0; padding: 2rem 1.75rem;
  border-radius: 1.5rem;
  background: linear-gradient(135deg, #1F534F 0%, #143C39 100%);
  color: #FAF5EE;
  box-shadow: 0 26px 50px -26px rgba(20,60,57,.7);
}
.course-cta::before {
  content: ''; position: absolute; top: -45%; right: -12%;
  width: 300px; height: 300px; border-radius: 50%;
  background: radial-gradient(circle, rgba(229,154,69,.35), transparent 70%);
  pointer-events: none;
}
.course-cta > * { position: relative; }
.course-cta__tag {
  display: inline-block; font-size: .75rem; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; color: #E59A45;
}
.course-cta__title {
  margin-top: .55rem; font-family: 'Fraunces', Georgia, serif; font-weight: 600;
  font-size: clamp(1.4rem, 1.1rem + 1.3vw, 1.8rem); line-height: 1.25; color: #FAF5EE;
}
.course-cta__lead { margin-top: .85rem; font-size: 1rem; line-height: 1.7; color: rgba(250,245,238,.92); }
.course-cta__lead strong { color: #fff; }
.course-cta__list { margin-top: 1.15rem; display: grid; gap: .55rem; }
.course-cta__list li { position: relative; padding-left: 1.55rem; font-size: .95rem; line-height: 1.55; color: rgba(250,245,238,.9); }
.course-cta__list li::before { content: ''; position: absolute; left: 0; top: .5em; width: .62rem; height: .62rem; border-radius: 50%; background: #A3B18A; }
.course-cta__list em { color: #EBD9A6; }
.course-cta__foot { margin-top: 1.6rem; display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; }
.course-cta__price { display: flex; flex-direction: column; line-height: 1.15; }
.course-cta__now { font-family: 'Fraunces', Georgia, serif; font-weight: 600; font-size: 1.7rem; color: #fff; }
.course-cta__was { font-size: .95rem; color: rgba(250,245,238,.5); text-decoration: line-through; }
.course-cta__off { margin-top: .15rem; font-size: .8rem; font-weight: 600; color: #E59A45; }
.course-cta__btn {
  display: inline-flex; align-items: center; gap: .5rem; margin-left: auto;
  padding: .9rem 1.6rem; border-radius: 999px;
  background: #E59A45; color: #2A331E; font-weight: 700; font-size: 1rem;
  box-shadow: 0 12px 26px -10px rgba(229,154,69,.85);
  transition: transform .15s ease, background .2s ease, color .2s ease;
}
.course-cta__btn:hover { background: #C67B4E; color: #fff; transform: translateY(-2px); }
.course-cta__btn svg { width: 1.1rem; height: 1.1rem; }
/* Image integrated as the card's top banner (one unified block) */
.course-cta__img {
  display: block;
  width: calc(100% + 3.5rem);
  height: 208px;
  margin: -2rem -1.75rem 1.4rem;
  object-fit: cover;
  object-position: center 34%;
}
@media (max-width: 639px) {
  .course-cta { padding: 1.6rem 1.25rem; }
  .course-cta__btn { margin-left: 0; width: 100%; justify-content: center; }
  .course-cta__img { width: calc(100% + 2.5rem); height: 168px; margin: -1.6rem -1.25rem 1.2rem; }
}

/* ---------- Blog category filter ---------- */
.blog-filter {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .5rem 1.05rem; border-radius: 999px;
  border: 1px solid #E0D2BC; background: rgba(255,255,255,.85);
  color: #343C27; font-family: inherit; font-size: .9rem; font-weight: 600;
  cursor: pointer; transition: background .2s ease, border-color .2s ease, color .2s ease, transform .12s ease;
}
.blog-filter:hover { border-color: #A3B18A; color: #1F534F; }
.blog-filter:active { transform: scale(.97); }
.blog-filter.is-active { background: #1F534F; border-color: #1F534F; color: #FAF5EE; }
.blog-filter__count {
  display: inline-grid; place-items: center; min-width: 1.25rem; height: 1.25rem; padding: 0 .35rem;
  border-radius: 999px; background: rgba(94,124,86,.15); color: #5E7C56;
  font-size: .72rem; font-weight: 700; line-height: 1;
}
.blog-filter.is-active .blog-filter__count { background: rgba(250,245,238,.22); color: #FAF5EE; }
.blog-hidden { display: none !important; }
.blog-fade { animation: blogFade .35s ease; }
@keyframes blogFade { from { opacity: .35; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .blog-fade { animation: none; } }

/* ---------- Course CTA: hint variant (no price) ---------- */
.course-cta__hint { font-size: .95rem; line-height: 1.5; color: rgba(250,245,238,.9); max-width: 22rem; }
.course-cta__hint strong { color: #E59A45; }

/* ---------- ICD-11 interactive checklist ---------- */
.icd-check { margin: 2rem 0; padding: 1.5rem 1.5rem 1.3rem; border: 1px solid #E1E7DB; border-radius: 1.25rem; background: #F8FAF6; }
.icd-check__intro { font-size: .95rem; line-height: 1.65; color: #343C27; }
.icd-check__group { margin: 1.2rem 0 .4rem; font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #5E7C56; }
.icd-item { display: flex; gap: .8rem; align-items: flex-start; padding: .6rem .7rem; border-radius: .65rem; cursor: pointer; transition: background .15s ease; }
.icd-item:hover { background: rgba(94,124,86,.08); }
.icd-item:has(.icd-box:checked) { background: rgba(94,124,86,.12); }
.icd-box { -webkit-appearance: none; appearance: none; flex: none; width: 1.35rem; height: 1.35rem; margin-top: .12rem; border: 2px solid #BFB69E; border-radius: .4rem; background: #fff; cursor: pointer; position: relative; transition: background .15s ease, border-color .15s ease; }
.icd-box:checked { background: #5E7C56; border-color: #5E7C56; }
.icd-box:checked::after { content: ''; position: absolute; left: 6px; top: 2px; width: 6px; height: 11px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.icd-box:focus-visible { outline: 2px solid #5E7C56; outline-offset: 2px; }
.icd-item span { font-size: .98rem; line-height: 1.5; color: #2A331E; }
.icd-item span b { font-weight: 600; }
.icd-result { margin-top: 1.15rem; padding: 1rem 1.15rem; border-radius: .9rem; background: #fff; border: 1px solid #E1E7DB; transition: background .2s ease, border-color .2s ease; }
.icd-result__count { font-family: 'Fraunces', Georgia, serif; font-weight: 600; font-size: 1.05rem; color: #1F534F; }
.icd-result__count #icdCount { font-size: 1.3rem; }
.icd-result__msg { margin-top: .35rem; font-size: .92rem; line-height: 1.6; color: #343C27; }
.icd-result__msg a { color: #1F534F; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.icd-result.is-alert .icd-result__msg a { color: #B23A2E; }
.icd-result.is-watch { background: #FFF8EE; border-color: #E8C593; }
.icd-result.is-watch .icd-result__count { color: #B06A1F; }
.icd-result.is-alert { background: #FDF1EF; border-color: #E1A99E; }
.icd-result.is-alert .icd-result__count { color: #B23A2E; }
.icd-check__note { margin-top: .8rem; font-size: .8rem; color: #6f7659; }

/* ---------- ICD-11 video companion ---------- */
.icd-video { margin: 2.25rem 0; }
.icd-video__eyebrow { margin-bottom: .6rem; font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #C0392B; }
.icd-video__card { display: flex; gap: 1rem; align-items: center; border: 1px solid #E3D9C8; border-radius: 1rem; overflow: hidden; background: #fff; transition: border-color .2s ease; }
.icd-video__card:hover { border-color: #A3B18A; }
.icd-video__thumb { position: relative; flex: none; width: 184px; aspect-ratio: 16 / 9; background: #143C39; }
.icd-video__thumb img { width: 100%; height: 100%; object-fit: cover; }
.icd-video__play { position: absolute; inset: 0; margin: auto; width: 3rem; height: 3rem; display: grid; place-items: center; border-radius: 999px; background: rgba(192,57,43,.95); color: #fff; box-shadow: 0 8px 18px -8px rgba(0,0,0,.5); }
.icd-video__play svg { width: 1.4rem; height: 1.4rem; margin-left: 2px; }
.icd-video__body { padding: .6rem 1rem .6rem 0; }
.icd-video__title { display: block; font-family: 'Fraunces', Georgia, serif; font-weight: 600; font-size: 1.05rem; line-height: 1.3; color: #2A331E; }
.icd-video__card:hover .icd-video__title { color: #1F534F; }
.icd-video__desc { display: block; margin-top: .35rem; font-size: .88rem; line-height: 1.5; color: #343C27; }
@media (max-width: 559px) {
  .icd-video__card { flex-direction: column; align-items: stretch; }
  .icd-video__thumb { width: 100%; }
  .icd-video__body { padding: 0 1rem 1rem; }
}

/* ---------- ICD-11 download card ---------- */
.icd-dl { display: flex; gap: 1.25rem; align-items: center; margin-top: 1.25rem; padding: 1.25rem; border: 1px solid #E1E7DB; border-radius: 1.25rem; background: #F8FAF6; }
.icd-dl__preview { flex: none; width: 132px; display: block; border-radius: .6rem; overflow: hidden; border: 1px solid #E3D9C8; background: #fff; box-shadow: 0 10px 24px -14px rgba(20,60,57,.45); }
.icd-dl__preview img { width: 100%; display: block; }
.icd-dl__body { flex: 1; min-width: 0; }
.icd-dl__title { font-family: 'Fraunces', Georgia, serif; font-weight: 600; font-size: 1.1rem; color: #2A331E; }
.icd-dl__desc { margin-top: .3rem; font-size: .9rem; line-height: 1.55; color: #343C27; }
.icd-dl__actions { margin-top: .9rem; display: flex; flex-wrap: wrap; align-items: center; gap: .7rem 1.1rem; }
.icd-dl__btn { display: inline-flex; align-items: center; gap: .5rem; padding: .7rem 1.3rem; border-radius: 999px; background: #1F534F; color: #FAF5EE; font-weight: 700; font-size: .95rem; box-shadow: 0 10px 22px -10px rgba(20,60,57,.7); transition: background .2s ease, transform .15s ease; }
.icd-dl__btn:hover { background: #143C39; transform: translateY(-1px); }
.icd-dl__btn svg { width: 1.05rem; height: 1.05rem; }
.icd-dl__link { font-size: .88rem; color: #5E7C56; text-decoration: underline; text-underline-offset: 2px; }
@media (max-width: 559px) {
  .icd-dl { flex-direction: column; align-items: flex-start; }
  .icd-dl__preview { width: 120px; align-self: center; }
}

/* ---------- YouTube channel card (brand red) ---------- */
.yt-card {
  display: flex; align-items: center; gap: 1rem;
  padding: 1.25rem; border-radius: 1.25rem;
  background: linear-gradient(135deg, #FF1A1A 0%, #CC0000 100%);
  color: #fff; box-shadow: 0 14px 30px -14px rgba(204,0,0,.6);
  transition: transform .15s ease, box-shadow .2s ease;
}
.yt-card:hover { transform: translateY(-2px); box-shadow: 0 18px 38px -14px rgba(204,0,0,.72); }
.yt-card__icon { flex: none; width: 3.1rem; }
.yt-card__icon svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 2px 6px rgba(0,0,0,.25)); }
.yt-card__eyebrow { display: block; font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.82); }
.yt-card__title { display: block; margin-top: .15rem; font-family: 'Fraunces', Georgia, serif; font-weight: 600; font-size: 1.15rem; line-height: 1.25; color: #fff; }
.yt-card__desc { display: block; margin-top: .3rem; font-size: .85rem; line-height: 1.45; color: rgba(255,255,255,.9); }
