/* ============================================
   ALUNA INTENSIVE PORTAL
   Design system: aluna-portal-mockup-FINAL.html
   All spacing values copied exactly from mockup.
   ============================================ */

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

:root {
  --bg:              #0b0b0b;
  --panel:           rgba(255,255,255,0.04);
  --panel-strong:    rgba(255,255,255,0.06);
  --panel-raised:    rgba(255,255,255,0.07);
  --border:          rgba(255,255,255,0.10);
  --border-strong:   rgba(255,255,255,0.14);
  --text:            rgba(255,255,255,0.92);
  --muted:           rgba(255,255,255,0.55);
  --dim:             rgba(255,255,255,0.25);
  --gold:            #d4af7a;
  --gold-soft:       rgba(212,175,122,0.15);
  --gold-border:     rgba(212,175,122,0.35);
  --radius:          12px;
  --radius-sm:       8px;
  --sidebar-width:   240px;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "SF Pro Display", Inter, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ── SHELL ── */
.shell { display: flex; height: 100vh; }

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-width); min-width: var(--sidebar-width);
  background: rgba(255,255,255,0.02);
  border-right: 1px solid var(--border);
  height: 100%; overflow-y: auto;
  display: flex; flex-direction: column;
  padding-bottom: 36px; /* clears the fixed .sb-footer */
  scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }

/* Sidebar sections - each area is its own block with generous, consistent spacing */
.sb-client-block {
  padding: 28px 18px;
  border-bottom: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 4px;
}
.sb-client-logo {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--panel-strong);
  overflow: hidden; flex-shrink: 0;
  margin-bottom: 6px;
}
.sb-client-logo img { width: 100%; height: 100%; object-fit: contain; }
.sb-client-name { font-size: 14px; font-weight: 600; color: var(--text); line-height: 1.2; }
.sb-client-org  { font-size: 11px; color: var(--muted); }

/* Quote gets its own section - a quiet pause, not squeezed under the client
   identity. Panel treatment (background + radius) instead of larger text
   alone, so it reads as a deliberate moment rather than more list content. */
.sb-quote-block {
  padding: 24px 18px;
  border-bottom: 1px solid var(--border);
}
.sb-client-quote {
  background: var(--panel-strong);
  border-radius: var(--radius);
  padding: 20px 18px;
  margin: 0;
  font-size: 16px; color: var(--gold); font-style: italic; opacity: 0.9;
  line-height: 1.6; letter-spacing: 0.01em;
}
.sb-client-quote p { margin-bottom: 10px; }
.sb-client-quote p:last-of-type { margin-bottom: 0; }
.sb-client-quote cite {
  display: block; margin-top: 12px;
  font-size: 11px; font-style: normal; color: var(--dim);
}

/* Sections flow naturally from the top with consistent spacing - nothing
   force-stretches to fill the viewport (that's what created the dead void
   between Delivered and Reference). Only the footer is truly pinned. */
.sb-sec { padding: 24px 0; border-bottom: 1px solid var(--border); }
.sb-sec:last-child { border-bottom: none; }
.sb-sec-reference { padding-bottom: 32px; }

/* Sidebar footer - fixed, aligned with .portal-footer to read as one row */
.sb-footer {
  position: fixed; bottom: 0; left: 0;
  width: var(--sidebar-width); height: 36px;
  border-top: 1px solid var(--border); border-right: 1px solid var(--border);
  background: var(--bg);
  display: flex; align-items: center; gap: 8px; padding: 0 18px;
  z-index: 100;
}
.sb-footer-logo { height: 14px; opacity: 0.5; cursor: pointer; flex-shrink: 0; }
.sb-footer-name {
  font-size: 10px; font-weight: 500; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}

.sb-lbl {
  font-size: 9px; font-weight: 500; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--dim);
  padding: 0 16px; margin-bottom: 8px;
}

