/* ==========================================================================
   FontChanger — site styles
   Light "paper" theme by default, dark theme via [data-theme="dark"].
   ========================================================================== */

:root {
  --bg: #fbf7f0;
  --bg-soft: #f5eee3;
  --surface: #fffdf9;
  --surface-2: #f7f1e7;
  --surface-3: #efe6d8;
  --ink: #191411;
  --ink-2: #453b33;
  --muted: #746658;
  --line: #e8ddcd;
  --line-strong: #d9c9b4;
  --accent: #6d28d9;
  --accent-2: #c026d3;
  --accent-ink: #ffffff;
  --accent-soft: #f3e9ff;
  --accent-line: #d8c4ff;
  --success: #0f766e;
  --success-soft: #e3f5f1;
  --warning: #9a5b07;
  --warning-soft: #fdf0d9;
  --danger: #b42318;
  --danger-soft: #fbe7e4;
  --footer-bg: #171310;
  --footer-ink: #f6efe6;
  --footer-muted: #b4a596;
  --shadow-sm: 0 1px 2px rgba(25, 20, 17, 0.05);
  --shadow-md: 0 2px 6px rgba(25, 20, 17, 0.05), 0 16px 32px -20px rgba(25, 20, 17, 0.25);
  --shadow-lg: 0 4px 10px rgba(25, 20, 17, 0.06), 0 28px 60px -28px rgba(25, 20, 17, 0.35);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --font-sample: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --header-h: 64px;
  --container: 1160px;
  --content: 760px;
}

:root[data-theme="dark"] {
  --bg: #141110;
  --bg-soft: #1b1714;
  --surface: #1e1916;
  --surface-2: #26211d;
  --surface-3: #302924;
  --ink: #f7f0e7;
  --ink-2: #ddcfc0;
  --muted: #a79889;
  --line: #342c26;
  --line-strong: #493d34;
  --accent: #b79bff;
  --accent-2: #f0a6ff;
  --accent-ink: #1a1122;
  --accent-soft: #2a1f45;
  --accent-line: #46326f;
  --success: #6ee7d4;
  --success-soft: #14332f;
  --warning: #f5c06a;
  --warning-soft: #332712;
  --danger: #ff9b90;
  --danger-soft: #3a1d19;
  --footer-bg: #0f0c0b;
  --footer-ink: #f6efe6;
  --footer-muted: #a29486;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.3), 0 18px 36px -22px rgba(0, 0, 0, 0.8);
  --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.35), 0 30px 70px -30px rgba(0, 0, 0, 0.9);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

