/*  1. GOOGLE FONTS  */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;0,700;1,300;1,400;1,600&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,300&family=DM+Mono:wght@300;400;500&display=swap');

/*  2. DESIGN TOKENS  */
:root {
  /* Layout */
  --max-w: 1200px;
  --gutter: 32px;
  --gutter-sm: 20px;
  /* Core Palette — Ivory & Obsidian */
  --bg: #F9F7F4;
  --bg-alt: #F2EFE9;
  --bg-deep: #EAE6DF;
  --surface: #FFFFFF;
  --surface-2: #FAF8F5;
  --surface-3: #F2EFE9;
  /* Gold Accent System */
  --gold: #C8A84B;
  --gold-light: #E2C97E;
  --gold-dark: #9A7B2E;
  --gold-pale: rgba(200, 168, 75, 0.10);
  --gold-glow: rgba(200, 168, 75, 0.22);
  --gold-border: rgba(200, 168, 75, 0.30);
  /* Obsidian Text Scale */
  --ink: #1A1714;
  --ink-2: #2E2B26;
  --text-1: #1A1714;
  --text-2: #4A4540;
  --text-3: #8A837A;
  --text-4: #B8B0A8;
  --text-inv: #FFFFFF;
  /* Borders */
  --line: rgba(26, 23, 20, 0.07);
  --line-mid: rgba(26, 23, 20, 0.12);
  --line-str: rgba(26, 23, 20, 0.20);
  /* Shadows — warm & layered */
  --sh-xs: 0 1px 3px rgba(26, 23, 20, 0.05);
  --sh-sm: 0 2px 12px rgba(26, 23, 20, 0.07), 0 1px 3px rgba(26, 23, 20, 0.04);
  --sh-md: 0 8px 32px rgba(26, 23, 20, 0.09), 0 2px 8px rgba(26, 23, 20, 0.05);
  --sh-lg: 0 20px 60px rgba(26, 23, 20, 0.12), 0 6px 18px rgba(26, 23, 20, 0.06);
  --sh-gold: 0 6px 28px rgba(200, 168, 75, 0.28), 0 2px 8px rgba(200, 168, 75, 0.15);
  --sh-xl: 0 32px 80px rgba(26, 23, 20, 0.15);
  /* Radii */
  --r-xs: 3px;
  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 24px;
  --r-2xl: 32px;
  --r-pill: 9999px;
  /* Typography */
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-ui: 'DM Sans', system-ui, sans-serif;
  --font-mono: 'DM Mono', 'Cascadia Code', monospace;
  /* Easings */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.40, 0.64, 1);
  --ease-snap: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.45, 0, 0.55, 1);
  /* Gradients */
  --grad-gold: linear-gradient(135deg, #C8A84B 0%, #E2C97E 50%, #C8A84B 100%);
  --grad-dark: linear-gradient(160deg, #1A1714 0%, #2E2923 50%, #1A1714 100%);
  --grad-surface: linear-gradient(180deg, #FFFFFF 0%, #FAF8F5 100%);
  --grad-bg: linear-gradient(180deg, #F9F7F4 0%, #F2EFE9 100%);
  --grad-mesh:
    radial-gradient(ellipse 70% 60% at 10% 90%, rgba(200, 168, 75, 0.05) 0%, transparent 70%),
    radial-gradient(ellipse 50% 50% at 90% 10%, rgba(200, 168, 75, 0.04) 0%, transparent 60%),
    radial-gradient(ellipse 80% 40% at 50% 110%, rgba(26, 23, 20, 0.02) 0%, transparent 70%);
  /* Header overlay */
  --overlay: rgba(249, 247, 244, 0.92);
}

/*  3. DARK MODE  */
.dark {
  --bg: #131210;
  --bg-alt: #1A1814;
  --bg-deep: #211F1A;
  --surface: #1E1C18;
  --surface-2: #252218;
  --surface-3: #2C2920;
  --gold: #C8A84B;
  --gold-light: #D4B86A;
  --gold-dark: #E2C97E;
  --gold-pale: rgba(200, 168, 75, 0.08);
  --gold-glow: rgba(200, 168, 75, 0.18);
  --gold-border: rgba(200, 168, 75, 0.22);
  --text-1: #EDE8E2;
  --text-2: #9A9088;
  --text-3: #5A5248;
  --text-4: #3A3530;
  --text-inv: #1A1714;
  --line: rgba(237, 232, 226, 0.06);
  --line-mid: rgba(237, 232, 226, 0.10);
  --line-str: rgba(237, 232, 226, 0.16);
  --sh-xs: 0 1px 3px rgba(0, 0, 0, 0.25);
  --sh-sm: 0 2px 12px rgba(0, 0, 0, 0.35), 0 1px 3px rgba(0, 0, 0, 0.20);
  --sh-md: 0 8px 32px rgba(0, 0, 0, 0.45), 0 2px 8px rgba(0, 0, 0, 0.25);
  --sh-lg: 0 20px 60px rgba(0, 0, 0, 0.55), 0 6px 18px rgba(0, 0, 0, 0.30);
  --sh-gold: 0 6px 28px rgba(200, 168, 75, 0.22), 0 2px 8px rgba(200, 168, 75, 0.12);
  --sh-xl: 0 32px 80px rgba(0, 0, 0, 0.65);
  --grad-surface: linear-gradient(180deg, #1E1C18 0%, #252218 100%);
  --grad-bg: linear-gradient(180deg, #131210 0%, #1A1814 100%);
  --grad-mesh:
    radial-gradient(ellipse 70% 60% at 10% 90%, rgba(200, 168, 75, 0.04) 0%, transparent 70%),
    radial-gradient(ellipse 50% 50% at 90% 10%, rgba(200, 168, 75, 0.03) 0%, transparent 60%);
  --overlay: rgba(19, 18, 16, 0.94);
}

/*  4. RESET  */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
  scroll-behavior: smooth;
}

body {
  height: 100%;
}

a {
  text-decoration: none;
  color: inherit;
}

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

ul {
  list-style: none;
}

button {
  font-family: var(--font-ui);
}

/*  5. THEME TRANSITIONS  */
body,
header,
footer,
.surface-transition {
  transition:
    background-color 0.32s var(--ease-snap),
    border-color 0.32s var(--ease-snap),
    color 0.22s var(--ease-snap);
}

.loader,
.loader * {
  transition: none !important;
}

/*  6. BODY & BASE TYPOGRAPHY  */
body {
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.75;
  color: var(--text-1);
  background-color: var(--bg);
  background-image: var(--grad-mesh);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-bottom: 100px;
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 300;
  line-height: 1.10;
  letter-spacing: -0.02em;
  font-style: italic;
  color: var(--text-1);
}

h2 {
  font-family: var(--font-ui);
  font-size: 0.60rem;
  font-weight: 600;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--text-3);
}

h3 {
  font-family: var(--font-ui);
  font-size: 0.80rem;
  font-weight: 500;
  color: var(--text-2);
}

/*  7. LAYOUT CONTAINER  */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/*  8. HEADER  */
header {
  background: var(--grad-dark);
  position: relative;
  z-index: 50;
}

/* Thin gold divider at bottom */
header::after {
  content: '';
  display: block;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg,
      transparent 0%,
      rgba(200, 168, 75, 0.40) 15%,
      #C8A84B 50%,
      rgba(200, 168, 75, 0.40) 85%,
      transparent 100%);
}

header .inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

header a {
  font-family: var(--font-ui);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.38);
  padding: 5px 10px;
  border-radius: var(--r-sm);
  transition: color 0.20s, background 0.20s;
}

header a:hover {
  color: var(--gold-light);
  background: rgba(200, 168, 75, 0.10);
}

/* Brand mark in header center */
.entry-header {
  width: 100%;
  text-align: center;
  padding: 16px 0 6px;
}

.entry-header p {
  color: var(--text-3);
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0.02em;
}

/*  9. THEME TOGGLE  */
#themeToggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(200, 168, 75, 0.28);
  background: rgba(200, 168, 75, 0.07);
  color: rgba(255, 255, 255, 0.55);
  font-family: var(--font-ui);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition:
    background 0.22s,
    border-color 0.22s,
    color 0.22s,
    box-shadow 0.22s;
}

