:root {
  color-scheme: dark;
  --ink: #f2f0e9;
  --muted: #98978f;
  --line: #34342f;
  --panel: #181816;
  --paper: #11110f;
  --acid: #d9ff45;
  --danger: #ff7b66;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    var(--paper);
  background-size: 32px 32px;
  color: var(--ink);
  font-family: var(--sans);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 1px solid var(--acid);
  border-radius: 0;
  background: var(--acid);
  color: #10110c;
  cursor: pointer;
  font-weight: 750;
  padding: 0.95rem 1.2rem;
  transition: transform 120ms ease, opacity 120ms ease;
}

button:hover {
  transform: translateY(-2px);
}

button:disabled {
  cursor: wait;
  opacity: 0.55;
  transform: none;
}

.topbar {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding: 1rem clamp(1.25rem, 4vw, 4rem);
}

.brand {
  color: var(--ink);
  font-family: var(--mono);
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  text-decoration: none;
}

.brand span {
  color: var(--acid);
}

.ghost-button {
  border-color: var(--line);
  background: transparent;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.65rem 0.8rem;
  text-transform: uppercase;
}

.shell {
  margin: 0 auto;
  max-width: 1320px;
  padding: clamp(3rem, 8vw, 8rem) clamp(1.25rem, 4vw, 4rem) 6rem;
}

.hero {
  max-width: 900px;
}

.eyebrow {
  color: var(--acid);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  margin: 0 0 1.25rem;
}

h1 {
  font-size: clamp(3rem, 8vw, 7rem);
  letter-spacing: -0.075em;
  line-height: 0.84;
  margin: 0;
}

.lede {
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.25rem);
  line-height: 1.55;
  margin: 2rem 0 0;
  max-width: 650px;
}

.workspace {
  margin-top: clamp(4rem, 10vw, 9rem);
}

.upload-panel,
.result-panel {
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  border: 1px solid var(--line);
  padding: clamp(1.25rem, 3vw, 2.5rem);
}

.drop-zone {
  align-items: flex-start;
  border: 1px dashed #595951;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  min-height: 260px;
  padding: clamp(1.5rem, 4vw, 3rem);
  position: relative;
  transition: border-color 150ms ease, background 150ms ease;
}

.drop-zone:hover,
.drop-zone.dragging {
  background: rgba(217, 255, 69, 0.045);
  border-color: var(--acid);
}

.drop-index {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.72rem;
}

.drop-title {
  font-size: clamp(1.6rem, 4vw, 3.5rem);
  font-weight: 650;
  letter-spacing: -0.045em;
  margin: auto 0 1rem;
  overflow-wrap: anywhere;
}

.drop-hint {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.68rem;
  line-height: 1.5;
}

.drop-zone input {
  height: 1px;
  opacity: 0;
  position: absolute;
  width: 1px;
}

.controls {
  align-items: end;
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(180px, 1fr) auto;
  margin-top: 1rem;
}

.field {
  display: grid;
  gap: 0.55rem;
}

.field span,
.stack label {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
}

select,
input[type="password"] {
  appearance: none;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 0;
  color: var(--ink);
  outline: none;
  padding: 0.95rem 1rem;
}

select:focus,
input[type="password"]:focus,
textarea:focus {
  border-color: var(--acid);
}

.status {
  font-family: var(--mono);
  font-size: 0.78rem;
  margin: 1rem 0 0;
  min-height: 1.2em;
}

.status.working {
  color: var(--muted);
}

.status.success {
  color: var(--acid);
}

.progress-track {
  background: var(--line);
  height: 3px;
  margin-top: 0.8rem;
  overflow: hidden;
  width: 100%;
}

.progress-bar {
  background: var(--acid);
  height: 100%;
  transition: width 300ms ease;
  width: 0;
}

.error,
.status.error {
  color: var(--danger);
}

.result-panel {
  margin-top: 1.5rem;
}

.result-heading {
  align-items: end;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.result-heading h2 {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  letter-spacing: -0.045em;
  margin: 0;
}

.result-actions {
  display: flex;
  gap: 0.5rem;
}

textarea {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 0;
  color: var(--ink);
  line-height: 1.65;
  min-height: 360px;
  outline: none;
  padding: 1.25rem;
  resize: vertical;
  width: 100%;
}

.usage {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.72rem;
  margin: 0.8rem 0 0;
}

.login-body {
  align-items: center;
  display: grid;
  padding: 1.25rem;
  place-items: center;
}

.login-card {
  background: var(--panel);
  border: 1px solid var(--line);
  max-width: 620px;
  padding: clamp(2rem, 6vw, 4rem);
  width: 100%;
}

.login-card h1 {
  font-size: clamp(3rem, 10vw, 5.5rem);
}

.stack {
  display: grid;
  gap: 0.7rem;
  margin-top: 3rem;
}

.stack button {
  margin-top: 0.5rem;
}

.stack .error {
  font-family: var(--mono);
  font-size: 0.78rem;
  margin: 0.4rem 0 0;
}

@media (max-width: 680px) {
  .controls {
    grid-template-columns: 1fr;
  }

  .result-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .result-actions {
    width: 100%;
  }

  .result-actions button {
    flex: 1;
  }
}
