:root {
  --bg-base: #0b0d13;
  --bg-surface: #151922;
  --bg-surface-raised: #1e2430;
  --border-subtle: #2d3546;
  --border-accent: #d97706;
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --accent-gold: #fbbf24;
  --accent-hover: #f59e0b;
  --status-error-bg: #2a1215;
  --status-error-text: #fca5a5;
  --status-success-text: #86efac;
  --status-error-border: #7f1d1d;
  --status-success-bg: #0d2818;
  --status-success-border: #166534;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --page-width: 1100px;
}

* { box-sizing: border-box; }

html {
  overflow-x: clip;
  background: var(--bg-base);
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, video, svg, iframe { max-width: 100%; }

a {
  color: var(--accent-gold);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

a:hover { color: var(--accent-hover); }

:focus-visible {
  outline: 2px solid var(--accent-gold);
  outline-offset: 2px;
}

header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(21, 25, 34, 0.96);
  border-bottom: 1px solid var(--border-subtle);
}

.nav-container,
.footer-inner,
main {
  width: min(var(--page-width), 100%);
  margin: 0 auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

.nav-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-primary);
  font-weight: 700;
  text-decoration: none;
}

.badge-fan {
  color: var(--accent-gold);
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.15rem 0.45rem;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--text-primary);
}

.credit-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  max-width: 100%;
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  background: var(--bg-surface-raised);
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.825rem;
}

.credit-pill strong { color: var(--accent-gold); }

main {
  flex: 1;
  padding-top: 2.5rem;
  padding-bottom: 4rem;
}

h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  line-height: 1.25;
  letter-spacing: -0.02em;
}

h2 {
  margin: 2rem 0 0.75rem;
  font-size: 1.35rem;
  line-height: 1.3;
}

h3 { margin: 1.25rem 0 0.5rem; font-size: 1.05rem; }

.hero-section { text-align: center; margin-bottom: 2rem; }

.hero-subtitle,
.lede {
  max-width: 42rem;
  margin: 0 auto 1.25rem;
  color: var(--text-secondary);
  font-size: 1.05rem;
}

.hero-section .hero-subtitle { text-align: center; }

.spec-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.pill-item,
.res-badge,
.format-pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 0.8rem;
  padding: 0.25rem 0.65rem;
}

.studio-card,
.panel,
.sheet-card,
.prose {
  min-width: 0;
}

.studio-card,
.panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  padding: 1.25rem;
}

.studio-card { margin: 0 auto 2rem; }

.studio-layout,
.resolution-grid,
.pack-list,
.action-group,
.footer-inner,
.legal-links {
  min-width: 0;
}

.upload-block { margin-bottom: 1.25rem; }

.dropzone {
  display: block;
  border: 2px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-surface-raised);
  padding: 1.5rem 1rem;
  text-align: center;
  cursor: pointer;
}

.dropzone:hover,
.dropzone.is-dragover { border-color: var(--border-accent); }

.dropzone-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-subtle);
  border-radius: 50%;
  color: var(--accent-gold);
}

.dropzone-title { font-weight: 650; margin-bottom: 0.35rem; }

.dropzone-meta,
.res-desc,
.hint,
.stage-copy,
.consent-text,
.footer-inner,
.prose,
.pricing-hint {
  color: var(--text-secondary);
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.preview-card {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 0.85rem;
  align-items: center;
  padding: 0.85rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-surface-raised);
}

.preview-card img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--bg-base);
}

.section-label {
  display: block;
  margin-bottom: 0.65rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.resolution-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.resolution-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
  padding: 0.9rem;
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-surface-raised);
  cursor: pointer;
}

.resolution-card:has(input:checked) {
  border-color: var(--accent-gold);
  background: #232938;
}

.resolution-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.res-header,
.pack-row,
.history-row,
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem 0.75rem;
}

.res-title { font-weight: 750; }

.res-badge { color: var(--accent-gold); }

.consent-block {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-surface-raised);
}

.consent-checkbox {
  width: 24px;
  height: 24px;
  min-width: 24px;
  margin-top: 0.15rem;
  accent-color: var(--accent-gold);
}

.consent-text { font-size: 0.875rem; }

.action-group { display: flex; flex-direction: column; gap: 0.75rem; }

.btn-primary,
.btn-secondary,
.pack-button,
.text-button {
  font: inherit;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}

.btn-primary,
.pack-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--accent-gold);
  color: var(--bg-base);
  font-weight: 750;
  padding: 0.95rem 1rem;
}

