/* ============================================================
   YTI New Design — extracted from yti.html with plan modifications
   ============================================================ */

:root {
  --bg: #FAFAF7;
  --surface: #FFFFFF;
  --surface-2: #F4F2EC;
  --ink: #0F1011;
  --ink-2: #3F4347;
  --ink-3: #7A7E83;
  --ink-4: #A7ABB0;
  --line: #ECE9E1;
  --line-2: #E3DFD4;
  --accent: #FF4F3A;
  --accent-ink: #C0301F;
  --accent-soft: #FFF0EC;
  --success: #1F9A57;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --radius-xl: 28px;

  --shadow-sm: 0 1px 2px rgba(15,16,17,.04), 0 1px 1px rgba(15,16,17,.03);
  --shadow: 0 1px 2px rgba(15,16,17,.04), 0 8px 24px -8px rgba(15,16,17,.08);
  --shadow-lg: 0 1px 2px rgba(15,16,17,.04), 0 24px 56px -16px rgba(15,16,17,.16);

  --serif: "Source Serif 4", Georgia, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
/* bare body{} omitted — replaced by body.new-design below so old pages keep Bootstrap styling */
button { font-family: inherit; cursor: pointer; }

/* Scoped link reset — only new-design contexts, so old Bootstrap pages aren't affected */
.nav a, .hero a, .features a, .section a, footer.site-footer a { color: inherit; text-decoration: none; }

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ============ NAV ============ */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 250, 247, 0.78);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: -0.01em;
  font-size: 18px;
}
.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--ink);
  display: grid;
  place-items: center;
  position: relative;
}
.brand-mark::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 8px solid var(--accent);
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  margin-left: 2px;
}
.brand-word { letter-spacing: -0.03em; }
.brand-word .dot { color: var(--accent); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-links a {
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 14px;
  color: var(--ink-2);
  transition: background .15s, color .15s;
}
.nav-links a:hover { color: var(--ink); background: var(--surface-2); }
.nav-links a.is-current { color: var(--ink); background: var(--surface-2); }

/* dropdown */
.dropdown { position: relative; }
.dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 10px 8px 14px;
  border-radius: 10px;
  font-size: 14px;
  color: var(--ink-2);
  background: transparent;
  border: 0;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.dropdown-trigger svg { transition: transform .2s; color: var(--ink-3); }
.dropdown:hover .dropdown-trigger,
.dropdown.is-open .dropdown-trigger { color: var(--ink); background: var(--surface-2); }
.dropdown:hover .dropdown-trigger svg,
.dropdown.is-open .dropdown-trigger svg { transform: rotate(180deg); color: var(--ink-2); }

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: -6px;
  min-width: 280px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 6px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity .15s, visibility .15s, transform .15s;
  z-index: 60;
}
.dropdown:hover .dropdown-menu,
.dropdown.is-open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--ink);
  transition: background .15s;
}
.menu-item:hover { background: var(--surface-2); }
.menu-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.menu-title {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.2;
}
.menu-desc {
  display: block;
  font-size: 12.5px;
  color: var(--ink-3);
  margin-top: 2px;
  line-height: 1.35;
}

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-weight: 500;
  font-size: 14px;
  line-height: 1;
  padding: 10px 16px;
  transition: transform .08s ease, background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.btn:active { transform: translateY(1px); }
.btn-ghost {
  background: transparent;
  color: var(--ink-2);
}
.btn-ghost:hover { color: var(--ink); background: var(--surface-2); }
.btn-outline {
  background: var(--surface);
  border-color: var(--line-2);
  color: var(--ink);
}
.btn-outline:hover { border-color: var(--ink-3); }
.btn-primary {
  background: var(--ink);
  color: #fff;
}
.btn-primary:hover { background: #1c1d1f; }
.btn-accent {
  background: var(--accent);
  color: #fff;
}
.btn-accent:hover { background: #ED4129; box-shadow: 0 8px 18px -8px rgba(255,79,58,.55); }

/* ============ HERO ============ */
.hero {
  padding: 80px 0 56px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  top: -120px; left: 50%;
  transform: translateX(-50%);
  width: 900px; height: 900px;
  background: radial-gradient(closest-side, rgba(255,79,58,.08), transparent 70%);
  pointer-events: none;
  z-index: 0;
}
.hero-inner { position: relative; z-index: 1; text-align: center; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--ink-2);
  box-shadow: var(--shadow-sm);
}
.pill .dot-led {
  width: 6px; height: 6px; border-radius: 999px;
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(31,154,87,.15);
}
.pill strong { color: var(--ink); font-weight: 600; }

h1.display {
  font-family: "Geist", sans-serif;
  font-weight: 600;
  font-size: clamp(36px, 5.5vw, 60px);
  letter-spacing: -0.035em;
  line-height: 1.05;
  margin: 22px auto 18px;
  max-width: 880px;
  text-wrap: balance;
}
h1.display .accent { color: var(--accent); }
.lede {
  font-size: 18px;
  color: var(--ink-2);
  max-width: 580px;
  margin: 0 auto 36px;
  text-wrap: pretty;
}

/* URL form */
.url-form {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: 14px;
  padding: 8px 8px 8px 16px;
  box-shadow: var(--shadow);
}
.url-form:focus-within { border-color: var(--ink-3); }
.url-icon { color: var(--ink-3); flex-shrink: 0; }
.url-input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  padding: 10px 4px;
  min-width: 0;
}
.url-input::placeholder { color: var(--ink-4); }
.url-form .btn-accent {
  padding: 12px 18px;
  font-size: 14px;
  border-radius: 10px;
}

