:root {
  --ink: #11120e;
  --ink-soft: #1a1c17;
  --paper: #ecebdc;
  --paper-muted: #aaa99d;
  --acid: #d5ff3f;
  --acid-dark: #a8ca29;
  --rule: rgba(236, 235, 220, 0.18);
  --danger: #ff806c;
  --mono: "SFMono-Regular", "Roboto Mono", "Courier New", monospace;
  --sans: Inter, "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { background: var(--ink); color: var(--paper); font-family: var(--sans); }

body { margin: 0; min-height: 100vh; overflow-x: hidden; }

button, input { font: inherit; }

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .045;
  z-index: 20;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.95' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.75'/%3E%3C/svg%3E");
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--rule);
  padding: 18px clamp(20px, 4vw, 64px);
  font: 700 11px/1 var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
}

.brand { color: var(--paper); display: flex; gap: 12px; align-items: center; text-decoration: none; }
.brand-mark { color: var(--acid); font-weight: 900; }
.session-state { display: flex; align-items: center; gap: 9px; color: var(--paper-muted); }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--paper-muted); }
.session-state.valid .pulse { background: var(--acid); box-shadow: 0 0 0 4px rgba(213,255,63,.12); }

.agent-label {
  color: var(--acid);
  font: 700 11px/1.3 var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
}

main { width: 100%; }
.workspace { min-height: calc(100vh - 58px); background: var(--paper); color: var(--ink); padding: clamp(28px, 5vw, 72px); }
.workspace-shell { width: min(1180px, 100%); margin: 0 auto; }
h1 { margin: 0 0 clamp(28px, 5vw, 58px); font-size: clamp(52px, 9vw, 126px); line-height: .82; letter-spacing: -.075em; }
h1 span { color: var(--acid-dark); }

.dropzone {
  width: 100%;
  min-height: min(52vh, 480px);
  padding: 45px 24px;
  border: 2px dashed rgba(17,18,14,.45);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: background .2s, border-color .2s, transform .2s;
}
.dropzone:hover, .dropzone.dragging { background: rgba(213,255,63,.28); border-color: var(--ink); transform: translateY(-2px); }
.drop-icon { width: 70px; height: 70px; border-radius: 50%; background: var(--acid); display: grid; place-items: center; margin-bottom: 28px; }
.drop-icon svg { width: 34px; fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linecap: square; }
.drop-primary { font-weight: 750; font-size: clamp(27px, 4vw, 46px); letter-spacing: -.035em; }
.auth-card, .expired-card { min-height: min(52vh, 480px); border: 2px solid var(--ink); padding: clamp(30px, 6vw, 80px); display: grid; place-items: center; }
.auth-card h3, .expired-card h3 { margin: 0; font-size: clamp(34px, 6vw, 78px); letter-spacing: -.06em; }

.job { border: 1px solid rgba(17,18,14,.22); padding: clamp(22px, 4vw, 48px); }
.job-topline { display: flex; align-items: center; gap: 18px; }
.file-badge { width: 58px; height: 68px; background: var(--ink); color: var(--acid); display: grid; place-items: center; font: 800 10px/1 var(--mono); overflow: hidden; }
.file-copy { min-width: 0; flex: 1; }
.file-copy h3 { margin: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: clamp(19px, 3vw, 30px); }
.file-copy p { margin: 5px 0 0; color: #717269; font: 600 12px/1 var(--mono); }
.text-button { border: 0; background: none; cursor: pointer; text-decoration: underline; text-underline-offset: 4px; font: 700 10px/1 var(--mono); letter-spacing: .1em; }
.progress-track { height: 10px; background: #cccbc0; margin-top: 46px; overflow: hidden; }
.progress-track span { display: block; width: 0; height: 100%; background: var(--ink); transition: width .25s ease; }
.progress-copy { display: flex; justify-content: space-between; gap: 20px; margin-top: 11px; color: #686960; font: 700 11px/1.3 var(--mono); text-transform: uppercase; letter-spacing: .05em; }

.agent-note { margin-top: 38px; border-top: 1px solid rgba(17,18,14,.2); padding-top: 30px; display: flex; gap: 18px; align-items: flex-start; }
.agent-glyph { width: 42px; height: 42px; flex: 0 0 auto; display: grid; place-items: center; background: var(--acid); border-radius: 50%; font-size: 20px; }
.agent-note p { margin: 0; }
.agent-note .agent-label { color: #686960; }
.agent-copy { min-width: 0; padding-top: 1px; }
.agent-reason { max-width: 680px; margin-top: 7px !important; color: #45463f; font-size: clamp(14px, 1.8vw, 17px); line-height: 1.45; }

.result { margin-top: 38px; padding: clamp(24px, 4vw, 44px); background: var(--ink); color: var(--paper); display: grid; grid-template-columns: 1fr auto; gap: 28px; align-items: end; }
.result-number strong { display: block; color: var(--acid); font-size: clamp(56px, 8vw, 106px); line-height: .9; letter-spacing: -.07em; }
.result-number span { display: block; margin-top: 8px; color: var(--paper-muted); font: 700 10px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.result-size { align-self: start; color: var(--paper-muted); font: 700 12px/1 var(--mono); display: flex; gap: 12px; }
.arrow { color: var(--acid); }
.result-actions { grid-column: 2; display: grid; gap: 8px; min-width: 260px; }
.download-button, .more-button { display: flex; justify-content: space-between; gap: 50px; width: 100%; padding: 18px 20px; border: 0; font-weight: 750; text-decoration: none; cursor: pointer; transition: background .2s, transform .2s; }
.download-button { background: var(--acid); color: var(--ink); }
.download-button:hover { background: #e2ff7b; transform: translateY(-2px); }
.more-button { background: transparent; color: var(--paper); outline: 1px solid rgba(236,235,220,.32); outline-offset: -1px; }
.more-button:hover { background: rgba(236,235,220,.08); transform: translateY(-2px); }
.more-button:disabled { cursor: wait; opacity: .5; transform: none; }

.error-note { margin-top: 36px; border: 1px solid var(--danger); padding: 24px; }
.error-note .agent-label { color: #a33326; }
.retry-button { border: 0; background: var(--ink); color: var(--paper); padding: 12px 18px; cursor: pointer; font-weight: 700; }

[hidden] { display: none !important; }

@media (max-width: 720px) {
  .topbar { padding: 16px 18px; }
  .workspace { padding: 36px 18px; }
  h1 { margin-bottom: 34px; }
  .dropzone { min-height: 58vh; }
  .job { padding: 20px; }
  .file-badge { width: 48px; height: 58px; }
  .text-button { align-self: start; }
  .result { grid-template-columns: 1fr; }
  .result-size, .result-actions { grid-column: 1; }
  .result-actions { min-width: 0; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