#themeToggle:hover {
  background: rgba(200, 168, 75, 0.18);
  border-color: rgba(200, 168, 75, 0.55);
  color: var(--gold-light);
  box-shadow: 0 4px 18px rgba(200, 168, 75, 0.18);
}

#themeToggle .icon-sun {
  display: none;
}

#themeToggle .icon-moon {
  display: inline;
}

#themeToggle .label-dark {
  display: inline;
}

#themeToggle .label-light {
  display: none;
}

.dark #themeToggle .icon-moon {
  display: none;
}

.dark #themeToggle .icon-sun {
  display: inline;
}

.dark #themeToggle .label-dark {
  display: none;
}

.dark #themeToggle .label-light {
  display: inline;
}

/*  10. CATEGORY PILLS  */
#topMenu {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 24px 0;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  scroll-behavior: smooth;
  scrollbar-width: none;
}

#topMenu::-webkit-scrollbar {
  display: none;
}

#topMenu a {
  display: inline-flex;
  align-items: center;
  padding: 8px 20px;
  border-radius: var(--r-pill);
  font-family: var(--font-ui);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
  border: 1px solid var(--line-mid);
  background: var(--surface);
  white-space: nowrap;
  box-shadow: var(--sh-xs);
  transition:
    color 0.20s,
    background 0.20s,
    border-color 0.20s,
    transform 0.24s var(--ease-spring),
    box-shadow 0.20s;
}

#topMenu a:hover {
  color: var(--gold-dark);
  background: var(--gold-pale);
  border-color: var(--gold-border);
  transform: translateY(-2px);
  box-shadow: var(--sh-gold);
}

