/* =============================================================
   ytdescriptionextractor.com
   Fresh design: indigo-forward, soft surfaces, generous spacing.
   Light mode only for now. No external CSS deps.
   ============================================================= */

:root {
  /* Brand */
  --brand: #4f46e5;          /* indigo-600 */
  --brand-dark: #3730a3;
  --brand-soft: #eef2ff;
  --accent: #0ea5a5;         /* teal-600 */
  --red: #dc2626;

  /* Neutrals */
  --ink: #0f172a;            /* slate-900 */
  --ink-2: #334155;          /* slate-700 */
  --muted: #64748b;          /* slate-500 */
  --line: #e2e8f0;           /* slate-200 */
  --bg: #ffffff;
  --bg-soft: #f8fafc;        /* slate-50 */
  --bg-tint: #f1f5f9;        /* slate-100 */

  /* Feedback */
  --ok: #16a34a;
  --warn: #f59e0b;

  /* Effects */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-xl: 24px;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.05), 0 1px 3px rgba(15,23,42,.06);
  --shadow-md: 0 4px 14px rgba(15,23,42,.08);
  --shadow-lg: 0 18px 40px rgba(15,23,42,.10);
  --ring: 0 0 0 3px rgba(79,70,229,.22);
  --ease: cubic-bezier(.2,.7,.3,1);

  /* Type */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; }

/* ---------- Accessibility ---------- */
.skip-link {
  position: absolute !important;
  left: -9999px !important;
  top: auto !important;
  width: 1px; height: 1px;
  overflow: hidden;
  background: var(--brand); color: #fff;
  padding: .5rem 1rem; border-radius: var(--r-sm);
  z-index: 9999;
}
.skip-link:focus, .skip-link:focus-visible {
  left: 1rem !important;
  top: 1rem !important;
  width: auto; height: auto;
  overflow: visible;
  outline: 2px solid #fff;
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.25rem;
}
.section { padding: 4rem 0; }
.section-tight { padding: 2.5rem 0; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.9);
  backdrop-filter: saturate(160%) blur(8px);
  -webkit-backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: .9rem 0;
}
.brand {
  display: flex; align-items: center; gap: .6rem;
  font-weight: 800; color: var(--ink); font-size: 1.05rem;
  letter-spacing: -.01em;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), #7c3aed);
  display: grid; place-items: center;
  color: #fff; font-weight: 900; font-size: .9rem;
  box-shadow: var(--shadow-sm);
}
.brand small {
  display: block; font-weight: 500; font-size: .72rem; color: var(--muted);
  letter-spacing: .02em;
}
.nav-links { display: flex; gap: 1.4rem; align-items: center; }
.nav-links a { color: var(--ink-2); font-weight: 500; font-size: .95rem; }
.nav-links a:hover { color: var(--brand); text-decoration: none; }
.nav-toggle { display: none; background: none; border: 0; padding: .4rem; cursor: pointer; }

@media (max-width: 720px) {
  .nav-links { display: none; }
}

