/* ==========================================================
   HerBaryo-ium – public site styles
   Colours are set once here; change them to restyle the site.
   ========================================================== */
:root {
  --green-900: #163a2c;
  --green-800: #1f4d3a;
  --green-600: #2f7a52;
  --green-200: #cfe5c8;
  --green-100: #e7eee2;
  --cream: #f7f4ec;
  --paper: #ffffff;
  --ochre: #c8902e;
  --ink: #1d2420;
  --muted: #5f6b63;
  --line: #dfe3d8;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(22, 58, 44, .06), 0 6px 20px rgba(22, 58, 44, .07);
  --font-head: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--cream);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
main { flex: 1; }
img { max-width: 100%; display: block; }
a { color: var(--green-600); }
a:hover { color: var(--green-800); }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.15; color: var(--green-900); margin: 0 0 .4em; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
p { margin: 0 0 .8em; }
:focus-visible { outline: 3px solid var(--ochre); outline-offset: 2px; }

.container { width: min(1180px, 100% - 2.5rem); margin-inline: auto; }
.narrow { max-width: 760px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--paper); padding: 8px 12px; z-index: 100; }
.skip-link:focus { left: 8px; }
.eyebrow { display: block; text-transform: uppercase; letter-spacing: .12em; font: 600 .75rem/1.4 var(--font-body); color: var(--green-600); margin-bottom: .5rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .75rem 1.5rem; border-radius: 999px; border: 2px solid transparent;
  font: 600 1rem/1 var(--font-body); text-decoration: none; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.btn-sm { padding: .5rem 1rem; font-size: .9rem; }
.btn-primary { background: var(--green-800); color: #fff; }
.btn-primary:hover { background: var(--green-900); color: #fff; }
.btn-outline { border-color: var(--green-800); color: var(--green-800); background: transparent; }
.btn-outline:hover { background: var(--green-800); color: #fff; }
.btn-ghost { color: var(--green-800); background: var(--green-100); }
.btn-ghost:hover { background: var(--green-200); }

/* ---------- Header ---------- */
.site-header { background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; gap: 1.5rem; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; font: 700 1.35rem/1 var(--font-head); color: var(--green-900); }
.site-nav { display: flex; align-items: center; gap: 1.5rem; margin-left: auto; }
.site-nav ul { display: flex; gap: 1.25rem; list-style: none; margin: 0; padding: 0; }
.site-nav a { text-decoration: none; color: var(--ink); font-weight: 600; padding: .3rem 0; border-bottom: 2px solid transparent; }
.site-nav a:hover { color: var(--green-600); }
.site-nav a[aria-current="page"] { color: var(--green-800); border-bottom-color: var(--ochre); }
.header-search { display: flex; align-items: center; gap: .4rem; border: 1.5px solid var(--line); border-radius: 999px; padding: .35rem .9rem; background: var(--cream); color: var(--muted); }
.header-search:focus-within { border-color: var(--green-600); }
.header-search input { border: 0; background: transparent; font: inherit; width: 190px; outline: none; color: var(--ink); }
.nav-toggle { display: none; margin-left: auto; background: none; border: 0; padding: 10px; cursor: pointer; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--green-900); margin: 5px 0; transition: transform .2s, opacity .2s; }

@media (max-width: 960px) {
  .nav-toggle { display: block; }
  .site-nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 1rem;
    background: var(--paper); border-bottom: 1px solid var(--line); padding: 1rem 1.25rem 1.5rem;
    box-shadow: var(--shadow);
  }
  .site-nav.open { display: flex; }
  .site-nav ul { flex-direction: column; gap: .25rem; }
  .site-nav a { display: block; padding: .6rem 0; font-size: 1.1rem; }
  .header-search { order: -1; }
  .header-search input { width: 100%; }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

/* ---------- Home ---------- */
.hero {
  background: var(--cream);
  padding: clamp(3.5rem, 10vw, 7rem) 0;
  text-align: center;
}
.hero-inner { max-width: 760px; }
.hero h1 { font-size: clamp(2.6rem, 8vw, 4.5rem); }
.lead { font-size: 1.2rem; color: var(--muted); max-width: 600px; margin: 0 auto 2rem; }
.hero-search { display: flex; gap: .5rem; max-width: 560px; margin: 0 auto 1.25rem; background: var(--paper); padding: .4rem; border-radius: 999px; box-shadow: var(--shadow); }
.hero-search input { flex: 1; min-width: 0; border: 0; background: transparent; padding: .6rem 1rem; font: inherit; font-size: 1.05rem; outline: none; }
.hero-search-left { margin: 1rem 0 0; }
.hero-actions { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }
.stats { display: flex; justify-content: center; gap: 2rem; list-style: none; padding: 0; margin: 2.5rem 0 0; color: var(--muted); flex-wrap: wrap; }
.stats strong { display: block; font: 700 2rem/1 var(--font-head); color: var(--green-800); }

.section { padding: 4rem 0; background: var(--paper); }
.section-title { font-size: clamp(1.4rem, 3vw, 1.9rem); margin: 2.5rem 0 1rem; }
.section .section-title { text-align: center; margin-top: 0; }
.how-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.25rem; margin-top: 2rem; }
.how-card { display: block; text-decoration: none; color: inherit; background: var(--cream); border-radius: var(--radius); padding: 1.75rem; border: 1px solid var(--line); transition: transform .15s, box-shadow .15s; }
.how-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); color: inherit; }
.how-num { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--green-800); color: #fff; font-weight: 700; margin-bottom: 1rem; }
.how-card p { color: var(--muted); margin: 0; }