.btn-primary:hover,
.pack-button:hover { background: var(--accent-hover); }

.btn-primary[data-ready="false"] { opacity: 0.72; }

.btn-primary:disabled,
.pack-button:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

.btn-primary:disabled:hover,
.pack-button:disabled:hover { background: var(--accent-gold); }

.btn-secondary,
.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-surface-raised);
  color: var(--text-primary);
  padding: 0.75rem 1rem;
}

.pricing-hint { font-size: 0.875rem; text-align: center; }

.alert-banner {
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--status-error-border);
  background: var(--status-error-bg);
  color: var(--status-error-text);
}

.alert-banner a { color: var(--status-error-text); font-weight: 700; }

.status-panel {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.stage-kicker {
  margin: 0;
  color: var(--accent-gold);
  font-weight: 750;
}

.stage-copy { margin: 0; }

.player {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: #000;
}

.player video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.success-note { color: var(--status-success-text); margin: 0; }

.sheet[hidden],
[hidden] { display: none !important; }

.sheet {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  background: rgba(0, 0, 0, 0.62);
}

.sheet-card {
  width: min(560px, 100%);
  max-height: 92vh;
  overflow-x: hidden;
  overflow-y: auto;
  margin: 0;
  padding: 1.25rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--bg-surface);
}

.pack-list {
  display: grid;
  gap: 0.65rem;
  margin: 1rem 0;
}

.field { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 0.75rem; }

.field span,
.history-meta,
.notice { color: var(--text-secondary); }

input[type="email"] {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-surface-raised);
  color: var(--text-primary);
  font: inherit;
  padding: 0.75rem 0.8rem;
}

.prose { max-width: 48rem; }

.prose p,
.prose li { color: var(--text-secondary); }

.prose strong { color: var(--text-primary); }

.prose ul,
.prose ol { padding-left: 1.2rem; }

.prose blockquote {
  margin: 0 0 1.25rem;
  padding: 0.9rem 1rem;
  border-left: 3px solid var(--border-accent);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
}

.prose blockquote p:last-child { margin-bottom: 0; }

.prose pre {
  max-width: 100%;
  overflow-x: auto;
  margin: 1rem 0 1.5rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 0.82rem;
  line-height: 1.45;
}

.prose pre code { color: inherit; }

.notice,
.legal-updated {
  margin: 0 0 1.25rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-primary);
}

.support-email {
  font-size: 1.2rem;
  font-weight: 750;
  line-height: 1.45;
}

.support-email a { overflow-wrap: anywhere; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
}

.data-table th,
.data-table td {
  border: 1px solid var(--border-subtle);
  padding: 0.65rem 0.7rem;
  text-align: left;
  vertical-align: top;
}

.data-table th {
  background: var(--bg-surface-raised);
  color: var(--text-primary);
}

.data-table td { color: var(--text-secondary); background: var(--bg-surface); }

.history-list { display: grid; gap: 0.75rem; }

.history-row {
  padding: 0.85rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
}

footer {
  border-top: 1px solid var(--border-subtle);
  background: #07080c;
  padding: 2rem 0 2.5rem;
}

.disclaimer-box {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem 1.1rem;
  color: var(--text-primary);
}

.legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.1rem;
}

.legal-links a { color: var(--text-secondary); }

.footer-support {
  min-width: 0;
  overflow-wrap: anywhere;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--accent-gold);
  overflow-wrap: anywhere;
}

@media (min-width: 800px) {
  .sheet { align-items: center; padding: 1.25rem; }
  .sheet-card { border-radius: var(--radius-lg); }
  .btn-secondary,
  .text-button { width: auto; }
}

@media (min-width: 1024px) {
  .studio-card { padding: 1.5rem; }
  .studio-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 1.5rem;
    align-items: start;
  }
}

@media (max-width: 720px) {
  .data-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  .data-table,
  .data-table tbody,
  .data-table tr,
  .data-table td {
    display: block;
    width: 100%;
  }

  .data-table tr {
    margin-bottom: 0.85rem;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
  }

  .data-table td {
    border: 0;
    border-top: 1px solid var(--border-subtle);
  }

  .data-table td::before {
    content: attr(data-label);
    display: block;
    color: var(--text-primary);
    font-weight: 700;
  }

  .btn-primary,
  .pack-button,
  .btn-secondary,
  .text-button { width: 100%; }
}