#topMenu a.active {
  color: var(--text-inv);
  background: var(--grad-dark);
  border-color: transparent;
  box-shadow: var(--sh-md);
  font-weight: 600;
  position: relative;
}

/* Gold dot on active pill */
#topMenu a.active::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  background: var(--gold);
  border-radius: 50%;
  margin-right: 7px;
  flex-shrink: 0;
}

#topMenu h3 {
  font-size: 0.52rem;
  font-weight: 600;
  color: var(--text-4);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  white-space: nowrap;
  margin: 0 6px;
}

.dark #topMenu a {
  background: var(--surface);
  border-color: var(--line-mid);
  color: var(--text-2);
}

.dark #topMenu a:hover {
  color: var(--gold-light);
  background: var(--gold-pale);
  border-color: var(--gold-border);
}

.dark #topMenu a.active {
  background: var(--grad-gold);
  color: var(--text-inv);
  border-color: transparent;
}

/*  11. STICKY SEARCH BAR  */
.input-section {
  display: flex;
  align-items: center;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 40;
  padding: 12px 0 14px;
  margin-left: calc(-1 * var(--gutter));
  margin-right: calc(-1 * var(--gutter));
  padding-left: var(--gutter);
  padding-right: var(--gutter);
  background: var(--overlay);
  backdrop-filter: blur(28px) saturate(1.8);
  -webkit-backdrop-filter: blur(28px) saturate(1.8);
  border-bottom: 1px solid var(--line);
}

.input-section div {
  position: relative;
  width: 100%;
}

.input-section input {
  width: 100%;
  padding: 14px 52px 14px 22px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line-mid);
  background: var(--surface);
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--text-1);
  outline: none;
  box-shadow: var(--sh-sm);
  transition:
    border-color 0.22s,
    box-shadow 0.22s,
    transform 0.22s var(--ease-spring);
}

.input-section input::placeholder {
  color: var(--text-4);
  font-weight: 400;
  font-style: italic;
}

.input-section input:focus {
  border-color: var(--gold);
  box-shadow:
    0 0 0 3px var(--gold-pale),
    var(--sh-sm);
  transform: translateY(-1px);
}

#input-count {
  position: absolute;
  right: 50px;
  bottom: 4px;
  font-size: 9px;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: 0.06em;
  opacity: 0.50;
  font-family: var(--font-mono);
}

.clear-overlay {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--r-md);
  cursor: pointer;
  color: var(--text-3);
  z-index: 10;
  transition: color 0.18s, background 0.18s;
}

.clear-overlay:hover {
  color: var(--ink);
  background: var(--gold-pale);
}

.dark .input-section {
  background: rgba(19, 18, 16, 0.94);
  border-color: var(--line);
}

.dark .input-section input {
  background: var(--surface);
  color: var(--text-1);
  border-color: var(--line-mid);
}

.dark .input-section input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(200, 168, 75, 0.14), var(--sh-sm);
}

/*  12. BUTTON BASE RESET  */
button,
#othertools a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  background: transparent;
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

button:hover {
  opacity: 0.94;
}

/*  13. BUTTON VARIANTS  */
/* Primary — Gold */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 12px 28px;
  border-radius: var(--r-md);
  border: none;
  font-family: var(--font-ui);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  color: var(--ink);
  background: var(--grad-gold);
  box-shadow: var(--sh-gold);
  transition:
    transform 0.22s var(--ease-spring),
    box-shadow 0.20s,
    opacity 0.18s;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.20) 0%, transparent 60%);
  pointer-events: none;
}

.btn:hover {
  transform: translateY(-2px) scale(1.015);
  box-shadow:
    0 14px 40px rgba(200, 168, 75, 0.45),
    0 4px 14px rgba(200, 168, 75, 0.25);
  opacity: 1;
}

.btn:active {
  transform: scale(0.97);
}

/* Secondary */
.btn.secondary {
  background: var(--surface);
  color: var(--text-2);
  border: 1px solid var(--line-mid);
  box-shadow: var(--sh-xs);
}

.btn.secondary::before {
  display: none;
}

.btn.secondary:hover {
  border-color: var(--gold-border);
  color: var(--gold-dark);
  background: var(--gold-pale);
  box-shadow: var(--sh-gold);
}

/* Close / danger */
button.btn.closeit {
  background: rgba(200, 60, 60, 0.07);
  color: #C03838;
  border: 1px solid rgba(200, 60, 60, 0.18);
}

/* Hamburger */
button#menu {
  height: 40px;
  width: 40px;
  border-radius: var(--r-md);
  border: 1px solid var(--line-mid);
  background: var(--surface);
  box-shadow: var(--sh-xs);
  color: var(--text-2);
  font-size: 1.1rem;
  transition:
    border-color 0.20s,
    background 0.20s,
    color 0.20s,
    box-shadow 0.20s;
}

