:root {
  --bg: #0b1220;
  --fg: #e5e7eb;
  --muted: #9ca3af;
  --accent: #38bdf8;
  --panel: #111827;
  --line: #243041;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.6;
}

main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 72px 24px 96px;
}

/* ---- Portal shell ---- */

.portal-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 1440px;
  padding: 24px;
}

.portal-shell .banner {
  margin-bottom: 18px;
}

.portal-heading {
  margin-bottom: 14px;
}

.portal-title {
  margin: 0 0 4px;
  font-size: 1.6rem;
  line-height: 1.15;
}

.portal-lede {
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
  max-width: 760px;
}

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

.tab {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.62rem 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(17, 24, 39, 0.85);
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease, background-color 160ms ease;
}

.tab:hover {
  color: var(--fg);
  border-color: rgba(56, 189, 248, 0.35);
}

.tab.is-active {
  color: var(--fg);
  background: rgba(56, 189, 248, 0.14);
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow: inset 3px 0 0 var(--accent);
}

.tab-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.portal-panel {
  flex: 1 1 auto;
  min-height: 0;
}

.portal-panel[hidden] {
  display: none;
}

.implementation-detail[hidden] {
  display: none;
}

.portal-panel-layout {
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: 100%;
}

.panel-intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.12), rgba(17, 24, 39, 0.96));
}

.panel-intro > div {
  min-width: 0;
}

.panel-intro-stack {
  display: grid;
  gap: 14px;
  width: 100%;
}

.panel-intro .eyebrow,
.team-card .eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.panel-intro h2 {
  margin: 0 0 6px;
  font-size: 1.35rem;
}

.panel-intro p:not(.eyebrow) {
  max-width: 850px;
  margin: 0;
  line-height: 1.48;
}

.demo-access {
  display: grid;
  gap: 2px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.88rem;
}

.demo-access strong {
  color: var(--fg);
}

.demo-access code {
  padding: 0.08rem 0.3rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: #bae6fd;
  background: rgba(11, 18, 32, 0.72);
}

.demo-access a {
  font-weight: 700;
}

.implementation-browser {
  display: grid;
  gap: 12px;
}

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

.implementation-card {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(17, 24, 39, 0.88);
  color: var(--muted);
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.implementation-card:hover {
  color: var(--fg);
  border-color: rgba(56, 189, 248, 0.35);
  transform: translateY(-1px);
}

.implementation-card.is-active {
  color: var(--fg);
  border-color: rgba(56, 189, 248, 0.45);
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.14), rgba(17, 24, 39, 0.96));
  box-shadow: inset 3px 0 0 var(--accent);
}

.implementation-card strong {
  font-size: 1rem;
}

.implementation-summary {
  font-size: 0.9rem;
  line-height: 1.45;
}

.implementation-details {
  min-height: 168px;
}

.implementation-detail {
  display: grid;
  gap: 10px;
  padding: 14px 20px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(11, 18, 32, 0.82);
}

.implementation-copy h3 {
  margin: 0 0 4px;
  font-size: 1.1rem;
}

.implementation-copy p:not(.eyebrow) {
  margin: 0;
}

.implementation-points {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.implementation-points code {
  padding: 0.08rem 0.3rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: #bae6fd;
  background: rgba(11, 18, 32, 0.72);
}

.panel-link {
  flex: 0 0 auto;
  color: var(--fg);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
}

.panel-link {
  padding: 0.62rem 0.82rem;
  border: 1px solid rgba(56, 189, 248, 0.45);
  border-radius: 9px;
  background: rgba(56, 189, 248, 0.12);
}

.panel-link:hover {
  color: var(--accent);
}

.portal-frame {
  flex: 1 1 auto;
  display: block;
  width: 100%;
  min-height: 36rem;
  height: clamp(36rem, 78vh, 80rem);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.implementation-frame {
  min-height: 42rem;
  height: clamp(42rem, 82vh, 90rem);
}

@media (max-width: 960px) {
  .panel-intro {
    flex-direction: column;
  }

  .implementation-list {
    grid-template-columns: 1fr;
  }
}

/* ---- Docs layout (shared with the About page) ---- */

main.docs-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.docs-content {
  min-width: 0;
  overflow-wrap: anywhere;
}

.docs-sidebar {
  position: sticky;
  top: 24px;
  padding: 18px;
}

.docs-sidebar-title {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg);
  margin-bottom: 12px;
}

.docs-sidebar-nav {
  display: grid;
  gap: 8px;
}

.docs-sidebar-nav a {
  color: var(--muted);
  text-decoration: none;
}

.docs-sidebar-nav a:hover {
  color: var(--accent);
}

.docs-sidebar-nav a.is-active {
  color: var(--fg);
  font-weight: 700;
  padding-left: 10px;
  border-left: 3px solid var(--accent);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  line-height: 1.1;
  color: var(--fg);
}

h1 {
  font-size: 2.8rem;
  margin: 0 0 12px;
}

h2 {
  font-size: 1.3rem;
  margin: 38px 0 14px;
}

h3 {
  margin: 24px 0 10px;
  font-size: 1.12rem;
}

p,
li {
  color: var(--muted);
}

a {
  color: var(--accent);
}

.lead {
  font-size: 1.08rem;
  max-width: 760px;
}

.banner,
.card {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 14px;
}

.banner {
  padding: 22px 24px;
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.12), rgba(17, 24, 39, 0.95));
}