body {
  margin: 0;
  background:
    radial-gradient(900px 500px at 88% -8%, rgba(109, 40, 217, 0.07), transparent 62%),
    radial-gradient(700px 420px at -8% 8%, rgba(192, 38, 211, 0.05), transparent 60%),
    var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

:root[data-theme="dark"] body {
  background:
    radial-gradient(900px 500px at 88% -8%, rgba(139, 92, 246, 0.13), transparent 62%),
    radial-gradient(700px 420px at -8% 8%, rgba(217, 70, 239, 0.08), transparent 60%),
    var(--bg);
}

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

h1,
h2,
h3,
p,
ul,
ol,
figure,
blockquote {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

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

button {
  cursor: pointer;
}

.icon {
  width: 18px;
  height: 18px;
  flex: none;
}

.icon-sprite {
  position: absolute !important;
  width: 0 !important;
  height: 0 !important;
  overflow: hidden;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.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: fixed;
  top: -100px;
  left: 16px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--bg);
  font-size: 14px;
  font-weight: 600;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 12px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
}

.header__inner {
  display: flex;
  align-items: center;
  gap: 28px;
  height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex: none;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-family: var(--font-display);
  font-size: 17px;
  font-style: italic;
  letter-spacing: -0.04em;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.brand__word {
  font-size: 17px;
  font-weight: 750;
  letter-spacing: -0.025em;
}

.brand__word-accent {
  color: var(--accent);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-right: auto;
}

.main-nav a {
  font-size: 13.5px;
  font-weight: 520;
  color: var(--ink-2);
  text-decoration: none;
  white-space: nowrap;
  padding: 6px 0;
  border-bottom: 1.5px solid transparent;
}

.main-nav a:hover {
  color: var(--ink);
}

.main-nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
}

.lang-switch:hover {
  border-color: var(--line-strong);
}

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

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

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

.icon-btn:active {
  transform: scale(0.96);
}

.theme-toggle .icon {
  width: 17px;
  height: 17px;
}

.theme-toggle .icon:first-child {
  display: none;
}

:root[data-theme="dark"] .theme-toggle .icon:first-child {
  display: block;
}

:root[data-theme="dark"] .theme-toggle .icon:last-child {
  display: none;
}

.mobile-nav {
  position: relative;
  display: none;
}

.mobile-nav summary {
  list-style: none;
}

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

.mobile-nav nav {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  display: grid;
  min-width: 220px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.mobile-nav nav a {
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  text-decoration: none;
}

.mobile-nav nav a:hover {
  background: var(--surface-2);
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: 64px 0 34px;
}

.hero__inner {
  position: relative;
  z-index: 2;
  max-width: 780px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 14%, transparent);
}

.hero h1 {
  max-width: 16ch;
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 5.7rem);
  font-weight: 400;
  line-height: 0.94;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.hero .lede {
  max-width: 60ch;
  margin-top: 20px;
  font-size: clamp(1rem, 1.6vw, 1.18rem);
  line-height: 1.6;
  color: var(--ink-2);
  text-wrap: pretty;
}

.hero__stats {
  display: flex;
  gap: 28px;
  margin-top: 26px;
}

.hero__stats li {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hero__stats strong {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 400;
  line-height: 1;
}

.hero__stats span {
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero__glyphs {
  position: absolute;
  top: 30px;
  right: max(2vw, 20px);
  width: 38vw;
  height: 300px;
  pointer-events: none;
  user-select: none;
  z-index: 1;
  opacity: 0.9;
}

.hero__glyph {
  position: absolute;
  font-family: var(--font-display);
  font-size: clamp(80px, 11vw, 150px);
  line-height: 1;
  color: var(--ink);
  opacity: 0.06;
  letter-spacing: -0.05em;
  white-space: nowrap;
}

:root[data-theme="dark"] .hero__glyph {
  opacity: 0.09;
}

.hero__glyph--1 {
  top: 0;
  right: 12%;
  color: var(--accent);
  opacity: 0.12;
}

.hero__glyph--2 {
  top: 96px;
  right: 0;
  transform: rotate(-6deg);
}

.hero__glyph--3 {
  top: 190px;
  right: 22%;
  transform: rotate(4deg);
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn,
.copy-btn,
.share-btn,
.trim-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.14s ease, background 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}

.btn:hover,
.copy-btn:hover,
.share-btn:hover,
.trim-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.share-btn {
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 8px 20px -10px color-mix(in srgb, var(--accent) 70%, transparent);
}

.share-btn:hover {
  color: #fff;
  filter: brightness(1.06);
}

.trim-btn {
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  background: transparent;
}

.copy-btn {
  flex: 1;
  min-height: 38px;
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
}

.copy-btn:hover {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

.copy-btn.is-copied {
  background: var(--success-soft);
  border-color: color-mix(in srgb, var(--success) 30%, transparent);
  color: var(--success);
}

.copy-btn.is-copied .ico-copy {
  --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12.5l5 5L20 6.5'/%3E%3C/svg%3E");
}

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


/* CSS-drawn icons keep the 300-card markup small. */
.ico {
  display: inline-block;
  width: 16px;
  height: 16px;
  flex: none;
  background-color: currentColor;
  -webkit-mask: var(--ico) center / contain no-repeat;
  mask: var(--ico) center / contain no-repeat;
}

.ico-copy {
  --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='9' width='11' height='11' rx='2'/%3E%3Cpath d='M5 15V5a2 2 0 0 1 2-2h10'/%3E%3C/svg%3E");
}

.ico-link {
  --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 13a5 5 0 0 0 7.1.1l2-2a5 5 0 0 0-7.1-7.1l-1.1 1.1'/%3E%3Cpath d='M14 11a5 5 0 0 0-7.1-.1l-2 2A5 5 0 0 0 12 20l1.1-1.1'/%3E%3C/svg%3E");
}

.ico-star {
  --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3.5l2.6 5.3 5.8.8-4.2 4.1 1 5.8-5.2-2.7-5.2 2.7 1-5.8-4.2-4.1 5.8-.8z'/%3E%3C/svg%3E");
}

.badge-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.badge-legend .badge {
  font-size: 9px;
  padding: 2px 7px;
}

.copy-btn .ico {
  width: 15px;
  height: 15px;
}

/* --------------------------------------------------------------------------
   Tool
   -------------------------------------------------------------------------- */

.tool {
  position: relative;
  padding: 4px 0 10px;
}

.tool-dock {
  position: sticky;
  top: var(--header-h);
  z-index: 60;
  padding: 10px 0 12px;
  background: linear-gradient(to bottom, var(--bg) 55%, color-mix(in srgb, var(--bg) 88%, transparent) 78%, transparent);
}

.tool-card {
  padding: 12px 14px 10px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.tool-card:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent), var(--shadow-md);
}

.tool-card__row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.tool-card__glyph {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  margin-top: 2px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent-soft), color-mix(in srgb, var(--accent-2) 12%, var(--surface)));
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 17px;
  font-style: italic;
  letter-spacing: -0.05em;
}

.tool-input {
  width: 100%;
  font-family: var(--font-sample);
  min-height: 42px;
  max-height: 168px;
  padding: 8px 2px;
  border: 0;
  background: transparent;
  font-size: 19px;
  line-height: 1.35;
  resize: none;
  overflow-y: auto;
  outline: none;
}

.tool-input::placeholder {
  color: color-mix(in srgb, var(--muted) 78%, transparent);
}

.clear-btn {
  width: 32px;
  height: 32px;
  margin-top: 5px;
  border: 0;
  background: transparent;
}

.clear-btn:hover {
  background: var(--surface-2);
}

.tool-card__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 32px;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}