button#menu:hover {
  border-color: var(--gold-border);
  background: var(--gold-pale);
  color: var(--gold-dark);
  box-shadow: var(--sh-gold);
}

.dark .btn {
  background: var(--grad-gold);
  color: var(--ink);
}

.dark .btn.secondary {
  background: var(--surface);
  color: var(--text-2);
  border-color: var(--line-mid);
}

.dark .btn.secondary:hover {
  background: var(--gold-pale);
  color: var(--gold-light);
  border-color: var(--gold-border);
}

.dark button#menu {
  background: var(--surface);
  border-color: var(--line-mid);
  color: var(--text-2);
}

.dark button#menu:hover {
  background: var(--gold-pale);
  border-color: var(--gold-border);
  color: var(--gold-light);
}

/*  14. OTHER TOOLS LINKS  */
#othertools a {
  padding: 8px 16px;
  background: var(--surface);
  color: var(--text-2);
  border-radius: var(--r-sm);
  font-family: var(--font-ui);
  font-size: 0.68rem;
  font-weight: 500;
  border: 1px solid var(--line);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: var(--sh-xs);
  transition:
    background 0.20s,
    color 0.20s,
    border-color 0.20s,
    transform 0.22s var(--ease-spring),
    box-shadow 0.20s;
}

#othertools a:hover {
  background: var(--gold-pale);
  color: var(--gold-dark);
  border-color: var(--gold-border);
  transform: translateY(-1px);
  box-shadow: var(--sh-gold);
}

.dark #othertools a {
  background: var(--surface);
  color: var(--text-2);
  border-color: var(--line);
}

.dark #othertools a:hover {
  background: var(--gold-pale);
  color: var(--gold-light);
  border-color: var(--gold-border);
}

/*  15. SVG ICONS  */
svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.7;
  fill: none;
  flex-shrink: 0;
}

.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/*  16. RANDOM WORD CLOUD  */
#randomcloud {
  text-align: center;
  width: 100%;
  overflow: auto;
  scrollbar-width: none;
}

#randomcloud::-webkit-scrollbar {
  display: none;
}

#randomcloud li {
  background: transparent;
  border: none;
  box-shadow: none;
}

#randomcloud p {
  background: transparent;
  border: none;
  color: var(--text-2);
  font-family: var(--font-display);
  font-size: 2rem !important;
  font-weight: 300;
  font-style: italic;
  padding: 10px 0 0;
  margin: 0;
  cursor: pointer;
  text-align: center;
  transition:
    color 0.22s,
    transform 0.28s var(--ease-spring);
}

#randomcloud p:hover {
  color: var(--gold-dark);
  transform: scale(1.08);
}

.dark #randomcloud p {
  color: var(--text-2);
}

.dark #randomcloud p:hover {
  color: var(--gold-light);
}

/* Random Button */
#randombutton {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border-radius: var(--r-md);
  padding: 14px 38px;
  margin-top: 20px;
  background: var(--grad-dark);
  color: rgba(255, 255, 255, 0.90);
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.80rem;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  border: 1px solid rgba(200, 168, 75, 0.24);
  cursor: pointer;
  box-shadow: var(--sh-md);
  transition:
    transform 0.24s var(--ease-spring),
    box-shadow 0.20s,
    border-color 0.20s;
  position: relative;
  overflow: hidden;
}

#randombutton::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(200, 168, 75, 0.12) 0%, transparent 60%);
  pointer-events: none;
}

#randombutton:hover {
  transform: translateY(-3px) scale(1.015);
  box-shadow: var(--sh-lg);
  border-color: rgba(200, 168, 75, 0.45);
}

.dark #randombutton {
  background: var(--grad-dark);
  border-color: var(--gold-border);
}

/*  17. FONT SIZE CONTROLLER  */
.font-size-controller {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: flex-end;
  padding: 10px 0;
}

.font-size-controller label {
  font-family: var(--font-ui);
  font-size: 0.58rem;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.font-size-controller input[type="range"] {
  width: 180px;
  height: 3px;
  appearance: none;
  -webkit-appearance: none;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold-light));
  border-radius: var(--r-pill);
  outline: none;
  border: none;
  cursor: pointer;
}

.font-size-controller input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  background: var(--surface);
  border: 2px solid var(--gold);
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(200, 168, 75, 0.35);
  cursor: grab;
  transition:
    transform 0.18s var(--ease-spring),
    box-shadow 0.18s;
}

.font-size-controller input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.28);
  box-shadow: 0 4px 16px rgba(200, 168, 75, 0.55);
}

/*  18. RESULTS GRID  */
#results {
  width: 100%;
}

.grid ul {
  display: grid;
  margin: 0;
  padding: 0;
  gap: 14px;
  grid-template-columns: repeat(3, 1fr);
  list-style: none;
}

/* Font Card Section */
.fontes-de-letraslist {
  margin-bottom: 48px;
}

.fontes-de-letraslist h2 {
  color: var(--text-3);
  margin-bottom: 18px;
  font-size: 0.58rem;
  display: flex;
  align-items: center;
  gap: 14px;
}

