:root {
  --bg: #0b1220;
  --bg-soft: #101827;
  --panel: rgba(255,255,255,.03);
  --panel-strong: rgba(255,255,255,.05);
  --text: #e5e7eb;
  --muted: #9ca3af;
  --line: rgba(255,255,255,.08);
  --accent: #2e8555;
  --accent-2: #3cad6e;
  --accent-dim: rgba(46,133,85,.14);
  --accent-glow: rgba(60,173,110,.28);
  --warn: #f59e0b;
  --sidebar-w: 272px;
  --sidebar-bg: #090e1a;
  --sidebar-border: rgba(255,255,255,.06);
  --font-ui: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 24px;
  --r-pill: 999px;
  --shadow: 0 18px 40px rgba(0,0,0,.22);
}

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

html, body {
  min-height: 100%;
  height: 100%;
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  font-size: 15px;
}

body {
  overflow: hidden;
}

body.mobile-sidebar-open {
  overflow: hidden;
}

body.mobile-sidebar-open .mobile-overlay {
  opacity: 1;
  pointer-events: auto;
}

body.mobile-sidebar-open .sidebar {
  transform: translateX(0);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

img {
  max-width: 100%;
  display: block;
}

.shell {
  display: flex;
  width: 100%;
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
  position: relative;
}

.mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
  z-index: 39;
}

.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  z-index: 40;
}

.sidebar::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 1px;
  height: 100%;
  background: linear-gradient(180deg, transparent, var(--accent-glow) 40%, transparent);
}

.sidebar-logo {
  padding: 22px 18px 18px;
  border-bottom: 1px solid var(--sidebar-border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-image {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  object-fit: contain;
  padding: 3px;
  background: linear-gradient(135deg, rgba(46,133,85,.18), rgba(60,173,110,.08));
  box-shadow: 0 0 22px rgba(60,173,110,.12);
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.logo-name {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .25px;
}

.logo-sub {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px;
  scrollbar-width: none;
}
.sidebar-nav::-webkit-scrollbar { display: none; }

.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  color: #6b7280;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  padding: 12px 8px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: background .15s ease, color .15s ease, border-color .15s ease, transform .15s ease;
  margin-bottom: 4px;
}

.nav-item:hover {
  background: rgba(255,255,255,.04);
  color: var(--text);
  transform: translateX(2px);
}

.nav-item.active {
  background: var(--accent-dim);
  border-color: rgba(60,173,110,.22);
  color: #9ff0bc;
}

.nav-icon {
  font-size: 15px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 12px 10px;
  border-top: 1px solid var(--sidebar-border);
}

.env-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--r-md);
  background: rgba(46,133,85,.08);
  border: 1px solid rgba(60,173,110,.2);
  color: #9ff0bc;
  font-size: 11px;
  font-weight: 700;
}

.env-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 8px var(--accent-2);
}

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(60,173,110,.09), transparent 28%),
    linear-gradient(180deg, #0b1220 0%, #050816 100%);
}

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(11,18,32,.82);
  backdrop-filter: blur(12px);
  flex-shrink: 0;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.topbar-title {
  font-size: 17px;
  font-weight: 800;
}

.topbar-sub {
  font-size: 12px;
  color: var(--muted);
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.content {
  flex: 1;
  overflow: auto;
  padding: 24px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.1) transparent;
}

.content::-webkit-scrollbar {
  width: 6px;
}

.content::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.12);
  border-radius: 999px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 12px;
  border: 1px solid rgba(60,173,110,.25);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  padding: 11px 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
  box-shadow: 0 0 24px rgba(60,173,110,.16);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-sm {
  padding: 9px 12px;
  font-size: 13px;
}

.btn-ghost {
  background: rgba(255,255,255,.03);
  color: var(--text);
  border-color: var(--line);
  box-shadow: none;
}

.mobile-menu-btn {
  display: none;
}

.view {
  display: grid;
  gap: 24px;
  animation: fade-in .22s ease;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 36px;
  min-height: 340px;
  background:
    linear-gradient(135deg, rgba(7, 12, 22, .78), rgba(7, 12, 22, .5)),
    url('/static/img/hero-bg.png') center/cover no-repeat;
  box-shadow: var(--shadow);
}

