:root {
  --paper: #f7f7f2;
  --paper-2: #ecece4;
  --ink: #0f1216;
  --muted: #6f756f;
  --line: rgba(15, 18, 22, 0.14);
  --line-strong: rgba(15, 18, 22, 0.28);
  --orange: #ff5f2e;
  --teal: #00a7a7;
  --blue: #2f6bff;
  --violet: #7d55ff;
  --shadow: 0 30px 90px rgba(26, 32, 31, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(15, 18, 22, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 18, 22, 0.055) 1px, transparent 1px),
    radial-gradient(circle at 82% 12%, rgba(0, 167, 167, 0.18), transparent 28rem),
    radial-gradient(circle at 18% 80%, rgba(255, 95, 46, 0.16), transparent 26rem),
    var(--paper);
  background-size: 28px 28px, 28px 28px, auto, auto, auto;
  font-family: Geist, Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  overflow-x: hidden;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -4;
  content: "";
  background: linear-gradient(90deg, rgba(247, 247, 242, 0.92), transparent 30%, transparent 70%, rgba(247, 247, 242, 0.92));
  pointer-events: none;
}

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

#neural-canvas {
  position: fixed;
  inset: 0;
  z-index: -3;
  width: 100%;
  height: 100%;
  opacity: 0.56;
  pointer-events: none;
}

.site-header,
main,
.footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 76px;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 247, 242, 0.78);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  font-weight: 800;
}

.mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--paper);
  box-shadow: 0 12px 32px rgba(15, 18, 22, 0.08);
}

.mark svg {
  width: 28px;
  height: 28px;
}

.mark path {
  fill: none;
  stroke: var(--ink);
  stroke-width: 5;
  stroke-linecap: round;
}

.mark circle:first-of-type {
  fill: var(--orange);
}

.mark circle:last-of-type {
  fill: var(--teal);
}

