/* Nocturne Messenger Studio — sealed DMs preview for Midnight */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Space+Grotesk:wght@500;600;700&display=swap");

:root {
  --bg: #05070f;
  --bg-elevated: rgba(14, 20, 36, 0.72);
  --bg-card: rgba(16, 24, 48, 0.68);
  --text: #eef2ff;
  --muted: #9aa8c7;
  --accent: #7c9cff;
  --accent-2: #a78bfa;
  --accent-3: #22d3ee;
  --ok: #6ee7b7;
  --warn: #fbbf24;
  --danger: #fb7185;
  --bad: #fb7185;
  --fail: #fb7185;
  --line: rgba(124, 156, 255, 0.22);
  --line-strong: rgba(124, 156, 255, 0.4);
  --radius: 18px;
  --radius-sm: 12px;
  --font: "Inter", system-ui, -apple-system, sans-serif;
  --display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --focus: 0 0 0 3px rgba(124, 156, 255, 0.45);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; transition: color 0.2s var(--ease); }
a:hover { color: #a5b8ff; }
a:focus-visible, button:focus-visible, .btn:focus-visible,
input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: none; box-shadow: var(--focus); border-radius: 8px;
}
code, .mono { font-family: var(--mono); font-size: 0.88em; }
code:not(pre code) {
  background: rgba(124, 156, 255, 0.12);
  padding: 0.15em 0.45em;
  border-radius: 6px;
  border: 1px solid rgba(124, 156, 255, 0.12);
}
kbd {
  font-family: var(--mono); font-size: 0.78em;
  padding: 0.12em 0.4em; border-radius: 6px;
  border: 1px solid var(--line); background: rgba(255,255,255,0.04);
}

.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: -9999px; top: 0.75rem; z-index: 100;
  padding: 0.6rem 1rem; background: var(--accent); color: #0a0e1a;
  font-weight: 600; border-radius: 10px;
}
.skip-link:focus { left: 0.75rem; }

.bg-scene {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  background:
    radial-gradient(ellipse 100% 60% at 50% -15%, rgba(167, 139, 250, 0.26), transparent 55%),
    radial-gradient(ellipse 70% 50% at 95% 20%, rgba(124, 156, 255, 0.16), transparent 50%),
    radial-gradient(ellipse 60% 45% at 5% 70%, rgba(34, 211, 238, 0.12), transparent 50%),
    linear-gradient(180deg, #04060d 0%, #070b18 45%, #05070f 100%);
}
.starfield { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.55; }
.bg-aurora {
  position: absolute; inset: -20% -10% auto;
  height: 55%; opacity: 0.35; filter: blur(40px);
  background: linear-gradient(105deg,
    transparent 10%,
    rgba(124, 156, 255, 0.35) 30%,
    rgba(167, 139, 250, 0.45) 48%,
    rgba(34, 211, 238, 0.28) 62%,
    transparent 85%);
  animation: auroraShift 18s ease-in-out infinite alternate;
}
.bg-aurora-2 {
  top: 40%; opacity: 0.22; transform: scaleX(-1);
  animation-delay: -8s;
}
@keyframes auroraShift {
  from { transform: translateX(-4%) rotate(-2deg); }
  to { transform: translateX(6%) rotate(2deg); }
}
.bg-nebula {
  position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.5;
  animation: nebulaDrift 22s ease-in-out infinite alternate;
}
.bg-nebula-a {
  width: 55vw; height: 40vh; top: -8%; left: 15%;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.4), transparent 70%);
}
.bg-nebula-b {
  width: 45vw; height: 35vh; right: -8%; top: 35%;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.22), transparent 70%);
  animation-delay: -7s;
}
.bg-nebula-c {
  width: 40vw; height: 30vh; left: -5%; bottom: 5%;
  background: radial-gradient(circle, rgba(124, 156, 255, 0.28), transparent 70%);
  animation-delay: -14s;
}
.bg-grid {
  position: absolute; inset: 0; opacity: 0.07;
  background-image:
    linear-gradient(rgba(124,156,255,0.4) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124,156,255,0.4) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 50% 30%, black 15%, transparent 72%);
}
.orb {
  position: absolute; border-radius: 50%; filter: blur(70px); opacity: 0.4;
  animation: nebulaDrift 20s ease-in-out infinite alternate;
}
.orb-a { width: 380px; height: 380px; top: -5%; right: 8%; background: rgba(124, 156, 255, 0.4); }
.orb-b { width: 280px; height: 280px; bottom: 12%; left: -4%; background: rgba(167, 139, 250, 0.35); animation-delay: -9s; }
.orb-c { width: 220px; height: 220px; top: 48%; left: 42%; background: rgba(34, 211, 238, 0.2); animation-delay: -4s; }
@keyframes nebulaDrift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(28px, -22px) scale(1.08); }
}