.counter {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.01em;
  color: var(--muted);
  white-space: nowrap;
}

.counter.is-over {
  color: var(--danger);
  font-weight: 700;
}

.limit-warning {
  font-size: 12px;
  font-weight: 600;
  color: var(--danger);
}

.limit-warning[hidden] {
  display: none;
}

.tool-card__meta .share-btn {
  margin-left: auto;
  min-height: 34px;
  padding: 0 14px;
  font-size: 12.5px;
}

.tool-card__meta .trim-btn {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 30%, transparent);
}

.tool-controls {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-top: 8px;
}

.control {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.control label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.control select,
.control input[type="search"] {
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  font-size: 14px;
}

.control select {
  min-width: 230px;
  padding: 0 38px 0 13px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23746658' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  cursor: pointer;
}

.control--search {
  flex: 1;
  max-width: 380px;
}

.control--search > .icon {
  position: absolute;
  left: 14px;
  top: 50%;
  width: 17px;
  height: 17px;
  color: var(--muted);
  pointer-events: none;
  transform: translateY(-50%);
}

.control--search input {
  width: 100%;
  padding: 0 38px 0 42px;
}

.control--search input::-webkit-search-cancel-button {
  display: none;
}

.search-clear {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
}

.search-clear:hover {
  background: var(--surface-2);
}

.search-clear[hidden] {
  display: none;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 16px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 600;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

.chip:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.chip.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

.chip__count {
  font-family: var(--font-mono);
  font-size: 10px;
  opacity: 0.55;
}

.chip__count:empty {
  display: none;
}

.tool-note {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}

.tool-note a {
  color: var(--accent);
}

.tool-note--bottom {
  margin-top: 18px;
  text-align: center;
}

/* --------------------------------------------------------------------------
   Section heads, popular picks, style cards
   -------------------------------------------------------------------------- */

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin: 46px 0 16px;
}

.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.section-head p {
  font-size: 12.5px;
  color: var(--muted);
}

.section-head--center {
  display: block;
  text-align: center;
  margin-bottom: 26px;
}

.section-head--center .eyebrow {
  margin-bottom: 8px;
}

.section-head--tight {
  align-items: center;
  margin-bottom: 10px;
}

.section-head--styles {
  align-items: flex-end;
}

.section-head__aside {
  max-width: 340px;
  text-align: right;
  line-height: 1.5;
}

.popular__row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.popular .style-card {
  margin: 0;
}

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

.style-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
  padding: 15px 15px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  content-visibility: auto;
  contain-intrinsic-size: auto 156px;
  scroll-margin-top: calc(var(--header-h) + 128px);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.style-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

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

.style-card.is-hidden {
  display: none;
}

.style-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 22px;
}

