:root {
  --bg: #f4ecde;
  --bg-soft: #fbf7f0;
  --panel: rgba(255, 250, 243, 0.9);
  --panel-strong: rgba(250, 243, 232, 0.96);
  --ink: #241911;
  --ink-soft: #5b473a;
  --line: rgba(72, 44, 31, 0.14);
  --amber: #aa5f2d;
  --amber-deep: #7b3817;
  --sage: #50685e;
  --sky: #7b95aa;
  --gold: #d59f4b;
  --danger: #8d4433;
  --shadow: 0 24px 60px rgba(72, 44, 31, 0.12);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --font-display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --font-body: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 239, 213, 0.9), transparent 26%),
    radial-gradient(circle at top right, rgba(123, 149, 170, 0.28), transparent 20%),
    linear-gradient(180deg, #efe0c7 0%, #f4ecde 42%, #f7f2ea 100%);
}

img {
  display: block;
  max-width: 100%;
}

a,
button {
  color: inherit;
}

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

button {
  border: 0;
  cursor: pointer;
  background: none;
}

.page-shell {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 56px;
}

.site-header,
.hero,
.status-strip,
.auth-grid,
.dashboard-grid,
.faq-grid {
  position: relative;
  z-index: 1;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 8px 0 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 18px;
  background: linear-gradient(145deg, var(--amber) 0%, #cf9b55 100%);
  color: #fff8f0;
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: 0.08em;
  box-shadow: var(--shadow);
}

.brand strong,
h1,
h2 {
  font-family: var(--font-display);
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.brand strong {
  display: block;
  font-size: 1.15rem;
}

.brand small,
.fine-print,
.hero-text,
.metric span,
.metric strong,
.story-card p,
.preview-meta dd,
.slot-history li,
.jobs-summary,
.job-meta,
.ad-fallback,
.wallet-card p,
.timeline-item p {
  color: var(--ink-soft);
}

.top-nav,
.header-user,
.hero-actions,
.wallet-grid,
.packs-grid,
.workspace-tabs,
.summary-grid,
.page-head,
.modal-head,
.modal-actions,
.job-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.top-nav {
  justify-content: center;
  flex: 1 1 auto;
}

.nav-link {
  position: relative;
  padding: 8px 0;
  color: var(--ink-soft);
}

.nav-link::after {
  content: "";
  position: absolute;
  inset: auto 0 -1px;
  height: 1px;
  background: rgba(35, 23, 17, 0.26);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 180ms ease;
}

.nav-link:hover::after,
.nav-link:focus-visible::after {
  transform: scaleX(1);
}

.header-user {
  align-items: center;
  justify-content: flex-end;
}

.panel {
  background: linear-gradient(180deg, var(--panel) 0%, var(--panel-strong) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.panel-soft {
  padding: 20px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(72, 44, 31, 0.1);
  border-radius: var(--radius-lg);
}

.hero {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 28px;
  padding: 32px;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--amber-deep);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: clamp(2.8rem, 6vw, 5rem);
  max-width: 12ch;
}

h2 {
  margin: 0 0 12px;
  font-size: clamp(1.6rem, 2.9vw, 2.4rem);
}

.hero-text {
  margin: 18px 0 0;
  max-width: 60ch;
  line-height: 1.72;
  font-size: 1.04rem;
}

.hero-actions {
  margin-top: 26px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 20px;
  border-radius: 999px;
  font-weight: 700;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    opacity 180ms ease,
    border-color 180ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
}

.button-primary {
  background: linear-gradient(135deg, var(--amber) 0%, #d49e55 100%);
  color: #fffdf8;
  box-shadow: 0 16px 28px rgba(170, 95, 45, 0.28);
}

.button-secondary {
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
  border: 1px solid rgba(72, 44, 31, 0.12);
}

.button-danger {
  background: rgba(141, 68, 51, 0.08);
  color: var(--danger);
  border: 1px solid rgba(141, 68, 51, 0.16);
}

.button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.hero-points,
.bullet-list,
.slot-history {
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}

.hero-points li,
.bullet-list li,
.slot-history li {
  position: relative;
  padding-left: 24px;
}

.hero-points li::before,
.bullet-list li::before,
.slot-history li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--amber) 0%, #e0b26a 100%);
}

.hero-stage {
  display: grid;
  gap: 16px;
}

.stage-story {
  padding: 24px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.52);
  border: 1px solid rgba(72, 44, 31, 0.1);
}

.timeline {
  display: grid;
  gap: 16px;
}

.timeline-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: start;
}

