/* MN Marketing LAB — design tokens & shared styles */

:root{
  --bg: #0b1140;
  --bg-2: #131a52;
  --panel: #161d5c;
  --panel-2: #1c2570;
  --line: rgba(180, 190, 255, .16);
  --line-strong: rgba(180, 190, 255, .3);

  --pink: #ff4fa3;
  --pink-soft: #ff8ec4;
  --pink-glow: rgba(255, 79, 163, .4);

  --orange: #ff8a3d;
  --orange-soft: #ffb066;
  --orange-glow: rgba(255, 138, 61, .4);

  /* secondary accents, echoing the flask liquids in the founders illustration */
  --teal: #4fd6e0;
  --teal-soft: #8ee8ef;
  --teal-glow: rgba(79, 214, 224, .3);

  --gold: var(--orange);
  --gold-soft: var(--orange-soft);
  --gold-glow: var(--orange-glow);
  --amber: var(--orange);

  --text: #f3f2ff;
  --muted: #a7aee0;
  --muted-2: #7b82bd;

  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 26px;

  /* layered shadows read as depth rather than a flat blur */
  --shadow-sm: 0 1px 2px rgba(4,7,30,.5), 0 6px 16px rgba(4,7,30,.35);
  --shadow: 0 2px 4px rgba(4,7,30,.4), 0 12px 28px rgba(4,7,30,.42), 0 28px 60px rgba(4,7,30,.35);
  --shadow-lg: 0 4px 8px rgba(4,7,30,.4), 0 20px 44px rgba(4,7,30,.45), 0 44px 90px rgba(4,7,30,.4);

  --ease: cubic-bezier(.22,.61,.36,1);

  --font: "Rubik", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*{ box-sizing: border-box; }
html,body{ margin:0; padding:0; }
html{ scroll-behavior: smooth; }
body{
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ambient lab background: nebula glows + constellation dots */
body::before{
  content:"";
  position: fixed; inset: 0; z-index: -2;
  background:
    radial-gradient(900px 500px at 12% -5%, rgba(255,79,163,.16), transparent 60%),
    radial-gradient(700px 500px at 100% 10%, rgba(255,138,61,.16), transparent 55%),
    radial-gradient(1000px 700px at 50% 120%, rgba(79,214,224,.12), transparent 60%),
    var(--bg);
}
body::after{
  content:"";
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .55;
  background-image:
    radial-gradient(1.5px 1.5px at 20% 30%, var(--pink-soft) 0%, transparent 60%),
    radial-gradient(1.5px 1.5px at 75% 15%, var(--teal-soft) 0%, transparent 60%),
    radial-gradient(1px 1px at 60% 65%, var(--orange-soft) 0%, transparent 60%),
    radial-gradient(1px 1px at 90% 80%, var(--teal-soft) 0%, transparent 60%),
    radial-gradient(1.5px 1.5px at 35% 85%, var(--pink-soft) 0%, transparent 60%),
    radial-gradient(1px 1px at 10% 60%, var(--orange-soft) 0%, transparent 60%);
  background-repeat: no-repeat;
}

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

h1,h2,h3,h4{ font-family: var(--font); font-weight: 800; margin: 0; letter-spacing: -.35px; line-height: 1.25; }
h1{ letter-spacing: -.8px; }

::selection{ background: var(--pink); color: #fff; }

:focus-visible{
  outline: 2px solid var(--teal);
  outline-offset: 3px;
  border-radius: 6px;
}

.container{ max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* nav */
.nav{
  position: sticky; top: 0; z-index: 40;
  background: rgba(11,17,64,.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.nav-inner{
  max-width: 1120px; margin: 0 auto; padding: 14px 24px;
  display:flex; align-items:center; justify-content: space-between; gap: 16px;
}
.brand{ display:flex; align-items:center; gap: 10px; font-weight: 800; font-size: 17px; letter-spacing:-.3px; }
.brand .flask{ font-size: 20px; filter: drop-shadow(0 0 10px var(--pink-glow)); }
.brand b{
  background: linear-gradient(135deg, var(--pink-soft), var(--orange-soft));
  -webkit-background-clip:text; background-clip:text; color: transparent;
}
.nav-links{ display:flex; align-items:center; gap: 26px; font-size: 14.5px; color: var(--muted); }
.nav-links a{ position:relative; padding: 4px 0; transition: color .2s var(--ease); }
.nav-links a::after{
  content:""; position:absolute; inset-inline:0; bottom:-2px; height:2px; border-radius:2px;
  background: linear-gradient(90deg, var(--pink), var(--orange));
  transform: scaleX(0); transform-origin: center; transition: transform .25s var(--ease);
}
.nav-links a:hover{ color: var(--text); }
.nav-links a:hover::after{ transform: scaleX(1); }
.nav-user{ display:flex; align-items:center; gap: 12px; font-size: 13.5px; color: var(--muted); }

.hamburger-btn{
  display:none; background: rgba(255,255,255,.04); border: 1px solid var(--line-strong); border-radius: 10px;
  color: var(--text); font-size: 18px; width: 38px; height: 38px; cursor: pointer;
  align-items:center; justify-content:center; flex:none;
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
.hamburger-btn:hover{ border-color: var(--pink); background: rgba(255,79,163,.1); }
.mobile-menu{
  display:none; flex-direction:column; gap: 4px;
  position: fixed; top: 66px; inset-inline: 14px; z-index: 50;
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line); border-radius: 16px; padding: 10px;
  box-shadow: var(--shadow);
}
.mobile-menu.open{ display:flex; animation: menu-in .22s var(--ease); }
@keyframes menu-in{ from{ opacity:0; transform: translateY(-8px); } to{ opacity:1; transform:none; } }
.mobile-menu a{
  padding: 13px 14px; border-radius: 10px; font-size: 14.5px; font-weight: 700; color: var(--text);
  transition: background .18s var(--ease), color .18s var(--ease);
}
.mobile-menu a:hover{ background: rgba(255,255,255,.06); color: var(--pink-soft); }

/* buttons */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding: 13px 26px; border-radius: 999px; font-weight: 700; font-size: 14.5px;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease);
  font-family: var(--font); letter-spacing: -.1px; white-space: nowrap;
}
.btn:active{ transform: translateY(1px) scale(.99); }
.btn-primary{
  background: linear-gradient(135deg, var(--pink), var(--orange));
  color: #fff; box-shadow: 0 8px 22px var(--pink-glow), 0 4px 12px var(--orange-glow);
  text-shadow: 0 1px 2px rgba(0,0,0,.15);
}
.btn-primary:hover{ transform: translateY(-2px); box-shadow: 0 14px 34px var(--pink-glow), 0 8px 20px var(--orange-glow); }
.btn-ghost{
  background: rgba(255,255,255,.04); border-color: var(--line-strong); color: var(--text);
}
.btn-ghost:hover{ border-color: var(--pink); color: var(--pink-soft); background: rgba(255,79,163,.08); transform: translateY(-2px); }
.btn-danger{ background: rgba(220,90,80,.16); color:#ffb3a8; border-color: rgba(220,90,80,.4); }
.btn-danger:hover{ background: rgba(220,90,80,.24); }
.btn-sm{ padding: 8px 16px; font-size: 13px; }
.btn[disabled]{ opacity:.5; cursor:not-allowed; transform:none !important; }

/* cards / panels */
.card{
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  position: relative;
}
/* hairline highlight along the top edge — reads as a lit surface */
.card::before{
  content:""; position:absolute; inset-inline: 16%; top:0; height:1px; border-radius:1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.22), transparent);
  pointer-events:none;
}
.card-pad{ padding: 28px; }

.eyebrow{
  display:inline-flex; align-items:center; gap:8px;
  background: rgba(255,138,61,.12); border: 1px solid rgba(255,138,61,.35);
  color: var(--orange-soft); font-size: 12.5px; font-weight: 800; letter-spacing: .5px;
  padding: 7px 16px; border-radius: 999px;
  box-shadow: 0 4px 14px rgba(255,138,61,.14);
}

/* forms */
.field{ display:flex; flex-direction:column; gap:7px; margin-bottom:16px; text-align:right; }
.field label{ font-size: 13px; color: var(--muted); font-weight:600; }
.field input, .field textarea, .field select{
  background: rgba(255,255,255,.035); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: 13px 15px; color: var(--text); font-family: var(--font); font-size: 14.5px;
  outline: none; transition: border-color .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease);
}
.field input::placeholder, .field textarea::placeholder{ color: var(--muted-2); }
.field input:focus, .field textarea:focus, .field select:focus{
  border-color: var(--teal); background: rgba(255,255,255,.05);
  box-shadow: 0 0 0 3px var(--teal-glow);
}
.field textarea{ resize: vertical; min-height: 90px; }

.consent-row{
  display:flex; align-items:flex-start; gap:10px; text-align:right;
  font-size:12.5px; color: var(--muted); line-height:1.7; cursor:pointer;
  padding: 13px 15px; border-radius: var(--radius-sm);
  border:1px solid var(--line); background: rgba(255,255,255,.025);
  margin-bottom: 14px;
}
.consent-row input{ width:17px; height:17px; flex:none; margin-top:2px; accent-color: var(--pink); }
.consent-row a{ color: var(--teal-soft); border-bottom:1px solid rgba(79,214,224,.4); }
.consent-row a:hover{ color: var(--text); }

.hint{ font-size: 12.5px; color: var(--muted-2); }
.error-text{ font-size: 13px; color: #ffb3a8; }
.success-text{ font-size: 13px; color: #7fd8a8; }

/* chapter grid */
.chapters-grid{ display:grid; grid-template-columns: repeat(auto-fill, minmax(268px,1fr)); gap: 20px; }
.chapter-card{
  position: relative; padding: 26px; border-radius: var(--radius-lg);
  background: linear-gradient(160deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line); overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .22s var(--ease), border-color .22s var(--ease), box-shadow .22s var(--ease);
}
/* accent bar that fills in on hover */
.chapter-card::after{
  content:""; position:absolute; inset-inline:0; bottom:0; height:3px;
  background: linear-gradient(90deg, var(--pink), var(--orange));
  transform: scaleX(0); transform-origin: inline-start; transition: transform .3s var(--ease);
}
.chapter-card:hover{ transform: translateY(-4px); border-color: var(--line-strong); box-shadow: var(--shadow); }
.chapter-card:hover::after{ transform: scaleX(1); }
.chapter-card .num{
  display:inline-flex; align-items:center; justify-content:center;
  width: 44px; height: 44px; border-radius: 14px;
  font-size: 16px; font-weight: 900; letter-spacing: -.5px;
  color: var(--orange-soft);
  background: rgba(255,138,61,.12);
  border: 1px solid rgba(255,138,61,.3);
  margin-bottom: 16px;
}
.chapter-card h3{ font-size: 17.5px; margin-bottom: 6px; color: var(--text); }
.chapter-card p.concept{ font-size: 12.5px; color: var(--pink-soft); font-weight: 700; margin: 0 0 10px; letter-spacing: .2px; }
.chapter-card p.desc{ font-size: 13.5px; color: var(--muted); margin:0; line-height:1.75; }
.chapter-card .lock{ position:absolute; top:18px; left:18px; opacity:.55; font-size:16px; }

/* badges */
.badge{ display:inline-block; padding: 4px 11px; border-radius: 999px; font-size: 11.5px; font-weight:800; letter-spacing:.2px; }
.badge-gold{ background: rgba(255,138,61,.15); color: var(--orange-soft); border:1px solid rgba(255,138,61,.35); }
.badge-teal{ background: rgba(79,214,224,.15); color: var(--teal-soft); border:1px solid rgba(79,214,224,.3); }

/* video */
.video-frame{
  position: relative; width: 100%; aspect-ratio: 16/9; border-radius: var(--radius);
  overflow: hidden; background: #000; border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.video-frame iframe, .video-frame video{ width:100%; height:100%; border:0; display:block; }

/* table-ish resource list */
.resource-row{
  display:flex; align-items:center; justify-content:space-between; gap: 14px;
  padding: 16px 20px; border: 1px solid var(--line); border-radius: var(--radius);
  background: rgba(255,255,255,.025); margin-bottom: 10px;
  transition: border-color .2s var(--ease), background .2s var(--ease), transform .2s var(--ease);
}
.resource-row:hover{ border-color: var(--line-strong); background: rgba(255,255,255,.045); transform: translateX(-3px); }
.resource-row .meta{ display:flex; align-items:center; gap: 14px; }
.resource-row .icon{
  font-size: 18px; flex:none;
  width: 42px; height: 42px; border-radius: 12px;
  display:flex; align-items:center; justify-content:center;
  background: rgba(79,214,224,.1); border: 1px solid rgba(79,214,224,.25);
}
.resource-row .name{ font-weight:700; font-size: 14.5px; }
.resource-row .sub{ font-size: 12.5px; color: var(--muted); }

/* footer */
.footer{ border-top: 1px solid var(--line); margin-top: 80px; padding: 32px 24px 36px; text-align:center; color: var(--muted-2); font-size: 13px; }
.footer-row{ display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:10px 22px; margin-bottom:14px; }
.footer-row a{ color: var(--muted); border-bottom:1px solid var(--line); padding-bottom:2px;
  transition: color .18s var(--ease), border-color .18s var(--ease); }
.footer-row a:hover{ color: var(--pink-soft); border-color: var(--pink); }
.back-to-landing{
  display:inline-flex; align-items:center; gap:7px; font-weight:700;
  color: var(--teal-soft) !important; border-color: rgba(79,214,224,.4) !important;
}
.back-to-landing:hover{ color:#fff !important; border-color: var(--teal) !important; }

/* reveal-on-scroll (opt-in via .reveal; JS adds .in) */
.reveal{ opacity:0; transform: translateY(18px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.in{ opacity:1; transform:none; }

/* staggered children — JS sets --i on each child */
.stagger > *{
  opacity:0; transform: translateY(20px);
  animation: stagger-in .6s var(--ease) forwards;
  animation-delay: calc(var(--i, 0) * 70ms);
}
@keyframes stagger-in{ to{ opacity:1; transform:none; } }

/* ---------- page transition veil ---------- */
.page-veil{
  position: fixed; inset: 0; z-index: 9997; pointer-events: none;
  background:
    radial-gradient(600px 400px at 20% 20%, rgba(255,79,163,.5), transparent 60%),
    radial-gradient(600px 400px at 80% 80%, rgba(255,138,61,.45), transparent 60%),
    var(--bg);
  opacity: 0; transition: opacity .34s var(--ease);
}
.page-veil.show{ opacity: 1; pointer-events: all; }
/* first paint: veil fades away, revealing the page */
.page-veil.intro{ opacity: 1; animation: veil-out .55s var(--ease) .05s forwards; }
@keyframes veil-out{ to{ opacity:0; visibility:hidden; } }

/* scroll progress bar */
.scroll-progress{
  position: fixed; top: 0; inset-inline: 0; height: 3px; z-index: 60;
  background: linear-gradient(90deg, var(--pink), var(--orange), var(--teal));
  transform-origin: right; transform: scaleX(0);
  transition: transform .1s linear;
}

/* shine sweep on primary buttons */
.btn-primary{ position: relative; overflow: hidden; }
.btn-primary::after{
  content:""; position:absolute; top:0; bottom:0; width: 45%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.35), transparent);
  transform: translateX(-160%) skewX(-18deg);
}
.btn-primary:hover::after{ animation: btn-shine .75s var(--ease); }
@keyframes btn-shine{ to{ transform: translateX(260%) skewX(-18deg); } }

/* ripple */
.ripple{
  position:absolute; border-radius:50%; pointer-events:none;
  background: rgba(255,255,255,.45); transform: scale(0); opacity:.75;
  animation: ripple-go .6s var(--ease) forwards;
}
@keyframes ripple-go{ to{ transform: scale(2.6); opacity:0; } }

/* ---------- terms gate ---------- */
.terms-gate{
  position: fixed; inset:0; z-index: 9990;
  display:flex; align-items:center; justify-content:center; padding: 22px;
  background: rgba(6,9,38,.82); backdrop-filter: blur(10px);
  animation: gate-in .3s var(--ease);
}
.terms-gate.out{ animation: gate-out .34s var(--ease) forwards; }
@keyframes gate-in{ from{ opacity:0; } to{ opacity:1; } }
@keyframes gate-out{ to{ opacity:0; } }
.terms-gate-card{
  max-width: 480px; width:100%; padding: 34px 30px; text-align:center;
  animation: gate-card-in .4s var(--ease);
}
@keyframes gate-card-in{ from{ opacity:0; transform: translateY(22px) scale(.97); } to{ opacity:1; transform:none; } }
.terms-gate-icon{ font-size: 40px; margin-bottom: 12px; }
.terms-gate-card h2{ font-size: 20px; margin-bottom: 12px; }
.terms-gate-card p{ font-size: 14px; color: var(--muted); line-height:1.85; margin: 0 0 18px; }
.terms-gate-link{
  display:inline-block; font-size:13.5px; font-weight:700; color: var(--teal-soft);
  border-bottom: 1px solid rgba(79,214,224,.4); padding-bottom: 2px; margin-bottom: 22px;
}
.terms-gate-link:hover{ color: var(--text); }
.terms-gate-check{
  display:flex; align-items:flex-start; gap:10px; text-align:right;
  font-size:13.5px; color: var(--text); cursor:pointer;
  padding: 14px 16px; border-radius: var(--radius-sm);
  border:1px solid var(--line); background: rgba(255,255,255,.03);
  margin-bottom: 16px;
}
.terms-gate-check input{ width:18px; height:18px; flex:none; margin-top:1px; accent-color: var(--pink); }
.terms-gate-card .btn{ width:100%; }
#terms-gate-msg{ min-height: 18px; margin-bottom: 8px; }

/* ---------- native View Transitions (cross-document) ---------- */
@view-transition{ navigation: auto; }
::view-transition-old(root){ animation: vt-out .28s var(--ease) both; }
::view-transition-new(root){ animation: vt-in .34s var(--ease) both; }
@keyframes vt-out{ to{ opacity:0; transform: translateY(-8px) scale(.994); } }
@keyframes vt-in{ from{ opacity:0; transform: translateY(10px) scale(.994); } }
/* persistent chrome shouldn't move between pages */
.nav{ view-transition-name: site-nav; }
::view-transition-old(site-nav), ::view-transition-new(site-nav){ animation: none; mix-blend-mode: normal; }

/* ---------- toasts ---------- */
.toast-host{
  position: fixed; z-index: 9995; bottom: 22px; inset-inline-start: 22px;
  display:flex; flex-direction:column; gap:10px; pointer-events:none;
}
.toast{
  display:flex; align-items:center; gap:10px;
  padding: 13px 18px; border-radius: 14px; font-size: 13.5px; font-weight:600;
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border:1px solid var(--line-strong); box-shadow: var(--shadow);
  animation: toast-in .3s var(--ease); pointer-events:all; max-width: 340px;
}
.toast.out{ animation: toast-out .3s var(--ease) forwards; }
.toast-success{ border-color: rgba(127,216,168,.4); }
.toast-error{ border-color: rgba(255,140,120,.45); }
.toast-ic{ flex:none; font-size:15px; }
@keyframes toast-in{ from{ opacity:0; transform: translateY(14px) scale(.96); } }
@keyframes toast-out{ to{ opacity:0; transform: translateY(8px) scale(.97); } }

/* ---------- dialogs ---------- */
.dialog-overlay{
  position: fixed; inset:0; z-index: 9993;
  display:flex; align-items:center; justify-content:center; padding:22px;
  background: rgba(6,9,38,.78); backdrop-filter: blur(8px);
  animation: gate-in .22s var(--ease);
}
.dialog-overlay.out{ animation: gate-out .22s var(--ease) forwards; }
.dialog{
  width:100%; max-width: 420px; padding: 28px; text-align:right;
  animation: gate-card-in .3s var(--ease);
}
.dialog-title{ font-size:18px; margin-bottom:12px; }
.dialog-body p{ font-size:14px; color: var(--muted); line-height:1.8; margin:0 0 6px; }
.dialog-actions{ display:flex; gap:10px; margin-top:22px; }
.dialog-actions .btn{ flex:1; }

/* ---------- skeletons ---------- */
.sk{ background: linear-gradient(90deg, rgba(255,255,255,.05), rgba(255,255,255,.11), rgba(255,255,255,.05));
  background-size: 200% 100%; animation: sk-shimmer 1.3s linear infinite; border-radius: 8px; }
@keyframes sk-shimmer{ to{ background-position: -200% 0; } }
.skeleton-card{
  padding: 26px; border-radius: var(--radius-lg);
  border:1px solid var(--line); background: rgba(255,255,255,.02);
  display:flex; flex-direction:column; gap:10px;
}
.skeleton-row{
  display:flex; align-items:center; gap:14px; padding:16px 20px; margin-bottom:10px;
  border:1px solid var(--line); border-radius: var(--radius); background: rgba(255,255,255,.02);
}
.sk-badge{ width:44px; height:44px; border-radius:14px; margin-bottom:6px; }
.sk-avatar{ width:42px; height:42px; border-radius:12px; flex:none; }
.sk-line{ height:11px; width:100%; }
.sk-line + .sk-line{ margin-top:8px; }
.w70{ width:70%; } .w50{ width:50%; } .w40{ width:40%; } .w30{ width:30%; } .w85{ width:85%; }

/* ---------- error state ---------- */
.error-state{ text-align:center; padding: 48px 20px; }
.error-state-ic{ font-size:34px; margin-bottom:12px; }
.error-state p{ color: var(--muted); font-size:14px; margin:0 0 18px; }

/* ---------- course progress ---------- */
.progress-panel{
  display:flex; align-items:center; gap: 26px; flex-wrap:wrap;
  padding: 26px 30px; margin-bottom: 28px;
}
.progress-ring{ flex:none; position:relative; width:84px; height:84px; }
.progress-ring svg{ transform: rotate(-90deg); }
.progress-ring circle{ fill:none; stroke-width: 8; stroke-linecap: round; }
.progress-ring .track{ stroke: rgba(255,255,255,.08); }
.progress-ring .bar{ stroke: url(#pg); transition: stroke-dashoffset .9s var(--ease); }
.progress-ring .pct{
  position:absolute; inset:0; display:flex; align-items:center; justify-content:center;
  font-size:16px; font-weight:900; letter-spacing:-.5px;
}
.progress-copy{ flex:1; min-width: 190px; }
.progress-copy h3{ font-size:17px; margin-bottom:4px; }
.progress-copy p{ font-size:13.5px; color: var(--muted); margin:0; }

/* chapter card states */
.chapter-card.is-done{ border-color: rgba(127,216,168,.35); }
.chapter-card.is-done .num{ color:#7fd8a8; background: rgba(127,216,168,.12); border-color: rgba(127,216,168,.32); }
.chapter-card .state{
  position:absolute; top:22px; left:22px; font-size:11px; font-weight:800;
  padding: 4px 10px; border-radius:999px;
}
.chapter-card .state.done{ background: rgba(127,216,168,.15); color:#7fd8a8; border:1px solid rgba(127,216,168,.3); }
.chapter-card .state.next{ background: linear-gradient(135deg, var(--pink), var(--orange)); color:#fff; }
.chapter-card.is-next{ border-color: var(--pink); box-shadow: 0 0 0 1px var(--pink-glow), var(--shadow); }

/* ---------- mobile bottom nav ---------- */
.bottom-nav{ display:none; }
@media (max-width: 720px){
  .bottom-nav{
    display:flex; position: fixed; bottom:0; inset-inline:0; z-index: 45;
    background: rgba(11,17,64,.9); backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  }
  .bottom-nav a{
    flex:1; display:flex; flex-direction:column; align-items:center; gap:3px;
    padding: 7px 4px; border-radius: 12px; font-size: 11px; font-weight:700; color: var(--muted-2);
  }
  .bottom-nav a .bi{ font-size:19px; }
  .bottom-nav a.active{ color: var(--pink-soft); background: rgba(255,79,163,.1); }
  body{ padding-bottom: 76px; }
  .toast-host{ bottom: 88px; }
}

/* ---------- back to top ---------- */
.to-top{
  position: fixed; z-index: 44; bottom: 24px; inset-inline-end: 24px;
  width: 44px; height: 44px; border-radius: 50%; cursor:pointer;
  display:flex; align-items:center; justify-content:center; font-size:17px;
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border:1px solid var(--line-strong); color: var(--text);
  box-shadow: var(--shadow-sm);
  opacity:0; visibility:hidden; transform: translateY(10px);
  transition: opacity .25s var(--ease), transform .25s var(--ease), visibility .25s;
}
.to-top.show{ opacity:1; visibility:visible; transform:none; }
.to-top:hover{ border-color: var(--pink); color: var(--pink-soft); }
@media (max-width: 720px){ .to-top{ bottom: 88px; } }

/* skip link */
.skip-link{
  position:absolute; inset-inline-start:-9999px; top:0; z-index: 100;
  background: var(--panel); color: var(--text); padding: 12px 18px; border-radius: 0 0 12px 0;
  border:1px solid var(--line-strong); font-size:13.5px; font-weight:700;
}
.skip-link:focus{ inset-inline-start:0; }

/* ---------- branded bubble loader ---------- */
.bubble-loader{
  display:flex; flex-direction:column; align-items:center; justify-content:flex-end;
  padding: 34px 0 30px; gap:2px;
}
.bl-stage{
  position:relative; width: 190px; height: 96px;
}
.bl-bubble{
  position:absolute; bottom:0;
  left: calc(50% + (var(--lane) - 3) * 26px);
  font-size: 17px; line-height:1;
  display:flex; align-items:center; justify-content:center;
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,.07);
  border: 1px solid var(--line-strong);
  box-shadow: 0 4px 14px rgba(4,7,30,.4);
  opacity: 0;
  animation: bl-rise 2.1s var(--ease) infinite;
}
@keyframes bl-rise{
  0%   { transform: translate(-50%, 10px) scale(.5); opacity:0; }
  18%  { opacity:1; }
  70%  { opacity:.9; }
  100% { transform: translate(-50%, -86px) scale(1.05); opacity:0; }
}
.bl-flask{
  font-size: 30px; line-height:1;
  filter: drop-shadow(0 0 14px var(--pink-glow));
  animation: bl-bob 2.1s var(--ease) infinite;
}
@keyframes bl-bob{
  0%,100%{ transform: translateY(0) rotate(-3deg); }
  50%    { transform: translateY(-4px) rotate(3deg); }
}
.bl-text{ margin-top:12px; font-size:13.5px; color: var(--muted); font-weight:600; }

@media (prefers-reduced-motion: reduce){
  .bl-bubble{ animation:none; opacity:.85; transform: translate(-50%, -30px); }
  .bl-flask{ animation:none; }
}

/* ---------- fillable worksheet ---------- */
.ws{ padding: 26px 28px 22px; }
.ws-loading{ padding: 40px 0; text-align:center; color: var(--muted); font-size:14px; }
.ws-head{ display:flex; align-items:flex-start; justify-content:space-between; gap:14px; margin-bottom:6px; }
.ws-kicker{ font-size:11px; font-weight:800; letter-spacing:1.4px; text-transform:uppercase; color: var(--orange-soft); margin-bottom:6px; }
.ws-title{ font-size:22px; }
.ws-saved{ font-size:12px; color: var(--teal-soft); flex:none; min-height:16px; }
.ws-intro{ font-size:13.5px; color: var(--muted); line-height:1.8; margin: 10px 0 4px; }
.ws-foot{ margin-top:22px; padding-top:14px; border-top:1px solid var(--line);
  font-size:11.5px; color: var(--muted-2); text-align:center; }

.ws-section{ margin-top: 30px; }
.ws-sec-title{
  font-size:15px; margin-bottom:10px; padding-inline-start:12px;
  border-inline-start:3px solid var(--pink); line-height:1.4;
}
.ws-note{ font-size:12.5px; color: var(--muted); line-height:1.85; margin: 0 0 14px;
  background: rgba(255,255,255,.03); border:1px solid var(--line); border-radius:12px; padding:12px 14px; }
.ws-subtitle{ font-size:13px; font-weight:800; color: var(--teal-soft); margin: 16px 0 10px; }

.ws-fields{ display:grid; gap:12px; }
.ws-field{ display:flex; flex-direction:column; gap:6px; }
.ws-field > span{ font-size:12.5px; color: var(--muted); font-weight:600; }
.ws-field input, .ws-field textarea,
.ws-table input, .ws-table textarea{
  background: rgba(255,255,255,.04); border:1px solid var(--line-strong); border-radius:10px;
  padding:10px 12px; color: var(--text); font-family: var(--font); font-size:14px;
  outline:none; width:100%; transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
}
.ws-field textarea, .ws-table textarea{ resize:vertical; line-height:1.6; }
.ws-field input:focus, .ws-field textarea:focus,
.ws-table input:focus, .ws-table textarea:focus{
  border-color: var(--pink); box-shadow: 0 0 0 3px rgba(255,79,163,.16);
}

.ws-group{ border:1px solid var(--line); border-radius:14px; padding:16px 18px; margin-bottom:12px;
  background: rgba(255,255,255,.02); }
.ws-group .ws-subtitle{ margin-top:0; }

.ws-scroll{ overflow-x:auto; margin-bottom:8px; }
.ws-ref, .ws-table{ width:100%; border-collapse:separate; border-spacing:0; font-size:13px; min-width:520px; }
.ws-ref th, .ws-table th{
  text-align:start; font-size:11.5px; font-weight:800; letter-spacing:.4px;
  color:#fff; padding:10px 12px;
  background: linear-gradient(135deg, var(--pink), var(--orange));
}
.ws-ref th:first-child{ border-start-start-radius:12px; }
.ws-ref th:last-child{ border-start-end-radius:12px; }
.ws-table thead th:first-child{ border-start-start-radius:12px; }
.ws-table thead th:last-child{ border-start-end-radius:12px; }
.ws-ref td{ padding:10px 12px; border-bottom:1px solid var(--line); color: var(--muted); line-height:1.7; }
.ws-table tbody th{ background:none; color: var(--muted); font-size:12.5px; white-space:nowrap;
  padding:8px 12px; border-bottom:1px solid var(--line); }
.ws-table td{ padding:6px; border-bottom:1px solid var(--line); min-width:130px; }

.ws-list{ margin:0; padding-inline-start:20px; display:grid; gap:8px; }
.ws-list li{ font-size:13.5px; color: var(--muted); line-height:1.8; }

.ws-checks{ display:grid; gap:8px; }
.ws-check{ display:flex; align-items:flex-start; gap:10px; cursor:pointer;
  padding:11px 14px; border:1px solid var(--line); border-radius:12px;
  background: rgba(255,255,255,.02); font-size:13.5px; line-height:1.6;
  transition: border-color .16s var(--ease), background .16s var(--ease); }
.ws-check:hover{ border-color: var(--line-strong); }
.ws-check input{ width:18px; height:18px; accent-color: var(--pink); flex:none; margin-top:1px; }
.ws-check:has(input:checked){ border-color: rgba(127,216,168,.4); background: rgba(127,216,168,.07); }

.ws-choices{ display:flex; flex-wrap:wrap; gap:8px; }
.ws-choice{ cursor:pointer; font-size:13px; padding:9px 15px; border-radius:999px;
  border:1px solid var(--line-strong); background: rgba(255,255,255,.03);
  transition: border-color .16s var(--ease), background .16s var(--ease), color .16s var(--ease); }
.ws-choice input{ display:none; }
.ws-choice:hover{ border-color: var(--pink); }
.ws-choice.on{ background: linear-gradient(135deg, var(--pink), var(--orange)); color:#fff; border-color:transparent; font-weight:700; }

.ws-calc{ margin-top:10px; font-size:13.5px; font-weight:700; color: var(--teal-soft); }

@media (max-width: 720px){
  .ws{ padding: 20px 16px 18px; }
  .ws-title{ font-size:19px; }
}

.kit-holder{ margin: 0 0 14px; }

/* utility */
.center{ text-align:center; }
.muted{ color: var(--muted); }
.mt-8{ margin-top:8px; } .mt-16{ margin-top:16px; } .mt-24{ margin-top:24px; } .mt-40{ margin-top:40px; }
.flex{ display:flex; } .items-center{ align-items:center; } .gap-8{ gap:8px; } .gap-12{ gap:12px; }
.spacer{ flex:1; }

.loader{ display:flex; align-items:center; justify-content:center; padding: 60px 0; color: var(--muted); font-size:14px; }
.hidden{ display:none !important; }

@media (max-width: 720px){
  .nav-links{ display:none; }
  .hamburger-btn{ display:flex; }
  .container{ padding: 0 16px; }
  .card-pad{ padding: 22px; }
}

@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{ animation-duration:.01ms !important; animation-iteration-count:1 !important; transition-duration:.01ms !important; scroll-behavior:auto !important; }
  .reveal{ opacity:1; transform:none; }
  .stagger > *{ opacity:1; transform:none; }
  .page-veil{ display:none; }
}