.style-card__name {
  font-size: 14px;
  font-weight: 680;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: none;
  padding: 2px 8px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: currentColor;
}

.badge--all {
  background: var(--success-soft);
  color: var(--success);
}

.badge--most {
  background: var(--warning-soft);
  color: var(--warning);
}

.badge--limited {
  background: var(--danger-soft);
  color: var(--danger);
}

.style-card__sample {
  display: -webkit-box;
  font-family: var(--font-sample);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  min-height: 62px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface-2);
  font-size: 20px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.style-card__desc {
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--muted);
}

.style-card__actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
}

.style-card__actions .icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: transparent;
}

.style-card__actions .icon-btn .icon {
  width: 16px;
  height: 16px;
}

.fav-btn[aria-pressed="true"] {
  color: var(--accent);
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.fav-btn[aria-pressed="true"] .icon {
  fill: currentColor;
}

.style-card--compact {
  padding: 11px 12px 9px;
  gap: 7px;
}

.style-card--compact .style-card__name {
  font-size: 12.5px;
}

.style-card--compact .style-card__sample {
  min-height: 42px;
  padding: 7px 9px;
  font-size: 16px;
  -webkit-line-clamp: 1;
}

.style-card--compact .copy-btn {
  min-height: 32px;
  font-size: 12px;
}

.style-card--compact .copy-btn .icon {
  width: 13px;
  height: 13px;
}

.empty-state {
  padding: 34px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  text-align: center;
  color: var(--muted);
}

.empty-state[hidden] {
  display: none;
}

.recent[hidden] {
  display: none;
}

/* --------------------------------------------------------------------------
   Linked style (deep links)
   -------------------------------------------------------------------------- */

.linked {
  margin-top: 24px;
  padding: 18px 18px 20px;
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent-soft) 82%, transparent), transparent 65%),
    var(--surface);
  box-shadow: var(--shadow-md);
  scroll-margin-top: calc(var(--header-h) + 128px);
}

.linked .section-head {
  margin: 0 0 8px;
}

.linked .section-head h2 {
  font-size: clamp(22px, 2.6vw, 28px);
}

.linked__note {
  max-width: 72ch;
  margin-bottom: 14px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--muted);
}

.linked__row {
  max-width: none;
}

.linked .style-card {
  content-visibility: visible;
  box-shadow: var(--shadow-sm);
}

.linked .style-card:hover {
  transform: none;
}