.timeline-item span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(170, 95, 45, 0.12);
  color: var(--amber-deep);
  font-weight: 700;
}

.timeline-item strong {
  display: block;
  margin-bottom: 4px;
}

.timeline-item p {
  margin: 0;
  line-height: 1.6;
}

.status-strip,
.auth-grid,
.faq-grid {
  display: grid;
  gap: 16px;
}

.status-strip,
.auth-grid,
.faq-grid {
  grid-template-columns: repeat(3, 1fr);
  margin-top: 18px;
}

.metric,
.auth-card,
.story-card,
.wallet-card,
.sidebar-card {
  padding: 24px;
}

.metric span {
  display: block;
  margin-bottom: 8px;
  font-size: 0.86rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  font-size: 1.05rem;
  line-height: 1.5;
}

.auth-card h2,
.story-card h2 {
  font-size: clamp(1.35rem, 2vw, 1.9rem);
}

.stack-form,
.queue-form {
  display: grid;
  gap: 16px;
}

.stack-form label,
.queue-form label {
  display: grid;
  gap: 8px;
}

.stack-form span,
.field-label {
  font-weight: 700;
}

.stack-form input,
.upload-dropzone,
.option-card,
.future-card,
.job-card,
.preview-frame,
.empty-state,
.ad-slot {
  border: 1px solid rgba(72, 44, 31, 0.12);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.62);
}

.stack-form input {
  min-height: 50px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.72);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.38fr) minmax(0, 1fr);
  gap: 18px;
  margin-top: 22px;
}

.dashboard-sidebar {
  display: grid;
  gap: 16px;
}

.summary-grid {
  margin-top: 16px;
}

.summary-grid > div {
  flex: 1 1 120px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.6);
}

.summary-grid span,
.preview-meta dt,
.job-meta span,
.wallet-card span {
  display: block;
  margin-bottom: 6px;
  color: var(--ink-soft);
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.summary-grid strong,
.wallet-card strong {
  font-size: 1.55rem;
}

.workspace-tabs {
  margin-bottom: 18px;
  padding: 10px;
}

.tab-button {
  border-radius: 999px;
  padding: 12px 18px;
  color: var(--ink-soft);
  font-weight: 700;
}

.tab-button.is-active {
  background: rgba(170, 95, 45, 0.12);
  color: var(--amber-deep);
}

.workspace-page {
  display: none;
  padding: 26px;
}

.workspace-page.is-active {
  display: block;
}

.page-head {
  align-items: start;
  justify-content: space-between;
}

.page-head .pill {
  align-self: start;
}

.workspace-split {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 18px;
  margin-top: 18px;
}

.upload-dropzone {
  position: relative;
  padding: 26px;
  text-align: left;
  overflow: hidden;
}

.upload-dropzone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-kicker {
  display: block;
  margin-bottom: 8px;
  color: var(--amber-deep);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  font-weight: 700;
}

.upload-dropzone strong {
  display: block;
  font-size: 1.2rem;
  margin-bottom: 8px;
}

.upload-dropzone small {
  display: block;
  color: var(--ink-soft);
  line-height: 1.5;
}

.field-group {
  display: grid;
  gap: 12px;
}

.option-card,
.future-card {
  padding: 18px;
}

.option-card {
  display: grid;
  gap: 6px;
}

.option-card input[type="radio"] {
  display: none;
}

.option-card strong,
.future-card strong,
.job-card h3 {
  font-size: 1.02rem;
}

.option-card span,
.future-card span {
  color: var(--ink-soft);
  line-height: 1.5;
}

.option-card.is-selected,
.option-card:has(input:checked) {
  border-color: rgba(170, 95, 45, 0.32);
  box-shadow: inset 0 0 0 1px rgba(170, 95, 45, 0.08);
}

.option-card.is-disabled,
.future-card {
  opacity: 0.72;
}

.future-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.preview-card {
  padding: 20px;
  display: grid;
  gap: 16px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.48);
  border: 1px solid rgba(72, 44, 31, 0.12);
}

.preview-frame {
  position: relative;
  min-height: 340px;
  overflow: hidden;
}

.preview-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-placeholder,
.compare-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  color: var(--ink-soft);
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.7), transparent 60%),
    linear-gradient(180deg, rgba(247, 241, 230, 0.9), rgba(240, 233, 220, 0.96));
}

.preview-meta {
  margin: 0;
  display: grid;
  gap: 10px;
}

.preview-meta > div {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.62);
}

.preview-meta dd,
.preview-meta dt {
  margin: 0;
}

