/* ==========================================================================
   My AI Professor — design system
   Fonts: Fraunces (display) + Inter (text). Tokens on :root, dark mode via
   prefers-color-scheme and [data-theme].
   ========================================================================== */

:root {
  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-text: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --bg: #faf9f6;
  --bg-elev: #ffffff;
  --bg-sunken: #f1efe9;
  --ink: #15161a;
  --ink-2: #4b4f58;
  --ink-3: #7a7f8a;
  --line: #e6e3db;
  --line-strong: #d4d0c6;

  --brand: #3d3bd6;
  --brand-ink: #ffffff;
  --brand-soft: #ecebfd;
  --brand-hover: #2f2dbb;
  --accent: #e0831a;
  --accent-soft: #fdf0e0;

  --free: #15803d;
  --free-soft: #e6f6ea;
  --freemium: #1d5fd6;
  --freemium-soft: #e4edfd;
  --paid: #8a5a00;
  --paid-soft: #fbf0d6;

  --radius-s: 8px;
  --radius: 14px;
  --radius-l: 22px;
  --shadow-s: 0 1px 2px rgba(20, 20, 40, 0.05), 0 1px 1px rgba(20, 20, 40, 0.03);
  --shadow: 0 1px 2px rgba(20, 20, 40, 0.04), 0 8px 24px -12px rgba(20, 20, 40, 0.18);
  --shadow-l: 0 2px 4px rgba(20, 20, 40, 0.05), 0 24px 48px -20px rgba(20, 20, 40, 0.25);

  --max: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --nav-h: 64px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0f13;
    --bg-elev: #16181e;
    --bg-sunken: #0a0b0e;
    --ink: #eef0f4;
    --ink-2: #b4b8c2;
    --ink-3: #7e8390;
    --line: #262932;
    --line-strong: #363a46;
    --brand: #8b8cff;
    --brand-ink: #0b0b20;
    --brand-soft: #1f2040;
    --brand-hover: #a3a4ff;
    --accent: #f5a04a;
    --accent-soft: #332313;
    --free: #4ade80;
    --free-soft: #12301d;
    --freemium: #7ab0ff;
    --freemium-soft: #14233d;
    --paid: #f2c66d;
    --paid-soft: #332a12;
    --shadow-s: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
    --shadow-l: 0 2px 4px rgba(0, 0, 0, 0.5), 0 24px 48px -20px rgba(0, 0, 0, 0.7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e0f13;
  --bg-elev: #16181e;
  --bg-sunken: #0a0b0e;
  --ink: #eef0f4;
  --ink-2: #b4b8c2;
  --ink-3: #7e8390;
  --line: #262932;
  --line-strong: #363a46;
  --brand: #8b8cff;
  --brand-ink: #0b0b20;
  --brand-soft: #1f2040;
  --brand-hover: #a3a4ff;
  --accent: #f5a04a;
  --accent-soft: #332313;
  --free: #4ade80;
  --free-soft: #12301d;
  --freemium: #7ab0ff;
  --freemium-soft: #14233d;
  --paid: #f2c66d;
  --paid-soft: #332a12;
  --shadow-s: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
  --shadow-l: 0 2px 4px rgba(0, 0, 0, 0.5), 0 24px 48px -20px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-text);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; line-height: 1.15; }
