/* =========================================================================
   The Font Generator — design system
   Aurora / studio aesthetic: layered surfaces, soft depth, gradient accents.
   ========================================================================= */

/* ---------- Tokens ---------- */
:root {
  color-scheme: light;

  /* Surfaces */
  --bg: #fbfaff;
  --bg-veil: #f3f1fd;
  --surface: #ffffff;
  --surface-2: #f5f4fc;
  --surface-3: #ecebf8;

  /* Ink */
  --text: #100e1c;
  --text-soft: #3a3752;
  --text-muted: #63607e;
  --text-faint: #8b88a3;

  /* Lines */
  --border: #e7e5f5;
  --border-strong: #d8d5ee;

  /* Brand */
  --accent: #6d4dfb;
  --accent-hover: #5a37ee;
  --accent-ink: #ffffff;
  --accent-soft: #efeaff;
  --accent-2: #d63bf0;
  --accent-3: #14b8d4;
  --gradient: linear-gradient(115deg, #6d4dfb 0%, #a340f5 45%, #e0459b 100%);
  --gradient-soft: linear-gradient(135deg, rgba(109, 77, 251, 0.14), rgba(224, 69, 155, 0.12));

  /* Status */
  --success: #0f9d70;
  --success-soft: #dff6ee;
  --warn: #b06a05;
  --warn-soft: #fdf0dc;
  --danger: #d03a4b;
  --danger-soft: #fdeaec;
  --star: #e09612;

  /* Depth */
  --shadow-xs: 0 1px 2px rgba(23, 16, 60, 0.05);
  --shadow-sm: 0 2px 8px rgba(23, 16, 60, 0.06);
  --shadow-md: 0 10px 30px -12px rgba(23, 16, 60, 0.18);
  --shadow-lg: 0 28px 60px -28px rgba(23, 16, 60, 0.3);
  --shadow-accent: 0 12px 28px -12px rgba(109, 77, 251, 0.55);
  --ring: 0 0 0 3px rgba(109, 77, 251, 0.28);

  /* Shape */
  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius: 16px;
  --radius-lg: 22px;
  --radius-xl: 30px;

  /* Type */
  --font-ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-brand: "Playfair Display", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --font-display: "Plus Jakarta Sans", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Layout */
  --max-width: 1180px;
  --max-prose: 760px;
  --header-h: 68px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="dark"] {
  color-scheme: dark;

  --bg: #08070f;
  --bg-veil: #0d0b18;
  --surface: #14121f;
  --surface-2: #1b1930;
  --surface-3: #23203a;

  --text: #f4f2ff;
  --text-soft: #d9d5ee;
  --text-muted: #a7a2c2;
  --text-faint: #7a7597;

  --border: #262238;
  --border-strong: #35304e;

  --accent: #9b83ff;
  --accent-hover: #b09aff;
  --accent-ink: #100b26;
  --accent-soft: #241d44;
  --accent-2: #ec6ef8;
  --accent-3: #3ad7ef;
  --gradient: linear-gradient(115deg, #8f74ff 0%, #c06bff 45%, #ff6fb2 100%);
  --gradient-soft: linear-gradient(135deg, rgba(155, 131, 255, 0.18), rgba(255, 111, 178, 0.14));

  --success: #34d9a0;
  --success-soft: #102f27;
  --warn: #f0b356;
  --warn-soft: #33270f;
  --danger: #ff7a8a;
  --danger-soft: #331419;
  --star: #f5b53d;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.45);
  --shadow-md: 0 14px 34px -14px rgba(0, 0, 0, 0.75);
  --shadow-lg: 0 34px 70px -30px rgba(0, 0, 0, 0.85);
  --shadow-accent: 0 14px 30px -14px rgba(155, 131, 255, 0.5);
  --ring: 0 0 0 3px rgba(155, 131, 255, 0.35);
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 20px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* clip, not hidden: "overflow-x: hidden" alone forces overflow-y to
     auto, turning body into its own scroll container and breaking every
     `position: sticky` element on the page (header, results bar, rail). */
  overflow-x: clip;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  letter-spacing: -0.022em;
  line-height: 1.15;
  color: var(--text);
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

img { max-width: 100%; }

/* The `hidden` attribute only sets display:none through the user-agent
   stylesheet, so ANY author rule that sets display beats it — an element with
   `hidden` and `display:flex` stays fully visible. Restate it here at author
   level so `el.hidden = true` reliably hides things. */
[hidden] { display: none !important; }

button, input, textarea, select { font: inherit; color: inherit; }

:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: var(--radius-xs);
}

::selection { background: var(--accent-soft); color: var(--text); }

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 22px;
}

.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;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 200;
  background: var(--accent);
  color: #fff;
  padding: 12px 20px;
  border-radius: 0 0 var(--radius-sm) 0;
  font-weight: 600;
}
.skip-link:focus { left: 0; }