.topbar, .wrap, .donate-dock { position: relative; z-index: 1; }

.topbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0.65rem; padding: 0.85rem clamp(1rem, 3vw, 1.75rem);
  border-bottom: 1px solid var(--line);
  background: rgba(5, 7, 15, 0.72); backdrop-filter: blur(16px);
  position: sticky; top: 0; z-index: 20;
}
.logo {
  font-family: var(--display); font-weight: 700; font-size: 1.15rem;
  letter-spacing: -0.02em; color: var(--text);
}
.logo span {
  background: linear-gradient(135deg, var(--accent-3), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.topbar nav { display: flex; flex-wrap: wrap; gap: 0.35rem 0.85rem; align-items: center; }
.topbar nav a {
  color: var(--muted); font-size: 0.88rem; font-weight: 500;
  padding: 0.25rem 0.15rem; border-radius: 6px;
}
.topbar nav a:hover { color: var(--text); }
.nav-toggle {
  display: none; margin-left: auto;
  background: rgba(255,255,255,0.04); border: 1px solid var(--line);
  color: var(--text); border-radius: 10px; padding: 0.35rem 0.65rem; cursor: pointer;
}
@media (max-width: 960px) {
  .nav-toggle { display: inline-flex; }
  .topbar nav {
    display: none; width: 100%; flex-direction: column; align-items: flex-start;
    padding: 0.5rem 0 0.25rem; gap: 0.55rem;
  }
  .topbar nav.is-open { display: flex; }
}

.badge {
  display: inline-block; padding: 0.3rem 0.7rem; border-radius: 999px;
  border: 1px solid rgba(167, 139, 250, 0.35); color: #d8b4fe;
  font-size: 0.72rem; font-weight: 650; letter-spacing: 0.04em;
  text-transform: uppercase; background: rgba(167, 139, 250, 0.12);
}
.badge-stub { border-color: rgba(251, 191, 36, 0.45); color: var(--warn); background: rgba(251, 191, 36, 0.08); }
.badge-sim { background: rgba(251, 191, 36, 0.12); color: var(--warn); border-color: rgba(251, 191, 36, 0.35); }
.badge-lab { background: rgba(34, 211, 238, 0.12); color: var(--accent-3); border-color: rgba(34, 211, 238, 0.35); }
.badge-new { background: rgba(110, 231, 183, 0.14); color: var(--ok); border-color: rgba(110, 231, 183, 0.4); }

.donate-dock {
  position: fixed; z-index: 30; right: 1rem; bottom: 1rem;
  display: flex; align-items: center; gap: 0.45rem;
  padding: 0.55rem 0.85rem; border-radius: 999px;
  background: rgba(8, 12, 24, 0.88); backdrop-filter: blur(14px);
  border: 1px solid var(--line-strong); box-shadow: var(--shadow);
  font-size: 0.82rem; font-weight: 600;
}
.dock-x { color: var(--accent-3); }
.dock-sep { color: var(--muted); opacity: 0.6; }
.dock-copy {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #0a0e1a; border: none; border-radius: 999px;
  padding: 0.35rem 0.75rem; font: inherit; font-weight: 700; cursor: pointer;
  transition: transform 0.2s var(--ease);
}
.dock-copy:hover { transform: translateY(-1px); }
@media (max-width: 520px) {
  .donate-dock { left: 0.75rem; right: 0.75rem; justify-content: center; }
}

.wrap {
  max-width: 1180px; margin: 0 auto;
  padding: 1.25rem clamp(1rem, 3vw, 1.5rem) 5rem;
}

.hero {
  border-radius: 22px; padding: clamp(1.35rem, 3.5vw, 2rem);
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(18, 26, 52, 0.88), rgba(10, 14, 28, 0.55));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  margin-bottom: 1.25rem; position: relative; overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; inset: -40% auto auto -10%;
  width: 60%; height: 80%; pointer-events: none;
  background: radial-gradient(circle, rgba(167,139,250,0.18), transparent 70%);
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.55rem;
  color: var(--accent-3); font-size: 0.82rem; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase; margin: 0 0 0.75rem;
}
.eyebrow .dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent-3);
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.8);
  animation: pulseDot 2.4s ease-in-out infinite;
}
@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.85); }
}
.hero h1 {
  font-family: var(--display); font-size: clamp(1.85rem, 4.5vw, 2.65rem);
  letter-spacing: -0.03em; margin: 0 0 0.75rem; line-height: 1.15;
}
.lede { color: var(--muted); font-size: 1.05rem; max-width: 62ch; margin: 0 0 1.15rem; }
.lede strong { color: var(--text); font-weight: 650; }
.cta-row { display: flex; flex-wrap: wrap; gap: 0.55rem; margin-bottom: 0.95rem; }
.kbd-bar {
  display: flex; flex-wrap: wrap; gap: 0.45rem; margin-bottom: 1rem;
}
.kbd {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.3rem 0.65rem; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(255,255,255,0.03);
  color: var(--muted); font-size: 0.78rem; font-weight: 500;
}
.honesty {
  padding: 0.85rem 1rem; border-radius: var(--radius-sm);
  border: 1px solid rgba(251, 191, 36, 0.28);
  background: rgba(251, 191, 36, 0.06);
  color: var(--muted); font-size: 0.9rem;
}
.honesty strong { color: var(--warn); }