/* ---------- Hero ---------- */
.hero {
  padding: 3.5rem 0 2rem;
  background:
    radial-gradient(1200px 600px at 10% -10%, #ede9fe 0%, transparent 60%),
    radial-gradient(800px 400px at 100% 0%, #ccfbf1 0%, transparent 55%),
    var(--bg);
  border-bottom: 1px solid var(--line);
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .35rem .75rem; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand-dark);
  font-size: .78rem; font-weight: 600; letter-spacing: .02em;
  border: 1px solid #e0e7ff;
}
.hero h1 {
  margin: 1rem 0 .75rem;
  font-size: clamp(2rem, 4.5vw, 3rem);
  line-height: 1.15;
  letter-spacing: -.02em;
  color: var(--ink);
  font-weight: 800;
}
.hero h1 em { font-style: normal; color: var(--brand); }
.hero-sub {
  max-width: 640px;
  font-size: 1.08rem;
  color: var(--ink-2);
  margin-bottom: 1.5rem;
}
.trust-row {
  display: flex; gap: 1.25rem; flex-wrap: wrap;
  color: var(--muted); font-size: .88rem; margin-top: 1.25rem;
}
.trust-row span { display: inline-flex; align-items: center; gap: .35rem; }

/* ---------- Extractor card ---------- */
.extractor {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 1.25rem;
  box-shadow: var(--shadow-md);
  margin-top: 1rem;
}
.input-row {
  display: flex; gap: .5rem; flex-wrap: wrap;
}
.input-wrap {
  flex: 1 1 280px;
  position: relative;
  display: flex; align-items: center;
}
.input-wrap svg {
  position: absolute; left: .9rem; width: 18px; height: 18px; color: var(--muted);
  pointer-events: none;
}
.input-wrap input[type="url"],
.input-wrap input[type="text"] {
  width: 100%;
  padding: .85rem 1rem .85rem 2.6rem;
  font-size: 1rem;
  color: var(--ink);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  outline: none;
  transition: border-color .15s var(--ease), background .15s var(--ease), box-shadow .15s var(--ease);
}
.input-wrap input:focus {
  border-color: var(--brand);
  background: #fff;
  box-shadow: var(--ring);
}
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .4rem;
  padding: .85rem 1.25rem;
  border-radius: var(--r-md);
  font-weight: 600;
  font-size: .95rem;
  cursor: pointer;
  transition: transform .12s var(--ease), background .15s var(--ease), box-shadow .15s var(--ease);
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn:focus-visible { box-shadow: var(--ring); outline: none; }
.btn-primary {
  background: var(--brand);
  color: #fff;
}
.btn-primary:hover { background: var(--brand-dark); text-decoration: none; }
.btn-primary:active { transform: translateY(1px); }
.btn-ghost {
  background: #fff;
  color: var(--ink-2);
  border-color: var(--line);
}
.btn-ghost:hover { background: var(--bg-soft); text-decoration: none; }
.btn.loading { pointer-events: none; opacity: .75; }
.btn.loading::after {
  content: "";
  width: 16px; height: 16px;
  border: 2px solid #fff;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.error-msg {
  margin-top: .9rem;
  padding: .75rem 1rem;
  background: #fef2f2;
  color: #991b1b;
  border-left: 3px solid var(--red);
  border-radius: var(--r-sm);
  font-size: .92rem;
}

/* ---------- Results ---------- */
.results {
  margin-top: 1.5rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.result-head {
  display: flex; gap: 1rem; padding: 1.25rem;
  border-bottom: 1px solid var(--line);
  background: var(--bg-soft);
}
.result-head img {
  width: 160px; height: 90px; border-radius: var(--r-md); object-fit: cover;
  background: var(--bg-tint);
  flex-shrink: 0;
}
.result-head-body { flex: 1; min-width: 0; }
.result-head h2 {
  font-size: 1.15rem; margin: 0 0 .35rem; color: var(--ink);
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.result-meta-row {
  display: flex; flex-wrap: wrap; gap: .9rem; color: var(--muted); font-size: .85rem;
}
.result-meta-row a { color: var(--brand); font-weight: 500; }
.tabs {
  display: flex; gap: 0;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}
.tab {
  padding: .9rem 1.1rem;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 500;
  font-size: .92rem;
  white-space: nowrap;
  transition: color .15s var(--ease), border-color .15s var(--ease);
}
.tab:hover { color: var(--ink); }
.tab.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
}
.tab-panel {
  display: none;
  padding: 1.5rem;
}
.tab-panel.active { display: block; }
.panel-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: .5rem; flex-wrap: wrap;
  margin-bottom: .9rem;
}
.panel-head h3 {
  margin: 0; font-size: 1rem; color: var(--ink);
  display: inline-flex; align-items: center; gap: .4rem;
}
.panel-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.copy-btn, .download-btn {
  padding: .45rem .8rem;
  background: #fff; color: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-size: .82rem; font-weight: 500;
  cursor: pointer;
  transition: background .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease);
}
.copy-btn:hover, .download-btn:hover {
  background: var(--brand-soft); color: var(--brand-dark); border-color: #c7d2fe;
}
.copy-btn.copied { background: #dcfce7; color: #166534; border-color: #bbf7d0; }

.desc-box, .transcript-box {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 1rem;
  max-height: 400px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-size: .92rem;
  line-height: 1.65;
  color: var(--ink);
}

/* Tags */
.tags-wrap { display: flex; flex-wrap: wrap; gap: .4rem; }
.tag-chip {
  padding: .35rem .7rem;
  background: var(--brand-soft);
  color: var(--brand-dark);
  border: 1px solid #c7d2fe;
  border-radius: 999px;
  font-size: .82rem;
  cursor: pointer;
  transition: background .15s var(--ease), transform .1s var(--ease);
}
.tag-chip:hover { background: #dbeafe; }
.tag-chip:active { transform: scale(.97); }
.no-tags {
  background: var(--bg-tint); color: var(--muted);
  padding: .75rem; border-radius: var(--r-sm); font-size: .88rem;
}
.tag-count { color: var(--muted); font-weight: 400; font-size: .82rem; }

/* Thumbnails */
.thumbs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.thumb-card {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  cursor: pointer;
  background: #fff;
  transition: transform .12s var(--ease), box-shadow .15s var(--ease), border-color .15s var(--ease);
}
.thumb-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--brand);
}
.thumb-card img { aspect-ratio: 16/9; object-fit: cover; background: var(--bg-tint); }
.thumb-card-info { padding: .7rem .85rem; }
.thumb-card-res { font-weight: 600; font-size: .88rem; color: var(--ink); }
.thumb-card-size { color: var(--muted); font-size: .78rem; margin-top: .1rem; }
.thumb-card-download { color: var(--brand); font-size: .78rem; margin-top: .35rem; }

