/* ---------- Shell ---------- */
.container { width: min(100% - 40px, var(--maxw)); margin-inline: auto; }
.container-narrow { width: min(100% - 40px, 880px); margin-inline: auto; }

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(246, 247, 243, 0.86);
  backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}
.site-header-inner {
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  padding: 9px 13px; border-radius: var(--r-pill); font-size: var(--fs-sm); font-weight: 700; color: var(--ink-2);
  transition: background var(--t-fast), color var(--t-fast);
}
.nav a:hover { background: var(--surface); color: var(--brand); }
.nav a.is-active { color: var(--brand); background: var(--brand-3); }
.header-actions { display: flex; align-items: center; gap: 9px; }
.demo-tag {
  display: inline-flex; align-items: center; gap: 6px; font-size: 0.625rem; font-weight: 800;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
  border: 1px solid var(--line-2); border-radius: 99px; padding: 5px 9px; background: var(--surface);
}
.demo-tag i { width: 6px; height: 6px; border-radius: 50%; background: var(--amber); }

.site-footer { border-top: 1px solid var(--line); padding: 24px 0; color: var(--muted); font-size: var(--fs-xs); }
.site-footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-footer a:hover { color: var(--brand); }

.mobile-nav-toggle { display: none; }

/* ---------- Landing ---------- */
.hero {
  position: relative; overflow: hidden;
  padding: clamp(52px, 9vw, 104px) 0 clamp(56px, 8vw, 96px);
}
.hero::before {
  content: ""; position: absolute; z-index: -1;
  width: 900px; height: 900px; right: -280px; top: -480px; border-radius: 50%;
  background: radial-gradient(circle, rgba(159,227,189,0.36), rgba(159,227,189,0) 66%);
}
.hero::after {
  content: ""; position: absolute; z-index: -1;
  width: 620px; height: 620px; left: -320px; bottom: -420px; border-radius: 50%;
  background: radial-gradient(circle, rgba(215,240,122,0.2), rgba(215,240,122,0) 68%);
}
.hero-grid {
  display: grid; grid-template-columns: minmax(0, 1.06fr) minmax(0, 0.94fr);
  gap: clamp(36px, 6vw, 86px); align-items: center;
}
.hero h1 { font-size: var(--fs-4xl); margin: 18px 0 20px; }
.hero-lead { font-size: clamp(1rem, 1.5vw, 1.125rem); color: var(--ink-2); max-width: 50ch; line-height: 1.65; }
.hero-trust { display: flex; align-items: center; gap: 16px; margin-top: 28px; flex-wrap: wrap; }
.avatar-stack { display: flex; }
.avatar-stack .avatar {
  width: 30px; height: 30px; border: 2px solid var(--paper); margin-left: -8px; font-size: 0.625rem;
}
.avatar-stack .avatar:first-child { margin-left: 0; }
.hero-trust p { font-size: var(--fs-xs); color: var(--muted); line-height: 1.4; }
.hero-trust strong { color: var(--ink); }

.hero-visual { position: relative; padding: 8px 0; }
.hero-phone {
  width: min(100%, 340px); margin: 0 auto;
  border-radius: 34px; padding: 10px; background: var(--surface);
  border: 1px solid var(--line-2); box-shadow: var(--shadow-lg);
  transform: rotate(2.2deg);
  transition: transform var(--t-slow) var(--ease);
}
.hero-phone:hover { transform: rotate(0deg) translateY(-4px); }
.hero-phone .video-frame { border-radius: 26px; }
.hero-float {
  position: absolute; z-index: 2; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); box-shadow: var(--shadow-md); padding: 11px 13px;
  display: flex; align-items: center; gap: 10px; font-size: var(--fs-xs); font-weight: 800;
  animation: floatY 5s var(--ease) infinite;
}
.hero-float svg { width: 18px; height: 18px; color: var(--brand); }
.hero-float small { display: block; color: var(--muted); font-weight: 600; font-size: 0.625rem; }
.hero-float-a { top: 12%; left: -2%; }
.hero-float-b { bottom: 14%; right: -2%; animation-delay: -2.5s; }
@keyframes floatY { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* Input card */
.intake-card { margin-top: -18px; position: relative; z-index: 5; }
.intake-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.intake-head h2 { font-size: var(--fs-xl); }
.intake-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 18px 24px; }
.intake-url { grid-column: 1 / -1; }
.intake-actions {
  grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding-top: 18px; border-top: 1px solid var(--line); flex-wrap: wrap;
}
.intake-note { display: flex; align-items: center; gap: 8px; font-size: var(--fs-xs); color: var(--muted); }
.intake-note svg { width: 15px; height: 15px; color: var(--brand); flex: none; }
.style-row { display: flex; flex-wrap: wrap; gap: 7px; }

