/* Babados Academy: design system + components. No inline styles anywhere (strict CSP). */

:root {
  color-scheme: dark;
  --bg: #07080c;
  --bg-elev: #0c0e14;
  --surface: #12151d;
  --surface-2: #181c26;
  --surface-3: #1f2430;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f4f6fb;
  --text-2: #b3bacb;
  --text-3: #858da1;
  --accent: #d4ff3a;
  --accent-ink: #0a0b0f;
  --accent-soft: rgba(212, 255, 58, 0.12);
  --cyan: #3ad6ff;
  --mint: #3affb2;
  --violet: #9d8cff;
  --grad: linear-gradient(115deg, #d4ff3a 0%, #3affb2 45%, #3ad6ff 100%);
  --series: #3987e5;
  --series-wash: rgba(57, 135, 229, 0.12);
  --good: #0ca30c;
  --good-text: #4ade80;
  --warn: #fab219;
  --serious: #ec835a;
  --bad: #d03b3b;
  --bad-text: #ff7a7a;
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 20px 50px -20px rgba(0, 0, 0, 0.6);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --container: 1180px;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--accent); color: var(--accent-ink); padding: 10px 14px; border-radius: var(--radius-sm);
  font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* ---------- Backdrop ---------- */
.backdrop { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.backdrop .aurora {
  position: absolute; inset: -30% -10% auto -10%; height: 110vh; filter: blur(80px); opacity: 0.55;
  background:
    radial-gradient(40% 45% at 20% 30%, rgba(212, 255, 58, 0.22), transparent 70%),
    radial-gradient(35% 40% at 75% 20%, rgba(58, 214, 255, 0.22), transparent 70%),
    radial-gradient(30% 35% at 55% 60%, rgba(157, 140, 255, 0.16), transparent 70%);
  animation: drift 24s var(--ease) infinite alternate;
}
.backdrop .grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
}
@keyframes drift {
  0% { transform: translate3d(0, 0, 0) rotate(0deg) scale(1); }
  50% { transform: translate3d(4%, 3%, 0) rotate(6deg) scale(1.08); }
  100% { transform: translate3d(-4%, 6%, 0) rotate(-4deg) scale(1.02); }
}

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 20px; }
.main { flex: 1; outline: none; padding-bottom: 80px; }
.stack { display: flex; flex-direction: column; gap: var(--gap, 16px); }
.stack-sm { --gap: 6px; }
.stack-lg { --gap: 28px; }
.section-gap { margin-top: 32px; }
.row { display: flex; align-items: center; gap: var(--gap, 12px); flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 980px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 440px) {
  .grid-4 { grid-template-columns: minmax(0, 1fr); }
}
.section { padding-block: 72px; }
.section-tight { padding-block: 40px; }
.page-head { padding-top: 48px; padding-bottom: 28px; }
.muted { color: var(--text-2); }
.subtle { color: var(--text-3); }
.mono { font-family: var(--mono); font-size: 0.92em; }
.nowrap { white-space: nowrap; }
.break { overflow-wrap: anywhere; }
.center { text-align: center; }
.center .row { justify-content: center; }
.center .receipt { text-align: left; }