.link-quiet {
  align-self: flex-end;
  padding: 6px 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.style-card.is-target {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
  content-visibility: visible;
}

/* --------------------------------------------------------------------------
   Content
   -------------------------------------------------------------------------- */

.content {
  padding: 46px 0 10px;
}

.content__inner {
  max-width: var(--content);
}

.prose {
  margin-bottom: 46px;
}

.prose h2 {
  margin-bottom: 16px;
  font-family: var(--font-display);
  font-size: clamp(27px, 3.4vw, 36px);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.prose p {
  margin-bottom: 15px;
  font-size: 17px;
  line-height: 1.75;
  color: var(--ink-2);
  text-wrap: pretty;
}

.prose p:last-child {
  margin-bottom: 0;
}

.prose a {
  color: var(--accent);
  text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
  text-decoration-line: underline;
}

.prose a:hover {
  text-decoration-color: var(--accent);
}

.prose strong {
  color: var(--ink);
  font-weight: 650;
}

.content-list {
  display: grid;
  gap: 10px;
  margin: 18px 0 4px;
}

.content-list li {
  position: relative;
  padding-left: 28px;
  font-size: 16.5px;
  line-height: 1.65;
  color: var(--ink-2);
}

.content-list li::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 0.66em;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
}

.content-list--steps {
  counter-reset: step;
  gap: 14px;
}

.content-list--steps li {
  padding-left: 42px;
  counter-increment: step;
}

.content-list--steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  left: 0;
  top: 0.05em;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
}

.note {
  margin: 22px 0 0;
  padding: 14px 18px;
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  background: var(--accent-soft);
  font-size: 14.5px !important;
  line-height: 1.6 !important;
  color: var(--ink-2) !important;
}

.table-wrap {
  margin: 22px 0 6px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.5;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  text-align: left;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

tbody th,
tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
  text-align: left;
  vertical-align: top;
}

tbody tr:last-child th,
tbody tr:last-child td {
  border-bottom: 0;
}

tbody th {
  font-weight: 650;
  color: var(--ink);
  white-space: nowrap;
}

tbody td {
  color: var(--ink-2);
}

.chart-wrap {
  max-height: 460px;
  overflow-y: auto;
}

.letter-chart td {
  font-size: 19px;
  line-height: 1.3;
}

.letter-chart th[scope="row"] {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   FAQ
   -------------------------------------------------------------------------- */

.faq {
  padding: 58px 0 20px;
  border-top: 1px solid var(--line);
  background: linear-gradient(to bottom, transparent, color-mix(in srgb, var(--surface-2) 55%, transparent));
}

.faq__inner {
  max-width: 820px;
}

.faq-list {
  border-top: 1px solid var(--line);
}

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

.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 19px 2px;
  list-style: none;
  cursor: pointer;
  font-size: 16.5px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink);
}

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

.faq-item__icon {
  position: relative;
  width: 18px;
  height: 18px;
  flex: none;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  transition: transform 0.2s ease, background 0.2s ease;
}

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

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

.faq-item[open] .faq-item__icon {
  transform: rotate(45deg);
  background: var(--accent-soft);
  border-color: var(--accent-line);
}

.faq-item__answer {
  padding: 0 40px 20px 2px;
}

.faq-item__answer p {
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   Related
   -------------------------------------------------------------------------- */

.related {
  padding: 54px 0 76px;
}

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

.related-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
  transition: border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.related-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.related-card__kicker {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
}

.related-card strong {
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 400;
  line-height: 1.15;
}

.related-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: auto;
  padding-top: 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}

.related-card:hover .related-card__cta {
  color: var(--accent);
}

.related-card__cta .icon {
  width: 14px;
  height: 14px;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
  padding: 54px 0 26px;
  background: var(--footer-bg);
  color: var(--footer-ink);
}

.footer__grid {
  display: grid;
  grid-template-columns: 1.7fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 38px;
}

.footer__brand .brand__word {
  color: var(--footer-ink);
}

.footer__brand .brand__word-accent {
  color: #c4b5fd;
}

.footer__brand p {
  max-width: 34ch;
  margin-top: 14px;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--footer-muted);
}

.footer__note {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10.5px !important;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.footer__note .icon {
  width: 13px;
  height: 13px;
}

.footer__col h2 {
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--footer-muted);
}

.footer__col ul {
  display: grid;
  gap: 9px;
}

.footer__col a {
  font-size: 13.5px;
  text-decoration: none;
  color: var(--footer-ink);
  opacity: 0.86;
}

.footer__col a:hover {
  opacity: 1;
  color: #c4b5fd;
}

.footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.03em;
  color: var(--footer-muted);
}

/* --------------------------------------------------------------------------
   Reverse tool
   -------------------------------------------------------------------------- */

