@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=DM+Mono:wght@400;500&family=Instrument+Sans:wght@400;500;600&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --ink:       #1a1a14;
  --ink2:      #4a4a3a;
  --ink3:      #8a8a7a;
  --ink4:      #b8b8a8;
  --jade:      #1D9E75;
  --jade-l:    #E1F5EE;
  --jade-m:    #0F6E56;
  --jade-d:    #085041;
  --amber:     #BA7517;
  --amber-l:   #FAEEDA;
  --amber-d:   #633806;
  --red:       #A32D2D;
  --red-l:     #FCEBEB;
  --blue:      #185FA5;
  --blue-l:    #E6F1FB;
  --blue-d:    #0C447C;
  --cream:     #faf9f5;
  --cream2:    #f3f1ea;
  --white:     #ffffff;
  --border:    rgba(0,0,0,0.08);
  --border-m:  rgba(0,0,0,0.13);
  --serif:     'DM Serif Display', Georgia, serif;
  --mono:      'DM Mono', monospace;
  --sans:      'Instrument Sans', system-ui, sans-serif;
}

html { scroll-behavior: smooth; }
body { font-family: var(--sans); background: var(--cream); color: var(--ink); font-size: 15px; line-height: 1.7; -webkit-font-smoothing: antialiased; }

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ── TOPBAR ── */
.topbar {
  background: var(--ink);
  color: rgba(255,255,255,0.55);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 36px;
  overflow: hidden;
}
.topbar-ticker { display: flex; gap: 3rem; animation: ticker 30s linear infinite; white-space: nowrap; }
@keyframes ticker { 0%{transform:translateX(0)} 100%{transform:translateX(-50%)} }
.topbar-right { font-family: var(--mono); font-size: 10px; color: rgba(255,255,255,0.35); white-space: nowrap; flex-shrink: 0; }

/* ── NAV ── */
.site-header { background: var(--ink); position: sticky; top: 0; z-index: 100; }
.site-nav {
  display: flex;
  align-items: stretch;
  padding: 0 2rem;
  max-width: 1200px;
  margin: 0 auto;
}
.nav-logo {
  font-family: var(--serif);
  font-size: 1.25rem;
  color: #fff;
  display: flex;
  align-items: center;
  padding: 14px 0;
  margin-right: 2rem;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}
.nav-logo span { color: var(--jade); }

