/* =====================================================================
   LEARNAN LIGHT - GLOBAL DESIGN SYSTEM
   One stylesheet for every page. Source: ll-cms/templates/partials/site.css
   The CMS build copies it to /assets/css/ll.css?v=<hash>. Edit it here, then click
   "Rebuild site files" in /admin (or run php tools/build.php).
   Sections: 1 tokens - 2 base - 3 layout - 4 buttons - 5 header - 6 footer - 7 badges & cards
             8 products - 9 article template - 10 article content blocks - 11 shared sections
             12 responsive
   ===================================================================== */

/* ---------- 1. Tokens ---------- */
:root {
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --text-xs: 0.75rem; --text-sm: 0.875rem; --text-base: 1rem; --text-lg: 1.125rem;
  --text-xl: 1.375rem; --text-2xl: 1.75rem;
  --text-3xl: clamp(1.9rem, 1.4rem + 2vw, 2.5rem);
  --text-hero: clamp(2rem, 1.4rem + 2.6vw, 3rem);
  --leading-tight: 1.15; --leading-normal: 1.65; --tracking-tight: -0.02em;

  --primary: #be123c; --primary-hover: #9f1239; --primary-soft: #ffe4e9;   /* rose-700: 6.3:1 on white (WCAG AA) */

  --bg: #ffffff; --bg-alt: #f8fafc; --surface: #ffffff; --surface-2: #f1f5f9;
  --border: #e2e8f0; --text: #0f172a; --text-muted: #475569; --text-faint: #64748b;
  --ink: #0b1220; --on-ink: #f8fafc;
  --ok: #047857; --warn: #b45309; --info: #1d4ed8;

  --sp-1: 0.25rem; --sp-2: 0.5rem; --sp-3: 0.75rem; --sp-4: 1rem; --sp-5: 1.25rem;
  --sp-6: 1.5rem; --sp-8: 2rem; --sp-10: 2.5rem; --sp-12: 3rem; --sp-16: 4rem; --sp-20: 5rem;

  --radius-sm: 8px; --radius-md: 12px; --radius-lg: 16px; --radius-xl: 24px; --radius-full: 999px;

  --shadow-sm: 0 1px 2px rgb(15 23 42 / 0.06);
  --shadow-md: 0 4px 12px rgb(15 23 42 / 0.08);
  --shadow-lg: 0 12px 32px rgb(15 23 42 / 0.12);

  --container: 1200px;
  --header-h: 68px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1); --dur: 0.25s;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0b1220; --bg-alt: #0f172a; --surface: #111a2e; --surface-2: #1e293b;
  --border: #253248; --text: #f1f5f9; --text-muted: #cbd5e1; --text-faint: #94a3b8;
  --primary: #fb7185; --primary-hover: #fda4af; --primary-soft: rgb(251 113 133 / 0.14);   /* rose-400 on dark: 7:1 */
  --ok: #6ee7b7; --warn: #fbbf24; --info: #93c5fd;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
  --shadow-md: 0 4px 12px rgb(0 0 0 / 0.45);
  --shadow-lg: 0 12px 32px rgb(0 0 0 / 0.5);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #0b1220; --bg-alt: #0f172a; --surface: #111a2e; --surface-2: #1e293b;
    --border: #253248; --text: #f1f5f9; --text-muted: #cbd5e1; --text-faint: #94a3b8;
    --primary: #fb7185; --primary-hover: #fda4af; --primary-soft: rgb(251 113 133 / 0.14);   /* rose-400 on dark: 7:1 */
    --ok: #6ee7b7; --warn: #fbbf24; --info: #93c5fd;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
    --shadow-md: 0 4px 12px rgb(0 0 0 / 0.45);
    --shadow-lg: 0 12px 32px rgb(0 0 0 / 0.5);
    color-scheme: dark;
  }
}

