/* ─── DESIGN TOKENS (Airbnb Dark Adaptation) ─────── */
:root {
  --bg:         #111111;
  --surface:    #1c1c1c;
  --surface-hi: #262626;
  --txt:        #f5f5f5;
  --txt-2:      #8a8a8a;
  --brand:      #ff385c;
  --brand-dk:   #e0084f;
  --border:     rgba(255,255,255,0.08);
  --sh-card:    rgba(255,255,255,0.04) 0 0 0 1px,rgba(0,0,0,0.4) 0 2px 8px,rgba(0,0,0,0.6) 0 8px 24px;
  --sh-hover:   rgba(0,0,0,0.8) 0 8px 32px;
  --r-btn:  8px;
  --r-card: 20px;
  --r-lg:   32px;
}

/* ─── BASE ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg); color: var(--txt);
  font-family: -apple-system, system-ui, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  font-weight: 500; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
button { cursor: pointer; border: none; background: none; font-family: inherit; color: inherit; }
pre    { font-family: 'SF Mono','Fira Code','Consolas', monospace; }
a      { color: var(--brand); }
.hidden { display: none !important; }

/* ─── LAYOUT ─────────────────────────────────────── */
.container { max-width: 1128px; margin: 0 auto; padding: 0 24px; }

/* ─── HEADER ─────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(17,17,17,0.92); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo         { font-size: 1.38rem; font-weight: 700; letter-spacing: -0.44px; }
.logo-accent  { color: var(--brand); }

/* ─── BUTTONS ────────────────────────────────────── */
.btn-primary {
  background: var(--brand); color: #fff;
  font-size: 1rem; font-weight: 600;
  padding: 0 24px; height: 48px; min-width: 44px;
  border-radius: var(--r-btn);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .2s, box-shadow .2s, transform .1s;
}
.btn-primary:hover  { background: var(--brand-dk); box-shadow: var(--sh-hover); }
.btn-primary:active { transform: scale(0.96); }

.btn-ghost {
  color: var(--txt-2); font-size: .88rem; font-weight: 600;
  padding: 0 16px; height: 40px; min-width: 44px;
  border-radius: var(--r-btn); border: 1px solid var(--border);
  display: inline-flex; align-items: center; justify-content: center;
  transition: border-color .2s, background .2s, color .2s;
}
.btn-ghost:hover { border-color: rgba(255,255,255,0.24); background: var(--surface); color: var(--txt); }

/* ─── HERO ───────────────────────────────────────── */
.hero       { padding: 72px 0 48px; }
.hero-inner { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 16px; }
.hero-title { font-size: clamp(1.75rem, 4.5vw, 2.5rem); font-weight: 700; letter-spacing: -0.44px; line-height: 1.18; }
.hero-sub   { font-size: 1rem; color: var(--txt-2); max-width: 560px; line-height: 1.6; }

