:root {
  --ink: #071018;
  --panel: rgba(12, 24, 36, 0.72);
  --line: rgba(255, 196, 92, 0.18);
  --text: #eef3f7;
  --muted: #8fa3b5;
  --amber: #ffc45c;
  --teal: #3ecfbf;
  --rose: #ff6b7a;
  --ok: #5dde9a;
  --glow: rgba(255, 196, 92, 0.35);
  --sans: "Syne", "Avenir Next", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  color: var(--text);
  font-family: var(--sans);
  background: var(--ink);
  overflow-x: hidden;
}

.atmosphere {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 90% 60% at 15% -10%, rgba(62, 207, 191, 0.16), transparent 55%),
    radial-gradient(ellipse 70% 50% at 95% 10%, rgba(255, 196, 92, 0.12), transparent 50%),
    linear-gradient(180deg, #0a1622 0%, var(--ink) 55%, #050b11 100%);
  z-index: 0;
}

.ring {
  position: absolute;
  left: 58%;
  top: 8%;
  width: 42rem;
  height: 42rem;
  border: 1px solid rgba(255, 196, 92, 0.08);
  border-radius: 50%;
  transform: translate(-30%, -20%);
  animation: pulse-ring 8s ease-in-out infinite;
}

.r2 { width: 56rem; height: 56rem; animation-delay: -2.5s; opacity: 0.7; }
.r3 { width: 72rem; height: 72rem; animation-delay: -5s; opacity: 0.45; }

@keyframes pulse-ring {
  0%, 100% { transform: translate(-30%, -20%) scale(1); opacity: 0.55; }
  50% { transform: translate(-30%, -20%) scale(1.04); opacity: 1; }
}

main {
  position: relative;
  z-index: 1;
  max-width: 44rem;
  margin: 0 auto;
  padding: 3.5rem 1.25rem 5rem;
}

.hero {
  margin-bottom: 2rem;
  animation: rise 0.7s ease both;
}

.eyebrow {
  margin: 0 0 0.6rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--teal);
}

.hero h1 {
  margin: 0;
  font-size: clamp(3.2rem, 10vw, 5rem);
  font-weight: 800;
  letter-spacing: -0.06em;
  line-height: 0.92;
  background: linear-gradient(120deg, #fff 30%, var(--amber) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lede {
  margin: 1rem 0 1.25rem;
  max-width: 28rem;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.5;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.25);
}

.status::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 0 currentColor;
}

.status[data-state="live"] {
  color: var(--ok);
  border-color: rgba(93, 222, 154, 0.35);
}

.status[data-state="live"]::before {
  animation: blink 1.4s ease infinite;
}

.status[data-state="error"] { color: var(--rose); }

@keyframes blink {
  0%, 100% { box-shadow: 0 0 0 0 rgba(93, 222, 154, 0.5); }
  50% { box-shadow: 0 0 0 0.45rem rgba(93, 222, 154, 0); }
}

.deck, .compose {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem 1rem;
  padding: 1.15rem;
  margin-bottom: 1rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 1rem;
  backdrop-filter: blur(14px);
  animation: rise 0.8s ease both;
  animation-delay: 0.08s;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.field.span, .toggle.span, .actions.span { grid-column: 1 / -1; }

.field label {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.soft { opacity: 0.6; text-transform: none; letter-spacing: 0; }

input, select, button {
  font: inherit;
}

input, select {
  width: 100%;
  color: var(--text);
  background: rgba(4, 10, 16, 0.75);
  border: 1px solid rgba(143, 163, 181, 0.22);
  border-radius: 0.55rem;
  padding: 0.7rem 0.8rem;
  font-family: var(--mono);
  font-size: 0.92rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="checkbox"] {
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
  accent-color: var(--teal);
  border: none;
  background: transparent;
  box-shadow: none;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--amber);
  box-shadow: 0 0 0 3px var(--glow);
}

input[type="checkbox"]:focus {
  box-shadow: 0 0 0 3px rgba(62, 207, 191, 0.35);
}

.toggle {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.65rem;
  width: max-content;
  max-width: 100%;
  color: var(--muted);
  font-size: 0.95rem;
  cursor: pointer;
}

.actions {
  display: flex;
  gap: 0.65rem;
  margin-top: 0.25rem;
}

button {
  flex: 1;
  border: 0;
  border-radius: 0.65rem;
  padding: 0.8rem 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
  background: linear-gradient(135deg, var(--amber), #ff9a3c);
  color: #1a1000;
  transition: transform 0.15s ease, filter 0.15s ease, opacity 0.15s;
}

button:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.05); }
button:active:not(:disabled) { transform: translateY(0); }
button:disabled { opacity: 0.35; cursor: not-allowed; transform: none; }

button.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(143, 163, 181, 0.3);
}

.compose {
  grid-template-columns: 8.5rem 1fr auto;
  animation-delay: 0.12s;
}

.compose button { flex: 0 0 auto; min-width: 5.5rem; }

.terminal {
  border: 1px solid var(--line);
  border-radius: 1rem;
  overflow: hidden;
  background: rgba(4, 10, 16, 0.82);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  animation: rise 0.9s ease both;
  animation-delay: 0.16s;
}

.terminal-bar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0.9rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 196, 92, 0.04);
}

.hint {
  color: var(--teal);
  letter-spacing: 0.02em;
  text-transform: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.log {
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.55;
  min-height: 16rem;
  max-height: 52vh;
  overflow: auto;
  padding: 0.85rem 0.95rem 1.1rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.log:empty::before {
  content: "Waiting for a link…";
  color: rgba(143, 163, 181, 0.45);
}

.log > div {
  animation: line-in 0.28s ease both;
}

.log .ok { color: var(--ok); }
.log .fail, .log .error { color: var(--rose); }
.log .in { color: var(--amber); }
.log .sent { color: var(--teal); }
.log .info, .log .mon, .log .repeat { color: var(--muted); }

.hidden { display: none !important; }

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

@keyframes line-in {
  from { opacity: 0; transform: translateX(-4px); }
  to { opacity: 1; transform: translateX(0); }
}

.downloads {
  margin-top: 1.75rem;
  padding: 1.2rem 1.15rem 1.35rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: rgba(12, 24, 36, 0.55);
  animation: rise 1s ease both;
  animation-delay: 0.2s;
}

.downloads h2 {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
}

.dl-lede {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.dl-lede code {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--amber);
}

.dl-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 12rem;
  padding: 0.75rem 1.1rem;
  border-radius: 0.65rem;
  background: linear-gradient(135deg, var(--teal), #2aa89c);
  color: #041512;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.15s ease, filter 0.15s;
}

.dl-primary:hover { transform: translateY(-1px); filter: brightness(1.05); }

.dl-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.1rem;
  margin-top: 0.85rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
}

.dl-meta a {
  color: var(--amber);
  text-decoration: none;
}

.dl-meta a:hover { text-decoration: underline; }

@media (max-width: 640px) {
  main { padding-top: 2rem; }
  .deck, .compose { grid-template-columns: 1fr; }
  .compose { grid-template-columns: 1fr; }
  .ring { left: 80%; opacity: 0.5; }
}
