:root {
  --bg-outer: #3c373d;
  --bg-outer-edge: #2a262c;
  --panel: rgba(18, 18, 23, 0.9);
  --panel-deep: rgba(13, 13, 18, 0.94);
  --panel-soft: rgba(25, 25, 31, 0.78);
  --line: rgba(233, 229, 217, 0.1);
  --line-strong: rgba(233, 229, 217, 0.18);
  --text: #ece5d9;
  --muted: #a7a19a;
  --muted-dim: #78726d;
  --accent: #bfc8a8;
  --accent-soft: rgba(191, 200, 168, 0.24);
  --warning: #ccb07a;
  --shadow: rgba(0, 0, 0, 0.52);
  --shadow-deep: rgba(0, 0, 0, 0.74);
  --mono: "IBM Plex Mono", "JetBrains Mono", "Cascadia Mono", monospace;
  --sans: "IBM Plex Sans", "Segoe UI Variable Text", "Aptos", sans-serif;
}

* {
  box-sizing: border-box;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html {
  min-height: 100%;
  background:
    radial-gradient(circle at top center, rgba(255, 255, 255, 0.06), transparent 28%),
    radial-gradient(circle at bottom center, rgba(0, 0, 0, 0.22), transparent 48%),
    linear-gradient(180deg, var(--bg-outer) 0%, var(--bg-outer-edge) 100%);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--mono);
  background-image: url("/noise.svg");
  background-size: 260px 260px;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.08), transparent 24%),
    radial-gradient(circle at 20% 12%, rgba(255, 255, 255, 0.03), transparent 16%),
    radial-gradient(circle at 85% 88%, rgba(0, 0, 0, 0.22), transparent 20%);
  opacity: 0.85;
}

.page {
  width: min(1540px, calc(100vw - 72px));
  margin: 0 auto;
  padding: 54px 0 72px;
}

.terminal-frame {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 16%),
    linear-gradient(180deg, rgba(30, 30, 36, 0.94) 0%, rgba(17, 17, 22, 0.97) 100%);
  box-shadow:
    0 26px 90px var(--shadow),
    0 10px 26px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.terminal-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 20%, rgba(255, 255, 255, 0.04), transparent 26%),
    radial-gradient(circle at 78% 42%, rgba(255, 255, 255, 0.03), transparent 32%),
    linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.12));
  mix-blend-mode: screen;
}

.terminal-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: url("/noise.svg");
  background-size: 220px 220px;
  opacity: 0.16;
}

.terminal-frame-primary {
  min-height: 1220px;
}

.terminal-bar,
.frame-strip,
.terminal-footer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 78px;
  padding: 0 34px;
  border-bottom: 1px solid var(--line);
}

.frame-strip,
.terminal-footer {
  min-height: 84px;
}

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

.bar-cluster {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.bar-cluster-right {
  justify-content: flex-end;
}

.bar-badge,
.bar-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 30px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.02);
  color: var(--accent);
  font-size: 0.83rem;
  line-height: 1;
}

.bar-path,
.strip-copy,
.footer-copy {
  color: var(--text);
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.strip-copy,
.footer-copy {
  color: var(--muted);
  font-size: 0.88rem;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--warning);
  box-shadow: 0 0 12px rgba(204, 176, 122, 0.52);
}

.frame-section {
  position: relative;
  z-index: 1;
}

.frame-command {
  padding: 26px 34px 14px;
  border-bottom: 1px solid var(--line);
}

.prompt-line {
  margin: 0;
  color: var(--accent);
  font-size: 1rem;
  letter-spacing: 0.01em;
}

.prompt-inline {
  color: var(--text);
}

.frame-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(380px, 0.95fr);
  min-height: 610px;
}

.catalog-pane {
  padding: 18px 34px 38px;
}

.catalog-list,
.cart-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.015);
}

.catalog-item,
.cart-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 18px;
  padding: 18px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.catalog-item:first-child,
.cart-item:first-child {
  border-top: 0;
}

.catalog-index {
  color: var(--text);
  font-size: 0.98rem;
}

.catalog-copy h2,
.cart-item h2,
.card-title {
  margin: 0 0 6px;
  color: var(--text);
  font-size: 0.98rem;
  font-weight: 400;
}

.catalog-copy p,
.cart-item p,
.card-body p {
  margin: 0;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.94rem;
  line-height: 1.55;
}

.catalog-price {
  align-self: start;
  color: var(--warning);
  font-size: 0.98rem;
  white-space: nowrap;
}

.action-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
  margin-top: 24px;
}

.terminal-button {
  display: inline-flex;
  align-items: center;
  min-height: 58px;
  padding: 0 28px;
  border: 1px solid var(--line-strong);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 60%),
    rgba(255, 255, 255, 0.018);
  color: var(--accent);
  text-decoration: none;
  font-size: 0.98rem;
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.terminal-button:hover {
  border-color: rgba(191, 200, 168, 0.42);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.22);
  transform: translateY(-1px);
}