/* Deliverable rows */
.del-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 16px; cursor: pointer; transition: background 0.15s; gap: 8px;
}
.del-row:hover { background: var(--panel); }
.del-row.dim { opacity: 0.3; cursor: default; pointer-events: none; }
.del-row.dim:hover { background: transparent; }
.del-name { font-size: 12px; color: var(--muted); flex: 1; }
.del-row:not(.dim) .del-name { color: var(--text); }

/* Pills */
.pill {
  font-size: 8px; font-weight: 500; letter-spacing: 0.12em;
  text-transform: uppercase; padding: 2px 7px; border-radius: 20px;
  white-space: nowrap; font-family: inherit;
}
.p-delivered { background: var(--gold-soft); color: var(--gold); border: 1px solid var(--gold-border); }
.p-pending   { background: transparent; color: var(--dim); border: 1px solid var(--border); }
.p-active    { background: var(--gold); color: #0b0b0b; font-weight: 600; }
.p-complete  { background: var(--gold-soft); color: var(--gold); border: 1px solid var(--gold-border); }

/* Reference rows */
.ref-row {
  display: flex; align-items: center; padding: 7px 16px;
  cursor: pointer; transition: background 0.15s; text-decoration: none;
}
.ref-row:hover { background: var(--panel); }
.ref-name { font-size: 12px; color: var(--muted); }

/* ── MAIN ── */
.main {
  flex: 1; overflow-y: auto;
  display: flex; flex-direction: column;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
  padding-bottom: 36px;
}

/* ── PHASE RAIL ── */
.phase-rail {
  display: grid; grid-template-columns: repeat(4,1fr);
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.pc {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 14px 10px 12px; gap: 5px; text-align: center; min-height: 86px;
  border-right: 1px solid var(--border);
  border-top: none; border-bottom: 2px solid transparent; border-left: none;
  background: transparent;
  cursor: pointer; transition: background 0.2s; font-family: inherit;
}
.pc:last-child { border-right: none; }
.pc-active   { border-bottom-color: var(--gold) !important; background: var(--panel); }
.pc-complete { border-bottom-color: var(--gold-border) !important; }
.pc-complete:hover, .pc-active:hover { background: var(--panel-strong); }
.pc-locked   { cursor: default; }
.pc-moon { font-size: 22px; line-height: 1; }
.pc-activate-icon {
  width: 14px; height: 14px;
  border: 1.5px solid var(--gold);
  transform: rotate(45deg);
  display: inline-block;
  opacity: 0.85;
}
.pc-name { font-size: 13px; font-weight: 600; color: var(--text); letter-spacing: 0.01em; }

/* ── CONTENT AREA ── */
.phase-wrap { padding: 36px 48px 72px; flex: 1; }

.week-tag {
  display: inline-flex; align-items: center;
  background: var(--gold-soft); border: 1px solid var(--gold-border);
  border-radius: 20px; padding: 3px 12px;
  font-size: 10px; font-weight: 500; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--gold); margin-bottom: 12px;
}

.phase-heading {
  font-size: 36px; font-weight: 700; color: var(--text);
  line-height: 1.05; letter-spacing: -0.5px; margin-bottom: 6px;
}
.phase-q {
  font-size: 15px; color: var(--gold); opacity: 0.75;
  margin-bottom: 28px; font-style: italic; line-height: 1.4;
}
.gold-rule { height: 1px; background: linear-gradient(to right, var(--gold-border), transparent); margin-bottom: 32px; }
.purpose-lbl {
  font-size: 9px; font-weight: 500; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--dim); margin-bottom: 6px;
}
.purpose-text { font-size: 14px; color: var(--muted); line-height: 1.75; max-width: 580px; margin-bottom: 36px; }

/* ── STACK CARDS ── */