/* ---------- Generic page ---------- */
.page { padding: 1.5rem 0 4rem; }
.back-link { display: inline-block; margin-bottom: 1.5rem; text-decoration: none; color: var(--muted); font-weight: 500; }
.back-link:hover { color: var(--green-800); }
.page-head { margin-bottom: 2rem; }
.empty, .empty-state { color: var(--muted); padding: 2rem; text-align: center; background: var(--paper); border-radius: var(--radius); border: 1px dashed var(--line); }
.note { margin-top: 2.5rem; padding: 1rem 1.25rem; border-left: 4px solid var(--ochre); background: #fbf5e8; border-radius: 0 10px 10px 0; color: #5d4a22; font-size: .92rem; }
.card { background: var(--paper); border-radius: var(--radius); padding: 1.25rem 1.5rem; box-shadow: var(--shadow); margin-bottom: 1rem; }
.card-title { font-size: 1.1rem; font-family: var(--font-body); text-transform: uppercase; letter-spacing: .08em; color: var(--green-600); }
.prose { font-size: 1.1rem; }
.tag { display: inline-block; padding: .2rem .75rem; border-radius: 999px; background: var(--green-100); color: var(--green-800); font-size: .9rem; font-weight: 600; margin: 0 .3rem .3rem 0; }
.tag-link { text-decoration: none; }
.tag-link:hover { background: var(--green-200); }
.small-link { font-size: .9rem; }

/* ---------- Barangays ---------- */
.pin { display: inline-block; width: .8em; height: .8em; margin-right: .4em; background: var(--green-800); border-radius: 50% 50% 50% 0; transform: rotate(-45deg); vertical-align: .05em; }
.pin-lg { width: .6em; height: .6em; }
.barangay-list { display: grid; gap: 1.5rem; }
.barangay-row { display: grid; grid-template-columns: 2fr 3fr; gap: 1.5rem; align-items: stretch; }
.barangay-row.flip { grid-template-columns: 3fr 2fr; }
.barangay-row.flip .barangay-map { order: 2; }
.barangay-map { border-radius: var(--radius); overflow: hidden; min-height: 200px; background: var(--green-100); }
.map-frame { width: 100%; height: 100%; min-height: 220px; border: 0; display: block; }
.map-empty { height: 100%; min-height: 200px; display: grid; place-content: center; justify-items: center; gap: .4rem; color: #7a9580; font-size: .9rem; }
.barangay-card { display: block; text-decoration: none; color: inherit; background: var(--paper); border-radius: var(--radius); padding: 1.5rem 1.75rem; box-shadow: var(--shadow); border: 1.5px solid transparent; transition: border-color .15s, transform .15s; }
.barangay-card:hover { border-color: var(--green-600); transform: translateY(-2px); color: inherit; }
.barangay-card h2 { font-size: 1.5rem; }
.address { color: var(--muted); font-size: .92rem; margin-bottom: .5rem; }
.desc { font-size: 1.05rem; }
.count { color: var(--green-800); margin: 0; }
.arrow { transition: margin .15s; }
.barangay-card:hover .arrow { margin-left: .3rem; }

.barangay-head { display: grid; grid-template-columns: 1fr minmax(0, 420px); gap: 2rem; align-items: start; padding-bottom: 1.5rem; border-bottom: 1px solid var(--line); }
.barangay-head:not(:has(.barangay-head-map)) { grid-template-columns: 1fr; }
.barangay-head-map { border-radius: var(--radius); overflow: hidden; height: 220px; }

.plant-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; }
.plant-pill { display: flex; align-items: center; gap: 1rem; text-decoration: none; color: inherit; background: var(--paper); border-radius: 999px 22px 22px 999px; padding: .5rem 1.5rem .5rem .5rem; box-shadow: var(--shadow); border: 1.5px solid transparent; transition: border-color .15s; }
.plant-pill:hover { border-color: var(--green-600); color: inherit; }
.plant-pill img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--green-100); }
.plant-pill strong { display: block; font-size: 1.1rem; color: var(--green-900); }
.plant-pill em { color: var(--muted); font-size: .92rem; }

