:root {
  color-scheme: light;
  --bg: #f2f2f0;
  --ink: #0f0f12;
  --muted: #5c5c65;
  --panel: #ffffff;
  --panel-soft: rgba(255, 255, 255, 0.75);
  --panel-soft-2: rgba(255, 255, 255, 0.55);
  --line: #c9c9cf;
  --accent: #1a1a1a;
  --accent-2: #e2e2e8;
  --signal: #0f5154;
  --signal-2: #d9f0ed;
  --header-bg: linear-gradient(180deg, rgba(242, 242, 240, 0.94), rgba(242, 242, 240, 0.6));
  --parallax-overlay: linear-gradient(120deg, rgba(242, 242, 240, 0.96), rgba(242, 242, 240, 0.7));
  --hero-mesh: linear-gradient(120deg, rgba(255, 255, 255, 0.6), rgba(0, 0, 0, 0.04));
  --grid-v: rgba(0, 0, 0, 0.06);
  --grid-h: rgba(0, 0, 0, 0.04);
  --ghost-bg: rgba(15, 15, 18, 0.08);
  --focus-ring: rgba(15, 81, 84, 0.6);
  --block-mid: #f7f7f9;
  --block-top: #ededf2;
  --overlay-fill: rgba(217, 240, 237, 0.6);
  --diagram-bg: #fafafa;
  --tile-accent-bg: #111317;
  --cta-bg: #111317;
  --primary-btn-bg: #0f0f12;
  --primary-btn-text: #ffffff;
  --shadow: 0 24px 60px rgba(15, 15, 18, 0.15);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c1116;
  --ink: #e8edf2;
  --muted: #a3acb7;
  --panel: #141c24;
  --panel-soft: rgba(20, 28, 36, 0.86);
  --panel-soft-2: rgba(20, 28, 36, 0.7);
  --line: #2f3d4b;
  --accent: #f1f6ff;
  --accent-2: #202a34;
  --signal: #6ec5c8;
  --signal-2: #1d3a3d;
  --header-bg: linear-gradient(180deg, rgba(12, 17, 22, 0.94), rgba(12, 17, 22, 0.6));
  --parallax-overlay: linear-gradient(120deg, rgba(12, 17, 22, 0.93), rgba(12, 17, 22, 0.65));
  --hero-mesh: linear-gradient(120deg, rgba(20, 28, 36, 0.72), rgba(0, 0, 0, 0.24));
  --grid-v: rgba(232, 237, 242, 0.08);
  --grid-h: rgba(232, 237, 242, 0.06);
  --ghost-bg: rgba(232, 237, 242, 0.12);
  --focus-ring: rgba(110, 197, 200, 0.7);
  --block-mid: #19232c;
  --block-top: #212f3a;
  --overlay-fill: rgba(31, 74, 78, 0.64);
  --diagram-bg: #101821;
  --tile-accent-bg: #1f2933;
  --cta-bg: #1f2933;
  --primary-btn-bg: #6ec5c8;
  --primary-btn-text: #0c1116;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

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

body {
  font-family: "Space Grotesk", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  position: relative;
  overflow-x: hidden;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background:
    var(--hero-mesh),
    repeating-linear-gradient(
      90deg,
      var(--grid-v) 0,
      var(--grid-v) 1px,
      transparent 1px,
      transparent 120px
    ),
    repeating-linear-gradient(
      0deg,
      var(--grid-h) 0,
      var(--grid-h) 1px,
      transparent 1px,
      transparent 120px
    );
  z-index: -2;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 6vw 0;
  position: sticky;
  top: 0;
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  z-index: 10;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo {
  font-weight: 700;
  letter-spacing: 0.2em;
  font-size: 0.9rem;
}

nav {
  display: flex;
  gap: 24px;
  font-size: 0.9rem;
}

nav a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 500;
  position: relative;
  padding-bottom: 4px;
  transition: color 0.3s ease;
}

nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--signal);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

nav a:hover {
  color: var(--ink);
}

nav a:hover::after {
  transform: scaleX(1);
}