.panel {
  border-radius: var(--radius); padding: clamp(1.15rem, 2.5vw, 1.55rem);
  border: 1px solid var(--line);
  background: var(--bg-elevated); backdrop-filter: blur(12px);
  box-shadow: var(--shadow); margin-bottom: 1.15rem;
}
.section-head { margin-bottom: 1rem; }
.section-head h2 {
  font-family: var(--display); font-size: clamp(1.25rem, 2.5vw, 1.55rem);
  margin: 0 0 0.35rem; letter-spacing: -0.02em;
}
.muted { color: var(--muted); }
.small { font-size: 0.86rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem;
  padding: 0.6rem 1.05rem; border-radius: 12px; font: inherit; font-weight: 650;
  font-size: 0.92rem; cursor: pointer; border: 1px solid transparent;
  transition: transform 0.2s var(--ease), background 0.2s, border-color 0.2s, color 0.2s;
  text-decoration: none; color: var(--text);
}
.btn:hover { transform: translateY(-1px); }
.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #0a0e1a; border: none;
}
.btn.ghost {
  background: rgba(255,255,255,0.03); border-color: var(--line); color: var(--text);
}
.btn.ghost:hover { border-color: var(--line-strong); background: rgba(124,156,255,0.08); }
.btn.small { padding: 0.4rem 0.75rem; font-size: 0.82rem; border-radius: 10px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.55rem; }

.journey {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0.55rem;
}
@media (max-width: 1100px) {
  .journey { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .journey { grid-template-columns: 1fr 1fr; }
}
.journey-step {
  display: flex; gap: 0.65rem; align-items: flex-start;
  padding: 0.75rem 0.85rem; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: rgba(255,255,255,0.02);
  transition: border-color 0.25s var(--ease), background 0.25s, box-shadow 0.25s;
}
.journey-step .js-idx {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center;
  font-size: 0.78rem; font-weight: 700;
  background: rgba(124,156,255,0.12); color: var(--accent); border: 1px solid var(--line);
}
.journey-step strong { display: block; font-size: 0.92rem; }
.js-detail { display: block; color: var(--muted); font-size: 0.78rem; margin-top: 0.15rem; }
.journey-step.is-active {
  border-color: rgba(34, 211, 238, 0.55);
  background: rgba(34, 211, 238, 0.08);
  box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.15);
}
.journey-step.is-active .js-idx {
  background: linear-gradient(135deg, var(--accent-3), var(--accent));
  color: #0a0e1a; border-color: transparent;
}
.journey-step.is-done { border-color: rgba(110, 231, 183, 0.35); }
.journey-step.is-done .js-idx {
  background: rgba(110, 231, 183, 0.18); color: var(--ok); border-color: rgba(110, 231, 183, 0.35);
}
.journey-live { margin: 0.85rem 0 0; }
.status { font-size: 0.9rem; color: var(--muted); }
.status.ok { color: var(--ok); }
.status.warn { color: var(--warn); }
.status.danger { color: var(--danger); }