/* ---------- Type ---------- */
h1, h2, h3, h4 { margin: 0; line-height: 1.12; letter-spacing: -0.025em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); font-weight: 800; }
h3 { font-size: 1.2rem; font-weight: 700; }
h4 { font-size: 1rem; font-weight: 700; }
p { margin: 0; }
.display {
  font-size: clamp(2.6rem, 7vw, 5.2rem);
  font-weight: 850;
  letter-spacing: -0.045em;
  line-height: 0.98;
}
.gradient-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  background-size: 200% 100%;
  animation: shimmer 8s linear infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.22rem); color: var(--text-2); max-width: 60ch; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-2);
}
.kicker { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: saturate(160%) blur(16px);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  background: rgba(7, 8, 12, 0.72);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; gap: 20px; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; letter-spacing: -0.02em; font-size: 1.08rem; }
.brand svg { width: 30px; height: 30px; }
.brand span { color: var(--text-3); font-weight: 600; }
.nav-menu { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav-menu > a {
  text-decoration: none; color: var(--text-2); font-weight: 600; font-size: 0.95rem;
  padding: 8px 12px; border-radius: 999px; transition: color 0.2s, background 0.2s;
}
.nav-menu > a:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.nav-menu > a[aria-current="page"] { color: var(--text); background: rgba(255, 255, 255, 0.08); }
.nav-menu > a.nav-admin::before {
  content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--cyan); margin-right: 7px; vertical-align: middle; box-shadow: 0 0 10px var(--cyan);
}
.nav-auth { display: flex; align-items: center; gap: 8px; margin-left: 10px; }
.nav-user { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; padding: 4px 12px 4px 4px; border-radius: 999px; border: 1px solid var(--border); font-weight: 600; font-size: 0.92rem; }
.nav-user:hover { border-color: var(--border-strong); }
.nav .nav-toggle { display: none; margin-left: auto; }
@media (max-width: 860px) {
  .nav .nav-toggle { display: inline-flex; }
  .nav-menu {
    position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; align-items: stretch;
    padding: 12px 20px 20px; background: rgba(7, 8, 12, 0.97); border-bottom: 1px solid var(--border);
    display: none;
  }
  .nav-menu.is-open { display: flex; }
  .nav-auth { margin: 8px 0 0; }
}

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: rgba(255, 255, 255, 0.06);
  --btn-fg: var(--text);
  --btn-border: var(--border-strong);
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 18px;
  border-radius: 999px; border: 1px solid var(--btn-border);
  background: var(--btn-bg); color: var(--btn-fg);
  font-weight: 700; font-size: 0.95rem; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform 0.15s var(--ease), background 0.2s, border-color 0.2s, box-shadow 0.25s, opacity 0.2s;
}
.btn:hover { background: rgba(255, 255, 255, 0.1); }
.btn:active { transform: translateY(1px) scale(0.99); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }
.btn-primary { --btn-bg: var(--accent); --btn-fg: var(--accent-ink); --btn-border: transparent; }
.btn-primary:hover { background: #e2ff72; box-shadow: 0 0 0 6px rgba(212, 255, 58, 0.14), 0 10px 30px -8px rgba(212, 255, 58, 0.55); }
.btn-ghost { --btn-bg: transparent; --btn-border: transparent; color: var(--text-2); }
.btn-ghost:hover { color: var(--text); }
.btn-danger { --btn-bg: rgba(208, 59, 59, 0.14); --btn-fg: #ffb4b4; --btn-border: rgba(208, 59, 59, 0.45); }
.btn-danger:hover { background: rgba(208, 59, 59, 0.24); }
.btn-sm { min-height: 34px; padding: 0 14px; font-size: 0.86rem; }
.btn-lg { min-height: 52px; padding: 0 26px; font-size: 1.02rem; }
.btn-icon { width: 38px; padding: 0; }
.btn[aria-busy="true"] { color: transparent !important; pointer-events: none; }
.btn[aria-busy="true"]::after {
  content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--btn-fg); border-right-color: transparent; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Chips / badges ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: transparent; color: var(--text-2);
  font-weight: 600; font-size: 0.88rem; cursor: pointer; transition: all 0.2s;
}
.chip:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.3); }
.chip[aria-pressed="true"] { background: var(--text); color: var(--accent-ink); border-color: var(--text); }
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: 0.74rem; font-weight: 700; letter-spacing: 0.02em; white-space: nowrap;
  background: rgba(255, 255, 255, 0.07); color: var(--text-2); border: 1px solid var(--border);
}
.badge-accent { background: var(--accent-soft); color: var(--accent); border-color: rgba(212, 255, 58, 0.3); }
.badge-cyan { background: rgba(58, 214, 255, 0.1); color: var(--cyan); border-color: rgba(58, 214, 255, 0.3); }
.badge-ok { background: rgba(12, 163, 12, 0.14); color: var(--good-text); border-color: rgba(12, 163, 12, 0.4); }
.badge-warn { background: rgba(250, 178, 25, 0.12); color: #ffd27a; border-color: rgba(250, 178, 25, 0.4); }
.badge-error { background: rgba(208, 59, 59, 0.14); color: var(--bad-text); border-color: rgba(208, 59, 59, 0.45); }
.badge-skipped { background: rgba(255, 255, 255, 0.04); color: var(--text-3); }
.level-beginner { background: rgba(58, 255, 178, 0.1); color: var(--mint); border-color: rgba(58, 255, 178, 0.3); }
.level-intermediate { background: rgba(58, 214, 255, 0.1); color: var(--cyan); border-color: rgba(58, 214, 255, 0.3); }
.level-advanced { background: rgba(157, 140, 255, 0.12); color: #c3b9ff; border-color: rgba(157, 140, 255, 0.35); }
.level-all { background: var(--accent-soft); color: var(--accent); border-color: rgba(212, 255, 58, 0.3); }

/* Status icon + label (status is never shown by color alone). */
.status { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; white-space: nowrap; }
.status-icon {
  display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%;
  font-size: 12px; font-weight: 900; line-height: 1; color: #0a0b0f; flex: none;
}
.status-ok .status-icon { background: var(--good); color: #fff; }
.status-warn .status-icon { background: var(--warn); }
.status-error .status-icon { background: var(--bad); color: #fff; }
.status-skipped .status-icon { background: var(--surface-3); color: var(--text-2); }
.status-pending .status-icon { background: var(--surface-3); color: var(--text-2); animation: pulse 1.2s ease-in-out infinite; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); flex: none; }
.dot-ok { background: var(--good); box-shadow: 0 0 0 0 rgba(12, 163, 12, 0.6); animation: ping 2.4s var(--ease) infinite; }
.dot-warn { background: var(--warn); }
.dot-error { background: var(--bad); }
@keyframes ping {
  0% { box-shadow: 0 0 0 0 rgba(12, 163, 12, 0.55); }
  70%, 100% { box-shadow: 0 0 0 8px rgba(12, 163, 12, 0); }
}
@keyframes pulse { 50% { opacity: 0.45; } }

/* ---------- Cards ---------- */
.card {
  position: relative;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 40%), var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
}
.card-tight { padding: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-head h3 { display: flex; align-items: center; gap: 10px; }
.card-icon {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: var(--surface-3); border: 1px solid var(--border); color: var(--text);
}
.card-icon svg { width: 18px; height: 18px; }
.spotlight { overflow: hidden; }
.spotlight::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(212, 255, 58, 0.09), transparent 45%);
  transition: opacity 0.3s;
}
.spotlight:hover::before { opacity: 1; }
.card-link { transition: transform 0.25s var(--ease), border-color 0.25s; }
.card-link:hover { transform: translateY(-3px); border-color: var(--border-strong); }

/* ---------- Forms ---------- */
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { padding: 0; margin-bottom: 6px; }
.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-size: 0.86rem; font-weight: 700; color: var(--text-2); }
.input, .textarea, .select {
  width: 100%; padding: 12px 14px; border-radius: 12px;
  background: var(--bg-elev); border: 1px solid var(--border-strong); color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.textarea { min-height: 110px; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(212, 255, 58, 0.12); }
.input[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--bad); box-shadow: 0 0 0 4px rgba(208, 59, 59, 0.14); }
.field-error { color: var(--bad-text); font-size: 0.84rem; font-weight: 600; min-height: 0; }
.field-hint { color: var(--text-3); font-size: 0.82rem; }
.input-wrap { position: relative; }
.input-wrap .input { padding-right: 76px; }
.input-wrap .reveal-btn { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }
.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; color: var(--text-2); font-size: 0.93rem; }
.check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--accent); flex: none; }
.choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 560px) { .choice-grid { grid-template-columns: 1fr; } }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.choice span {
  display: block; padding: 12px; border-radius: 12px; border: 1px solid var(--border-strong);
  background: var(--bg-elev); font-weight: 700; font-size: 0.92rem; text-align: center; transition: all 0.2s;
}
.choice small { display: block; font-weight: 500; color: var(--text-3); font-size: 0.76rem; }
.choice input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.choice input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-banner { padding: 12px 14px; border-radius: 12px; font-size: 0.92rem; font-weight: 600; }
.form-banner-error { background: rgba(208, 59, 59, 0.12); border: 1px solid rgba(208, 59, 59, 0.4); color: #ffc2c2; }
.form-banner-warn { background: rgba(250, 178, 25, 0.1); border: 1px solid rgba(250, 178, 25, 0.35); color: #ffe0a3; }
.meter { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.meter > i { display: block; height: 100%; width: var(--w, 0%); border-radius: inherit; background: var(--bad); transition: width 0.3s var(--ease), background 0.3s; }
.meter[data-level="2"] > i { background: var(--warn); }
.meter[data-level="3"] > i { background: var(--mint); }
.meter[data-level="4"] > i { background: var(--accent); }

/* ---------- Avatars ---------- */
.avatar {
  --size: 40px;
  width: var(--size); height: var(--size); border-radius: 50%; flex: none; overflow: hidden;
  display: inline-grid; place-items: center; font-weight: 800; color: var(--accent-ink);
  font-size: calc(var(--size) * 0.38); letter-spacing: -0.02em; background: var(--grad);
  border: 2px solid var(--bg);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-xs { --size: 28px; }
.avatar-sm { --size: 34px; }
.avatar-lg { --size: 64px; }
.avatar-xl { --size: 132px; border-width: 3px; }
.hue-0 { background: linear-gradient(135deg, #d4ff3a, #3affb2); }
.hue-1 { background: linear-gradient(135deg, #3ad6ff, #9d8cff); }
.hue-2 { background: linear-gradient(135deg, #ffb86b, #ff6b9a); }
.hue-3 { background: linear-gradient(135deg, #3affb2, #3ad6ff); }
.hue-4 { background: linear-gradient(135deg, #9d8cff, #ff6bd5); }
.hue-5 { background: linear-gradient(135deg, #ffe066, #ffb86b); }
.avatar-stack { display: flex; }
.avatar-stack .avatar + .avatar { margin-left: -10px; }
.avatar-ring { padding: 4px; border-radius: 50%; background: var(--grad); display: inline-block; }

/* ---------- Hero ---------- */
.hero { padding-top: clamp(40px, 8vw, 96px); padding-bottom: 40px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 48px; align-items: center; }
@media (max-width: 980px) { .hero-grid { grid-template-columns: minmax(0, 1fr); } }
.hero-copy { display: flex; flex-direction: column; gap: 24px; }
.pill {
  display: inline-flex; align-items: center; gap: 10px; align-self: flex-start;
  padding: 6px 14px 6px 8px; border-radius: 999px; border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.03); font-size: 0.86rem; font-weight: 600; color: var(--text-2);
}
.pill .badge { padding: 2px 8px; }
.social-proof { display: flex; align-items: center; gap: 14px; color: var(--text-2); font-size: 0.92rem; }

/* Live stack widget + console topology */
.stack-card { overflow: hidden; }
.stack-card .card-head { margin-bottom: 8px; }
.topology { width: 100%; height: auto; }
.topology .edge { fill: none; stroke: var(--border-strong); stroke-width: 2; }
.topology .edge-flow { fill: none; stroke: var(--accent); stroke-width: 2; stroke-dasharray: 4 10; stroke-linecap: round; animation: flow 1.1s linear infinite; opacity: 0.85; }
.topology .edge-flow.is-cyan { stroke: var(--cyan); }
.topology .is-down .edge-flow { stroke: var(--bad); animation: none; stroke-dasharray: 3 6; }
.topology .is-unknown .edge-flow { stroke: var(--text-3); animation: none; opacity: 0.5; }
.topology .packet { fill: var(--accent); filter: drop-shadow(0 0 6px rgba(212, 255, 58, 0.9)); }
.topology .packet.is-cyan { fill: var(--cyan); filter: drop-shadow(0 0 6px rgba(58, 214, 255, 0.9)); }
.topology .is-down .packet, .topology .is-unknown .packet { display: none; }
.topology .node-box { fill: var(--surface-2); stroke: var(--border-strong); stroke-width: 1.5; }
.topology .node.is-ok .node-box { stroke: rgba(12, 163, 12, 0.8); }
.topology .node.is-warn .node-box { stroke: rgba(250, 178, 25, 0.85); }
.topology .node.is-down .node-box { stroke: rgba(208, 59, 59, 0.9); fill: rgba(208, 59, 59, 0.08); }
.topology .zone { fill: rgba(58, 214, 255, 0.03); stroke: rgba(58, 214, 255, 0.35); stroke-dasharray: 5 5; }
.topology .zone-label { fill: var(--cyan); font-size: 11px; font-weight: 700; letter-spacing: 0.08em; }
.topology .node-title { fill: var(--text); font-size: 13px; font-weight: 700; }
.topology .node-sub { fill: var(--text-3); font-size: 11px; }
.topology .edge-label { fill: var(--text-2); font-size: 11px; font-family: var(--mono); }
.topology .node-status { font-size: 11px; font-weight: 800; }
.topology .is-ok .node-status { fill: var(--good-text); }
.topology .is-warn .node-status { fill: #ffd27a; }
.topology .is-down .node-status { fill: var(--bad-text); }
.topology .is-unknown .node-status { fill: var(--text-3); }
.topology .node-glyph { fill: none; stroke: var(--text-2); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
@keyframes flow { to { stroke-dashoffset: -28; } }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--border); border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border); }
.stats > div { background: var(--surface); padding: 26px 24px; }
.stat-value { font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 850; letter-spacing: -0.04em; line-height: 1; }
.stat-label { color: var(--text-2); font-size: 0.9rem; margin-top: 8px; }
@media (max-width: 720px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Programs / sessions ---------- */
.program-card { display: flex; flex-direction: column; gap: 14px; text-decoration: none; }
.program-card h3 { font-size: 1.25rem; }
.program-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; color: var(--text-3); font-size: 0.86rem; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 0.76rem; color: var(--text-2); padding: 2px 9px; border-radius: 6px; background: rgba(255, 255, 255, 0.05); }
.program-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 6px; }
.arrow-link { color: var(--accent); font-weight: 700; font-size: 0.9rem; text-decoration: none; }
.arrow-link::after { content: " →"; transition: margin 0.2s; }
.card-link:hover .arrow-link::after { margin-left: 4px; }
.steps { counter-reset: step; }
.step { position: relative; padding-top: 56px; }
.step::before {
  counter-increment: step; content: "0" counter(step);
  position: absolute; top: 20px; left: 24px; font-family: var(--mono); font-weight: 700; color: var(--accent); font-size: 0.9rem;
}
.day-group { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 24px; padding-block: 22px; border-top: 1px solid var(--border); }
.day-group:first-child { border-top: none; }
.day-label { position: sticky; top: 90px; align-self: start; }
.day-label strong { display: block; font-size: 1.25rem; letter-spacing: -0.02em; }
@media (max-width: 760px) {
  .day-group { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .day-label { position: static; }
}
.session-row {
  display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: 18px; align-items: center;
  padding: 18px 20px;
}
.session-row + .session-row { margin-top: 12px; }
.session-time { font-family: var(--mono); font-weight: 700; font-size: 1.05rem; }
.session-time small { display: block; color: var(--text-3); font-weight: 500; font-size: 0.78rem; }
@media (max-width: 620px) {
  .session-row { grid-template-columns: minmax(0, 1fr); gap: 10px; }
}
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.empty {
  padding: 48px 24px; text-align: center; color: var(--text-2);
  border: 1px dashed var(--border-strong); border-radius: var(--radius-lg);
  align-items: center;
}
.empty .row { justify-content: center; }
.empty h1, .empty h2 { color: var(--text); }

/* ---------- Community / newsletter ---------- */
.member-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 14px; }
.member { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 10px; text-align: center; }
.member .avatar { --size: 64px; }
.member-name { font-weight: 700; font-size: 0.92rem; }
.cta-card {
  overflow: hidden;
  background:
    radial-gradient(60% 120% at 100% 0%, rgba(58, 214, 255, 0.16), transparent 60%),
    radial-gradient(60% 120% at 0% 100%, rgba(212, 255, 58, 0.14), transparent 60%),
    var(--surface);
}
.cta-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 36px; align-items: center; }
@media (max-width: 860px) { .cta-grid { grid-template-columns: minmax(0, 1fr); } }
.inline-form { display: flex; gap: 10px; flex-wrap: wrap; }
.inline-form .input { flex: 1 1 220px; }

/* ---------- Receipt (S3 write confirmation) ---------- */
.receipt {
  border-radius: 14px; padding: 14px 16px; background: var(--bg-elev);
  border: 1px solid rgba(12, 163, 12, 0.35); font-size: 0.86rem;
}
.receipt-row { display: flex; justify-content: space-between; gap: 12px; padding-block: 3px; }
.receipt-row span:first-child { color: var(--text-3); flex: none; }
.receipt-row span:last-child { font-family: var(--mono); text-align: right; overflow-wrap: anywhere; }
.receipt-plain { border-color: var(--border-strong); }
.receipt-plain .receipt-row span:last-child { font-family: var(--font); font-weight: 600; }
.success-mark {
  width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; margin-inline: auto;
  background: var(--accent-soft); border: 1px solid rgba(212, 255, 58, 0.4);
}
.success-mark svg { width: 30px; height: 30px; stroke: var(--accent); stroke-width: 3; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.success-mark path { stroke-dasharray: 30; stroke-dashoffset: 30; animation: draw 0.6s 0.1s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ---------- Auth ---------- */
.auth-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 640px; overflow: hidden; padding: 0; margin-top: 40px; }
.auth-art {
  position: relative; padding: 40px; display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
  background:
    radial-gradient(80% 60% at 20% 10%, rgba(212, 255, 58, 0.25), transparent 60%),
    radial-gradient(70% 60% at 90% 90%, rgba(58, 214, 255, 0.25), transparent 60%),
    var(--surface-2);
  border-right: 1px solid var(--border);
}
.auth-art blockquote { margin: 0; font-size: 1.35rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.35; }
.auth-form { padding: 40px; display: flex; flex-direction: column; justify-content: center; gap: 22px; max-width: 480px; width: 100%; margin-inline: auto; }
@media (max-width: 860px) {
  .auth-wrap { grid-template-columns: minmax(0, 1fr); }
  .auth-art { display: none; }
  .auth-form { padding: 28px 22px; }
}

/* ---------- Profile ---------- */
.profile-head { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.dropzone {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center;
  padding: 28px; border-radius: var(--radius); border: 1.5px dashed var(--border-strong); background: var(--bg-elev);
  cursor: pointer; transition: border-color 0.2s, background 0.2s;
}
.dropzone:hover, .dropzone.is-over, .dropzone:focus-within { border-color: var(--accent); background: var(--accent-soft); }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.preview { width: 160px; height: 160px; border-radius: 50%; object-fit: cover; border: 3px solid var(--border-strong); }
.progress { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress > i { display: block; height: 100%; width: var(--w, 0%); background: var(--grad); transition: width 0.15s linear; }
.session-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.session-item:first-child { border-top: none; }
.danger-zone { border-color: rgba(208, 59, 59, 0.35); }

/* ---------- Console ---------- */
.banner {
  display: flex; align-items: center; gap: 16px; padding: 18px 22px; border-radius: var(--radius-lg);
  border: 1px solid var(--border); background: var(--surface);
}
.banner-ok { border-color: rgba(12, 163, 12, 0.45); background: linear-gradient(90deg, rgba(12, 163, 12, 0.12), transparent 60%), var(--surface); }
.banner-warn { border-color: rgba(250, 178, 25, 0.45); background: linear-gradient(90deg, rgba(250, 178, 25, 0.1), transparent 60%), var(--surface); }
.banner-error { border-color: rgba(208, 59, 59, 0.5); background: linear-gradient(90deg, rgba(208, 59, 59, 0.14), transparent 60%), var(--surface); }
.banner .status-icon { width: 34px; height: 34px; font-size: 18px; }
.banner h2 { font-size: 1.3rem; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 0.88rem; font-weight: 600; color: var(--text-2); }
.switch input { appearance: none; width: 36px; height: 20px; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--border-strong); position: relative; cursor: pointer; transition: background 0.2s; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--text-2); transition: transform 0.2s var(--ease), background 0.2s; }
.switch input:checked { background: var(--accent-soft); border-color: rgba(212, 255, 58, 0.5); }
.switch input:checked::after { transform: translateX(16px); background: var(--accent); }
.is-refreshing .refresh-dim { opacity: 0.55; transition: opacity 0.2s; }

.tile { display: flex; flex-direction: column; gap: 6px; min-height: 150px; }
.tile-label { color: var(--text-2); font-size: 0.86rem; font-weight: 600; }
.tile-value { font-size: 2.1rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; }
.tile-value small { font-size: 0.95rem; color: var(--text-2); font-weight: 600; margin-left: 2px; }
.tile-sub { color: var(--text-3); font-size: 0.8rem; }
.spark { width: 100%; height: 48px; margin-top: auto; overflow: visible; }
.spark .spark-line { fill: none; stroke: var(--series); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spark .spark-area { fill: var(--series-wash); }
.spark .spark-dot { fill: var(--series); stroke: var(--surface); stroke-width: 2; }
.spark .spark-cross { stroke: var(--text-3); stroke-width: 1; }
.spark .spark-hit { fill: transparent; }
.spark-tip {
  position: fixed; z-index: 60; pointer-events: none; padding: 6px 10px; border-radius: 8px;
  background: var(--surface-3); border: 1px solid var(--border-strong); font-size: 0.8rem; box-shadow: var(--shadow);
  transform: translate(-50%, calc(-100% - 10px));
}
.spark-tip strong { display: block; font-size: 0.95rem; }
.spark-tip span { color: var(--text-3); }

.kv { display: grid; grid-template-columns: minmax(120px, max-content) minmax(0, 1fr); gap: 8px 18px; margin: 0; font-size: 0.9rem; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; overflow-wrap: anywhere; font-family: var(--mono); font-size: 0.86rem; color: var(--text); }
.kv dd.plain { font-family: var(--font); font-size: 0.9rem; }
.check-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.check-list li { display: flex; gap: 10px; align-items: flex-start; font-size: 0.92rem; }
.check-list .status-icon { margin-top: 1px; }
.check-list small { display: block; color: var(--text-3); font-size: 0.8rem; overflow-wrap: anywhere; }
.alert { border-radius: 12px; padding: 12px 14px; font-size: 0.88rem; display: flex; flex-direction: column; gap: 4px; }
.alert strong { font-weight: 700; }
.alert-error { background: rgba(208, 59, 59, 0.1); border: 1px solid rgba(208, 59, 59, 0.4); }
.alert-warn { background: rgba(250, 178, 25, 0.08); border: 1px solid rgba(250, 178, 25, 0.35); }
.alert-note { background: rgba(58, 214, 255, 0.06); border: 1px solid rgba(58, 214, 255, 0.25); }
.alert .hint { color: var(--text-2); }
.alert .hint::before { content: "Fix: "; font-weight: 700; color: var(--text); }
.perm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 1100px) { .perm-grid { grid-template-columns: minmax(0, 1fr); } }
.perm { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 10px; background: var(--bg-elev); border: 1px solid var(--border); font-family: var(--mono); font-size: 0.8rem; }

.waterfall { display: flex; flex-direction: column; gap: 8px; }
.wf-row { display: grid; grid-template-columns: 128px minmax(0, 1fr) 64px; gap: 10px; align-items: center; font-size: 0.82rem; }
.wf-name { font-family: var(--mono); color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.wf-track { position: relative; height: 12px; }
.wf-bar {
  position: absolute; top: 0; bottom: 0; left: var(--x, 0%); width: max(var(--w, 0%), 3px);
  background: var(--series); border-radius: 0 4px 4px 0;
}
.wf-row.is-failed .wf-bar { background: var(--bad); }
.wf-ms { text-align: right; font-family: var(--mono); color: var(--text); }
.timing-bars { display: flex; flex-direction: column; gap: 8px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.table th {
  text-align: left; font-weight: 700; color: var(--text-3); font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 12px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; font-variant-numeric: tabular-nums; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background 0.15s; }
.table tbody tr.is-clickable { cursor: pointer; }
.table tbody tr.is-clickable:hover { background: rgba(255, 255, 255, 0.03); }
.search-input { flex: 1 1 240px; max-width: 380px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tab {
  background: none; border: none; padding: 12px 16px; color: var(--text-2); font-weight: 700; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.code {
  margin: 0; padding: 16px; border-radius: 12px; background: #05060a; border: 1px solid var(--border);
  font-family: var(--mono); font-size: 0.8rem; line-height: 1.55; overflow: auto; max-height: 460px; color: #cfe3ff; white-space: pre;
}
details.raw > summary { cursor: pointer; font-weight: 700; color: var(--text-2); padding-block: 8px; }

/* ---------- Dialog ---------- */
dialog.modal {
  width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0;
  border: 1px solid var(--border-strong); border-radius: var(--radius-lg);
  background: var(--surface); color: var(--text); box-shadow: 0 40px 120px -20px rgba(0, 0, 0, 0.85);
}
dialog.modal-wide { width: min(820px, calc(100vw - 32px)); }
dialog.modal::backdrop { background: rgba(3, 4, 8, 0.72); backdrop-filter: blur(6px); }
dialog.modal[open] { animation: pop 0.25s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(0.98); } }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-body { padding: 22px; overflow: auto; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; z-index: 80; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 10px; max-width: min(420px, calc(100vw - 32px)); }
.toast {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px;
  background: var(--surface-2); border: 1px solid var(--border-strong); box-shadow: var(--shadow);
  font-size: 0.92rem; animation: slide-in 0.3s var(--ease);
}
.toast.is-leaving { animation: slide-out 0.25s var(--ease) forwards; }
.toast small { display: block; color: var(--text-3); font-family: var(--mono); font-size: 0.74rem; margin-top: 2px; }
@keyframes slide-in { from { opacity: 0; transform: translateY(12px); } }
@keyframes slide-out { to { opacity: 0; transform: translateY(12px); } }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding-block: 32px; color: var(--text-3); font-size: 0.88rem; background: rgba(7, 8, 12, 0.6); }
.footer-grid { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.status-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); color: var(--text-2); text-decoration: none; font-weight: 600; }
.stack-chips { display: flex; flex-wrap: wrap; gap: 6px; }

.footer-link { color: var(--text-2); text-decoration: none; font-weight: 600; }
.footer-link:hover { color: var(--accent); }

/* ---------- Credits ---------- */
.credits {
  min-height: calc(100vh - 68px - 120px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 32px; padding-block: 64px; text-align: center;
}
.credits-people { display: flex; justify-content: center; align-items: flex-start; gap: clamp(28px, 9vw, 110px); }
.credit { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.credit-photo {
  --size: clamp(128px, 26vw, 230px);
  width: var(--size); height: var(--size); padding: 5px; border-radius: 50%;
  background: var(--grad);
  box-shadow: 0 0 70px -12px rgba(58, 214, 255, 0.5), 0 0 40px -18px rgba(212, 255, 58, 0.6);
  animation: float 6s ease-in-out infinite;
}
.credit:nth-child(2) .credit-photo { animation-delay: -3s; }
.credit-photo img,
.credit-initial {
  display: block; width: 100%; height: 100%; border-radius: 50%;
  border: 4px solid var(--bg); object-fit: cover;
}
.credit-initial {
  display: grid; place-items: center;
  font-size: calc(var(--size) * 0.4); font-weight: 850; color: var(--accent-ink);
}
.credit-name { font-size: clamp(1.4rem, 3vw, 2.1rem); font-weight: 800; letter-spacing: -0.02em; }
.credits-caption { margin-top: clamp(20px, 4vw, 40px); font-size: clamp(1.7rem, 5vw, 3.2rem); font-weight: 850; letter-spacing: -0.035em; line-height: 1.1; }
@keyframes float { 50% { transform: translateY(-10px); } }

/* ---------- Skeletons & reveal ---------- */
.skeleton {
  border-radius: 10px; min-height: 16px;
  background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2));
  background-size: 200% 100%; animation: sheen 1.4s linear infinite;
}
.skeleton-card { height: 180px; border-radius: var(--radius-lg); }
@keyframes sheen { to { background-position: -200% 0; } }
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); transition-delay: var(--delay, 0s); }
.reveal.is-visible { opacity: 1; transform: none; }
.fade-in { animation: fade 0.4s var(--ease); }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
  .topology .packet { display: none; }
}
@media (forced-colors: active) {
  .status-icon, .dot { forced-color-adjust: none; }
  .wf-bar { background: CanvasText; }
}
