:root {
  --forest-950: #07130d;
  --forest-900: #0b1e15;
  --forest-800: #102b1e;
  --forest-700: #173d2a;
  --moss: #2f6b45;
  --frog: #b7f34a;
  --frog-bright: #d8ff80;
  --cream: #f2eedf;
  --paper: #e8e3d2;
  --ink: #122019;
  --orange: #ff7a3d;
  --red: #ff4f45;
  --cyan: #60e7da;
  --muted-dark: #9bb1a2;
  --muted-light: #59675f;
  --line-dark: rgba(216, 255, 128, 0.18);
  --line-light: rgba(18, 32, 25, 0.18);
  --shadow: 0 26px 70px rgba(3, 12, 7, 0.34);
  --mono: "SFMono-Regular", "Cascadia Code", "Roboto Mono", Consolas, monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  background: var(--forest-950);
  color: var(--cream);
  font-family: var(--sans);
  line-height: 1.55;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 3px solid white;
  outline-offset: 2px;
  box-shadow: 0 0 0 6px var(--ink);
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: 0.65rem 0.9rem;
  transform: translateY(-150%);
  background: var(--cream);
  color: var(--ink);
  font-weight: 800;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  min-height: 4.65rem;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 0 4vw;
  border-bottom: 1px solid var(--line-dark);
  background: rgba(7, 19, 13, 0.9);
  backdrop-filter: blur(16px);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--cream);
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.wordmark span:not(.wordmark-dot) {
  color: var(--frog);
}

.wordmark-dot {
  width: 0.75rem;
  height: 0.75rem;
  border: 2px solid var(--frog);
  border-radius: 50% 50% 42% 42%;
  box-shadow: inset 0 -2px 0 var(--moss);
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(0.9rem, 2vw, 2rem);
}

nav a {
  color: var(--muted-dark);
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-decoration: none;
  text-transform: uppercase;
}

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

.hero {
  position: relative;
  display: grid;
  min-height: calc(100vh - 4.65rem);
  grid-template-columns: minmax(0, 1.05fr) minmax(22rem, 0.95fr);
  align-items: center;
  gap: clamp(3rem, 7vw, 8rem);
  overflow: hidden;
  padding: clamp(4rem, 8vw, 8rem) max(4vw, calc((100vw - 88rem) / 2));
  background:
    radial-gradient(circle at 78% 45%, rgba(183, 243, 74, 0.11), transparent 28rem),
    linear-gradient(115deg, var(--forest-950), var(--forest-900));
}

.hero::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--line-dark) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-dark) 1px, transparent 1px);
  background-size: 46px 46px;
  content: "";
  mask-image: linear-gradient(to bottom, black, transparent 90%);
  opacity: 0.36;
}

.hero-copy,
.badge-stage {
  position: relative;
  z-index: 1;
}

.eyebrow,
.section-kicker,
.terminal-label {
  margin: 0 0 1rem;
  color: var(--frog);
  font-family: var(--mono);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 12ch;
  margin-bottom: 1.6rem;
  font-size: clamp(3.5rem, 7.3vw, 7.7rem);
  font-weight: 850;
  letter-spacing: -0.065em;
  line-height: 0.88;
  text-wrap: balance;
}

h1 em {
  color: var(--frog);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
}

h2 {
  max-width: 19ch;
  margin-bottom: 1.3rem;
  font-size: clamp(2.35rem, 5vw, 4.8rem);
  font-weight: 820;
  letter-spacing: -0.05em;
  line-height: 0.98;
  text-wrap: balance;
}

h3 {
  margin-bottom: 0.75rem;
  font-size: 1.28rem;
  letter-spacing: -0.025em;
}

.lede {
  max-width: 58ch;
  margin-bottom: 2rem;
  color: #c4d0c6;
  font-size: clamp(1.05rem, 1.7vw, 1.3rem);
}

.hero-actions,
.flash-action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem;
}