/* Archive rows (completed steps) */
.completed-archive { display: flex; flex-direction: column; margin-bottom: 2px; }
.archive-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 18px;
  border: 1px solid var(--border); border-bottom: none;
  background: var(--panel);
}
.archive-row:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.archive-row:last-child  { border-bottom: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius); margin-bottom: 16px; }
.archive-row:only-child  { border-radius: var(--radius); border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.archive-left  { display: flex; align-items: center; gap: 10px; }
.archive-dot   { width: 5px; height: 5px; border-radius: 50%; background: var(--gold); opacity: 0.35; flex-shrink: 0; }
.archive-lbl   { font-size: 9px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); min-width: 100px; }
.archive-title { font-size: 13px; font-weight: 500; color: var(--dim); }
.archive-check { font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); opacity: 0.45; }

/* Active card */
.active-card {
  background: var(--panel-strong);
  border: 1px solid var(--border-strong);
  border-left: 2px solid var(--gold);
  border-radius: var(--radius);
  padding: 22px 24px 20px;
  margin-bottom: 8px;
  transition: all 0.35s ease-out;
}
.active-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.active-card-lbl {
  font-size: 9px; font-weight: 500; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--gold); opacity: 0.7; margin-bottom: 5px;
}
.active-card-title { font-size: 18px; font-weight: 600; color: var(--text); line-height: 1.2; letter-spacing: -0.2px; }
.active-card-body  { font-size: 13px; color: var(--muted); line-height: 1.75; }
.active-card-body strong { color: var(--text); font-weight: 500; }
.active-card-body p { margin-bottom: 6px; }
.active-card-body p:last-child { margin-bottom: 0; }

/* Status badges */
.ssb {
  font-size: 9px; font-weight: 500; letter-spacing: 0.12em;
  text-transform: uppercase; padding: 3px 9px; border-radius: 20px;
  white-space: nowrap; flex-shrink: 0; margin-top: 2px;
}
.ssb-upcoming { background: var(--gold-soft); color: var(--gold); border: 1px solid var(--gold-border); }
.ssb-ready    { background: var(--gold); color: #0b0b0b; font-weight: 600; }
.ssb-awaiting { background: transparent; color: var(--dim); border: 1px solid var(--border); }
.ssb-action   { background: var(--gold); color: #0b0b0b; font-weight: 600; }
.ssb-complete { background: var(--gold-soft); color: var(--gold); border: 1px solid var(--gold-border); }

/* Peek card (next step) */
.peek-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 18px;
  margin-bottom: 6px;
  user-select: none;
}
.peek-inner  { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.peek-left   { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.peek-lbl    { font-size: 9px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); min-width: 100px; }
.peek-title  { font-size: 13px; font-weight: 500; color: var(--muted); }
.peek-meta   { flex-basis: 100%; font-size: 11px; color: var(--muted); margin-left: 110px; }
.peek-status { font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); }

/* Compressed card (far future) */
.compressed-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 18px;
  margin-bottom: 5px;
  opacity: 0.45; user-select: none;
}
.compressed-inner { display: flex; align-items: center; gap: 8px; }
.compressed-dot   { width: 4px; height: 4px; border-radius: 50%; background: var(--muted); flex-shrink: 0; }
.compressed-lbl   { font-size: 11px; color: var(--muted); letter-spacing: 0.04em; }