.wordmark {
  display: block;
  width: 100%;
  max-width: 340px;
  height: auto;
  margin: 0 0 18px;
}

.backlink {
  margin-top: 0;
}

ul {
  padding-left: 20px;
}

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

  .docs-sidebar {
    position: static;
  }
}

@media (max-width: 700px) {
  main {
    padding: 40px 16px 64px;
  }

  .portal-shell {
    height: auto;
    padding: 16px;
  }

  .portal-panel {
    min-height: 0;
  }

  .panel-intro {
    flex-direction: column;
    gap: 14px;
  }

  .portal-frame {
    min-height: 32rem;
    height: 72vh;
  }

  h1 {
    font-size: 2rem;
  }
}

/* ---- About page ---- */

body.about-page {
  --about-bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #312e81 100%);
  --about-glass-bg: rgba(255, 255, 255, 0.03);
  --about-glass-border: rgba(255, 255, 255, 0.08);
  --about-glass-highlight: rgba(255, 255, 255, 0.15);
  --about-text-primary: #f8fafc;
  --about-text-secondary: #94a3b8;
  --about-accent-glow: #6366f1;
  --about-font-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --about-font-h1: clamp(2.5rem, 2rem + 2.5vw, 4rem);
  --about-font-h2: clamp(1.8rem, 1.5rem + 1.5vw, 2.5rem);
  --about-font-h3: clamp(1.4rem, 1.2rem + 1vw, 1.8rem);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  background: var(--about-bg-gradient);
  color: var(--about-text-primary);
}

.about-shell {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

.about-page .docs-content {
  position: relative;
  z-index: 0;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: clamp(2rem, 4vw, 4rem);
  overflow: hidden;
  border: 1px solid var(--about-glass-border);
  border-top-color: var(--about-glass-highlight);
  border-radius: 24px;
  background: var(--about-glass-bg);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.about-page .docs-content::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -100px;
  right: -100px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--about-accent-glow) 0%, transparent 70%);
  opacity: 0.4;
  filter: blur(60px);
  pointer-events: none;
}

.about-page .banner {
  padding: 0;
  border: 0;
  background: transparent;
}

.about-page h1 {
  margin: 0 0 1.5rem;
  font-size: var(--about-font-h1);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--about-text-primary);
  background: linear-gradient(to right, #fff, #94a3b8);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.about-page .lead {
  max-width: 65ch;
  margin-bottom: 3rem;
  padding-left: 1.5rem;
  border-left: 3px solid var(--about-accent-glow);
  color: var(--about-text-secondary);
  font-size: var(--about-font-base);
}

.about-page .team-card {
  margin: 0 0 3rem;
  padding: clamp(1.4rem, 3vw, 2rem);
  border: 1px solid rgba(99, 102, 241, 0.5);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.62);
  box-shadow: inset 4px 0 0 var(--about-accent-glow);
}

.about-page .team-card h2 {
  margin: 0.2rem 0 0;
}

.about-page .team-card h2 a {
  color: inherit;
  text-decoration-color: rgba(165, 180, 252, 0.55);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.18em;
}

.about-page .team-card h2 a:hover {
  color: #c7d2fe;
  text-decoration-color: #c7d2fe;
}

.about-page .team-role {
  margin: 0.35rem 0 1.25rem;
  color: #c7d2fe;
  font-size: 1.1rem;
  font-weight: 700;
}

.about-page .verification-link {
  display: inline-grid;
  gap: 0.1rem;
  margin-top: 0.75rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(99, 102, 241, 0.7);
  border-radius: 10px;
  color: #fff;
  background: rgba(99, 102, 241, 0.2);
  text-decoration: none;
}

.about-page .verification-link:hover {
  border-color: #a5b4fc;
  background: rgba(99, 102, 241, 0.3);
}

.about-page .verification-link > span {
  color: #a5b4fc;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.about-page h2 {
  margin: 3rem 0 1.5rem;
  color: #fff;
  font-size: var(--about-font-h2);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.about-page h3 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 2.5rem 0 1rem;
  color: #e2e8f0;
  font-size: var(--about-font-h3);
  font-weight: 600;
}

.about-page h3::before {
  content: "";
  display: block;
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--about-accent-glow);
  box-shadow: 0 0 10px var(--about-accent-glow);
}

.about-page p {
  margin-bottom: 1.5rem;
  color: var(--about-text-secondary);
  font-size: var(--about-font-base);
  font-weight: 300;
}

.about-page a {
  border-bottom: 1px solid rgba(129, 140, 248, 0.3);
  color: #818cf8;
  text-decoration: none;
  transition: color 0.3s ease, border-color 0.3s ease, text-shadow 0.3s ease;
}

.about-page a:hover {
  border-bottom-color: #fff;
  color: #fff;
  text-shadow: 0 0 8px rgba(129, 140, 248, 0.6);
}

.about-page .backlink {
  display: inline-block;
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--about-glass-border);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

@media (max-width: 600px) {
  body.about-page {
    padding: 1rem;
  }

  .about-page .docs-content {
    padding: 1.5rem;
    border-radius: 16px;
  }

  .about-page .lead {
    padding-top: 1rem;
    padding-left: 0;
    border-top: 2px solid var(--about-accent-glow);
    border-left: 0;
  }
}
