:root {
  color-scheme: light;
  --bg: #f5efe3;
  --bg-elevated: rgba(255, 255, 255, 0.8);
  --bg-contrast: #fffaf1;
  --panel: rgba(255, 251, 242, 0.92);
  --text: #1e2930;
  --text-muted: #556369;
  --headline: #0f1720;
  --line: rgba(27, 52, 58, 0.12);
  --brand: #0f8b8d;
  --brand-strong: #0b5d63;
  --accent: #f25f5c;
  --accent-soft: rgba(242, 95, 92, 0.12);
  --shadow: 0 20px 60px rgba(38, 55, 63, 0.12);
  --code-bg: #11181d;
  --code-text: #eff7f8;
  --hero-grad-a: rgba(15, 139, 141, 0.14);
  --hero-grad-b: rgba(242, 95, 92, 0.16);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #081217;
  --bg-elevated: rgba(15, 23, 31, 0.85);
  --bg-contrast: #0d1c24;
  --panel: rgba(11, 24, 31, 0.88);
  --text: #deedf1;
  --text-muted: #97adb5;
  --headline: #f3fbfd;
  --line: rgba(154, 189, 198, 0.14);
  --brand: #56d0cb;
  --brand-strong: #9fe8e4;
  --accent: #ff8b78;
  --accent-soft: rgba(255, 139, 120, 0.16);
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.38);
  --code-bg: #061015;
  --code-text: #dff8fb;
  --hero-grad-a: rgba(49, 204, 200, 0.12);
  --hero-grad-b: rgba(255, 139, 120, 0.14);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background:
    radial-gradient(circle at top left, var(--hero-grad-a), transparent 30%),
    radial-gradient(circle at top right, var(--hero-grad-b), transparent 28%),
    linear-gradient(180deg, var(--bg), var(--bg-contrast));
  color: var(--text);
  font-family: "IBM Plex Sans", "Avenir Next", "Segoe UI", sans-serif;
  min-height: 100%;
}

body {
  line-height: 1.6;
}

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

code,
pre {
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
}

code {
  background: var(--accent-soft);
  border-radius: 0.4rem;
  padding: 0.1rem 0.35rem;
}

pre {
  background: var(--code-bg);
  color: var(--code-text);
  border-radius: 1rem;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  font-size: 0.92rem;
  line-height: 1.55;
}

pre code {
  background: transparent;
  padding: 0;
}

.page-shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: 1.2rem 1.2rem 4rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
  margin-top: 0.6rem;
  border: 1px solid var(--line);
  border-radius: 1.4rem;
  background: color-mix(in srgb, var(--bg-elevated) 78%, transparent);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: white;
  background: linear-gradient(135deg, var(--brand), var(--accent));
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-text strong {
  color: var(--headline);
  font-size: 0.98rem;
}

.brand-text span {
  color: var(--text-muted);
  font-size: 0.86rem;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.top-nav a {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.top-nav a:hover,
.footer-links a:hover {
  color: var(--headline);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--headline);
  cursor: pointer;
}

.theme-toggle span {
  font-size: 0.86rem;
  color: var(--text-muted);
}

.hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1.4rem;
  padding: 2.2rem 0 1.2rem;
}

.hero-copy,
.hero-panel,
.info-card,
.tool-card,
.diagram-card,
.metric-card,
.panel-card {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero-copy {
  padding: 2rem;
  border-radius: 2rem;
}

.eyebrow {
  margin: 0 0 0.9rem;
  color: var(--brand-strong);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
  font-weight: 700;
}

.hero h1,
.section h2 {
  margin: 0;
  color: var(--headline);
  font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
  line-height: 1.05;
}

.hero h1 {
  font-size: clamp(2.7rem, 5vw, 4.8rem);
  max-width: 12ch;
}

.hero-text {
  margin: 1.2rem 0 0;
  max-width: 65ch;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.hero-actions {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.8rem 1.1rem;
  border-radius: 999px;
  font-weight: 700;
}

.button-primary {
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: white;
}

.button-secondary {
  border: 1px solid var(--line);
  color: var(--headline);
}

.hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  padding: 0;
  margin: 1.35rem 0 0;
  list-style: none;
}

.hero-facts li {
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text-muted);
  background: var(--bg-elevated);
}

.hero-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
  border-radius: 2rem;
}

.panel-card {
  padding: 1.3rem;
  border-radius: 1.5rem;
}