/* ── BUTTONS ── */
.btn-p {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--gold); color: #0b0b0b;
  font-size: 12px; font-weight: 600; letter-spacing: 0.04em;
  padding: 10px 20px; border: none; border-radius: var(--radius-sm);
  cursor: pointer; transition: all 0.18s; margin-top: 14px; font-family: inherit;
  text-decoration: none;
}
.btn-p:hover { background: #e0c08d; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,0,0,0.3); }

.btn-s {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; color: var(--gold);
  font-size: 12px; font-weight: 500;
  padding: 10px 18px; border: 1px solid var(--gold-border);
  border-radius: var(--radius-sm); cursor: pointer;
  transition: all 0.18s; margin-top: 14px; font-family: inherit;
  text-decoration: none;
}
.btn-s:hover { background: var(--gold-soft); border-color: var(--gold); }

/* ── WELCOME STATE ── */
.welcome-heading {
  font-size: 32px; font-weight: 700; color: var(--text);
  line-height: 1.1; letter-spacing: -0.5px; margin-bottom: 28px;
}
.welcome-quote {
  border-left: 2px solid var(--gold-border); padding-left: 20px;
  margin-top: 28px; margin-bottom: 36px;
}
.welcome-quote-text {
  font-size: 16px; font-style: italic; color: var(--gold);
  opacity: 0.85; line-height: 1.6; margin-bottom: 8px;
}
.welcome-quote-attr { font-size: 12px; color: var(--dim); }
.welcome-reversal {
  font-size: 16px; color: var(--muted); line-height: 1.75;
  margin-bottom: 40px; max-width: 580px;
}

/* ── ACTIVATE STATE ── */
.activate-heading {
  font-size: 36px; font-weight: 700; color: var(--text);
  letter-spacing: -0.5px; margin-bottom: 8px;
}
.activate-sub { font-size: 15px; color: var(--muted); margin-bottom: 40px; }

/* ── FOOTER ── */
.portal-footer {
  position: fixed; bottom: 0;
  left: var(--sidebar-width); right: 0;
  height: 36px;
  border-top: 1px solid var(--border);
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
}
.portal-footer p {
  font-size: 10px; font-weight: 500; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--dim); font-style: italic;
  margin: 0;
}
/* Pinned to the far right of the whole page's footer row (not the narrow
   sidebar-footer strip), as its own quiet utility action. */
.portal-footer-logout {
  position: absolute; right: 24px;
  font-size: 11px; font-weight: 500; color: var(--text); text-decoration: none;
  white-space: nowrap; letter-spacing: 0.04em; transition: color 0.15s;
}
.portal-footer-logout:hover { color: var(--gold); }
.deliverable-stack { margin-bottom: 40px; }
.deliverable-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px;
  border: 1px solid var(--border); border-bottom: none;
  background: var(--panel);
}
.deliverable-row:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.deliverable-row:last-child { border-bottom: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius); }
.deliverable-check {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--gold-soft); border: 1px solid var(--gold-border);
  display: flex; align-items: center; justify-content: center;
  color: var(--gold); font-size: 10px; flex-shrink: 0;
}
.deliverable-title { font-size: 14px; font-weight: 500; color: var(--text); }
.deliverable-phase { font-size: 11px; color: var(--muted); margin-top: 1px; }

/* ── WRAPPING UP STATE ── */
.wrapping-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 12px;
}

/* ── OVERLAYS ── */
.overlay {
  position: fixed; inset: 0; background: var(--bg);
  z-index: 500; display: flex; align-items: center; justify-content: center;
  flex-direction: column; opacity: 0; pointer-events: none; transition: opacity 0.5s ease;
}
.overlay.active { opacity: 1; pointer-events: all; }

/* Overlay close button */
.overlay-close {
  position: fixed; top: 18px; right: 20px;
  background: transparent; border: 1px solid var(--border);
  color: var(--muted); border-radius: var(--radius-sm);
  padding: 5px 12px; cursor: pointer; font-size: 13px;
  font-family: inherit; transition: all 0.15s; z-index: 10; line-height: 1.4;
}
.overlay-close:hover { color: var(--text); border-color: var(--border-strong); }

/* ── FOUNDATIONS OVERLAY ── */
#foundations-overlay {
  top: 0;
  height: 100vh;
  align-items: flex-start;
  /* .overlay's base justify-content:center vertically centers overflowing
     content in a flex column - for a long scrollable document that means it
     never actually starts at the top. This was the real scroll-to-top bug. */
  justify-content: flex-start;
  overflow-y: auto;
}
#foundations-overlay .overlay-close {
  position: fixed;
  top: 16px;
  right: 24px;
}
.foundations-body {
  width: 100%; max-width: 660px; margin: 0 auto;
  padding: 48px 52px 80px;
}