h1, h2 { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.02em; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* ---------- Layout ---------- */
.wrap { width: min(var(--max), 100% - 2 * var(--gutter)); margin-inline: auto; }
.section { padding-block: clamp(48px, 8vw, 96px); }
.section-tight { padding-block: clamp(32px, 5vw, 56px); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 32px; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(28px, 3.4vw, 40px); }
.section-head p { color: var(--ink-2); max-width: 56ch; margin-top: 8px; font-size: 17px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brand); margin-bottom: 14px; }
.eyebrow::before { content: ""; width: 18px; height: 2px; background: currentColor; border-radius: 2px; }
.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.muted { color: var(--ink-2); }
.small { font-size: 14px; }
.lede { font-size: clamp(17px, 1.6vw, 20px); color: var(--ink-2); max-width: 62ch; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav .wrap { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display); font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.logo svg { width: 30px; height: 30px; }
.logo .dot { color: var(--brand); }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  padding: 8px 12px; border-radius: 999px; font-size: 14.5px; font-weight: 500; color: var(--ink-2);
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); background: var(--bg-sunken); }
.nav-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg-elev); color: var(--ink-2);
  transition: border-color 0.15s, color 0.15s, transform 0.15s;
}
.icon-btn:hover { border-color: var(--line-strong); color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; }
.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: block; }
}
.nav-links a { white-space: nowrap; }
@media (min-width: 600px) { .logo { white-space: nowrap; } }
/* small phones: the logo stays on one line; "Find a course" is also in the hero search and the menu */
@media (max-width: 479px) { .logo { white-space: nowrap; } .nav-actions > .btn { display: none; } }
.menu-btn { display: none; }
@media (max-width: 1040px) {
  .nav-links { display: none; position: absolute; top: var(--nav-h); left: 0; right: 0; flex-direction: column; align-items: stretch; padding: 12px var(--gutter) 20px; background: var(--bg-elev); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-l); }
  .nav-links a { padding: 12px 14px; border-radius: 10px; font-size: 16px; }
  .nav.open .nav-links { display: flex; }
  .menu-btn { display: inline-grid; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 999px; font-weight: 600; font-size: 15px;
  border: 1px solid transparent; white-space: nowrap;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.btn svg { width: 16px; height: 16px; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: var(--brand-ink); box-shadow: 0 1px 0 rgba(255,255,255,0.15) inset, var(--shadow-s); }
.btn-primary:hover { background: var(--brand-hover); }
.btn-secondary { background: var(--bg-elev); border-color: var(--line-strong); color: var(--ink); }
.btn-secondary:hover { border-color: var(--ink-3); }
.btn-ghost { color: var(--ink-2); padding-inline: 10px; }
.btn-ghost:hover { color: var(--ink); background: var(--bg-sunken); }
.btn-lg { padding: 14px 24px; font-size: 16px; }
.btn-sm { padding: 7px 12px; font-size: 13.5px; }
.btn-accent { background: var(--accent); color: #1a1000; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  padding-block: clamp(64px, 10vw, 128px) clamp(48px, 7vw, 96px);
  border-bottom: 1px solid var(--line);
}
.hero::before {
  content: ""; position: absolute; inset: -20% -10% auto; height: 120%;
  background:
    radial-gradient(60% 50% at 20% 20%, color-mix(in srgb, var(--brand) 22%, transparent), transparent 70%),
    radial-gradient(45% 45% at 85% 10%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 70%),
    radial-gradient(40% 40% at 60% 90%, color-mix(in srgb, var(--freemium) 12%, transparent), transparent 70%);
  filter: blur(20px); pointer-events: none; z-index: 0;
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px; opacity: 0.35;
  mask-image: radial-gradient(70% 60% at 50% 40%, #000 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(70% 60% at 50% 40%, #000 30%, transparent 100%);
}
.hero .wrap { position: relative; z-index: 1; text-align: center; }
.hero h1 { font-size: clamp(40px, 6.4vw, 76px); line-height: 1.02; letter-spacing: -0.03em; max-width: 18ch; margin-inline: auto; }
.hero h1 em { font-style: italic; color: var(--brand); }
.hero .lede { margin: 24px auto 0; }
.hero-pill { display: inline-flex; align-items: center; gap: 10px; padding: 6px 14px 6px 8px; border-radius: 999px; background: var(--bg-elev); border: 1px solid var(--line); font-size: 13.5px; font-weight: 500; color: var(--ink-2); box-shadow: var(--shadow-s); margin-bottom: 28px; }
.hero-pill b { color: var(--brand-ink); background: var(--brand); border-radius: 999px; padding: 2px 8px; font-size: 12px; font-weight: 600; white-space: nowrap; }

.search {
  margin: 36px auto 0; max-width: 680px; display: flex; align-items: center; gap: 8px;
  padding: 6px 6px 6px 18px; border-radius: 999px; background: var(--bg-elev);
  border: 1px solid var(--line-strong); box-shadow: var(--shadow);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent), var(--shadow); }
.search svg { width: 20px; height: 20px; color: var(--ink-3); flex: none; }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; font-size: 17px; padding: 10px 4px; outline: none; }
.search input::placeholder { color: var(--ink-3); }
.search .btn { flex: none; }
.hero-quick { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; }
.hero-quick span { color: var(--ink-3); font-size: 14px; padding: 6px 2px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-size: 13.5px; font-weight: 500;
  background: var(--bg-elev); border: 1px solid var(--line); color: var(--ink-2);
  transition: border-color 0.15s, color 0.15s, background 0.15s, transform 0.15s;
}
.chip:hover { border-color: var(--line-strong); color: var(--ink); transform: translateY(-1px); }
.chip[aria-pressed="true"], .chip.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.hero-stats { display: flex; justify-content: center; gap: clamp(24px, 5vw, 64px); margin-top: 48px; flex-wrap: wrap; }
.stat { text-align: center; }
.stat b { display: block; font-family: var(--font-display); font-size: clamp(28px, 3.4vw, 40px); font-weight: 500; letter-spacing: -0.02em; line-height: 1; }
.stat span { display: block; margin-top: 6px; font-size: 13.5px; color: var(--ink-3); }

