:root {
  --bg: #07060a;
  --surface: #12101a;
  --surface-2: #1c1828;
  --border: #2e2840;
  --text: #f3efe6;
  --muted: #a39bb8;
  --gold: #d4a853;
  --gold-dim: rgba(212, 168, 83, 0.14);
  --violet: #8b7cf6;
  --ok: #34d399;
  --danger: #f87171;
  --radius: 1rem;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  background:
    radial-gradient(900px 500px at 10% -10%, rgba(139, 124, 246, 0.12), transparent 55%),
    radial-gradient(800px 400px at 90% 0%, rgba(212, 168, 83, 0.08), transparent 50%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 0 1.25rem; }
.muted { color: var(--muted); }
.gold { color: var(--gold); }

.nav {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(12px);
  background: rgba(7, 6, 10, 0.85);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 0.85rem 0;
}
.brand {
  display: flex; align-items: center; gap: 0.65rem;
  font-weight: 700; letter-spacing: -0.02em; color: var(--text);
  text-decoration: none;
}
.brand-mark {
  width: 2.1rem; height: 2.1rem; border-radius: 0.7rem;
  background: linear-gradient(145deg, rgba(212,168,83,0.16), rgba(139,124,246,0.1));
  border: 1px solid rgba(212,168,83,0.38);
  display: grid; place-items: center;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.25) inset, 0 4px 14px rgba(0,0,0,0.25);
}
.brand-logo {
  width: 1.35rem; height: 1.35rem;
  display: block;
}
.brand:hover { text-decoration: none; }
.brand:hover .brand-mark {
  border-color: rgba(232, 200, 120, 0.65);
  box-shadow: 0 0 0 1px rgba(212,168,83,0.12), 0 6px 18px rgba(212,168,83,0.12);
}
.nav-links { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.nav-links a, .nav-links span {
  color: var(--muted); font-size: 0.875rem; padding: 0.35rem 0.65rem; border-radius: 999px;
}
.nav-links a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  border-radius: 999px; border: 1px solid var(--border);
  padding: 0.55rem 1rem; font-weight: 600; font-size: 0.875rem;
  cursor: pointer; background: var(--surface-2); color: var(--text);
  text-decoration: none;
}
.btn:hover { border-color: var(--gold); text-decoration: none; }
.btn-gold {
  background: linear-gradient(135deg, #e0b75e, #b8892f);
  color: #1a1205; border-color: transparent;
}
.btn-gold:hover { filter: brightness(1.05); }
.btn-ghost { background: transparent; }
.btn-danger { border-color: rgba(248,113,113,0.4); color: var(--danger); }

.hero { padding: 3rem 0 2rem; }
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  line-height: 1.08; letter-spacing: -0.03em; margin: 0 0 1rem;
  font-weight: 700;
}
.hero h1 em { color: var(--gold); font-style: italic; font-weight: 600; }
.lead { font-size: 1.1rem; color: var(--muted); max-width: 36rem; margin: 0 0 1.5rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.65rem; margin-bottom: 1rem; }
.pill-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.pill {
  font-size: 0.75rem; color: var(--muted); border: 1px solid var(--border);
  border-radius: 999px; padding: 0.3rem 0.7rem; background: var(--surface);
}

.section { padding: 2rem 0; border-top: 1px solid var(--border); }
.section h2 { margin: 0 0 0.35rem; font-size: 1.5rem; letter-spacing: -0.02em; }
.section .sub { margin: 0 0 1.25rem; color: var(--muted); font-size: 0.95rem; }

.grid-3 {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 1.15rem; padding: 1.1rem;
}
.card h3 { margin: 0 0 0.4rem; font-size: 1rem; }
.card p { margin: 0; color: var(--muted); font-size: 0.9rem; }

.examples {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.ex-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 1.1rem; overflow: hidden;
}
.ex-card-clickable {
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.ex-card-clickable:hover,
.ex-card-clickable:focus-visible {
  border-color: rgba(212, 168, 83, 0.55);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  outline: none;
}
.ex-pair { display: grid; grid-template-columns: 1fr 1fr; }
.ex-pair img, .ex-pair video {
  width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: #000;
  pointer-events: none;
}
.ex-meta { padding: 0.75rem 0.9rem; }
.ex-meta .tag {
  font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--gold); font-weight: 700;
}
.ex-meta h3 { margin: 0.15rem 0 0; font-size: 0.95rem; }

