:root {
  --bg: #f4ecd8;
  --panel: #efe6cf;
  --card: #f7f0dd;
  --stage: #efe5cd;
  --ink: #2a2520;
  --muted: #6b6153;
  --subtle: #9a9081;
  --line: rgba(42, 37, 32, .14);
  --line-strong: rgba(42, 37, 32, .26);
  --red: #8b2020;
  --red-d: #5f1e1e;
  --red-soft: rgba(139, 32, 32, .1);
  --up: #4a7d47;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  background-image: radial-gradient(rgba(42, 37, 32, .05) 1px, transparent 1px);
  background-size: 7px 7px;
}

.wrap {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 28px;
}

a {
  color: inherit;
  text-decoration: none;
}

.wm {
  font-family: var(--sans);
  font-weight: 800;
  letter-spacing: -.03em;
}

.wm .us {
  color: var(--red);
}

.tape {
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: #f0e7d0;
}

.tape .run {
  display: inline-flex;
  gap: 24px;
  white-space: nowrap;
  padding: 7px 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  animation: scroll 48s linear infinite;
}

.tape .run span b {
  color: var(--ink);
  font-weight: 500;
}

@keyframes scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(244, 236, 216, .9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 64px;
}

.brand {
  font-size: 24px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-left: 36px;
  margin-right: auto;
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: .04em;
  text-transform: lowercase;
}

.nav-links a {
  color: var(--muted);
  transition: .15s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--ink);
}

.btn {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 12.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  border-radius: 7px;
  padding: 11px 18px;
  transition: transform .1s, background .15s, color .15s;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn:active {
  transform: translateY(1px);
}

.btn-red {
  background: var(--red);
  color: #f7efdc;
}

.btn-red:hover {
  background: var(--red-d);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line-strong);
}

.btn-ghost:hover {
  background: rgba(42, 37, 32, .05);
}

.btn-lg {
  padding: 14px 22px;
  font-size: 13px;
}

.brk::before { content: "[ "; }
.brk::after { content: " ]"; }

.hero {
  padding: 64px 0 40px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 36px;
  align-items: center;
}

h1 {
  font-family: var(--sans);
  font-weight: 900;
  font-size: clamp(48px, 8vw, 96px);
  line-height: .92;
  letter-spacing: -.045em;
}

h1 .us {
  color: var(--red);
}

.feat {
  margin: 26px 0 30px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.feat div {
  font-size: 17px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 12px;
}

.feat div::before {
  content: "";
  width: 18px;
  height: 2px;
  background: var(--red);
  flex: 0 0 auto;
}

.hero-cta {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.soon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.soon .lbl {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .14em;
  color: var(--subtle);
  text-transform: uppercase;
}

.hero-right {
  position: relative;
}

.terminal {
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #f8f1de;
  box-shadow: 0 30px 60px -34px rgba(42, 37, 32, .5);
  overflow: hidden;
}

.term-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}

.term-top .wm {
  font-size: 14px;
}

.term-body {
  padding: 16px;
}

.tchart {
  height: 150px;
  position: relative;
}

.tstats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 11px;
}

.tstats div {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 10px;
}

.tstats .k { color: var(--subtle); }
.tstats .v {
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  margin-top: 3px;
}

section {
  padding: 52px 0;
}

.sec-head {
  max-width: 660px;
  margin: 0 auto 36px;
  text-align: center;
}

.sec-head .tag {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 12px;
}

.sec-head h2 {
  font-family: var(--sans);
  font-weight: 900;
  font-size: clamp(28px, 4.6vw, 44px);
  line-height: 1.02;
  letter-spacing: -.03em;
}

.sec-head p {
  color: var(--muted);
  margin-top: 12px;
  font-size: 16px;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  padding: 14px;
  overflow: hidden;
}

.panel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.crate-stage {
  background: var(--stage);
  border: 1px solid var(--line);
  border-radius: 12px;
  position: relative;
  min-height: 430px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 28px;
  background-image: radial-gradient(rgba(42, 37, 32, .06) 1px, transparent 1px);
  background-size: 8px 8px;
}

