:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --accent: #2563eb;
  --accent-2: #06b6d4;
  --border: #e2e8f0;
  --radius: 20px;
}

* {
  box-sizing: border-box;
}

.hidden {
  display: none !important;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

body.modal-open {
  overflow: hidden;
}

.site-header {
  border-bottom: 1px solid var(--border);
  padding: 1rem;
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
}

.site-header nav a {
  color: var(--muted);
  margin-left: 1.25rem;
  text-decoration: none;
  font-weight: 600;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}

.logo img {
  height: 48px;
  width: auto;
}

.site-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

.site-footer {
  text-align: center;
  padding: 2rem;
  color: var(--muted);
}

.site-footer p {
  margin: 0.25rem 0;
}

.tmdb-note {
  font-size: 0.85rem;
}

.grid.two-col {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(520px, 1.4fr);
  gap: 2rem;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.launch-card {
  text-align: center;
}

.launch-card .btn {
  margin-top: 1rem;
}

.launch-bottom {
  margin-top: 2rem;
}

.lede {
  color: var(--muted);
  font-size: 1.1rem;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.08);
  border: 1px solid var(--border);
}

.btn {
  border-radius: 999px;
  border: none;
  padding: 0.85rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.btn:hover {
  opacity: 0.85;
}

.btn-primary {
  background: linear-gradient(120deg, var(--accent), #1d4ed8);
  color: #fff;
}

.btn-secondary {
  background: rgba(37, 99, 235, 0.08);
  color: var(--accent);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn.full {
  width: 100%;
}

.webcam-panel {
  background: #fff;
  border-radius: var(--radius);
  padding: 1rem;
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.webcam-panel video,
.webcam-panel img {
  width: 100%;
  border-radius: calc(var(--radius) - 4px);
  background: #e2e8f0;
}

.camera-select {
  display: block;
  margin-top: 1rem;
}

.camera-select select {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.8);
  color: var(--text);
}

.camera-error {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  background: #fee2e2;
  color: #b91c1c;
  font-weight: 600;
}

.webcam-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.form-grid label {
  display: block;
  margin-bottom: 1.5rem;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
}

.label {
  display: inline-block;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.upload-fallback {
  display: block;
  margin-bottom: 1rem;
  color: var(--muted);
}

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

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

.error {
  color: #f87171;
  font-size: 0.9rem;
}

.toast-container {
  margin-bottom: 1rem;
}

.toast {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.25);
  color: var(--text);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.gallery-card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  box-shadow: 0 15px 40px rgba(15, 23, 42, 0.08);
}

.gallery-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.gallery-card .tagline {
  color: var(--muted);
}

.gallery-card h3,
.gallery-card .gallery-meta,
.gallery-card .tagline {
  margin-left: 1rem;
}

.gallery-card h3 {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
}

.gallery-meta {
  font-size: 0.95rem;
  color: var(--muted);
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
}

.hero-detail {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  align-items: center;
}

.hero-detail img {
  width: 100%;
  border-radius: var(--radius);
}

.hero-detail .tagline {
  font-size: 1.25rem;
  color: var(--accent);
}

.hero-detail .fact {
  color: var(--muted);
}

.facts ul {
  list-style: disc;
  padding-left: 1.5rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.style-guide .swatches {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.swatch {
  width: 150px;
  height: 80px;
  border-radius: var(--radius);
  background: var(--color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: #fff;
}

.celeb-browser {
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.08);
}

.browser-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.browser-search {
  flex: 1;
  min-width: 220px;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #f1f5f9;
  color: var(--text);
}

.browser-filters {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 1rem 0;
}

.browser-selected {
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--muted);
}

.celeb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
  max-height: 680px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.celeb-card {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #fff;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.celeb-card.selected {
  border-color: var(--accent);
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.15);
}

.celeb-card__media img,
.celeb-card__placeholder {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  object-fit: cover;
}

.celeb-card__placeholder {
  background: #eff6ff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--accent);
}

.celeb-card__copy p {
  margin: 0.25rem 0;
  color: var(--muted);
}

.celeb-card__copy small {
  color: #94a3b8;
}

.style-guide header {
  margin-bottom: 2rem;
}

.components {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.sample-card .cta-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.sample-card .demo-card {
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius);
}

.pill {
  display: inline-flex;
  padding: 0.2rem 0.8rem;
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.15);
  color: var(--accent);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.pill.active {
  background: var(--accent);
  color: #05060a;
}

.modal,
.modal__backdrop {
  transition: opacity 0.3s ease;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal.open {
  display: flex;
}

.modal__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  opacity: 0;
  pointer-events: none;
  z-index: 999;
}

.modal__backdrop.visible {
  opacity: 1;
  pointer-events: auto;
}

.modal__dialog {
  background: #fff;
  border-radius: 32px;
  width: min(1400px, 97vw);
  max-height: 95vh;
  overflow-y: auto;
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.2);
  padding: 2.5rem;
  position: relative;
  border: 1px solid var(--border);
}

.modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--muted);
  cursor: pointer;
}

.modal__content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.modal__preview {
  background: radial-gradient(circle at top, rgba(37, 99, 235, 0.08), #f8fafc);
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.preview-stack {
  display: grid;
  grid-template-columns: minmax(320px, 0.8fr) minmax(520px, 1.4fr);
  gap: 1.5rem;
  align-items: stretch;
}

.modal__content.form-open .preview-stack {
  grid-template-columns: minmax(320px, 1fr);
}

.modal__content.form-open .merged-panel {
  order: 3;
}

.preview-left {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal__content.form-open .preview-left {
  order: 1;
}

.mashup-preview__panel {
  background: #fff;
  border-radius: var(--radius);
  padding: 1rem;
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border: 1px solid var(--border);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.04);
}

.merged-panel {
  min-height: 100%;
}

.mashup-preview__panel img {
  width: 100%;
  border-radius: calc(var(--radius) - 6px);
  object-fit: cover;
}

.mashup-preview__panel img.hidden {
  opacity: 0;
}

.mashup-preview__panel .placeholder-text {
  position: absolute;
  color: var(--muted);
  text-align: center;
}

.panel-label {
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.panel-label.overlay {
  position: absolute;
  top: 16px;
  left: 16px;
  background: rgba(15, 23, 42, 0.85);
  color: #fff;
  padding: 0.25rem 0.8rem;
  border-radius: 999px;
  letter-spacing: 0.18em;
}

.status {
  background: #eef2ff;
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-weight: 600;
  color: #1d4ed8;
  margin-bottom: 1rem;
}

.status.is-loading {
  color: #0f172a;
}

.status.is-error {
  background: #fee2e2;
  color: #b91c1c;
}

.status.is-success {
  background: #ecfccb;
  color: #15803d;
}

.merged-output {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
  margin-bottom: 1rem;
}

.merged-output img {
  width: 100%;
  border-radius: calc(var(--radius) - 8px);
}

.modal__cta {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

.modal__cta .btn {
  min-width: 220px;
}

.btn-highlight {
  background: linear-gradient(120deg, #22d3ee, #2563eb);
  color: #0f172a;
  font-weight: 700;
}

.modal__form {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1px solid var(--border);
  box-shadow: 0 15px 40px rgba(15, 23, 42, 0.08);
}

.form-preview {
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  background: #fff;
}

.form-preview img {
  width: 100%;
  border-radius: calc(var(--radius) - 8px);
}

.modal__actions {
  margin-top: 1rem;
}

.modal__actions .btn {
  width: 100%;
}

.allow-gallery {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
  font-weight: 600;
}

.allow-gallery input[type='checkbox'] {
  width: 1.25rem;
  height: 1.25rem;
}

.billboard-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1200;
  padding: 2rem;
}

.billboard-overlay[hidden] {
  display: none !important;
}

.billboard-overlay__inner {
  max-width: 1200px;
  width: 100%;
  text-align: center;
  color: #fff;
}

.billboard-overlay__inner img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.4);
  margin-bottom: 1rem;
}

.billboard-overlay__text {
  font-size: 1.5rem;
  font-weight: 600;
}

@media (max-width: 720px) {
  .site-main {
    padding: 1rem;
  }

  .webcam-actions {
    flex-direction: column;
  }
}
.upload-fallback {
  display: block;
  margin: 1rem 0 2rem;
  color: var(--muted);
  font-weight: 600;
}

.upload-fallback input[type='file'] {
  display: block;
  margin-top: 0.5rem;
  color: var(--text);
}