/* ============ INLINE URL ERROR ============ */
.url-error {
  max-width: 680px;
  margin: 20px auto 0;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #FFF5F4;
  border: 1px solid rgba(255,79,58,.25);
  border-radius: var(--radius);
  padding: 14px 16px;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.5;
  text-align: left;
}
.url-error svg { flex-shrink: 0; color: var(--accent); margin-top: 2px; }
.url-error strong { color: var(--ink); display: block; margin-bottom: 4px; }
.url-error a { color: var(--accent); text-decoration: underline; }
.url-error a:hover { color: var(--accent-ink); }
.url-error code { font-family: "Geist Mono", monospace; font-size: 12.5px; background: rgba(255,79,58,.08); padding: 1px 5px; border-radius: 4px; }

/* ============ RESULT PANEL ============ */
.result {
  margin: 56px auto 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(to bottom, #FCFBF8, var(--surface));
}
.result-head-left {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--ink-2);
}
.yt-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  padding: 4px 8px;
  border-radius: 6px;
  font-family: "Geist Mono", monospace;
  font-size: 12px;
  color: var(--ink-2);
}
.yt-chip .yt-icon {
  width: 14px; height: 10px;
  background: var(--accent);
  border-radius: 3px;
  position: relative;
  display: inline-block;
}
.yt-chip .yt-icon::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 0; height: 0;
  border-left: 4px solid #fff;
  border-top: 3px solid transparent;
  border-bottom: 3px solid transparent;
  margin-left: 5px;
}
.traffic {
  display: flex; gap: 6px;
}
.traffic span {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--line-2);
}
.traffic span:nth-child(1) { background: #FF6B5C; opacity: .65; }
.traffic span:nth-child(2) { background: #FFC857; opacity: .65; }
.traffic span:nth-child(3) { background: #59C28C; opacity: .65; }

.result-body {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 0;
}
@media (max-width: 880px) {
  .result-body { grid-template-columns: 1fr; }
}

.preview-pane {
  padding: 24px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, #FBFAF6, #FFFFFF);
}
@media (max-width: 880px) {
  .preview-pane { border-right: 0; border-bottom: 1px solid var(--line); }
}

.preview-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: #111;
  box-shadow: 0 14px 32px -16px rgba(15,16,17,.4);
}
.preview-frame img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.preview-overlay {
  position: absolute; inset: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(0,0,0,0) 50%, rgba(0,0,0,.55));
  pointer-events: none;
}
.play-btn {
  width: 64px; height: 64px;
  border-radius: 999px;
  background: rgba(0,0,0,.75);
  backdrop-filter: blur(8px);
  border: 1.5px solid rgba(255,255,255,.18);
  display: grid; place-items: center;
  transition: transform .2s ease;
}
.play-btn::after {
  content: "";
  width: 0; height: 0;
  border-left: 16px solid #fff;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  margin-left: 4px;
}
.preview-frame:hover .play-btn { transform: scale(1.05); }
.preview-badge {
  position: absolute;
  top: 12px; left: 12px;
  background: rgba(0,0,0,.7);
  color: #fff;
  font-size: 11px;
  font-family: "Geist Mono", monospace;
  padding: 4px 8px;
  border-radius: 6px;
  letter-spacing: 0.02em;
}

.res-pane {
  padding: 18px 22px 22px;
}
.res-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.res-head h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-3);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.res-head .count {
  font-size: 12px;
  color: var(--ink-3);
  font-family: "Geist Mono", monospace;
}
.res-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.res-row {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 10px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: background .15s, border-color .15s;
  cursor: pointer;
}
.res-row:hover { background: var(--surface-2); border-color: var(--line); }
.res-row.is-active {
  background: var(--accent-soft);
  border-color: rgba(255,79,58,.25);
}
.res-thumb {
  width: 64px; height: 36px;
  background: var(--ink-4);
  border-radius: 6px;
  overflow: hidden;
}
.res-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.res-info { min-width: 0; }
.res-name {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}
.res-tag {
  font-family: "Geist Mono", monospace;
  font-size: 10.5px;
  color: var(--ink-3);
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.res-row.is-active .res-tag {
  background: rgba(255,79,58,.12);
  border-color: rgba(255,79,58,.2);
  color: var(--accent-ink);
}
.res-dim {
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--ink-3);
  font-family: "Geist Mono", monospace;
}
.dl-btn {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  display: grid; place-items: center;
  color: var(--ink-2);
  transition: background .15s, color .15s, border-color .15s;
}
.res-row:hover .dl-btn { color: var(--ink); border-color: var(--ink-3); }
.res-row.is-active .dl-btn {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.res-actions {
  margin-top: 14px;
  display: flex;
  gap: 8px;
}
.res-actions .btn { flex: 1; }
.res-actions a.btn { text-decoration: none; }
a.btn-primary { color: #fff; }
a.btn-accent  { color: #fff; }

/* ============ HOW IT WORKS / SECTION ============ */
.section {
  padding: 96px 0;
}
.section-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 48px;
  max-width: 720px;
}
.eyebrow {
  font-family: "Geist Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.section h2, .faq-grid h2 {
  margin: 0;
  font-size: clamp(28px, 3.6vw, 40px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.1;
  text-wrap: balance;
}
.section-sub {
  color: var(--ink-3);
  font-size: 16px;
  max-width: 540px;
  text-wrap: pretty;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 880px) {
  .steps { grid-template-columns: 1fr; }
}
.step {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
  position: relative;
  transition: border-color .2s, transform .2s;
}
.step:hover { border-color: var(--line-2); transform: translateY(-2px); }
.step-num {
  font-family: "Geist Mono", monospace;
  font-size: 12px;
  color: var(--ink-3);
  margin-bottom: 16px;
}
.step-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  color: var(--ink);
  margin-bottom: 20px;
}
.step h3 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.step p {
  margin: 0;
  color: var(--ink-3);
  font-size: 14.5px;
  line-height: 1.55;
}

/* ============ FEATURES STRIP ============ */
.features {
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}
@media (max-width: 880px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
}
.feature {
  padding: 36px 28px;
  border-right: 1px solid var(--line);
}
.feature:last-child { border-right: 0; }
@media (max-width: 880px) {
  .feature:nth-child(2n) { border-right: 0; }
  .feature:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}
.feature-icon {
  width: 28px; height: 28px;
  color: var(--accent);
  margin-bottom: 14px;
}
.feature h4 {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.005em;
}
.feature p {
  margin: 0;
  color: var(--ink-3);
  font-size: 13.5px;
  line-height: 1.55;
}

/* ============ FAQ ============ */
.faq-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 56px;
}
@media (max-width: 880px) {
  .faq-grid { grid-template-columns: 1fr; gap: 24px; }
}

/* dl-based FAQ list — works with dt/dd pairs wrapped in .faq-item div */
.faq-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line);
  margin: 0;
  padding: 0;
  list-style: none;
}
.faq-item {
  border-bottom: 1px solid var(--line);
}
.faq-item dt { margin: 0; }
.faq-item dt h3 { margin: 0; scroll-margin-top: 90px; }
.faq-item dd { margin: 0; }
.faq-q {
  width: 100%;
  background: transparent;
  border: 0;
  text-align: left;
  padding: 22px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  font-size: 16.5px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
  font-family: inherit;
  cursor: pointer;
}
.faq-q:hover { color: var(--accent); }
.faq-icon {
  width: 22px; height: 22px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: transform .2s, border-color .2s, background .2s;
  color: var(--ink-2);
}
.faq-item.is-open .faq-icon {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
  transform: rotate(45deg);
}
.faq-a {
  display: none;
  padding: 0 32px 22px 0;
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.6;
  max-width: 640px;
}
.faq-item.is-open .faq-a { display: block; }

