:root {
  --bg: #050912;
  --surface: #0B1020;
  --surface-2: #131A2E;
  --ink: #F4F6FA;
  --muted: rgba(244, 246, 250, 0.6);
  --faint: rgba(244, 246, 250, 0.34);
  --border: rgba(244, 246, 250, 0.08);
  --border-strong: rgba(244, 246, 250, 0.18);
  --cobalt: #4F8CFF;
  --cobalt-soft: rgba(79, 140, 255, 0.12);
  --ok: #7FD6A7;
  --bad: #E27A7A;
  --display: "Fraunces", Georgia, serif;
  --body: "Manrope", system-ui, sans-serif;
  --mono: "JetBrains Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.45'/%3E%3C/svg%3E");
  opacity: 0.035;
  z-index: -1;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 72px;
  padding: 16px clamp(18px, 4vw, 48px);
  background: rgba(5, 9, 18, 0.92);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: max-content;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--display);
  font-size: 25px;
  font-weight: 500;
  letter-spacing: 0;
}

.mark {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 50%;
  color: var(--ink);
  font-family: var(--display);
  font-size: 14px;
  line-height: 1;
  position: relative;
}

.mark::after {
  content: "";
  position: absolute;
  right: -5px;
  top: 11px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cobalt);
}

.dot {
  color: var(--cobalt);
}

.context {
  display: flex;
  gap: 12px;
  align-items: baseline;
  min-width: 0;
  color: var(--muted);
  font-size: 14px;
}

.context span:first-child {
  color: var(--ink);
  font-weight: 600;
}

.auth-note {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0;
  text-transform: uppercase;
  white-space: nowrap;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cobalt);
}

.shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  max-width: 1440px;
  margin: 0 auto;
}

.sidebar {
  position: sticky;
  top: 72px;
  height: calc(100vh - 72px);
  overflow-y: auto;
  border-right: 1px solid var(--border);
  padding: 28px 20px;
}

.panel {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 4px;
  padding: 20px;
  margin-bottom: 18px;
}

.panel h1 {
  margin: 8px 0 10px;
  font-family: var(--display);
  font-size: 26px;
  line-height: 1.12;
  font-weight: 400;
  letter-spacing: 0;
}

.panel p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.panel--quiet {
  background: transparent;
}

.label {
  display: block;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0;
  line-height: 1.3;
  text-transform: uppercase;
}

.label--accent {
  color: var(--cobalt);
}

.nav {
  display: grid;
  gap: 4px;
  margin-bottom: 18px;
}

.nav-item {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
  font-weight: 600;
}

.nav-item:hover,
.nav-item:focus-visible {
  color: var(--ink);
  border-color: var(--border);
  outline: none;
}

.nav-item.is-active {
  color: var(--ink);
  background: var(--surface-2);
  border-color: var(--border-strong);
}

.main {
  min-width: 0;
  padding: 36px clamp(20px, 5vw, 56px) 88px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 32px;
  align-items: end;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.hero h2 {
  margin: 10px 0 16px;
  font-family: var(--display);
  font-size: 64px;
  line-height: 1.02;
  font-weight: 400;
  letter-spacing: 0;
}

.hero p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
}

.hero-meta {
  display: grid;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.hero-meta > div {
  background: var(--surface);
  padding: 18px;
}

.hero-meta strong {
  display: block;
  margin-top: 8px;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 400;
}

.setup-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 24px 0 34px;
  background: var(--border);
  border: 1px solid var(--border);
}

.setup-strip > div {
  min-height: 104px;
  padding: 18px;
  background: var(--surface);
}

.setup-strip strong {
  display: block;
  margin-top: 8px;
  font-size: 15px;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.section-head {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  margin-bottom: 22px;
}

.section-num {
  color: var(--cobalt);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0;
}

.section-head h3 {
  margin: 0 0 8px;
  font-family: var(--display);
  font-size: 40px;
  line-height: 1.08;
  font-weight: 400;
  letter-spacing: 0;
}

.section-head p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 14px;
}

.grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.phase-track {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.phase-track .card {
  border: 0;
}

.card,
.empty,
.record {
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
}

.card,
.empty {
  padding: 22px;
}

.card h4,
.empty h4 {
  margin: 8px 0 8px;
  font-family: var(--display);
  font-size: 24px;
  line-height: 1.15;
  font-weight: 400;
  letter-spacing: 0;
}

.card p,
.empty p {
  margin: 0;
  color: var(--muted);
}

.metric {
  min-height: 132px;
}

.metric strong {
  display: block;
  margin-top: 12px;
  font-family: var(--display);
  font-size: 48px;
  line-height: 1;
  font-weight: 400;
  letter-spacing: 0;
}

.metric span:last-child {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.record {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  padding: 18px;
  margin-bottom: 10px;
}

.record h4 {
  margin: 0 0 6px;
  font-size: 16px;
  line-height: 1.35;
  font-weight: 600;
}

.record p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.record a {
  color: var(--cobalt);
  font-size: 13px;
  text-decoration: none;
}

.record .why {
  margin-top: 8px;
  font-size: 13px;
  font-style: italic;
  color: var(--faint);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge--active,
.badge--shipped,
.badge--adopted,
.badge--live {
  border-color: rgba(127, 214, 167, 0.28);
  color: var(--ok);
}

.badge--blocked {
  border-color: rgba(226, 122, 122, 0.28);
  color: var(--bad);
}

.badge--mapped,
.badge--building,
.badge--in-flight {
  border-color: rgba(79, 140, 255, 0.34);
  color: var(--cobalt);
}

.source-note {
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--muted);
  font-size: 13px;
}

.timeline {
  position: relative;
  padding-left: 18px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: var(--border-strong);
}

.timeline .record {
  position: relative;
}

.timeline .record::before {
  content: "";
  position: absolute;
  left: -19px;
  top: 22px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--cobalt);
}

.site-footer {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px clamp(20px, 5vw, 56px) 40px;
  border-top: 1px solid var(--border);
  color: var(--faint);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0;
}

@media (max-width: 960px) {
  .topbar {
    position: static;
    flex-wrap: wrap;
  }

  .auth-note {
    margin-left: 0;
  }

  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero,
  .setup-strip,
  .phase-track,
  .grid--2,
  .grid--3 {
    grid-template-columns: 1fr;
  }

  .hero h2 {
    font-size: 48px;
  }

  .section-head h3 {
    font-size: 34px;
  }

  .metric strong {
    font-size: 40px;
  }
}

@media (max-width: 560px) {
  .topbar {
    gap: 12px;
  }

  .context {
    flex-direction: column;
    gap: 2px;
  }

  .nav {
    grid-template-columns: 1fr;
  }

  .main {
    padding-inline: 16px;
  }

  .section-head {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .record {
    grid-template-columns: 1fr;
  }

  .hero h2 {
    font-size: 38px;
  }

  .section-head h3 {
    font-size: 30px;
  }

  .metric strong {
    font-size: 34px;
  }
}