.lesson-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem;
}
@media (max-width: 900px) {
  .lesson-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .lesson-grid { grid-template-columns: 1fr; }
}
.lesson-card {
  text-align: left; cursor: pointer;
  padding: 1rem 1.05rem; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: rgba(255,255,255,0.025);
  color: inherit; font: inherit;
  transition: transform 0.2s var(--ease), border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.lesson-card:hover {
  transform: translateY(-2px); border-color: var(--line-strong);
  background: rgba(124,156,255,0.06);
}
.lesson-card.is-active {
  border-color: rgba(167, 139, 250, 0.55);
  background: rgba(167, 139, 250, 0.1);
  box-shadow: 0 0 0 1px rgba(167, 139, 250, 0.2), var(--shadow);
}
.lesson-card .lc-top {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 0.5rem;
  margin-bottom: 0.45rem;
}
.lesson-card .lc-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center;
  background: rgba(124,156,255,0.12); border: 1px solid var(--line);
  font-size: 1rem;
}
.lesson-card h3 { margin: 0 0 0.35rem; font-size: 1rem; font-family: var(--display); }
.lesson-card p { margin: 0; color: var(--muted); font-size: 0.84rem; }

.threat-rail {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-bottom: 1rem;
}
@media (max-width: 700px) { .threat-rail { grid-template-columns: 1fr; } }
.rail {
  padding: 0.9rem 1rem; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: rgba(255,255,255,0.02);
}
.rail h4 { margin: 0 0 0.25rem; font-size: 0.95rem; }
.rail-meter {
  height: 10px; border-radius: 999px; background: rgba(255,255,255,0.06);
  overflow: hidden; margin: 0.55rem 0 0.35rem; border: 1px solid var(--line);
}
.rail-fill {
  height: 100%; width: 0%; border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-3), var(--accent-2));
  transition: width 0.55s var(--ease);
}
.sealed-rail .rail-fill {
  background: linear-gradient(90deg, rgba(167,139,250,0.9), rgba(34,211,238,0.85));
}
.disclose-rail .rail-fill {
  background: linear-gradient(90deg, var(--accent), #93c5fd);
}
.rail-label { margin: 0; font-size: 0.8rem; color: var(--muted); }

.atelier-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0.65rem; margin-bottom: 0.75rem;
}
.toolbar-meta { color: var(--muted); font-size: 0.88rem; font-weight: 500; }
.toolbar-actions { display: flex; flex-wrap: wrap; gap: 0.45rem; }

.construct-chips {
  display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.85rem; min-height: 2rem;
}
.chip {
  appearance: none; cursor: pointer;
  padding: 0.32rem 0.7rem; border-radius: 999px; font: inherit; font-size: 0.78rem; font-weight: 600;
  border: 1px solid var(--line); background: rgba(255,255,255,0.03); color: var(--muted);
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s;
}
.chip:hover { color: var(--text); border-color: var(--line-strong); transform: translateY(-1px); }
.chip.is-active {
  color: #0a0e1a; border-color: transparent;
  background: linear-gradient(135deg, var(--accent-3), var(--accent-2));
}

.atelier-split {
  display: grid; grid-template-columns: 1.35fr 1fr; gap: 0.85rem;
}
@media (max-width: 920px) {
  .atelier-split { grid-template-columns: 1fr; }
}
.editor-pane, .explain-pane {
  border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: rgba(8, 12, 24, 0.55); overflow: hidden;
  display: flex; flex-direction: column; min-height: 420px;
}
.pane-head {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,0.02);
}
.pane-head h3 { margin: 0; font-size: 0.95rem; font-family: var(--display); }
.editor-shell {
  display: grid; grid-template-columns: auto 1fr; flex: 1; min-height: 0;
  background: #070b14;
}
.line-numbers {
  margin: 0; padding: 0.9rem 0.55rem 0.9rem 0.75rem;
  font-family: var(--mono); font-size: 0.78rem; line-height: 1.55;
  color: rgba(154, 168, 199, 0.45); text-align: right; user-select: none;
  border-right: 1px solid rgba(124,156,255,0.12);
  overflow: hidden;
}
#code-editor {
  width: 100%; height: 100%; min-height: 380px; resize: vertical;
  border: none; outline: none; background: transparent; color: #e8edff;
  font-family: var(--mono); font-size: 0.82rem; line-height: 1.55;
  padding: 0.9rem 0.85rem; tab-size: 2; white-space: pre; overflow: auto;
  box-shadow: none !important; border-radius: 0;
}
#code-editor:focus-visible { box-shadow: inset 0 0 0 2px rgba(124,156,255,0.35) !important; }
.explain-body {
  padding: 0.95rem 1rem; flex: 1; overflow: auto;
  font-size: 0.92rem;
}
.explain-body h4 { margin: 0 0 0.4rem; font-family: var(--display); font-size: 1.05rem; }
.explain-body .explain-kind {
  display: inline-block; margin-bottom: 0.55rem;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--accent-3);
}
.explain-body ul { margin: 0.5rem 0 0; padding-left: 1.15rem; color: var(--muted); }
.explain-body li { margin: 0.25rem 0; }
.explain-tags {
  display: flex; flex-wrap: wrap; gap: 0.35rem;
  padding: 0 1rem 1rem;
}
.tag {
  font-size: 0.72rem; font-weight: 600; padding: 0.2rem 0.55rem; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted); background: rgba(255,255,255,0.03);
}

