/* ==========================================================================
   Stylish Name Maker - design system
   1. Tokens
   2. Base
   3. Layout helpers
   4. Header and navigation
   5. Buttons and controls
   6. Hero and generator
   7. Style grid
   8. Sections and cards
   9. Content blocks
   10. Keyboard
   11. Contact
   12. Footer
   13. Motion and responsive
   ========================================================================== */

/* 1. Tokens ================================================================ */
:root {
  --primary-blue: #5500a9;
  --bg: #f9fafb;
  --bg-soft: #f3f4f6;
  --surface: #ffffff;
  --surface-2: #f0f4ff;
  --ink: #1f2937;
  --ink-soft: #374151;
  --muted: #6b7280;
  --line: #e5e7eb;
  --line-strong: #d1d5db;
  --brand: #5500a9;
  --brand-2: #8b5cf6;
  --brand-3: #ec4899;
  --brand-soft: #f0e7ff;
  --brand-ink: #5500a9;
  --teal: #06b6d4;
  --gold: #f59e0b;
  --danger: #ff6b6b;
  --success: #10b981;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 10px 15px rgba(85, 0, 169, 0.12);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --header-h: 72px;
  --font-display: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-body: "DM Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-style: "Segoe UI Symbol", "Noto Sans Symbols", "Apple Symbols", "Segoe UI", sans-serif;
  --max: 1280px;
}

[data-theme="dark"] {
  --bg: #111827;
  --bg-soft: #1f2937;
  --surface: #1f2937;
  --surface-2: #374151;
  --ink: #f9fafb;
  --ink-soft: #d1d5db;
  --muted: #9ca3af;
  --line: #374151;
  --line-strong: #4b5563;
  --brand: #8b5cf6;
  --brand-2: #a78bfa;
  --brand-3: #ec4899;
  --brand-soft: #2e1065;
  --brand-ink: #c4b5fd;
  --teal: #22d3ee;
  --gold: #fbbf24;
  --danger: #ff6b6b;
  --success: #34d399;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 10px 28px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 30px 80px rgba(0, 0, 0, 0.55);
}

/* 2. Base ================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img,
svg {
  max-width: 100%;
  display: block;
}

a {
  color: var(--brand-ink);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--brand);
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  color: var(--ink);
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin: 0 0 0.5em;
  font-weight: 700;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.4rem, 5.4vw, 4.1rem);
  letter-spacing: -0.045em;
}

h2 {
  font-size: clamp(1.7rem, 3.2vw, 2.5rem);
}

h3 {
  font-size: 1.18rem;
  letter-spacing: -0.02em;
}

p {
  margin: 0 0 1em;
}

ul,
ol {
  padding-left: 1.2em;
}

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent);
  outline-offset: 3px;
  border-radius: 6px;
}

::selection {
  background: color-mix(in srgb, var(--brand) 26%, transparent);
}

.container {
  width: min(100% - 40px, var(--max));
  margin-inline: auto;
}

.narrow {
  width: min(100% - 40px, 820px);
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 200;
  background: var(--ink);
  color: var(--bg);
  padding: 12px 18px;
  border-radius: 10px;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 14px;
  color: var(--bg);
}

.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
}

.eyebrow-light {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.9);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 14%, transparent); }
  50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--brand) 5%, transparent); }
}

/* 3. Layout helpers ======================================================== */
.section {
  padding: clamp(52px, 7vw, 88px) 0;
}

.section-alt {
  background: var(--bg-soft);
  border-block: 1px solid var(--line);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 34px;
}

.section-head > div {
  max-width: 660px;
}

.section-head p:last-child {
  margin-bottom: 0;
  color: var(--muted);
}

.section-head-center {
  justify-content: center;
  text-align: center;
}

.section-head-center > div {
  max-width: 720px;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--brand-ink);
  text-decoration: none;
}

.text-link .icon {
  width: 15px;
  height: 15px;
  transition: transform 0.2s;
}

.text-link:hover .icon {
  transform: translateX(3px);
}

.text-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  background: none;
  padding: 4px 2px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 6px;
}

.text-btn .icon {
  width: 15px;
  height: 15px;
}

.text-btn:hover {
  color: var(--brand-ink);
}