/* ── DELIVERABLES OVERLAY (mobile) ── */
#deliverables-overlay {
  top: 0;
  height: 100vh;
  align-items: stretch;
  justify-content: flex-start;
  overflow-y: auto;
}
/* Content anchors to the bottom of the screen (Delivered stacked directly
   above Reference) rather than starting right under the close button.
   min-height keeps it pinned low when short; overflow above still scrolls
   normally if the content ever grows taller than the viewport. */
.deliverables-body {
  width: 100%; max-width: 420px; margin: 0 auto;
  min-height: 100%;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 24px 24px 60px;
}
.foundations-title {
  font-size: 28px; font-weight: 700; color: var(--text);
  letter-spacing: -0.5px; margin-bottom: 36px;
}
.foundations-divider { height: 1px; background: var(--border); margin: 28px 0; }

.foundations-section h2 { font-size: 18px; font-weight: 600; color: var(--text); margin-bottom: 12px; }
.foundations-section h3 { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 10px; margin-top: 20px; }
.foundations-section h4 { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 8px; margin-top: 16px; }
.foundations-section h5 { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 6px; margin-top: 12px; }
.foundations-section p {
  font-size: 14px; color: var(--muted); line-height: 1.75; margin-bottom: 10px;
}
.foundations-section p:last-child { margin-bottom: 0; }
.foundations-section ul { padding-left: 20px; margin-bottom: 10px; }
.foundations-section li { font-size: 14px; color: var(--muted); line-height: 1.75; margin-bottom: 4px; }
.foundations-section strong { color: var(--text); font-weight: 600; }

/* Phase grid in foundations */
.foundations-phase-grid {
  display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; margin: 16px 0;
}
.foundations-phase-item {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px; text-align: center;
}
.foundations-phase-num {
  width: 24px; height: 24px; border-radius: 50%;
  border: 1px solid var(--gold-border); color: var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; margin: 0 auto 8px;
}
.foundations-phase-name { font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.foundations-phase-desc { font-size: 11px; color: var(--dim); }

/* Roles grid */
.foundations-roles-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 12px 0; }
.foundations-role { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px; }
.foundations-role-label { font-size: 10px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); margin-bottom: 8px; }
.foundations-role p { font-size: 13px; color: var(--muted); line-height: 1.6; }

.foundations-caption { font-size: 12px; color: var(--dim); font-style: italic; margin-top: 8px; }

.foundations-confirm-area { padding: 40px 0 0; border-top: 1px solid var(--border); margin-top: 40px; }

/* ── ARTIFACT OVERLAY ── */
#artifact-overlay {
  align-items: stretch; flex-direction: column;
}
.artifact-bar {
  position: relative;
  height: 52px; min-height: 52px;
  background: rgba(11,11,11,0.97);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: flex-end;
  padding: 0 20px; flex-shrink: 0;
}
#artifact-overlay iframe {
  width: 100%; flex: 1; border: none;
}


/* ── CEREMONY ── */
.c-logo       { height: 30px; opacity: 0; margin-bottom: 52px; }
.c-completing { font-size: 15px; font-weight: 400; color: var(--dim); letter-spacing: 0.04em; text-align: center; opacity: 0; margin-bottom: 6px; }
.c-complete   { font-size: 56px; font-weight: 700; color: var(--text); letter-spacing: -1px; opacity: 0; margin-bottom: 36px; text-align: center; line-height: 1; }
.c-line       { width: 0; height: 1px; background: var(--gold); margin: 0 auto 36px; }
.c-next       { font-size: 15px; font-weight: 400; color: var(--gold); opacity: 0; margin-bottom: 6px; letter-spacing: 0.04em; text-align: center; }
.c-active     { font-size: 44px; font-weight: 700; color: var(--text); opacity: 0; margin-bottom: 16px; letter-spacing: -0.5px; text-align: center; line-height: 1; }
.c-q          { font-size: 17px; font-style: italic; color: var(--gold); opacity: 0; text-align: center; max-width: 440px; line-height: 1.5; }
.c-sub        { font-size: 14px; color: var(--muted); opacity: 0; text-align: center; margin-top: 10px; }
.c-hint       { position: absolute; bottom: 40px; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); opacity: 0; }