/* =========================================================================
   Header
   ========================================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease),
    background 0.25s var(--ease);
}
.site-header.is-scrolled {
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  /* Full-bleed: the 1180px content column is too narrow for the full nav. */
  max-width: 1560px;
  margin: 0 auto;
  min-height: var(--header-h);
  height: var(--header-h);
  padding: 10px 22px;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 18px;
}

.brand {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  line-height: 1;
  color: var(--text);
  white-space: nowrap;
  flex-shrink: 0;
  transition: transform 0.2s var(--ease);
}
.brand:hover { color: var(--text); transform: translateY(-1px); }
.brand:hover .brand-mark { transform: scale(1.05); }

.brand-the {
  font-family: var(--font-brand);
  font-style: italic;
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}
/* The mark supplies the F, the text completes the word. */
.brand-font {
  display: inline-flex;
  align-items: center;
  gap: 0;
}
.brand-mark {
  width: 26px;
  height: 26px;
  object-fit: contain;
  margin-right: -1px;
  transition: transform 0.2s var(--ease);
}
.brand-ont {
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: 1.16rem;
  letter-spacing: -0.01em;
}
.brand-gen {
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: 1.16rem;
  letter-spacing: -0.01em;
}
.brand-accent {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav-desktop {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  /* Rail: one rounded container so the links read as a single control. */
  padding: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.nav-desktop a {
  position: relative;
  padding: 9px 11px;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1;
  color: var(--text-muted);
  white-space: nowrap;
  transition: color 0.18s var(--ease), background 0.18s var(--ease),
    box-shadow 0.18s var(--ease);
}
.nav-desktop a:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}
.nav-desktop a[aria-current="page"] {
  color: var(--accent);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

/* "More" dropdown — the ninth slot in the rail, holding every landing page
   that doesn't earn a permanent spot. The trigger is styled to match a nav
   link exactly so the rail still reads as one control. */
.nav-more { position: relative; display: flex; }
.nav-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 11px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1;
  color: var(--text-muted);
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.18s var(--ease), background 0.18s var(--ease);
}
.nav-more-btn:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}
/* Set when the open page lives inside the dropdown, so the rail still shows
   where you are instead of looking like nothing is selected. */
.nav-more-btn.is-current,
.nav-more-btn[aria-expanded="true"] { color: var(--accent); }
.nav-more-btn.is-current {
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}
.nav-more-caret {
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translate(-1px, -1px);
  transition: transform 0.2s var(--ease);
}
.nav-more-btn[aria-expanded="true"] .nav-more-caret {
  transform: rotate(-135deg) translate(-2px, -2px);
}

.nav-more-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 70;
  min-width: 190px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  animation: nav-more-in 0.16s var(--ease);
  /* The list grows with every new landing page, so cap it against the
     viewport and scroll rather than letting it run off the bottom. */
  max-height: calc(100vh - var(--header-h) - 28px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
/* The rail is a pill, so square off the menu's own link corners a little. */
.nav-desktop .nav-more-menu a {
  border-radius: var(--radius-xs);
  padding: 9px 12px;
}
@keyframes nav-more-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .nav-more-menu { animation: none; }
  .nav-more-caret { transition: none; }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.nav-desktop + .header-actions { margin-left: 10px; }

/* Wide screens only: the nav is optically centred in the header.
   Below this it stays in normal flow, where centring would collide
   with the wordmark. */
@media (min-width: 1440px) {
  .header-inner { position: relative; }
  .nav-desktop {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    margin-left: 0;
  }
  /* The nav leaves the flow, so the actions need the auto margin back. */
  .nav-desktop + .header-actions { margin-left: auto; }
}

.icon-button {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.18s var(--ease), border-color 0.18s var(--ease), color 0.18s var(--ease);
}
.icon-button:hover {
  color: var(--accent);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}
.icon-button svg { width: 18px; height: 18px; }

.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }

.nav-toggle { display: none; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }
.nav-toggle[aria-expanded="true"] .icon-burger { display: none; }

.mobile-nav {
  display: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  border-top: 1px solid var(--border);
  background: var(--bg);
  padding: 12px 22px 20px;
}
.mobile-nav.is-open {
  display: grid;
  animation: slide-down 0.25s var(--ease);
}
.mobile-nav a {
  display: block;
  padding: 13px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-soft);
  font-weight: 600;
  font-size: 0.94rem;
}
.mobile-nav a[aria-current="page"] { border-color: var(--border); }
@media (max-width: 420px) {
  .mobile-nav { grid-template-columns: minmax(0, 1fr); }
}
.mobile-nav a:hover,
.mobile-nav a[aria-current="page"] {
  background: var(--surface-2);
  color: var(--accent);
}