.button {
  display: inline-flex;
  min-height: 3.1rem;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 0.25rem;
  padding: 0.75rem 1.1rem;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.035em;
  text-decoration: none;
  text-transform: uppercase;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

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

.button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.65);
  opacity: 0.48;
}

.button-primary {
  background: var(--frog);
  color: var(--forest-950);
  box-shadow: 0 12px 32px rgba(183, 243, 74, 0.16);
}

.button-secondary {
  border-color: rgba(242, 238, 223, 0.32);
  background: rgba(242, 238, 223, 0.05);
  color: var(--cream);
}

.button-danger {
  background: var(--red);
  color: white;
  box-shadow: 0 12px 32px rgba(255, 79, 69, 0.18);
}

.status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1.35rem;
  margin: 2.2rem 0 0;
  padding: 0;
  color: var(--muted-dark);
  font-family: var(--mono);
  font-size: 0.7rem;
  list-style: none;
  text-transform: uppercase;
}

.status-strip li {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.signal {
  width: 0.52rem;
  height: 0.52rem;
  border-radius: 50%;
  background: var(--muted-dark);
}

.signal-good { background: var(--frog); box-shadow: 0 0 12px var(--frog); }
.signal-warn { background: var(--orange); box-shadow: 0 0 12px var(--orange); }
.signal-lab { background: var(--cyan); box-shadow: 0 0 12px var(--cyan); }

.badge-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.badge-lanyard {
  width: 38%;
  height: 5rem;
  border: 1.15rem solid rgba(242, 238, 223, 0.16);
  border-bottom: 0;
  border-radius: 8rem 8rem 0 0;
}

.badge-shell {
  width: min(100%, 39rem);
  border: 1px solid #3c5145;
  border-radius: 1.4rem;
  padding: clamp(1.2rem, 3vw, 2rem);
  background: linear-gradient(155deg, #18241e, #080c0a 70%);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transform: rotate(1.5deg);
}

.badge-topline,
.badge-bottomline {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted-dark);
  font-family: var(--mono);
  font-size: clamp(0.52rem, 1vw, 0.68rem);
  letter-spacing: 0.07em;
}

.badge-bottomline {
  flex-wrap: wrap;
  margin-top: 1rem;
}

.live-dot {
  color: var(--frog);
}

.led-matrix {
  display: grid;
  width: 100%;
  aspect-ratio: 4 / 1.25;
  grid-template-columns: repeat(44, 1fr);
  grid-template-rows: repeat(11, 1fr);
  gap: clamp(1px, 0.22vw, 3px);
  margin: 1rem 0 0.75rem;
  border: 1px solid #1d2a23;
  border-radius: 0.55rem;
  padding: 0.8rem;
  background: #010302;
  box-shadow: inset 0 0 35px black;
}

.matrix-pixel {
  aspect-ratio: 1;
  border-radius: 50%;
  background: #152018;
  box-shadow: inset 0 0 1px #3a4a3f;
}

.matrix-pixel.is-on {
  background: var(--frog-bright);
  box-shadow: 0 0 8px rgba(216, 255, 128, 0.88), 0 0 2px white;
}

.stage-caption {
  margin: 1rem 0 0;
  color: #a9bbb0;
  font-family: var(--mono);
  font-size: 0.65rem;
  text-transform: uppercase;
}

.manifesto,
.evidence-section,
.flash-section,
.open-section,
.cycle-section {
  padding: clamp(4rem, 8vw, 8rem) max(4vw, calc((100vw - 82rem) / 2));
}

.manifesto {
  background: var(--cream);
  color: var(--ink);
}

.manifesto .section-kicker,
.evidence-section .section-kicker {
  color: var(--moss);
}

.manifesto-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: 3rem;
  border: 1px solid var(--line-light);
  background: var(--line-light);
}