/* 4. Header and navigation ================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  backdrop-filter: saturate(150%) blur(14px);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.04em;
  font-size: 1.22rem;
  flex: 0 0 auto;
}

.brand:hover {
  color: var(--ink);
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
  color: #fff;
  font-size: 0.93rem;
  font-weight: 800;
  letter-spacing: -0.06em;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 55%, var(--brand-3) 120%);
  box-shadow: inset 0 -2px 6px rgba(0, 0, 0, 0.18), 0 6px 14px color-mix(in srgb, var(--brand) 28%, transparent);
}

.brand-mark span:first-child {
  transform: translateY(-2px);
}

.brand-mark span:last-child {
  transform: translateY(2px);
  opacity: 0.85;
}

.brand-name span {
  color: var(--brand);
}

.brand-light {
  color: #fff;
}

.brand-light:hover {
  color: #fff;
}

.brand-light .brand-name span {
  color: #c9b8ff;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 14px;
}

.nav-item {
  position: relative;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 9px 11px;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--brand-ink);
  background: var(--brand-soft);
}

.nav-trigger .chev {
  width: 13px;
  height: 13px;
  transition: transform 0.2s;
}

.nav-item.open > .nav-trigger .chev {
  transform: rotate(180deg);
}

.nav-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 218px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.18s, transform 0.18s, visibility 0.18s;
  z-index: 90;
}

.nav-menu.menu-wide {
  min-width: 420px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
}

.nav-menu.menu-medium {
  min-width: 300px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
}

.nav-menu a {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--ink-soft);
  font-size: 0.88rem;
  text-decoration: none;
  white-space: nowrap;
}

.nav-menu a:hover,
.nav-menu a.is-active {
  background: var(--brand-soft);
  color: var(--brand-ink);
}

.nav-item:hover > .nav-menu,
.nav-item:focus-within > .nav-menu,
.nav-item.open > .nav-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.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;
}

.lang-switch {
  position: relative;
  margin: 0;
}

.lang-select {
  appearance: none;
  -webkit-appearance: none;
  min-width: 132px;
  max-width: 180px;
  height: 38px;
  padding: 0 28px 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='none' stroke='%235500a9' stroke-width='1.6' stroke-linecap='round' d='M1.5 1.5L6 6 10.5 1.5'/></svg>") no-repeat right 10px center;
  color: var(--ink-soft);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 500;
  cursor: pointer;
}

.lang-select:hover,
.lang-select:focus {
  color: var(--brand-ink);
  border-color: var(--brand);
  outline: none;
}

html[dir="rtl"] .header-inner,
html[dir="rtl"] .header-actions,
html[dir="rtl"] .site-nav,
html[dir="rtl"] .footer-bottom,
html[dir="rtl"] .footer-grid {
  direction: rtl;
}

html[dir="rtl"] .header-actions {
  margin-left: 0;
  margin-right: auto;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
}

.icon-btn:hover {
  color: var(--brand-ink);
  border-color: var(--line-strong);
}

.theme-icon-sun,
.theme-icon-moon {
  display: none;
}

[data-theme="dark"] .theme-icon-sun {
  display: inline-flex;
}

html:not([data-theme="dark"]) .theme-icon-moon {
  display: inline-flex;
}

.nav-toggle {
  display: none;
}

/* 5. Buttons and controls ================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 0.94rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.16s, box-shadow 0.16s, background 0.16s, color 0.16s, border-color 0.16s;
  white-space: nowrap;
}

.btn .icon {
  width: 17px;
  height: 17px;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  color: #fff;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--brand) 30%, transparent);
}

.btn-primary:hover {
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 12px 26px color-mix(in srgb, var(--brand) 36%, transparent);
}

.btn-soft {
  background: var(--brand-soft);
  color: var(--brand-ink);
  border-color: color-mix(in srgb, var(--brand) 14%, transparent);
}

.btn-soft:hover {
  color: var(--brand-ink);
  background: color-mix(in srgb, var(--brand) 14%, var(--surface));
}

.btn-ghost {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink-soft);
}

.btn-ghost:hover {
  color: var(--brand-ink);
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.btn-light {
  background: #fff;
  color: #3d23b8;
  box-shadow: 0 14px 30px rgba(20, 8, 70, 0.22);
}

.btn-light:hover {
  color: #3d23b8;
  transform: translateY(-2px);
}

.btn-sm {
  padding: 8px 13px;
  font-size: 0.84rem;
  border-radius: 9px;
}

.btn-sm .icon {
  width: 15px;
  height: 15px;
}

.btn-lg {
  padding: 15px 26px;
  font-size: 1rem;
}

.select {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.92rem;
  cursor: pointer;
}

/* 6. Hero and generator ==================================================== */
.hero {
  position: relative;
  padding: clamp(40px, 6vw, 78px) 0 clamp(46px, 6vw, 76px);
  overflow: clip;
}

.hero-home {
  background:
    radial-gradient(900px 500px at 12% -10%, color-mix(in srgb, var(--brand) 12%, transparent), transparent 65%),
    radial-gradient(800px 480px at 88% 4%, color-mix(in srgb, var(--brand-3) 11%, transparent), transparent 62%),
    linear-gradient(180deg, var(--surface-2), var(--bg));
  border-bottom: 1px solid var(--line);
}

.hero-page {
  background:
    radial-gradient(780px 420px at 8% -20%, color-mix(in srgb, var(--brand) 11%, transparent), transparent 65%),
    linear-gradient(180deg, var(--surface-2), var(--bg));
  border-bottom: 1px solid var(--line);
}

.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.5;
}

.blob-a {
  width: 420px;
  height: 420px;
  top: -220px;
  left: -80px;
  background: color-mix(in srgb, var(--brand) 30%, transparent);
}