/* Blog-post FAQ — disable article-body dropcap on first paragraph inside answers */
.article-body .faq-a p:first-child::first-letter {
  font-weight: inherit; font-size: inherit;
  float: none; line-height: inherit;
  margin: 0; color: inherit;
}
.article-body .faq-a > :last-child { margin-bottom: 0; }

/* ============ FOOTER ============ */
footer.site-footer {
  border-top: 1px solid var(--line);
  padding: 48px 0 32px;
}
/* .footer-grid / .footer-brand / .footer-col omitted — not in old design */

.footer-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  color: var(--ink-3);
  font-size: 13px;
}
.footer-bottom nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 20px; }
.footer-bottom nav a { font-size: 14px; color: var(--ink-2); transition: color .15s; }
.footer-bottom nav a:hover { color: var(--ink); }
.footer-bottom .socials {
  display: flex; gap: 6px;
}
.footer-bottom .socials a {
  width: 32px; height: 32px;
  border-radius: 8px;
  border: 1px solid var(--line);
  display: grid; place-items: center;
  color: var(--ink-2);
  transition: color .15s, border-color .15s;
}
.footer-bottom .socials a:hover { color: var(--ink); border-color: var(--ink-3); }

/* ============ BODY — NEW DESIGN PAGES ONLY ============ */
body.new-design {
  font-family: "Geist", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01","cv11";
  line-height: 1.45;
}