@keyframes slide-down {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Narrower desktop/laptop widths: shrink the rail instead of hiding it,
   so the full nav keeps showing on typical laptop screens. */
@media (max-width: 1280px) {
  .nav-desktop { gap: 0; }
  .nav-desktop a { padding: 9px 8px; font-size: 0.82rem; }
}
@media (max-width: 1150px) {
  .nav-desktop a { padding: 8px 6px; font-size: 0.76rem; }
}

@media (max-width: 1010px) {
  .nav-desktop { display: none; }
  .nav-toggle { display: inline-flex; }
}

/* =========================================================================
   Hero
   ========================================================================= */
.hero {
  position: relative;
  padding: 60px 0 34px;
  text-align: center;
  overflow: hidden;
  isolation: isolate;
}
.hero-glow {
  position: absolute;
  inset: -220px 0 auto;
  height: 620px;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(46% 46% at 22% 34%, rgba(109, 77, 251, 0.3), transparent 68%),
    radial-gradient(40% 40% at 78% 26%, rgba(224, 69, 155, 0.24), transparent 66%),
    radial-gradient(38% 38% at 52% 60%, rgba(20, 184, 212, 0.18), transparent 70%);
  filter: blur(20px);
  animation: drift 22s ease-in-out infinite alternate;
}
[data-theme="dark"] .hero-glow { opacity: 0.7; }

@keyframes drift {
  from { transform: translate3d(-2%, 0, 0) scale(1); }
  to { transform: translate3d(3%, 2%, 0) scale(1.08); }
}

.hero-inner { position: relative; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 15px 7px 12px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(10px);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  box-shadow: var(--shadow-xs);
  margin-bottom: 22px;
}
.eyebrow .pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--success) 55%, transparent); }
  70% { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.hero h1 {
  font-size: clamp(2.1rem, 5.4vw, 3.55rem);
  font-weight: 800;
  margin: 0 auto 18px;
  max-width: 17ch;
  letter-spacing: -0.035em;
}
.hero h1 .grad {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-lede {
  color: var(--text-muted);
  max-width: 620px;
  margin: 0 auto;
  font-size: clamp(1rem, 1.6vw, 1.12rem);
  line-height: 1.65;
}

.hero-stats {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  padding: 0;
  margin: 26px 0 0;
}
.hero-stats li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 76%, transparent);
  font-size: 0.86rem;
  color: var(--text-muted);
  box-shadow: var(--shadow-xs);
}
.hero-stats b { color: var(--text); font-weight: 700; }
.hero-stats svg { width: 15px; height: 15px; color: var(--accent); }

/* =========================================================================
   Studio (tool)
   ========================================================================= */
.studio {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 18px 22px;
  align-items: start;
  margin: 10px 0;
}
@media (max-width: 1000px) {
  .studio { grid-template-columns: 1fr; }
}

/* The primary field: full width, first in the flow, and larger than anything
   else on the page — it must never be confused with the style filter. */
.studio-input {
  grid-column: 1 / -1;
  padding: 20px 22px 18px;
  border-color: var(--border-strong);
  box-shadow: var(--shadow-lg);
}
.input-headline {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 11px;
  cursor: text;
}
.input-headline-text {
  font-family: var(--font-display);
  font-size: 1.06rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.input-foot .char-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.input-foot .char-pill svg { width: 14px; height: 14px; color: var(--success); }

.panel-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.studio-rail {
  position: sticky;
  top: calc(var(--header-h) + 16px);
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
}
@media (max-width: 1000px) {
  .studio-rail { position: static; }
}

.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-faint);
  margin-bottom: 9px;
}

.input-shell { position: relative; }
#text-input {
  width: 100%;
  min-height: 104px;
  resize: vertical;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1.5;
  padding: 16px 46px 16px 16px;
  outline: none;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
#text-input::placeholder { color: var(--text-faint); }
#text-input:focus {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: var(--ring);
}

.input-clear {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.18s var(--ease), background 0.18s var(--ease), color 0.18s var(--ease);
}
.input-clear svg { width: 15px; height: 15px; }
.input-shell:hover .input-clear,
.input-shell.has-text .input-clear,
.input-clear:focus-visible { opacity: 1; }
.input-clear:hover { background: var(--surface-3); color: var(--text); }

.input-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.char-pill {
  font-size: 0.78rem;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}