.hero::before {
  content: "";
  position: absolute;
  inset: auto -10% -45% auto;
  width: 340px;
  height: 340px;
  background: radial-gradient(circle, rgba(60,173,110,.22), transparent 60%);
  pointer-events: none;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 700;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
  color: #d1fae5;
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, .9fr);
  gap: 22px;
  align-items: end;
}

.hero-copy {
  max-width: 760px;
}

.hero h1 {
  margin-top: 18px;
  font-size: clamp(2rem, 3vw, 3.5rem);
  line-height: 1.08;
  letter-spacing: -.03em;
}

.hero h1 span {
  color: #8ff1b4;
}

.hero p {
  margin-top: 16px;
  font-size: 17px;
  color: #d1d5db;
  max-width: 640px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.hero-panel {
  align-self: stretch;
  background: rgba(0,0,0,.24);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--r-lg);
  padding: 18px;
  display: grid;
  gap: 14px;
}

.stat-list {
  display: grid;
  gap: 12px;
}

.stat-item {
  padding: 12px 14px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 14px;
}

.stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: #9ca3af;
}

.stat-value {
  margin-top: 6px;
  font-size: 18px;
  font-weight: 800;
}

.grid-2,
.grid-3,
.grid-4 {
  display: grid;
  gap: 16px;
}

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

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px;
  min-width: 0;
}

.card-accent {
  position: relative;
  overflow: hidden;
}

.card-accent::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-glow), transparent);
}

.card h2,
.card h3 {
  margin-bottom: 8px;
}

.card p,
.card li {
  color: #d1d5db;
}

.section-head {
  display: grid;
  gap: 6px;
}

.section-kicker {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: #8ff1b4;
  font-weight: 700;
}

.section-head h2 {
  font-size: clamp(1.5rem, 2vw, 2.2rem);
  line-height: 1.15;
}

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

.card ul {
  padding-left: 18px;
  display: grid;
  gap: 8px;
}

.stack {
  display: grid;
  gap: 16px;
}

.timeline {
  display: grid;
  gap: 12px;
}

.timeline-step {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.timeline-index {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: var(--accent-dim);
  color: #9ff0bc;
  border: 1px solid rgba(60,173,110,.2);
  display: grid;
  place-items: center;
  font-weight: 800;
}

.profile-card {
  text-align: center;
}

.profile-card img {
  width: 108px;
  height: 108px;
  object-fit: cover;
  border-radius: 999px;
  margin: 0 auto 14px;
  border: 3px solid rgba(60,173,110,.15);
  box-shadow: 0 0 0 1px rgba(255,255,255,.08);
}

.meta-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: var(--r-pill);
  background: rgba(255,255,255,.04);
  border: 1px solid var(--line);
  color: #d1d5db;
  font-size: 13px;
}

.notice {
  background: linear-gradient(135deg, rgba(46,133,85,.16), rgba(46,133,85,.06));
  border: 1px solid rgba(60,173,110,.2);
}

@media (max-width: 1180px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    transform: translateX(-100%);
    transition: transform .2s ease;
    height: 100dvh;
    box-shadow: 0 30px 60px rgba(0,0,0,.45);
  }

  .mobile-menu-btn {
    display: inline-flex;
  }

  .topbar {
    padding: 14px 16px;
  }

  .content {
    padding: 16px;
  }

  .hero {
    padding: 24px;
    min-height: auto;
  }

  .hero-grid,
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .topbar-actions {
    display: none;
  }

  .hero h1 {
    font-size: 1.9rem;
  }

  .hero p {
    font-size: 15px;
  }
}

/* Theme support and resilient fallback styles */
html[data-theme="light"] {
  --bg: #f5f7fb;
  --bg-soft: #eef4f1;
  --panel: rgba(255,255,255,.82);
  --panel-strong: rgba(255,255,255,.96);
  --text: #102033;
  --muted: #667085;
  --line: rgba(16,32,51,.12);
  --accent: #2e8555;
  --accent-2: #287d5e;
  --accent-dim: rgba(46,133,85,.1);
  --accent-glow: rgba(46,133,85,.2);
  --sidebar-bg: #ffffff;
  --sidebar-border: rgba(16,32,51,.1);
  --shadow: 0 18px 40px rgba(16,32,51,.1);
}

html[data-theme="light"] body {
  background: var(--bg);
}

