:root {
  --bg: #0b0c0c;
  --bg-2: #111312;
  --ink: #f1efe7;
  --muted: #8f918a;
  --dim: #5d615a;
  --line: rgba(241, 239, 231, 0.12);
  --line-strong: rgba(241, 239, 231, 0.24);
  --panel: rgba(241, 239, 231, 0.045);
  --panel-strong: rgba(241, 239, 231, 0.075);
  --green: #96ffb0;
  --amber: #ffd36a;
  --red: #ff6a54;
  --cyan: #8ad8ff;
  --mono: "SF Mono", "IBM Plex Mono", "Berkeley Mono", "Menlo", monospace;
  --sans: "Avenir Next", "SF Pro Display", "Helvetica Neue", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(241, 239, 231, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(241, 239, 231, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 60% 0%, rgba(150, 255, 176, 0.08), transparent 36rem),
    var(--bg);
  background-size: 24px 24px, 24px 24px, auto, auto;
  font-family: var(--sans);
  letter-spacing: 0;
}

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

button {
  font: inherit;
}

::selection {
  color: #08100b;
  background: var(--green);
}

.site-noise {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.22;
  background-image: url("data:image/svg+xml,%3Csvg width='7' height='7' viewBox='0 0 7 7' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1h1v1H1zM4 0h1v1H4zM6 3h1v1H6zM2 5h1v1H2z' fill='%23f1efe7' fill-opacity='.16'/%3E%3C/svg%3E");
  mix-blend-mode: screen;
}

.site-frame {
  position: fixed;
  inset: 14px;
  z-index: 2;
  pointer-events: none;
  border: 1px solid var(--line);
}

.topbar,
main,
.footer {
  position: relative;
  z-index: 3;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
  width: min(100% - 3rem, 1240px);
  margin: 0 auto;
  padding: 2rem 0 0;
}

.wordmark {
  display: grid;
  gap: 0.35rem;
  min-width: 10rem;
  font-family: var(--mono);
  line-height: 1;
  text-transform: uppercase;
}

.wordmark span:first-child {
  font-size: 0.82rem;
  font-weight: 700;
}

.wordmark span:last-child {
  color: var(--muted);
  font-size: 0.68rem;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem;
  font-family: var(--mono);
}

.nav a,
.button,
.footer a,
.experiment-link,
.control-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.55rem 0.72rem;
  color: var(--muted);
  background: rgba(11, 12, 12, 0.42);
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1;
  transition:
    border-color 160ms ease,
    color 160ms ease,
    background-color 160ms ease,
    transform 160ms ease;
}

.nav a:hover,
.button:hover,
.footer a:hover,
.experiment-link:hover,
.control-button:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  background: var(--panel-strong);
  transform: translateY(-1px);
}

.button.primary {
  color: #071109;
  border-color: rgba(150, 255, 176, 0.6);
  background: var(--green);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(22rem, 0.78fr);
  gap: 3rem;
  align-items: center;
  width: min(100% - 3rem, 1240px);
  min-height: 41rem;
  margin: 0 auto;
  padding: 4.5rem 0 4rem;
}

.hero-copy {
  display: grid;
  gap: 1.4rem;
  min-width: 0;
}

.kicker,
.tile-kind,
.tile-no,
.console-head,
.console-readout,
.bench,
.footer,
.experiment-kicker,
.metric-label,
.state-label,
.page-note,
.legend {
  font-family: var(--mono);
  text-transform: uppercase;
}

.kicker {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

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

.hero h1 {
  max-width: 9.5ch;
  font-size: 6.7rem;
  font-weight: 560;
  line-height: 0.9;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.hero-console {
  display: grid;
  gap: 0.85rem;
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0.8rem;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(241, 239, 231, 0.065), rgba(241, 239, 231, 0.025)),
    rgba(11, 12, 12, 0.68);
  box-shadow: 0 2rem 4rem rgba(0, 0, 0, 0.28);
}

.console-head,
.console-readout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.68rem;
}