.what-next { border-top: 1px solid var(--line); padding-top: 14px; font-size: var(--fs-sm); color: var(--muted); }
.what-next summary { cursor: pointer; font-weight: 800; color: var(--ink-2); list-style: none; display: inline-flex; align-items: center; gap: 8px; }
.what-next summary::-webkit-details-marker { display: none; }
.what-next summary::before { content: "+"; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-3); color: var(--brand); font-weight: 800; }
.what-next[open] summary::before { content: "−"; }
.what-next ol { margin: 12px 0 0 26px; display: grid; gap: 6px; list-style: decimal; }
.what-next li::marker { color: var(--brand); font-weight: 800; }

.section { padding: clamp(48px, 7vw, 88px) 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 30px; flex-wrap: wrap; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feature {
  padding: 26px; border-radius: var(--r-lg); background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow-xs);
  transition: transform var(--t-base) var(--ease), box-shadow var(--t-base) var(--ease);
}
.feature:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.feature-icon {
  width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center;
  background: var(--brand-3); color: var(--brand); margin-bottom: 18px;
}
.feature-icon svg { width: 21px; height: 21px; }
.feature h3 { font-size: var(--fs-lg); margin-bottom: 8px; }
.feature p { color: var(--muted); font-size: var(--fs-sm); line-height: 1.6; }

.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; counter-reset: step; }
.step { position: relative; padding: 22px 20px; border-radius: var(--r-lg); background: var(--surface-2); border: 1px solid var(--line); }
.step::before {
  counter-increment: step; content: "0" counter(step);
  display: block; font-family: var(--font-display); font-size: 1.7rem; color: var(--brand); margin-bottom: 10px;
}
.step h3 { font-size: var(--fs-base); margin-bottom: 5px; }
.step p { font-size: var(--fs-xs); color: var(--muted); }

.cta-band {
  border-radius: var(--r-xl); padding: clamp(28px, 5vw, 54px);
  background: linear-gradient(120deg, var(--brand-2), var(--brand) 60%, #1c6d5b);
  color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  position: relative; overflow: hidden;
}
.cta-band::after {
  content: ""; position: absolute; width: 460px; height: 460px; right: -160px; top: -260px;
  border-radius: 50%; background: radial-gradient(circle, rgba(215,240,122,0.22), transparent 68%);
}
.cta-band h2 { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.8rem, 3.5vw, 2.8rem); }
.cta-band p { color: rgba(255,255,255,0.76); margin-top: 8px; max-width: 48ch; font-size: var(--fs-sm); }
.cta-band .btn { position: relative; z-index: 1; --btn-bg: #fff; --btn-fg: var(--brand-2); --btn-bd: #fff; }

/* ---------- Processing ---------- */
.processing-wrap { padding: clamp(28px, 5vw, 64px) 0 clamp(40px, 6vw, 80px); }
.processing-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
.processing-main h1 { font-family: var(--font-display); font-weight: 400; font-size: clamp(2.1rem, 4.5vw, 3.4rem); margin: 16px 0 12px; }
.processing-main > p { color: var(--muted); max-width: 50ch; }
.progress-block { margin-top: 34px; display: grid; gap: 14px; }
.progress-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.progress-pct { font-size: 2.1rem; font-weight: 800; letter-spacing: -0.05em; font-variant-numeric: tabular-nums; }
.progress-label { font-size: var(--fs-sm); color: var(--muted); font-weight: 700; }
.processing-side { display: grid; gap: 16px; }
.source-preview { position: relative; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); }
.source-preview .video-frame { border-radius: 0; }
.source-info { padding: 16px; display: grid; gap: 12px; }
.source-info h3 { font-size: var(--fs-base); }
.url-chip {
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 9px 11px; border-radius: 8px; background: var(--surface-3); color: var(--muted);
  font-size: 0.75rem; font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
}
.live-log { font-size: var(--fs-xs); color: var(--muted); display: grid; gap: 6px; }
.live-log div { display: flex; gap: 8px; animation: fadeUp var(--t-base) var(--ease-out) both; }
.live-log time { color: var(--muted-2); font-variant-numeric: tabular-nums; flex: none; }