.blob-b {
  width: 360px;
  height: 360px;
  top: -160px;
  right: -60px;
  background: color-mix(in srgb, var(--brand-3) 26%, transparent);
}

.blob-c {
  width: 300px;
  height: 300px;
  bottom: -220px;
  left: 42%;
  background: color-mix(in srgb, var(--teal) 20%, transparent);
}

.hero-inner {
  position: relative;
  z-index: 1;
}

.hero-copy {
  max-width: 880px;
  margin: 0 auto;
  text-align: center;
}

.hero-copy h1 {
  margin-bottom: 18px;
}

.hero-copy .lead {
  max-width: 680px;
  margin: 0 auto 22px;
  color: var(--muted);
  font-size: clamp(1.02rem, 1.6vw, 1.18rem);
  line-height: 1.6;
}

.hero-stats {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 auto;
  padding: 10px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  backdrop-filter: blur(8px);
}

.hero-stats > div {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 0 16px;
  border-right: 1px solid var(--line);
}

.hero-stats > div:last-child {
  border-right: 0;
}

.hero-stats strong {
  font-family: var(--font-display);
  font-size: 1.02rem;
  color: var(--ink);
}

.hero-stats span {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

/* Generator */
.generator-card {
  margin: clamp(30px, 4vw, 46px) auto 0;
  padding: clamp(16px, 2.4vw, 26px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  text-align: left;
  scroll-margin-top: calc(var(--header-h) + 18px);
}

.gen-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.gen-head-main {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.gen-label {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.gen-context {
  font-size: 0.78rem;
  color: var(--brand-ink);
  background: var(--brand-soft);
  padding: 3px 9px;
  border-radius: 999px;
}

.gen-head-actions {
  display: flex;
  gap: 8px;
}

.name-field {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 6px 16px;
  border: 2px solid var(--line-strong);
  border-radius: 15px;
  background: var(--surface-2);
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}

.name-field:focus-within {
  border-color: color-mix(in srgb, var(--brand) 60%, var(--line));
  background: var(--surface);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--brand) 10%, transparent);
}

.name-field-icon {
  width: 22px;
  height: 22px;
  color: var(--brand);
}

.name-field input {
  flex: 1;
  min-width: 0;
  padding: 12px 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2.2vw, 1.5rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.name-field input::placeholder {
  color: color-mix(in srgb, var(--muted) 65%, transparent);
  font-weight: 500;
}

.name-count {
  font-size: 0.76rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.field-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.field-clear:hover {
  background: var(--bg-soft);
  color: var(--ink);
}

.field-clear .icon {
  width: 16px;
  height: 16px;
}

.gen-limits {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 10px 2px 18px;
}

.limit-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--gold) 14%, transparent);
  color: var(--gold);
  font-size: 0.74rem;
  font-weight: 700;
}

.limit-hint {
  font-size: 0.78rem;
  color: var(--muted);
}

.gen-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  padding: 12px 0 0;
}

.font-menu-top {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 0 4px;
  max-height: 108px;
  overflow: hidden;
}

.font-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 700;
  white-space: nowrap;
}

.font-chip b {
  font-size: 1rem;
  line-height: 1;
  color: var(--ink);
  font-weight: 700;
  font-style: normal;
}

.font-chip i {
  font-style: normal;
  font-weight: 700;
}

.font-chip:hover,
.font-chip.is-active {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}

.font-chip:hover b,
.font-chip.is-active b {
  color: #fff;
}

.filter-tabs {
  display: none;
}

.tab {
  flex: 0 0 auto;
  padding: 7px 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.tab:hover {
  color: var(--ink);
  background: var(--bg-soft);
}

.tab.is-active {
  background: var(--brand-soft);
  border-color: color-mix(in srgb, var(--brand) 16%, transparent);
  color: var(--brand-ink);
}

.tab .tab-count {
  margin-left: 5px;
  opacity: 0.65;
  font-variant-numeric: tabular-nums;
}

.gen-search {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 190px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
}

.gen-search .icon {
  width: 15px;
  height: 15px;
  color: var(--muted);
}

.gen-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 0.85rem;
}

.gen-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 2px 10px;
  color: var(--muted);
  font-size: 0.82rem;
}

.gen-empty {
  padding: 52px 20px;
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.gen-empty .empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  margin-bottom: 12px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-ink);
}

.gen-empty h3 {
  margin-bottom: 6px;
}

.gen-empty p {
  color: var(--muted);
  font-size: 0.9rem;
}

.font-results {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.font-category {
  order: 1;
  flex: 0 0 168px;
  position: sticky;
  top: calc(var(--header-h) + 16px);
  align-self: flex-start;
  max-height: calc(100vh - 200px);
  overflow-y: auto;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--brand);
  color: #fff;
}

.font-category-title {
  margin: 0 0 10px;
  font-size: 0.7rem;
  padding: 5px;
  text-align: center;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
}