/* Metadata */
.metadata-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: .75rem 1.5rem;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 1rem 1.25rem;
}
.metadata-grid div {
  padding: .55rem 0;
  border-bottom: 1px dashed var(--line);
}
.metadata-grid div:last-child { border-bottom: 0; }
.metadata-grid dt {
  font-size: .75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.metadata-grid dd {
  margin: .2rem 0 0;
  font-size: .9rem;
  color: var(--ink);
  word-break: break-word;
}

/* Transcript */
.transcript-loader {
  text-align: center; padding: 2rem; color: var(--muted);
}
.transcript-loader::before {
  content: "";
  display: inline-block;
  width: 18px; height: 18px;
  border: 2px solid var(--brand);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin-right: .5rem;
  vertical-align: -4px;
}
.transcript-error {
  background: #fef3c7; color: #92400e;
  border-left: 3px solid var(--warn);
  padding: .75rem 1rem; border-radius: var(--r-sm);
  font-size: .9rem;
}

/* ---------- Feature blocks ---------- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}
.feature {
  padding: 1.5rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.feature:hover { border-color: #c7d2fe; box-shadow: var(--shadow-sm); }
.feature-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center;
  margin-bottom: .9rem; font-size: 1.25rem;
}
.feature h3 { margin: 0 0 .4rem; font-size: 1rem; color: var(--ink); }
.feature p { margin: 0; color: var(--ink-2); font-size: .92rem; }

/* ---------- Full-width colored band section ---------- */
.section-band {
  background: var(--bg-soft);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 3rem 0;
  margin: 3rem 0;
}
.section-band .container { padding: 0 1.25rem; }

/* ---------- Steps ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  counter-reset: step;
  max-width: 960px;
  margin: 0 auto;
}
.step {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 1.25rem 1.25rem 1.25rem 3.5rem;
  position: relative;
  counter-increment: step;
}
.step::before {
  content: counter(step);
  position: absolute;
  left: 1rem; top: 1.1rem;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--brand); color: #fff;
  display: grid; place-items: center;
  font-weight: 700; font-size: .95rem;
}
.step h3 { margin: 0 0 .3rem; font-size: 1rem; color: var(--ink); }
.step p { margin: 0; color: var(--ink-2); font-size: .9rem; }

/* ---------- FAQ ---------- */
.faq { margin-top: 1.5rem; }
.faq details {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 1rem 1.2rem;
  margin-bottom: .6rem;
  background: #fff;
  transition: border-color .15s var(--ease);
}
.faq details[open] { border-color: #c7d2fe; }
.faq summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--ink);
  list-style: none;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-weight: 300; font-size: 1.4rem; color: var(--muted);
  transition: transform .15s var(--ease);
}
.faq details[open] summary::after { content: "\2212"; }
.faq details p { margin: .75rem 0 0; color: var(--ink-2); line-height: 1.7; }