/* ============ SKIP LINK ============ */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 999;
  padding: 8px 16px;
  background: var(--ink);
  color: #fff;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
}
.skip-link:focus { left: 8px; }

/* ============ BACKWARD COMPAT ============ */
/* old pages used padding-top:104px for fixed nav; new nav is sticky so 0 is fine */
body.new-design .padding { padding-top: 0; }

/* ============ AJAX / TOOL ============ */
#wait { display: none; text-align: center; padding: 20px 0; }
#wait .dl-spinner {
  display: inline-block; width: 40px; height: 40px;
  border: 3px solid var(--line);
  border-top-color: var(--accent);  /* orange — matches the spinner on every other tool */
  border-radius: 50%;
  animation: dlspin .7s linear infinite;
}
@keyframes dlspin { to { transform: rotate(360deg); } }

/* visually-hidden text for screen readers (none existed before) */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
#im { width: 100%; margin-top: 32px; }

/* ============ BREADCRUMB ============ */
.breadcrumb-nav {
  padding: 12px 0 0;
  margin-bottom: 8px;
}
.breadcrumb-nav ol {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-3);
}
.breadcrumb-nav li + li::before {
  content: "›";
  margin-right: 6px;
  color: var(--ink-4);
}
.breadcrumb-nav a { color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }
.breadcrumb-nav a:hover { color: var(--ink); }

/* ============ CONTENT CARDS (educational sections on index/story) ============ */
.content-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 0;
}
.content-card p {
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.65;
  margin: 0 0 16px;
}
.content-card p:last-child { margin-bottom: 0; }
.content-card ul, .content-card ol {
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.65;
  padding-left: 20px;
  margin: 0 0 16px;
}
.content-card li { margin-bottom: 8px; }
.content-card strong { color: var(--ink); }
.content-card h1 { margin: 0 0 32px; font-size: clamp(26px,3.5vw,38px); font-weight: 600; letter-spacing: -0.025em; }
.content-card h2 { font-size: 18px; font-weight: 600; margin: 32px 0 12px; letter-spacing: -0.01em; }
.content-card a  { color: var(--accent); }

/* content card table */
.content-card table {
  border-collapse: collapse;
  width: 100%;
  margin: 16px 0;
  font-size: 14px;
}
.content-card th, .content-card td {
  border: 1px solid var(--line);
  padding: 10px 14px;
  text-align: left;
}
.content-card th {
  background: var(--surface-2);
  font-weight: 500;
  color: var(--ink);
}
.content-card td { color: var(--ink-2); }

/* ============ RELATED TOOLS ============ */
.related-tools {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
}
.related-tools h2 {
  font-size: 18px !important;
  margin: 0 0 16px !important;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.related-tools ul {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.related-tools li {
  font-size: 14.5px;
  color: var(--ink-2);
  line-height: 1.5;
}
.related-tools a {
  color: var(--ink);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--line-2);
}
.related-tools a:hover { text-decoration-color: var(--ink-3); }

/* ============ BLOG ============ */

/* Featured post */
.featured { padding: 48px 0 24px; }
.featured-card {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 48px;
  align-items: center;
}
@media (max-width: 880px) { .featured-card { grid-template-columns: 1fr; gap: 28px; } }

.featured-media {
  aspect-ratio: 7 / 4;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--surface-2);
  box-shadow: var(--shadow);
  display: block;
}
.featured-media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .5s ease;
}
.featured-card:hover .featured-media img { transform: scale(1.025); }