.font-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.font-cat-item {
  display: block;
  width: 100%;
  padding: 11px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.86);
  cursor: pointer;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.4;
}

.font-cat-item b {
  display: block;
  font-size: 1.1rem;
  line-height: 1.2;
  margin-bottom: 4px;
  color: #fff;
  font-weight: 700;
  font-style: normal;
}

.font-cat-item i {
  font-style: normal;
  font-weight: 700;
}

.font-cat-item:hover {
  border-color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.font-cat-item:hover b {
  color: #fff;
}

.font-cat-item.is-active {
  background: #fff;
  border-color: #fff;
  color: var(--brand);
}

.font-cat-item.is-active b {
  color: var(--brand);
}

.font-cat-item .tab-count {
  display: block;
  margin-top: 2px;
  font-size: 0.68rem;
  opacity: 0.7;
}

.fontslist-sec {
  order: 2;
  flex: 1;
  min-width: 0;
}

.font-results .style-grid {
  flex: 1;
  min-width: 0;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

#loadMoreContainer {
  width: 100%;
  text-align: center;
  margin-top: 24px;
  padding: 8px 0 12px;
}

#loadMoreBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px 32px;
  border: 0;
  border-radius: var(--radius);
  background: var(--brand);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: var(--shadow-md);
}

#loadMoreBtn:hover {
  background: #3b5bdb;
}

.noscript-note {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--bg-soft);
  color: var(--muted);
  font-size: 0.86rem;
}

/* 7. Style grid =========================================================== */
.style-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(212px, 1fr));
  gap: 10px;
}

.style-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 12px 12px 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color 0.16s, box-shadow 0.16s, transform 0.16s, background 0.16s;
  content-visibility: auto;
  contain-intrinsic-size: 0 92px;
}

.style-card:hover {
  border-color: color-mix(in srgb, var(--brand) 40%, var(--line));
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.style-card:active {
  transform: translateY(0);
}

.style-card.is-over {
  border-color: color-mix(in srgb, var(--danger) 35%, var(--line));
  background: color-mix(in srgb, var(--danger) 3%, var(--surface-2));
}

.style-preview {
  font-family: var(--font-style);
  font-size: 1.13rem;
  line-height: 1.45;
  min-height: 2.5em;
  display: flex;
  align-items: center;
  overflow-wrap: anywhere;
  word-break: normal;
  color: var(--ink);
}

.style-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: auto;
}

.style-label {
  font-size: 0.72rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.style-len {
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--muted);
  white-space: nowrap;
}

.style-card.is-over .style-len {
  background: color-mix(in srgb, var(--danger) 12%, transparent);
  color: var(--danger);
  font-weight: 700;
}

.style-actions {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.15s;
}

.style-card:hover .style-actions,
.style-card:focus-within .style-actions {
  opacity: 1;
}

.style-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}

.style-actions button:hover {
  color: var(--brand-ink);
  border-color: color-mix(in srgb, var(--brand) 30%, var(--line));
}

.style-actions .icon {
  width: 14px;
  height: 14px;
}

.save-btn[aria-pressed="true"] {
  color: var(--brand-3);
  background: color-mix(in srgb, var(--brand-3) 8%, var(--surface));
}

.save-btn[aria-pressed="true"] svg path {
  fill: currentColor;
}

.style-card.copied {
  border-color: var(--success);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 14%, transparent);
}

.style-card.copied .style-preview::after {
  content: "copied";
  position: absolute;
  top: 7px;
  left: 10px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--success);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.recent-list {
  display: grid;
  gap: 8px;
}

.recent-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}

.recent-text {
  font-family: var(--font-style);
  font-size: 1.06rem;
  overflow-wrap: anywhere;
}

.recent-item button {
  flex: 0 0 auto;
}

/* 8. Sections and cards ==================================================== */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}

.category-card {
  --tone-a: var(--brand);
  --tone-b: var(--brand-2);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}

.category-card:hover {
  color: var(--ink);
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--tone-a) 34%, var(--line));
  box-shadow: var(--shadow-md);
}

.category-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--tone-a), var(--tone-b));
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  box-shadow: inset 0 -2px 6px rgba(0, 0, 0, 0.18);
}

.category-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.category-name {
  font-weight: 700;
  font-size: 0.98rem;
  letter-spacing: -0.01em;
}

.category-short {
  font-size: 0.78rem;
  color: var(--muted);
}

.category-arrow {
  width: 16px;
  height: 16px;
  margin-left: auto;
  color: var(--muted);
  transition: transform 0.18s;
}

.category-card:hover .category-arrow {
  transform: translateX(3px);
  color: var(--tone-a);
}

