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

:root {
  --bg:      #0a0a0a;
  --surface: #111111;
  --border:  #222222;
  --accent:  #c8f135;
  --muted:   #555555;
  --text:    #f0f0f0;
  --mono:    'Space Mono', monospace;
  --sans:    'Syne', sans-serif;
}

html { scroll-behavior: smooth; }
body {
  background: var(--bg); color: var(--text); font-family: var(--sans);
  overflow-x: hidden; cursor: none;
}
::selection { background: var(--accent); color: var(--bg); }

/* grain overlay */
body::before {
  content: ''; position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
  pointer-events: none; z-index: 0; opacity: .35;
}

/* custom cursor */
.cursor {
  position: fixed; width: 10px; height: 10px;
  background: var(--accent); border-radius: 50%;
  pointer-events: none; z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width .15s, height .15s;
  mix-blend-mode: difference;
}
.cursor.grow { width: 32px; height: 32px; }

/* ── nav ── */
nav {
  position: fixed; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 2.5rem;
  border-bottom: 1px solid var(--border);
  background: rgba(10,10,10,.88); backdrop-filter: blur(14px);
  z-index: 100;
}
.nav-logo {
  font-family: var(--mono); font-size: .85rem; color: var(--accent);
  letter-spacing: .1em; text-decoration: none;
}
.nav-links { display: flex; gap: 2rem; }
.nav-links a {
  font-family: var(--mono); font-size: .75rem; color: var(--muted);
  text-decoration: none; letter-spacing: .08em; text-transform: uppercase;
  transition: color .2s;
}
.nav-links a:hover { color: var(--text); }

/* ── hero ── */
.hero {
  display: flex; flex-direction: column; justify-content: flex-end;
  min-height: 0; padding: 5rem 2.5rem 2.5rem;
  position: relative; overflow: hidden;
}
.hero-bg-ascii {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--mono); font-size: clamp(5px, .85vw, 10px);
  line-height: 1.25; color: var(--accent); opacity: .06;
  white-space: pre; pointer-events: none; user-select: none;
}
.hero-eyebrow {
  font-family: var(--mono); font-size: .7rem; color: var(--accent);
  letter-spacing: .2em; text-transform: uppercase; margin-bottom: 1rem;
  opacity: 0; animation: fadeup .6s .2s forwards;
}
.hero-title {
  font-family: var(--sans); font-size: clamp(2.75rem, 8vw, 6.5rem);
  font-weight: 800; line-height: .95; letter-spacing: -.03em;
  margin-bottom: 1rem; opacity: 0; animation: fadeup .7s .35s forwards;
}
.hero-title span { color: var(--accent); }
.hero-sub {
  font-family: var(--mono); font-size: clamp(.8rem, 1.3vw, .95rem);
  color: var(--muted); max-width: 460px; line-height: 1.8;
  margin-bottom: 0; opacity: 0; animation: fadeup .7s .5s forwards;
}

/* ── section label ── */
.section-label {
  font-family: var(--mono); font-size: .7rem; color: var(--accent);
  letter-spacing: .2em; text-transform: uppercase;
}

