/* ScoreForge - dark, quiet, glass over a slow ambient backdrop.
   No web fonts, no external requests: everything here is local. */

:root {
  /* surfaces */
  --bg: #07090e;
  --glass: rgba(18, 21, 30, 0.55);
  --glass-strong: rgba(20, 23, 33, 0.78);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);

  /* ink */
  --text: #eceef5;
  --muted: #9aa1b4;
  --faint: #6f7688;

  /* accent - warm amber reads as "music paper", not another blue app */
  --accent: #f2c45c;
  --accent-ink: #241a05;
  --accent-soft: rgba(242, 196, 92, 0.14);
  --ok: #74d3ac;
  --warn: #f2887f;
  --info: #8fb3f8;

  --radius-lg: 22px;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --blur: blur(22px) saturate(115%);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
        Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

code {
  font-family: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, monospace;
  font-size: 0.9em;
  color: var(--muted);
}

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ------------------------------------------------------------------ */
/* backdrop: a very slow, heavily blurred video behind everything       */
/* ------------------------------------------------------------------ */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background:
    radial-gradient(1200px 700px at 20% 15%, #1b2233 0%, transparent 60%),
    radial-gradient(900px 600px at 85% 80%, #241d2c 0%, transparent 65%),
    var(--bg);
}

.backdrop-video {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 120vw;
  height: 120vh;
  transform: translate(-50%, -50%);
  object-fit: cover;
  /* The file is already soft; this keeps it out of the way on top of it. */
  filter: blur(46px) saturate(135%) brightness(1.05);
  opacity: 0.95;
  will-change: transform;
}

/* Scrim + fine grain: keeps text contrast high without a flat black sheet. */
.backdrop-veil {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(130% 80% at 50% 8%, rgba(7, 9, 14, 0) 25%, rgba(7, 9, 14, 0.45) 78%),
    linear-gradient(180deg, rgba(7, 9, 14, 0.18) 0%, rgba(7, 9, 14, 0.66) 62%, var(--bg) 100%);
}

.backdrop-veil::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'>\
<filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/></filter>\
<rect width='120' height='120' filter='url(%23n)'/></svg>");
}

/* ------------------------------------------------------------------ */
/* layout                                                             */
/* ------------------------------------------------------------------ */
.shell {
  max-width: 880px;
  margin: 0 auto;
  padding: 26px 24px 56px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  padding: 10px 16px;
  background: var(--glass-strong);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 16px; }

.site-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-weight: 650;
  letter-spacing: -0.015em;
  font-size: 17px;
}

/* Four stems of a staff - used as the mark. */
.brand-mark {
  display: inline-flex;
  align-items: flex-end;
  gap: 3px;
  height: 20px;
  padding: 0 2px;
}
.brand-mark span {
  width: 3px;
  border-radius: 2px;
  background: var(--accent);
  opacity: 0.9;
}
.brand-mark span:nth-child(1) { height: 11px; }
.brand-mark span:nth-child(2) { height: 20px; }
.brand-mark span:nth-child(3) { height: 14px; }
.brand-mark span:nth-child(4) { height: 7px; opacity: 0.55; }

.tagline {
  color: var(--faint);
  font-size: 13px;
  letter-spacing: 0.01em;
  margin-left: auto;
  white-space: nowrap;
}

main { flex: 1; }

.site-footer {
  margin-top: 44px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 12.5px;
  max-width: 62ch;
}
.site-footer p { margin: 0; }

/* ------------------------------------------------------------------ */
/* hero + form                                                        */
/* ------------------------------------------------------------------ */
.hero { padding: 34px 0 6px; }

.hero h1 {
  margin: 0 0 14px;
  font-size: clamp(30px, 5.2vw, 46px);
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-weight: 680;
  background: linear-gradient(180deg, #ffffff 8%, #dfe4f2 92%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lead {
  margin: 0 0 30px;
  color: var(--muted);
  font-size: 16.5px;
  max-width: 54ch;
}

.submit-form { margin: 0 0 20px; }

.field {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 7px 7px 14px;
  background: var(--glass);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  box-shadow: var(--shadow);
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease);
}

.field:focus-within {
  border-color: rgba(242, 196, 92, 0.5);
  background: var(--glass-strong);
}

.field-icon {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  color: var(--faint);
  transition: color 0.2s var(--ease);
}
.field:focus-within .field-icon { color: var(--accent); }

.field input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 12px 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 15.5px;
}
.field input::placeholder { color: var(--faint); }
.field input:focus { outline: none; }

.field-hint {
  margin: 10px 4px 0;
  color: var(--faint);
  font-size: 12.5px;
}

button, .button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border: 0;
  border-radius: 15px;
  background: linear-gradient(180deg, #f7d27e, var(--accent));
  color: var(--accent-ink);
  font: inherit;
  font-size: 14.5px;
  font-weight: 640;
  letter-spacing: -0.01em;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.18s var(--ease), filter 0.18s var(--ease),
              box-shadow 0.18s var(--ease);
  box-shadow: 0 6px 18px rgba(242, 196, 92, 0.16);
}
button:hover, .button:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
  color: var(--accent-ink);
}
button:active, .button:active { transform: translateY(0); }

.btn-arrow { width: 17px; height: 17px; flex: 0 0 17px; }

.button.small {
  padding: 7px 12px;
  font-size: 13px;
  border-radius: 10px;
  font-weight: 600;
}

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 26px 0 0;
  padding: 0;
}
.facts li {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font-size: 12.5px;
}