.tone-berry { --tone-a: #ff6b9d; --tone-b: #7c4dff; }
.tone-ink { --tone-a: #56507a; --tone-b: #1d1930; }
.tone-pink { --tone-a: #ff9ac1; --tone-b: #ff4f87; }
.tone-slate { --tone-a: #93a1ba; --tone-b: #4c5872; }
.tone-gold { --tone-a: #ffd166; --tone-b: #e29500; }
.tone-rose { --tone-a: #ff8fab; --tone-b: #d93a6d; }
.tone-blue { --tone-a: #6da0ff; --tone-b: #3457d5; }
.tone-lilac { --tone-a: #c2a2ff; --tone-b: #7c5cff; }
.tone-amber { --tone-a: #ffc46b; --tone-b: #f07c1f; }
.tone-mint { --tone-a: #6ee7c8; --tone-b: #0e9f7c; }
.tone-orange { --tone-a: #ffab73; --tone-b: #ef5f2e; }
.tone-teal { --tone-a: #66e0d3; --tone-b: #0b8f84; }

.ready-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.ready-block {
  --tone-a: var(--brand);
  --tone-b: var(--brand-2);
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.ready-block header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.ready-block h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 1rem;
}

.ready-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--tone-a), var(--tone-b));
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
}

.ready-block header > span {
  font-size: 0.74rem;
  color: var(--muted);
  white-space: nowrap;
}

.name-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.name-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink);
  font-family: var(--font-style);
  font-size: 0.92rem;
  line-height: 1.35;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}

.name-chip:hover {
  border-color: color-mix(in srgb, var(--brand) 40%, var(--line));
  background: var(--surface);
  transform: translateY(-1px);
}

.name-text {
  overflow-wrap: anywhere;
}

.chip-copy {
  display: inline-flex;
  color: var(--muted);
  opacity: 0;
  transition: opacity 0.15s;
}

.chip-copy .icon {
  width: 13px;
  height: 13px;
}

.name-chip:hover .chip-copy,
.name-chip:focus-visible .chip-copy {
  opacity: 1;
}

.name-chip.copied {
  border-color: var(--success);
  background: color-mix(in srgb, var(--success) 8%, var(--surface));
}

.ready-block .text-link {
  margin-top: 14px;
}

.page-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
}

.page-card {
  --tone-a: var(--brand);
  --tone-b: var(--brand-2);
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}

.page-card:hover {
  color: var(--ink);
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--tone-a) 32%, var(--line));
  box-shadow: var(--shadow-md);
}

.page-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.page-card-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--tone-a), var(--tone-b));
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
}

.page-card-kind {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  background: var(--bg-soft);
  padding: 3px 8px;
  border-radius: 999px;
}

.page-card-title {
  font-family: var(--font-display);
  font-size: 1.06rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.page-card-desc {
  font-size: 0.83rem;
  color: var(--muted);
  line-height: 1.5;
}

.page-card-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--tone-a);
}

.page-card-link .icon {
  width: 14px;
  height: 14px;
}

/* Split, steps, demo */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}

.split-copy > p:not(.eyebrow) {
  color: var(--muted);
}

.steps {
  list-style: none;
  margin: 26px 0 0;
  padding: 0;
  display: grid;
  gap: 18px;
}

.steps li {
  display: flex;
  gap: 14px;
}

.steps li > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.9rem;
}

.steps h3 {
  margin: 4px 0 4px;
  font-size: 1rem;
}

.steps p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.split-visual {
  position: relative;
}

.demo-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.demo-rows {
  display: grid;
  gap: 10px;
}

.demo-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-2);
}

.demo-label {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
}

.demo-value {
  font-family: var(--font-style);
  font-size: 1.12rem;
  overflow-wrap: anywhere;
}

.demo-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  font-size: 0.76rem;
  color: var(--muted);
}

/* Families, rules, troubleshooting */
.family-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 14px;
}

.family-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.family-example {
  display: flex;
  align-items: center;
  min-height: 58px;
  padding: 10px 12px;
  margin-bottom: 14px;
  border-radius: 10px;
  background: var(--bg-soft);
  font-family: var(--font-style);
  font-size: 1.05rem;
  overflow-wrap: anywhere;
}

.family-card h3 {
  margin-bottom: 6px;
}

.family-card p {
  font-size: 0.9rem;
  color: var(--muted);
}

.family-card .text-link {
  font-size: 0.82rem;
}

.rules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}

.rules-grid article {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.rules-grid span {
  display: inline-block;
  margin-bottom: 10px;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--brand);
  letter-spacing: 0.08em;
}

.rules-grid h3 {
  font-size: 1.02rem;
}

.rules-grid p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.trouble-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.trouble-grid article {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.trouble-grid h3 {
  font-size: 0.98rem;
  margin-bottom: 6px;
}

.trouble-grid p {
  margin: 0;
  font-size: 0.87rem;
  color: var(--muted);
}

/* 9. Content blocks ======================================================== */
.page-hero {
  position: relative;
  padding: clamp(34px, 5vw, 62px) 0 clamp(36px, 5vw, 58px);
  background:
    radial-gradient(760px 400px at 12% -30%, color-mix(in srgb, var(--brand) 12%, transparent), transparent 65%),
    linear-gradient(180deg, var(--surface-2), var(--bg));
  border-bottom: 1px solid var(--line);
  overflow: clip;
}

.page-hero .container,
.page-hero .narrow {
  position: relative;
  z-index: 1;
}

.page-hero .lead {
  max-width: 720px;
  color: var(--muted);
  font-size: 1.05rem;
}

.breadcrumb {
  margin-bottom: 22px;
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.79rem;
  color: var(--muted);
}

.breadcrumb li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.breadcrumb li + li::before {
  content: "/";
  color: var(--line-strong);
}

.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--brand-ink);
}

