/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #F5F3EE;
  --ink: #0E0D0C;
  --accent: #E8741A;
  --accent-soft: rgba(232, 116, 26, 0.12);
  --muted: #7A7774;
  --border: #DDD9D3;
  --surface: #EDEBE6;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ===== NAV ===== */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 48px;
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.nav-tagline {
  font-size: 0.8rem;
  color: var(--muted);
  font-family: 'DM Mono', monospace;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ===== HERO ===== */
.hero {
  padding: 80px 48px 64px;
  border-bottom: 1px solid var(--border);
}

.hero-inner {
  max-width: 860px;
}

.hero-label {
  font-size: 0.75rem;
  font-family: 'DM Mono', monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
  font-weight: 500;
}

.hero-headline {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: clamp(2.8rem, 6vw, 5.5rem);
  line-height: 1.0;
  letter-spacing: -0.04em;
  color: var(--ink);
  margin-bottom: 28px;
}

.hero-sub {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 520px;
  line-height: 1.65;
  margin-bottom: 56px;
}

.hero-visual {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Waveform */
.waveform {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 64px;
  padding: 12px 16px;
  background: var(--ink);
  border-radius: 8px;
}

.wave-bar {
  flex: 1;
  background: var(--accent);
  border-radius: 2px;
  min-width: 3px;
  opacity: 0.7;
}

.wave-bar:nth-child(4n) { opacity: 1; }
.wave-bar:nth-child(8n) { background: #B4F03D; }

/* Clip markers */
.clip-markers {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.clip-marker {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--surface);
  border-radius: 6px;
  border: 1px solid var(--border);
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
}

.clip-marker-1 { border-left: 3px solid #B4F03D; }
.clip-marker-2 { border-left: 3px solid var(--accent); }
.clip-marker-3 { border-left: 3px solid #3B82F6; }

.clip-time { color: var(--muted); }
.clip-label { font-weight: 500; color: var(--ink); }
.clip-score { color: var(--accent); font-weight: 600; margin-left: auto; }

/* ===== STATS ===== */
.stats {
  padding: 48px 48px;
  border-bottom: 1px solid var(--border);
}

.stats-grid {
  display: flex;
  align-items: center;
  gap: 0;
  max-width: 860px;
}

.stat {
  flex: 1;
  padding: 0 32px;
}

.stat:first-child { padding-left: 0; }
.stat:last-child { padding-right: 0; }

.stat-value {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 2.2rem;
  letter-spacing: -0.04em;
  color: var(--ink);
  line-height: 1;
  margin-bottom: 6px;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: 'DM Mono', monospace;
}

.stat-divider {
  width: 1px;
  height: 48px;
  background: var(--border);
  flex-shrink: 0;
}

/* ===== HOW IT WORKS ===== */
.hiw {
  padding: 80px 48px;
  border-bottom: 1px solid var(--border);
}

.hiw-header {
  margin-bottom: 56px;
}

.section-tag {
  font-size: 0.72rem;
  font-family: 'DM Mono', monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
  font-weight: 500;
}

.hiw-header h2 {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: clamp(1.8rem, 3.5vw, 3rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--ink);
}

.hiw-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  max-width: 860px;
}

.step-num {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 3.5rem;
  letter-spacing: -0.05em;
  color: var(--surface);
  line-height: 1;
  margin-bottom: 16px;
  -webkit-text-stroke: 1px var(--border);
}

.hiw-step h3 {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 10px;
  color: var(--ink);
}

.hiw-step p {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.65;
}

/* ===== FEATURES ===== */
.features {
  padding: 80px 48px;
  border-bottom: 1px solid var(--border);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  max-width: 860px;
}

.feature {
  background: var(--bg);
  padding: 28px 28px;
}

.feature-icon {
  width: 40px;
  height: 40px;
  background: var(--accent-soft);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  margin-bottom: 14px;
}

.feature h4 {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 8px;
  color: var(--ink);
}

.feature p {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.6;
}

/* ===== CLOSING ===== */
.closing {
  padding: 80px 48px;
}

.closing-inner {
  max-width: 640px;
}

.closing-statement {
  font-family: 'Syne', sans-serif;
  font-weight: 600;
  font-size: clamp(1.1rem, 2.2vw, 1.5rem);
  line-height: 1.5;
  color: var(--ink);
  letter-spacing: -0.02em;
}

/* ===== FOOTER ===== */
footer {
  border-top: 1px solid var(--border);
  padding: 32px 48px;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer-brand {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--ink);
}

.footer-sub {
  font-size: 0.75rem;
  color: var(--muted);
  font-family: 'DM Mono', monospace;
}

/* ===== CLIP UI ===== */
.clip-ui {
  padding: 80px 48px;
  border-bottom: 1px solid var(--border);
}

.clip-ui-inner {
  max-width: 860px;
}

.clip-ui-header {
  margin-bottom: 40px;
}

.clip-input-row {
  display: flex;
  gap: 12px;
  max-width: 640px;
  margin-bottom: 32px;
}

.clip-url-input {
  flex: 1;
  padding: 12px 16px;
  font-family: 'DM Mono', monospace;
  font-size: 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s;
}

.clip-url-input:focus {
  border-color: var(--accent);
}

.clip-url-input::placeholder {
  color: var(--muted);
}

.clip-detect-btn {
  padding: 12px 24px;
  background: var(--ink);
  color: var(--bg);
  border: none;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  font-size: 0.88rem;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s;
}

.clip-detect-btn:hover { opacity: 0.85; }
.clip-detect-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Results */
.clip-results {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 720px;
}

.clip-result-item {
  padding: 20px 24px;
  border: 1px solid var(--border);
  border-bottom: none;
  background: var(--bg);
  cursor: pointer;
  transition: background 0.12s;
}

.clip-result-item:first-child { border-radius: 10px 10px 0 0; }
.clip-result-item:last-child { border-bottom: 1px solid var(--border); border-radius: 0 0 10px 10px; }
.clip-result-item:first-child:last-child { border-radius: 10px; border-bottom: 1px solid var(--border); }

.clip-result-item:hover { background: var(--surface); }
.clip-result-item.selected { background: var(--surface); border-left: 3px solid var(--accent); }

.clip-result-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 8px;
}

.clip-rank {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--accent);
  min-width: 28px;
}

.clip-timestamp {
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
  color: var(--muted);
}

.clip-duration-badge {
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  padding: 2px 8px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 4px;
}

.clip-score-badge {
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  background: var(--ink);
  color: var(--bg);
  border-radius: 4px;
  margin-left: auto;
}

.clip-result-text {
  font-size: 0.85rem;
  color: var(--ink);
  line-height: 1.55;
  font-style: italic;
  margin-bottom: 10px;
}

.clip-signals {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.clip-signal {
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
}

/* Loading state */
.clip-loading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 0;
  color: var(--muted);
  font-family: 'DM Mono', monospace;
  font-size: 0.8rem;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Error state */
.clip-error {
  padding: 16px 20px;
  background: #FEF2F2;
  border: 1px solid #FCA5A5;
  border-radius: 8px;
  color: #B91C1C;
  font-size: 0.85rem;
  max-width: 640px;
}

/* Empty state */
.clip-empty {
  padding: 40px 0;
  text-align: center;
  color: var(--muted);
  font-family: 'DM Mono', monospace;
  font-size: 0.8rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .nav { padding: 20px 24px; }
  .hero { padding: 56px 24px 48px; }
  .stats { padding: 40px 24px; }
  .stats-grid { flex-direction: column; gap: 24px; }
  .stat { padding: 0; }
  .stat-divider { display: none; }
  .hiw { padding: 56px 24px; }
  .hiw-steps { grid-template-columns: 1fr; gap: 32px; }
  .features { padding: 56px 24px; }
  .features-grid { grid-template-columns: 1fr; }
  .closing { padding: 56px 24px; }
  footer { padding: 24px; }
  .clip-markers { gap: 8px; }
  .clip-marker { font-size: 0.7rem; padding: 6px 10px; }
}

@media (max-width: 480px) {
  .hero-headline { font-size: 2.6rem; }
  .stat-value { font-size: 1.8rem; }
}