html[data-theme="light"] .main {
  background:
    radial-gradient(circle at top right, rgba(46,133,85,.13), transparent 32%),
    linear-gradient(180deg, #f7fafc 0%, #eef3f7 100%);
}

html[data-theme="light"] .topbar {
  background: rgba(255,255,255,.86);
}

html[data-theme="light"] .hero {
  background:
    linear-gradient(135deg, rgba(255,255,255,.9), rgba(255,255,255,.68)),
    url('/static/img/hero-bg.png') center/cover no-repeat;
}

html[data-theme="light"] .hero-panel,
html[data-theme="light"] .stat-item,
html[data-theme="light"] .hero-card,
html[data-theme="light"] .info-card,
html[data-theme="light"] .section-block {
  background: rgba(255,255,255,.76);
  border-color: rgba(16,32,51,.1);
}

html[data-theme="light"] .hero p,
html[data-theme="light"] .hero-text,
html[data-theme="light"] .card p,
html[data-theme="light"] .card li,
html[data-theme="light"] .section-block p,
html[data-theme="light"] .section-block li,
html[data-theme="light"] .info-card p,
html[data-theme="light"] .hero-list li,
html[data-theme="light"] .meta-pill {
  color: #425466;
}

html[data-theme="light"] .pill,
html[data-theme="light"] .eyebrow,
html[data-theme="light"] .section-kicker {
  color: #1f7a4a;
}

html[data-theme="light"] .pill {
  background: rgba(46,133,85,.09);
  border-color: rgba(46,133,85,.16);
}

html[data-theme="light"] .hero h1 span,
html[data-theme="light"] .nav-item.active,
html[data-theme="light"] .nav-link.active,
html[data-theme="light"] .timeline-index,
html[data-theme="light"] .env-badge {
  color: #1f7a4a;
}

html[data-theme="light"] .btn-ghost {
  background: rgba(255,255,255,.68);
  color: var(--text);
}

html[data-theme="light"] .mobile-overlay {
  background: rgba(16,32,51,.25);
}

/* Compatibility styles for the server-rendered HTML fallback. */
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: background .15s ease, color .15s ease, border-color .15s ease, transform .15s ease;
  margin-bottom: 4px;
}

.nav-link:hover {
  background: rgba(255,255,255,.04);
  color: var(--text);
  transform: translateX(2px);
}

.nav-link.active {
  background: var(--accent-dim);
  border-color: rgba(60,173,110,.22);
  color: #9ff0bc;
}

.section-block {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px;
  display: grid;
  gap: 10px;
  min-width: 0;
}

.section-block h1,
.section-block h2 {
  line-height: 1.15;
  letter-spacing: -.02em;
}

.section-block h1 {
  font-size: clamp(2rem, 3vw, 3.2rem);
}

.section-block h2 {
  font-size: clamp(1.35rem, 2vw, 2rem);
}

.section-block p,
.section-block li {
  color: #d1d5db;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.info-card,
.hero-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px;
  min-width: 0;
}

.info-card h3,
.hero-card-title {
  margin-bottom: 8px;
  font-weight: 800;
}

.info-card p,
.hero-list li {
  color: #d1d5db;
}

.eyebrow {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
  color: #8ff1b4;
}

.hero-text {
  color: #d1d5db;
}

.hero-card {
  align-self: stretch;
  background: rgba(0,0,0,.24);
  border-color: rgba(255,255,255,.08);
}

.hero-list {
  display: grid;
  gap: 10px;
  padding-left: 18px;
}

.theme-toggle {
  min-width: 92px;
  padding-inline: 12px;
  white-space: nowrap;
}

.theme-icon {
  line-height: 1;
}

.legal-view {
  max-width: 1080px;
}

@media (max-width: 900px) {
  .cards-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .topbar-actions {
    display: flex;
  }

  .topbar-actions a.btn {
    display: none;
  }

  .theme-toggle {
    min-width: 42px;
    padding-inline: 10px;
  }

  .theme-label {
    display: none;
  }
}

/* Layout for the initial server-rendered home hero before JavaScript hydrates. */
.hero > .hero-copy,
.hero > .hero-card {
  position: relative;
  z-index: 1;
}

@media (min-width: 901px) {
  .hero:has(> .hero-card) {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, .9fr);
    gap: 22px;
    align-items: end;
  }
}