.featured-meta {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--ink-3);
  font-family: "Geist Mono", monospace;
  margin-bottom: 18px;
}
.featured-meta .dot {
  width: 3px; height: 3px; border-radius: 999px;
  background: var(--ink-4); display: inline-block;
}
.featured h2 {
  margin: 0 0 16px;
  font-size: clamp(28px, 3.6vw, 42px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.08;
  text-wrap: balance;
}
.featured h2 a { color: var(--ink); transition: color .15s; }
.featured h2 a:hover { color: var(--accent); }
.featured-excerpt {
  color: var(--ink-2); font-size: 16px; line-height: 1.6;
  margin: 0 0 24px; max-width: 520px;
}

/* Author row — shared by featured + post cards */
.author-row { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 36px; height: 36px; border-radius: 999px;
  background: linear-gradient(135deg, #FFB199, #FF4F3A);
  color: #fff; display: grid; place-items: center;
  font-weight: 600; font-size: 14px; flex-shrink: 0;
}
.author-name { font-size: 14px; color: var(--ink); font-weight: 500; }
.author-sub  { font-size: 13px; color: var(--ink-3); }

/* Grid section */
.grid-section { padding: 40px 0 96px; }
.grid-head {
  display: flex; align-items: baseline; gap: 16px;
  margin-bottom: 28px;
}
.grid-head h3 {
  margin: 0; font-size: 14px; font-weight: 500;
  color: var(--ink-3); font-family: "Geist Mono", monospace;
  letter-spacing: 0.04em; text-transform: uppercase;
}

/* Post grid */
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px 28px;
}
@media (max-width: 1000px) { .post-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .post-grid { grid-template-columns: 1fr; } }

/* Post card */
.post-card { display: flex; flex-direction: column; }
.post-card .media {
  /* aspect-ratio: 4 / 3; */
  aspect-ratio: 7 / 4;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface-2);
  margin-bottom: 18px;
  display: block;
}
.post-card .media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .5s ease;
}
.post-card:hover .media img { transform: scale(1.03); }
.post-meta {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-size: 12px; color: var(--ink-3);
  font-family: "Geist Mono", monospace;
  margin-bottom: 10px;
}
.dot-sep { color: var(--ink-3); }
.cat-tag {
  font-size: 11px; font-family: "Geist Mono", monospace;
  color: var(--accent); letter-spacing: 0.04em; text-transform: uppercase;
}
.post-card h4 {
  margin: 0 0 10px; font-size: 20px; font-weight: 500;
  letter-spacing: -0.015em; line-height: 1.2;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card h4 a { color: var(--ink); transition: color .15s; }
.post-card:hover h4 a { color: var(--accent); }
.post-card > p {
  margin: 0 0 16px; font-size: 14.5px; color: var(--ink-3); line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card .author-row { margin-top: auto; padding-top: 4px; }
.post-card .avatar { width: 28px; height: 28px; font-size: 12px; }

/* Blog pagination */
.blog-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  padding: 8px 0 48px;
  flex-wrap: wrap;
}
.blog-pagination a,
.blog-pagination span.ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
  border: 1px solid var(--line);
  background: var(--surface);
  text-decoration: none;
  transition: background .15s, color .15s, border-color .15s;
}
.blog-pagination a:hover { color: var(--ink); border-color: var(--ink-3); }
.blog-pagination a.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }
.blog-pagination a[aria-disabled="true"] { color: var(--ink-4); pointer-events: none; }
.blog-pagination span.ellipsis { border-color: transparent; background: transparent; color: var(--ink-3); }

/* ============ RESPONSIVE ============ */
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .hero { padding: 48px 0 32px; }
  .section { padding: 56px 0; }
  .url-form { flex-wrap: wrap; }
  .url-form .btn-accent { width: 100%; justify-content: center; }
  footer.site-footer { padding: 32px 0 24px; }
  /* post-grid responsive handled in blog section above */
}

/* ============ POST PAGE ============ */

.wrap-narrow { max-width: 760px; margin: 0 auto; padding: 0 32px; }

/* Reading progress bar */
.progress-bar {
  position: fixed; top: 0; left: 0; right: 0;
  height: 2px; background: transparent; z-index: 60; pointer-events: none;
}
.progress-bar .fill {
  height: 100%; width: 0%;
  background: var(--accent); transition: width .1s linear;
}