/* Phase 3 special: c-next becomes the big completion line */
#ceremony.is-p3 .c-next { font-size: 44px; font-weight: 700; letter-spacing: -0.5px; color: var(--text); }
#ceremony.is-p3 .c-q   { font-size: 17px; font-style: italic; color: var(--gold); }

@keyframes fU  { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }
@keyframes fUd { from { opacity:0; transform:translateY(8px); } to { opacity:0.4; transform:translateY(0); } }
@keyframes xL  { from { width:0; } to { width:240px; } }

.overlay.active .c-logo       { animation: fUd 0.7s ease forwards 0.2s; }
.overlay.active .c-completing { animation: fU  0.5s ease forwards 1.0s; }
.overlay.active .c-complete   { animation: fU  0.5s ease forwards 1.3s; }
.overlay.active .c-line       { animation: xL  0.6s ease forwards 2.1s; }
.overlay.active .c-next       { animation: fU  0.5s ease forwards 2.8s; }
.overlay.active .c-active     { animation: fU  0.5s ease forwards 3.1s; }
.overlay.active .c-q          { animation: fU  0.5s ease forwards 3.5s; }
.overlay.active .c-sub        { animation: fU  0.4s ease forwards 3.7s; }
.overlay.active .c-hint       { animation: fU  0.4s ease forwards 4.2s; }
.overlay.active .c-close-btn  { animation: fU  0.4s ease forwards 4.4s; }

.c-close-btn {
  opacity: 0; margin-top: 48px;
  background: transparent; color: var(--muted);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 24px; cursor: pointer; font-family: inherit; font-size: 13px;
  transition: all 0.15s;
}
.c-close-btn:hover { color: var(--text); border-color: var(--border-strong); }

/* ── MOBILE BOTTOM NAV ── */
.bottom-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  height: 60px;
  background: rgba(11,11,11,0.97);
  border-top: 1px solid var(--border);
  align-items: center; justify-content: space-around;
  z-index: 150; padding: 0 4px;
}
.bn-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; flex: 1; min-height: 44px;
  background: transparent; border: none;
  cursor: pointer; padding: 4px 2px;
  color: var(--dim); font-family: inherit;
  transition: color 0.15s;
}
.bn-item:hover, .bn-item.active { color: var(--gold); }
.bn-icon  { font-size: 17px; line-height: 1; }
.bn-label { font-size: 8px; letter-spacing: 0.08em; text-transform: uppercase; }
.bn-center { flex-shrink: 0; }
.bn-circle {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--gold); color: #0b0b0b;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ── RESPONSIVE ── */
@media (max-width: 767px) {
  .sidebar { display: none; }
  .bottom-nav      { display: flex; }
  .main            { padding-bottom: 60px; }
  .portal-footer   { left: 0; bottom: 60px; }
  .portal-footer-logout { display: none; } /* bottom-nav has its own Log out button on mobile */
  .sb-footer       { display: none; }
  .phase-wrap      { padding: 24px 20px 72px; }
  .phase-heading   { font-size: 26px; }
  .welcome-heading { font-size: 26px; }
  .foundations-phase-grid  { grid-template-columns: repeat(2,1fr); }
  .foundations-roles-grid  { grid-template-columns: 1fr; }
  .foundations-body        { padding: 64px 20px 60px; }
}

@media (min-width: 768px) {
  .welcome-heading { font-size: 42px; }
}