/* Dark mode: elements with a primary background use dark text for contrast */
[data-theme="dark"] :is(.btn-primary, .btn-primary:hover, .skip-link, .filter-btn.active, .chip[aria-pressed="true"], .page-number.active, .page-number[aria-current], .product-badge, .chip.active) { color: #0b1220; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) :is(.btn-primary, .btn-primary:hover, .skip-link, .filter-btn.active, .chip[aria-pressed="true"], .page-number.active, .page-number[aria-current], .product-badge, .chip.active) { color: #0b1220; }
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans); font-size: var(--text-base);
  line-height: var(--leading-normal); color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img, svg, video { display: block; max-width: 100%; height: auto; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { line-height: var(--leading-tight); letter-spacing: var(--tracking-tight); font-weight: 700; text-wrap: balance; color: var(--text); }
h1 { font-size: var(--text-hero); font-weight: 800; }
h2 { font-size: var(--text-3xl); }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; border-radius: var(--radius-sm); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; top: -100%; left: var(--sp-4); z-index: 100; background: var(--primary); color: #fff; padding: var(--sp-3) var(--sp-6); border-radius: 0 0 var(--radius-md) var(--radius-md); font-weight: 600; }
.skip-link:focus { top: 0; }

/* ---------- 3. Layout ---------- */
.container { max-width: var(--container); margin-inline: auto; padding-inline: var(--sp-6); }
/* Hero and article share one width so their left edges line up: 720px text + 64px gap + 240px sidebar */
.container-narrow { max-width: calc(1024px + 2 * var(--sp-6)); margin-inline: auto; padding-inline: var(--sp-6); }

/* ---------- 4. Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: 44px; padding: 0.75rem 1.5rem; border-radius: var(--radius-full);
  font-weight: 600; font-size: var(--text-sm); line-height: 1;
  border: 1px solid transparent; text-decoration: none; cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease),
              border-color var(--dur) var(--ease), transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.btn-sm { min-height: 38px; padding: 0.5rem 1.1rem; }
.btn-lg { min-height: 50px; padding: 0.9rem 1.6rem; font-size: var(--text-base); }
.btn-block { width: 100%; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--primary-hover); box-shadow: var(--shadow-md); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }
.btn-ghost { background: transparent; color: var(--primary); padding-inline: var(--sp-2); min-height: 0; }
.btn-inverse { background: #fff; color: var(--ink); }
.btn-inverse:hover { background: var(--primary-soft); color: var(--ink); }
.btn-ghost-light { background: transparent; color: #fff; border-color: rgb(255 255 255 / 0.35); }
.btn-ghost-light:hover { border-color: #fff; color: #fff; }

/* ---------- 5. Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.site-header.is-scrolled { border-bottom-color: var(--border); box-shadow: var(--shadow-sm); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-6); height: var(--header-h); }
.logo { display: inline-flex; align-items: center; gap: 0.15em; font-size: var(--text-xl); font-weight: 800; color: var(--text); letter-spacing: var(--tracking-tight); white-space: nowrap; }
.logo span { color: var(--primary); }
.logo:hover { text-decoration: none; }
.nav-menu { display: flex; align-items: center; gap: var(--sp-2); list-style: none; padding: 0; }
.nav-menu > li { position: relative; display: flex; align-items: center; }
.nav-link { display: inline-flex; align-items: center; padding: 0.55rem 0.8rem; border-radius: var(--radius-full); color: var(--text-muted); font-weight: 500; font-size: var(--text-sm); }
.nav-link:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav-link[aria-current="page"] { color: var(--primary); font-weight: 600; }
.sub-toggle { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; margin-left: -0.45rem; padding: 0; border: 0; border-radius: var(--radius-full); background: transparent; color: var(--text-faint); }
.sub-toggle:hover { color: var(--text); background: var(--surface-2); }
.sub-toggle svg { transition: transform var(--dur) var(--ease); }
.sub-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.sub-menu {
  position: absolute; top: calc(100% + 10px); left: -8px; z-index: 60;
  min-width: 280px; padding: var(--sp-2); list-style: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  display: none;
}
.sub-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -12px; height: 12px; }   /* hover bridge */
.has-sub.is-open > .sub-menu { display: block; }
@media (hover: hover) and (min-width: 961px) {
  .has-sub:hover > .sub-menu { display: block; }
}
.sub-menu a { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); padding: 0.6rem 0.8rem; border-radius: var(--radius-sm); color: var(--text); font-size: var(--text-sm); font-weight: 500; }
.sub-menu a:hover { background: var(--surface-2); text-decoration: none; color: var(--primary); }
.sub-menu a[aria-current="page"] { color: var(--primary); }
.sub-menu .count { color: var(--text-faint); font-size: var(--text-xs); font-weight: 600; }
.sub-menu .sub-all { margin-top: var(--sp-1); border-top: 1px solid var(--border); border-radius: 0 0 var(--radius-sm) var(--radius-sm); padding-top: 0.7rem; color: var(--primary); font-weight: 600; }
.header-actions { display: flex; align-items: center; gap: var(--sp-3); }
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: var(--radius-full); background: transparent; border: 1px solid var(--border); color: var(--text-muted); }
.theme-toggle:hover { background: var(--surface-2); color: var(--text); }
.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .theme-toggle .icon-sun { display: none; }
  :root:not([data-theme]) .theme-toggle .icon-moon { display: block; }
}
.mobile-menu-toggle { display: none; flex-direction: column; justify-content: center; gap: 5px; width: 44px; height: 44px; background: none; border: 0; padding: 10px; border-radius: var(--radius-sm); }
.mobile-menu-toggle span { width: 24px; height: 2px; background: var(--text); border-radius: 2px; transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease); }
.mobile-menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mobile-menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.mobile-menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- 6. Footer ---------- */
.site-footer { background: var(--bg-alt); border-top: 1px solid var(--border); padding-block: var(--sp-16) var(--sp-8); }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: var(--sp-10); }
.footer-logo { font-size: var(--text-lg); margin-bottom: var(--sp-3); }
.footer-brand > p { color: var(--text-muted); font-size: var(--text-sm); max-width: 36ch; }
.footer-brand .footer-contact { margin-top: var(--sp-3); }
.footer-col h2 { font-size: var(--text-sm); text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-faint); margin-bottom: var(--sp-4); font-weight: 700; }
.footer-col ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: var(--sp-3); }
.footer-col ul a { color: var(--text-muted); font-size: var(--text-sm); }
.footer-col ul a:hover { color: var(--primary); }
.social-links { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-top: var(--sp-5); }
.social-links a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: var(--radius-full);
  border: 1px solid var(--border); color: var(--text-muted);
  transition: color var(--dur), border-color var(--dur), background var(--dur);
}
.social-links a:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-soft); }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--sp-3); margin-top: var(--sp-12); padding-top: var(--sp-6); border-top: 1px solid var(--border); color: var(--text-faint); font-size: var(--text-sm); }
.footer-bottom a { color: var(--text-faint); }
.footer-bottom a:hover { color: var(--primary); }