/* ---------- Results ---------- */
.results-wrap { padding: 24px 0 64px; }
.results-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 20px; }
.results-top h1 { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.9rem, 3.6vw, 2.8rem); }
.results-top p { color: var(--muted); font-size: var(--fs-sm); margin-top: 5px; }
.results-toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 0 18px; border-bottom: 1px solid var(--line); margin-bottom: 22px;
}
.results-toolbar .grow { flex: 1; }
.clip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; align-items: start; }
.clip-grid .clip-card { animation: fadeUp var(--t-slow) var(--ease-out) both; }
.clip-grid .clip-card:nth-child(2) { animation-delay: 70ms; }
.clip-grid .clip-card:nth-child(3) { animation-delay: 140ms; }
.clip-grid .clip-card:nth-child(4) { animation-delay: 210ms; }
.clip-grid .clip-card:nth-child(5) { animation-delay: 280ms; }
.clip-grid .clip-card:nth-child(6) { animation-delay: 350ms; }

.editor-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px clamp(18px, 3vw, 30px); border-bottom: 1px solid var(--line); }
.editor-header h1 { font-size: var(--fs-lg); }
.editor-picker { display: flex; gap: 6px; }
.editor-picker button {
  min-width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--surface); font-size: var(--fs-xs); font-weight: 800; color: var(--muted);
  transition: all var(--t-fast);
}
.editor-picker button:hover { border-color: var(--brand); color: var(--brand); }
.editor-picker button[aria-current="true"] { background: var(--brand); color: #fff; border-color: var(--brand); }
.editor-panel { overflow: hidden; }
.export-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 12px 0; }
.export-row + .export-row { border-top: 1px solid var(--line); }
.export-row strong { font-size: var(--fs-sm); display: block; }
.export-row small { color: var(--muted); font-size: var(--fs-xs); }
.export-progress { display: grid; gap: 8px; padding: 14px 0; }

/* ---------- History ---------- */
.history-wrap { padding: clamp(28px, 4vw, 52px) 0 72px; }
.history-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 26px; }
.history-head h1 { font-family: var(--font-display); font-weight: 400; font-size: clamp(2rem, 4vw, 3rem); }
.history-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 22px; }
.filter-row { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 16px; }

/* ---------- Account ---------- */
.account-wrap { padding: clamp(28px, 5vw, 60px) 0 80px; }
.account-grid { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 24px; align-items: start; }
.account-profile { padding: 26px; text-align: center; display: grid; justify-items: center; gap: 10px; }
.account-profile .avatar { margin-bottom: 4px; }
.account-profile h2 { font-size: var(--fs-lg); }
.account-profile p { color: var(--muted); font-size: var(--fs-xs); word-break: break-all; }
.account-details { padding: clamp(20px, 3vw, 30px); display: grid; gap: 20px; }

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { order: -1; }
  .hero-phone { transform: rotate(0); }
  .hero-float-a { left: 4%; }
  .hero-float-b { right: 4%; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .editor-layout { grid-template-columns: 1fr; }
  .editor-side { max-height: none; }
  .editor-stage { min-height: 380px; }
  .account-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  :root { --header-h: 64px; }
  .container, .container-narrow { width: min(100% - 28px, var(--maxw)); }
  .nav {
    display: none; position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 3px;
    background: var(--surface); border-bottom: 1px solid var(--line);
    padding: 10px 14px 14px; box-shadow: var(--shadow-md);
  }
  .nav.is-open { display: flex; animation: fadeUp var(--t-base) var(--ease-out) both; }
  .nav a { padding: 11px 13px; }
  .mobile-nav-toggle { display: inline-flex; }
  .demo-tag { display: none; }
  .header-actions .btn-ghost { display: none; }
  .hero { padding-top: 40px; }
  .hero h1 { margin-top: 14px; }
  .intake-grid { grid-template-columns: 1fr; }
  .intake-url { grid-column: auto; }
  .intake-actions { grid-column: auto; }
  .intake-card { margin-top: -6px; }
  .input-affix .input { padding-right: 14px; }
  .input-affix .affix-action { display: none; }
  .feature-grid, .steps { grid-template-columns: 1fr; }
  .processing-grid { grid-template-columns: 1fr; }
  .processing-side { order: -1; }
  .history-stats { grid-template-columns: repeat(2, 1fr); }
  .project-row { grid-template-columns: 78px minmax(0, 1fr); gap: 12px; }
  .project-thumb { width: 78px; height: 58px; }
  .project-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .clip-grid { grid-template-columns: 1fr; }
  .cta-band { align-items: flex-start; }
  .results-toolbar .grow { flex-basis: 100%; }
  .toast-root { left: 14px; right: 14px; bottom: 14px; width: auto; }
}

@media (max-width: 420px) {
  .hero-float { display: none; }
  .stat-grid { grid-template-columns: 1fr; }
  .editor-picker { flex-wrap: wrap; justify-content: flex-end; max-width: 180px; }
  .trim-controls { gap: 8px; }
  .modal-actions .btn { flex: 1; }
}