.manifesto-grid article {
  min-height: 18rem;
  padding: clamp(1.5rem, 3vw, 2.5rem);
  background: var(--cream);
}

.card-number {
  display: block;
  margin-bottom: 4.5rem;
  color: var(--moss);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 800;
}

.manifesto-grid p,
.cycle-section p,
.open-section > p {
  color: var(--muted-light);
}

.caveat {
  margin-top: 2rem;
  border-left: 4px solid var(--orange);
  padding: 1.2rem 1.4rem;
  background: rgba(255, 122, 61, 0.1);
}

.cycle-section {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: clamp(3rem, 7vw, 7rem);
  background: var(--paper);
  color: var(--ink);
}

.cycle-section .section-kicker {
  color: #9d4b24;
}

.cycle {
  display: grid;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line-light);
  list-style: none;
}

.cycle li {
  display: grid;
  grid-template-columns: 4rem 7rem 1fr;
  align-items: center;
  gap: 1rem;
  border-bottom: 1px solid var(--line-light);
  padding: 1.15rem 0;
}

.cycle span,
.cycle strong,
.cycle small {
  font-family: var(--mono);
}

.cycle span {
  color: #9d4b24;
  font-size: 0.75rem;
  font-weight: 900;
}

.cycle strong {
  font-size: 0.76rem;
  letter-spacing: 0.08em;
}

.cycle small {
  color: var(--muted-light);
}

.evidence-section {
  background: #d9ddcb;
  color: var(--ink);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
}

.text-link {
  margin-bottom: 1.6rem;
  color: var(--moss);
  font-family: var(--mono);
  font-size: 0.76rem;
  font-weight: 900;
  text-decoration: none;
}

.evidence-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 2.2rem;
}

.evidence-card {
  min-width: 0;
  border: 1px solid rgba(18, 32, 25, 0.14);
  padding: clamp(1.4rem, 3vw, 2rem);
  background: rgba(242, 238, 223, 0.48);
}