/* ---------- 7. Badges and cards ---------- */
.badge-row { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.category-badge { padding: 0.2rem 0.7rem; border-radius: var(--radius-full); font-size: var(--text-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; }
.badge-ai { background: var(--primary-soft); color: #be123c; }
.badge-web { background: rgb(37 99 235 / 0.12); color: #1d4ed8; }
.badge-mobile { background: rgb(5 150 105 / 0.12); color: #047857; }
.badge-design { background: rgb(147 51 234 / 0.12); color: #7e22ce; }
.badge-other { background: var(--surface-2); color: var(--text-muted); }
.badge-api { background: var(--surface-2); color: var(--text-muted); border: 1px dashed var(--text-faint); }
[data-theme="dark"] .badge-ai { color: #fda4af; }
[data-theme="dark"] .badge-web { color: #93c5fd; }
[data-theme="dark"] .badge-mobile { color: #6ee7b7; }
[data-theme="dark"] .badge-design { color: #d8b4fe; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .badge-ai { color: #fda4af; }
  :root:not([data-theme]) .badge-web { color: #93c5fd; }
  :root:not([data-theme]) .badge-mobile { color: #6ee7b7; }
  :root:not([data-theme]) .badge-design { color: #d8b4fe; }
}
a.badge-link { text-decoration: none; transition: filter var(--dur) var(--ease); }
a.badge-link:hover { filter: brightness(0.95); text-decoration: underline; }
.type-tag { margin-left: auto; font-size: var(--text-xs); font-weight: 600; color: var(--text-faint); }
.eyebrow { display: inline-block; padding: 0.3rem 0.9rem; margin-bottom: var(--sp-4); border-radius: var(--radius-full); background: var(--primary-soft); color: var(--primary); font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }

.resources-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: var(--sp-6); }
.resource-card {
  position: relative; display: flex;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.resource-card[hidden] { display: none; }
.resource-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); }
.resource-card:focus-within { border-color: var(--primary); }
.card-link { display: flex; flex-direction: column; width: 100%; color: inherit; text-decoration: none; }
.card-link:hover { text-decoration: none; }
.card-link:focus-visible { outline-offset: -3px; border-radius: var(--radius-lg); }
.resource-img { aspect-ratio: 16 / 9; background: var(--surface-2); overflow: hidden; border-bottom: 1px solid var(--border); }
.resource-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s var(--ease); }
.resource-card:hover .resource-img img { transform: scale(1.03); }
.resource-content { display: flex; flex-direction: column; flex: 1; padding: var(--sp-6); }
.resource-content h3 { font-size: var(--text-lg); margin-top: var(--sp-3); color: var(--text); transition: color var(--dur); }
.resource-card:hover h3 { color: var(--primary); }
.resource-desc {
  margin-top: var(--sp-2); color: var(--text-muted); font-size: var(--text-sm);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-cta { display: inline-flex; align-items: center; gap: var(--sp-1); margin-top: auto; padding-top: var(--sp-4); color: var(--primary); font-size: var(--text-sm); font-weight: 600; }
.card-cta svg { transition: transform var(--dur) var(--ease); }
.resource-card:hover .card-cta svg { transform: translateX(3px); }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-top: auto; padding-top: var(--sp-4); color: var(--text-faint); font-size: var(--text-xs); }
.card-foot .card-cta { margin-top: 0; padding-top: 0; }
.category-marker { grid-column: 1 / -1; }

/* ---------- 8. Products ---------- */
.fp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-6); }
.fp-grid.fp-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.product-card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow-sm);
  transition: box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.product-card:hover { box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); }
.product-img { display: block; background: var(--ink); aspect-ratio: 16 / 9; overflow: hidden; border-bottom: 1px solid var(--border); }
.product-img img { width: 100%; height: 100%; object-fit: cover; }
.product-body { display: flex; flex-direction: column; flex: 1; padding: var(--sp-6); }
.product-eyebrow { font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-faint); }
.price-tag { margin-left: auto; padding: 0.2rem 0.7rem; border-radius: var(--radius-full); background: var(--ink); color: var(--on-ink); font-size: var(--text-sm); font-weight: 700; }
.price-tag.is-free { background: rgb(5 150 105 / 0.12); color: #047857; }
[data-theme="dark"] .price-tag { background: var(--surface-2); }
[data-theme="dark"] .price-tag.is-free { color: #6ee7b7; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .price-tag { background: var(--surface-2); }
  :root:not([data-theme]) .price-tag.is-free { color: #6ee7b7; }
}
.product-body h3 { margin-top: var(--sp-3); font-size: var(--text-lg); }
.product-body h3 a { color: var(--text); }
.product-body h3 a:hover { color: var(--primary); }
.product-body > p { margin-top: var(--sp-2); color: var(--text-muted); font-size: var(--text-sm); }
.product-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-4); margin-top: auto; padding-top: var(--sp-6); }
.product-note { color: var(--text-faint); font-size: var(--text-xs); }

/* ---------- 9. Article template ---------- */
.article-hero { position: relative; overflow: hidden; isolation: isolate; padding-block: var(--sp-12) var(--sp-8); }
.article-hero-bg {
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(600px 300px at 15% 0%, var(--primary-soft), transparent 70%),
    radial-gradient(500px 300px at 90% 10%, color-mix(in srgb, var(--primary) 8%, transparent), transparent 70%);
}
.breadcrumbs { display: flex; flex-wrap: wrap; gap: var(--sp-2); list-style: none; padding: 0; margin-bottom: var(--sp-6); font-size: var(--text-sm); color: var(--text-faint); }
.breadcrumbs a { color: var(--text-faint); }
.breadcrumbs a:hover { color: var(--primary); }
.breadcrumbs li + li::before { content: "/"; margin-right: var(--sp-2); color: var(--text-faint); }
.breadcrumbs li[aria-hidden="true"] { display: none; }   /* pages that write the "/" separators themselves */
.breadcrumbs [aria-current] { color: var(--text-muted); }
.article-hero h1 { margin-top: var(--sp-4); max-width: 24ch; }
.lede { margin-top: var(--sp-4); max-width: 62ch; color: var(--text-muted); font-size: var(--text-lg); }
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-4); margin-top: var(--sp-6); color: var(--text-faint); font-size: var(--text-sm); }
.article-meta strong { color: var(--text); font-weight: 600; }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-top: var(--sp-8); }
.article-cover { margin-top: var(--sp-8); border-radius: var(--radius-xl); overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow-md); background: var(--surface-2); aspect-ratio: 16 / 9; }
.article-cover img { width: 100%; height: 100%; object-fit: cover; }