.nav {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.nav a,
.git-link,
.button {
  min-height: 42px;
  padding: 13px 16px;
  border: 1px solid transparent;
  border-radius: 0;
  font-family: "Geist Mono", monospace;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.nav a:hover,
.git-link:hover {
  border-color: var(--line-strong);
  background: var(--paper-2);
}

.git-link {
  justify-self: end;
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.index-rail {
  position: fixed;
  top: 50%;
  left: 22px;
  z-index: 10;
  display: grid;
  gap: 10px;
  transform: translateY(-50%);
}

.index-rail a {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  background: rgba(247, 247, 242, 0.78);
  color: var(--muted);
  font-family: "Geist Mono", monospace;
  font-size: 0.68rem;
  font-weight: 700;
  backdrop-filter: blur(12px);
}

.index-rail a:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(360px, 0.88fr);
  gap: 50px;
  align-items: center;
  min-height: calc(100vh - 76px);
  padding: 64px 0 70px;
}

.mono {
  margin: 0 0 18px;
  color: var(--muted);
  font-family: "Geist Mono", monospace;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.5;
  text-transform: uppercase;
}

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

h1 {
  max-width: 800px;
  margin-bottom: 24px;
  font-size: clamp(4.5rem, 10vw, 10rem);
  font-weight: 800;
  line-height: 0.88;
  letter-spacing: 0;
  text-wrap: balance;
}

h2 {
  margin-bottom: 22px;
  font-size: clamp(2.8rem, 6vw, 6.7rem);
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: 0;
  text-wrap: balance;
}

h3 {
  margin-bottom: 12px;
  font-size: 1.34rem;
  line-height: 1.1;
}

p {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.72;
}

.hero-copy > p:not(.mono) {
  max-width: 630px;
  color: #4e544f;
  font-size: clamp(1.06rem, 1.4vw, 1.22rem);
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-color: var(--ink);
  transition: transform 0.2s ease, background 0.2s ease;
}

.button.primary {
  background: var(--ink);
  color: var(--paper);
}

.button.secondary {
  background: rgba(247, 247, 242, 0.68);
}

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

.lab-board {
  min-height: 610px;
  border: 1px solid var(--line-strong);
  background:
    linear-gradient(rgba(15, 18, 22, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 18, 22, 0.06) 1px, transparent 1px),
    rgba(247, 247, 242, 0.78);
  background-size: 22px 22px;
  box-shadow: var(--shadow);
}

.board-top,
.board-bottom {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 20px;
  border-bottom: 1px solid var(--line);
  font-family: "Geist Mono", monospace;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.board-bottom {
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.node-map {
  position: relative;
  min-height: 492px;
  overflow: hidden;
}

.node-map svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.node-map path {
  fill: none;
  stroke: rgba(15, 18, 22, 0.42);
  stroke-width: 2;
}

.node-map path:nth-child(1) {
  stroke: var(--orange);
}

.node-map path:nth-child(2) {
  stroke: var(--teal);
}

.node {
  position: absolute;
  z-index: 2;
  display: block;
  width: 22px;
  height: 22px;
  border: 4px solid var(--paper);
  background: var(--ink);
  box-shadow: 0 0 0 1px var(--ink), 0 14px 34px rgba(15, 18, 22, 0.18);
}

.n1 {
  top: 66%;
  left: 14%;
  background: var(--orange);
}

.n2 {
  top: 24%;
  left: 25%;
}

.n3 {
  top: 76%;
  left: 41%;
  background: var(--blue);
}

.n4 {
  top: 39%;
  left: 56%;
  background: var(--teal);
}

.n5 {
  top: 58%;
  left: 84%;
  background: var(--violet);
}

.logic,
.stack,
.contact-strip {
  padding: 105px 0;
}

.section-title {
  display: grid;
  grid-template-columns: 0.36fr 1fr;
  gap: 42px;
  align-items: end;
  margin-bottom: 44px;
}

.logic-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line-strong);
  border-left: 1px solid var(--line-strong);
}

.logic-grid article {
  min-height: 310px;
  padding: 28px;
  border-right: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  background: rgba(247, 247, 242, 0.72);
}

.logic-grid span {
  display: inline-block;
  margin-bottom: 78px;
  color: var(--orange);
  font-family: "Geist Mono", monospace;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
}

.stack {
  display: grid;
  grid-template-columns: 0.92fr 1fr;
  gap: 46px;
  align-items: stretch;
}

.stack-panel {
  min-height: 520px;
  padding: 34px;
  background: var(--ink);
  color: var(--paper);
}

.stack-panel .mono,
.stack-panel p {
  color: rgba(247, 247, 242, 0.66);
}

.stack-panel h2 {
  margin-top: 130px;
  color: var(--paper);
}

.stack-list {
  display: grid;
  gap: 1px;
  border: 1px solid var(--line-strong);
  background: var(--line-strong);
}

.stack-list div {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 28px;
  align-items: start;
  padding: 30px;
  background: rgba(247, 247, 242, 0.82);
}

.stack-list strong {
  font-size: 1rem;
}

.stack-list p {
  margin: 0;
}

.contact-strip {
  display: grid;
  grid-template-columns: 1fr minmax(320px, 0.72fr);
  gap: 54px;
  align-items: end;
  padding-bottom: 130px;
}

.contact-card {
  display: grid;
  border-top: 1px solid var(--line-strong);
  font-style: normal;
}

.contact-card a {
  display: block;
  padding: 22px 0;
  border-bottom: 1px solid var(--line-strong);
  font-family: "Geist Mono", monospace;
  font-size: 0.86rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.contact-card a:hover {
  color: var(--orange);
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 30px 0 42px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: "Geist Mono", monospace;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.footer span:last-child {
  display: flex;
  gap: 20px;
}

.legal {
  width: min(820px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 70px 0;
}

.legal .brand {
  margin-bottom: 80px;
}

.legal h1 {
  font-size: clamp(4rem, 14vw, 9rem);
}

.legal .button {
  margin-top: 24px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 980px) {
  .site-header {
    grid-template-columns: 1fr auto;
    row-gap: 10px;
    padding: 12px 0;
  }

  .nav {
    grid-column: 1 / -1;
    justify-content: space-between;
    order: 3;
    padding-top: 10px;
    border-top: 1px solid var(--line);
  }

  .hero,
  .section-title,
  .stack,
  .contact-strip {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .logic-grid {
    grid-template-columns: 1fr;
  }

  .lab-board {
    min-height: 540px;
  }

  .index-rail {
    display: none;
  }
}

@media (max-width: 620px) {
  .site-header,
  main,
  .footer {
    width: min(100% - 22px, 1180px);
  }

  .brand {
    font-size: 0.96rem;
  }

  .nav {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: 100%;
    overflow: visible;
  }

  .nav a,
  .git-link,
  .button {
    padding-inline: 12px;
    font-size: 0.68rem;
  }

  .nav a {
    text-align: center;
  }

  h1 {
    font-size: clamp(3.7rem, 18vw, 6.2rem);
  }

  h2 {
    font-size: clamp(2.8rem, 14vw, 4.5rem);
  }

  .hero {
    gap: 30px;
    padding-top: 44px;
  }

  .lab-board {
    min-height: 430px;
  }

  .node-map {
    min-height: 320px;
  }

  .board-top,
  .board-bottom {
    flex-wrap: wrap;
  }

  .stack-panel {
    min-height: 420px;
  }

  .stack-panel h2 {
    margin-top: 70px;
  }

  .stack-list div {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .footer {
    flex-direction: column;
  }
}
