:root {
  --bg: #12151b;
  --surface: #1b2028;
  --surface-raised: #232a35;
  --border: #2e3644;
  --text: #f2efe9;
  --text-muted: #8b93a1;
  --accent: #e8a33d;
  --accent-soft: #e8a33d22;
  --accent-2: #3fa9a0;
  --accent-2-soft: #3fa9a022;
  --danger: #e15b5b;

  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;

  --radius: 10px;
  --wrap: 1080px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.5;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}

.mono { font-family: var(--font-mono); }

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

/* ---------- Topbar ---------- */

.topbar {
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  gap: 16px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.wordmark-icon {
  color: var(--accent);
}

.topbar-note {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  white-space: nowrap;
}

@media (max-width: 560px) {
  .topbar-note { display: none; }
}

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

.lang-select {
  background: var(--surface-raised);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  font-family: var(--font-body);
  font-size: 0.82rem;
  cursor: pointer;
}

.lang-select:hover {
  border-color: var(--accent);
}

.lang-select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* ---------- Ad slots ---------- */

.ad-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.ad-slot--leaderboard {
  max-width: var(--wrap);
  margin: 20px auto 0;
  height: 90px;
}

.ad-slot--rectangle {
  height: 280px;
  max-width: 336px;
  margin: 56px auto;
}

/* ---------- Hero ---------- */

.hero {
  padding: 64px 24px 40px;
  text-align: center;
}

.eyebrow {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 14px;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.1rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
  max-width: 720px;
  margin-inline: auto;
}

.hero-sub {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 560px;
  margin: 0 auto;
}

/* ---------- Lab panel (dropzone) with film-perforation signature ---------- */

.lab-panel {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 10px 0;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.lab-panel.is-dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.perf {
  height: 10px;
  background-image: radial-gradient(circle, var(--bg) 3px, transparent 3.5px);
  background-size: 22px 10px;
  background-repeat: repeat-x;
  background-position: 11px center;
  opacity: 0.9;
}

.lab-panel-inner {
  padding: 48px 24px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
}

.dropzone-icon {
  color: var(--accent);
  margin-bottom: 8px;
}

.dropzone-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  margin: 0;
}

.dropzone-sub {
  color: var(--text-muted);
  margin: 2px 0 8px;
  font-size: 0.9rem;
}

.dropzone-meta {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin: 10px 0 0;
}

/* ---------- Buttons & inputs ---------- */

.btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 11px 22px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.1s ease, filter 0.15s ease, background 0.15s ease;
}

.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--accent);
  color: #1a1305;
}

.btn--primary:hover { filter: brightness(1.08); }

.btn--ghost {
  background: var(--surface-raised);
  color: var(--text);
  border-color: var(--border);
}

.btn--ghost:hover { border-color: var(--accent); }

.btn--outline {
  background: transparent;
  color: var(--accent-2);
  border-color: var(--accent-2);
}

.btn--outline:hover { background: var(--accent-2-soft); }

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ---------- Settings row ---------- */

.settings-row {
  margin-top: 24px;
  display: flex;
  align-items: end;
  gap: 20px;
  flex-wrap: wrap;
}

.setting {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.setting label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.setting select,
.setting input[type="range"] {
  accent-color: var(--accent);
}

.setting select {
  background: var(--surface-raised);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  font-family: var(--font-body);
}

.setting--quality {
  min-width: 180px;
}

.status-line {
  margin: 18px 0 0;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  min-height: 1.2em;
}

/* ---------- Contact sheet (results grid) ---------- */

.contact-sheet {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.frame {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.frame-thumb {
  aspect-ratio: 4 / 3;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.frame-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.frame-body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.frame-name {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.frame-meta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.frame-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-family: var(--font-mono);
}

.frame-status .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
}

.frame[data-status="pending"] .dot { background: var(--text-muted); }
.frame[data-status="converting"] .dot { background: var(--accent); animation: pulse 1s infinite; }
.frame[data-status="done"] .dot { background: var(--accent-2); }
.frame[data-status="error"] .dot { background: var(--danger); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.frame-error {
  color: var(--danger);
  font-size: 0.78rem;
}

.frame-download {
  margin-top: 2px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-2);
  text-decoration: none;
}

/* ---------- Info & FAQ sections ---------- */

.info-section, .faq-section {
  padding: 56px 24px;
}

.info-section h2, .faq-section h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  margin: 0 0 28px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 22px;
}

.info-card h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  margin: 0 0 8px;
}

.info-card p {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin: 0;
}

.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  font-family: var(--font-display);
}

.faq-item p {
  color: var(--text-muted);
  margin: 10px 0 0;
  font-size: 0.92rem;
}

/* ---------- Footer ---------- */

.site-footer {
  padding: 32px 24px 48px;
  color: var(--text-muted);
  font-size: 0.82rem;
  border-top: 1px solid var(--border);
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px 28px;
  align-items: center;
  justify-content: space-between;
}

.site-footer .footer-tagline {
  margin: 0;
}

.footer-nav {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-nav a {
  color: var(--text-muted);
  text-decoration: none;
}

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

/* ---------- Simple content pages (About / Privacy / Contact) ---------- */

.page-header {
  padding: 56px 24px 12px;
}

.page-header .eyebrow {
  margin-bottom: 10px;
}

.page-header h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  letter-spacing: -0.01em;
  margin: 0;
}

.page-updated {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-family: var(--font-mono);
  margin: 10px 0 0;
}

.prose {
  padding: 24px 24px 64px;
  max-width: 700px;
}

.prose h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin: 36px 0 12px;
}

.prose h2:first-child {
  margin-top: 0;
}

.prose p {
  color: var(--text-muted);
  margin: 0 0 14px;
}

.prose ul {
  color: var(--text-muted);
  margin: 0 0 14px;
  padding-left: 20px;
}

.prose li {
  margin-bottom: 6px;
}

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

.contact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 28px;
  margin-top: 8px;
}

.contact-email {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--accent);
  text-decoration: none;
  display: inline-block;
  margin: 6px 0 0;
}

.about-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  margin: 24px 0;
}

@media (prefers-reduced-motion: reduce) {
  .frame[data-status="converting"] .dot { animation: none; }
}