.fontes-de-letraslist h2::before {
  content: '';
  display: inline-block;
  width: 18px;
  height: 1px;
  background: var(--gold);
  flex-shrink: 0;
}

.fontes-de-letraslist h2::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* Font Card */
.fontes-de-letraslist li {
  display: flex;
  align-items: stretch;
  position: relative;
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--sh-xs);
  transition:
    transform 0.26s var(--ease-spring),
    box-shadow 0.22s,
    border-color 0.20s;
}

/* Subtle top accent on hover */
.fontes-de-letraslist li::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--grad-gold);
  opacity: 0;
  transition: opacity 0.22s;
}

.fontes-de-letraslist li:hover::before {
  opacity: 1;
}

.fontes-de-letraslist li:hover {
  border-color: var(--gold-border);
  transform: translateY(-4px) scale(1.004);
  box-shadow:
    var(--sh-md),
    0 0 0 1px rgba(200, 168, 75, 0.15),
    var(--sh-gold);
}

.fontes-de-letraslist li p {
  background: transparent;
  padding: 20px 0 32px 20px;
  margin: 0;
  color: var(--text-1);
  cursor: pointer;
  user-select: none;
  text-align: left;
  width: 100%;
  position: relative;
  white-space: normal;
  word-break: break-word;
  font-family: var(--font-ui);
  overflow: hidden;
  border: none;
  line-height: 1.55;
  transition: background 0.16s;
}

.fontes-de-letraslist li p:hover,
.fontes-de-letraslist li p:focus {
  outline: none;
  background: var(--surface-2);
}

/* Card label */
.fontes-de-letraslist li i,
#flourishList li i {
  position: absolute;
  bottom: 7px;
  left: 20px;
  font-size: 8.5px;
  font-weight: 600;
  color: var(--text-3);
  z-index: 2;
  display: flex;
  align-items: baseline;
  gap: 4px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  font-style: normal;
  font-family: var(--font-mono);
  opacity: 0.45;
}

/* Copy button inside card */
.fontes-de-letraslist li button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: var(--font-ui);
  font-size: 8.5px;
  font-weight: 600;
  padding: 8px 14px;
  gap: 4px;
  color: var(--text-3);
  background: var(--surface-2);
  border: none;
  border-left: 1px solid var(--line);
  cursor: pointer;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  transition: background 0.18s, color 0.18s;
}

.fontes-de-letraslist li button:hover {
  background: var(--grad-gold);
  color: var(--ink);
}

.dark .fontes-de-letraslist li {
  background: var(--surface);
  border-color: var(--line);
}

.dark .fontes-de-letraslist li:hover {
  border-color: var(--gold-border);
  box-shadow:
    var(--sh-md),
    0 0 0 1px rgba(200, 168, 75, 0.12),
    var(--sh-gold);
}

.dark .fontes-de-letraslist li p {
  background: var(--surface);
  color: var(--text-1);
}

.dark .fontes-de-letraslist li p:hover,
.dark .fontes-de-letraslist li p:focus {
  background: var(--surface-2);
}

.dark .fontes-de-letraslist li button {
  background: var(--surface-2);
  color: var(--text-3);
  border-color: var(--line);
}

.dark .fontes-de-letraslist li button:hover {
  background: var(--grad-gold);
  color: var(--ink);
}

/*  19. FLOATING ACTION BUTTONS  */
.buttons {
  position: fixed;
  right: 20px;
  bottom: 80px;
  z-index: 99;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
}

.buttons button {
  width: 46px;
  height: 46px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line-mid);
  box-shadow: var(--sh-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-2);
  transition:
    background 0.20s,
    color 0.20s,
    border-color 0.20s,
    transform 0.22s var(--ease-spring),
    box-shadow 0.20s;
}

.buttons button:hover {
  background: var(--grad-dark);
  color: var(--gold-light);
  border-color: var(--gold-border);
  transform: scale(1.10) translateY(-2px);
  box-shadow: var(--sh-lg);
}

#bulbBtn svg {
  stroke: var(--gold-dark);
}

#bulbBtn:hover svg {
  stroke: var(--gold-light);
}

.dark .buttons button {
  background: var(--surface-2);
  color: var(--text-2);
  border-color: var(--line-mid);
}

.dark .buttons button:hover {
  background: var(--grad-dark);
  color: var(--gold-light);
  border-color: var(--gold-border);
}

/*  20. SIDE DRAWER  */
.f-m {
  position: fixed;
  top: 0;
  right: 0;
  width: 290px;
  height: 100%;
  background: var(--surface);
  border-left: 1px solid var(--line-mid);
  box-shadow: -24px 0 70px rgba(26, 23, 20, 0.12);
  z-index: 9999;
  display: none;
  overflow-y: auto;
  padding: 28px 22px;
}

.floatmenu h3 {
  color: var(--text-3);
  font-family: var(--font-ui);
  font-size: 0.54rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-weight: 600;
  margin-bottom: 10px;
}