/* Article header */
.article-head { padding: 64px 0 40px; }
.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13.5px; color: var(--ink-3);
  padding: 6px 10px 6px 6px; border-radius: 8px; margin-bottom: 28px;
  transition: color .15s, background .15s;
}
.back-link:hover { color: var(--ink); background: var(--surface-2); }

.article-meta {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--ink-3);
  font-family: "Geist Mono", monospace; margin-bottom: 22px;
}
.article-meta .cat { color: var(--accent); }
.article-meta .dot { width: 3px; height: 3px; border-radius: 999px; background: var(--ink-4); }

h1.article-title {
  margin: 0 0 24px;
  font-size: clamp(38px, 5.2vw, 60px);
  font-weight: 600; letter-spacing: -0.035em; line-height: 1.04; text-wrap: balance;
}
.article-standfirst {
  font-family: var(--serif);
  font-size: 21px; font-weight: 400; line-height: 1.5;
  color: var(--ink-2); margin: 0 0 36px; max-width: 660px; text-wrap: pretty;
}

/* Byline + share */
.byline {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 18px 0;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.byline-left { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 40px; height: 40px; border-radius: 999px;
  background: linear-gradient(135deg, #FFB199, #FF4F3A);
  color: #fff; display: grid; place-items: center;
  font-weight: 600; font-size: 14px; flex-shrink: 0;
}
.author-name { font-size: 14.5px; color: var(--ink); font-weight: 500; }
.author-sub { font-size: 13px; color: var(--ink-3); margin-top: 2px; }

.share-row { display: flex; align-items: center; gap: 6px; }
.share-row .label {
  font-size: 12px; color: var(--ink-3); margin-right: 4px;
  font-family: "Geist Mono", monospace;
  letter-spacing: 0.04em; text-transform: uppercase;
}
.icon-btn {
  width: 34px; height: 34px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface);
  display: grid; place-items: center; color: var(--ink-2);
  transition: color .15s, border-color .15s;
  cursor: pointer;
}
.icon-btn:hover { color: var(--ink); border-color: var(--ink-3); }

/* Hero image */
.hero-image { margin: 0 0 56px; }
.hero-image figure { margin: 0; }
.hero-image .frame {
  aspect-ratio: 16 / 9; border-radius: var(--radius-xl);
  overflow: hidden; background: var(--surface-2); box-shadow: var(--shadow);
}
.hero-image .frame img { width: 100%; height: 100%; object-fit: cover; }
.hero-image figcaption {
  margin-top: 14px; font-size: 13px; color: var(--ink-3);
  text-align: center; font-family: var(--serif); font-style: italic;
}

/* Article body wrapper — same centering as .wrap-narrow */
.post-body-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 32px 80px;
}

/* TOC sidebar — fixed to right of centered article on wide screens */
.toc-sidebar {
  display: none;
  padding: 18px 0;
  transition: opacity .2s ease;
}
@media (min-width: 1340px) {
  .toc-sidebar {
    display: block;
    position: fixed;
    top: 88px;
    left: calc(50% + 396px); /* right edge of centered 760px article + 16px gap */
    width: 220px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    opacity: 0;
    pointer-events: none;
  }
  .toc-sidebar.is-visible {
    opacity: 1;
    pointer-events: auto;
  }
}
.toc-sidebar .toc-heading {
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--ink-2); margin: 0 0 12px;
  font-family: "Geist Mono", monospace;
}
.toc-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 0;
  border-left: 2px solid var(--line);
}
.toc-list li.toc-h3 { padding-left: 12px; }
.toc-link {
  display: block; font-size: 13px; color: var(--ink-3);
  padding: 4px 8px 4px 14px;
  margin-left: -2px;
  border-left: 2px solid transparent;
  line-height: 1.45;
  transition: color .15s, border-color .15s;
}
.toc-link:hover { color: var(--ink); }
.toc-link.is-active { color: var(--accent); border-left-color: var(--accent); font-weight: 500; }