/* ---------- Section titles ---------- */
.section-title {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 2.5rem;
}
.section-title h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin: 0 0 .6rem;
  letter-spacing: -.02em;
  color: var(--ink);
}
.section-title p {
  color: var(--ink-2); margin: 0; font-size: 1.02rem;
}

/* ---------- Blog styles ---------- */
.post {
  max-width: 760px;
  margin: 0 auto;
  padding: 3rem 1.25rem 4rem;
  color: var(--ink);
}
.post h1 {
  font-size: clamp(1.85rem, 4vw, 2.5rem);
  line-height: 1.2;
  letter-spacing: -.02em;
  margin: 0 0 .6rem;
}
.post .post-meta {
  color: var(--muted); font-size: .9rem; margin-bottom: 2rem;
  padding-bottom: 1rem; border-bottom: 1px solid var(--line);
}
.post h2 {
  margin: 2.2rem 0 .8rem; font-size: 1.4rem; letter-spacing: -.01em;
}
.post h3 { margin: 1.5rem 0 .5rem; font-size: 1.1rem; }
.post p { margin: 0 0 1.1rem; color: var(--ink-2); line-height: 1.75; }
.post ul, .post ol { margin: 0 0 1.3rem; padding-left: 1.4rem; color: var(--ink-2); line-height: 1.75; }
.post li { margin-bottom: .45rem; }
.post blockquote {
  margin: 1.5rem 0; padding: 1rem 1.25rem;
  background: var(--brand-soft); border-left: 3px solid var(--brand);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  color: var(--ink); font-size: .98rem;
}
.post a { color: var(--brand); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }

.blog-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}
.blog-card {
  padding: 1.5rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  transition: transform .12s var(--ease), border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.blog-card:hover {
  transform: translateY(-2px);
  border-color: #c7d2fe;
  box-shadow: var(--shadow-md);
}
.blog-card h3 { margin: 0 0 .45rem; font-size: 1.05rem; line-height: 1.35; }
.blog-card h3 a { color: var(--ink); text-decoration: none; }
.blog-card h3 a:hover { color: var(--brand); }
.blog-card p { margin: 0 0 .6rem; font-size: .92rem; color: var(--ink-2); }
.blog-card time { font-size: .8rem; color: var(--muted); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--bg-soft);
  border-top: 1px solid var(--line);
  padding: 2.5rem 0 1.5rem;
  margin-top: 4rem;
  font-size: .9rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
}
@media (max-width: 720px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
.footer-col h4 { font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink); margin: 0 0 .8rem; }
.footer-col a { color: var(--ink-2); display: block; margin-bottom: .45rem; font-size: .9rem; }
.footer-col a:hover { color: var(--brand); }
.footer-bottom {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  text-align: center; font-size: .85rem;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%) translateY(20px);
  background: #0f172a; color: #fff;
  padding: .75rem 1.25rem; border-radius: 999px;
  font-size: .9rem; font-weight: 500;
  opacity: 0;
  transition: opacity .25s var(--ease), transform .25s var(--ease);
  z-index: 500;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Misc ---------- */
.note {
  padding: 1rem 1.2rem; background: var(--brand-soft); border-radius: var(--r-md);
  color: var(--brand-dark); font-size: .92rem;
}
.note strong { font-weight: 600; }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .section { padding: 3rem 0; }
  .hero { padding: 2.5rem 0 1.5rem; }
  .result-head { flex-direction: column; }
  .result-head img { width: 100%; height: auto; aspect-ratio: 16/9; }
  .input-row { flex-direction: column; }
  .btn { width: 100%; }
}