@media (max-width: 760px) {
  .barangay-row, .barangay-row.flip, .barangay-head { grid-template-columns: 1fr; }
  .barangay-row.flip .barangay-map { order: 0; }
  .barangay-map, .map-empty { min-height: 140px; }
  .barangay-map:has(.map-empty) { display: none; }
  .map-frame { min-height: 180px; }
  .plant-list { grid-template-columns: 1fr; }
}

/* ---------- Plant page ---------- */
.plant-top { display: grid; grid-template-columns: minmax(0, 380px) 1fr; gap: 2.5rem; align-items: start; }
.plant-photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow); background: var(--green-100); margin-bottom: 1rem; }
.plant-photo { text-align: center; }
.plant-photo h1 { font-size: clamp(1.9rem, 4vw, 2.5rem); margin-bottom: .1em; }
.other-names { color: var(--muted); margin: 0; }
.sci { font-size: 1.15rem; margin: .2rem 0 0; }
.family { color: var(--muted); }
.pill-row { margin-bottom: .75rem; display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; background: var(--paper); padding: .5rem .5rem .5rem 1.1rem; border-radius: 999px; box-shadow: var(--shadow); width: fit-content; }
.pill-row .tag { margin: 0; }
.label { font-weight: 600; margin-right: .3rem; }
.tag-row { margin: 0; }

.accordion { margin-top: 2.5rem; background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); }
.accordion summary { list-style: none; cursor: pointer; padding: 1.1rem 1.5rem; display: flex; align-items: center; justify-content: space-between; }
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary h2 { margin: 0; font-size: 1.35rem; }
.accordion summary::after { content: ""; width: 10px; height: 10px; border-right: 2px solid var(--green-800); border-bottom: 2px solid var(--green-800); transform: rotate(45deg); transition: transform .2s; }
.accordion[open] summary::after { transform: rotate(-135deg); }
.accordion > :not(summary) { padding: 0 1.5rem 1.5rem; }