.char-pill b { color: var(--text-muted); font-weight: 700; }

.input-foot-actions {
  display: inline-flex;
  align-items: center;
  gap: 11px;
}
.kbd-hint {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.73rem;
  color: var(--text-faint);
}
.kbd-hint kbd {
  font-family: inherit;
  font-size: 0.69rem;
  font-weight: 700;
  line-height: 1;
  padding: 3px 5px;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--text-muted);
}
@media (max-width: 620px) {
  .kbd-hint { display: none; }
}

/* Where the text will actually be pasted. Shown only once something is typed,
   so the resting state of the card stays quiet. */
.fit-meter {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 11px;
}
.fit-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-faint);
}
.fit-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  cursor: default;
}
.fit-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  flex: 0 0 auto;
}
.fit-pill--over {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 40%, transparent);
  background: var(--danger-soft);
}
.fit-pill--over::before { background: var(--danger); }

.ghost-btn {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 0.79rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease), background 0.18s var(--ease);
}
.ghost-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.rail-divider {
  height: 1px;
  background: var(--border);
  border: 0;
  margin: 2px 0;
}

/* Collapsible rail section (decorations) */
.rail-group summary {
  cursor: pointer;
  list-style: none;
  margin-bottom: 0;
}
.rail-group summary::-webkit-details-marker { display: none; }
.rail-group summary > span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.rail-caret {
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translate(-1px, -1px);
  transition: transform 0.2s var(--ease);
}
.rail-group[open] .rail-caret { transform: rotate(-135deg) translate(-1px, -1px); }
.rail-group[open] summary { margin-bottom: 9px; }
.rail-group summary:hover { color: var(--accent); }

/* Collapsed on mobile, the picker would otherwise give no sign of what is
   currently applied — so the summary carries a live preview of it. */
.deco-active {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-muted);
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rail-group[open] .deco-active { display: none; }

/* ---------- Chips ---------- */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-soft);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.16s var(--ease), border-color 0.16s var(--ease), color 0.16s var(--ease),
    background 0.16s var(--ease), box-shadow 0.16s var(--ease);
}
.chip:hover {
  border-color: var(--border-strong);
  color: var(--text);
  transform: translateY(-1px);
}
.chip--active {
  background: var(--gradient);
  border-color: transparent;
  color: #fff;
  box-shadow: var(--shadow-accent);
}
.chip--active .chip-count { color: rgba(255, 255, 255, 0.8); }
.chip-count {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

/* ---------- Decorations ---------- */
.deco-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 7px;
  max-height: 210px;
  overflow-y: auto;
  padding: 3px 4px 3px 0;
  margin-top: 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
.deco-list::-webkit-scrollbar { width: 8px; }
.deco-list::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; }
.deco-list::-webkit-scrollbar-track { background: transparent; }

.deco-item {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-soft);
  border-radius: var(--radius-xs);
  padding: 9px 6px;
  cursor: pointer;
  font-size: 0.82rem;
  line-height: 1.35;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: border-color 0.16s var(--ease), background 0.16s var(--ease), transform 0.16s var(--ease);
}
.deco-item:hover { border-color: var(--accent); transform: translateY(-1px); }
.deco-item--active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--accent);
}

/* ---------- Size control ---------- */
.size-row { display: flex; align-items: center; gap: 12px; }
.size-row input[type="range"] {
  flex: 1;
  appearance: none;
  -webkit-appearance: none;
  height: 6px;
  border-radius: 99px;
  background: var(--surface-3);
  cursor: pointer;
}
.size-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--surface);
  box-shadow: var(--shadow-sm);
}
.size-row input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--surface);
}
.size-value {
  min-width: 52px;
  text-align: right;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* ---------- Results column ---------- */
.studio-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.results-bar {
  position: sticky;
  top: calc(var(--header-h) + 16px);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-sm);
}
@media (max-width: 1000px) { .results-bar { position: static; } }

/* Deliberately small, last in the bar, and quieter than the main text field —
   it filters style names and must not read as the box you type your text in. */
.search-shell {
  position: relative;
  flex: 0 0 auto;
  width: 190px;
  max-width: 100%;
  margin-left: auto;
}
.search-shell svg {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--text-faint);
  pointer-events: none;
}
#font-search {
  width: 100%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  border-radius: 999px;
  padding: 7px 12px 7px 32px;
  font-size: 0.82rem;
  outline: none;
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
#font-search::placeholder { color: var(--text-faint); }
#font-search:focus {
  border-color: var(--accent);
  background: var(--surface-2);
  color: var(--text);
  box-shadow: var(--ring);
}