/* Dashboard job thumbnail grid */
.job-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
}
.job-card {
  background: var(--surface-2, #1a1624);
  border: 1px solid var(--border);
  border-radius: 1rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.job-card:hover {
  border-color: rgba(212, 168, 83, 0.4);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}
.job-thumb {
  position: relative;
  display: block;
  aspect-ratio: 1;
  background: #0a0810;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}
.job-thumb-media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #000;
}
.job-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 1.5rem;
  background:
    linear-gradient(135deg, rgba(139, 124, 246, 0.12), transparent 55%),
    #0f0c16;
}
.job-status-badge {
  position: absolute;
  top: 0.45rem;
  left: 0.45rem;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  background: rgba(8, 6, 12, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(4px);
}
.job-thumb-play {
  position: absolute;
  right: 0.45rem;
  bottom: 0.45rem;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  background: rgba(212, 168, 83, 0.92);
  color: #1a1408;
  pointer-events: none;
}
.job-card-meta {
  padding: 0.7rem 0.75rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex: 1;
}
.job-card-title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.job-card-title a {
  color: var(--text);
  text-decoration: none;
}
.job-card-title a:hover { color: var(--gold); }
.job-card-sub {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.35;
}
.job-card-actions {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.45rem;
}
.job-card-actions .btn {
  flex: 1;
  text-align: center;
  padding: 0.35rem 0.5rem;
  font-size: 0.78rem;
  border-radius: 0.55rem;
}
.job-action-zip {
  /* Keep download visually distinct and off the thumbnail hit target */
  flex: 0 0 auto;
  min-width: 3.2rem;
}

/* Example lightbox (also inlined on home for cache resilience) */
body.ex-modal-open { overflow: hidden; }
#ex-modal { display: none; }
#ex-modal.is-open {
  display: flex !important;
  position: fixed; inset: 0; z-index: 9999;
  align-items: center; justify-content: center;
  padding: 1rem;
}
.ex-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(4, 3, 8, 0.82);
  backdrop-filter: blur(6px);
}
.ex-modal-dialog {
  position: relative; z-index: 1;
  width: min(960px, 100%);
  max-height: min(92vh, 900px);
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1.15rem;
  padding: 1.15rem 1.25rem 1.35rem;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}
.ex-modal-close {
  position: absolute; top: 0.55rem; right: 0.7rem;
  border: none; background: transparent; color: var(--muted);
  font-size: 1.75rem; line-height: 1; cursor: pointer; padding: 0.2rem 0.45rem;
}
.ex-modal-close:hover { color: var(--gold); }
.ex-modal-header { padding-right: 2rem; margin-bottom: 0.85rem; }
.ex-modal-header .tag {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--gold); font-weight: 700;
}
.ex-modal-header h3 {
  margin: 0.2rem 0 0; font-size: 1.25rem; font-weight: 700;
}
.ex-modal-pair {
  display: grid; gap: 0.85rem;
  grid-template-columns: 1fr 1fr;
}
.ex-modal-pair figure { margin: 0; }
.ex-modal-pair img,
.ex-modal-pair video {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  border-radius: 0.85rem;
  background: #000;
  border: 1px solid var(--border);
}
.ex-modal-pair figcaption {
  margin-top: 0.4rem;
  font-size: 0.8rem;
  text-align: center;
}
@media (max-width: 700px) {
  .ex-modal-pair { grid-template-columns: 1fr; }
  .ex-modal-pair img,
  .ex-modal-pair video { aspect-ratio: 16 / 10; }
}

.code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem; background: #0b0912; border: 1px solid var(--border);
  border-radius: 0.85rem; padding: 0.9rem 1rem; overflow-x: auto;
  color: #d8d2e8; white-space: pre-wrap; word-break: break-word;
}

.form-row { margin-bottom: 0.9rem; }
.form-row label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.35rem; }
.input, .textarea, select.input {
  width: 100%; border-radius: 0.8rem; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text);
  padding: 0.65rem 0.8rem; font-size: 0.9rem;
}
.input:focus, .textarea:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212,168,83,0.25);
}
/* Paid-only options in free trial cast form */
select.input option:disabled {
  color: #6b6578;
  font-style: italic;
}
.textarea { min-height: 90px; resize: vertical; }

.flash {
  border-radius: 0.85rem; padding: 0.75rem 1rem; margin-bottom: 1rem;
  border: 1px solid var(--border); background: var(--surface-2); font-size: 0.875rem;
}
.flash-ok { border-color: rgba(52,211,153,0.4); background: rgba(52,211,153,0.08); }
.flash-err { border-color: rgba(248,113,113,0.4); background: rgba(248,113,113,0.08); color: #fecaca; }
.flash-key {
  border-color: rgba(212,168,83,0.45); background: var(--gold-dim);
  word-break: break-all;
}

.table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.table th, .table td {
  text-align: left; padding: 0.55rem 0.4rem; border-bottom: 1px solid var(--border);
}
.table th { color: var(--muted); font-weight: 600; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; }

.stat {
  font-size: 1.75rem; font-weight: 700; letter-spacing: -0.02em;
}
.stat span { font-size: 0.85rem; color: var(--muted); font-weight: 500; }

.drop {
  border: 1.5px dashed var(--border); border-radius: 1rem;
  padding: 1.5rem; text-align: center; background: var(--surface-2);
  color: var(--muted); cursor: pointer;
}
.drop:hover { border-color: var(--gold); color: var(--text); }

.footer {
  border-top: 1px solid var(--border); padding: 2rem 0; margin-top: 2rem;
  color: var(--muted); font-size: 0.8rem; text-align: center;
}

.two-col {
  display: grid; gap: 1.25rem;
  grid-template-columns: 1.1fr 0.9fr;
}
@media (max-width: 800px) {
  .two-col { grid-template-columns: 1fr; }
}

.price {
  font-size: 1.6rem; font-weight: 700;
}
.price small { font-size: 0.85rem; color: var(--muted); font-weight: 500; }

.status-ready { color: var(--ok); }
.status-error { color: var(--danger); }
.status-pending, .status-queued, .status-casting, .status-packaging { color: var(--gold); }