.bit-grid {
  display: grid;
  grid-template-columns: repeat(28, minmax(0, 1fr));
  gap: 2px;
  aspect-ratio: 28 / 18;
  width: 100%;
  min-width: 0;
  min-height: 16rem;
}

.bit-cell {
  min-width: 0;
  background: rgba(241, 239, 231, 0.065);
  transition:
    background-color 120ms linear,
    opacity 120ms linear,
    transform 120ms linear;
}

.bit-cell[data-on="1"] {
  background: var(--green);
  box-shadow: 0 0 1.25rem rgba(150, 255, 176, 0.18);
}

.bit-cell[data-hot="1"] {
  background: var(--amber);
  transform: scale(1.03);
}

.console-readout {
  display: grid;
  grid-template-columns: repeat(6, auto);
  justify-content: start;
  gap: 0.45rem 0.8rem;
}

.console-readout span:nth-child(even) {
  color: var(--ink);
}

.lab-wall {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.75rem;
  width: min(100% - 3rem, 1240px);
  margin: 0 auto;
  border-top: 1px solid var(--line);
  padding: 4rem 0;
}

.lab-tile {
  position: relative;
  display: grid;
  align-content: start;
  gap: 0.85rem;
  min-height: 25rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
  overflow: hidden;
  background:
    linear-gradient(rgba(241, 239, 231, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(241, 239, 231, 0.035) 1px, transparent 1px),
    rgba(241, 239, 231, 0.035);
  background-size: 18px 18px, 18px 18px, auto;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background-color 180ms ease;
}

.lab-tile:nth-child(1),
.lab-tile:nth-child(2),
.lab-tile:nth-child(3) {
  grid-column: span 2;
}

.lab-tile:nth-child(4),
.lab-tile:nth-child(5) {
  grid-column: span 3;
  min-height: 20rem;
}

.lab-tile:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  background-color: rgba(241, 239, 231, 0.055);
}

.tile-no {
  position: absolute;
  right: 1rem;
  top: 1rem;
  color: var(--dim);
  font-size: 0.72rem;
}

.tile-canvas,
.tile-schematic {
  width: 100%;
  aspect-ratio: 2.35 / 1;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #070808;
}

.tile-schematic {
  display: block;
  position: relative;
  overflow: hidden;
}

.tile-schematic::before,
.tile-schematic::after {
  content: "";
  position: absolute;
  inset: 0;
}

.tile-schematic-scroll::before {
  background:
    linear-gradient(90deg, transparent 0 18%, rgba(150, 255, 176, 0.72) 18% 20%, transparent 20% 100%),
    repeating-linear-gradient(0deg, transparent 0 18px, rgba(241, 239, 231, 0.18) 18px 19px);
}

.tile-schematic-scroll::after {
  width: 40%;
  height: 55%;
  inset: 24% auto auto 38%;
  border: 1px solid rgba(255, 211, 106, 0.72);
  background: rgba(255, 211, 106, 0.08);
}

.tile-schematic-canvas::before {
  background:
    linear-gradient(90deg, rgba(138, 216, 255, 0.4) 1px, transparent 1px),
    linear-gradient(rgba(138, 216, 255, 0.28) 1px, transparent 1px);
  background-size: 30px 30px;
}

.tile-schematic-canvas::after {
  inset: 18% 16% 24% 22%;
  border: 1px solid rgba(150, 255, 176, 0.7);
  clip-path: polygon(0 0, 78% 0, 100% 42%, 58% 100%, 0 72%);
  background: rgba(150, 255, 176, 0.06);
}

.tile-kind {
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.4;
}

.lab-tile h2 {
  max-width: 9ch;
  font-size: 2.25rem;
  font-weight: 560;
  line-height: 0.95;
}

.lab-tile p {
  max-width: 29ch;
  color: #b8baaf;
  font-size: 0.98rem;
  line-height: 1.45;
}