/* ------------------------------------------------------------------ */
/* panels                                                             */
/* ------------------------------------------------------------------ */
.panel {
  position: relative;
  margin: 20px 0;
  padding: 22px 24px;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 620;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 0 rgba(116, 211, 172, 0.5);
  animation: pulse 2.8s var(--ease) infinite;
}

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(116, 211, 172, 0.45); }
  70%  { box-shadow: 0 0 0 7px rgba(116, 211, 172, 0); }
  100% { box-shadow: 0 0 0 0 rgba(116, 211, 172, 0); }
}

.queue-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.badge {
  padding: 3px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.badge.running { color: var(--accent); border-color: rgba(242, 196, 92, 0.28); }
.badge.done    { color: var(--ok);     border-color: rgba(116, 211, 172, 0.26); }
.badge.failed  { color: var(--warn);   border-color: rgba(242, 136, 127, 0.26); }

.current {
  margin: 0;
  font-size: 14.5px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  align-items: baseline;
}
.current strong { font-weight: 600; }

.queue-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.queue-list li {
  display: flex;
  gap: 12px;
  align-items: baseline;
  padding: 9px 0;
  border-top: 1px solid var(--line);
  font-size: 14.5px;
}
.queue-list li a { overflow-wrap: anywhere; }
.queue-list li .muted { margin-left: auto; white-space: nowrap; }

.muted { color: var(--muted); font-size: 13.5px; }
.empty { margin: 4px 0 0; }

/* ------------------------------------------------------------------ */
/* tables                                                             */
/* ------------------------------------------------------------------ */
.jobs {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.jobs th {
  text-align: left;
  padding: 0 10px 10px 0;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  border-bottom: 1px solid var(--line);
}
.jobs td {
  padding: 12px 10px 12px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.jobs tr:last-child td { border-bottom: 0; }
.cell-title { max-width: 34ch; }
.cell-title a {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cell-action { text-align: right; }
.nowrap { white-space: nowrap; }

.status {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 7px;
  font-size: 12px;
  letter-spacing: 0.01em;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  color: var(--muted);
}
.status.done    { color: var(--ok);     border-color: rgba(116, 211, 172, 0.26); }
.status.running { color: var(--accent); border-color: rgba(242, 196, 92, 0.28); }
.status.failed  { color: var(--warn);   border-color: rgba(242, 136, 127, 0.26); }
.status.queued  { color: var(--info);   border-color: rgba(143, 179, 248, 0.24); }
.status.expired { color: var(--faint); }

/* ------------------------------------------------------------------ */
/* job page                                                           */
/* ------------------------------------------------------------------ */
.job-head { padding: 30px 0 6px; }

.eyebrow {
  margin: 0 0 10px;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}

.job-head h1 {
  margin: 0 0 8px;
  font-size: clamp(26px, 4.4vw, 36px);
  line-height: 1.15;
  letter-spacing: -0.025em;
  font-weight: 660;
}

.source-url {
  margin: 0 0 14px;
  color: var(--faint);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.job-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.progress {
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #c9a044, var(--accent) 55%, #ffe7ae);
  box-shadow: 0 0 18px rgba(242, 196, 92, 0.4);
  transition: width 0.8s var(--ease);
}

.progress-value {
  margin: 12px 0 4px;
  font-size: 30px;
  font-weight: 620;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.progress-value span {
  font-size: 16px;
  color: var(--faint);
  margin-left: 2px;
  font-weight: 500;
}

.message { margin: 10px 0; font-size: 14.5px; }
.message > .button { margin-right: 10px; vertical-align: middle; }
.zip-size { font-size: 13px; }

.preview {
  display: block;
  width: 100%;
  margin-top: 22px;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: #fff;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

.alert {
  margin: 16px 0 0;
  padding: 12px 15px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: rgba(242, 196, 92, 0.08);
  border: 1px solid rgba(242, 196, 92, 0.22);
  color: #ebd4a1;
}
.alert.error {
  background: rgba(242, 136, 127, 0.08);
  border-color: rgba(242, 136, 127, 0.26);
  color: #f6bdb7;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ------------------------------------------------------------------ */
/* responsive                                                         */
/* ------------------------------------------------------------------ */
@media (max-width: 680px) {
  .shell { padding: 18px 16px 40px; }
  .tagline { display: none; }
  .field { flex-wrap: wrap; padding: 12px 12px 12px 14px; }
  .field input { flex-basis: 100%; padding: 6px 0 10px; }
  .field-icon { display: none; }
  .field button { width: 100%; justify-content: center; }
  .panel { padding: 18px 16px; }
  .jobs th:nth-child(3), .jobs td:nth-child(3),
  .jobs th:nth-child(4), .jobs td:nth-child(4) { display: none; }
  .cell-title { max-width: 18ch; }
  .hero { padding-top: 20px; }
}

/* ------------------------------------------------------------------ */
/* motion / contrast preferences                                      */
/* ------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  .backdrop-video { display: none; }
  .live-dot { animation: none; }
  * { transition-duration: 0.01ms !important; }
}

@media (prefers-contrast: more) {
  :root {
    --glass: rgba(12, 14, 20, 0.92);
    --glass-strong: rgba(12, 14, 20, 0.97);
    --line: rgba(255, 255, 255, 0.2);
    --muted: #c2c8d6;
    --faint: #a7aebd;
  }
  .backdrop-video { opacity: 0.25; }
}

/* Firefox historically ignored backdrop-filter; keep contrast if it does. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .panel, .field { background: rgba(15, 18, 26, 0.92); }
}