/* Article body typography */
.article-body {
  font-family: var(--serif);
  font-size: 19px; line-height: 1.72; color: var(--ink);
}
.article-body p { margin: 0 0 1.4em; text-wrap: pretty; }
.article-body p:first-child::first-letter {
  font-weight: 600; font-size: 3.4em;
  float: left; line-height: 0.88;
  margin: 0.08em 0.08em 0 0; color: var(--ink);
}
.article-body a {
  color: var(--ink); text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1.5px; text-underline-offset: 4px;
}
.article-body a:hover { color: var(--accent); }
.article-body h2 {
  font-family: "Geist", sans-serif;
  margin: 2.2em 0 0.5em; font-size: 30px;
  font-weight: 600; letter-spacing: -0.025em; line-height: 1.15;
}
.article-body h3 {
  font-family: "Geist", sans-serif;
  margin: 1.8em 0 0.4em; font-size: 22px;
  font-weight: 600; letter-spacing: -0.015em; line-height: 1.2;
}
.article-body strong { font-weight: 600; }
.article-body em { font-style: italic; }
.article-body ul, .article-body ol { margin: 0 0 1.4em; padding-left: 24px; }
.article-body li { margin-bottom: 0.5em; }
.article-body ul li::marker { color: var(--accent); }
.article-body blockquote {
  margin: 2em 0; padding: 0 0 0 28px;
  border-left: 3px solid var(--accent);
  font-style: italic; font-size: 22px; line-height: 1.5; color: var(--ink-2);
}
.article-body blockquote cite {
  display: block; margin-top: 10px; font-style: normal;
  font-family: "Geist", sans-serif; font-size: 13px;
  color: var(--ink-3); letter-spacing: 0.02em;
}
.article-body code {
  font-family: "Geist Mono", monospace; font-size: 0.86em;
  background: var(--surface-2); border: 1px solid var(--line);
  padding: 1px 6px; border-radius: 5px; color: var(--ink);
}
.article-body table {
  width: 100%; border-collapse: collapse;
  margin: 1.6em 0; font-size: 0.93em;
  display: block; overflow-x: auto;
}
.article-body thead tr {
  border-bottom: 2px solid var(--line);
}
.article-body th {
  text-align: left; padding: 0.5rem 0.75rem;
  font-family: "Geist", sans-serif; font-weight: 600;
  color: var(--ink-2); font-size: 0.8em; letter-spacing: 0.04em;
  text-transform: uppercase;
}
.article-body tbody tr { border-bottom: 1px solid var(--line); }
.article-body tbody tr:last-child { border-bottom: none; }
.article-body td {
  padding: 0.55rem 0.75rem; vertical-align: top;
}
.article-body img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 2em auto;
  border-radius: var(--radius-lg);
}

/* Inline figure + callout */
.article-figure { margin: 2.4em 0; }
.article-figure .frame {
  aspect-ratio: 16 / 10; border-radius: var(--radius-lg);
  overflow: hidden; background: var(--surface-2);
}
.article-figure .frame img { width: 100%; height: 100%; object-fit: cover; }
.article-figure figcaption {
  margin-top: 12px; font-size: 13.5px; color: var(--ink-3);
  text-align: center; font-style: italic;
}

.callout {
  margin: 2em 0; padding: 22px 24px;
  background: var(--accent-soft);
  border: 1px solid rgba(255,79,58,.18);
  border-radius: var(--radius-lg);
  font-family: "Geist", sans-serif; font-size: 15px; line-height: 1.6; color: var(--ink-2);
}
.callout strong {
  color: var(--ink); display: block; margin-bottom: 4px;
  font-weight: 600; font-size: 13px;
  letter-spacing: 0.04em; text-transform: uppercase;
}

/* Post footer — author card */
.post-footer { border-top: 1px solid var(--line); padding: 40px 0; }

.author-card {
  display: grid; grid-template-columns: 56px 1fr;
  gap: 18px; align-items: start;
  padding: 24px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
}
.author-card .avatar { width: 56px; height: 56px; font-size: 18px; }
.author-card-name {
  font-family: "Geist", sans-serif; font-size: 16px;
  font-weight: 500; margin: 0 0 4px; letter-spacing: -0.01em;
}
.author-card-bio {
  font-family: "Geist", sans-serif; font-size: 14px;
  color: var(--ink-3); line-height: 1.5; margin: 0;
}

/* Related posts */
.related {
  padding: 64px 0 96px; border-top: 1px solid var(--line);
  background: linear-gradient(180deg, var(--bg), #F6F4ED);
}
.related-heading {
  margin: 0 0 28px; font-size: 22px; font-weight: 600;
  color: var(--ink); letter-spacing: -0.02em; line-height: 1.2;
}
.related-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px;
}
@media (max-width: 720px) { .related-grid { grid-template-columns: 1fr; } }

