:root {
  --bg: #EEF0F3;
  --panel: #FFFFFF;
  --ink: #10161F;
  --steel: #4B5A70;
  --line: #D8DCE2;
  --hero-bg: #0B121C;
  --hero-ink: #EEF1F5;
  --hero-steel: #8C9BB0;
  --hero-line: #253142;
  --amber: #C9862F;
  --teal: #2C7A6B;
  --teal-bright: #45B79C;
  --font-display: 'Space Grotesk', 'Arial Narrow', Arial, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', 'SFMono-Regular', Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0D1218;
    --panel: #131A22;
    --ink: #ECEEF2;
    --steel: #98A5B7;
    --line: #232C38;
    --hero-bg: #070B11;
    --hero-line: #1B2431;
    --amber: #E0A24C;
    --teal-bright: #55C9AC;
  }
}
:root[data-theme='dark'] {
  --bg: #0D1218;
  --panel: #131A22;
  --ink: #ECEEF2;
  --steel: #98A5B7;
  --line: #232C38;
  --hero-bg: #070B11;
  --hero-line: #1B2431;
  --amber: #E0A24C;
  --teal-bright: #55C9AC;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
img { max-width: 100%; }

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--teal-bright);
  outline-offset: 3px;
}

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 28px;
}

/* ---------- Header ---------- */
header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  gap: 20px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
  white-space: nowrap;
}
.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: var(--ink);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
nav.main-nav {
  display: flex;
  gap: 26px;
  flex-wrap: wrap;
}
nav.main-nav a {
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--steel);
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: color 0.15s, border-color 0.15s;
}
nav.main-nav a:hover { color: var(--ink); border-color: var(--teal-bright); }
nav.main-nav a[aria-current] { color: var(--ink); border-color: var(--teal); }

.portal-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.portal-pill {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-decoration: none;
  color: var(--steel);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 5px 9px;
  transition: border-color 0.15s, color 0.15s;
}
.portal-pill:hover { border-color: var(--teal-bright); color: var(--ink); }

@media (max-width: 860px) {
  nav.main-nav { display: none; }
}

/* ---------- Hero ---------- */
.hero {
  background: var(--hero-bg);
  color: var(--hero-ink);
  padding: 76px 0 64px;
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 48px;
  align-items: center;
}
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
}
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--hero-steel);
  border: 1px solid var(--hero-line);
  border-radius: 20px;
  padding: 5px 12px 5px 10px;
  margin-bottom: 26px;
}
.status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--teal-bright);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--teal-bright) 25%, transparent);
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.1rem, 4.2vw, 3.15rem);
  line-height: 1.12;
  margin: 0 0 20px;
  letter-spacing: -0.01em;
  max-width: 15ch;
}
.hero p.lede {
  font-size: 1.08rem;
  color: var(--hero-steel);
  max-width: 46ch;
  margin: 0 0 32px;
}
.hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  padding: 12px 22px;
  border-radius: 7px;
  transition: transform 0.12s, background 0.15s, border-color 0.15s;
  border: none;
  cursor: pointer;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--amber);
  color: #1A1103;
}
.btn-primary:hover { background: color-mix(in srgb, var(--amber) 85%, white); }
.btn-ghost {
  border: 1px solid var(--hero-line);
  color: var(--hero-ink);
  background: transparent;
}
.btn-ghost:hover { border-color: var(--teal-bright); }

/* diagram */
.diagram { position: relative; }
.diagram svg { width: 100%; height: auto; display: block; }
.diagram-line {
  stroke: var(--hero-line);
  stroke-width: 1.5;
  fill: none;
}
.diagram-line.animated {
  stroke: var(--teal-bright);
  stroke-dasharray: 6 260;
  stroke-dashoffset: 0;
  animation: flow 3.2s linear infinite;
  opacity: 0.75;
}
@keyframes flow { to { stroke-dashoffset: -266; } }
.node-core { fill: var(--panel); stroke: var(--teal-bright); stroke-width: 1.5; }
.node-svc { fill: var(--hero-bg); stroke: var(--hero-line); stroke-width: 1.4; }
.diagram text {
  font-family: var(--font-mono);
  fill: var(--hero-steel);
}
.diagram .core-label { fill: var(--hero-ink); font-family: var(--font-display); font-weight: 600; }

/* ---------- Services intro strip ---------- */
.strip {
  border-bottom: 1px solid var(--line);
  padding: 22px 0;
}
.strip .wrap {
  display: flex;
  gap: 34px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--steel);
}
.strip strong { color: var(--ink); font-weight: 500; }

/* ---------- Service sections ---------- */
.service {
  padding: 74px 0;
  border-bottom: 1px solid var(--line);
}
.service .grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 56px;
  align-items: start;
}
.service.reverse .grid { direction: rtl; }
.service.reverse .grid > * { direction: ltr; }
@media (max-width: 900px) {
  .service .grid { grid-template-columns: 1fr; }
  .service.reverse .grid { direction: ltr; }
}

.svc-domain {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--teal);
  margin: 0 0 12px;
}
.service h2 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 2.6vw, 2.1rem);
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}
.svc-tagline {
  font-size: 1.02rem;
  color: var(--steel);
  margin: 0 0 20px;
}
.svc-desc { font-size: 0.98rem; margin: 0 0 24px; max-width: 58ch; }

.svc-features {
  list-style: none;
  margin: 0 0 28px;
  padding: 0;
  display: grid;
  gap: 10px;
}
.svc-features li {
  display: flex;
  gap: 10px;
  font-size: 0.94rem;
  align-items: flex-start;
}
.svc-features li::before {
  content: "";
  width: 7px; height: 7px;
  background: var(--teal-bright);
  margin-top: 7px;
  flex-shrink: 0;
  border-radius: 1px;
}

.svc-ctas { display: flex; gap: 12px; flex-wrap: wrap; }
.svc-ctas .btn-primary { background: var(--ink); color: var(--bg); }
.svc-ctas .btn-primary:hover { background: var(--teal); color: #fff; }
.svc-ctas .btn-ghost { border: 1px solid var(--line); color: var(--ink); }
.svc-ctas .btn-ghost:hover { border-color: var(--teal-bright); }

/* spec panel */
.spec-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 22px 24px;
}
.spec-panel h3 {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--steel);
  margin: 0 0 16px;
  font-weight: 500;
}
.spec-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.83rem;
}
.spec-row:first-of-type { border-top: none; }
.spec-key { color: var(--steel); }
.spec-val { text-align: right; }

/* ---------- Closing / footer ---------- */
.closing {
  padding: 70px 0;
  text-align: left;
}
.closing h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  max-width: 22ch;
  margin: 0 0 18px;
}
.closing p { color: var(--steel); max-width: 52ch; margin: 0 0 28px; }

footer {
  border-top: 1px solid var(--line);
  padding: 40px 0 50px;
}
.footer-grid {
  display: flex;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}
.footer-brand { max-width: 34ch; }
.footer-brand p { color: var(--steel); font-size: 0.88rem; margin: 10px 0 0; }
.footer-links { display: flex; gap: 48px; flex-wrap: wrap; }
.footer-col h4 {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.76rem;
  color: var(--steel);
  margin: 0 0 12px;
}
.footer-col a {
  display: block;
  text-decoration: none;
  font-size: 0.88rem;
  color: var(--ink);
  margin-bottom: 8px;
}
.footer-col a:hover { color: var(--teal); }
.footer-bottom {
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 0.8rem;
  color: var(--steel);
  font-family: var(--font-mono);
}
