/* ============================================================
   Mo'Stash — mostash.io design system
   Palette & components per PLAN_DEFI_APP_v6 (site web section)
   ============================================================ */

:root {
  --navy:        #1B2340;
  --navy-deep:   #0F1628;
  --navy-mid:    #141d33;
  --navy-border: #2d3a5c;
  --gold:        #F5A623;
  --gold-muted:  rgba(245, 166, 35, 0.13);
  --teal:        #0D9488;
  --danger:      #EF4444;
  --warning:     #F59E0B;
  --text-light:  #FFFFFF;
  --text-muted:  #8899BB;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 9999px;

  --maxw: 1140px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--navy);
  color: var(--text-muted);
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

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

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

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 1.5rem; }

h1, h2, h3 { color: var(--text-light); font-weight: 600; line-height: 1.2; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.1rem); }
h3 { font-size: 1.15rem; }

.gold { color: var(--gold); }
.teal { color: var(--teal); }

/* ─── Buttons ─────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.85rem 1.6rem; border-radius: var(--radius-pill);
  font-weight: 600; font-size: 0.95rem; cursor: pointer;
  border: 1px solid transparent; transition: all 0.18s ease;
}
.btn-primary { background: var(--gold); color: #000; font-weight: 700; }
.btn-primary:hover { background: #e0911a; transform: translateY(-1px); box-shadow: 0 6px 18px rgba(245, 166, 35, 0.35); }
.btn-ghost { background: transparent; color: var(--text-light); border-color: var(--navy-border); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn-lg { padding: 1rem 2rem; font-size: 1.05rem; }

/* ─── Badge pill ──────────────────────────────────────── */
.pill {
  display: inline-block; padding: 0.35rem 0.9rem;
  background: var(--gold-muted); border: 1px solid var(--gold);
  color: var(--gold); border-radius: var(--radius-pill);
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; margin-bottom: 1.25rem;
}

/* ─── Navbar ──────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(27, 35, 64, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--navy-border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.nav-logo img { height: 38px; }
.nav-links { display: flex; align-items: center; gap: 1.8rem; }
.nav-links a { color: var(--text-muted); font-weight: 500; font-size: 0.93rem; transition: color 0.15s; }
.nav-links a:hover, .nav-links a.active { color: var(--text-light); }
.nav-links a.btn-primary, .nav-links a.btn-primary:hover { color: #000; font-weight: 700; }
.nav-toggle { display: none; background: none; border: 0; color: var(--text-light); font-size: 1.5rem; cursor: pointer; }

/* ─── Nav dropdowns (Product / Resources / Community / Legal) ──── */
.nav-group { position: relative; }
.nav-group-btn {
  background: none; border: 0; cursor: pointer; font: inherit;
  color: var(--text-muted); font-weight: 500; font-size: 0.93rem;
  display: inline-flex; align-items: center; gap: 0.3rem; padding: 0;
  transition: color 0.15s;
}
.nav-group-btn:hover, .nav-group:focus-within .nav-group-btn, .nav-group.open .nav-group-btn { color: var(--text-light); }
.nav-group-btn .chev { font-size: 0.9rem; transition: transform 0.18s; }
.nav-group:hover .chev, .nav-group:focus-within .chev, .nav-group.open .chev { transform: rotate(180deg); }
.nav-dropdown {
  position: absolute; top: 100%; left: 0; min-width: 196px;
  background: var(--navy); border: 1px solid var(--navy-border);
  border-radius: var(--radius-md); padding: 0.5rem; margin-top: 0.5rem;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.4); z-index: 200; display: none;
}
/* Invisible bridge so the panel stays open while the cursor crosses the gap. */
.nav-dropdown::before { content: ""; position: absolute; top: -0.6rem; left: 0; right: 0; height: 0.6rem; }
.nav-group:hover .nav-dropdown, .nav-group:focus-within .nav-dropdown, .nav-group.open .nav-dropdown { display: block; }
.nav-dropdown a {
  display: block; padding: 0.55rem 0.7rem; border-radius: var(--radius-sm);
  color: var(--text-muted); font-size: 0.9rem; font-weight: 500; white-space: nowrap;
  transition: color 0.12s, background 0.12s;
}
.nav-dropdown a:hover, .nav-dropdown a.active { color: var(--text-light); background: var(--navy-mid); }

