/* ── Exodus app portal ────────────────────────────────────────────────────────
   Aesthetic: machined instrument panel. Hairlines, amber signal, mono data.
   Read as studio equipment, not as a web app.
   ─────────────────────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=IBM+Plex+Mono:wght@300;400;500;600&display=swap');

:root {
  --void: #0a0a0b;
  --panel: #121215;
  --panel-lift: #17171b;
  --hairline: #26262c;
  --hairline-bright: #34343c;

  --ink: #e9e6e1;
  --ink-dim: #9b9791;
  --ink-faint: #635f5b;

  --signal: #e8a33d;
  --signal-dim: #7d5a22;
  --live: #4ade80;
  --alarm: #f87171;

  --serif: 'Instrument Serif', Georgia, serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --gutter: clamp(20px, 5vw, 56px);
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--void);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 300;
  line-height: 1.65;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}

/* Faint vertical light from above, as on a rack panel. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(120% 70% at 50% -10%, rgba(232, 163, 61, 0.06), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* Film grain — keeps the flat darks from banding. */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

main,
header,
footer {
  position: relative;
  z-index: 2;
}

/* ── Type ─────────────────────────────────────────────────────────────────── */

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.015em;
  margin: 0;
}

.wordmark {
  font-family: var(--serif);
  font-size: 19px;
  letter-spacing: 0.01em;
}

.wordmark em {
  font-style: italic;
  color: var(--signal);
}

.label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.dim {
  color: var(--ink-dim);
}

/* ── Chrome ───────────────────────────────────────────────────────────────── */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px var(--gutter);
  border-bottom: 1px solid var(--hairline);
}

.topbar nav {
  display: flex;
  align-items: center;
  gap: 22px;
}

.shell {
  max-width: 880px;
  margin: 0 auto;
  padding: clamp(40px, 8vh, 84px) var(--gutter) 96px;
}

.masthead {
  margin-bottom: 52px;
  animation: rise 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.masthead h1 {
  font-size: clamp(38px, 7vw, 58px);
  line-height: 1.02;
  margin: 14px 0 12px;
}

.masthead h1 em {
  font-style: italic;
  color: var(--signal);
}

.masthead p {
  color: var(--ink-dim);
  max-width: 46ch;
  margin: 0;
}

/* ── Channel strips (download cards) ──────────────────────────────────────── */

.rack {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--hairline);
  border: 1px solid var(--hairline);
  border-radius: 3px;
  overflow: hidden;
}

.strip {
  background: var(--panel);
  padding: 26px clamp(18px, 3vw, 30px);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 26px;
  align-items: center;
  transition: background 0.25s ease;
  animation: rise 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.strip:hover {
  background: var(--panel-lift);
}

.strip-id {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.strip-id h2 {
  font-size: 25px;
}

.strip-desc {
  color: var(--ink-dim);
  margin: 0 0 16px;
  max-width: 48ch;
  font-size: 13px;
}

.meta {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
}

.meta b {
  font-weight: 500;
  color: var(--ink-dim);
}

/* Size meter — a 278 MB download deserves a warning you can see. */
.meter {
  margin-top: 14px;
  height: 2px;
  background: var(--hairline-bright);
  border-radius: 2px;
  overflow: hidden;
  max-width: 240px;
}

.meter span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--signal-dim), var(--signal));
  transform-origin: left;
  animation: sweep 1.1s cubic-bezier(0.16, 1, 0.3, 1) both 0.3s;
}

.dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  display: inline-block;
  background: var(--live);
  box-shadow: 0 0 7px rgba(74, 222, 128, 0.6);
}

.dot.off {
  background: var(--ink-faint);
  box-shadow: none;
}

/* ── Controls ─────────────────────────────────────────────────────────────── */

.btn {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 13px 22px;
  border-radius: 2px;
  border: 1px solid var(--signal);
  background: transparent;
  color: var(--signal);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease, transform 0.12s ease;
}

.btn:hover {
  background: var(--signal);
  color: var(--void);
}

.btn:active {
  transform: translateY(1px);
}

.btn[disabled],
.btn.is-off {
  border-color: var(--hairline-bright);
  color: var(--ink-faint);
  cursor: not-allowed;
  pointer-events: none;
}

.btn.quiet {
  border-color: var(--hairline-bright);
  color: var(--ink-dim);
}

.btn.quiet:hover {
  background: var(--hairline);
  color: var(--ink);
}

.btn.danger {
  border-color: transparent;
  color: var(--ink-faint);
  padding: 6px 10px;
  letter-spacing: 0.06em;
}

.btn.danger:hover {
  background: transparent;
  color: var(--alarm);
}

.linkish {
  background: none;
  border: none;
  padding: 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-dim);
  cursor: pointer;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--hairline-bright);
  transition: color 0.2s ease, border-color 0.2s ease;
  text-decoration: none;
}