.panel-card h2 {
  margin: 0.35rem 0 0.5rem;
  font-size: 1.5rem;
}

.panel-card p,
.info-card p,
.section-note,
.tool-card li,
.timeline-step p {
  color: var(--text-muted);
}

.panel-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--brand-strong);
  font-weight: 700;
}

.panel-grid,
.card-grid {
  display: grid;
  gap: 1rem;
}

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

.metric-card {
  border-radius: 1.2rem;
  padding: 1rem;
}

.metric-card span {
  display: block;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.metric-card strong {
  display: block;
  margin-top: 0.35rem;
  color: var(--headline);
}

.section {
  padding: 2rem 0 0.5rem;
}

.section-contrast {
  padding: 2rem;
  margin-top: 1rem;
  border-radius: 2rem;
  background: color-mix(in srgb, var(--bg-elevated) 76%, transparent);
  border: 1px solid var(--line);
}

.section-code {
  padding-top: 2.6rem;
}

.section-heading {
  margin-bottom: 1.3rem;
}

.section h2 {
  font-size: clamp(2rem, 3.5vw, 3rem);
  max-width: 16ch;
}

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

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

.info-card {
  border-radius: 1.5rem;
  padding: 1.35rem;
}

.info-card h3,
.tool-card h3,
.diagram-header h3,
.timeline-step h3 {
  margin: 0 0 0.55rem;
  color: var(--headline);
  font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
}

.architecture-layout {
  display: grid;
  grid-template-columns: 1.35fr 0.65fr;
  gap: 1rem;
}

.diagram-card {
  padding: 1.1rem;
  border-radius: 1.7rem;
}

.diagram-header p {
  margin: 0;
  color: var(--text-muted);
}

.architecture-diagram {
  width: 100%;
  height: auto;
  display: block;
  margin-top: 0.8rem;
}

.node {
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 2;
}

.node-core {
  fill: color-mix(in srgb, var(--brand) 18%, var(--panel));
}

.node-soft {
  fill: color-mix(in srgb, var(--accent) 12%, var(--panel));
}

.node-title {
  fill: var(--headline);
  font-size: 26px;
  font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
  font-weight: 700;
}

.node-subtitle {
  fill: var(--text-muted);
  font-size: 15px;
  font-family: "IBM Plex Sans", sans-serif;
}

.flow {
  fill: none;
  stroke: var(--brand);
  stroke-width: 5;
  marker-end: url(#arrow);
  color: var(--brand);
  opacity: 0.92;
}

.flow-primary {
  stroke: url(#heroStroke);
  color: var(--accent);
}

.tool-groups {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.tool-card {
  border-radius: 1.4rem;
  padding: 1.3rem;
}

.tool-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.55rem;
}

.timeline {
  display: grid;
  gap: 1rem;
}

.timeline-step {
  display: grid;
  grid-template-columns: 4rem 1fr;
  gap: 1rem;
  align-items: start;
  padding: 1.2rem;
  border: 1px solid var(--line);
  border-radius: 1.4rem;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.timeline-step span {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 1rem;
  color: white;
  font-weight: 700;
  background: linear-gradient(135deg, var(--brand), var(--accent));
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 2rem 0 1rem;
  margin-top: 2rem;
  border-top: 1px solid var(--line);
}

.site-footer p {
  margin: 0.3rem 0 0;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

@media (max-width: 1080px) {
  .hero,
  .architecture-layout {
    grid-template-columns: 1fr;
  }

  .card-grid-three,
  .tool-groups {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .site-header {
    flex-wrap: wrap;
  }

  .top-nav {
    width: 100%;
    justify-content: flex-start;
  }

  .card-grid-two,
  .panel-grid {
    grid-template-columns: 1fr;
  }

  .hero-copy,
  .hero-panel,
  .section-contrast {
    padding: 1.35rem;
  }

  .hero h1 {
    max-width: none;
  }

  .site-footer {
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .page-shell {
    padding: 0.8rem 0.8rem 3rem;
  }

  .site-header {
    border-radius: 1.1rem;
  }

  .hero-copy,
  .hero-panel,
  .section-contrast,
  .diagram-card,
  .info-card,
  .tool-card,
  .panel-card,
  .timeline-step {
    border-radius: 1.2rem;
  }

  .top-nav {
    gap: 0.8rem;
  }

  .top-nav a,
  .footer-links a {
    font-size: 0.92rem;
  }

  .timeline-step {
    grid-template-columns: 1fr;
  }
}