/* ─── Hero ────────────────────────────────────────────── */
.hero { padding: clamp(3.5rem, 9vw, 6.5rem) 0 clamp(3rem, 7vw, 5rem); text-align: center; }
.hero p.sub { max-width: 640px; margin: 1.3rem auto 2rem; font-size: 1.12rem; color: var(--text-muted); }
.hero-cta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.hero-mascot { width: 92px; margin: 0 auto 1.5rem; }

/* ─── Sections ────────────────────────────────────────── */
.section { padding: clamp(3rem, 7vw, 5rem) 0; }
.section-alt { background: var(--navy-mid); }
.section-head { text-align: center; max-width: 620px; margin: 0 auto 3rem; }
.section-head p { margin-top: 0.8rem; }

/* ─── Feature grid ────────────────────────────────────── */
.grid { display: grid; gap: 1.25rem; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--navy-mid); border: 1px solid var(--navy-border);
  border-radius: var(--radius-lg); padding: 1.75rem;
  transition: transform 0.2s, border-color 0.2s;
}
.card:hover { transform: translateY(-3px); border-color: var(--gold); }
.card .icon { font-size: 1.7rem; color: var(--gold); margin-bottom: 0.9rem; display: block; }
.card h3 { margin-bottom: 0.5rem; }
.card p { font-size: 0.92rem; }