/* ── deck (form terminal block) ── */
.deck {
  min-height: 52vh; padding: 2rem 2.5rem 5rem;
  max-width: 780px; margin: 0 auto;
  display: flex; flex-direction: column; justify-content: center;
  align-items: center; text-align: center;
}
.deck .section-label { text-align: center; }
.deck .terminal { width: 100%; text-align: left; }
.terminal {
  background: var(--surface); border: 1px solid var(--border);
  padding: 1.75rem 2rem; margin-top: 1.5rem;
}
.terminal-bar { display: flex; gap: .5rem; margin-bottom: 1.5rem; }
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot-r { background: #ff5f56; }
.dot-y { background: #ffbd2e; }
.dot-g { background: #27c93f; }

/* form fields */
.field { margin-bottom: 1rem; }
.field label {
  display: block; font-family: var(--mono); font-size: .7rem;
  color: var(--accent); letter-spacing: .15em; text-transform: uppercase;
  margin-bottom: .5rem;
}
.field input {
  width: 100%; height: 2.79rem; background: var(--bg); border: 1px solid var(--border);
  color: var(--text); font-family: var(--mono); font-size: .85rem;
  padding: 0 1rem; outline: none; transition: border-color .2s;
  color-scheme: dark;
}
.field input:focus { border-color: var(--accent); }
.field input::placeholder { color: var(--muted); }

/* custom dropdown */
.dd { position: relative; width: 100%; }
.dd-toggle {
  width: 100%; height: 2.79rem; background: var(--bg); border: 1px solid var(--border);
  color: var(--text); font-family: var(--mono); font-size: .85rem;
  padding: 0 1rem; outline: none; display: flex; align-items: center;
  justify-content: space-between; gap: .75rem; transition: border-color .2s;
  cursor: none; text-align: left;
}
.dd-toggle:hover, .dd.open .dd-toggle { border-color: var(--accent); }
.dd-caret {
  width: 0; height: 0; border-left: 5px solid transparent;
  border-right: 5px solid transparent; border-top: 6px solid var(--muted);
  transition: transform .2s, border-top-color .2s; flex-shrink: 0;
}
.dd.open .dd-caret { transform: rotate(180deg); border-top-color: var(--accent); }
.dd-menu {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--border);
  list-style: none; display: none; z-index: 20; overflow: hidden;
}
.dd.open .dd-menu { display: block; }
.dd-item {
  font-family: var(--mono); font-size: .8rem; color: var(--muted);
  padding: .75rem 1rem; cursor: none; transition: background .15s, color .15s;
}
.dd-item:hover { background: var(--bg); color: var(--text); }
.dd-item.selected { color: var(--accent); }
.dd-item.selected::before { content: '>> '; color: var(--accent); }

.row { display: flex; gap: 1rem; align-items: flex-end; }
.field--grow { flex: 1; }
.row .field { margin-bottom: 0; }
.row .grab { height: 2.79rem; flex-shrink: 0; }
.turnstile-wrap { margin: .9rem 0 .25rem; min-height: 65px; }

/* buttons */
.btn {
  font-family: var(--mono); font-size: .8rem; letter-spacing: .08em;
  text-transform: uppercase; text-decoration: none;
  padding: .85rem 2rem; border: 1px solid;
  transition: background .2s, color .2s, transform .15s;
  display: inline-block; cursor: none;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); color: #0a0a0a; border-color: var(--accent); }
.btn-primary:hover { background: #d4f74a; border-color: #d4f74a; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--muted); }

.grab { cursor: none; }

.status-line {
  font-family: var(--mono); font-size: .75rem; color: var(--accent);
  margin-top: 1rem; min-height: 1.2em; letter-spacing: .02em;
}

/* ── log (recent grabs) ── */
.log {
  padding: 6rem 2.5rem; max-width: 860px; margin: 0 auto;
  border-top: 1px solid var(--border);
}
.log-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 2rem;
}
.meter {
  font-family: var(--mono); font-size: .65rem; letter-spacing: .06em;
}
.meter .ok { color: #27c93f; margin-right: .8rem; }
.meter .bad { color: #ff5f56; margin-right: .8rem; }

/* ── job list ── */
.job-list {
  list-style: none; display: flex; flex-direction: column; gap: 1px;
  background: var(--border); border: 1px solid var(--border);
}
.job {
  background: var(--bg); padding: 1.25rem 1.5rem;
  transition: background .2s;
}
.job:hover { background: var(--surface); }

.job-meta {
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  font-family: var(--mono); font-size: .75rem;
}

/* lamp */
.lamp {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.lamp--running { background: var(--accent); animation: pulse 1.4s ease infinite; }
.lamp--queued  { background: #ffbd2e; animation: pulse 2s ease infinite; }
.lamp--done    { background: #27c93f; }
.lamp--failed  { background: #ff5f56; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: .35; }
}

/* tag (kind badge) */
.tag {
  font-family: var(--mono); font-size: .6rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--accent); border: 1px solid var(--border);
  padding: .15rem .55rem; line-height: 1.5;
}
.tag[data-kind="spotify"] { border-color: var(--accent); }

.job-src {
  color: var(--muted); flex: 1; min-width: 120px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.job-fmt,
.job-status,
.job-time {
  color: var(--muted); font-size: .65rem; letter-spacing: .06em;
}

.prog {
  font-family: var(--mono); font-size: .72rem; color: var(--accent);
  margin-top: .75rem;
}
.prog b { color: var(--accent); }

/* tracks */
.tracks {
  list-style: none; margin-top: .75rem;
  display: flex; flex-direction: column; gap: .25rem;
  font-family: var(--mono); font-size: .72rem;
}
.tracks li { display: flex; align-items: baseline; gap: .6rem; }
.ix { color: var(--accent); min-width: 1.6em; }
.trk { color: var(--muted); }
.tracks li[data-status="done"] .trk { color: #27c93f; }
.tracks li[data-status="failed"] { color: #ff5f56; }

.job-error {
  font-family: var(--mono); font-size: .72rem; color: #ff5f56;
  margin-top: .6rem;
}

/* files */
.files {
  list-style: none; margin-top: .75rem;
  display: flex; flex-direction: column; gap: .35rem;
}
.files a {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--mono); font-size: .72rem; color: var(--muted);
  text-decoration: none; letter-spacing: .04em; transition: color .2s;
}
.files a::before { content: ']'; color: var(--accent); }
.files a:hover { color: var(--text); }

/* empty state */
.empty {
  font-family: var(--mono); font-size: .8rem; color: var(--muted);
  padding: 3rem; text-align: center; background: var(--bg);
  letter-spacing: .04em;
}

/* new-job enter animation */
@keyframes fadeup { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.enter { animation: fadeup .35s ease both; }

/* ── legal pages ── */
.legal {
  max-width: 720px; margin: 0 auto;
  padding: 10rem 2.5rem 6rem;
}
.legal-title {
  font-family: var(--sans); font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800; letter-spacing: -.02em; margin: 1.5rem 0 2.5rem;
}
.legal-title span { color: var(--accent); }
.legal-body {
  font-family: var(--mono); font-size: .8rem; color: var(--muted);
  line-height: 2; letter-spacing: .02em;
}
.legal-body h2 {
  font-family: var(--mono); font-size: .7rem; color: var(--accent);
  letter-spacing: .15em; text-transform: uppercase;
  margin-top: 2.5rem; margin-bottom: .75rem;
}
.legal-body p { margin-bottom: 1rem; }

/* ── cookie consent overlay ── */
.consent-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(6,6,6,.85); backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
}
.consent-overlay.hidden { display: none; }
.consent-card {
  background: var(--surface); border: 1px solid var(--border);
  max-width: 440px; width: 100%; padding: 2rem 2rem 1.75rem;
}
.consent-title {
  font-family: var(--sans); font-size: 1.6rem; font-weight: 800;
  letter-spacing: -.02em; margin: 1rem 0 .75rem;
}
.consent-title span { color: var(--accent); }
.consent-text {
  font-family: var(--mono); font-size: .78rem; color: var(--muted);
  line-height: 1.9; margin-bottom: 1.5rem;
}
.consent-text code { color: var(--text); }
.consent-actions { display: flex; gap: .75rem; flex-wrap: wrap; }
.consent-actions .btn { flex: 1; text-align: center; min-width: 8rem; }

/* ── footer ── */
footer {
  border-top: 1px solid var(--border); padding: 2rem 2.5rem;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 1rem;
}
footer span { font-family: var(--mono); font-size: .7rem; color: var(--muted); }
footer a {
  font-family: var(--mono); font-size: .7rem; color: var(--muted);
  text-decoration: none; transition: color .2s;
}
footer a:hover { color: var(--text); }
.footer-links { display: flex; gap: 1.5rem; }
.footer-note { margin: .5rem 0 0; max-width: 60ch; font-size: .75rem; line-height: 1.5; color: var(--muted); }

/* ── error page (404) ── */
.error {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 8rem 2.5rem 4rem;
  position: relative; overflow: hidden; min-height: 100vh;
}
.error .hero-bg-ascii {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--mono); font-size: clamp(5px, .85vw, 10px);
  line-height: 1.25; color: var(--accent); opacity: .06;
  white-space: pre; pointer-events: none; user-select: none;
  z-index: 0;
}
.error-content { position: relative; z-index: 1; max-width: 620px; }
.error-code {
  font-family: var(--sans); font-weight: 800; letter-spacing: -.04em;
  font-size: clamp(6rem, 22vw, 13rem); line-height: .85;
  margin: .5rem 0 .25rem; opacity: 0; animation: fadeup .7s .22s forwards;
}
.error-code span { color: var(--accent); }
.error-title {
  font-family: var(--sans); font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 800; letter-spacing: -.02em; margin-bottom: 1rem;
  opacity: 0; animation: fadeup .7s .34s forwards;
}
.error-sub {
  font-family: var(--mono); font-size: clamp(.78rem, 1.2vw, .9rem);
  color: var(--muted); line-height: 1.9; max-width: 460px;
  margin: 0 auto 2rem; opacity: 0; animation: fadeup .7s .46s forwards;
}
.error .actions {
  display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap;
  opacity: 0; animation: fadeup .7s .58s forwards;
}

/* ── scrollbar ── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); }
