@import url("https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&family=Source+Serif+4:opsz,wght@8..60,400;8..60,500;8..60,650;8..60,700&display=swap");

@font-face {
  font-family: "Grift";
  src: local("Grift");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #0A0A1F;
  --ink-2: #11112d;
  --line: rgba(255, 255, 255, 0.24);
  --line-strong: rgba(255, 255, 255, 0.48);
  --white: #ffffff;
  --muted: rgba(255, 255, 255, 0.72);
  --soft: rgba(255, 255, 255, 0.48);
  --yellow: #FFEF00;
  --pink: #FF28A2;
  --green: #4EFF00;
  --red: #ff4b4b;
  --font-serif: "Source Serif 4", Georgia, serif;
  --font-body: "Grift", Inter, Arial, sans-serif;
  --font-mono: "JetBrains Mono", monospace;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.024) 1px, transparent 1px),
    var(--ink);
  background-size: 48px 48px, 48px 48px, auto;
  color: var(--white);
  font-family: var(--font-body);
  letter-spacing: 0;
}

a {
  color: inherit;
}

button,
input,
textarea {
  font: inherit;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1320px, calc(100% - 40px));
  margin: 0 auto;
  padding: 22px 0 16px;
  border-bottom: 1px solid var(--line);
}

.brand img {
  display: block;
  width: clamp(172px, 17vw, 248px);
  height: auto;
}

.logout {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  padding: 9px 14px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
}

.logout:hover {
  border-color: var(--yellow);
  color: var(--yellow);
}

.layout {
  width: min(1320px, calc(100% - 40px));
  margin: 0 auto;
  padding: 34px 0 64px;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.34fr);
  gap: 28px;
  margin-bottom: 28px;
  align-items: end;
}

.eyebrow {
  margin: 0;
  color: var(--pink);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.yellow {
  color: var(--yellow);
}

.green {
  color: var(--green);
}

h1,
h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1;
}

h1 {
  max-width: 940px;
  font-size: clamp(46px, 6vw, 88px);
}

h2 {
  font-size: clamp(26px, 2.5vw, 38px);
}

.lede {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.5;
}

.workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(380px, 0.72fr);
  gap: 24px;
  align-items: start;
}

.panel {
  border: 1px solid var(--line);
  background: rgba(5, 5, 21, 0.78);
  backdrop-filter: blur(10px);
  position: relative;
}

.panel::before {
  content: "";
  position: absolute;
  inset: -1px auto auto -1px;
  width: 86px;
  height: 3px;
  background: var(--yellow);
}

.panel-head,
.terminal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
}

.field-label {
  display: block;
  padding: 22px 24px 10px;
  color: var(--soft);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

textarea {
  display: block;
  width: calc(100% - 48px);
  min-height: 300px;
  margin: 0 24px 24px;
  padding: 18px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 0;
  outline: none;
  background: #050515;
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.65;
}

textarea:focus,
input:focus {
  border-color: var(--yellow);
}

.geo-field {
  display: grid;
  gap: 10px;
  margin: 0 24px 24px;
}

.field-label.compact {
  padding: 0;
}

.geo-field input {
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 0;
  outline: none;
  background: #050515;
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 14px;
}

.geo-field input::placeholder {
  color: var(--soft);
}

.upload-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 0.28fr);
  gap: 18px;
  padding: 0 24px 24px;
  align-items: stretch;
}

.upload-zone {
  display: grid;
  gap: 8px;
  min-height: 126px;
  padding: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 239, 0, 0.045);
  cursor: pointer;
}

.upload-zone:hover {
  border-color: var(--yellow);
}

.upload-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.upload-kicker {
  color: var(--yellow);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.upload-zone strong {
  font-size: 21px;
  line-height: 1.15;
}

.upload-zone span:last-child {
  color: var(--muted);
}

.actions {
  display: grid;
  gap: 12px;
  align-content: stretch;
  min-width: 0;
}

.button,
.download-button,
.gate-form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid currentColor;
  border-radius: 0;
  background: transparent;
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 140ms ease, color 140ms ease, background 140ms ease;
}

.icon {
  display: inline-block;
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: square;
  stroke-linejoin: miter;
}

.button.primary {
  background: var(--yellow);
  color: var(--ink);
}

.button.primary:hover {
  background: transparent;
  color: var(--yellow);
}

.button.secondary {
  color: var(--yellow);
}

.button.secondary:hover,
.button.control:hover,
.button.danger:hover {
  border-color: var(--white);
}

.button.control {
  color: var(--white);
}

.button.control.resume {
  color: var(--green);
}

.button.danger {
  color: var(--pink);
}

.button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.download-button {
  border-radius: 999px;
  background: var(--green);
  color: var(--ink);
}

.download-button:not(.disabled):hover {
  background: transparent;
  color: var(--green);
}

.download-button.disabled {
  pointer-events: none;
  opacity: 0.34;
}

.terminal {
  position: sticky;
  top: 22px;
}

#progress-value {
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
}

.progress-track {
  height: 8px;
  margin: 0 24px;
  border: 1px solid var(--line);
  background: #050515;
}

.job-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 24px 0;
}

.job-controls .button {
  min-height: 40px;
  padding: 0 10px;
  font-size: 11px;
}

#progress-bar {
  width: 0%;
  height: 100%;
  background: var(--green);
  transition: width 180ms ease;
}

#terminal-output {
  min-height: 382px;
  max-height: 548px;
  margin: 24px;
  padding: 18px;
  overflow: auto;
  border: 1px solid var(--line);
  background: #02020c;
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.gate-body {
  display: grid;
  place-items: center;
  padding: 24px;
}

.gate-shell {
  width: min(560px, 100%);
}

.gate-panel {
  border: 1px solid var(--line);
  padding: 32px;
  background: rgba(5, 5, 21, 0.82);
  position: relative;
}

.gate-panel::before {
  content: "";
  position: absolute;
  inset: -1px auto auto -1px;
  width: 96px;
  height: 3px;
  background: var(--yellow);
}

.gate-logo {
  width: min(300px, 82%);
  height: auto;
  margin-bottom: 30px;
}

.gate-form {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.gate-form label {
  color: var(--soft);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.gate-form input {
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 0;
  outline: 0;
  background: #050515;
  color: var(--white);
}

.gate-form button {
  justify-self: start;
  min-height: 38px;
  margin-top: 6px;
  padding: 0 18px;
  background: var(--yellow);
  color: var(--ink);
}

.gate-form button:hover {
  background: transparent;
  color: var(--yellow);
}

.form-error {
  margin: 0;
  color: var(--red);
  font-family: var(--font-mono);
  font-size: 12px;
}

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

  .workbench,
  .upload-grid {
    grid-template-columns: 1fr;
  }

  .terminal {
    position: static;
  }

  .actions {
    min-width: 0;
  }
}

@media (max-width: 620px) {
  .topbar,
  .layout {
    width: min(100% - 24px, 1320px);
  }

  .panel-head,
  .terminal-head {
    align-items: flex-start;
    flex-direction: column;
  }

  textarea,
  #terminal-output {
    margin-inline: 14px;
    width: calc(100% - 28px);
  }

  .field-label,
  .upload-grid,
  .panel-head,
  .terminal-head {
    padding-inline: 14px;
  }
}