@media (max-width: 860px) {
  .plant-top { grid-template-columns: 1fr; gap: 1.5rem; }
  .pill-row { width: 100%; border-radius: 18px; }
}

/* ---------- Tables (turn into cards on phones) ---------- */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; background: var(--paper); border-radius: 12px; overflow: hidden; }
.data-table th { text-align: left; background: var(--green-800); color: #fff; font-weight: 600; padding: .75rem 1rem; font-size: .9rem; }
.data-table td { padding: .85rem 1rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tr.highlight td { background: #fbf5e8; }
.plant-cell { display: flex; gap: .75rem; align-items: center; text-decoration: none; color: inherit; }
.plant-cell img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.result-block { margin-bottom: 2rem; }

@media (max-width: 760px) {
  .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
  .data-table thead { display: none; }
  .data-table { background: none; }
  .data-table tr { background: var(--paper); border-radius: 14px; box-shadow: var(--shadow); margin-bottom: 1rem; padding: .5rem 0; }
  .data-table td { border: 0; padding: .45rem 1.1rem; }
  .data-table td::before { content: attr(data-label); display: block; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--green-600); font-weight: 600; }
}

/* ---------- Catalogue ---------- */
.filter-row { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin-bottom: 2rem; }
.chip { padding: .45rem 1rem; border-radius: 999px; background: var(--paper); border: 1.5px solid var(--line); text-decoration: none; color: var(--ink); font-weight: 500; font-size: .95rem; }
.chip:hover { border-color: var(--green-600); color: var(--green-800); }
.chip[aria-current="true"] { background: var(--green-800); color: #fff; border-color: var(--green-800); }
.catalogue-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.25rem; }
.specimen-card { all: unset; box-sizing: border-box; cursor: pointer; background: var(--paper); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; border: 1.5px solid transparent; transition: transform .15s, border-color .15s; }
.specimen-card:hover { transform: translateY(-3px); border-color: var(--green-600); }
.specimen-card:focus-visible { outline: 3px solid var(--ochre); }
.specimen-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--green-100); }
.specimen-text { padding: 1rem 1.1rem 1.2rem; display: flex; flex-direction: column; gap: .15rem; }
.specimen-text strong { font: 700 1.2rem/1.2 var(--font-head); color: var(--green-900); }
.specimen-text em { color: var(--muted); font-size: .92rem; }
.cert-status { margin-top: .5rem; font-size: .8rem; font-weight: 600; color: var(--muted); }
.cert-status.ok { color: var(--green-600); }
@media (max-width: 520px) { .catalogue-grid { grid-template-columns: 1fr 1fr; gap: .75rem; } .specimen-text strong { font-size: 1rem; } }

/* ---------- Certificate popup ---------- */
.cert-dialog { width: min(980px, 100% - 2rem); max-height: calc(100vh - 2rem); padding: 0; border: 0; border-radius: 20px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); color: var(--ink); }
.cert-dialog::backdrop { background: rgba(22, 32, 26, .6); }
.cert-dialog[open] { display: flex; flex-direction: column; }
.cert-head { display: flex; justify-content: space-between; gap: 1rem; padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--line); }
.cert-head h2 { margin: 0; font-size: 1.6rem; }
.cert-head .names { margin: 0; color: var(--muted); }
.dialog-close { flex-shrink: 0; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--green-100); font-size: 1.1rem; cursor: pointer; color: var(--green-900); }
.dialog-close:hover { background: var(--green-200); }
.cert-body { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; padding: 1.25rem 1.5rem; overflow-y: auto; }
.cert-body figure { margin: 0; }
.cert-body figcaption { font-weight: 600; color: var(--green-800); margin-bottom: .5rem; }
.cert-body img { width: 100%; border-radius: 12px; border: 1px solid var(--line); background: var(--cream); }
.cert-pdf { width: 100%; height: 60vh; border-radius: 12px; border: 1px solid var(--line); }
.file-empty { display: grid; place-items: center; aspect-ratio: 4 / 3; border-radius: 12px; border: 2px dashed var(--line); color: var(--muted); background: var(--cream); text-align: center; padding: 1rem; }
.cert-foot { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding: 1rem 1.5rem 1.25rem; border-top: 1px solid var(--line); }
.cert-foot p { margin: 0; }
.cert-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
body.dialog-open { overflow: hidden; }
@media (max-width: 700px) {
  .cert-dialog { width: 100%; max-width: 100%; height: 100%; max-height: 100%; border-radius: 0; margin: 0; }
  .cert-body { grid-template-columns: 1fr; flex: 1; }
}