/* ---------- Cards ---------- */
.card {
  position: relative; display: flex; flex-direction: column; gap: 12px;
  padding: 22px; border-radius: var(--radius); background: var(--bg-elev);
  border: 1px solid var(--line); box-shadow: var(--shadow-s);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.card-top { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.card .org { font-size: 13px; color: var(--ink-3); font-weight: 500; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.card .org .sep { opacity: 0.6; }
.card h3 { font-size: 17.5px; line-height: 1.3; }
.card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.card .desc { color: var(--ink-2); font-size: 14.5px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.card-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.card .price { font-weight: 600; font-size: 15px; }
.card .price.free { color: var(--free); }
.card-foot .ext { position: relative; z-index: 2; font-size: 13.5px; font-weight: 600; color: var(--brand); display: inline-flex; align-items: center; gap: 4px; }
.card-foot .ext svg { width: 14px; height: 14px; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; letter-spacing: 0.01em; background: var(--bg-sunken); color: var(--ink-2); border: 1px solid transparent; }
.badge-free { background: var(--free-soft); color: var(--free); }
.badge-freemium { background: var(--freemium-soft); color: var(--freemium); }
.badge-paid { background: var(--paid-soft); color: var(--paid); }
.badge-level { text-transform: capitalize; }
.badge-cert::before { content: "✓"; font-size: 11px; }

/* Category tiles */
.cat-tile {
  position: relative; display: flex; flex-direction: column; gap: 10px; padding: 22px; min-height: 180px;
  border-radius: var(--radius); background: var(--bg-elev); border: 1px solid var(--line);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.cat-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.cat-tile .ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.cat-tile .ic svg { width: 22px; height: 22px; }
.cat-tile h3 { font-size: 17px; }
.cat-tile h3 a::after { content: ""; position: absolute; inset: 0; }
.cat-tile p { color: var(--ink-2); font-size: 14px; }
.cat-tile .count { margin-top: auto; font-size: 13px; color: var(--ink-3); font-weight: 500; display: flex; justify-content: space-between; align-items: center; }
.cat-tile .count svg { width: 16px; height: 16px; transition: transform 0.2s; }
.cat-tile:hover .count svg { transform: translateX(3px); }

/* ---------- Compare (free vs premium) ---------- */
.compare { display: grid; grid-template-columns: 1fr auto 1fr; gap: 20px; align-items: stretch; }
.compare .vs { display: grid; place-items: center; font-family: var(--font-display); font-style: italic; font-size: 22px; color: var(--ink-3); }
.compare-col { padding: 24px; border-radius: var(--radius-l); background: var(--bg-elev); border: 1px solid var(--line); box-shadow: var(--shadow-s); }
.compare-col header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.compare-col header h3 { font-size: 15px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.compare-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.compare-row:first-of-type { border-top: 0; }
.compare-row .t { font-weight: 600; font-size: 15px; }
.compare-row .s { font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.compare-row .p { font-weight: 600; white-space: nowrap; text-align: right; font-size: 15px; }
@media (max-width: 760px) { .compare { grid-template-columns: 1fr; } .compare .vs { padding: 6px 0; } }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-elev); box-shadow: var(--shadow-s); }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 760px; }
thead th { text-align: left; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; padding: 14px 16px; border-bottom: 1px solid var(--line); background: var(--bg-sunken); white-space: nowrap; }
tbody td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: color-mix(in srgb, var(--bg-sunken) 60%, transparent); }
td .t { font-weight: 600; color: var(--ink); }
td .s { font-size: 13px; color: var(--ink-3); }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--ink); }
th.sortable[aria-sort="ascending"]::after { content: " ↑"; }
th.sortable[aria-sort="descending"]::after { content: " ↓"; }

/* ---------- Page header ---------- */
.page-head { padding-block: clamp(40px, 6vw, 72px) clamp(24px, 4vw, 40px); border-bottom: 1px solid var(--line); background: linear-gradient(180deg, color-mix(in srgb, var(--brand-soft) 55%, transparent), transparent); }
.page-head h1 { font-size: clamp(34px, 4.6vw, 56px); max-width: 20ch; }
.page-head .lede { margin-top: 16px; }
.crumbs { display: flex; gap: 8px; align-items: center; font-size: 13.5px; color: var(--ink-3); margin-bottom: 18px; flex-wrap: wrap; }
.crumbs a:hover { color: var(--ink); }
.crumbs span { opacity: 0.6; }
.page-head .facts { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }

/* ---------- Catalog / filters ---------- */
.catalog { display: grid; grid-template-columns: 260px 1fr; gap: 32px; align-items: start; }
.filters { position: sticky; top: calc(var(--nav-h) + 20px); display: flex; flex-direction: column; gap: 22px; }
.filter-group h4 { font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 10px; display: flex; justify-content: space-between; }
.filter-group h4 button { border: 0; background: none; color: var(--brand); font-size: 12px; text-transform: none; letter-spacing: 0; font-weight: 600; padding: 0; }
.filter-group label { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 14.5px; color: var(--ink-2); cursor: pointer; }
.filter-group label:hover { color: var(--ink); }
.filter-group input[type="checkbox"], .filter-group input[type="radio"] { width: 16px; height: 16px; accent-color: var(--brand); margin: 0; }
.filter-group .n { margin-left: auto; font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.filter-group select { width: 100%; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--bg-elev); }
.filters-toggle { display: none; }
.results-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.results-bar .count { color: var(--ink-2); font-size: 14.5px; }
.results-bar .count b { color: var(--ink); }
.results-bar select { padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--bg-elev); font-size: 14px; }
.catalog-search { display: flex; align-items: center; gap: 10px; padding: 4px 4px 4px 14px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--bg-elev); margin-bottom: 18px; }
.catalog-search svg { width: 18px; height: 18px; color: var(--ink-3); }
.catalog-search input { flex: 1; border: 0; background: none; outline: none; padding: 9px 4px; font-size: 15.5px; }
.active-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.active-chips .chip { background: var(--brand-soft); border-color: transparent; color: var(--brand); }
.empty { padding: 48px 24px; text-align: center; color: var(--ink-2); border: 1px dashed var(--line-strong); border-radius: var(--radius); }
@media (max-width: 900px) {
  .catalog { grid-template-columns: 1fr; }
  .filters { position: static; display: none; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-elev); }
  .filters.open { display: flex; }
  .filters-toggle { display: inline-flex; }
}