.prose {
  color: var(--ink-soft);
}

.prose h2 {
  margin-top: 1.6em;
  margin-bottom: 0.55em;
  font-size: clamp(1.5rem, 2.6vw, 2rem);
}

.prose h2:first-child {
  margin-top: 0;
}

.prose h3 {
  margin-top: 1.4em;
}

.prose p {
  font-size: 1.03rem;
  line-height: 1.75;
}

.prose > p:first-of-type {
  font-size: 1.08rem;
}

.prose .eyebrow {
  margin-bottom: 12px;
}

.ex {
  font-family: var(--font-style);
  font-size: 1.06em;
  padding: 1px 4px;
  border-radius: 5px;
  background: var(--brand-soft);
  color: var(--brand-ink);
}

.callout {
  margin: 26px 0;
  padding: 18px 20px;
  border: 1px solid color-mix(in srgb, var(--brand) 22%, var(--line));
  border-left: 4px solid var(--brand);
  border-radius: 12px;
  background: color-mix(in srgb, var(--brand) 5%, var(--surface));
}

.callout strong {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--ink);
}

.callout p {
  margin: 0;
  font-size: 0.94rem;
  color: var(--muted);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.compat-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 580px;
}

.compat-table th {
  text-align: left;
  padding: 12px 16px;
  background: var(--bg-soft);
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--line);
}

.compat-table td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
}

.compat-table tbody tr:last-child td {
  border-bottom: 0;
}

.compat-table tbody tr:hover {
  background: var(--surface-2);
}

.status {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.status.ok {
  background: color-mix(in srgb, var(--success) 13%, transparent);
  color: var(--success);
}

.status.no {
  background: color-mix(in srgb, var(--danger) 12%, transparent);
  color: var(--danger);
}

.status.warn {
  background: color-mix(in srgb, var(--gold) 16%, transparent);
  color: var(--gold);
}

.table-note {
  margin-top: 14px;
  font-size: 0.84rem;
  color: var(--muted);
}

.faq-list {
  display: grid;
  gap: 10px;
}

.faq {
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  overflow: hidden;
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 18px;
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  font-size: 0.97rem;
  color: var(--ink);
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq-icon {
  position: relative;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--brand-soft);
}

.faq-icon::before,
.faq-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 1.6px;
  border-radius: 2px;
  background: var(--brand-ink);
  transform: translate(-50%, -50%);
  transition: transform 0.2s;
}

.faq-icon::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.faq[open] .faq-icon::after {
  transform: translate(-50%, -50%) rotate(0deg);
}

.faq-body {
  padding: 0 18px 16px;
}

.faq-body p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.65;
}

.jump-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 20px;
}

.jump-links a {
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
}

.jump-links a:hover {
  color: var(--brand-ink);
  border-color: color-mix(in srgb, var(--brand) 28%, var(--line));
}

.check-list {
  list-style: none;
  padding: 0;
  margin: 18px 0;
  display: grid;
  gap: 10px;
}

.check-list li {
  position: relative;
  padding-left: 26px;
  color: var(--ink-soft);
  font-size: 0.94rem;
}

.check-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.42em;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--success) 16%, transparent);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--success) 60%, transparent);
}

.check-list li::after {
  content: "";
  position: absolute;
  left: 4.7px;
  top: 0.68em;
  width: 5px;
  height: 3px;
  border-left: 1.6px solid var(--success);
  border-bottom: 1.6px solid var(--success);
  transform: rotate(-45deg);
}

.legal h2 {
  font-size: 1.32rem;
  margin-top: 1.9em;
}

.legal ul {
  padding-left: 1.1em;
  color: var(--ink-soft);
}

.legal li {
  margin-bottom: 8px;
}

/* 10. Keyboard ============================================================= */
.keyboard-tool {
  padding: clamp(16px, 3vw, 26px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.keyboard-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 18px;
  margin-bottom: 18px;
}

.keyboard-output-wrap {
  position: relative;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
}

.keyboard-output-wrap label,
.keyboard-controls label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
}

.keyboard-output {
  display: block;
  min-height: 2.6em;
  font-family: var(--font-style);
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.keyboard-count {
  display: block;
  margin-top: 6px;
  font-size: 0.72rem;
  color: var(--muted);
}

.keyboard-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.keyboard-controls .btn {
  width: 100%;
}

.keyboard-keys {
  display: grid;
  grid-template-columns: repeat(13, minmax(0, 1fr));
  gap: 6px;
}

.key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 6px 4px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, transform 0.12s;
}