.article-layout { display: grid; grid-template-columns: minmax(0, 720px) 240px; justify-content: space-between; gap: var(--sp-16); max-width: calc(1024px + 2 * var(--sp-6)); margin-inline: auto; padding-inline: var(--sp-6); margin-top: var(--sp-12); }
main > .article-layout:last-child { margin-bottom: var(--sp-16); }
.article-layout .toc { position: sticky; top: 96px; align-self: start; max-height: calc(100vh - 120px); overflow-y: auto; padding: var(--sp-6); border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.article-layout .toc h2 { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-faint); margin-bottom: var(--sp-3); }
.article-layout .toc ol { list-style: none; padding: 0; display: flex; flex-direction: column; gap: var(--sp-1); }
.article-layout .toc a { display: block; padding-block: 0.15rem; color: var(--text-muted); font-size: var(--text-sm); line-height: 1.4; }
.article-layout .toc a:hover, .article-layout .toc a.is-active { color: var(--primary); text-decoration: none; }
.article-layout .toc a.toc-cta { display: flex; margin-top: var(--sp-6); width: 100%; color: #fff; padding: 0.6rem 1rem; font-size: var(--text-sm); }
.article-layout .toc a.toc-cta:hover { color: #fff; }
.toc-inline { display: none; margin-top: var(--sp-8); padding: var(--sp-6); background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.prose .toc-inline h2 { font-size: var(--text-lg); margin: 0; }
.prose > .toc-inline:first-child { margin-top: 0; }
.prose .toc-inline a:not(.btn) { text-decoration: none; }
.prose .toc-inline a:hover { text-decoration: underline; }
.prose .toc-inline li + li { margin-top: 0; }
.toc-inline ol { margin-top: var(--sp-3); padding-left: 1.3rem; columns: 2; column-gap: var(--sp-8); font-size: var(--text-sm); }
.toc-inline li { break-inside: avoid; margin-bottom: var(--sp-2); }

/* Prose: typography for article bodies (Markdown and migrated pages) */
.prose { width: 100%; min-width: 0; max-width: 720px; font-size: 1.0625rem; line-height: 1.75; color: var(--text-muted); overflow-wrap: break-word; }
.prose section:not(:first-child) { margin-top: var(--sp-12); }
.prose > section + section { margin-top: var(--sp-16); }
.prose section { scroll-margin-top: 96px; }
.prose h2 { font-size: var(--text-2xl); margin-bottom: 0; }
.prose h3 { font-size: var(--text-xl); }
.prose h4 { font-size: var(--text-lg); }
.prose :where(p, ul, ol, dl, pre, blockquote, figure, table, details, .table-wrap, .video-embed, .compare, .block-grid, .figure-grid, .prompt-box, img) { margin-top: var(--sp-4); }
.prose :where(h2) { margin-top: var(--sp-12); }
.prose :where(h3) { margin-top: var(--sp-10); }
.prose :where(h4) { margin-top: var(--sp-6); }
.prose :where(h2, h3, h4) + * { margin-top: var(--sp-3); }
.prose :where(section, .callout, .card-block, .compare > div, li, figure, td, th, blockquote, details, .cta-band > div) > :first-child { margin-top: 0; }
.prose p { color: var(--text-muted); }
.prose :where(strong, b) { color: var(--text); font-weight: 650; }
.prose a:not(.btn):not(.share-btn):not(.badge-link) { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose :where(ul, ol) { padding-left: 1.4em; }
.prose li + li { margin-top: var(--sp-2); }
.prose li > :where(ul, ol) { margin-top: var(--sp-2); }
.prose li::marker { color: var(--primary); }
.prose ol > li::marker { font-weight: 700; }
.prose hr { margin-block: var(--sp-10); border: 0; border-top: 1px solid var(--border); }
.prose blockquote { padding: var(--sp-2) 0 var(--sp-2) var(--sp-5); border-left: 4px solid var(--primary); color: var(--text); font-style: italic; }
.prose code { padding: 0.12em 0.4em; border-radius: 6px; background: var(--surface-2); color: var(--text); font-family: var(--font-mono); font-size: 0.88em; }
.prose kbd { padding: 0.1em 0.45em; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 6px; background: var(--surface); color: var(--text); font-family: var(--font-mono); font-size: 0.85em; }
.prose pre { position: relative; padding: var(--sp-5) var(--sp-6); border-radius: var(--radius-md); background: #0b1220; color: #e2e8f0; overflow-x: auto; font-family: var(--font-mono); font-size: 0.875rem; line-height: 1.65; border: 1px solid #1e293b; }
.prose pre code { padding: 0; background: none; color: inherit; font-size: inherit; white-space: pre; }
.prose pre.has-copy { padding-top: var(--sp-10); }
.prose pre .keyword { color: #f9a8d4; } .prose pre .string { color: #86efac; } .prose pre .comment { color: #94a3b8; } .prose pre .highlight { color: #fde68a; }
.prose img { border-radius: var(--radius-md); border: 1px solid var(--border); }
.prose figure img { margin-top: 0; }
.prose figcaption, .prose .caption { margin-top: var(--sp-2); text-align: center; font-size: var(--text-sm); color: var(--text-faint); }
.prose table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); line-height: 1.55; }
.prose .table-wrap table { margin-top: 0; }
.prose th, .prose td { padding: 0.7rem 0.9rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
.prose thead th { background: var(--surface-2); color: var(--text); font-weight: 700; }
.prose tbody tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
.table-wrap:focus-visible { outline-offset: 2px; }
.prose dl dt { font-weight: 700; color: var(--text); }
.prose dl dd { margin: var(--sp-1) 0 var(--sp-3); }
.section-kicker { display: block; margin-bottom: var(--sp-2); color: var(--primary); font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }

/* ---------- 10. Article content blocks ---------- */
.callout { margin-top: var(--sp-8); padding: var(--sp-6); background: var(--bg-alt); border: 1px solid var(--border); border-left: 4px solid var(--primary); border-radius: var(--radius-md); }
.prose .callout :where(h2, h3, h4) { font-size: var(--text-lg); }
.prose .callout :where(h2, h3, h4) + * { margin-top: var(--sp-3); }
.callout-info { border-left-color: #2563eb; }
.callout-success { border-left-color: #059669; }
.callout-warning { border-left-color: #d97706; }
.callout-answer { background: var(--primary-soft); border-color: color-mix(in srgb, var(--primary) 25%, var(--border)); }
.callout-answer p { color: var(--text); }
.check-list { list-style: none; padding: 0 !important; display: grid; gap: var(--sp-3); font-size: var(--text-base); }
.check-list li { display: flex; align-items: flex-start; gap: var(--sp-3); color: var(--text-muted); line-height: 1.6; }
.prose .check-list li + li { margin-top: 0; }
.check-list li strong { color: var(--text); }
.check-list svg { flex: none; margin-top: 0.3rem; color: var(--primary); }

.feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-4); margin-top: var(--sp-6); }
.feature { padding: var(--sp-6); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.feature-icon { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: var(--radius-md); background: var(--primary-soft); color: var(--primary); }
.feature h3 { margin-top: var(--sp-4); font-size: var(--text-base); }
.feature p { margin-top: var(--sp-2); font-size: var(--text-sm); line-height: 1.6; }

/* Card grids (feature, benefit, step and tool cards from migrated pages) */
.block-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: var(--sp-4); }
.block-grid:has(> :nth-child(4):last-child) { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }   /* 4 cards = 2 x 2 */
.card-block { padding: var(--sp-5) var(--sp-6); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.block-grid > .card-block { margin-top: 0; }
.prose .card-block + .card-block { margin-top: var(--sp-4); }
.block-grid > .card-block + .card-block { margin-top: 0; }
.prose .card-block :where(h3, h4) { font-size: var(--text-base); margin-top: 0; }
.prose .card-block :where(p, li) { font-size: var(--text-sm); line-height: 1.6; }
.step-num { display: inline-flex; align-items: center; justify-content: center; flex: none; min-width: 34px; height: 34px; margin-bottom: var(--sp-3); padding-inline: 0.5rem; border-radius: var(--radius-full); background: var(--primary-soft); color: var(--primary); font-weight: 800; font-size: var(--text-sm); }
.compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4); }
.compare > div { padding: var(--sp-5) var(--sp-6); background: var(--surface); border: 1px solid var(--border); border-top: 4px solid var(--text-faint); border-radius: var(--radius-md); }
.compare > .compare-bad { border-top-color: #d97706; }
.compare > .compare-good { border-top-color: #059669; }
.prose .compare :where(h3, h4) { font-size: var(--text-base); }
.prose .compare li { font-size: var(--text-sm); }
.video-embed { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius-lg); overflow: hidden; background: var(--ink); border: 1px solid var(--border); }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.figure-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: var(--sp-4); }
.figure-grid figure { margin-top: 0; }
.prompt-box { position: relative; padding: var(--sp-5) var(--sp-6); padding-right: 6.5rem; border: 1px dashed color-mix(in srgb, var(--primary) 45%, var(--border)); border-radius: var(--radius-md); background: var(--bg-alt); color: var(--text); font-size: var(--text-base); line-height: 1.65; white-space: pre-line; }
.copy-btn { position: absolute; top: var(--sp-3); right: var(--sp-3); display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--radius-full); background: var(--surface); color: var(--text); font-size: var(--text-xs); font-weight: 600; font-family: var(--font-sans); white-space: nowrap; }
.copy-btn:hover { border-color: var(--primary); color: var(--primary); }
.copy-btn.is-done { border-color: #059669; color: #047857; }
.prose pre .copy-btn { background: #1e293b; border-color: #334155; color: #e2e8f0; }
.prose pre .copy-btn:hover { border-color: #fda4af; color: #fff; }

.prompt-list { list-style: none; padding: 0 !important; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); margin-top: var(--sp-6); counter-reset: p; }
.prompt-list li { counter-increment: p; display: flex; align-items: center; gap: var(--sp-4); padding: var(--sp-4); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); font-weight: 600; font-size: var(--text-base); line-height: 1.35; color: var(--text); }
.prose .prompt-list li + li { margin-top: 0; }
.prompt-list li > span, .check-list li > span { min-width: 0; overflow-wrap: anywhere; }
.prompt-list li::before { content: counter(p); flex: none; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: var(--radius-full); background: var(--primary-soft); color: var(--primary); font-weight: 800; font-size: var(--text-sm); }
.tip { margin-top: var(--sp-6); font-size: var(--text-base); }

.cta-band { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: var(--sp-8); align-items: center; margin-top: var(--sp-8); padding: var(--sp-8); background: var(--ink); color: var(--on-ink); border-radius: var(--radius-xl); }
.cta-band.no-img { grid-template-columns: 1fr; }
.cta-band :where(h2, h3) { color: #fff; }
.prose .cta-band p { color: #cbd5e1; }
.prose .cta-band strong { color: #fff; }
.prose .cta-band a:not(.btn) { color: #fda4af; }
.cta-band .btn { margin-top: var(--sp-6); }
.cta-band .btn + .btn { margin-left: var(--sp-2); }
.cta-band .fine { margin-top: var(--sp-3); font-size: var(--text-sm); }
.cta-band img { border-radius: var(--radius-md); aspect-ratio: 16 / 9; object-fit: cover; width: 100%; border: 0; }
.cta-band :focus-visible { outline-color: #fff; }

.faq { display: grid; gap: var(--sp-3); }
.faq details { margin-top: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); padding: var(--sp-4) var(--sp-6); cursor: pointer; font-weight: 600; color: var(--text); list-style: none; border-radius: var(--radius-md); line-height: 1.45; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex: none; font-size: 1.4rem; line-height: 1; color: var(--primary); transition: transform var(--dur) var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details > :not(summary) { padding: 0 var(--sp-6) var(--sp-4); margin-top: 0; }

.share-bar { margin-top: var(--sp-12); padding-top: var(--sp-6); border-top: 1px solid var(--border); }
.prose .share-title { font-size: var(--text-base); margin: 0 0 var(--sp-3); }
.share-list { list-style: none; margin: 0 !important; padding: 0 !important; display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.prose .share-list li { margin: 0; }
.share-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border: 1px solid var(--border); border-radius: var(--radius-full);
  background: var(--surface); color: var(--text); font: 500 var(--text-sm)/1 var(--font-sans); text-decoration: none; cursor: pointer; transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease); }
.prose a.share-btn { color: var(--text); text-decoration: none; }
.share-btn:hover { border-color: var(--primary); background: var(--primary-soft); text-decoration: none; }
.share-status { min-height: 1.4em; margin: var(--sp-2) 0 0; font-size: var(--text-sm); color: var(--text-muted); }
.aff-note, .offer-box { margin: 0 0 var(--sp-6); padding: var(--sp-4) var(--sp-5); border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-alt); font-size: var(--text-sm); color: var(--text-muted); }
.prose .aff-note p { margin: 0; font-size: var(--text-sm); }
.offer-box { border-left: 4px solid #059669; }
.offer-box ul { margin: var(--sp-2) 0; padding-left: 1.1em; }
.prose .offer-box li, .prose .offer-box p { font-size: var(--text-sm); margin-block: 2px; }
.prose .offer-state { font-weight: 700; color: var(--text); margin: 0; }
.offer-box.is-expired { border-left-color: #b45309; }
.offer-box.is-expired .offer-state { color: #b45309; }

/* "Hidden websites" style tool lists */
.prose h2.cat-head { display: flex; align-items: center; gap: var(--sp-3); }
.cat-num { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: var(--radius-md); background: var(--primary-soft); color: var(--primary); font-weight: 800; font-size: var(--text-sm); letter-spacing: 0; }
.site-list { list-style: none; padding: 0 !important; display: grid; gap: var(--sp-3); margin-top: var(--sp-6); }
.prose .site-list li + li { margin-top: 0; }
.site-card { padding: var(--sp-6); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.prose .site-card h3 { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-2) var(--sp-3); font-size: var(--text-lg); margin-top: 0; }
.site-card .n { color: var(--primary); font-weight: 800; }
.prose .site-card a.domain { font-family: var(--font-mono); font-size: var(--text-sm); font-weight: 600; text-decoration: none; padding: 0.1rem 0.5rem; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--primary); }
.prose .site-card a.domain:hover { text-decoration: underline; }
.site-card p { margin-top: var(--sp-2); font-size: var(--text-base); }
.prose .site-card p.best { margin-top: var(--sp-3); font-size: var(--text-sm); color: var(--text-faint); }
.site-card .best strong { color: var(--text-muted); }
.cat-note { margin-top: var(--sp-4); padding: var(--sp-3) var(--sp-4); border-left: 3px solid var(--primary); background: var(--bg-alt); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: var(--text-sm); }
.note-box { margin-top: var(--sp-12); padding: var(--sp-4) var(--sp-6); background: var(--primary-soft); border-radius: var(--radius-md); font-size: var(--text-sm); color: var(--text); line-height: 1.6; }
/* ChatGPT shortcuts article */
.sc-list { list-style: none; padding: 0 !important; display: grid; gap: var(--sp-3); }
.sc-card { padding: var(--sp-5) var(--sp-6); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.prose .sc-list li + li { margin-top: 0; }
.sc-card .cmd { font-family: var(--font-mono); font-weight: 700; color: var(--primary); }
.sc-card .try { font-size: var(--text-sm); color: var(--text-faint); }
.copy-box { position: relative; margin-top: var(--sp-6); padding: var(--sp-5) var(--sp-6); border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-alt); }
.copy-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.copy-box .copy-btn { position: static; }
.prose .copy-box pre { margin-top: var(--sp-3); white-space: pre-wrap; }
.prose .copy-box pre code { white-space: pre-wrap; }

/* ---------- 11. Shared page sections ---------- */
.page-band { margin-top: var(--sp-20); padding-block: var(--sp-16); background: var(--bg-alt); border-top: 1px solid var(--border); }
.page-band + .page-band { margin-top: 0; padding-top: 0; border-top: 0; }
.band-head { max-width: 640px; margin: 0 auto var(--sp-8); text-align: center; }
.band-head p { margin-top: var(--sp-3); color: var(--text-muted); }
.related-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-6); }
.explore-links { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--sp-3); margin-top: var(--sp-8); }
.newsletter-block { padding: var(--sp-12) var(--sp-8); text-align: center; background: var(--ink); color: var(--on-ink); border-radius: var(--radius-xl); }
.newsletter-block h2 { color: #fff; font-size: var(--text-2xl); }
.newsletter-block > p { max-width: 52ch; margin: var(--sp-3) auto 0; color: #cbd5e1; }
.newsletter-form { display: flex; gap: var(--sp-2); max-width: 460px; margin: var(--sp-6) auto 0; }
.newsletter-form input { flex: 1; min-width: 0; min-height: 46px; padding: 0.7rem 1.1rem; border-radius: var(--radius-full); border: 1px solid #334155; background: #0f172a; color: #fff; font: inherit; font-size: var(--text-sm); }
.newsletter-form input::placeholder { color: #94a3b8; }
.newsletter-form input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 40%, transparent); }
.newsletter-block :focus-visible { outline-color: #fff; }
.newsletter-status { min-height: 1.5em; margin-top: var(--sp-3); color: #a7f3d0; font-size: var(--text-sm); }
.newsletter-status.is-error { color: #fecaca; }
.newsletter-note { margin-top: var(--sp-2); color: #94a3b8; font-size: var(--text-xs); }

/* Scroll reveal: content is always visible without JavaScript; ll.js adds the fade-in when it runs. */
.js-reveal .reveal:not(.is-visible) { opacity: 0; transform: translateY(16px); }
.reveal { transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
@media (prefers-reduced-motion: reduce) { .js-reveal .reveal:not(.is-visible) { opacity: 1; transform: none; } }

/* ---------- 12. Responsive ---------- */
@media (max-width: 1024px) {
  .article-layout { grid-template-columns: minmax(0, 1fr); max-width: calc(720px + 2 * var(--sp-6)); }
  .container-narrow { max-width: calc(720px + 2 * var(--sp-6)); }
  .article-layout .toc { display: none; }
  .toc-inline { display: block; }
  .prose { margin-inline: auto; }
  .fp-grid.fp-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 992px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .fp-grid { grid-template-columns: 1fr; max-width: 680px; margin-inline: auto; }
  .related-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 960px) {
  .header-actions .header-cta { display: none; }
  .mobile-menu-toggle { display: flex; }
  .site-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    max-height: calc(100vh - var(--header-h)); overflow-y: auto;
    background: var(--bg); border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg); display: none; padding: var(--sp-4) var(--sp-4) var(--sp-6);
  }
  .site-nav.is-open { display: block; }
  .nav-menu { flex-direction: column; align-items: stretch; gap: 0; }
  .nav-menu > li { flex-wrap: wrap; }
  .nav-link { flex: 1; padding: var(--sp-4); border-radius: var(--radius-sm); font-size: var(--text-base); }
  .sub-toggle { width: 48px; height: 48px; margin-left: 0; }
  .sub-menu { position: static; flex-basis: 100%; min-width: 0; margin: 0 0 var(--sp-2) var(--sp-4); padding: var(--sp-1) 0 var(--sp-1) var(--sp-3); border: 0; border-left: 2px solid var(--border); border-radius: 0; box-shadow: none; background: transparent; }
  .sub-menu::before { display: none; }
  .sub-menu a { padding: var(--sp-3); }
  .sub-menu .sub-all { border-top: 0; padding-top: var(--sp-3); }
}
@media (max-width: 768px) {
  .container, .container-narrow, .article-layout { padding-inline: var(--sp-4); }
  .article-hero { padding-block: var(--sp-8) var(--sp-6); }
  .lede { font-size: var(--text-base); }
  .article-cover { border-radius: var(--radius-lg); }
  .article-layout { margin-top: var(--sp-8); }
  .prose { font-size: 1rem; }
  .prose > section + section { margin-top: var(--sp-12); }
  .feature-grid, .prompt-list, .related-grid, .compare, .fp-grid.fp-3 { grid-template-columns: minmax(0, 1fr); }
  .cta-band { grid-template-columns: 1fr; padding: var(--sp-6); }
  .cta-band img { order: -1; }
  .page-band { margin-top: var(--sp-16); padding-block: var(--sp-12); }
  .newsletter-block { padding: var(--sp-8) var(--sp-6); }
  .newsletter-form { flex-direction: column; }
  .prompt-box { padding-right: var(--sp-6); padding-top: var(--sp-12); }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; gap: var(--sp-8); }
  .toc-inline ol { columns: 1; }
  .site-card { padding: var(--sp-4); }
  .hero-actions .btn, .cta-band .btn, .product-actions .btn { width: 100%; }
  .cta-band .btn + .btn { margin-left: 0; margin-top: var(--sp-2); }
  .share-btn span { font-size: var(--text-xs); }
  .logo { font-size: var(--text-lg); }
  .header-actions { gap: var(--sp-2); }
}
@media print {
  .site-header, .site-footer, .article-layout .toc, .share-bar, .page-band, .copy-btn { display: none !important; }
  .article-layout { display: block; }
  .prose { max-width: none; }
}