/* ---------- Course detail ---------- */
.detail { display: grid; grid-template-columns: 1fr 340px; gap: 40px; align-items: start; }
.detail-aside { position: sticky; top: calc(var(--nav-h) + 20px); padding: 24px; border-radius: var(--radius-l); background: var(--bg-elev); border: 1px solid var(--line); box-shadow: var(--shadow); }
.detail-aside .big-price { font-family: var(--font-display); font-size: 30px; font-weight: 500; letter-spacing: -0.02em; }
.detail-aside .big-price.free { color: var(--free); }
.detail-aside dl { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; margin: 20px 0; font-size: 14.5px; }
.detail-aside dt { color: var(--ink-3); }
.detail-aside dd { margin: 0; font-weight: 500; }
.detail-aside .btn { width: 100%; }
.detail-aside .fine { font-size: 12.5px; color: var(--ink-3); margin-top: 12px; text-align: center; }
.detail-body h2 { font-size: 24px; margin: 36px 0 12px; }
.detail-body p { color: var(--ink-2); font-size: 16.5px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.alt-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 16px; }
.alt { padding: 18px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg-elev); position: relative; }
.alt .k { font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 600; margin-bottom: 8px; }
.alt .k.free { color: var(--free); } .alt .k.paid { color: var(--paid); }
.alt h3 { font-size: 16px; }
.alt h3 a::after { content: ""; position: absolute; inset: 0; }
.alt .s { font-size: 13.5px; color: var(--ink-3); margin-top: 4px; }
@media (max-width: 900px) { .detail { grid-template-columns: 1fr; } .detail-aside { position: static; } }