.key:hover {
  background: var(--brand-soft);
  border-color: color-mix(in srgb, var(--brand) 30%, var(--line));
  color: var(--brand-ink);
}

.key:active {
  transform: translateY(1px);
}

.key-space {
  grid-column: span 4;
  font-size: 0.8rem;
}

.key-wide {
  grid-column: span 4;
  font-size: 0.8rem;
}

.keyboard-symbols {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.keyboard-symbols-label {
  margin-right: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
}

.key-symbol {
  min-width: 38px;
  min-height: 36px;
  font-family: var(--font-style);
  font-size: 1rem;
}

.keyboard-note {
  margin: 16px 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

/* 11. Contact ============================================================== */
.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 24px;
  align-items: start;
}

.contact-card {
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.contact-form {
  display: grid;
  gap: 14px;
}

.contact-form label {
  display: grid;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.contact-form input,
.contact-form textarea,
.contact-form select {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
  outline: 0;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.contact-form input:focus,
.contact-form textarea:focus,
.contact-form select:focus {
  border-color: color-mix(in srgb, var(--brand) 55%, var(--line));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 10%, transparent);
}

.contact-form textarea {
  resize: vertical;
  min-height: 140px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.form-status {
  font-size: 0.82rem;
  color: var(--success);
}

.form-note {
  margin: 4px 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.contact-aside {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg-soft);
}

.contact-aside h2 {
  font-size: 1.2rem;
}

.contact-aside .check-list li {
  font-size: 0.88rem;
}

.contact-meta {
  display: grid;
  gap: 3px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 0.86rem;
}

.contact-meta span {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
}

.contact-meta a {
  font-weight: 600;
}

.contact-meta p {
  margin: 0 0 10px;
  color: var(--muted);
}

/* 12. Footer =============================================================== */
.cta-band {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(600px 300px at 15% 0%, rgba(255, 255, 255, 0.16), transparent 60%),
    linear-gradient(120deg, #4c2fd6 0%, #7c4dff 45%, #d94d92 100%);
  color: #fff;
}

.cta-band::after {
  content: "";
  position: absolute;
  right: -80px;
  bottom: -160px;
  width: 380px;
  height: 380px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
}

.cta-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 52px 0;
}

.cta-inner h2 {
  color: #fff;
  margin-bottom: 8px;
}

.cta-inner p:not(.eyebrow) {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.95rem;
  max-width: 560px;
}

.site-footer {
  background: #120e1f;
  color: #b9b1d0;
  padding: 56px 0 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr));
  gap: 36px;
  padding-bottom: 40px;
}

.footer-brand p {
  margin: 16px 0 18px;
  font-size: 0.88rem;
  line-height: 1.65;
  max-width: 360px;
  color: #9c94b8;
}

.footer-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-badges li {
  padding: 3px 9px;
  border: 1px solid #2c2545;
  border-radius: 999px;
  font-size: 0.7rem;
  color: #a79fbe;
}

.footer-col h3 {
  margin: 6px 0 14px;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: #7f769c;
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.footer-col a {
  color: #c4bcdd;
  font-size: 0.87rem;
  text-decoration: none;
}

.footer-col a:hover {
  color: #fff;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
  border-top: 1px solid #241d39;
  font-size: 0.76rem;
  color: #7f769c;
}

.footer-bottom p {
  margin: 0;
}

.footer-bottom ul {
  display: flex;
  gap: 16px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-bottom a {
  color: #7f769c;
  text-decoration: none;
}

.footer-bottom a:hover {
  color: #fff;
}

.to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 70;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
}

.to-top .icon {
  transform: rotate(-90deg);
}

.to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 120;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--bg);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 10px);
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
  max-width: calc(100vw - 32px);
  text-align: center;
}

.toast.show {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.sitemap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 22px;
}

.sitemap-group h2 {
  font-size: 1.05rem;
  margin-bottom: 10px;
}

.sitemap-group ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 7px;
}

.sitemap-group a {
  font-size: 0.88rem;
  color: var(--ink-soft);
  text-decoration: none;
}

.sitemap-group a:hover {
  color: var(--brand-ink);
  text-decoration: underline;
}

.error-hero {
  padding-top: clamp(52px, 7vw, 90px);
  padding-bottom: clamp(52px, 7vw, 90px);
}

.error-hero h1 {
  max-width: 760px;
}

