:root {
  --bg: #07070c;
  --bg-soft: #0d0d16;
  --card: rgba(255, 255, 255, 0.035);
  --card-solid: #11111c;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f2f2f7;
  --muted: #9a9ab0;
  --accent: #7c5cff;
  --accent-2: #22d3ee;
  --accent-3: #f472b6;
  --ok: #34d399;
  --radius: 18px;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(900px 500px at 12% -8%, rgba(124, 92, 255, 0.22), transparent 62%),
    radial-gradient(800px 460px at 88% 4%, rgba(34, 211, 238, 0.14), transparent 60%),
    radial-gradient(700px 500px at 50% 110%, rgba(244, 114, 182, 0.10), transparent 65%),
    var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
.wrap { width: min(1080px, calc(100% - 40px)); margin: 0 auto; }
.mono { font-family: "JetBrains Mono", ui-monospace, monospace; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(18px);
  background: rgba(7, 7, 12, 0.72);
  border-bottom: 1px solid var(--border);
}
.topbar-inner { display: flex; align-items: center; gap: 22px; height: 66px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -0.02em; font-size: 18px; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  color: #08080f; font-weight: 900; font-size: 17px;
  box-shadow: 0 8px 22px rgba(124, 92, 255, 0.45);
}
.brand-text span { background: linear-gradient(120deg, var(--accent-2), var(--accent-3)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand.small { font-size: 15px; }
.brand.small .brand-mark { width: 26px; height: 26px; font-size: 14px; border-radius: 8px; }
.nav { display: flex; gap: 6px; margin-left: auto; }
.nav a { padding: 8px 12px; border-radius: 10px; font-size: 14px; color: var(--muted); transition: 0.18s; }
.nav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.pill {
  font-size: 12px; font-weight: 600; color: #c9c4ff;
  border: 1px solid rgba(124, 92, 255, 0.4);
  background: rgba(124, 92, 255, 0.12);
  padding: 6px 11px; border-radius: 999px; white-space: nowrap;
}

/* ---------- hero ---------- */
.hero { padding: 74px 0 40px; text-align: center; }
.eyebrow {
  display: inline-block; font-size: 12.5px; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: #b9b2ff; margin-bottom: 18px;
}
h1 { font-size: clamp(34px, 5.4vw, 58px); line-height: 1.06; letter-spacing: -0.035em; margin: 0 0 20px; font-weight: 800; }
.grad { background: linear-gradient(100deg, #a78bfa 0%, #22d3ee 55%, #f472b6 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { max-width: 680px; margin: 0 auto; color: #b6b6c8; font-size: 17px; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 26px; }
.hero-badges span {
  font-size: 13px; color: #c8c8dc; padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--border); background: rgba(255, 255, 255, 0.04);
}

/* ---------- cards ---------- */
.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}
.studio { padding: 10px 22px 26px; margin-bottom: 34px; }
#studio, #result, #how, #faq { scroll-margin-top: 86px; }

.tabs { display: flex; gap: 6px; padding: 14px 0 4px; border-bottom: 1px solid var(--border); margin-bottom: 22px; flex-wrap: wrap; }
.tab {
  border: 0; background: transparent; color: var(--muted);
  font: inherit; font-weight: 600; font-size: 14px;
  padding: 10px 16px; border-radius: 10px 10px 0 0; cursor: pointer; position: relative;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); }
.tab.active::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: -5px; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 2px;
}

.panel { display: none; }
.panel.active { display: block; animation: fade 0.25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.field-label { display: block; font-size: 13px; font-weight: 600; color: #c6c6d8; margin: 4px 0 8px; }
.input-row { display: flex; gap: 10px; }
.input-row input { flex: 1; min-width: 0; }
input[type="url"], input[type="search"], select, input[type="text"] {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-strong);
  color: var(--text);
  border-radius: 12px;
  padding: 13px 15px;
  font: inherit;
  font-size: 15px;
  outline: none;
  transition: 0.18s;
}
input[type="url"]:focus, select:focus, input[type="search"]:focus {
  border-color: rgba(124, 92, 255, 0.75);
  box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.16);
}
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #9a9ab0 50%), linear-gradient(135deg, #9a9ab0 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 38px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 18px 0 20px; align-items: start; }
.hint-box { font-size: 13px; color: var(--muted); background: rgba(124, 92, 255, 0.08); border: 1px solid rgba(124, 92, 255, 0.22); padding: 12px 14px; border-radius: 12px; }
.hint-box strong { color: #d7d3ff; }
code { font-family: "JetBrains Mono", monospace; font-size: 12px; background: rgba(255, 255, 255, 0.08); padding: 2px 6px; border-radius: 6px; }

/* ---------- buttons ---------- */
.btn {
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font: inherit; font-weight: 600; font-size: 14px;
  padding: 12px 18px; border-radius: 12px; cursor: pointer;
  transition: 0.18s; white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn:hover { background: rgba(255, 255, 255, 0.1); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn.primary {
  background: linear-gradient(120deg, var(--accent), #a855f7 55%, var(--accent-2));
  color: #0a0a12; border: 0;
  box-shadow: 0 14px 34px rgba(124, 92, 255, 0.32);
}
.btn.primary:hover { box-shadow: 0 18px 42px rgba(124, 92, 255, 0.45); }
.btn.big { width: 100%; padding: 15px 20px; font-size: 15.5px; margin-top: 4px; }
.btn.ghost { background: rgba(255, 255, 255, 0.045); }
.btn.small { padding: 9px 12px; font-size: 13px; }
.link-btn { background: none; border: 0; color: #b9b2ff; font: inherit; font-size: 13px; cursor: pointer; padding: 10px 0 0; text-decoration: underline; }

/* ---------- dropzone ---------- */
.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; text-align: center; cursor: pointer;
  border: 1.5px dashed var(--border-strong); border-radius: 16px;
  padding: 38px 20px; background: rgba(0, 0, 0, 0.22); transition: 0.2s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: rgba(124, 92, 255, 0.08); }
.drop-icon { font-size: 26px; }
.drop-title { font-weight: 600; }
.drop-sub { font-size: 13px; color: var(--muted); }
.drop-file { font-size: 13px; color: var(--accent-2); font-weight: 600; }

/* ---------- recorder ---------- */
.recorder { text-align: center; padding: 14px 0 4px; }
.rec-dot { width: 12px; height: 12px; border-radius: 50%; background: #4a4a60; margin: 0 auto 12px; transition: 0.2s; }
.recorder.recording .rec-dot { background: #ef4444; box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6); animation: pulse 1.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); } 70% { box-shadow: 0 0 0 16px rgba(239, 68, 68, 0); } 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); } }
.rec-time { font-family: "JetBrains Mono", monospace; font-size: 34px; font-weight: 500; letter-spacing: 0.04em; }
.rec-help { color: var(--muted); font-size: 14px; max-width: 460px; margin: 6px auto 18px; }
.micro { color: #7d7d93; font-size: 12px; margin-top: 12px; }
.micro.warn { color: #fbbf24; }

/* ---------- status / toast ---------- */
.status { display: flex; align-items: center; gap: 12px; margin-top: 18px; padding: 14px 16px; border-radius: 12px; background: rgba(34, 211, 238, 0.07); border: 1px solid rgba(34, 211, 238, 0.22); font-size: 14px; color: #bfeef7; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(34, 211, 238, 0.3); border-top-color: var(--accent-2); animation: spin 0.8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: #1a1a28; border: 1px solid var(--border-strong); color: var(--text);
  padding: 13px 20px; border-radius: 12px; font-size: 14px; z-index: 90;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6); max-width: min(560px, 90vw);
}
.toast.error { border-color: rgba(239, 68, 68, 0.5); background: #2a1118; }

/* ---------- result ---------- */
.result { padding: 26px; margin-bottom: 26px; }
.video-head { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 18px; }
.thumb { width: 148px; aspect-ratio: 16/9; object-fit: cover; border-radius: 12px; border: 1px solid var(--border); flex: none; }
.video-meta h2 { margin: 0 0 4px; font-size: 20px; line-height: 1.3; letter-spacing: -0.02em; }
.video-meta p { margin: 0 0 10px; font-size: 13.5px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font-size: 12px; padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--border); color: #c9c9dc; }
.chip.accent { background: rgba(124, 92, 255, 0.16); border-color: rgba(124, 92, 255, 0.4); color: #d6d0ff; }

.toolbar { display: flex; gap: 12px; align-items: center; margin: 6px 0 14px; flex-wrap: wrap; }
.search-wrap { flex: 1; min-width: 220px; display: flex; align-items: center; gap: 10px; background: rgba(0, 0, 0, 0.35); border: 1px solid var(--border-strong); border-radius: 12px; padding: 0 14px; }
.search-wrap input { border: 0; background: none; padding: 12px 0; }
.search-wrap input:focus { box-shadow: none; }
.method-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 4px 0 2px; }
.method-option { position: relative; display: flex; gap: 10px; align-items: flex-start; cursor: pointer; border: 1px solid var(--border-strong); background: rgba(0, 0, 0, 0.25); border-radius: 12px; padding: 13px 15px; transition: 0.18s; }
.method-option input { position: absolute; opacity: 0; pointer-events: none; }
.method-option span { display: flex; flex-direction: column; gap: 2px; }
.method-option strong { font-size: 14px; font-weight: 600; }
.method-option em { font-style: normal; font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.method-option:hover { border-color: rgba(124, 92, 255, 0.5); }
.method-option:has(input:checked) { border-color: rgba(124, 92, 255, 0.75); background: rgba(124, 92, 255, 0.12); box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.14); }
.method-option:has(input:checked) strong { color: #e7e3ff; }
.audio-card { margin-top: 4px; }
.mode-switch { display: inline-flex; padding: 3px; gap: 2px; background: rgba(0, 0, 0, 0.35); border: 1px solid var(--border-strong); border-radius: 10px; }
.mode-btn { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 12.5px; font-weight: 600; padding: 7px 12px; border-radius: 8px; cursor: pointer; transition: 0.16s; white-space: nowrap; }
.mode-btn:hover { color: var(--text); }
.mode-btn.active { background: rgba(124, 92, 255, 0.28); color: #e8e4ff; box-shadow: inset 0 0 0 1px rgba(124, 92, 255, 0.5); }
.edit-btn.active { background: rgba(34, 211, 238, 0.18); border-color: rgba(34, 211, 238, 0.55); color: #c4f5fd; }
.edit-note { flex-basis: 100%; margin: 0; font-size: 12.5px; color: #9fd8e6; background: rgba(34, 211, 238, 0.08); border: 1px solid rgba(34, 211, 238, 0.22); border-radius: 10px; padding: 9px 12px; }
.edit-note kbd { font-family: "JetBrains Mono", monospace; font-size: 11px; background: rgba(255, 255, 255, 0.12); border-radius: 4px; padding: 1px 5px; }
.transcript.editing .line .text { outline: none; border-bottom: 1px dashed rgba(34, 211, 238, 0.45); cursor: text; padding-bottom: 1px; }
.transcript.editing .line .text:focus { background: rgba(34, 211, 238, 0.08); border-bottom: 1px solid var(--accent-2); border-radius: 4px; }
.transcript.editing .line { align-items: flex-start; }
.del-line { border: 1px solid rgba(239, 68, 68, 0.4); background: rgba(239, 68, 68, 0.12); color: #fca5a5; font-size: 11px; line-height: 1; border-radius: 7px; padding: 5px 7px; cursor: pointer; flex: none; opacity: 0; transition: 0.15s; }
.transcript.editing .del-line { opacity: 1; }
.del-line:hover { background: rgba(239, 68, 68, 0.28); }
.switch { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); cursor: pointer; user-select: none; }
.switch input { accent-color: var(--accent); width: 16px; height: 16px; }

.transcript {
  max-height: 440px; overflow-y: auto;
  border: 1px solid var(--border); border-radius: 14px;
  background: rgba(0, 0, 0, 0.28);
  padding: 8px 8px 8px 0;
  scrollbar-width: thin;
}
.transcript::-webkit-scrollbar { width: 9px; }
.transcript::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.14); border-radius: 9px; }
.line { display: flex; gap: 14px; padding: 9px 14px 9px 16px; border-radius: 10px; }
.line:hover { background: rgba(255, 255, 255, 0.045); }
.line .time {
  font-family: "JetBrains Mono", monospace; font-size: 12px; color: #8f87ff;
  min-width: 58px; padding-top: 2px; cursor: pointer; flex: none;
}
.line .text { font-size: 14.7px; line-height: 1.62; color: #e6e6f0; overflow-wrap: anywhere; }
.line mark { background: rgba(250, 204, 21, 0.32); color: #fff; border-radius: 3px; padding: 0 2px; }
.line.hidden { display: none; }
.transcript.no-time .line { padding-left: 14px; }
.transcript.no-time .time { display: none; }
.transcript.plain .line { display: block; }

.export-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 16px 0 20px; }
.export-note { margin-left: auto; font-size: 12.5px; color: var(--muted); }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.subcard { background: rgba(0, 0, 0, 0.26); border: 1px solid var(--border); border-radius: 16px; padding: 18px; }
.subcard h3 { margin: 0 0 4px; font-size: 15.5px; }
.subcard p { margin: 0 0 14px; }
.inline-row { display: flex; gap: 8px; }
.inline-row select { flex: 1; }
.speed-row { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.speed-row input[type="range"] { flex: 1; accent-color: var(--accent); }
.player { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.player audio { width: 100%; height: 40px; }
.player .btn { align-self: flex-start; }
.player audio::-webkit-media-controls-panel { background: #1c1c2b; }

/* ---------- steps / faq ---------- */
.section-title { font-size: clamp(24px, 3.2vw, 32px); letter-spacing: -0.025em; margin: 54px 0 22px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.step { background: var(--card); border: 1px solid var(--border); border-radius: 18px; padding: 22px; }
.step-num { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; font-weight: 700; background: rgba(124, 92, 255, 0.18); color: #c7beff; border: 1px solid rgba(124, 92, 255, 0.4); margin-bottom: 12px; }
.step h3 { margin: 0 0 6px; font-size: 16px; }
.step p { margin: 0; color: var(--muted); font-size: 14px; }

.faq { display: flex; flex-direction: column; gap: 10px; }
.faq details { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 16px 20px; }
.faq summary { cursor: pointer; font-weight: 600; font-size: 15px; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--muted); font-size: 18px; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq p { margin: 12px 0 0; color: var(--muted); font-size: 14px; }

.footer { border-top: 1px solid var(--border); margin-top: 64px; padding: 26px 0 40px; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.footer-inner p { margin: 0; }

/* ---------- print ---------- */
@media print {
  body { background: #fff; color: #000; }
  .topbar, .hero, .studio, #how, #faq, .footer, .toolbar, .export-row, .split, .toast, .nav, .topbar-cta { display: none !important; }
  .result { box-shadow: none; border: 0; padding: 0; background: #fff; }
  .transcript { max-height: none; overflow: visible; border: 0; background: #fff; padding: 0; }
  .line { padding: 2px 0; }
  .line .text { color: #111; font-size: 12pt; }
  .line .time { color: #555; }
  .video-meta h2 { color: #000; }
  .chip { border-color: #ccc; color: #333; background: #f4f4f4; }
  .muted { color: #555; }
}

@media (max-width: 860px) {
  .row-2, .split, .steps, .method-switch { grid-template-columns: 1fr; }
  .nav { display: none; }
  .topbar-cta .pill { font-size: 11px; padding: 5px 9px; }
  .hero { padding-top: 44px; }
  .thumb { width: 96px; }
  .studio, .result { padding: 18px 15px; }
  .wrap { width: calc(100% - 24px); }
  .export-note { margin-left: 0; width: 100%; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 8px; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { padding: 10px 12px; font-size: 13px; white-space: nowrap; }
  .transcript { max-height: 56vh; }
  .video-meta h2 { font-size: 17px; text-align: left; }
  .export-row .btn { flex: 1 1 calc(50% - 4px); justify-content: center; }
  .edit-note { font-size: 11.5px; }
  .transcript.editing .del-line { opacity: 1; }
  .toolbar { gap: 10px; }
  .search-wrap { min-width: 100%; }
  .inline-row { flex-wrap: wrap; }
  .inline-row select { min-width: 100%; }
  .inline-row .btn { width: 100%; }
  .toast { bottom: 16px; max-width: calc(100vw - 28px); text-align: center; }
  .rec-time { font-size: 30px; }
  .section-title { margin-top: 42px; }
  .hero-badges span { font-size: 12px; padding: 7px 11px; }
}

@media (max-width: 420px) {
  h1 { font-size: 32px; }
  .lead { font-size: 15.5px; }
  .video-head { gap: 12px; }
  .mode-switch { order: 3; }
  .switch { order: 4; }
}