.results-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.results-count {
  font-size: 0.82rem;
  color: var(--text-faint);
  font-weight: 600;
  white-space: nowrap;
}
.results-count b { color: var(--text); }

.category-scroll {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.category-scroll::-webkit-scrollbar { display: none; }
.category-scroll .chip { flex: 0 0 auto; }

#results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}
@media (max-width: 520px) { #results { grid-template-columns: 1fr; } }

.result-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 15px 16px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s var(--ease);
  animation: rise 0.32s var(--ease) both;
}
.result-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}
.result-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--gradient-soft);
  opacity: 0;
  transition: opacity 0.25s var(--ease);
  pointer-events: none;
}
.result-card:hover::before { opacity: 0.5; }
.result-card > * { position: relative; }

@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.result-card--fav { border-color: color-mix(in srgb, var(--star) 38%, var(--border)); }

.result-group {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 4px 0 -2px;
  font-size: 0.71rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-faint);
}
.result-group svg { width: 13px; height: 13px; color: var(--star); flex: 0 0 auto; }
.result-group::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.result-name {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.result-actions { display: flex; align-items: center; gap: 6px; }

.icon-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-muted);
  border-radius: 10px;
  cursor: pointer;
  transition: color 0.16s var(--ease), border-color 0.16s var(--ease), background 0.16s var(--ease),
    transform 0.16s var(--ease);
}
.icon-btn svg { width: 15px; height: 15px; }
.icon-btn:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-1px); }
.icon-btn--active {
  color: var(--star);
  border-color: color-mix(in srgb, var(--star) 55%, transparent);
  background: color-mix(in srgb, var(--star) 12%, transparent);
}
.icon-btn--active:hover { color: var(--star); border-color: var(--star); }

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 13px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-soft);
  border-radius: 10px;
  font-size: 0.79rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.16s var(--ease), background 0.16s var(--ease), border-color 0.16s var(--ease),
    transform 0.16s var(--ease), box-shadow 0.16s var(--ease);
}
.copy-btn svg { width: 14px; height: 14px; }
.copy-btn:hover {
  background: var(--gradient);
  border-color: transparent;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-accent);
}
.copy-btn.is-copied,
.copy-btn.is-copied:hover {
  background: var(--success-soft);
  border-color: color-mix(in srgb, var(--success) 45%, transparent);
  color: var(--success);
  box-shadow: none;
  transform: none;
}

.result-text {
  font-size: 22px;
  line-height: 1.45;
  word-break: break-word;
  color: var(--text);
  cursor: pointer;
  min-height: 1.45em;
}

/* Empty / preview state */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 14px 16px 6px;
  color: var(--text-muted);
}
.empty-state h3 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  color: var(--text);
}
.empty-state p { margin: 0; font-size: 0.92rem; }

.sample-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 13px;
}
.sample-chip { font-weight: 600; }
.sample-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
  box-shadow: var(--shadow-xs);
}

/* Deliberately the same box model as .result-card: the first keystroke should
   swap the text inside these tiles, not re-flow the whole grid. */
.preview-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  padding: 15px 16px 14px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text-muted);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease),
    color 0.18s var(--ease), transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.preview-item:hover {
  border-color: var(--accent);
  background: var(--surface);
  color: var(--text);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.preview-sample {
  display: block;
  width: 100%;
  font-size: 22px;
  line-height: 1.45;
  min-height: 1.45em;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Matches the height of a result card head row (32px icon buttons) so the
   tiles and the real cards are exactly the same size. */
.preview-name {
  display: flex;
  align-items: center;
  min-height: 32px;
  font-size: 0.72rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 700;
}

.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 34px 22px;
  color: var(--text-muted);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}
.no-results-title {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--text);
  overflow-wrap: anywhere;
}
.no-results-hint {
  margin: 0 auto;
  max-width: 44ch;
  font-size: 0.9rem;
  line-height: 1.6;
}
.no-results-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  justify-content: center;
  margin-top: 18px;
}

.primary-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  background: var(--gradient);
  color: #fff;
  border-radius: 999px;
  padding: 9px 18px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  max-width: 100%;
  overflow-wrap: anywhere;
  box-shadow: var(--shadow-accent);
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.primary-btn:hover { transform: translateY(-1px); }

/* =========================================================================
   Saved panels
   ========================================================================= */
.side-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 30px 0 10px;
}
@media (max-width: 820px) { .side-panels { grid-template-columns: 1fr; } }

.panel { padding: 18px 20px; }
.panel-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
}
.panel-head svg { width: 16px; height: 16px; color: var(--accent); }
.panel-head h3 { margin: 0; font-size: 0.95rem; font-weight: 700; letter-spacing: -0.01em; }