.bench {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  width: min(100% - 3rem, 1240px);
  margin: 0 auto;
  border-top: 1px solid var(--line);
  padding: 1rem 0 4rem;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.35;
}

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(100% - 3rem, 1240px);
  margin: 0 auto;
  border-top: 1px solid var(--line);
  padding: 1.35rem 0 2rem;
  color: var(--muted);
  font-size: 0.68rem;
}

.reveal {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 620ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 620ms cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: var(--delay, 0ms);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.experiment-main {
  width: min(100% - 3rem, 1240px);
  margin: 0 auto;
  padding: 4rem 0 4rem;
}

.experiment-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(18rem, 0.5fr);
  gap: 3rem;
  align-items: end;
  min-height: 16rem;
  padding-bottom: 2.5rem;
}

.experiment-kicker {
  margin-bottom: 1rem;
  color: var(--muted);
  font-size: 0.72rem;
}

.experiment-hero h1 {
  max-width: 9ch;
  font-size: 5rem;
  font-weight: 560;
  line-height: 0.92;
}

.experiment-hero p {
  max-width: 32rem;
  color: #c8c9c0;
  font-size: 1.05rem;
  line-height: 1.6;
}

.experiment-link {
  width: fit-content;
  align-self: end;
}

.experiment-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 17rem;
  gap: 0.75rem;
  min-height: 37rem;
  border-top: 1px solid var(--line);
  padding-top: 0.75rem;
}

.experiment-stage {
  position: relative;
  min-height: 37rem;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  overflow: hidden;
  background: #060707;
}

.experiment-stage canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.experiment-sidebar {
  display: grid;
  align-content: start;
  gap: 0.75rem;
}

.metric-card,
.state-card,
.control-card {
  display: grid;
  gap: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.9rem;
  background: var(--panel);
}

.metric-label,
.state-label {
  color: var(--muted);
  font-size: 0.68rem;
}

.metric-value {
  color: var(--ink);
  font-family: var(--mono);
  font-size: 1.45rem;
  line-height: 1;
}

.state-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: #c8c9c0;
  font-family: var(--mono);
  font-size: 0.75rem;
}

.state-row span:last-child {
  color: var(--green);
}

.control-button {
  width: 100%;
  cursor: pointer;
}

.page-note {
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.55;
}

.legend {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.68rem;
  pointer-events: none;
}

.legend span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.32rem 0.48rem;
  background: rgba(6, 7, 7, 0.72);
}

@media (max-width: 980px) {
  .hero,
  .experiment-hero,
  .experiment-panel {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: 4rem;
  }

  .hero h1 {
    font-size: 5rem;
  }

  .hero-console {
    max-width: 38rem;
  }

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

  .lab-tile:nth-child(n) {
    grid-column: span 1;
  }

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

@media (max-width: 680px) {
  .site-frame {
    inset: 9px;
  }

  .topbar,
  .hero,
  .lab-wall,
  .bench,
  .footer,
  .experiment-main {
    width: min(100% - 2rem, 1240px);
  }

  .topbar {
    flex-direction: column;
    gap: 1rem;
    padding-top: 1.45rem;
  }

  .nav {
    justify-content: flex-start;
  }

  .hero {
    gap: 2rem;
    padding: 3.25rem 0 3rem;
  }

  .hero h1,
  .experiment-hero h1 {
    font-size: 3.25rem;
  }

  .bit-grid {
    min-height: 11rem;
  }

  .console-readout {
    grid-template-columns: repeat(2, auto);
  }

  .lab-wall {
    grid-template-columns: 1fr;
    padding: 2.5rem 0;
  }

  .lab-tile {
    min-height: 21rem;
  }

  .bench,
  .experiment-sidebar {
    grid-template-columns: 1fr;
  }

  .footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .experiment-main {
    padding-top: 3.5rem;
  }

  .experiment-panel,
  .experiment-stage {
    min-height: 28rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
