:root {
  --bg: #030102;
  --surface: rgba(7, 2, 4, 0.88);
  --red: #e60026;
  --red-hot: #ff1e42;
  --red-dim: rgba(230, 0, 38, 0.32);
  --red-faint: rgba(230, 0, 38, 0.12);
  --fg: #f0e6e8;
  --muted: #8a6c72;
  --dim: #4f3a3f;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --display: "Syne", ui-sans-serif, system-ui, sans-serif;
}

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

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

.scan-overlay {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0) 0px,
      rgba(0, 0, 0, 0) 2px,
      rgba(0, 0, 0, 0.28) 3px
    ),
    radial-gradient(ellipse at 50% 45%, transparent 30%, rgba(2, 0, 1, 0.88) 100%);
}

body.fx-off .scan-overlay,
body.fx-off .wordmark::after {
  display: none;
}

.stage {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.25rem;
}

.frame {
  width: 100%;
  max-width: 680px;
}

/* Top inline meta (no sticky bar) */
.head-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
}

.domain {
  color: var(--fg);
}

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

.dot {
  width: 7px;
  height: 7px;
  background: var(--muted);
  display: inline-block;
}

.dot.live {
  background: var(--red-hot);
  box-shadow: 0 0 8px var(--red);
}

/* Hero */
.hero {
  margin-bottom: 2.25rem;
}

.title-wrap {
  display: flex;
  align-items: baseline;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.wordmark {
  position: relative;
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2rem, 6.2vw, 3.25rem);
  line-height: 0.96;
  letter-spacing: -0.02em;
  color: var(--fg);
}

.wordmark::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  color: var(--red-hot);
  clip-path: inset(46% 0 42% 0);
  transform: translateX(3px);
  pointer-events: none;
  animation: tear 5.5s infinite steps(1);
}

.build-tag {
  font-size: 0.78rem;
  color: var(--red-hot);
  letter-spacing: 0.06em;
}

.tagline {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.65;
  max-width: 52ch;
}

/* Brutalist Drop Panel */
.drop-panel {
  background: var(--surface);
  border: 1px solid var(--red-dim);
  border-top: 2px solid var(--red);
  backdrop-filter: blur(4px);
}

.os-bar {
  display: flex;
  border-bottom: 1px solid var(--red-dim);
  overflow-x: auto;
}

.os-tab {
  flex: 1 0 auto;
  background: transparent;
  border: none;
  border-right: 1px solid rgba(230, 0, 38, 0.16);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  padding: 0.75rem 0.9rem;
  cursor: pointer;
  text-transform: uppercase;
  transition: background 0.1s linear, color 0.1s linear;
}

.os-tab:last-child {
  border-right: none;
}

.os-tab:hover {
  color: var(--fg);
  background: var(--red-faint);
}

.os-tab.active {
  background: var(--red);
  color: #030102;
  font-weight: 600;
}

.os-tab .os-mark {
  opacity: 0.7;
  margin-left: 0.25rem;
}

/* Spec rows */
.manifest-grid {
  margin: 0;
  padding: 1.25rem 1.35rem 1.15rem;
  display: grid;
  gap: 0.6rem;
}

.kv {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 0.75rem;
  align-items: baseline;
  font-size: 0.84rem;
}

.kv dt {
  color: var(--dim);
  letter-spacing: 0.1em;
  font-size: 0.74rem;
}

.kv dd {
  margin: 0;
  color: var(--fg);
  word-break: break-all;
}

.kv-hash dd {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.kv-hash code {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  font-size: 0.78rem;
}

/* Primary Download Button */
.action-row {
  padding: 0 1.35rem 1.15rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.dl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.85rem 1.35rem;
  background: var(--red);
  color: #030102;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
  letter-spacing: 0.12em;
  border: 1px solid var(--red);
  transition: background 0.1s linear, color 0.1s linear, border-color 0.1s linear;
}

.dl-btn:hover {
  background: var(--fg);
  border-color: var(--fg);
  color: #030102;
}

.dl-btn .arrow {
  font-size: 1.05rem;
  line-height: 1;
}

.state-note {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
}

.state-note.armed {
  color: var(--red-hot);
}

.feedback {
  padding: 0 1.35rem;
  font-size: 0.78rem;
  color: var(--red-hot);
  min-height: 0;
}

.feedback:not(:empty) {
  padding-bottom: 1rem;
}

/* Single-line CLI strip */
.cli-strip {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 1.35rem;
  border-top: 1px solid var(--red-dim);
  background: rgba(0, 0, 0, 0.52);
  font-size: 0.78rem;
}

.cli-prompt {
  color: var(--red-hot);
  user-select: none;
  flex-shrink: 0;
}

.cli-cmd {
  flex: 1;
  color: var(--muted);
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}

.cli-cmd::-webkit-scrollbar {
  display: none;
}

.text-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  cursor: pointer;
  flex-shrink: 0;
}

.text-btn:hover {
  color: var(--red-hot);
}

/* Raw Directory Index (only shown when files exist in /downloads/) */
.index-panel {
  margin-top: 1.5rem;
  background: var(--surface);
  border: 1px solid rgba(230, 0, 38, 0.24);
}

.index-head {
  padding: 0.6rem 1.35rem;
  border-bottom: 1px solid rgba(230, 0, 38, 0.2);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.index-list {
  display: flex;
  flex-direction: column;
}

.index-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 1rem;
  align-items: center;
  padding: 0.65rem 1.35rem;
  border-bottom: 1px solid rgba(230, 0, 38, 0.1);
  font-size: 0.8rem;
}

.index-row:last-child {
  border-bottom: none;
}

.index-row a {
  color: var(--fg);
  text-decoration: none;
  word-break: break-all;
}

.index-row a:hover {
  color: var(--red-hot);
  text-decoration: underline;
}

.index-size {
  color: var(--muted);
  font-size: 0.75rem;
}

.index-hash {
  color: var(--dim);
  font-size: 0.72rem;
}

/* Minimal Footer */
.foot {
  margin-top: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  color: var(--dim);
}

.foot-links {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
}

.foot-links a {
  color: var(--muted);
  text-decoration: none;
}

.foot-links a:hover {
  color: var(--red-hot);
}

@keyframes tear {
  0%, 91%, 100% {
    clip-path: inset(46% 0 42% 0);
    transform: translateX(0);
    opacity: 0;
  }
  92% {
    clip-path: inset(28% 0 58% 0);
    transform: translateX(4px);
    opacity: 0.9;
  }
  93% {
    clip-path: inset(64% 0 22% 0);
    transform: translateX(-5px);
    opacity: 0.85;
  }
  94% {
    clip-path: inset(42% 0 46% 0);
    transform: translateX(2px);
    opacity: 0.6;
  }
}

@media (max-width: 540px) {
  .stage {
    padding: 1.5rem 1rem;
    align-items: flex-start;
  }
  .kv {
    grid-template-columns: 74px minmax(0, 1fr);
  }
  .dl-btn {
    width: 100%;
  }
  .index-hash {
    display: none;
  }
}
