:root {
  --ink: #101a14;
  --ink-soft: #3a4a40;
  --paper: #eef6ea;
  --paper-deep: #dce9d5;
  --line: rgba(16, 26, 20, 0.14);
  --accent: #c6f23a;
  --accent-ink: #132010;
  --danger: #b42318;
  --ok: #1a6b45;
  --warn: #8a5a00;
  --glow: rgba(198, 242, 58, 0.35);
  --font-display: "Syne", sans-serif;
  --font-body: "Instrument Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background:
    linear-gradient(165deg, #f5faf1 0%, #e8f2e2 42%, #d7e8cf 100%);
  background-attachment: fixed;
  overflow-x: hidden;
}

.atmosphere {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  animation: drift 14s ease-in-out infinite alternate;
}

.orb-a {
  width: 55vw;
  height: 55vw;
  max-width: 680px;
  max-height: 680px;
  left: -12%;
  top: -18%;
  background: radial-gradient(circle, rgba(198, 242, 58, 0.55), transparent 68%);
}

.orb-b {
  width: 42vw;
  height: 42vw;
  max-width: 520px;
  max-height: 520px;
  right: -8%;
  top: 18%;
  background: radial-gradient(circle, rgba(90, 160, 130, 0.35), transparent 70%);
  animation-delay: -4s;
}

.wave {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8%;
  width: 100%;
  height: min(32vh, 280px);
  color: rgba(16, 26, 20, 0.12);
  animation: wavePulse 8s ease-in-out infinite;
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1080px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.25rem 0 4.5rem;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  animation: rise 0.65s ease both;
}

.mark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--ink);
}

.mark-dot {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 6px var(--glow);
  animation: pulseDot 2.8s ease-in-out infinite;
}

.mark-text {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.04em;
}

.user-chip {
  display: none;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.user-chip.visible { display: flex; }

button,
.button {
  font: inherit;
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  padding: 0.8rem 1.25rem;
  background: var(--ink);
  color: #f4faf0;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, opacity 0.15s ease;
}

button:hover { transform: translateY(-1px); }

button.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

button.accent {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  box-shadow: 0 10px 30px var(--glow);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.landing {
  min-height: calc(100vh - 7rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1rem 0 3rem;
  animation: rise 0.8s ease 0.05s both;
}

.brand-hero {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3.4rem, 12vw, 7.2rem);
  letter-spacing: -0.065em;
  line-height: 0.9;
  color: var(--ink);
}

.landing h1 {
  margin: 0.2rem 0 0.85rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.55rem, 3.6vw, 2.35rem);
  letter-spacing: -0.035em;
  line-height: 1.1;
  max-width: 16ch;
}

.lede {
  margin: 0 0 1.75rem;
  max-width: 34ch;
  font-size: 1.08rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

.auth-stage {
  width: min(420px, 100%);
  animation: rise 0.75s ease 0.15s both;
}

.auth-tabs,
.work-tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}

.auth-tabs button,
.work-tabs button {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid transparent;
  padding: 0.5rem 0.9rem;
}

.auth-tabs button.active,
.work-tabs button.active {
  color: var(--ink);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.45);
}

label {
  display: block;
  font-size: 0.84rem;
  margin: 0.8rem 0 0.3rem;
  color: var(--ink-soft);
}

input,
select,
textarea {
  width: 100%;
  font: inherit;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  border-radius: 14px;
  padding: 0.85rem 0.95rem;
  color: var(--ink);
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(198, 242, 58, 0.75);
  border-color: transparent;
  background: #fff;
}

.row {
  display: grid;
  grid-template-columns: 1fr 140px;
  gap: 0.75rem;
}

.actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 1.05rem;
}

.field-note,
.hint,
.empty {
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.45;
}

.field-note {
  margin: 0.45rem 0 0;
}

.hint { margin: 0 0 0.75rem; }

.hidden { display: none !important; }

.flash {
  margin-top: 0.85rem;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  background: #fff4dc;
  color: var(--warn);
  font-size: 0.92rem;
}

.flash.error {
  background: #fdecea;
  color: var(--danger);
}

.flash.ok {
  background: #e5f6ec;
  color: var(--ok);
}

.workspace {
  display: none;
  gap: 1.1rem;
  animation: rise 0.55s ease both;
}

.workspace.visible {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
}

.work-stage {
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 1.25rem 1.3rem 1.4rem;
  backdrop-filter: blur(12px);
}

.jobs h2 {
  font-family: var(--font-display);
  letter-spacing: -0.03em;
  margin: 0;
  font-size: 1.45rem;
}

.jobs-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0 0.75rem;
  flex-wrap: wrap;
}

.jobs-head button {
  padding: 0.45rem 0.85rem;
  font-size: 0.86rem;
}

.job {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  padding: 1rem 0;
  border-top: 1px solid var(--line);
}

.job:first-of-type { border-top: 0; }

.job-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
  word-break: break-word;
}

.meta {
  color: var(--ink-soft);
  font-size: 0.86rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  background: var(--paper-deep);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge.completed { background: #d5f3e4; color: var(--ok); }
.badge.failed,
.badge.cancelled { background: #fdecea; color: var(--danger); }
.badge.processing,
.badge.downloading,
.badge.queued { background: #fff1c9; color: var(--warn); }

.progress {
  margin-top: 0.55rem;
  height: 7px;
  border-radius: 999px;
  background: rgba(16, 26, 20, 0.08);
  overflow: hidden;
}

.progress > span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #8fbf2e, var(--accent));
  transition: width 0.35s ease;
}

.result {
  margin-top: 0.75rem;
  white-space: pre-wrap;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.9rem;
  max-height: 220px;
  overflow: auto;
  font-size: 0.95rem;
  line-height: 1.5;
}

.job-actions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: stretch;
}

.job-actions button {
  padding: 0.5rem 0.85rem;
  font-size: 0.86rem;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(4%, 6%, 0) scale(1.06); }
}

@keyframes wavePulse {
  0%, 100% { opacity: 0.7; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-6px); }
}

@keyframes pulseDot {
  0%, 100% { box-shadow: 0 0 0 5px var(--glow); }
  50% { box-shadow: 0 0 0 10px rgba(198, 242, 58, 0.15); }
}

@media (max-width: 900px) {
  .workspace.visible,
  .row { grid-template-columns: 1fr; }

  .landing {
    min-height: auto;
    padding-top: 1.5rem;
  }

  .job { grid-template-columns: 1fr; }

  .job-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .orb, .wave, .mark-dot, .landing, .top, .auth-stage, .workspace {
    animation: none !important;
  }
}