/* ---------- Ailments ---------- */
.letter-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: .35rem; margin-bottom: 2rem; }
.letter-nav a { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--paper); text-decoration: none; font-weight: 700; color: var(--green-800); box-shadow: var(--shadow); }
.letter-nav a:hover { background: var(--green-800); color: #fff; }
.letter-group { margin-bottom: 2rem; scroll-margin-top: 90px; }
.letter-group h2 { font-size: 1.6rem; border-bottom: 2px solid var(--green-200); padding-bottom: .3rem; }
.ailment-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .85rem; }
.ailment-card { display: flex; flex-direction: column; gap: .1rem; background: var(--paper); border-radius: 14px; padding: 1rem 1.2rem; text-decoration: none; color: inherit; box-shadow: var(--shadow); border: 1.5px solid transparent; }
.ailment-card:hover { border-color: var(--green-600); color: inherit; }
.ailment-card strong { font-size: 1.1rem; color: var(--green-900); }
.ailment-card .count { font-size: .85rem; color: var(--green-600); margin-top: .3rem; }

/* ---------- Contact ---------- */
.team-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.5rem; margin-top: 3rem; }
.team-card { background: var(--paper); border-radius: var(--radius); padding: 3.5rem 1.5rem 1.5rem; text-align: center; box-shadow: var(--shadow); position: relative; }
.team-card .avatar { position: absolute; top: -40px; left: 50%; transform: translateX(-50%); width: 84px; height: 84px; border-radius: 50%; background: var(--green-800); border: 4px solid var(--cream); display: grid; place-items: center; overflow: hidden; }
.team-card .avatar span { color: #fff; font: 700 1.8rem/1 var(--font-head); }
.team-card .avatar img { width: 100%; height: 100%; object-fit: cover; }
.team-card h2 { font-size: 1.3rem; }
.team-card .role { color: var(--green-600); font-weight: 600; font-size: .92rem; }
.team-card p { color: var(--muted); }
.contact-box { margin-top: 3rem; padding: 1.75rem; background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); }
.contact-box h2 { font-size: 1.4rem; }
@media (max-width: 520px) { .team-grid { grid-template-columns: 1fr 1fr; gap: 3rem 1rem; } .team-card { padding: 3.25rem 1rem 1.25rem; } }