.terminal-button-secondary {
  color: var(--text);
}

.hero-stage {
  position: relative;
  border-left: 1px solid var(--line);
  background:
    radial-gradient(circle at 46% 28%, rgba(255, 255, 255, 0.06), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.012), transparent 28%),
    var(--panel-deep);
}

.stage-deck {
  position: absolute;
  left: 6%;
  right: -6%;
  bottom: 54px;
  height: 130px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(0, 0, 0, 0.18));
  transform: perspective(900px) rotateX(66deg) rotateZ(-17deg);
  transform-origin: bottom center;
  box-shadow:
    0 26px 48px rgba(0, 0, 0, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.stage-keyboard {
  position: absolute;
  right: -28px;
  bottom: 92px;
  width: 63%;
  height: 114px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 30%),
    linear-gradient(180deg, #24242b 0%, #121218 100%);
  transform: perspective(980px) rotateX(70deg) rotateZ(-13deg);
  transform-origin: bottom right;
  box-shadow:
    0 20px 34px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.stage-keyboard::before {
  content: "";
  position: absolute;
  inset: 12px 18px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 22px 16px;
  opacity: 0.16;
}

.hero-product {
  position: absolute;
  right: 9%;
  bottom: 12px;
  width: min(470px, 74%);
  max-height: 92%;
  object-fit: contain;
  filter: drop-shadow(0 24px 40px rgba(0, 0, 0, 0.62));
}

.frame-lower {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.9fr);
  min-height: 404px;
}

.copy-pane,
.tree-pane {
  padding: 28px 34px 34px;
}

.tree-pane {
  border-left: 1px solid var(--line);
}

.copy-mark {
  margin: 18px 0 10px;
  color: var(--text);
  font-size: 1.42rem;
  line-height: 1.4;
}

.copy-body {
  max-width: 46rem;
  margin: 0 0 12px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.7;
}

.copy-body-muted {
  color: var(--muted);
}

.tree-output {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.8;
  white-space: pre-wrap;
}

.card-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 34px;
  margin-top: 56px;
}

.terminal-frame-card {
  min-height: 676px;
}

.card-visual {
  position: relative;
  min-height: 392px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 50% 24%, rgba(255, 255, 255, 0.05), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.012), transparent 25%),
    var(--panel-deep);
}

.card-product {
  position: absolute;
  left: 50%;
  bottom: 14px;
  width: min(340px, 72%);
  transform: translateX(-50%);
  filter: drop-shadow(0 20px 32px rgba(0, 0, 0, 0.6));
}

.stage-keyboard-small {
  width: 70%;
  height: 98px;
  right: -34px;
  bottom: 66px;
}

.card-body,
.cart-body {
  position: relative;
  z-index: 1;
  padding: 28px 34px 34px;
}

.card-body p {
  max-width: 28rem;
  margin: 0 0 22px;
}

.cart-summary {
  margin: 0 0 24px;
  color: var(--text);
  font-size: 1rem;
}

.terminal-frame-cart .cart-body {
  padding-bottom: 20px;
}

.terminal-footer-card {
  min-height: 68px;
  padding: 0 28px;
}

@media (max-width: 1260px) {
  .page {
    width: min(100vw - 36px, 1540px);
    padding-top: 28px;
  }

  .frame-hero,
  .frame-lower,
  .card-grid {
    grid-template-columns: 1fr;
  }

  .hero-stage,
  .tree-pane {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .hero-stage {
    min-height: 460px;
  }

  .hero-product {
    right: 50%;
    bottom: 6px;
    transform: translateX(50%);
    width: min(430px, 72vw);
  }
}

@media (max-width: 760px) {
  .page {
    width: min(100vw - 18px, 1540px);
    padding-bottom: 28px;
  }

  .terminal-bar,
  .frame-strip,
  .terminal-footer {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    min-height: auto;
    padding: 18px;
  }

  .bar-cluster,
  .bar-cluster-right {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .frame-command,
  .catalog-pane,
  .copy-pane,
  .tree-pane,
  .card-body,
  .cart-body {
    padding-left: 18px;
    padding-right: 18px;
  }

  .catalog-item,
  .cart-item {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .catalog-index {
    color: var(--muted);
  }

  .action-stack {
    width: 100%;
  }

  .terminal-button {
    width: 100%;
    justify-content: center;
  }

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

  .stage-keyboard,
  .stage-keyboard-small,
  .stage-deck {
    display: none;
  }

  .hero-product {
    position: absolute;
    right: 50%;
    width: min(320px, 84vw);
  }

  .copy-mark {
    font-size: 1.16rem;
  }
}