/* ─── UPLOAD CARD ────────────────────────────────── */
.upload-card {
  width: 100%; max-width: 640px; margin-top: 8px;
  background: var(--surface); border-radius: var(--r-card);
  box-shadow: var(--sh-card);
  border: 2px dashed rgba(255,255,255,0.12);
  padding: 56px 32px; cursor: pointer;
  transition: border-color .2s, background .2s;
}
.upload-card:hover, .upload-card.drag-over { border-color: var(--brand); background: var(--surface-hi); }
.upload-content { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.upload-icon    { width: 48px; height: 48px; color: var(--brand); margin-bottom: 4px; }
.upload-label   { font-size: 1rem; font-weight: 600; }
.upload-limit   { font-size: .81rem; color: var(--txt-2); }

/* ─── PROGRESS ───────────────────────────────────── */
.progress-wrap { width: 100%; max-width: 640px; margin-top: 24px; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.progress-label   { font-size: .88rem; font-weight: 600; color: var(--txt-2); }
.progress-bar-bg  { width: 100%; height: 6px; background: var(--surface-hi); border-radius: 99px; overflow: hidden; }
.progress-bar-fill{ height: 100%; background: var(--brand); border-radius: 99px; transition: width .3s ease; }
.progress-pct     { font-size: .75rem; color: var(--txt-2); }

/* ─── RESULT ─────────────────────────────────────── */
.result-wrap      { width: 100%; max-width: 800px; display: flex; flex-direction: column; gap: 24px; margin-top: 16px; }
.video-player     { width: 100%; border-radius: var(--r-card); aspect-ratio: 16/9; background: #000; object-fit: contain; }
.subtitle-box     { background: var(--surface); border-radius: var(--r-card); box-shadow: var(--sh-card); padding: 32px; }
.subtitle-heading { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.18px; margin-bottom: 16px; }
.subtitle-output  {
  font-size: .81rem; line-height: 1.7; color: var(--txt-2);
  white-space: pre-wrap; max-height: 280px; overflow-y: auto;
  border: 1px solid var(--border); border-radius: var(--r-btn);
  padding: 16px; background: var(--bg);
}
.btn-group { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; }

/* ─── ERROR ──────────────────────────────────────── */
.error-box {
  background: rgba(193,53,21,.12); border: 1px solid rgba(193,53,21,.4);
  border-radius: var(--r-btn); padding: 14px 20px;
  max-width: 640px; width: 100%; margin-top: 16px;
  color: #ff6b4a; font-size: .88rem; font-weight: 500;
}

/* ─── AD SPACE (min 60px gap from buttons enforced by margin-top on section) ── */
.ad-space { margin-top: 80px; padding: 0 24px; }
.ad-inner {
  min-height: 100px; max-width: 728px; margin: 0 auto;
  background: var(--surface); border-radius: var(--r-card);
  border: 1px dashed var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--txt-2); font-size: .75rem; font-weight: 500;
  letter-spacing: 0.32px; text-transform: uppercase;
}

/* ─── GUIDE ──────────────────────────────────────── */
.guide-section  { padding: 80px 0; margin-top: 60px; }
.section-title  { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.44px; text-align: center; margin-bottom: 48px; }
.guide-grid     { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.guide-card     {
  background: var(--surface); border-radius: var(--r-card);
  box-shadow: var(--sh-card); padding: 32px 24px;
  transition: box-shadow .2s, transform .2s;
}
.guide-card:hover    { box-shadow: var(--sh-hover); transform: translateY(-3px); }
.guide-step          { font-size: .69rem; font-weight: 700; color: var(--brand); text-transform: uppercase; letter-spacing: 0.32px; margin-bottom: 12px; }
.guide-card-title    { font-size: 1rem; font-weight: 600; letter-spacing: -0.18px; margin-bottom: 8px; }
.guide-card-desc     { font-size: .88rem; color: var(--txt-2); line-height: 1.57; }

/* ─── FOOTER ─────────────────────────────────────── */
.site-footer  { border-top: 1px solid var(--border); padding: 40px 0; }
.footer-inner { display: flex; flex-direction: column; align-items: center; gap: 20px; text-align: center; }
.footer-brand { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.44px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; }
.footer-link  {
  font-size: .88rem; font-weight: 500; color: var(--txt-2);
  padding: 8px 14px; border-radius: var(--r-btn);
  min-height: 44px; min-width: 44px;
  display: inline-flex; align-items: center;
  transition: color .2s, background .2s;
}
.footer-link:hover { color: var(--txt); background: var(--surface); }
.footer-copy  { font-size: .75rem; color: var(--txt-2); }

/* ─── MODAL ──────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.78);
  z-index: 200; display: flex; align-items: center; justify-content: center;
  padding: 24px; backdrop-filter: blur(6px);
}
.modal-box {
  background: var(--surface); border-radius: var(--r-lg);
  box-shadow: var(--sh-card); max-width: 600px; width: 100%;
  max-height: 80vh; overflow-y: auto; padding: 40px; position: relative;
}
.modal-close {
  position: absolute; top: 16px; right: 16px;
  color: var(--txt-2); font-size: 1.25rem;
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: color .2s, background .2s;
}
.modal-close:hover  { color: var(--txt); background: var(--surface-hi); }
.modal-title        { font-size: 1.38rem; font-weight: 700; letter-spacing: -0.44px; margin-bottom: 20px; }
.modal-body         { font-size: .88rem; color: var(--txt-2); line-height: 1.71; }
.modal-body h3      { color: var(--txt); font-weight: 600; margin: 16px 0 6px; }
.modal-body p       { margin-bottom: 8px; }

/* ─── RESPONSIVE ─────────────────────────────────── */
@media (max-width: 744px) {
  .hero         { padding: 48px 0 32px; }
  .upload-card  { padding: 40px 20px; }
  .subtitle-box { padding: 24px 16px; }
  .guide-section{ padding: 60px 0; }
  .modal-box    { padding: 28px 20px; }
}
@media (max-width: 550px) {
  .hero-title { font-size: 1.75rem; }
  .btn-group  { flex-direction: column; }
  .btn-group .btn-primary,
  .btn-group .btn-ghost { width: 100%; }
}