nav a:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 4px;
  border-radius: 4px;
}
button {
  font-family: "IBM Plex Mono", monospace;
  border-radius: 999px;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  padding: 10px 20px;
  cursor: pointer;
  transition: transform 0.3s ease, background 0.3s ease;
}

button:hover {
  transform: translateY(-2px);
}

.primary {
  background: var(--primary-btn-bg);
  color: var(--primary-btn-text);
  border-color: var(--primary-btn-bg);
}

.secondary {
  border-color: var(--line);
  color: var(--ink);
  background: var(--panel);
}

.ghost {
  border-color: transparent;
  background: var(--ghost-bg);
}

.theme-toggle {
  border-color: var(--line);
  background: var(--panel);
  color: var(--ink);
  width: 42px;
  height: 42px;
  padding: 0;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.theme-icon {
  position: absolute;
  width: 20px;
  height: 20px;
  transition: opacity 0.24s ease, transform 0.3s ease;
}

.theme-icon-moon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.theme-icon-sun {
  opacity: 0;
  transform: rotate(-20deg) scale(0.85);
}

[data-theme="dark"] .theme-icon-moon {
  opacity: 0;
  transform: rotate(20deg) scale(0.85);
}

[data-theme="dark"] .theme-icon-sun {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

main {
  padding: 40px 6vw 80px;
  display: flex;
  flex-direction: column;
  gap: 80px;
}

.parallax {
  position: relative;
  overflow: hidden;
}

.parallax::before {
  content: "";
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  transform: translateZ(0);
  opacity: 0.5;
  filter: grayscale(100%);
}

.parallax::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--parallax-overlay);
}

.hero-parallax::before {
  background-image: url("./hero-abstract.jpg");
}

.usecases-parallax::before {
  background-image: url("./usecases-grid.jpg");
  opacity: 0.35;
}

.hero-parallax {
  overflow: visible;
}

.parallax > * {
  position: relative;
  z-index: 1;
}

.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 60px;
  align-items: center;
  padding: 60px 40px 40px;
  background: transparent;
  min-height: 70vh;
}

.eyebrow {
  font-family: "IBM Plex Mono", monospace;
  letter-spacing: 0.2em;
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
}

h1 {
  font-size: clamp(2.6rem, 4vw, 4rem);
  line-height: 1.05;
  margin-bottom: 20px;
}

.lead {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 520px;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 28px 0 24px;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
  max-width: 420px;
}

.metric {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
}

.value {
  font-weight: 600;
  display: block;
  margin-top: 6px;
}

.hero-visual {
  position: relative;
  min-height: 360px;
  display: grid;
  place-items: center;
}

.stack {
  position: relative;
  width: 260px;
  height: 220px;
}

.block {
  position: absolute;
  width: 100%;
  height: 140px;
  border-radius: 16px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: var(--panel);
  opacity: 0;
  transform: translateY(20px);
  animation: float-in 1s ease forwards;
}

.block.base {
  bottom: 0;
  animation-delay: 0.1s;
}

.block.mid {
  bottom: 28px;
  left: 16px;
  background: var(--block-mid);
  animation-delay: 0.3s;
}

.block.top {
  bottom: 56px;
  left: 32px;
  background: var(--block-top);
  animation-delay: 0.5s;
}

.block.overlay {
  bottom: 86px;
  left: 48px;
  border: 2px dashed var(--signal);
  background: var(--overlay-fill);
  animation-delay: 0.7s;
}