.crate {
  position: relative;
  width: 220px;
  height: 220px;
  z-index: 2;
}

.crate .box {
  position: absolute;
  inset: 0;
  border-radius: 8px;
  border: 2px solid var(--red);
  background: #f6eed9;
  overflow: hidden;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .4);
}

.crate .fill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0%;
  background: linear-gradient(180deg, #a83232, #8b2020);
  transition: height 1s cubic-bezier(.22, 1, .36, 1);
}

.crate .fill::after {
  content: "";
  position: absolute;
  top: -5px;
  left: 0;
  right: 0;
  height: 5px;
  background: rgba(139, 32, 32, .4);
}

.crate .grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(42, 37, 32, .06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(42, 37, 32, .06) 1px, transparent 1px);
  background-size: 22px 22px;
}

.crate .mark {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 3;
}

.crate .mark .wm {
  font-size: 26px;
  color: var(--ink);
}

.crate .mark .fill-on {
  color: #f7efdc;
}

.crate .rivet {
  position: absolute;
  width: 6px;
  height: 6px;
  background: var(--red);
  z-index: 3;
}

.crate .rivet.tl { top: 12px; left: 12px; }
.crate .rivet.tr { top: 12px; right: 12px; }
.crate .rivet.bl { bottom: 12px; left: 12px; }
.crate .rivet.br { bottom: 12px; right: 12px; }

.crate-read {
  position: relative;
  z-index: 3;
  text-align: center;
  margin-top: 26px;
}

.crate-read .big {
  font-family: var(--sans);
  font-weight: 900;
  font-size: 56px;
  line-height: 1;
  letter-spacing: -.03em;
}

.crate-read .cap {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
  font-family: var(--mono);
}

.tierbadge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  border: 1px solid var(--red);
  color: var(--red);
  font-weight: 600;
  font-size: 12px;
  padding: 7px 14px;
  border-radius: 7px;
  font-family: var(--mono);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.controls {
  padding: 28px 26px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.controls h3 {
  font-family: var(--sans);
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -.02em;
}

.controls .lede {
  color: var(--muted);
  font-size: 14px;
  margin-top: 10px;
  line-height: 1.55;
}

.eb {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 12px;
}

.eb::before {
  content: "";
  width: 14px;
  height: 2px;
  background: var(--red);
}

.hint {
  color: var(--subtle);
  font-size: 12px;
  margin-top: 8px;
  font-family: var(--mono);
}

.result {
  border: 1px solid var(--red);
  border-radius: 10px;
  padding: 22px;
  background: var(--red-soft);
}

.result-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(139, 32, 32, .24);
}