.floatmenu a,
.right-menu a {
  display: inline-block;
  padding: 7px 14px;
  border-radius: var(--r-sm);
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--line);
  margin: 3px;
  white-space: nowrap;
  transition:
    color 0.18s,
    background 0.18s,
    border-color 0.18s,
    transform 0.20s var(--ease-spring),
    box-shadow 0.18s;
}

.floatmenu a:hover,
.right-menu a:hover {
  color: var(--gold-dark);
  background: var(--gold-pale);
  border-color: var(--gold-border);
  transform: translateY(-1px);
  box-shadow: var(--sh-gold);
}

.dark .f-m {
  background: var(--surface);
  border-color: var(--line-mid);
  box-shadow: -24px 0 70px rgba(0, 0, 0, 0.45);
}

.dark .floatmenu a,
.dark .right-menu a {
  background: var(--surface-2);
  color: var(--text-2);
  border-color: var(--line);
}

.dark .floatmenu a:hover,
.dark .right-menu a:hover {
  background: var(--gold-pale);
  color: var(--gold-light);
  border-color: var(--gold-border);
}

#fMN {
  overflow: auto;
}

.fAr {
  display: none;
}

#menu {
  color: var(--text-2);
}

/*  21. CLOSE BUTTON (drawer)  */
.close-button {
  position: fixed;
  top: 14px;
  right: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  font-size: 15px;
  border: 1px solid var(--line-mid);
  border-radius: var(--r-md);
  color: var(--text-2);
  background: var(--surface);
  box-shadow: var(--sh-sm);
  cursor: pointer;
  z-index: 10000;
  padding: 0;
  transition:
    border-color 0.18s,
    background 0.18s,
    color 0.18s,
    box-shadow 0.18s;
}

.close-button:hover {
  border-color: var(--gold-border);
  background: var(--gold-pale);
  color: var(--gold-dark);
  box-shadow: var(--sh-gold);
}

.dark .close-button {
  background: var(--surface);
  border-color: var(--line-mid);
  color: var(--text-2);
}

.dark .close-button:hover {
  background: var(--gold-pale);
  color: var(--gold-light);
  border-color: var(--gold-border);
}

/*  22. COPIED TOAST  */
.copied {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 18px;
  position: fixed;
  top: 14%;
  right: 0;
  z-index: 9999;
  width: 210px;
  background: var(--grad-dark);
  color: var(--gold-light);
  border-radius: var(--r-lg) 0 0 var(--r-lg);
  border: 1px solid rgba(200, 168, 75, 0.22);
  border-right: none;
  box-shadow: -8px 10px 44px rgba(26, 23, 20, 0.35);
  animation: toastIn 0.30s var(--ease-spring);
}

@keyframes toastIn {
  from {
    transform: translateX(110%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.copied textarea {
  background: transparent;
  border: none;
  color: rgba(200, 168, 75, 0.80);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  resize: none;
  outline: none;
  padding: 5px 0;
}

.copied-btn {
  position: absolute;
  top: 8px;
  left: 12px;
  background: var(--grad-gold);
  color: var(--ink);
  border-radius: var(--r-pill);
  padding: 3px 10px;
  font-family: var(--font-ui);
  font-size: 0.58rem;
  font-weight: 700;
  border: none;
  cursor: default;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  box-shadow: 0 2px 8px rgba(200, 168, 75, 0.38);
}

/*  23. LOADER  */
.loader {
  width: 32px;
  height: 32px;
  border: 2px solid var(--surface-3);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.70s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.page-load-status,
.aryapage {
  display: none;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: 24px 0;
}

.loadmore {
  text-align: center;
  padding: 16px 0;
}

/*  24. POPUP MODAL  */
.flourish-popup {
  position: fixed;
  inset: 0;
  background: rgba(26, 23, 20, 0.55);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  animation: fadeIn 0.22s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.flourish-popup.hidden {
  display: none;
}

.popup-box {
  background: var(--surface);
  width: 92%;
  max-width: 460px;
  max-height: 72vh;
  border-radius: var(--r-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--sh-xl), 0 0 0 1px var(--line-mid);
  animation: popIn 0.32s var(--ease-spring);
}

/* Gold accent bar at top of modal */
.popup-box::before {
  content: '';
  display: block;
  height: 2px;
  background: var(--grad-gold);
  flex-shrink: 0;
}

@keyframes popIn {
  from {
    transform: scale(0.92) translateY(18px);
    opacity: 0;
  }

  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

.popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  padding: 4px 18px;
}

.popup-header h3 {
  font-family: var(--font-display);
  font-size: 1.10rem;
  font-weight: 400;
  font-style: italic;
  color: var(--text-1);
  padding: 12px 0;
  margin: 0;
  letter-spacing: 0.01em;
}

.popup-header button {
  background: none;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  font-size: 15px;
  padding: 12px;
  border-radius: var(--r-sm);
  transition: background 0.18s, color 0.18s;
}

.popup-header button:hover {
  background: var(--gold-pale);
  color: var(--gold-dark);
}

.dark .popup-box {
  background: var(--surface);
}

.dark .popup-header {
  background: var(--surface-2);
  border-color: var(--line);
}

.dark .popup-header h3 {
  color: var(--text-1);
}

.dark .popup-header button:hover {
  background: var(--gold-pale);
  color: var(--gold-light);
}

/*  25. FLOURISH LIST (popup)  */
#flourishList {
  padding: 14px;
  overflow-y: auto;
  list-style: none;
  flex: 1;
}

#flourishList li {
  margin-bottom: 8px;
  position: relative;
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface-2);
  transition:
    transform 0.20s var(--ease-spring),
    border-color 0.18s,
    box-shadow 0.18s;
}

#flourishList li:hover {
  border-color: var(--gold-border);
  transform: translateY(-2px);
  box-shadow: 0 6px 22px var(--gold-glow);
}

#flourishList .count {
  display: flex;
  justify-content: flex-end;
  font-size: 8px;
  color: var(--text-3);
  padding: 2px 8px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: var(--font-mono);
}

