:root {
  --bg: #050505;
  --bg-soft: #0c0c0c;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-strong: rgba(255, 255, 255, 0.07);
  --text: #f4f2ec;
  --muted: #aaa49a;
  --line: rgba(244, 242, 236, 0.18);
  --line-strong: rgba(244, 242, 236, 0.72);
  --radius-xl: 32px;
  --radius-lg: 22px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

html[data-theme="light"] {
  --bg: #f4f1ea;
  --bg-soft: #ebe5d8;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-strong: rgba(255, 255, 255, 0.92);
  --text: #111111;
  --muted: #5f5b54;
  --line: rgba(0, 0, 0, 0.18);
  --line-strong: rgba(0, 0, 0, 0.72);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.14);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, var(--surface-strong), transparent 34rem),
    radial-gradient(circle at bottom right, var(--surface), transparent 30rem),
    var(--bg);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  opacity: .22;
  background-size: 64px 64px;
  mask-image: radial-gradient(circle at center, black, transparent 78%);
}

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

.skip-link {
  position: absolute;
  left: -999px;
  top: 1rem;
  padding: .75rem 1rem;
  background: var(--text);
  color: var(--bg);
  border-radius: 999px;
  z-index: 10;
}
.skip-link:focus { left: 1rem; }

.site-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 56px;
  position: relative;
}

.site-header,
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.site-header { padding-bottom: 40px; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  letter-spacing: -0.06em;
  font-size: 1.2rem;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.brand-mark svg { width: 28px; height: 28px; }
.brand-mark path {
  fill: none;
  stroke: var(--line-strong);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
  color: var(--muted);
  font-size: .94rem;
}
.nav-links a:hover { color: var(--text); }

.theme-toggle {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  box-shadow: inset 0 0 0 1px transparent;
  transition:
    background .22s ease,
    color .22s ease,
    border-color .22s ease,
    transform .22s ease,
    box-shadow .22s ease;
}

.theme-toggle:hover {
  color: var(--text);
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.theme-toggle[aria-pressed="true"] {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
  box-shadow: 0 0 24px rgba(244, 242, 236, .18);
}

html[data-theme="light"] .theme-toggle[aria-pressed="true"] {
  box-shadow: 0 0 22px rgba(0, 0, 0, .12);
}

.theme-toggle__icon {
  width: 18px;
  height: 18px;
  display: block;
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero {
  min-height: 72vh;
  display: grid;
  grid-template-columns: 1.04fr .96fr;
  align-items: center;
  gap: 38px;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: .75rem;
  letter-spacing: .22em;
  text-transform: uppercase;
}

h1, h2, h3 { margin-top: 0; }

h1 {
  margin-bottom: 0;
  font-size: clamp(4.5rem, 12vw, 10rem);
  line-height: .82;
  letter-spacing: -.105em;
}

h2 {
  font-size: clamp(2.2rem, 5.4vw, 5rem);
  line-height: .92;
  letter-spacing: -.075em;
  margin-bottom: 16px;
}

h3 {
  font-size: 1.28rem;
  letter-spacing: -.035em;
  margin-bottom: 10px;
}

.hero-text,
.section-heading p,
.card p,
.pir8-teaser p {
  color: var(--muted);
  line-height: 1.65;
}

.hero-text {
  max-width: 680px;
  font-size: clamp(1.08rem, 2vw, 1.35rem);
  margin: 28px 0 0;
}

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

.button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 12px 18px;
  background: var(--surface-strong);
}
.button:hover { border-color: var(--line-strong); }
.button-ghost { color: var(--muted); background: transparent; }

.hero-art,
.card,
.concept-art,
.pir8-teaser {
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(255,255,255,.055), rgba(255,255,255,.018));
  box-shadow: var(--shadow);
}

.hero-art {
  min-height: 520px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-xl);
  padding: 24px;
  overflow: hidden;
}

.hero-art svg { width: 100%; max-width: 520px; }
.grid-lines path,
.routes path,
.panel-shape,
.ml-mark-large path,
.nodes circle,
.card-art svg *,
.concept-art svg *,
.pir8-mark svg * {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.grid-lines path { stroke: var(--line); stroke-width: 2; opacity: .45; }
.routes path { stroke: var(--line); stroke-width: 4; }
.panel-shape { stroke: var(--line); stroke-width: 3; fill: var(--surface); }
.panel-shape.thin { stroke: var(--line); }
.nodes circle { stroke: var(--line-strong); stroke-width: 3; fill: var(--bg-soft); }
.ml-mark-large path { stroke: var(--line-strong); stroke-width: 10; }

.section { margin-top: 88px; }
.section-heading { max-width: 850px; margin-bottom: 24px; }
.section-heading.compact { max-width: 600px; margin-bottom: 0; }

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

.card {
  border-radius: var(--radius-lg);
  padding: 24px;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card-art svg { width: 100%; max-width: 190px; height: auto; margin-bottom: 28px; }
.card-art svg * { stroke: var(--line-strong); stroke-width: 6; }
.card-art rect,
.card-art circle,
.card-art path:first-child { fill: var(--surface); }

.split-section {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: 24px;
  align-items: center;
}

.concept-art {
  border-radius: var(--radius-xl);
  padding: 20px;
}
.concept-art svg { width: 100%; }
.concept-art svg * { stroke: var(--line-strong); stroke-width: 6; }

.pir8-teaser {
  border-radius: var(--radius-xl);
  padding: clamp(24px, 5vw, 44px);
  display: grid;
  grid-template-columns: 1.3fr .7fr;
  gap: 22px;
  align-items: center;
}
.pir8-teaser p { max-width: 680px; }
.pir8-mark { justify-self: end; width: min(180px, 100%); opacity: .82; }
.pir8-mark svg { width: 100%; }
.pir8-mark svg * { stroke: var(--line-strong); stroke-width: 8; }

.site-footer {
  margin-top: 72px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: #777168;
  font-size: .92rem;
  flex-wrap: wrap;
}
.site-footer a:hover { color: var(--text); }


@media (max-width: 900px) {
  .site-header {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .nav-links {
    display: none;
  }

  .theme-toggle {
    margin-left: auto;
  }

  .hero,
  .split-section,
  .pir8-teaser {
    grid-template-columns: 1fr;
  }

  .hero-art {
    min-height: 380px;
  }

  .three-up {
    grid-template-columns: 1fr;
  }

  .pir8-mark {
    justify-self: start;
  }
}

@media (max-width: 520px) {
  .site-header {
    gap: 12px;
  }

  .theme-toggle {
    width: 36px;
    height: 36px;
    margin-left: auto;
  }
}
