:root {
  color-scheme: dark;
  --bg: #000;
  --panel: #0b0b0b;
  --panel-2: #111;
  --border: #2b2b2b;
  --border-hot: #555;
  --text: #e7e7e7;
  --muted: #777;
  --blue: #5c9cf5;
  --amber: #e5c07b;
  --red: #e06c75;
  --green: #78b892;
  --mono: "SFMono-Regular", "Cascadia Code", "Roboto Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.55;
}
button, input { font: inherit; }
a { color: inherit; }
.hidden { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }

.shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  height: 58px;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 3;
  background: rgba(0, 0, 0, .92);
  backdrop-filter: blur(12px);
}
.wordmark { text-decoration: none; font-weight: 700; letter-spacing: -.02em; }
.mark {
  display: inline-grid;
  place-items: center;
  width: 23px;
  height: 23px;
  margin-right: 8px;
  border: 1px solid #fff;
  border-radius: 50%;
  font-size: 11px;
}
.runtime-badge { color: var(--muted); font-size: 11px; letter-spacing: .12em; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--amber); margin-right: 9px; box-shadow: 0 0 12px rgba(229, 192, 123, .5); }
.dot.ready { background: var(--green); box-shadow: 0 0 12px rgba(120, 184, 146, .55); }
.dot.failed { background: var(--red); box-shadow: 0 0 12px rgba(224, 108, 117, .55); }
nav { justify-self: end; display: flex; gap: 22px; }
nav a { color: var(--muted); text-decoration: none; font-size: 11px; letter-spacing: .1em; }
nav a:hover, nav a.active { color: var(--text); }

main { width: min(1040px, calc(100% - 48px)); margin: 0 auto; flex: 1; }
.intro { padding: 82px 0 60px; max-width: 760px; }
.eyebrow { color: var(--amber); font-size: 11px; letter-spacing: .14em; margin: 0 0 19px; }
h1 { font-size: clamp(36px, 6vw, 68px); line-height: 1.02; letter-spacing: -.065em; margin: 0 0 24px; font-weight: 580; }
.lede { color: #a0a0a0; font-size: 15px; max-width: 680px; margin: 0; }

.status-panel {
  border: 1px solid var(--border);
  background: var(--panel);
  margin: -24px 0 34px;
  padding: 14px 16px;
}
.status-panel.ready { border-color: rgba(120, 184, 146, .45); }
.status-panel.failed { border-color: rgba(224, 108, 117, .72); background: rgba(224, 108, 117, .06); }
.status-panel span { display: block; color: var(--green); font-size: 10px; letter-spacing: .13em; margin-bottom: 7px; }
.status-panel.failed span { color: var(--red); }
.status-panel p { color: var(--muted); margin: 0; font-size: 12px; }

.command-panel { display: grid; grid-template-columns: 62px 1fr; border-top: 1px solid var(--border); padding: 32px 0 46px; }
.line-number { color: #444; font-size: 11px; padding-top: 4px; }
.panel-body { min-width: 0; }
.prompt { margin: 0 0 7px; font-size: 15px; font-weight: 650; }
.prompt span { color: var(--blue); margin-right: 8px; }
.muted { color: var(--muted); margin: 0 0 25px; font-size: 12px; }
.panel-heading { display: flex; justify-content: space-between; gap: 24px; }
.revision { color: var(--amber); font-size: 10px; letter-spacing: .12em; white-space: nowrap; padding-top: 3px; }

.form-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: end; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
label { display: grid; gap: 8px; color: #8b8b8b; font-size: 10px; letter-spacing: .11em; }
label.wide { grid-column: 1 / -1; }
input {
  width: 100%;
  height: 43px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--panel);
  color: var(--text);
  padding: 0 13px;
  outline: none;
  letter-spacing: 0;
}
input::placeholder { color: #454545; }
input:focus { border-color: var(--border-hot); background: var(--panel-2); box-shadow: 0 0 0 1px #222; }
button {
  min-height: 43px;
  border: 1px solid #d8d8d8;
  border-radius: 3px;
  background: #e6e6e6;
  color: #050505;
  padding: 0 18px;
  cursor: pointer;
  text-decoration: none;
  display: inline-grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .07em;
}
button:hover { background: #fff; }
button:disabled { opacity: .45; cursor: wait; }
button.secondary { color: var(--text); background: transparent; border-color: var(--border-hot); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.divider { border-top: 1px solid #1c1c1c; margin: 30px 0 22px; position: relative; }
.divider span { position: relative; top: -9px; background: #000; color: #555; font-size: 9px; letter-spacing: .13em; padding-right: 12px; }
.form-status { min-height: 22px; color: var(--muted); margin: 14px 0 0; font-size: 12px; }
.form-status.error { color: var(--red); }
.form-status.ok { color: var(--green); }
.issued { margin-top: 20px; padding: 14px; border: 1px solid var(--amber); background: rgba(229,192,123,.05); }
.issued span { display: block; color: var(--amber); font-size: 9px; letter-spacing: .13em; margin-bottom: 8px; }
.issued code { word-break: break-all; color: #fff; }
#connect-command, #issued-connect-command {
  display: block;
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--blue);
  overflow-wrap: anywhere;
}

.terminal { border: 1px solid var(--border); background: var(--panel); margin: 2px 0 70px; }
.terminal header { height: 38px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 13px; color: #777; font-size: 9px; letter-spacing: .12em; }
.terminal header p { margin: 0; }
.log-lines { height: min(360px, 48vh); overflow: auto; padding: 12px 0; scrollbar-color: #333 transparent; }
.log-line { display: grid; grid-template-columns: 62px 76px 1fr; gap: 8px; padding: 3px 13px; font-size: 11px; }
.log-line:hover { background: #131313; }
.log-seq { color: #3f3f3f; }
.log-stream { color: var(--blue); }
.log-text { color: #aaa; white-space: pre-wrap; overflow-wrap: anywhere; }

footer { border-top: 1px solid var(--border); min-height: 50px; padding: 0 28px; display: flex; align-items: center; justify-content: space-between; color: #444; font-size: 9px; letter-spacing: .12em; }

@media (max-width: 700px) {
  .topbar { padding: 0 16px; grid-template-columns: 1fr auto; }
  .runtime-badge { display: none; }
  nav { gap: 13px; }
  main { width: min(100% - 28px, 1040px); }
  .intro { padding: 58px 0 42px; }
  .command-panel { grid-template-columns: 1fr; padding: 25px 0 38px; }
  .line-number { display: none; }
  .form-grid, .form-grid.two { grid-template-columns: 1fr; }
  label.wide { grid-column: auto; }
  .panel-heading { display: block; }
  .revision { display: inline-block; margin-bottom: 17px; }
  .actions > * { flex: 1 1 100%; }
  .log-line { grid-template-columns: 38px 54px 1fr; padding: 3px 8px; gap: 4px; }
  footer { padding: 14px; gap: 12px; flex-wrap: wrap; }
}

@media (prefers-reduced-motion: no-preference) {
  .dot { animation: breathe 2.2s ease-in-out infinite; }
  @keyframes breathe { 50% { opacity: .45; } }
}