#flourishList li p {
  font-size: 1rem !important;
  color: var(--text-1);
  border-radius: 0;
  border: none;
  background: transparent;
  text-align: center;
  padding: 12px;
  font-family: var(--font-ui);
  cursor: pointer;
  transition: color 0.15s;
}

#flourishList li:hover p {
  color: var(--gold-dark);
}

.dark #flourishList li {
  background: var(--surface-2);
  border-color: var(--line);
}

.dark #flourishList li:hover {
  border-color: var(--gold-border);
  box-shadow: 0 6px 22px rgba(200, 168, 75, 0.18);
}

.dark #flourishList li p {
  color: var(--text-1);
}

.dark #flourishList li:hover p {
  color: var(--gold-light);
}

/*  26. FLOURISH FOOTER (popup)  */
.flourishit {
  padding: 16px 20px;
  text-align: center;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}

.dark .flourishit {
  background: var(--surface-2);
  border-color: var(--line);
}

.select-flourish {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.select-flourish label {
  font-family: var(--font-ui);
  font-size: 0.64rem;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0.10em;
  text-transform: uppercase;
}

#flourishSelect {
  appearance: none;
  padding: 9px 28px 9px 14px;
  font-size: 0.82rem;
  font-family: var(--font-ui);
  font-weight: 400;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-mid);
  background: var(--surface);
  color: var(--text-1);
  cursor: pointer;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}

#flourishSelect:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-pale);
}

.dark #flourishSelect {
  background: var(--surface);
  color: var(--text-1);
  border-color: var(--line-mid);
}

#flourishRegenerate {
  padding: 12px 32px;
  border-radius: var(--r-md);
  background: var(--grad-gold);
  color: var(--ink);
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  box-shadow: var(--sh-gold);
  transition:
    transform 0.22s var(--ease-spring),
    box-shadow 0.20s;
  position: relative;
  overflow: hidden;
}

#flourishRegenerate::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.18) 0%, transparent 60%);
  pointer-events: none;
}

#flourishRegenerate:hover {
  transform: translateY(-2px) scale(1.015);
  box-shadow: 0 16px 40px rgba(200, 168, 75, 0.50);
}

#flourishRegenerate:active {
  transform: scale(0.97);
}

/*  27. ADS PLACEHOLDER  */
.ads {
  grid-column: 1 / -1;
  display: block;
  width: 100%;
  margin: 18px 0;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px dashed var(--line-mid);
  overflow: hidden;
}

.dark .ads {
  background: var(--surface-2);
  border-color: var(--line-mid);
}

/*  28. FOOTER  */
footer {
  margin-top: 80px;
  background: var(--grad-dark);
  padding: 44px 0;
  position: relative;
}

/* Gold rule at top of footer */
footer::before {
  content: '';
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg,
      transparent 0%,
      rgba(200, 168, 75, 0.35) 15%,
      #C8A84B 50%,
      rgba(200, 168, 75, 0.35) 85%,
      transparent 100%);
}

footer .inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

footer a {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.38);
  transition: color 0.20s;
}

footer a:hover {
  color: var(--gold-light);
}

footer p,
footer span {
  color: rgba(255, 255, 255, 0.20);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
}

.copyright-area {
  color: rgba(255, 255, 255, 0.60);
}

/*  29. INFO / SEO TEXT BLOCK  */
.info-text {
  font-family: var(--font-ui);
  line-height: 1.88;
  color: var(--text-2);
  padding: 60px 64px;
  background: var(--surface);
  margin-top: 48px;
  border-radius: var(--r-2xl);
  border: 1px solid var(--line);
  box-shadow: var(--sh-sm);
  white-space: normal;
  word-break: break-word;
  position: relative;
  overflow: hidden;
}