.glossary-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.65rem;
}
@media (max-width: 860px) { .glossary-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .glossary-grid { grid-template-columns: 1fr; } }
.glossary-card {
  padding: 0.85rem 0.95rem; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: rgba(255,255,255,0.02);
  cursor: pointer; text-align: left; color: inherit; font: inherit;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}
.glossary-card:hover {
  border-color: var(--line-strong); background: rgba(124,156,255,0.06);
  transform: translateY(-1px);
}
.glossary-card strong {
  display: block; font-family: var(--mono); font-size: 0.88rem;
  color: var(--accent-3); margin-bottom: 0.3rem;
}
.glossary-card span { color: var(--muted); font-size: 0.82rem; }

.lint-layout {
  display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: start;
  margin-bottom: 0.85rem;
}
@media (max-width: 720px) { .lint-layout { grid-template-columns: 1fr; } }
.lint-scorecard {
  display: flex; gap: 1rem; align-items: center;
  padding: 0.85rem 1rem; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: rgba(255,255,255,0.02);
}
.score-ring {
  position: relative; width: 96px; height: 96px; flex-shrink: 0;
}
.score-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: rgba(255,255,255,0.08); stroke-width: 8; }
.ring-fill {
  fill: none; stroke: url(#none); stroke-width: 8; stroke-linecap: round;
  stroke: var(--accent-3); stroke-dasharray: 327; stroke-dashoffset: 327;
  transition: stroke-dashoffset 0.7s var(--ease), stroke 0.3s;
}
.score-num {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--display); font-weight: 700; font-size: 1.35rem;
}
.lint-findings {
  padding: 0.85rem 1rem; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: rgba(255,255,255,0.02);
  min-height: 120px;
}
.finding {
  display: grid; grid-template-columns: auto 1fr; gap: 0.55rem;
  padding: 0.55rem 0; border-bottom: 1px solid rgba(124,156,255,0.1);
}
.finding:last-child { border-bottom: none; }
.finding-sev {
  font-size: 0.68rem; font-weight: 750; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 0.2rem 0.45rem; border-radius: 6px; height: fit-content;
}
.finding-sev.ok { background: rgba(110,231,183,0.12); color: var(--ok); }
.finding-sev.warn { background: rgba(251,191,36,0.12); color: var(--warn); }
.finding-sev.danger { background: rgba(251,113,133,0.12); color: var(--danger); }
.finding-sev.info { background: rgba(124,156,255,0.12); color: var(--accent); }
.finding strong { display: block; font-size: 0.9rem; }
.finding p { margin: 0.2rem 0 0; color: var(--muted); font-size: 0.82rem; }

.log {
  margin: 0; padding: 0.85rem 1rem; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: #070b14;
  font-family: var(--mono); font-size: 0.78rem; line-height: 1.55;
  color: #c7d2fe; max-height: 220px; overflow: auto; white-space: pre-wrap;
}

.donate-card {
  padding: 1rem; border-radius: var(--radius-sm);
  border: 1px dashed rgba(167,139,250,0.4);
  background: rgba(167,139,250,0.06);
}
.donate-addr {
  word-break: break-all; margin: 0 0 0.85rem;
  padding: 0.75rem 0.85rem; border-radius: 10px;
  background: rgba(0,0,0,0.25); border: 1px solid var(--line);
  font-size: 0.82rem;
}

.site-footer {
  margin-top: 1.5rem; padding: 1.25rem 0 3rem;
  border-top: 1px solid var(--line); color: var(--muted); font-size: 0.88rem;
}
.site-footer p { margin: 0 0 0.4rem; }