/* ---------- Footer ---------- */
.site-footer { background: var(--green-900); color: #dfe8df; padding: 2.5rem 0 1.25rem; margin-top: auto; }
.footer-inner { display: grid; grid-template-columns: 2fr 1fr; gap: 2rem; }
.brand-footer { color: #fff; margin-bottom: 1rem; }
.disclaimer { font-size: .9rem; color: #b9c9bc; max-width: 560px; }
.footer-links { display: flex; flex-direction: column; gap: .35rem; }
.footer-links a { color: #dfe8df; text-decoration: none; }
.footer-links a:hover { color: #fff; text-decoration: underline; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .12); margin-top: 1.5rem; padding-top: 1rem; font-size: .85rem; color: #9fb3a4; }
@media (max-width: 700px) { .footer-inner { grid-template-columns: 1fr; } }

/* ==========================================================
   Home page animations
   (all switched off for visitors who prefer reduced motion)
   ========================================================== */
.hero { position: relative; overflow: hidden; isolation: isolate; }
.hero-inner { position: relative; z-index: 1; }
.hero-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; }

/* Soft colour blobs that drift slowly */
.blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; }
.blob-1 { width: 420px; height: 420px; background: #b9dcbf; left: -120px; top: -80px; animation: blob-move 18s ease-in-out infinite alternate; }
.blob-2 { width: 360px; height: 360px; background: #f0d59b; right: -100px; bottom: -120px; animation: blob-move 22s ease-in-out infinite alternate-reverse; }
@keyframes blob-move {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(60px, 40px) scale(1.12); }
  100% { transform: translate(-30px, 70px) scale(.95); }
}

/* Falling, swaying leaves */
.leaf {
  position: absolute; top: -60px; left: var(--x);
  width: var(--size); height: var(--size);
  animation: leaf-fall var(--dur) linear var(--delay) infinite;
  opacity: 0;
}
.leaf svg { width: 100%; height: 100%; display: block; animation: leaf-sway calc(var(--dur) / 4) ease-in-out var(--delay) infinite alternate; }
.leaf-a { color: #7fb98c; }
.leaf-b { color: #a9cf9f; }
.leaf-c { color: #d9b25e; }
@keyframes leaf-fall {
  0%   { transform: translateY(0); opacity: 0; }
  10%  { opacity: .75; }
  85%  { opacity: .75; }
  100% { transform: translateY(820px); opacity: 0; }
}
@keyframes leaf-sway {
  0%   { transform: translateX(-24px) rotate(-35deg); }
  100% { transform: translateX(24px) rotate(40deg); }
}

/* Hero content rises in, one piece after another */
.js .rise { opacity: 0; animation: rise .8s cubic-bezier(.2, .7, .2, 1) forwards; animation-delay: calc(var(--i, 0) * 110ms + 100ms); }
@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}

/* Gentle pulse on the Explore button so the eye finds it */
.hero-actions .btn-outline { position: relative; }
.hero-actions .btn-outline::after {
  content: ""; position: absolute; inset: -2px; border-radius: inherit;
  border: 2px solid var(--green-600); opacity: 0;
  animation: ring 2.8s ease-out 1.6s infinite;
}
@keyframes ring {
  0%   { opacity: .6; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.18); }
}

/* Sections slide in when scrolled into view */
.js [data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1); transition-delay: calc(var(--i, 0) * 120ms); }
.js [data-reveal].is-visible { opacity: 1; transform: none; }
.how-card .how-num { transition: transform .3s; }
.how-card:hover .how-num { transform: rotate(-10deg) scale(1.12); }

@media (max-width: 700px) {
  .leaf:nth-child(n+8) { display: none; } /* fewer leaves on small screens */
  .blob { filter: blur(45px); }
}

@media (prefers-reduced-motion: reduce) {
  .leaf, .blob, .hero-actions .btn-outline::after { animation: none !important; }
  .leaf { display: none; }
  .js .rise { animation: none; opacity: 1; }
  .js [data-reveal] { opacity: 1; transform: none; transition: none; }
}

/* ---------- Precautions ---------- */
.warning-box { display: flex; gap: .9rem; align-items: flex-start; background: #fdecea; border: 1.5px solid #e8a9a2; border-left: 6px solid #b3261e; color: #6b1a14; border-radius: 14px; padding: 1rem 1.25rem; margin-bottom: 1rem; scroll-margin-top: 90px; }
.warning-box svg { color: #b3261e; flex-shrink: 0; margin-top: .1rem; }
.warning-box h2 { font: 700 1rem/1.3 var(--font-body); text-transform: uppercase; letter-spacing: .08em; color: #b3261e; margin: 0 0 .35rem; }
.warning-box p { margin: 0 0 .4rem; }
.warning-box p:last-child { margin-bottom: 0; }
.no-precautions { font-size: .9rem; color: var(--muted); background: var(--paper); border-radius: 12px; padding: .7rem 1rem; border: 1px dashed var(--line); scroll-margin-top: 90px; }
.warn-flag { display: inline-block; margin-top: .35rem; font-size: .8rem; font-weight: 700; color: #b3261e; text-decoration: none; }
a.warn-flag:hover { text-decoration: underline; color: #8a1c15; }
.warn-inline { margin: 0 0 .75rem; font-size: .92rem; }
.warn-inline a { color: inherit; }

/* ---------- Ailment categories ---------- */
.view-toggle { display: flex; justify-content: center; gap: .25rem; margin: -1rem auto 2rem; background: var(--paper); border-radius: 999px; padding: .3rem; width: fit-content; box-shadow: var(--shadow); }
.view-toggle a { padding: .45rem 1.1rem; border-radius: 999px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: .92rem; }
.view-toggle a[aria-current="true"] { background: var(--green-800); color: #fff; }
.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 1rem; margin-bottom: 2.5rem; }
.category-card { display: flex; flex-direction: column; gap: .2rem; padding: 1.2rem 1.3rem; border-radius: var(--radius); background: var(--green-800); color: #e7eee2; text-decoration: none; transition: transform .15s, background .15s; }
.category-card:hover { transform: translateY(-3px); background: var(--green-900); color: #fff; }
.category-card strong { font: 700 1.2rem/1.2 var(--font-head); color: #fff; }
.category-card span { font-size: .88rem; opacity: .85; }
.category-card em { font-style: normal; font-size: .82rem; font-weight: 600; color: #e1b65a; margin-top: .4rem; }
.letter-group h2 a { color: inherit; text-decoration: none; }
.letter-group h2 a:hover { color: var(--green-600); }
.eyebrow a { color: inherit; }
@media (max-width: 520px) { .category-grid { grid-template-columns: 1fr 1fr; gap: .75rem; } .category-card { padding: 1rem; } }

/* ---------- Homepage background video ---------- */
.hero--video { background: var(--green-900); color: #fff; min-height: min(88vh, 760px); display: flex; align-items: center; }
.hero--video .hero-inner { width: min(1180px, 100% - 2.5rem); }
.hero-media { position: absolute; inset: 0; z-index: 0; overflow: hidden; background: var(--green-900); }
.hero-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; opacity: var(--video-opacity, .35); }
.hero-shade { position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(14, 36, 27, .35) 0%, rgba(14, 36, 27, .1) 70%), linear-gradient(180deg, rgba(14, 36, 27, .15) 0%, rgba(14, 36, 27, .45) 100%); }
.hero--video h1 { color: #fff; text-shadow: 0 2px 24px rgba(0, 0, 0, .35); }
.hero--video .eyebrow { color: #cfe5c8; }
.hero--video .lead { color: rgba(255, 255, 255, .9); }
.hero--video .stats { color: rgba(255, 255, 255, .8); }
.hero--video .stats strong { color: #fff; }
.hero--video .btn-outline { border-color: #fff; color: #fff; }
.hero--video .btn-outline:hover { background: #fff; color: var(--green-900); }
.hero--video .btn-outline::after { border-color: #fff; }
.hero--video .btn-ghost { background: rgba(255, 255, 255, .16); color: #fff; backdrop-filter: blur(4px); }
.hero--video .btn-ghost:hover { background: rgba(255, 255, 255, .28); }
.video-toggle { position: absolute; right: 1rem; bottom: 1rem; z-index: 2; width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .5); background: rgba(0, 0, 0, .35); color: #fff; display: grid; place-items: center; cursor: pointer; }
.video-toggle:hover { background: rgba(0, 0, 0, .55); }
.video-toggle .i-play { display: none; }
.video-toggle[aria-pressed="true"] .i-pause { display: none; }
.video-toggle[aria-pressed="true"] .i-play { display: block; }