/* 13. Motion and responsive ================================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 1080px) {
  .nav-link {
    padding: 9px 8px;
    font-size: 0.87rem;
  }

  .site-nav {
    margin-left: 4px;
  }

  .style-grid {
    grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
  }

  .keyboard-keys {
    grid-template-columns: repeat(10, minmax(0, 1fr));
  }
}

@media (max-width: 920px) {
  .header-cta {
    display: none;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 85;
    display: block;
    margin: 0;
    padding: 16px 20px 40px;
    background: var(--bg);
    border-top: 1px solid var(--line);
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
  }

  .site-nav.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .nav-item {
    border-bottom: 1px solid var(--line);
  }

  .nav-link {
    display: flex;
    width: 100%;
    padding: 14px 6px;
    font-size: 1rem;
    border-radius: 0;
    justify-content: space-between;
  }

  .nav-item > a.nav-link {
    justify-content: flex-start;
  }

  .nav-link:hover,
  .nav-link.is-active {
    background: transparent;
  }

  .nav-menu,
  .nav-menu.menu-wide,
  .nav-menu.menu-medium {
    position: static;
    min-width: 0;
    display: none;
    grid-template-columns: 1fr;
    opacity: 1;
    visibility: visible;
    transform: none;
    border: 0;
    box-shadow: none;
    padding: 0 0 10px 8px;
    background: transparent;
  }

  .nav-item.open > .nav-menu {
    display: grid;
  }

  /* Disable hover-open on touch layouts */
  .nav-item:hover > .nav-menu,
  .nav-item:focus-within > .nav-menu {
    opacity: 1;
    visibility: visible;
  }

  .nav-item:not(.open) > .nav-menu {
    display: none;
  }

  .lang-switch {
    position: relative;
  }

  .lang-select {
    min-width: 120px;
    font-size: 0.82rem;
  }

  .nav-menu a {
    padding: 10px;
    font-size: 0.92rem;
  }

  .split {
    grid-template-columns: 1fr;
  }

  .split-visual {
    max-width: 520px;
  }

  .contact-layout {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .cta-inner {
    flex-direction: column;
    align-items: flex-start;
    padding: 42px 0;
  }
}

@media (max-width: 760px) {
  body {
    font-size: 16px;
  }

  .container,
  .narrow {
    width: min(100% - 28px, var(--max));
  }

  .section {
    padding: 46px 0;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .hero {
    padding-top: 32px;
  }

  .hero-stats > div {
    padding: 0 10px;
  }

  .hero-stats span {
    font-size: 0.68rem;
  }

  .generator-card {
    border-radius: 20px;
  }

  .gen-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .gen-head-actions {
    width: 100%;
  }

  .gen-head-actions .btn {
    flex: 1;
  }

  .font-menu-top {
    flex-wrap: wrap;
    overflow-x: auto;
    max-height: 108px;
    scrollbar-width: none;
  }

  .font-results {
    gap: 8px;
  }

  .font-category {
    flex: 0 0 75px;
    padding: 2px;
    position: sticky;
    top: calc(var(--header-h) + 8px);
  }

  .font-category-title {
    display: none;
  }

  .font-cat-item {
    padding: 8px;
    font-size: 0.7rem;
  }

  .font-cat-item b {
    font-size: 1rem;
  }

  .fontslist-sec {
    order: 1;
  }

  .font-results .style-grid,
  .style-grid {
    grid-template-columns: 1fr;
  }

  .gen-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .gen-search {
    min-width: 0;
  }

  .style-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 8px;
  }

  .style-preview {
    font-size: 1rem;
  }

  .style-card {
    padding: 10px 10px 8px;
  }

  .style-actions {
    opacity: 1;
  }

  .ready-grid {
    grid-template-columns: 1fr;
  }

  .ready-block {
    padding: 16px;
  }

  .name-chip {
    font-size: 0.88rem;
  }

  .category-grid {
    grid-template-columns: 1fr 1fr;
  }

  .page-grid,
  .family-grid,
  .rules-grid,
  .trouble-grid {
    grid-template-columns: 1fr;
  }

  .compat-table {
    min-width: 520px;
  }

  .keyboard-top {
    grid-template-columns: 1fr;
  }

  .keyboard-keys {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

  .key {
    min-height: 40px;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }

  .cta-inner h2 {
    font-size: 1.7rem;
  }

  .toast {
    bottom: 18px;
  }

  .to-top {
    right: 14px;
    bottom: 14px;
  }
}

@media (max-width: 520px) {
  .category-grid {
    grid-template-columns: 1fr;
  }

  .hero-stats {
    border-radius: 16px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .hero-stats > div {
    border-right: 0;
  }

  .name-field {
    padding-left: 12px;
  }

  .name-count {
    display: none;
  }

  .style-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .style-preview {
    font-size: 0.92rem;
  }

  .style-label {
    font-size: 0.66rem;
  }

  .style-actions {
    position: static;
    justify-content: flex-end;
    opacity: 1;
  }

  .keyboard-keys {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .key-space,
  .key-wide {
    grid-column: span 3;
  }

  .keyboard-symbols {
    max-height: 150px;
    overflow-y: auto;
  }
}

/* Print */
@media print {
  .site-header,
  .site-footer,
  .cta-band,
  .to-top,
  .toast,
  .gen-toolbar,
  .gen-head-actions,
  .gen-search,
  .font-category {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  .style-card {
    break-inside: avoid;
  }
}