.toast {
  position: fixed; z-index: 40; left: 50%; bottom: 4.5rem;
  transform: translateX(-50%) translateY(12px);
  padding: 0.65rem 1.05rem; border-radius: 999px;
  background: rgba(12, 18, 36, 0.94); border: 1px solid var(--line-strong);
  box-shadow: var(--shadow); color: var(--text); font-weight: 600; font-size: 0.88rem;
  opacity: 0; pointer-events: none; transition: opacity 0.25s, transform 0.25s var(--ease);
  max-width: min(90vw, 420px); text-align: center;
}
.toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }

.help-overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(3, 5, 12, 0.72); backdrop-filter: blur(8px);
  display: grid; place-items: center; padding: 1rem;
}
.help-overlay[hidden] { display: none !important; }
.help-card {
  width: min(440px, 100%); padding: 1.25rem 1.35rem;
  border-radius: 18px; border: 1px solid var(--line-strong);
  background: rgba(12, 18, 34, 0.96); box-shadow: var(--shadow);
}
.help-card h3 { margin: 0 0 0.75rem; font-family: var(--display); }
.help-card ul { list-style: none; margin: 0; padding: 0; }
.help-card li {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: 0.45rem 0; border-bottom: 1px solid rgba(124,156,255,0.12);
  color: var(--muted); font-size: 0.9rem;
}
.help-card li span:last-child {
  font-family: var(--mono); color: var(--accent-3); font-weight: 650;
}

.reveal {
  opacity: 0; transform: translateY(14px);
  transition: opacity 0.55s var(--ease), transform 0.55s var(--ease);
}
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
}


/* —— Nocturne messenger-specific —— */
.identity-grid {
  display: grid; grid-template-columns: 1.15fr 1fr; gap: 0.85rem;
}
@media (max-width: 860px) { .identity-grid { grid-template-columns: 1fr; } }
.identity-form, .identity-card {
  padding: 1rem 1.05rem; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: rgba(255,255,255,0.02);
}
.identity-form label {
  display: block; font-size: 0.82rem; font-weight: 600; color: var(--muted);
  margin: 0.55rem 0 0.35rem;
}
.identity-form label:first-child { margin-top: 0; }
.input-row {
  display: flex; align-items: stretch; border-radius: 12px;
  border: 1px solid var(--line); background: rgba(0,0,0,0.22); overflow: hidden;
}
.input-prefix {
  display: grid; place-items: center; padding: 0 0.75rem;
  color: var(--accent-3); font-family: var(--mono); font-weight: 700;
  border-right: 1px solid var(--line); background: rgba(34,211,238,0.06);
}
.identity-form input[type="text"],
.identity-form input[type="password"] {
  width: 100%; border: 1px solid var(--line); border-radius: 12px;
  background: rgba(0,0,0,0.22); color: var(--text);
  padding: 0.65rem 0.85rem; font: inherit; font-size: 0.95rem;
}
.input-row input {
  border: none !important; border-radius: 0 !important; background: transparent !important;
}
.identity-form input:focus-visible { box-shadow: var(--focus); }
.identity-card h3 { margin: 0 0 0.75rem; font-family: var(--display); font-size: 1.05rem; }
.id-dl { margin: 0; display: grid; gap: 0.55rem; }
.id-dl > div {
  display: grid; grid-template-columns: 7.5rem 1fr; gap: 0.5rem; align-items: baseline;
  padding-bottom: 0.45rem; border-bottom: 1px solid rgba(124,156,255,0.1);
}
.id-dl dt { margin: 0; color: var(--muted); font-size: 0.78rem; font-weight: 650; text-transform: uppercase; letter-spacing: 0.04em; }
.id-dl dd { margin: 0; font-size: 0.9rem; word-break: break-all; }