.evidence-card.shipped { border-top: 5px solid var(--moss); }
.evidence-card.prototype { border-top: 5px solid #168e84; }
.evidence-card.planned { border-top: 5px solid #c45d2d; }

.evidence-state {
  margin-bottom: 2.8rem;
  color: var(--muted-light);
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.command {
  display: block;
  overflow: hidden;
  margin-top: 1.3rem;
  border-radius: 0.2rem;
  padding: 0.65rem 0.75rem;
  background: var(--forest-950);
  color: var(--frog-bright);
  font-family: var(--mono);
  font-size: 0.69rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rule-table-wrap {
  overflow-x: auto;
  margin-top: 3rem;
  border: 1px solid var(--line-light);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(242, 238, 223, 0.5);
}

caption {
  padding: 1.1rem;
  color: var(--moss);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 900;
  text-align: left;
  text-transform: uppercase;
}

th,
td {
  border-top: 1px solid var(--line-light);
  padding: 0.9rem 1.1rem;
  text-align: left;
}

th {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

td {
  font-size: 0.88rem;
}

.flash-section {
  background:
    radial-gradient(circle at 10% 10%, rgba(96, 231, 218, 0.08), transparent 24rem),
    var(--forest-900);
}

.flash-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 0.6fr);
  gap: 1rem 4rem;
  align-items: end;
}

.flash-intro h2 {
  grid-row: span 2;
}

.flash-intro > p:not(.section-kicker) {
  color: var(--muted-dark);
}

.capability-pill {
  width: fit-content;
  border: 1px solid var(--line-dark);
  border-radius: 999px;
  padding: 0.6rem 0.85rem;
  color: var(--muted-dark);
  font-family: var(--mono);
  font-size: 0.67rem;
}

[data-tone="good"] { color: var(--frog-bright) !important; }
[data-tone="warning"] { color: #ffb07b !important; }
[data-tone="bad"] { color: #ff8d87 !important; }
[data-tone="working"] { color: var(--cyan) !important; }

.connection-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 3rem;
}

.connection-card {
  border: 1px solid var(--line-dark);
  padding: clamp(1.4rem, 3vw, 2rem);
  background: rgba(255, 255, 255, 0.025);
}

.connection-card-danger {
  border-color: rgba(255, 122, 61, 0.35);
}

.connection-card > p {
  max-width: 58ch;
  color: var(--muted-dark);
}

.connection-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.step-tag,
.experimental-label {
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.experimental-label {
  color: #ffb07b;
}

.device-status,
.field-help {
  min-height: 2.7rem;
  margin: 1rem 0 0;
  color: var(--muted-dark);
  font-family: var(--mono);
  font-size: 0.7rem;
}

.device-facts,
.artifact-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 1.4rem 0 0;
  background: var(--line-dark);
}

.device-facts div,
.artifact-facts div {
  min-width: 0;
  padding: 0.8rem;
  background: #0b1912;
}

dt {
  color: #72877a;
  font-family: var(--mono);
  font-size: 0.59rem;
  font-weight: 800;
  text-transform: uppercase;
}

dd {
  overflow: hidden;
  margin: 0.25rem 0 0;
  color: var(--cream);
  font-family: var(--mono);
  font-size: 0.68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#firmware-hash,
#firmware-revision {
  overflow: visible;
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
}

.flash-console {
  margin-top: 1rem;
  border: 1px solid rgba(96, 231, 218, 0.28);
  padding: clamp(1.2rem, 3vw, 2.2rem);
  background: #050c08;
  box-shadow: var(--shadow);
}

.console-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 2rem;
  border-bottom: 1px solid var(--line-dark);
  padding-bottom: 1.4rem;
}

.console-header h3 {
  margin: 0;
}

.terminal-label {
  margin-bottom: 0.35rem;
  color: var(--cyan);
}

.artifact-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1.2rem;
  padding: 1.5rem 0;
}

.field-group label,
.safety-gate legend {
  display: block;
  margin-bottom: 0.55rem;
  color: var(--cream);
  font-family: var(--mono);
  font-size: 0.69rem;
  font-weight: 800;
  text-transform: uppercase;
}

select,
input[type="text"],
input[type="file"] {
  width: 100%;
  min-height: 3rem;
  border: 1px solid #314b3b;
  border-radius: 0.2rem;
  padding: 0.65rem;
  background: #0f1d15;
  color: var(--cream);
  font-family: var(--mono);
  font-size: 0.7rem;
}

.revision-gate {
  margin-top: 1.5rem;
  border-bottom: 1px solid var(--line-dark);
  padding-bottom: 1.5rem;
}

.divider-label {
  color: #607267;
  font-family: var(--mono);
  font-size: 0.65rem;
}

.artifact-facts {
  grid-template-columns: 0.8fr 0.8fr 1fr 2fr;
  margin: 0 0 1.5rem;
}

.artifact-facts dd {
  color: var(--cyan);
}

.safety-gate {
  display: grid;
  gap: 0.8rem;
  margin: 0;
  border: 1px solid rgba(255, 79, 69, 0.32);
  padding: 1.25rem;
  background: rgba(255, 79, 69, 0.04);
}

.safety-gate legend {
  padding: 0 0.5rem;
  color: #ff8d87;
}

.safety-gate label {
  display: grid;
  grid-template-columns: 1.1rem 1fr;
  align-items: start;
  gap: 0.7rem;
  color: #c7d1ca;
  font-size: 0.84rem;
}

.safety-gate input {
  width: 1rem;
  height: 1rem;
  margin-top: 0.2rem;
  accent-color: var(--red);
}

.flash-action-row {
  margin-top: 1.5rem;
}

.progress-wrap {
  display: grid;
  flex: 1;
  min-width: 15rem;
  gap: 0.4rem;
}

.progress-wrap label {
  color: var(--muted-dark);
  font-family: var(--mono);
  font-size: 0.66rem;
}

progress {
  width: 100%;
  height: 0.65rem;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  background: #1d2a23;
}

progress::-webkit-progress-bar { background: #1d2a23; }
progress::-webkit-progress-value { background: var(--frog); }
progress::-moz-progress-bar { background: var(--frog); }

.flash-log {
  max-height: 15rem;
  overflow: auto;
  margin: 1.5rem 0 0;
  padding: 1rem 1rem 1rem 2.4rem;
  border: 1px solid #203228;
  background: #020503;
  color: #9fb3a5;
  font-family: var(--mono);
  font-size: 0.68rem;
}

.flash-log li {
  margin-bottom: 0.35rem;
}

.flash-log [data-tone="success"] { color: var(--frog-bright); }
.flash-log [data-tone="warning"] { color: #ffb07b; }
.flash-log [data-tone="error"] { color: #ff8d87; }

.recovery-note {
  margin-top: 1.4rem;
  border-left: 3px solid var(--cyan);
  padding: 0.9rem 1rem;
  background: rgba(96, 231, 218, 0.06);
  color: #abc0b2;
  font-size: 0.78rem;
}

.recovery-note a {
  color: var(--cyan);
}

.open-section {
  background: var(--frog);
  color: var(--ink);
}

.open-section .section-kicker {
  color: var(--forest-700);
}

.open-section > p {
  max-width: 66ch;
  color: #294232;
  font-size: 1.05rem;
}

.open-links {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  margin-top: 2.5rem;
  border: 1px solid rgba(18, 32, 25, 0.32);
  background: rgba(18, 32, 25, 0.32);
}

.open-links a {
  display: flex;
  justify-content: space-between;
  padding: 1.2rem;
  background: var(--frog);
  font-family: var(--mono);
  font-size: 0.76rem;
  font-weight: 900;
  text-decoration: none;
}

.open-links a:hover {
  background: var(--frog-bright);
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  padding: 2rem 4vw;
  border-top: 1px solid var(--line-dark);
  background: var(--forest-950);
  color: #6e8275;
  font-family: var(--mono);
  font-size: 0.66rem;
}

footer p {
  margin: 0;
}

@media (max-width: 960px) {
  .hero {
    grid-template-columns: 1fr;
    padding-top: 5rem;
  }

  .badge-stage {
    width: min(100%, 42rem);
    justify-self: center;
  }

  .manifesto-grid,
  .evidence-grid {
    grid-template-columns: 1fr;
  }

  .manifesto-grid article {
    min-height: auto;
  }

  .card-number {
    margin-bottom: 2rem;
  }

  .cycle-section,
  .flash-intro {
    grid-template-columns: 1fr;
  }

  .flash-intro h2 {
    grid-row: auto;
  }

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

@media (max-width: 680px) {
  .site-header {
    position: relative;
    align-items: flex-start;
    flex-direction: column;
    gap: 0.8rem;
    padding-block: 1rem;
  }

  nav {
    gap: 0.8rem 1rem;
  }

  .hero {
    min-height: auto;
    grid-template-columns: minmax(0, 1fr);
    padding-top: 4rem;
  }

  h1 {
    font-size: clamp(3.2rem, 17vw, 5.6rem);
  }

  .badge-shell {
    padding: 1rem;
    transform: none;
  }

  .led-matrix {
    padding: 0.5rem;
    gap: 1px;
  }

  .section-heading,
  .console-header,
  footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .cycle li {
    grid-template-columns: 3.5rem 6rem 1fr;
    gap: 0.5rem;
  }

  .device-facts,
  .artifact-facts {
    grid-template-columns: 1fr;
  }

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

  .divider-label {
    text-align: center;
  }

  .flash-action-row,
  .flash-action-row .button {
    width: 100%;
  }

  .open-links {
    grid-template-columns: 1fr;
  }
}

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

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