.result-k {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.result-alloc {
  font-family: var(--sans);
  font-weight: 900;
  font-size: 38px;
  line-height: 1.02;
  color: var(--red);
  letter-spacing: -.02em;
}

.result-sub {
  display: flex;
  gap: 14px;
  margin-top: 16px;
}

.result-sub > div {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.result-sub span {
  color: var(--muted);
  font-size: 11px;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.result-sub b {
  font-size: 17px;
  font-weight: 700;
}

.result-sub b.accent {
  color: var(--red);
}

.tiers {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
}

.tier {
  flex: 1 1 172px;
  max-width: 210px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 22px 16px;
  text-align: center;
  transition: transform .18s, border-color .18s;
}

.tier:hover {
  transform: translateY(-3px);
  border-color: var(--red);
}

.tier .ic {
  width: 44px;
  height: 44px;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
}

.tier .chip {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: block;
  box-shadow: inset 0 -5px 0 rgba(0, 0, 0, .16), 0 2px 7px rgba(42, 37, 32, .22);
}

.tier .tname {
  font-family: var(--sans);
  font-weight: 900;
  font-size: 18px;
  letter-spacing: -.01em;
}

.tier .trange {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
  font-family: var(--mono);
}

.tier .tsub {
  color: var(--subtle);
  font-size: 11.5px;
  margin-top: 8px;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.step {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 24px;
}

.step .n {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 13px;
  color: var(--red);
  letter-spacing: .1em;
}

.step h4 {
  font-size: 17px;
  margin: 10px 0 6px;
  font-weight: 800;
}

.step p {
  color: var(--muted);
  font-size: 14px;
}

.stats {
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  padding: 36px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  background: var(--card);
}

.stat .num {
  font-family: var(--sans);
  font-weight: 900;
  font-size: 30px;
  line-height: 1;
  letter-spacing: -.02em;
}

.stat .lab {
  color: var(--muted);
  font-size: 12.5px;
  margin-top: 8px;
  font-family: var(--mono);
}

.band {
  text-align: center;
  border: 1px solid var(--red);
  border-radius: 14px;
  padding: 50px 30px;
  background: var(--red-soft);
}

.band h2 {
  font-family: var(--sans);
  font-weight: 900;
  font-size: clamp(28px, 4.6vw, 44px);
  letter-spacing: -.03em;
}

.band p {
  color: var(--muted);
  max-width: 520px;
  margin: 12px auto 26px;
}

footer {
  border-top: 1px solid var(--line);
  margin-top: 60px;
  padding: 40px 0 56px;
}

.foot-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 30px;
  flex-wrap: wrap;
}

.foot-brand .wm {
  font-size: 22px;
}

.foot-links {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
}

.foot-col h5 {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--subtle);
  margin-bottom: 12px;
}

.foot-col a {
  display: block;
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 8px;
  transition: color .15s;
}

.foot-col a:hover {
  color: var(--ink);
}

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .7s, transform .7s;
}

.reveal.in {
  opacity: 1;
  transform: none;
}

.toggles {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: 11px 14px;
  cursor: pointer;
  transition: .15s;
  user-select: none;
}

.toggle[aria-pressed="true"] {
  border-color: var(--red);
  color: var(--red);
  background: var(--red-soft);
}

.toggle .tk {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: currentColor;
  opacity: .4;
}

.toggle[aria-pressed="true"] .tk {
  opacity: 1;
}

.counter {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: -6px;
}

.counter .g {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--up);
  box-shadow: 0 0 0 3px rgba(74, 125, 71, .2);
}

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-root.open {
  display: flex;
}

.modal-root .scrim {
  position: absolute;
  inset: 0;
  background: rgba(42, 37, 32, .42);
  backdrop-filter: blur(4px);
}

.modal-card {
  position: relative;
  width: min(420px, 100%);
  background: #f8f1de;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  box-shadow: 0 30px 70px -28px rgba(42, 37, 32, .55);
  overflow: hidden;
}

.modal-card .mh {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.modal-card .mh h1 {
  font-size: 20px;
  letter-spacing: -.02em;
  font-weight: 800;
  line-height: 1.2;
}

.modal-card .x {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 16px;
}

.modal-card .mb {
  padding: 22px 18px 24px;
}

.modal-card .mb p {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 18px;
}

.modal-card .wlist {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-card .wopt {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 10px;
  padding: 14px 14px;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink);
  transition: .15s;
}

.modal-card .wopt:hover {
  border-color: var(--red);
  background: var(--red-soft);
}

.modal-card .spin {
  display: none;
  margin-top: 16px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

.modal-card.busy .spin {
  display: block;
}

@media (max-width: 900px) {
  .nav-links { display: none; }
  .hero-grid { grid-template-columns: 1fr; }
  .panel-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .stats {
    grid-template-columns: repeat(2, 1fr);
    padding: 26px;
  }
}

@media (max-width: 520px) {
  .wrap { padding: 0 18px; }
  .crate {
    width: 186px;
    height: 186px;
  }
  .crate-stage {
    padding: 22px;
    min-height: 380px;
  }
  .crate-read .big { font-size: 48px; }
  .controls { padding: 24px 20px; }
  .result-alloc { font-size: 30px; }
}