.messenger-split {
  display: grid; grid-template-columns: 240px 1.4fr 1fr; gap: 0.75rem; align-items: stretch;
}
@media (max-width: 1100px) {
  .messenger-split { grid-template-columns: 1fr 1fr; }
  .thread-pane { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .messenger-split { grid-template-columns: 1fr; }
}

.thread-pane, .chat-pane, .envelope-pane {
  border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: rgba(8, 12, 24, 0.55); overflow: hidden;
  display: flex; flex-direction: column; min-height: 420px;
}
.thread-list {
  list-style: none; margin: 0; padding: 0.45rem; overflow: auto; flex: 1;
}
.thread-item {
  display: grid; grid-template-columns: auto 1fr auto; gap: 0.65rem; align-items: center;
  width: 100%; text-align: left; cursor: pointer;
  padding: 0.7rem 0.75rem; margin-bottom: 0.35rem;
  border-radius: 12px; border: 1px solid transparent;
  background: transparent; color: inherit; font: inherit;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}
.thread-item:hover { background: rgba(124,156,255,0.06); border-color: var(--line); }
.thread-item.is-active {
  background: rgba(167,139,250,0.12); border-color: rgba(167,139,250,0.45);
  box-shadow: 0 0 0 1px rgba(167,139,250,0.12);
}
.thread-avatar {
  width: 36px; height: 36px; border-radius: 12px;
  display: grid; place-items: center; font-weight: 700; font-size: 0.85rem;
  background: linear-gradient(135deg, rgba(124,156,255,0.25), rgba(167,139,250,0.3));
  border: 1px solid var(--line); color: var(--text); position: relative;
}
.presence-dot {
  position: absolute; right: -2px; bottom: -2px; width: 10px; height: 10px;
  border-radius: 50%; border: 2px solid #080c18;
  background: var(--muted);
}
.presence-dot.online { background: var(--ok); box-shadow: 0 0 8px rgba(110,231,183,0.7); }
.presence-dot.away { background: var(--warn); }
.thread-meta strong { display: block; font-size: 0.9rem; }
.thread-meta span { display: block; color: var(--muted); font-size: 0.75rem; margin-top: 0.1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 12ch; }
.thread-time { color: var(--muted); font-size: 0.7rem; font-family: var(--mono); }

.chat-head { align-items: flex-start; }
.chat-log {
  flex: 1; overflow: auto; padding: 0.85rem 1rem;
  display: flex; flex-direction: column; gap: 0.65rem;
  background: #070b14; min-height: 240px;
}
.msg {
  max-width: 88%; padding: 0.65rem 0.85rem; border-radius: 14px;
  border: 1px solid var(--line); background: rgba(255,255,255,0.03);
  animation: msgIn 0.35s var(--ease);
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .msg { animation: none; }
}
.msg.mine {
  align-self: flex-end;
  background: linear-gradient(145deg, rgba(124,156,255,0.18), rgba(167,139,250,0.12));
  border-color: rgba(124,156,255,0.35);
}
.msg.theirs { align-self: flex-start; }
.msg.system {
  align-self: center; max-width: 95%;
  background: rgba(251,191,36,0.06); border-color: rgba(251,191,36,0.25);
  color: var(--muted); font-size: 0.82rem; text-align: center;
}
.msg-head {
  display: flex; justify-content: space-between; gap: 0.75rem;
  margin-bottom: 0.25rem; font-size: 0.72rem; color: var(--muted);
}
.msg-head .who { font-weight: 700; color: var(--accent-3); }
.msg.mine .msg-head .who { color: var(--accent); }
.msg-body { font-size: 0.92rem; word-break: break-word; }
.msg-body.veiled {
  font-family: var(--mono); font-size: 0.78rem; color: var(--accent-2);
  letter-spacing: 0.02em;
}
.msg-foot {
  display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.4rem;
  align-items: center;
}
.msg-commit {
  font-family: var(--mono); font-size: 0.68rem; color: var(--muted);
  padding: 0.15rem 0.45rem; border-radius: 6px;
  border: 1px solid var(--line); background: rgba(0,0,0,0.2);
}
.msg-ticks { color: var(--ok); font-size: 0.75rem; margin-left: auto; }

.typing-line {
  display: flex; align-items: center; gap: 0.55rem;
  padding: 0.35rem 1rem; color: var(--muted); font-size: 0.8rem;
  border-top: 1px solid rgba(124,156,255,0.1);
}
.typing-dots { display: inline-flex; gap: 3px; }
.typing-dots i {
  width: 5px; height: 5px; border-radius: 50%; background: var(--accent-3);
  display: block; animation: typingBounce 1.1s ease-in-out infinite;
}
.typing-dots i:nth-child(2) { animation-delay: 0.15s; }
.typing-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes typingBounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-3px); opacity: 1; }
}

.compose {
  border-top: 1px solid var(--line); padding: 0.75rem 0.85rem;
  background: rgba(255,255,255,0.02);
}
.compose textarea {
  width: 100%; resize: vertical; min-height: 56px; max-height: 140px;
  border-radius: 12px; border: 1px solid var(--line);
  background: rgba(0,0,0,0.25); color: var(--text);
  padding: 0.65rem 0.8rem; font: inherit; font-size: 0.92rem;
  margin-bottom: 0.55rem;
}
.compose textarea:disabled { opacity: 0.55; }
.compose-actions {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.55rem;
}