/* ---------- Providers ---------- */
.provider { display: flex; gap: 16px; padding: 20px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg-elev); position: relative; transition: transform 0.2s, box-shadow 0.2s; }
.provider:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.provider .mono { width: 46px; height: 46px; flex: none; border-radius: 12px; display: grid; place-items: center; font-family: var(--font-display); font-size: 20px; font-weight: 600; background: var(--brand-soft); color: var(--brand); }
.provider h3 { font-size: 16.5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.provider h3 a::after { content: ""; position: absolute; inset: 0; }
.provider h3 .badge { font-weight: 500; }
.provider p { font-size: 14px; color: var(--ink-2); margin-top: 4px; }
.provider .n { font-size: 13px; color: var(--ink-3); margin-top: 8px; }
.logo-strip { display: flex; flex-wrap: wrap; gap: 10px 28px; justify-content: center; align-items: center; color: var(--ink-3); font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }
.logo-strip span { opacity: 0.8; }

/* ---------- Paths ---------- */
.path { padding: 26px; border-radius: var(--radius-l); border: 1px solid var(--line); background: var(--bg-elev); box-shadow: var(--shadow-s); }
.path header { display: flex; justify-content: space-between; gap: 16px; align-items: start; margin-bottom: 14px; }
.path h3 { font-size: 20px; font-family: var(--font-display); font-weight: 500; letter-spacing: -0.01em; }
.path .who { font-size: 13.5px; color: var(--ink-3); margin-top: 4px; }
.path ol { margin: 18px 0 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 10px; }
.path li { position: relative; display: grid; grid-template-columns: 28px 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 12px; background: var(--bg-sunken); counter-increment: step; }
.path li::before { content: counter(step); width: 26px; height: 26px; border-radius: 999px; display: grid; place-items: center; background: var(--ink); color: var(--bg); font-size: 12px; font-weight: 700; }
.path li .t { font-weight: 600; font-size: 14.5px; }
.path li .s { font-size: 12.5px; color: var(--ink-3); }
.path li .p { font-size: 13px; font-weight: 600; white-space: nowrap; }
.path li a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }

/* ---------- CTA band ---------- */
.band { border-radius: var(--radius-l); padding: clamp(32px, 5vw, 56px); background: var(--ink); color: var(--bg); position: relative; overflow: hidden; display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; align-items: center; }
.band::before { content: ""; position: absolute; inset: auto -10% -60% auto; width: 60%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--brand) 55%, transparent), transparent 70%); filter: blur(30px); }
.band h2 { font-size: clamp(26px, 3.2vw, 38px); position: relative; }
.band p { position: relative; opacity: 0.8; margin-top: 10px; font-size: 16.5px; }
.band .actions { position: relative; display: flex; gap: 10px; flex-wrap: wrap; justify-content: end; }
.band .btn-primary { background: var(--bg); color: var(--ink); }
.band .btn-secondary { background: transparent; color: var(--bg); border-color: color-mix(in srgb, var(--bg) 35%, transparent); }
@media (max-width: 760px) { .band { grid-template-columns: 1fr; } .band .actions { justify-content: start; } }

/* ---------- Prose / FAQ ---------- */
.prose { max-width: 70ch; }
.prose h2 { font-size: 26px; margin: 40px 0 12px; }
.prose h3 { font-size: 19px; margin: 28px 0 8px; }
.prose p, .prose li { color: var(--ink-2); font-size: 16.5px; margin-bottom: 14px; }
.prose ul { list-style: disc; padding-left: 22px; }
.prose a { color: var(--brand); font-weight: 500; }
.prose a:hover { text-decoration: underline; }
details { border: 1px solid var(--line); border-radius: 12px; background: var(--bg-elev); padding: 0 18px; margin-bottom: 10px; }
summary { cursor: pointer; padding: 16px 0; font-weight: 600; font-size: 16px; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-size: 20px; color: var(--ink-3); transition: transform 0.2s; }
details[open] summary::after { transform: rotate(45deg); }
details p { padding-bottom: 16px; color: var(--ink-2); }

/* ---------- Notice ---------- */
.notice { display: flex; gap: 12px; align-items: start; padding: 14px 16px; border-radius: 12px; background: var(--accent-soft); color: var(--ink-2); font-size: 14px; border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }
.notice svg { width: 18px; height: 18px; color: var(--accent); flex: none; margin-top: 2px; }

/* ---------- Forms ---------- */
.form { display: grid; gap: 16px; max-width: 640px; }
.form label { display: grid; gap: 6px; font-size: 14px; font-weight: 500; }
.form input, .form select, .form textarea { padding: 11px 14px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--bg-elev); font: inherit; color: inherit; }
.form textarea { min-height: 120px; resize: vertical; }
.form input:focus, .form textarea:focus, .form select:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: transparent; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding-block: 48px 32px; margin-top: clamp(48px, 8vw, 96px); background: var(--bg-sunken); }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 32px; }
.footer h4 { font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 14px; }
.footer li { margin-bottom: 9px; font-size: 14.5px; }
.footer li a { color: var(--ink-2); }
.footer li a:hover { color: var(--ink); }
.footer .about { color: var(--ink-2); font-size: 14.5px; max-width: 40ch; margin-top: 14px; }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-3); }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(12px); animation: reveal 0.6s ease forwards; }
  .reveal:nth-child(2) { animation-delay: 0.06s; } .reveal:nth-child(3) { animation-delay: 0.12s; } .reveal:nth-child(4) { animation-delay: 0.18s; }
  @keyframes reveal { to { opacity: 1; transform: none; } }
}