/* ─── Stat cards ──────────────────────────────────────── */
.stats { display: flex; gap: 1.25rem; flex-wrap: wrap; justify-content: center; }
.stat {
  background: var(--navy-mid); border: 1px solid var(--navy-border);
  border-radius: var(--radius-lg); padding: 1.5rem 2rem; text-align: center; min-width: 150px;
}
.stat .val { color: var(--gold); font-size: 1.9rem; font-weight: 700; }
.stat .lbl { color: var(--text-muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; margin-top: 0.3rem; }

/* ─── How-to steps ────────────────────────────────────── */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.step { position: relative; padding: 1.5rem; }
.step .num {
  font-size: 3.2rem; font-weight: 700; color: var(--gold);
  opacity: 0.27; line-height: 1; margin-bottom: 0.5rem;
}
.step h3 { margin-bottom: 0.4rem; }
.step p { font-size: 0.92rem; }

/* ─── Protocol badges ─────────────────────────────────── */
.protocols { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; }
.protocols + .proto-group { margin-top: 2rem; }
.proto-group { text-align: center; color: var(--text-muted); font-size: 0.85rem;
  text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 1rem; }
.proto {
  background: var(--navy-mid); border: 1px solid var(--navy-border);
  border-radius: var(--radius-pill); padding: 0.55rem 1.15rem;
  color: var(--text-muted); font-size: 0.88rem; font-weight: 500;
}

/* ─── Health-factor demo (lending page) ───────────────── */
.hf-demo { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
.hf-card { background: var(--navy-mid); border: 1px solid var(--navy-border); border-radius: var(--radius-lg); padding: 1.6rem; }
.hf-bar { height: 10px; border-radius: var(--radius-pill); background: var(--navy-deep); overflow: hidden; margin: 0.9rem 0; }
.hf-bar > span { display: block; height: 100%; border-radius: var(--radius-pill); }
.hf-val { font-size: 1.6rem; font-weight: 700; }
.hf-safe .hf-val, .hf-safe .hf-bar > span { color: var(--teal); }
.hf-safe .hf-bar > span { background: var(--teal); }
.hf-warn .hf-val { color: var(--warning); }
.hf-warn .hf-bar > span { background: var(--warning); }

/* ─── CTA final ───────────────────────────────────────── */
.cta-final { background: var(--gold); color: var(--navy); text-align: center; padding: clamp(3rem, 7vw, 4.5rem) 0; }
.cta-final h2 { color: var(--navy); }
.cta-final p { color: #5a4410; margin: 0.9rem auto 1.8rem; max-width: 540px; }
.cta-final .btn-primary { background: var(--navy); color: var(--text-light); }
.cta-final .btn-primary:hover { background: var(--navy-deep); }

/* ─── Footer ──────────────────────────────────────────── */
.footer { background: var(--navy-deep); padding: 3rem 0 2rem; border-top: 1px solid var(--navy-border); }
.footer-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 2rem; flex-wrap: wrap; }
.footer-logo img { height: 34px; margin-bottom: 0.8rem; }
.footer-cols { display: flex; gap: 3rem; flex-wrap: wrap; }
.footer-col h4 { color: var(--text-light); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.8rem; }
.footer-col a { display: block; color: var(--text-muted); font-size: 0.9rem; margin-bottom: 0.5rem; transition: color 0.15s; }
.footer-col a:hover { color: var(--gold); }
.footer-bottom { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--navy-border); font-size: 0.82rem; color: var(--text-muted); }

/* ─── Blog ────────────────────────────────────────────── */
.blog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.post-card { background: var(--navy-mid); border: 1px solid var(--navy-border); border-radius: var(--radius-lg); padding: 1.6rem; transition: border-color 0.2s, transform 0.2s; }
.post-card:hover { border-color: var(--gold); transform: translateY(-3px); }
.post-card .kw { color: var(--gold); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; }
.post-card h3 { margin: 0.5rem 0; font-size: 1.1rem; }
.post-card .meta { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.9rem; }

.article { max-width: 760px; margin: 0 auto; padding: 3rem 1.5rem; }
.article header { margin-bottom: 2rem; }
.article h1 { margin-bottom: 0.8rem; }
.article .meta { color: var(--text-muted); font-size: 0.85rem; }
.article-body { color: #c3cce0; font-size: 1.05rem; }
.article-body h2 { margin: 2rem 0 0.8rem; }
.article-body h3 { margin: 1.5rem 0 0.6rem; }
.article-body p { margin-bottom: 1.1rem; }
.article-body ul, .article-body ol { margin: 0 0 1.1rem 1.3rem; }
.article-body li { margin-bottom: 0.4rem; }
.article-body a { color: var(--gold); text-decoration: underline; }
.article-body code { background: var(--navy-mid); padding: 0.15em 0.4em; border-radius: 5px; font-size: 0.9em; }
.article-body blockquote { border-left: 3px solid var(--gold); padding-left: 1rem; margin: 1.2rem 0; color: var(--text-muted); }
.article-body table { width: 100%; border-collapse: collapse; margin: 1.2rem 0; font-size: 0.95rem; }
.article-body th, .article-body td { border: 1px solid var(--navy-border); padding: 0.6rem 0.8rem; text-align: left; }
.article-body th { color: var(--text-light); background: var(--navy-mid); }

/* ─── Lexicon ─────────────────────────────────────────── */
.lex-alpha { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 2rem; justify-content: center; }
.lex-alpha a { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--navy-border); border-radius: var(--radius-sm); color: var(--text-muted); font-weight: 600; font-size: 0.85rem; }
.lex-alpha a:hover { border-color: var(--gold); color: var(--gold); }
.lex-term { background: var(--navy-mid); border: 1px solid var(--navy-border); border-radius: var(--radius-md); padding: 1.3rem 1.5rem; margin-bottom: 1rem; }
.lex-term h3 { color: var(--gold); margin-bottom: 0.4rem; }
.lex-search { width: 100%; max-width: 460px; margin: 0 auto 2rem; display: block; background: var(--navy-mid); border: 1px solid var(--navy-border); border-radius: var(--radius-pill); padding: 0.8rem 1.3rem; color: var(--text-light); font-size: 0.95rem; }
.lex-search:focus { outline: none; border-color: var(--gold); }

/* ─── Pricing ─────────────────────────────────────────── */
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; align-items: stretch; }
.plan {
  background: var(--navy-mid); border: 1px solid var(--navy-border);
  border-radius: var(--radius-lg); padding: 2rem 1.75rem;
  display: flex; flex-direction: column;
}
.plan-featured { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 12px 34px rgba(245, 166, 35, 0.12); }
.plan-badge {
  align-self: flex-start; margin-bottom: 0.9rem;
  background: var(--gold); color: #000; font-size: 0.66rem; font-weight: 700;
  letter-spacing: 0.05em; text-transform: uppercase; padding: 0.3rem 0.8rem;
  border-radius: var(--radius-pill);
}
.plan-name { color: var(--text-light); font-size: 1.15rem; font-weight: 600; }
.plan-price { margin: 0.6rem 0 0.2rem; color: var(--text-light); font-size: 2.4rem; font-weight: 700; line-height: 1; }
.plan-price .per { color: var(--text-muted); font-size: 0.9rem; font-weight: 500; }
.plan-desc { font-size: 0.9rem; margin-bottom: 1.4rem; min-height: 2.6em; }
.plan-features { list-style: none; margin: 0 0 1.6rem; display: grid; gap: 0.6rem; }
.plan-features li { display: flex; gap: 0.55rem; align-items: flex-start; font-size: 0.9rem; }
.plan-features li i { color: var(--teal); font-size: 1rem; margin-top: 0.1rem; flex-shrink: 0; }
.plan-features li.off { color: var(--text-muted); }
.plan-features li.off i { color: var(--navy-border); }
.plan .btn { margin-top: auto; width: 100%; justify-content: center; }
.pricing-note { text-align: center; color: var(--text-muted); font-size: 0.84rem; margin-top: 1.6rem; }