.envelope-body { padding: 0.9rem 1rem; flex: 1; overflow: auto; font-size: 0.9rem; }
.envelope-body h4 { margin: 0 0 0.4rem; font-family: var(--display); }
.envelope-kv {
  display: grid; gap: 0.45rem; margin: 0.65rem 0;
}
.envelope-kv div {
  display: grid; grid-template-columns: 6.5rem 1fr; gap: 0.4rem;
  font-size: 0.82rem; padding-bottom: 0.35rem;
  border-bottom: 1px solid rgba(124,156,255,0.1);
}
.envelope-kv dt { color: var(--muted); font-weight: 650; }
.envelope-kv dd { margin: 0; word-break: break-all; font-family: var(--mono); font-size: 0.78rem; }
.envelope-pane .log { margin: 0 0.75rem 0.75rem; max-height: 140px; }

.reveal-layout {
  display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: start;
  margin-bottom: 0.85rem;
}
@media (max-width: 720px) { .reveal-layout { grid-template-columns: 1fr; } }
.reveal-scorecard {
  display: flex; gap: 1rem; align-items: center;
  padding: 0.85rem 1rem; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: rgba(255,255,255,0.02);
}
.reveal-findings {
  padding: 0.85rem 1rem; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: rgba(255,255,255,0.02);
  min-height: 120px;
}

.snippet {
  margin: 0; padding: 1rem 1.1rem; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: #070b14;
  font-size: 0.8rem; line-height: 1.55; color: #c7d2fe;
  overflow: auto; max-height: 360px; white-space: pre;
}

.btn:disabled, .btn[disabled] {
  opacity: 0.45; cursor: not-allowed; transform: none !important;
}

/* Midnight visual refresh — 2026-10-04. Shared craft overlay. */
:root {
  --bg: #070612;
  --bg-elevated: rgba(18, 16, 40, 0.78);
  --bg-card: rgba(16, 14, 36, 0.72);
  --text: #f5f3ff;
  --muted: #b7b3d4;
  --accent: #67e8f9;
  --accent-2: #c084fc;
  --accent-3: #5eead4;
  --ok: #6ee7b7;
  --warn: #fbbf24;
  --danger: #fb7185;
  --bad: #fb7185;
  --fail: #fb7185;
  --line: rgba(192, 132, 252, 0.28);
  --line-strong: rgba(103, 232, 249, 0.55);
  --shadow: 0 24px 60px rgba(4, 2, 16, 0.45);
  --font: "Inter", system-ui, sans-serif;
  --display: "Space Grotesk", "Inter", system-ui, sans-serif;
}
body {
  background:
    radial-gradient(900px 480px at 12% -10%, rgba(192, 132, 252, 0.22), transparent 60%),
    radial-gradient(800px 520px at 90% 0%, rgba(103, 232, 249, 0.16), transparent 55%),
    var(--bg);
}
.site-header, header.site-header {
  background: rgba(7, 6, 18, 0.72);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
.hero-shell, .hero, main section:first-of-type {
  position: relative;
}
.hero-mark {
  width: min(280px, 70vw);
  margin: 0.4rem auto 1.2rem;
  filter: drop-shadow(0 18px 40px rgba(103, 232, 249, 0.25));
}
.hero-mark img, .hero-mark svg { width: 100%; height: auto; display: block; }
.btn.primary, a.btn.primary, button.btn.primary {
  background: linear-gradient(135deg, #67e8f9, #c084fc);
  color: #140b22;
  border: 0;
  font-weight: 700;
}
.app-card, .panel, .card, article {
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.app-card {
  background:
    linear-gradient(180deg, rgba(103, 232, 249, 0.08), transparent 42%),
    var(--bg-card);
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease);
}
.app-card:hover { transform: translateY(-4px); border-color: var(--line-strong); }
.icon, .app-card .icon {
  background: radial-gradient(circle at 30% 30%, rgba(103, 232, 249, 0.35), rgba(192, 132, 252, 0.12));
  border: 1px solid var(--line);
}
.badge, .badge-live, .badge-flagship {
  letter-spacing: 0.04em;
}

/* Studio product banner */
body { background-image: linear-gradient(180deg, rgba(7,6,18,0.2), #070612 220px), url("../assets/horizon.jpg"); background-size: auto, cover; background-position: center top; background-repeat: no-repeat; }
.topbar, header.site-header { background: rgba(7,6,18,0.78) !important; }
h1 { letter-spacing: -0.04em; }