.empty-hint { color: var(--text-faint); font-size: 0.86rem; margin: 0; }

.fav-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}
.fav-row:last-child { border-bottom: none; }
.fav-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-chip {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-soft);
  border-radius: 999px;
  padding: 6px 13px;
  margin: 0 6px 7px 0;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.16s var(--ease), color 0.16s var(--ease), transform 0.16s var(--ease);
}
.history-chip:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }

/* =========================================================================
   Toast
   ========================================================================= */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 16px);
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: var(--text);
  color: var(--bg);
  padding: 11px 20px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s var(--ease), transform 0.22s var(--ease);
  z-index: 120;
}
.toast svg { width: 16px; height: 16px; flex: 0 0 auto; }
.toast--visible { opacity: 1; transform: translate(-50%, 0); }

/* =========================================================================
   Feature strip
   ========================================================================= */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
  margin: 46px 0 10px;
}
.feature {
  padding: 22px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.feature:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.feature-icon {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 13px;
}
.feature-icon svg { width: 20px; height: 20px; }
.feature h3 { margin: 0 0 6px; font-size: 1rem; }
.feature p { margin: 0; color: var(--text-muted); font-size: 0.9rem; line-height: 1.6; }

/* =========================================================================
   Editorial content
   ========================================================================= */
.content { padding-top: 26px; padding-bottom: 20px; }
.prose { max-width: var(--max-prose); }
.content h2 {
  font-size: clamp(1.45rem, 2.7vw, 1.95rem);
  margin: 54px 0 14px;
  font-weight: 800;
}
.content > .prose > h2:first-child { margin-top: 14px; }
.content h3 { font-size: 1.14rem; margin: 30px 0 8px; }
.content p,
.content li {
  color: var(--text-muted);
  line-height: 1.8;
  font-size: 1.02rem;
}
.content ul, .content ol { padding-left: 20px; }
.content li { margin-bottom: 8px; }
.content li::marker { color: var(--accent); }
.content strong { color: var(--text-soft); }

/* Editorial banner — <figure> with a <picture> inside, used mid-article. The
   aspect-ratio plus the width/height on the <img> keeps the space reserved
   before the image decodes, so nothing below it shifts. */
.content-figure {
  margin: 28px 0 30px;
  max-width: var(--max-prose);
}
.content-figure picture { display: block; }
.content-figure img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 1;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  background: var(--surface-2);
}
.content-figure figcaption {
  margin-top: 10px;
  color: var(--text-faint);
  font-size: 0.88rem;
  line-height: 1.6;
}

/* Key takeaways — the summary callout that opens a long article. */
.key-takeaways {
  max-width: var(--max-prose);
  margin: 26px 0 10px;
  padding: 22px 24px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
}
.content .key-takeaways h2 {
  margin: 0 0 12px;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--accent);
}
.key-takeaways ul { margin: 0; padding-left: 18px; }
.content .key-takeaways li { font-size: 0.97rem; line-height: 1.7; }

/* Style showcase — build-time gallery of real Unicode samples. Numbered,
   because these sections answer "best/top <x> fonts" style queries. */
.showcase {
  list-style: none;
  counter-reset: showcase;
  max-width: var(--max-prose);
  margin: 24px 0 28px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(228px, 1fr));
  gap: 12px;
}
.content .showcase-card {
  counter-increment: showcase;
  position: relative;
  /* Combining marks (the glitch/zalgo styles) paint far outside their own box
     and report zero height, so neither the layout nor getBoundingClientRect
     knows they are there. Clip at the card so a stacked sample cannot bleed
     over its neighbours. */
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 0;
  padding: 16px 16px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease),
    border-color 0.2s var(--ease);
}
.content .showcase-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  box-shadow: var(--shadow-md);
}
.content .showcase-card::before {
  content: counter(showcase);
  position: absolute;
  top: 12px;
  right: 14px;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-faint);
}
/* The sample is the point of the card, so it gets the size. Wrapping is
   allowed because decorated samples run long and must not overflow. */
.showcase-sample {
  font-size: 1.32rem;
  line-height: 1.45;
  color: var(--text);
  padding-right: 18px;
  overflow-wrap: anywhere;
}
.showcase-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-soft);
  margin-top: 4px;
}
.showcase-note {
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--text-muted);
}

/* Full alphabet per style. Rows wrap rather than scroll: 26 letters in a
   scrolling container would hide most of the alphabet on a phone, which is
   the one thing this block exists to show. */
.alphabet-set {
  max-width: var(--max-prose);
  margin: 24px 0 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}
