/* DS1 Orbital — mobile first. Gabriel opens this on a phone between jobs. */

:root {
  --bg: #0f1115;
  --surface: #171a21;
  --surface-2: #1e222b;
  --line: #2a2f3a;
  --text: #e6e8ec;
  --muted: #9aa3b2;
  --accent: #f0a03c;
  --ok: #4ec98a;
  --warn: #e8c05a;
  --bad: #e8705a;
  --radius: 12px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f7f9; --surface: #ffffff; --surface-2: #f0f2f5;
    --line: #dfe3e9; --text: #14171c; --muted: #5d6675;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-text-size-adjust: 100%;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- layout -- */
header {
  position: sticky; top: 0; z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: env(safe-area-inset-top) 0 0;
}
.bar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; max-width: 900px; margin: 0 auto;
}
.brand { font-weight: 650; letter-spacing: -0.01em; }
.brand span { color: var(--accent); }
.bar form { margin-left: auto; }

nav {
  display: flex; gap: 4px; overflow-x: auto;
  padding: 0 12px 10px; max-width: 900px; margin: 0 auto;
  scrollbar-width: none;
}
nav::-webkit-scrollbar { display: none; }
nav a {
  padding: 7px 13px; border-radius: 999px; white-space: nowrap;
  color: var(--muted); font-size: 14.5px; font-weight: 500;
}
nav a.on { background: var(--surface-2); color: var(--text); }

main { max-width: 900px; margin: 0 auto; padding: 18px 16px 96px; }

h1 { font-size: 22px; margin: 4px 0 16px; letter-spacing: -0.02em; }
h2 { font-size: 17px; margin: 26px 0 10px; letter-spacing: -0.01em; }

/* ----------------------------------------------------------------- cards -- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 15px; margin-bottom: 12px;
}
.card h3 { margin: 0 0 6px; font-size: 16px; font-weight: 600; }
.meta { color: var(--muted); font-size: 13.5px; }
.empty {
  text-align: center; color: var(--muted);
  padding: 36px 20px; border: 1px dashed var(--line); border-radius: var(--radius);
}

.pill {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.02em;
  background: var(--surface-2); color: var(--muted);
}
.pill.ok { color: var(--ok); }
.pill.warn { color: var(--warn); }
.pill.bad { color: var(--bad); }

/* --------------------------------------------------------------- buttons -- */
button, .btn {
  font: inherit; font-weight: 600; cursor: pointer;
  padding: 11px 17px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text);
  min-height: 44px;                     /* thumb-sized */
}
button:active, .btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #1a1206; }
.btn-ok { color: var(--ok); }
.btn-bad { color: var(--bad); }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.btn-row form { display: contents; }

input[type=text], input[type=password], textarea, select {
  font: inherit; width: 100%; padding: 12px;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px;
  margin: 6px 0 4px;
}
textarea { min-height: 88px; resize: vertical; }
label { font-size: 14px; color: var(--muted); font-weight: 500; }

/* ----------------------------------------------------------------- flash -- */
.flash {
  padding: 12px 14px; border-radius: 10px; margin-bottom: 14px;
  border: 1px solid var(--line); background: var(--surface);
}
.flash.error { border-color: var(--bad); color: var(--bad); }
.flash.ok { border-color: var(--ok); color: var(--ok); }

/* ------------------------------------------------------------- recording -- */
.rec-wrap { text-align: center; padding: 22px 0 8px; }
#recBtn {
  width: 128px; height: 128px; border-radius: 50%;
  border: 3px solid var(--accent); background: var(--surface);
  color: var(--accent); font-size: 15px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
#recBtn.recording {
  background: var(--bad); border-color: var(--bad); color: #fff;
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232,112,90,.45); }
  50% { box-shadow: 0 0 0 18px rgba(232,112,90,0); }
}
#timer {
  font-variant-numeric: tabular-nums; font-size: 30px;
  margin-top: 14px; letter-spacing: -0.02em;
}
#hint { color: var(--muted); font-size: 14px; margin-top: 6px; }

pre.log {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px; overflow-x: auto;
  font-size: 13px; white-space: pre-wrap; word-break: break-word;
}

/* -------------------------------------------------------------- markdown -- */
.md { line-height: 1.62; overflow-wrap: anywhere; }
.md h1 { font-size: 21px; }
.md h2 { font-size: 18px; border-bottom: 1px solid var(--line); padding-bottom: 5px; }
.md h3 { font-size: 16px; margin-top: 22px; }
.md code {
  background: var(--surface-2); padding: 1px 5px;
  border-radius: 5px; font-size: 13.5px;
}
.md pre { background: var(--surface-2); padding: 12px; border-radius: 10px; overflow-x: auto; }
.md blockquote {
  margin: 12px 0; padding: 8px 14px;
  border-left: 3px solid var(--accent); color: var(--muted);
}
.md table { border-collapse: collapse; width: 100%; font-size: 14px; display: block; overflow-x: auto; }
.md th, .md td { border: 1px solid var(--line); padding: 7px 9px; text-align: left; }
.md details { margin: 12px 0; }
.md summary { cursor: pointer; color: var(--muted); }

.sticky-actions {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: var(--surface); border-top: 1px solid var(--line);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  display: flex; gap: 8px; justify-content: center;
}

@media (min-width: 640px) {
  h1 { font-size: 26px; }
  main { padding-top: 26px; }
}