.ad-shell {
  padding: 18px;
}

.ad-shell-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 12px;
}

.ad-shell-head p {
  margin: 0;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.74rem;
  font-weight: 700;
}

.ad-slot {
  display: grid;
  place-items: center;
  min-height: 140px;
  background:
    linear-gradient(135deg, rgba(123, 149, 170, 0.08), rgba(170, 95, 45, 0.08));
}

.ad-shell-inline {
  margin-top: 18px;
}

.ad-fallback {
  margin: 12px 0 0;
  font-size: 0.94rem;
  line-height: 1.5;
}

.wallet-grid,
.packs-grid {
  margin-top: 18px;
}

.wallet-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.wallet-card {
  display: grid;
  gap: 12px;
}

.wallet-card p {
  margin: 0;
  line-height: 1.6;
}

.packs-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.pack-card {
  padding: 22px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.64);
  border: 1px solid rgba(72, 44, 31, 0.12);
  display: grid;
  gap: 12px;
}

.pack-card strong {
  font-size: 1.3rem;
}

.pack-card p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.55;
}

.jobs-list {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.job-card {
  padding: 18px;
  display: grid;
  gap: 12px;
}

.job-card h3 {
  margin: 0;
}

.jobs-summary,
.job-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.empty-state {
  margin-top: 18px;
  padding: 24px;
  text-align: center;
  color: var(--ink-soft);
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(72, 44, 31, 0.1);
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-weight: 700;
}

.pill-accent {
  background: rgba(170, 95, 45, 0.12);
  color: var(--amber-deep);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
}

.status-pill.pending {
  background: rgba(213, 159, 75, 0.14);
  color: #8d631f;
}

.status-pill.processing {
  background: rgba(123, 149, 170, 0.16);
  color: #36526b;
}

.status-pill.completed {
  background: rgba(80, 104, 94, 0.16);
  color: #2f5549;
}

.status-pill.failed {
  background: rgba(141, 68, 51, 0.14);
  color: var(--danger);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(25, 18, 14, 0.58);
  backdrop-filter: blur(4px);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(1000px, calc(100% - 24px));
  margin: 24px auto;
  padding: 24px;
}

.modal-head {
  justify-content: space-between;
  align-items: start;
}

.compare-stage {
  position: relative;
  margin-top: 16px;
  min-height: 420px;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.64);
  border: 1px solid rgba(72, 44, 31, 0.12);
  --compare-position: 50%;
}

.compare-stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: linear-gradient(180deg, #ede4d6 0%, #f7f2e8 100%);
}

.compare-after-shell {
  position: absolute;
  inset: 0;
  overflow: hidden;
  clip-path: inset(0 calc(100% - var(--compare-position)) 0 0);
}

.compare-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--compare-position);
  width: 2px;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 0 1px rgba(72, 44, 31, 0.16);
}

.compare-divider::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 24px rgba(72, 44, 31, 0.16);
}

.compare-control {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.compare-control span {
  color: var(--ink-soft);
  font-weight: 700;
}

.compare-control input {
  width: 100%;
}

.toast-region {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  display: grid;
  gap: 10px;
}

.toast {
  min-width: 260px;
  max-width: 360px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(36, 25, 17, 0.92);
  color: #fff8f1;
  box-shadow: 0 18px 32px rgba(24, 15, 10, 0.24);
}

.toast.is-error {
  background: rgba(122, 44, 29, 0.94);
}

@media (max-width: 1180px) {
  .hero,
  .dashboard-grid,
  .workspace-split,
  .wallet-grid,
  .packs-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .site-header {
    flex-direction: column;
    align-items: stretch;
  }

  .top-nav {
    justify-content: flex-start;
  }

  .header-user {
    justify-content: flex-start;
  }

  .status-strip,
  .auth-grid,
  .faq-grid,
  .future-grid {
    grid-template-columns: 1fr;
  }

  .compare-stage {
    min-height: 280px;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100%, calc(100% - 18px));
    padding-top: 18px;
    padding-bottom: 42px;
  }

  .hero,
  .metric,
  .auth-card,
  .story-card,
  .workspace-page,
  .sidebar-card,
  .ad-shell,
  .modal-card {
    padding: 18px;
  }

  h1 {
    font-size: 2.35rem;
  }

  h2 {
    font-size: 1.55rem;
  }

  .button,
  .tab-button {
    width: 100%;
  }

  .toast-region {
    left: 12px;
    right: 12px;
    bottom: 12px;
  }

  .toast {
    min-width: 0;
    max-width: none;
  }
}