.nav-links { display: flex; flex: 1; }
.nav-item { position: relative; }
.nav-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 14px;
  height: 100%;
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  transition: color .15s;
  white-space: nowrap;
  border: none;
  background: none;
  font-family: var(--sans);
}
.nav-btn:hover, .nav-btn.active { color: #fff; }
.nav-btn .ch { font-size: 8px; opacity: 0.6; transition: transform .2s; }
.nav-btn.active .ch { transform: rotate(180deg); }

.nav-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.nav-search-box {
  background: rgba(255,255,255,0.07);
  border: 0.5px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  padding: 6px 12px;
  font-family: var(--mono);
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  width: 170px;
  outline: none;
  transition: border-color .15s, background .15s;
}
.nav-search-box:focus { border-color: var(--jade); background: rgba(255,255,255,0.1); color: #fff; }
.nav-search-box::placeholder { color: rgba(255,255,255,0.3); }
.nav-cta {
  background: var(--jade);
  color: #fff;
  font-size: 11px;
  font-family: var(--mono);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 7px 14px;
  border-radius: 4px;
  cursor: pointer;
  transition: background .15s;
}
.nav-cta:hover { background: var(--jade-m); }

/* ── MEGA MENU ── */
.mega {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--white);
  border-bottom: 0.5px solid var(--border);
  z-index: 200;
  box-shadow: 0 8px 32px rgba(0,0,0,0.08);
}
.mega.open { display: block; }
.mega-inner { max-width: 1200px; margin: 0 auto; padding: 1.75rem 2rem; }

/* ── FOOTER ── */
.site-footer {
  background: var(--ink);
  color: rgba(255,255,255,0.45);
  padding: 3rem 2rem 2rem;
  margin-top: 4rem;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 200px 1fr 1fr 1fr;
  gap: 3rem;
}
.footer-logo { font-family: var(--serif); font-size: 1.4rem; color: #fff; margin-bottom: 0.75rem; letter-spacing: -0.02em; }
.footer-logo span { color: var(--jade); }
.footer-tagline { font-size: 12px; line-height: 1.6; margin-bottom: 1.25rem; }
.footer-badge { font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; padding: 4px 8px; border: 0.5px solid rgba(255,255,255,0.15); border-radius: 3px; display: inline-block; color: rgba(255,255,255,0.4); }
.footer-col-title { font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(255,255,255,0.3); margin-bottom: 0.75rem; }
.footer-links { display: flex; flex-direction: column; gap: 6px; }
.footer-link { font-size: 12px; color: rgba(255,255,255,0.45); cursor: pointer; transition: color .15s; }
.footer-link:hover { color: #fff; }
.footer-bottom {
  max-width: 1200px;
  margin: 2rem auto 0;
  padding-top: 1.5rem;
  border-top: 0.5px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 10px;
  color: rgba(255,255,255,0.25);
}

/* ── UTILS ── */
.tag { font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; padding: 3px 8px; border-radius: 3px; display: inline-block; }
.tag-jade { background: var(--jade-l); color: var(--jade-d); }
.tag-amber { background: var(--amber-l); color: var(--amber-d); }
.tag-blue { background: var(--blue-l); color: var(--blue-d); }
.tag-red { background: var(--red-l); color: var(--red); }

.ev-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.ev-strong { background: var(--jade); }
.ev-mod    { background: #5DCAA5; }
.ev-pre    { background: var(--amber); }
.ev-mixed  { background: var(--ink3); }

.section-label { font-family: var(--mono); font-size: 10px; letter-spacing: 0.15em; text-transform: uppercase; color: var(--jade); margin-bottom: 0.75rem; }
.section-title { font-family: var(--serif); font-size: 2rem; letter-spacing: -0.03em; line-height: 1.1; margin-bottom: 0.5rem; }
.section-sub { font-size: 0.9rem; color: var(--ink2); line-height: 1.7; max-width: 540px; }

.btn-primary { background: var(--ink); color: #fff; padding: 0.7rem 1.5rem; font-size: 13px; border-radius: 4px; cursor: pointer; transition: opacity .15s; border: none; font-family: var(--sans); display: inline-block; }
.btn-primary:hover { opacity: 0.85; }
.btn-outline { border: 0.5px solid var(--border-m); color: var(--ink2); padding: 0.7rem 1.5rem; font-size: 13px; border-radius: 4px; cursor: pointer; background: transparent; font-family: var(--sans); display: inline-block; transition: border-color .15s; }
.btn-outline:hover { border-color: var(--ink3); }

/* ── HERB CARD ── */
.herb-card { background: var(--white); border: 0.5px solid var(--border); border-radius: 12px; overflow: hidden; cursor: pointer; transition: border-color .2s, transform .2s; display: flex; flex-direction: column; }
.herb-card:hover { border-color: rgba(0,0,0,0.2); transform: translateY(-2px); }
.herb-card-sketch { height: 170px; background: var(--cream2); display: flex; align-items: center; justify-content: center; border-bottom: 0.5px solid var(--border); flex-shrink: 0; }
.herb-card-sketch svg { width: 130px; height: 130px; }
.herb-card-body { padding: 1rem 1.1rem 1.1rem; flex: 1; display: flex; flex-direction: column; }
.herb-card-name { font-family: var(--serif); font-size: 1.2rem; letter-spacing: -0.02em; line-height: 1.1; margin-bottom: 2px; }
.herb-card-name .zh { font-family: var(--mono); font-size: 0.8rem; color: var(--ink3); font-weight: 400; }
.herb-card-latin { font-size: 11px; color: var(--ink3); font-style: italic; margin-bottom: 0.6rem; }
.herb-card-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 0.7rem; }
.ev-bar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 0.5rem; }
.ev-bar-label { font-family: var(--mono); font-size: 10px; color: var(--ink3); text-transform: uppercase; letter-spacing: 0.06em; white-space: nowrap; }
.ev-track { flex: 1; height: 3px; background: rgba(0,0,0,0.07); border-radius: 2px; }
.ev-fill { height: 3px; border-radius: 2px; }
.ev-fill-s { background: var(--jade); }
.ev-fill-m { background: #5DCAA5; }
.ev-fill-p { background: var(--amber); }
.herb-card-footer { display: flex; justify-content: space-between; align-items: center; border-top: 0.5px solid var(--border); padding-top: 0.6rem; margin-top: auto; }
.herb-card-studies { font-family: var(--mono); font-size: 10px; color: var(--ink3); }
.herb-card-cta { font-size: 12px; color: var(--jade-d); font-weight: 500; }


/* ── HAMBURGER — hidden by default, shown on mobile ── */
.nav-hamburger { display: none; }
/* ══════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════ */

/* ── TOPBAR ── */
@media (max-width: 768px) {
  .topbar { padding: 0 1rem; height: 32px; }
  .topbar-right { display: none; }
}

/* ── NAV ── */
@media (max-width: 1024px) {
  .nav-search-box { width: 130px; }
}
@media (max-width: 900px) {
  .nav-search-box { display: none; }
}
@media (max-width: 768px) {
  .site-nav { padding: 0 1rem; }
  .nav-links { display: none !important; }
  .nav-right .nav-cta { padding: 6px 10px; font-size: 10px; }
  .nav-hamburger { display: flex !important; }
  /* Mobile drawer */
  .nav-mobile-open .nav-links {
    display: flex !important;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: var(--ink);
    padding: 0.5rem 1rem 1.5rem;
    border-top: 0.5px solid rgba(255,255,255,0.08);
    z-index: 500;
  }
  .nav-mobile-open .nav-links .nav-item { width: 100%; }
  .nav-mobile-open .nav-links .nav-btn {
    width: 100%; padding: 13px 0;
    border-bottom: 0.5px solid rgba(255,255,255,0.06);
    font-size: 14px; justify-content: space-between;
  }
  .mega { position: static !important; box-shadow: none; max-height: 60vh; overflow-y: auto; }
  .mega-inner { padding: 1rem; }
}

/* ── FOOTER ── */
@media (max-width: 900px) {
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 2rem; }
}
@media (max-width: 580px) {
  .footer-inner { grid-template-columns: 1fr; gap: 1.75rem; }
  .footer-bottom { flex-direction: column; gap: 6px; text-align: center; }
  .footer-social { flex-wrap: wrap; gap: 0.75rem; }
}

/* ── SHARED SECTION TITLES ── */
@media (max-width: 768px) {
  .section-title { font-size: 1.7rem; }
  .section-sub { font-size: 0.85rem; }
}

/* ── HERB CARD ── */
@media (max-width: 480px) {
  .herb-card-name { font-size: 1.05rem; }
}