/* ─── Calculator ──────────────────────────────────────── */
.calc-form { background: var(--navy-mid); border: 1px solid var(--navy-border); border-radius: var(--radius-lg); padding: 1.75rem; }
.calc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; margin: 1.1rem 0 1.4rem; }
.calc-row label { display: block; font-size: 0.82rem; color: var(--text-muted); margin-bottom: 0.45rem; font-weight: 500; }
.calc-row label .muted { opacity: 0.7; }
.calc-row select, .calc-amount {
  width: 100%; background: var(--navy); border: 1px solid var(--navy-border);
  border-radius: var(--radius-md); padding: 0.7rem 0.9rem; color: var(--text-light);
  font-size: 0.95rem; font-family: inherit;
}
.calc-row select:focus, .calc-amount:focus-within { outline: none; border-color: var(--gold); }
.calc-amount { display: flex; align-items: center; gap: 0.3rem; padding: 0; padding-left: 0.9rem; }
.calc-amount span { color: var(--text-muted); }
.calc-amount input { flex: 1; background: none; border: 0; color: var(--text-light); font-size: 0.95rem; padding: 0.7rem 0.9rem 0.7rem 0.2rem; font-family: inherit; }
.calc-amount input:focus { outline: none; }
input[type="range"] { width: 100%; margin-top: 0.7rem; accent-color: var(--gold); }
.risk-badge { display: inline-block; margin-top: 0.55rem; font-size: 0.72rem; font-weight: 600; padding: 0.22rem 0.65rem; border-radius: var(--radius-pill); border: 1px solid transparent; }
.risk-low { color: var(--teal); border-color: var(--teal); background: rgba(13, 148, 136, 0.12); }
.risk-med { color: var(--warning); border-color: var(--warning); background: rgba(245, 158, 11, 0.12); }
.risk-high { color: var(--danger); border-color: var(--danger); background: rgba(239, 68, 68, 0.14); }