.alphabet-row {
  display: grid;
  gap: 4px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.alphabet-row:last-child { border-bottom: none; }
.alphabet-row:nth-child(even) { background: var(--surface-2); }
.alphabet-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.alphabet-chars {
  font-size: 1.12rem;
  line-height: 1.6;
  color: var(--text);
  overflow-wrap: anywhere;
  /* Letter-spacing keeps the run scannable as individual characters rather
     than one dense block, which matters most for the tight styles. */
  letter-spacing: 0.04em;
}
.alphabet-lower { color: var(--text-soft); }

/* Data table — horizontally scrollable on narrow screens so a wide comparison
   table never forces the page body to scroll sideways. */
.table-wrap {
  max-width: var(--max-prose);
  margin: 22px 0 26px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  -webkit-overflow-scrolling: touch;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
  min-width: 620px;
}
/* Column hints. Without them the one cell holding a long caveat stretches its
   column and leaves the rows that hold only a "Yes" pill looking half-empty. */
.data-table th:nth-child(1) { width: 30%; }
.data-table th:nth-child(2) { width: 17%; }
.data-table th:nth-child(3) { width: 31%; }
.data-table th:nth-child(4) { width: 22%; }
/* The source column repeats one of two short labels — keep each on one line
   instead of wrapping "Community-tested" in every single row. */
.data-table th:nth-child(4),
.data-table td:nth-child(4) { white-space: nowrap; font-size: 0.88rem; }
/* Three-column variant. The four-column widths leave a 22% gap when there is
   no fourth column, and the 620px floor forces a scrollbar on a table that
   fits a phone comfortably. */
.data-table-3col { min-width: 460px; }
.data-table-3col th:nth-child(1) { width: 38%; }
.data-table-3col th:nth-child(2) { width: 42%; }
.data-table-3col th:nth-child(3) { width: 20%; }
/* Styled Unicode samples. Bumped a step so Fraktur and script stay legible,
   and left to fall back through the system stack rather than Inter, which
   covers none of the Mathematical Alphanumeric block. */
.sample-cell {
  font-size: 1.08rem;
  color: var(--text) !important;
  word-break: break-word;
}
.data-table caption {
  caption-side: top;
  text-align: left;
  padding: 14px 18px 0;
  color: var(--text-faint);
  font-size: 0.86rem;
  line-height: 1.5;
}
/* Below the table's min-width the caption would be clipped by the scroll
   container, so hide it visually and leave it for screen readers — the
   paragraph above the table already introduces it on screen. */
@media (max-width: 640px) {
  .data-table caption {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}
.data-table th,
.data-table td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  color: var(--text-muted);
  line-height: 1.6;
}
/* Qualifier under a yes/no pill, e.g. why a channel name is only "mostly no". */
.cell-note {
  display: block;
  margin-top: 6px;
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--text-faint);
}
.data-table thead th {
  color: var(--text);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: var(--surface-2);
  white-space: nowrap;
}
.data-table tbody th { color: var(--text-soft); font-weight: 600; }
.data-table tbody tr:last-child th,
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover th,
.data-table tbody tr:hover td { background: var(--surface-2); }

/* Yes / no / partial pills inside a data table cell. */
.tag {
  display: inline-block;
  padding: 2px 9px;
  margin-right: 6px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.tag-yes { background: var(--success-soft); color: var(--success); }
.tag-no { background: var(--danger-soft); color: var(--danger); }
.tag-partial { background: var(--warn-soft); color: var(--warn); }

/* Steps */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 24px 0 10px;
}
@media (max-width: 820px) { .steps { grid-template-columns: 1fr; } }
.step-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 22px;
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.step-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.step-card::after {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--gradient);
}
.step-num {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--gradient);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  box-shadow: var(--shadow-accent);
}
.step-card h3 { margin: 0 0 7px; font-size: 1.04rem; }
.step-card p { margin: 0; color: var(--text-muted); font-size: 0.93rem; line-height: 1.65; }

/* FAQ */
.faq-list {
  max-width: var(--max-prose);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item:last-child { border-bottom: none; }
.faq-item summary {
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  padding: 17px 20px;
  font-weight: 600;
  font-size: 0.99rem;
  color: var(--text);
  list-style: none;
  transition: background 0.18s var(--ease), color 0.18s var(--ease);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "";
  margin-left: auto;
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--text-faint);
  border-bottom: 2px solid var(--text-faint);
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform 0.22s var(--ease), border-color 0.22s var(--ease);
}
.faq-item summary:hover { background: var(--surface-2); color: var(--accent); }
.faq-item[open] summary { color: var(--accent); }
.faq-item[open] summary::after {
  transform: rotate(-135deg) translate(-2px, -2px);
  border-color: var(--accent);
}
.faq-item p {
  margin: 0;
  padding: 0 20px 19px;
  color: var(--text-muted);
  font-size: 0.96rem;
  line-height: 1.75;
}