.seal {
  position: absolute;
  top: 24px;
  right: 0;
  transform: translateX(10px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.7rem;
  background: var(--panel);
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.signal {
  position: absolute;
  bottom: -20px;
  left: -40px;
  width: 320px;
  stroke: var(--signal);
  stroke-width: 2;
  fill: none;
  opacity: 0.6;
}

.section {
  background: var(--panel-soft);
  border-radius: 24px;
  padding: 50px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.usecases-parallax {
  background: var(--panel-soft-2);
  min-height: 60vh;
}

.section.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 40px;
  align-items: center;
}

.section-head {
  margin-bottom: 30px;
  max-width: 680px;
}

h2 {
  font-size: clamp(2rem, 3vw, 2.8rem);
  margin-bottom: 16px;
}

h3 {
  font-size: 1.2rem;
  margin-bottom: 10px;
}

.bullets {
  margin-top: 20px;
  display: grid;
  gap: 10px;
  color: var(--muted);
  list-style: none;
}

.bullets li::before {
  content: "•";
  margin-right: 8px;
}

.diagram {
  border: 1px dashed var(--line);
  padding: 24px;
  border-radius: 16px;
  background: var(--diagram-bg);
}

.lane {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.lane span {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.7rem;
  color: var(--muted);
  width: 70px;
}

.node {
  width: 34px;
  height: 12px;
  border-radius: 999px;
  background: var(--line);
}

.chaos {
  margin-top: 16px;
  padding: 10px 14px;
  font-family: "IBM Plex Mono", monospace;
  background: var(--signal-2);
  border-radius: 999px;
  display: inline-block;
}

.block-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.definition-block {
  background: #0f1114;
  color: #f5f5f7;
  border-radius: 18px;
  padding: 24px;
  border: 1px solid #26262e;
  margin-bottom: 26px;
}

.definition-title {
  font-family: "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.7rem;
  color: #b5b5bf;
  margin-bottom: 12px;
}

.definition {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.9rem;
  line-height: 1.6;
  white-space: pre-wrap;
  margin: 0 0 12px 0;
}

.definition-footnote {
  font-size: 0.95rem;
  color: #c8c8d0;
}

.tile {
  background: var(--panel);
  border-radius: 18px;
  padding: 20px;
  border: 1px solid var(--line);
}

.tile.accent {
  background: var(--tile-accent-bg);
  color: #fff;
  border-color: var(--tile-accent-bg);
}

.flow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 20px;
  text-align: left;
  width: 100%;
  justify-items: stretch;
}

.flow-item {
  background: var(--panel);
  border-radius: 16px;
  padding: 18px 18px 18px 0;
  border: none;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  width: 100%;
}

.flow-item h3 {
  margin: 0 0 8px 0;
  font-size: 1.05rem;
}

.flow-item p {
  margin: 0;
  color: inherit;
  line-height: 1.6;
}

.blueprint {
  position: relative;
  background: #0f0f12;
  border-radius: 20px;
  padding: 20px;
  color: #fff;
}

.blueprint svg {
  width: 100%;
  stroke: #e9e9ef;
  fill: none;
  stroke-width: 1.5;
}

.blueprint rect {
  stroke: #4b4b56;
}

.blueprint-label {
  margin-top: 12px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.8rem;
  color: #c8c8d0;
}

.case-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.case {
  background: var(--panel);
  border-radius: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  transition: transform 0.3s ease;
}

.case:hover {
  transform: translateY(-4px);
}

.spec-list {
  list-style: none;
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.spec-list li {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.9rem;
}

.spec-list span:last-child {
  color: var(--muted);
  font-family: "Space Grotesk", sans-serif;
}

.cta-panel {
  background: var(--cta-bg);
  color: #fff;
  border-radius: 20px;
  padding: 32px;
  display: grid;
  gap: 16px;
}

footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 20px;
  padding: 30px 6vw 50px;
  border-top: 1px solid var(--line);
}

.footer-links {
  display: flex;
  gap: 18px;
  font-size: 0.85rem;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
}

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

@media (max-width: 900px) {
  .parallax::before {
    background-attachment: scroll;
  }
  nav {
    display: none;
  }

  .site-header {
    padding: 20px 6vw 0;
  }

  .seal {
    position: static;
    margin-top: 20px;
  }

  .hero-visual {
    min-height: 320px;
  }

  .section {
    padding: 36px;
  }

  .spec-list li {
    flex-direction: column;
  }
}

@media (max-width: 600px) {
  main {
    padding: 20px 5vw 60px;
  }

  .header-actions {
    gap: 8px;
  }

  .header-actions button {
    padding: 8px 14px;
    font-size: 0.72rem;
  }

  .theme-toggle {
    width: 36px;
    height: 36px;
    padding: 0;
  }

  .section {
    padding: 28px;
  }

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