.tool--reverse .tool-dock {
  position: static;
}

.reverse-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.reverse-pane {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.reverse-pane__label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.tool-input--tall {
  min-height: 132px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  font-size: 18px;
  resize: vertical;
}

.reverse-pane--out .tool-input {
  background: var(--accent-soft);
  border-color: var(--accent-line);
}

.reverse-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--muted);
}

.reverse-hint .icon {
  width: 13px;
  height: 13px;
}

.reverse-help {
  margin-top: 14px;
  font-size: 12px;
  color: var(--muted);
}

.reverse-help p {
  max-width: 70ch;
}

/* --------------------------------------------------------------------------
   Toast
   -------------------------------------------------------------------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 200;
  max-width: calc(100vw - 32px);
  padding: 11px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translate(-50%, 16px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

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

/* --------------------------------------------------------------------------
   404
   -------------------------------------------------------------------------- */

.page-404 .not-found {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  min-height: 78vh;
  padding-top: 80px;
  padding-bottom: 80px;
}

.page-404 h1 {
  max-width: 18ch;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.03em;
}

.page-404 .lede {
  max-width: 54ch;
  margin: 18px 0 28px;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (min-width: 1180px) {
  .style-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1080px) {
  .popular__row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .hero__glyphs {
    width: 34vw;
    opacity: 0.7;
  }
}

@media (max-width: 900px) {
  .main-nav {
    display: none;
  }

  .mobile-nav {
    display: block;
  }

  .hero {
    padding: 44px 0 26px;
  }

  .hero__glyphs {
    display: none;
  }

  .hero__inner {
    max-width: none;
  }

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

  .style-card {
    contain-intrinsic-size: auto 140px;
  }

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

  .footer__grid {
    grid-template-columns: 1fr 1fr;
    gap: 30px;
  }

  .footer__brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .container {
    padding: 0 18px;
  }

  .hero h1 {
    font-size: clamp(2.55rem, 12vw, 3.6rem);
  }

  .hero .lede {
    margin-top: 14px;
    font-size: 15.5px;
  }

  .hero__stats {
    gap: 22px;
    margin-top: 20px;
  }

  .popular__row {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 6px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .popular__row::-webkit-scrollbar {
    display: none;
  }

  .popular__row .style-card {
    flex: 0 0 200px;
    scroll-snap-align: start;
  }

  .tool-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .control select {
    width: 100%;
    min-width: 0;
  }

  .control--search {
    max-width: none;
  }

  .chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .chips::-webkit-scrollbar {
    display: none;
  }

  .chip {
    flex: none;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    margin-top: 34px;
  }

  .section-head__aside {
    text-align: left;
  }

  .prose p {
    font-size: 16.5px;
  }

  .table-wrap {
    margin-left: -18px;
    margin-right: -18px;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }

  thead th,
  tbody th,
  tbody td {
    padding: 10px 14px;
  }

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

  .faq-item summary {
    font-size: 15.5px;
    gap: 16px;
  }

  .faq-item__answer {
    padding-right: 10px;
  }

  .footer__grid {
    grid-template-columns: 1fr 1fr;
    gap: 26px;
  }

  .footer__bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}

@media (max-width: 480px) {
  .header__inner {
    gap: 10px;
  }

  .brand__word {
    font-size: 15.5px;
  }

  .lang-switch {
    padding: 6px 9px;
  }

  .lang-switch .icon {
    display: none;
  }

  .tool-card {
    padding: 10px 12px 8px;
    border-radius: 18px;
  }

  .tool-card__glyph {
    width: 34px;
    height: 34px;
    font-size: 15px;
  }

  .tool-input {
    font-size: 17px;
  }

  .tool-card__meta {
    gap: 8px;
  }

  .tool-card__meta .share-btn span {
    display: none;
  }

  .tool-card__meta .share-btn {
    padding: 0 11px;
  }

  .hero__stats strong {
    font-size: 22px;
  }

  .style-card__sample {
    font-size: 18px;
  }

  .related-card {
    padding: 17px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