/* Related links */
.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  margin: 22px 0 10px;
}
.link-card {
  position: relative;
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 44px 18px 18px;
  color: var(--text);
  box-shadow: var(--shadow-xs);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s var(--ease);
}
.link-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  color: var(--text);
}
.link-card strong { display: block; font-weight: 700; font-size: 0.96rem; line-height: 1.35; }
.link-card span {
  display: block;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 5px;
  line-height: 1.55;
}
.link-card::after {
  content: "\2192";
  position: absolute;
  top: 18px;
  right: 18px;
  color: var(--text-faint);
  transition: transform 0.2s var(--ease), color 0.2s var(--ease);
}
.link-card:hover::after { color: var(--accent); transform: translateX(3px); }

/* CTA band */
.cta-band {
  margin: 56px 0 10px;
  border-radius: var(--radius-xl);
  padding: 44px 34px;
  text-align: center;
  background: var(--gradient);
  color: #fff;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}
.cta-band::after {
  content: "";
  position: absolute;
  inset: -50% -10% auto;
  height: 240px;
  background: radial-gradient(50% 60% at 50% 50%, rgba(255, 255, 255, 0.28), transparent 70%);
  pointer-events: none;
}
.cta-band h2 {
  color: #fff;
  margin: 0 0 10px;
  font-size: clamp(1.4rem, 3vw, 2rem);
}
.cta-band p {
  color: rgba(255, 255, 255, 0.9);
  margin: 0 auto 22px;
  max-width: 520px;
}
.btn-light {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: #fff;
  color: #2c1a70;
  border: none;
  border-radius: 999px;
  padding: 13px 26px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 10px 24px -12px rgba(0, 0, 0, 0.5);
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.btn-light svg { width: 18px; height: 18px; flex: 0 0 auto; }
.btn-light:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px -14px rgba(0, 0, 0, 0.55);
  color: #2c1a70;
}

/* =========================================================================
   Footer
   ========================================================================= */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-veil);
  padding: 54px 0 30px;
  margin-top: 64px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(3, 1fr);
  gap: 30px;
}
@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 26px; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }

.footer-brand .brand { font-size: 1.05rem; }
.footer-tagline {
  color: var(--text-muted);
  font-size: 0.88rem;
  max-width: 290px;
  margin: 14px 0 16px;
  line-height: 1.65;
}
.footer-badges { display: flex; flex-wrap: wrap; gap: 7px; }
.footer-badges span {
  font-size: 0.73rem;
  font-weight: 600;
  color: var(--text-muted);
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  padding: 4px 11px;
}
/* Social profiles. Icon-only, so each link carries an aria-label and the
   target is kept at 40px for comfortable tapping. */
.footer-social {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}
.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease),
    transform 0.18s var(--ease), background 0.18s var(--ease);
}
.social-link svg { width: 19px; height: 19px; }
.social-link:hover {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  background: var(--accent-soft);
  transform: translateY(-2px);
}
@media (prefers-reduced-motion: reduce) {
  .social-link:hover { transform: none; }
}

.footer-col h4 {
  font-size: 0.73rem;
  margin: 0 0 13px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-weight: 700;
}
.footer-col a {
  display: block;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 10px;
  transition: color 0.16s var(--ease), transform 0.16s var(--ease);
}
.footer-col a:hover { color: var(--accent); transform: translateX(2px); }
.footer-bottom {
  margin-top: 38px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-faint);
  font-size: 0.82rem;
}

/* =========================================================================
   Small screens — tighten the fold so the tool is reachable fast
   ========================================================================= */
@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .hero { padding: 30px 0 20px; }
  .eyebrow { margin-bottom: 16px; font-size: 0.76rem; padding: 6px 13px 6px 10px; }
  .hero h1 { max-width: 100%; font-size: clamp(1.95rem, 8.5vw, 2.5rem); margin-bottom: 14px; }
  .hero-lede { font-size: 0.98rem; }
  .hero-stats { gap: 8px; margin-top: 18px; }
  .hero-stats li { padding: 6px 12px; font-size: 0.79rem; }
  .studio-rail { padding: 16px; gap: 14px; }
  #text-input { min-height: 96px; font-size: 1rem; }
  .panel { padding: 16px; }
  .result-card { padding: 13px 14px; }
  .site-footer { padding: 40px 0 26px; margin-top: 44px; }
  .cta-band { padding: 34px 22px; }
  .content h2 { margin-top: 42px; }
}

/* =========================================================================
   Motion preferences
   ========================================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