.calc-results { margin-top: 2rem; }
.calc-status { text-align: center; color: var(--text-muted); font-size: 0.85rem; margin-bottom: 1.2rem; }
.calc-headline { text-align: center; margin-bottom: 1.6rem; }
.calc-headline span { display: block; color: var(--text-muted); font-size: 0.95rem; }
.calc-headline strong { font-size: clamp(2.2rem, 6vw, 3.2rem); font-weight: 700; line-height: 1.1; display: block; margin: 0.2rem 0; }
.calc-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.9rem; margin-bottom: 1.4rem; }
.calc-card { background: var(--navy-mid); border: 1px solid var(--navy-border); border-radius: var(--radius-md); padding: 1.1rem; text-align: center; }
.calc-card-hl { border-color: var(--gold); }
.calc-card-lbl { font-size: 0.74rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.calc-card-val { font-size: 1.35rem; font-weight: 700; color: var(--text-light); margin-top: 0.3rem; }
.calc-stats { display: flex; justify-content: center; gap: 1.8rem; flex-wrap: wrap; color: var(--text-muted); font-size: 0.88rem; margin-bottom: 1.6rem; }
.calc-stats strong { color: var(--text-light); margin-left: 0.3rem; }
.calc-chart { background: var(--navy-mid); border: 1px solid var(--navy-border); border-radius: var(--radius-lg); padding: 1.2rem; height: 260px; }
.calc-cta { text-align: center; margin: 2rem 0 0; padding: 2rem 1.5rem; background: var(--gold-muted); border: 1px solid var(--gold); border-radius: var(--radius-lg); }
.calc-cta h3 { font-size: 1.3rem; margin-bottom: 0.4rem; }
.calc-cta p { max-width: 460px; margin: 0 auto 1.3rem; }
.calc-disclaimer { border-left: 3px solid var(--warning); padding: 0.9rem 1.1rem; margin: 2rem 0 0; color: var(--text-muted); font-size: 0.85rem; background: var(--navy-mid); border-radius: 0 var(--radius-md) var(--radius-md) 0; }

/* ─── Embedded waitlist form (reusable, any page) ─────── */
.wl-embed { max-width: 460px; margin: 0 auto; }
.wl-form { display: flex; gap: 0.6rem; }
.wl-form .wl-email {
  flex: 1; min-width: 0; padding: 0.95rem 1.1rem; border-radius: var(--radius-md);
  background: var(--navy-mid); border: 1px solid var(--navy-border);
  color: var(--text-light); font-size: 1rem; font-family: inherit;
}
.wl-form .wl-email::placeholder { color: var(--text-muted); }
.wl-form .wl-email:focus { outline: none; border-color: var(--gold); }
.wl-form .wl-submit { white-space: nowrap; }
.wl-form .wl-submit[disabled] { opacity: 0.6; cursor: default; }
/* Honeypot — off-screen, out of tab order and the a11y tree. */
.wl-hp { position: absolute; left: -9999px; top: -9999px; height: 0; width: 0; opacity: 0; }
.wl-msg { min-height: 1.3rem; margin-top: 0.8rem; font-size: 0.92rem; text-align: center; }
.wl-msg.ok  { color: var(--teal); }
.wl-msg.err { color: var(--danger); }

/* Same form dropped on the gold final-CTA band: white field (the navy button
   is already handled by `.cta-final .btn-primary`). */
.cta-final .wl-form .wl-email { background: #fff; border-color: rgba(0, 0, 0, 0.18); color: var(--navy); }
.cta-final .wl-form .wl-email::placeholder { color: #8a7f66; }
.cta-final .wl-form .wl-email:focus { border-color: var(--navy); }
.cta-final .wl-msg.ok  { color: var(--navy); font-weight: 600; }
.cta-final .wl-msg.err { color: #7a1515; font-weight: 600; }

/* ─── Responsive ──────────────────────────────────────── */
@media (max-width: 860px) {
  .grid-3, .blog-grid, .steps, .pricing-grid { grid-template-columns: 1fr; }
  .calc-grid { grid-template-columns: 1fr; }
  .calc-cards { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .hf-demo { grid-template-columns: 1fr; }
  .nav-links { position: fixed; inset: 68px 0 auto 0; flex-direction: column; background: var(--navy); padding: 1.5rem; gap: 1.2rem; border-bottom: 1px solid var(--navy-border); display: none; }
  .nav-links.open { display: flex; align-items: flex-start; }
  .nav-toggle { display: block; }

  /* Dropdowns become tap-to-expand accordions inside the mobile overlay. */
  .nav-group { width: 100%; }
  .nav-group-btn { width: 100%; justify-content: space-between; padding: 0.4rem 0; font-size: 1rem; }
  .nav-dropdown {
    position: static; min-width: 0; margin: 0.2rem 0 0.4rem; padding: 0 0 0 0.9rem;
    background: transparent; border: 0; box-shadow: none;
  }
  .nav-dropdown::before { display: none; }
  /* No hover on touch — only a tap (the .open class) reveals a panel. */
  .nav-group:hover .nav-dropdown, .nav-group:focus-within .nav-dropdown { display: none; }
  .nav-group.open .nav-dropdown { display: block; }
  .nav-group:hover .chev, .nav-group:focus-within .chev { transform: none; }
  .nav-group.open .chev { transform: rotate(180deg); }
}

@media (max-width: 520px) {
  .wl-form { flex-direction: column; }
}