.related-card {
  display: grid; grid-template-columns: 140px 1fr;
  gap: 20px; align-items: start;
  padding: 20px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  transition: border-color .15s, transform .15s;
}
.related-card:hover { border-color: var(--line-2); transform: translateY(-2px); }
@media (max-width: 480px) { .related-card { grid-template-columns: 1fr; } }
.related-media {
  aspect-ratio: 4 / 3; border-radius: var(--radius);
  overflow: hidden; background: var(--surface-2); display: block;
}
.related-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.related-card:hover .related-media img { transform: scale(1.04); }
.related-meta {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-size: 12px; color: var(--ink-3);
  font-family: "Geist Mono", monospace; margin-bottom: 8px;
}
.related-card h3 {
  margin: 0 0 8px; font-size: 16px; font-weight: 500;
  letter-spacing: -0.01em; line-height: 1.3; color: var(--ink);
}
.related-card h3 a { color: inherit; transition: color .15s; }
.related-card:hover h3 a { color: var(--accent); }
.related-excerpt {
  margin: 0; font-size: 13px; color: var(--ink-3); line-height: 1.5;
}

@media (max-width: 640px) {
  .wrap-narrow { padding: 0 16px; }
  .article-head { padding: 40px 0 28px; }
  .post-body-wrap { padding: 0 16px 56px; }
  .article-body { font-size: 17px; }
  .article-standfirst { font-size: 18px; }
}

/* ── Resizer Tool ────────────────────────────────────────── */
.resizer-tool { display: flex; flex-direction: column; gap: 16px; margin-top: 24px; }

.upload-zone {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 40px 24px; border: 2px dashed var(--line);
  border-radius: var(--radius-lg); background: var(--surface); cursor: pointer;
  transition: border-color .2s, background .2s; text-align: center; color: var(--ink-2);
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--accent); background: var(--accent-soft);
}
.upload-zone strong { color: var(--ink); font-size: 15px; }
.upload-zone span { font-size: 13px; color: var(--ink-3); }

.preset-bar { display: flex; flex-wrap: wrap; gap: 8px; }
.preset-btn {
  flex: 1; min-width: 130px; padding: 10px 14px; border: 1.5px solid var(--line);
  border-radius: var(--radius); background: var(--surface); cursor: pointer;
  font-size: 13px; text-align: center; transition: border-color .2s, background .2s;
  font-family: inherit; color: var(--ink-2); line-height: 1.4;
}
.preset-btn small { color: var(--ink-4); font-size: 11px; }
.preset-btn.is-active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.preset-btn.is-active small { color: var(--accent-ink); }

.custom-dims { display: flex; align-items: center; gap: 10px; }
.custom-dims input {
  width: 110px; padding: 8px 12px; border: 1.5px solid var(--line);
  border-radius: var(--radius); font-size: 14px; background: var(--surface);
  color: var(--ink); font-family: inherit;
}
.custom-dims input:focus { outline: 2px solid var(--accent); outline-offset: 2px; border-color: transparent; }
.custom-dims span { color: var(--ink-3); font-weight: 500; }

.resize-info { font-size: 13px; color: var(--ink-3); font-family: "Geist Mono", monospace; padding: 8px 12px; background: var(--surface-2); border-radius: var(--radius); }

.output-options { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }

.format-toggle { display: flex; gap: 4px; }
.fmt-btn {
  padding: 7px 18px; border: 1.5px solid var(--line); border-radius: var(--radius);
  background: var(--surface); cursor: pointer; font-size: 13px; transition: .15s;
  font-family: inherit; color: var(--ink-2); font-weight: 500;
}
.fmt-btn.is-active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }

.quality-row {
  display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-2);
  cursor: default;
}
.quality-row input[type=range] { width: 120px; accent-color: var(--accent); }

@media (max-width: 640px) {
  .preset-btn { min-width: 140px; }
  .upload-zone { padding: 32px 16px; }
}

/* Download unavailable toast */
.dl-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 12px 20px;
  font-size: 14px;
  color: var(--ink);
  box-shadow: 0 4px 20px rgba(0,0,0,.13);
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 9999;
  white-space: nowrap;
  animation: dl-toast-in .2s ease;
}
@keyframes dl-toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.dl-btn[disabled] { opacity: .35; cursor: not-allowed; pointer-events: none; }

/* ── Ad slots ── */
.ad-wrap {
  margin: 1.5rem auto;
  text-align: center;
  min-height: 100px;
}
/* Above/below-input ad slots match the 680px input field and reserve the
   680×100 banner height so the ad loading causes zero layout shift (CLS). */
.ad-slot-above-input,
.ad-slot-below-input {
  max-width: 680px;
  height: 100px;
}