.linkish:hover {
  color: var(--signal);
  border-color: var(--signal);
}

input,
textarea {
  width: 100%;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 300;
  color: var(--ink);
  background: var(--void);
  border: 1px solid var(--hairline-bright);
  border-radius: 2px;
  padding: 13px 15px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--signal);
  box-shadow: 0 0 0 3px rgba(232, 163, 61, 0.12);
}

input::placeholder,
textarea::placeholder {
  color: var(--ink-faint);
}

.field {
  margin-bottom: 16px;
  text-align: left;
}

.field .label {
  display: block;
  margin-bottom: 7px;
}

/* ── Gatekeeper note ──────────────────────────────────────────────────────── */

.note {
  margin-top: 30px;
  border: 1px solid var(--hairline);
  border-left: 2px solid var(--signal-dim);
  border-radius: 3px;
  padding: 20px clamp(18px, 3vw, 26px);
  background: var(--panel);
  animation: rise 0.7s cubic-bezier(0.16, 1, 0.3, 1) both 0.35s;
}

.note h3 {
  font-size: 19px;
  margin-bottom: 6px;
}

.note p {
  color: var(--ink-dim);
  font-size: 13px;
  margin: 0 0 16px;
  max-width: 62ch;
}

.cmd {
  display: flex;
  align-items: stretch;
  gap: 0;
  border: 1px solid var(--hairline-bright);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 10px;
}

.cmd code {
  flex: 1;
  padding: 12px 14px;
  background: var(--void);
  font-size: 12px;
  color: var(--ink);
  overflow-x: auto;
  white-space: nowrap;
  line-height: 1.5;
}

.cmd button {
  flex: none;
  border: none;
  border-left: 1px solid var(--hairline-bright);
  background: var(--panel-lift);
  color: var(--ink-dim);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  padding: 0 16px;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}

.cmd button:hover {
  background: var(--signal);
  color: var(--void);
}

.cmd button.done {
  color: var(--live);
}

/* ── Login ────────────────────────────────────────────────────────────────── */

.gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px 24px;
}

.gate-inner {
  width: 100%;
  max-width: 360px;
  text-align: center;
  animation: rise 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.gate h1 {
  font-size: 44px;
  line-height: 1.05;
  margin: 20px 0 8px;
}

.gate h1 em {
  font-style: italic;
  color: var(--signal);
}

.gate > .gate-inner > p.sub {
  color: var(--ink-dim);
  font-size: 13px;
  margin: 0 0 34px;
}

.seal {
  width: 34px;
  height: 34px;
  margin: 0 auto;
  border: 1px solid var(--signal);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--signal);
  font-size: 15px;
  font-family: var(--serif);
  animation: pulse 3.4s ease-in-out infinite;
}

.msg {
  font-size: 12px;
  padding: 11px 14px;
  border-radius: 2px;
  margin-bottom: 16px;
  text-align: left;
  line-height: 1.5;
}

.msg.err {
  color: var(--alarm);
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.22);
}

.msg.ok {
  color: var(--live);
  background: rgba(74, 222, 128, 0.07);
  border: 1px solid rgba(74, 222, 128, 0.22);
}

.gate .btn {
  width: 100%;
  padding: 14px;
}

.switcher {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--hairline);
}

[hidden] {
  display: none !important;
}

/* ── Admin ────────────────────────────────────────────────────────────────── */

.block {
  border: 1px solid var(--hairline);
  border-radius: 3px;
  background: var(--panel);
  padding: 24px clamp(18px, 3vw, 28px);
  margin-bottom: 22px;
  animation: rise 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.block > h2 {
  font-size: 21px;
  margin-bottom: 4px;
}

.block > p.hint {
  color: var(--ink-dim);
  font-size: 12px;
  margin: 0 0 20px;
  max-width: 60ch;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid var(--hairline);
  font-size: 13px;
}

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

.row-main {
  min-width: 0;
}

.row-main strong {
  font-weight: 500;
}

.row-main span {
  display: block;
  color: var(--ink-faint);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.empty {
  color: var(--ink-faint);
  font-size: 12px;
  font-style: italic;
  padding: 10px 0;
}

.inline-form {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.inline-form input {
  flex: 1;
}

footer {
  padding: 26px var(--gutter) 40px;
  border-top: 1px solid var(--hairline);
  font-size: 11px;
  color: var(--ink-faint);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

/* ── Motion ───────────────────────────────────────────────────────────────── */

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes sweep {
  from {
    transform: scaleX(0);
  }
}

@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(232, 163, 61, 0.32);
  }
  50% {
    box-shadow: 0 0 0 9px rgba(232, 163, 61, 0);
  }
}

@media (max-width: 620px) {
  .strip {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .strip .btn {
    width: 100%;
    text-align: center;
  }

  .row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