/* Subtle gold corner accent */
.info-text::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle at top left, rgba(200, 168, 75, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

.info-text h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 300;
  font-style: italic;
  color: var(--text-1);
  text-align: center;
  margin-bottom: 48px;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--line);
  letter-spacing: -0.02em;
  line-height: 1.12;
}

.info-text h2 {
  font-family: var(--font-ui);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-1);
  margin-top: 56px;
  margin-bottom: 14px;
  letter-spacing: -0.01em;
  text-transform: none;
  font-style: normal;
  position: relative;
  padding-left: 18px;
}

/* Gold vertical rule on h2 */
.info-text h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: var(--grad-gold);
  border-radius: 2px;
}

.info-text h3 {
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-1);
  margin-top: 28px;
  margin-bottom: 8px;
  font-style: normal;
  letter-spacing: -0.005em;
}

.info-text p {
  font-size: 0.96rem;
  margin-bottom: 18px;
  text-align: justify;
  color: var(--text-2);
}

.info-text ul,
.info-text ol {
  margin-bottom: 24px;
  padding-left: 24px;
}

.info-text li {
  font-size: 0.96rem;
  margin-bottom: 8px;
}

.info-text strong {
  color: var(--text-1);
  font-weight: 600;
}

.info-text code {
  background: var(--surface-2);
  color: var(--gold-dark);
  padding: 2px 8px;
  border-radius: var(--r-xs);
  font-family: var(--font-mono);
  font-size: 0.84rem;
  word-break: break-all;
  display: inline-block;
  margin: 1px;
  border: 1px solid var(--line);
}

.info-text img {
  max-width: 100%;
  border-radius: var(--r-md);
}

.info-text ul {
  overflow: auto;
}

.info-text .example-box {
  background: var(--surface-2);
  border-left: 2px solid var(--gold);
  border-radius: var(--r-md);
  padding: 22px 26px;
  margin: 26px 0;
  box-shadow: 0 2px 14px rgba(200, 168, 75, 0.10);
}

.info-text .example-title {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.62rem;
  color: var(--gold-dark);
  margin-top: 14px;
  margin-bottom: 8px;
  letter-spacing: 0.16em;
  font-style: normal;
  text-transform: uppercase;
}

.info-text .example-title:first-child {
  margin-top: 0;
}

.info-text .example-box ol {
  list-style-type: decimal;
  margin-bottom: 12px;
}

.info-text .example-box li {
  font-size: 1.02rem;
  letter-spacing: 0.01em;
  color: var(--text-1);
  background: var(--surface);
  padding: 9px 16px;
  margin-bottom: 5px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
}

/* Dark overrides — info text */
.dark .info-text {
  background: var(--surface);
  border-color: var(--line);
}

.dark .info-text h1 {
  color: var(--text-1);
  border-color: var(--line);
}

.dark .entry-header p {
  color: var(--text-2);
}

.dark .info-text h2 {
  color: var(--text-1);
}

.dark .info-text h3 {
  color: var(--text-2);
}

.dark .info-text p {
  color: var(--text-2);
}

.dark .info-text strong {
  color: var(--text-1);
}

.dark .info-text code {
  background: var(--surface-3);
  color: var(--gold-light);
  border-color: var(--line);
}

.dark .info-text .example-box {
  background: var(--surface-2);
}

.dark .info-text .example-box li {
  background: var(--surface-3);
  border-color: var(--line);
  color: var(--text-1);
}

/*  30. DARK HEADER  */
.dark header {
  background: linear-gradient(160deg, #0D0C0A 0%, #141210 50%, #0D0C0A 100%);
}

/*  31. RESPONSIVE — Tablet  */
@media (max-width: 960px) {
  .grid ul {
    grid-template-columns: repeat(2, 1fr);
  }
}

/*  32. RESPONSIVE — Mobile  */
@media (max-width: 640px) {
  :root {
    --gutter: var(--gutter-sm);
  }

  h1 {
    font-size: 1.65rem;
  }

  .container {
    padding: 0 var(--gutter);
    max-width: 100%;
  }

  .input-section {
    margin-left: calc(-1 * var(--gutter));
    margin-right: calc(-1 * var(--gutter));
    padding-left: var(--gutter);
    padding-right: var(--gutter);
  }

  .f-m {
    width: 100%;
  }

  .font-size-controller input[type="range"] {
    width: 120px;
  }

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

  .info-text {
    padding: 28px 22px;
    border-radius: var(--r-lg);
  }

  .info-text h1 {
    font-size: 1.80rem;
  }

  .info-text h2 {
    font-size: 1.05rem;
  }

  .floatmenu a {
    display: block;
  }

  .buttons {
    right: 14px;
    bottom: 70px;
  }
}

/*  33. ACCESSIBILITY — Reduce Motion  */
@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;
  }
}

/*  34. PRINT  */
@media print {

  header,
  footer,
  .buttons,
  .input-section {
    display: none !important;
  }

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

  .fontes-de-letraslist li {
    break-inside: avoid;
  }
}