/* 1. GOOGLE FONTS */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,600;0,9..144,700;1,9..144,400;1,9..144,600&family=Figtree:wght@300;400;500;600;700&family=Fira+Code:wght@400;500&display=swap');

/* 2. DESIGN TOKENS  — Light Mode (Default) */
:root {
  --maxw: 1200px;

  /*  Brand accent: burnt sienna / warm vermillion  */
  --ac: #D94F00;
  --ac-light: #FF6B2B;
  --ac-soft: rgba(217, 79, 0, 0.07);
  --ac-ring: rgba(217, 79, 0, 0.18);
  --grad-ac: linear-gradient(135deg, #D94F00 0%, #FF6B2B 100%);

  /*  Surface stack — warm ivory/paper tones  */
  --bg: #F6F4F0;
  --surface: #FFFFFF;
  --surface-2: #F0EDE7;
  --surface-3: #E5E1D7;
  --surface-card: rgba(255, 255, 255, 0.97);
  --glass: rgba(246, 244, 240, 0.85);

  /*  Text  */
  --tx-1: #1C1A16;
  --tx-2: #5A5549;
  --tx-3: #9A9285;
  --tx-inv: #FFFFFF;

  /*  Borders  */
  --bd: rgba(28, 26, 22, 0.09);
  --bd-mid: rgba(28, 26, 22, 0.14);
  --bd-soft: rgba(28, 26, 22, 0.05);

  /*  Shadows — warm tinted, layered  */
  --sh-xs: 0 1px 2px rgba(28, 26, 22, 0.05), 0 1px 4px rgba(28, 26, 22, 0.04);
  --sh-sm: 0 2px 8px rgba(28, 26, 22, 0.07), 0 1px 3px rgba(28, 26, 22, 0.04);
  --sh-md: 0 6px 22px rgba(28, 26, 22, 0.09), 0 2px 6px rgba(28, 26, 22, 0.05);
  --sh-lg: 0 16px 48px rgba(28, 26, 22, 0.12), 0 4px 12px rgba(28, 26, 22, 0.06);
  --sh-ac: 0 4px 18px rgba(217, 79, 0, 0.26), 0 1px 4px rgba(217, 79, 0, 0.14);
  --sh-in: inset 0 1px 3px rgba(28, 26, 22, 0.05);

  /*  Radii  */
  --r-xs: 3px;
  --r-sm: 7px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 24px;
  --r-pill: 999px;

  /*  Typography  */
  --font-display: 'Fraunces', Georgia, serif;
  --font-sans: 'Figtree', system-ui, -apple-system, sans-serif;
  --font-mono: 'Fira Code', 'Cascadia Code', 'Consolas', monospace;

  /*  Easings  */
  --ease-out: cubic-bezier(0.16, 1, 0.30, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.45, 0.00, 0.55, 1);

  /*  Gradients  */
  --grad-hero: linear-gradient(160deg, #1C1A16 0%, #252218 55%, #1F1D12 100%);
  --grad-subtle: linear-gradient(180deg, rgba(217, 79, 0, 0.03) 0%, transparent 100%);
}

/* 
   3. DARK MODE  — .dark class overrides
    */
.dark {
  --bg: #100F0B;
  --surface: #1C1A14;
  --surface-2: #252319;
  --surface-3: #2E2B1F;
  --surface-card: rgba(28, 26, 20, 0.96);
  --glass: rgba(16, 15, 11, 0.88);

  --tx-1: #F0EDE5;
  --tx-2: #A09A88;
  --tx-3: #60594E;

  --bd: rgba(240, 237, 229, 0.07);
  --bd-mid: rgba(240, 237, 229, 0.12);
  --bd-soft: rgba(240, 237, 229, 0.04);

  --sh-xs: 0 1px 3px rgba(0, 0, 0, 0.35);
  --sh-sm: 0 2px 10px rgba(0, 0, 0, 0.45), 0 1px 3px rgba(0, 0, 0, 0.28);
  --sh-md: 0 6px 24px rgba(0, 0, 0, 0.55), 0 2px 6px rgba(0, 0, 0, 0.34);
  --sh-lg: 0 16px 50px rgba(0, 0, 0, 0.65), 0 4px 14px rgba(0, 0, 0, 0.40);
  --sh-ac: 0 4px 20px rgba(255, 107, 43, 0.30), 0 1px 4px rgba(255, 107, 43, 0.16);
  --sh-in: inset 0 1px 3px rgba(0, 0, 0, 0.25);

  --ac: #FF6B2B;
  --ac-light: #FF8F58;
  --ac-soft: rgba(255, 107, 43, 0.09);
  --ac-ring: rgba(255, 107, 43, 0.22);
  --grad-ac: linear-gradient(135deg, #E05500 0%, #FF6B2B 100%);
}

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

html {
  height: 100%;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  height: 100%;
}

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

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

ul,
ol {
  list-style: none;
}

/*  Theme transitions (no flicker on load)  */
*,
*::before,
*::after {
  transition:
    background-color 0.22s ease,
    border-color 0.22s ease,
    color 0.16s ease,
    box-shadow 0.22s ease;
}

/* Never animate loaders */
.loader,
.loader * {
  transition: none !important;
}

/* 5. BODY & BASE TYPOGRAPHY */
body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.7;
  color: var(--tx-1);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-bottom: 100px;
  /* Warm paper texture — very subtle */
  background-image:
    radial-gradient(ellipse at 10% 0%, rgba(217, 79, 0, 0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 90% 100%, rgba(217, 79, 0, 0.03) 0%, transparent 45%);
}

/*  Heading styles  */
h1 {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 600;
  font-style: italic;
  color: var(--tx-1);
  line-height: 1.18;
  letter-spacing: -0.02em;
  margin: 0;
}

h2 {
  font-family: var(--font-sans);
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--tx-3);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h3 {
  font-family: var(--font-sans);
  font-weight: 600;
  color: var(--tx-2);
}

/* 6. HEADER */
header {
  background: var(--grad-hero);
  position: relative;
  z-index: 50;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04), var(--sh-lg);
}

/* Warm accent line at bottom */
header::after {
  content: '';
  display: block;
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg,
      transparent 0%,
      rgba(217, 79, 0, 0.40) 20%,
      rgba(255, 107, 43, 0.85) 50%,
      rgba(217, 79, 0, 0.40) 80%,
      transparent 100%);
}

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

header a {
  color: rgba(255, 255, 255, 0.42);
  padding: 5px 12px;
  font-family: var(--font-sans);
  font-size: 0.67rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  border-radius: var(--r-sm);
  transition: color 0.16s, background 0.16s;
  cursor: pointer;
}

header a:hover {
  color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.08);
}

/* 7. ENTRY HEADER (page title area) */
.entry-header {
  width: 100%;
  text-align: center;
  padding: 14px 0 6px;
}

.entry-header p {
  color: var(--tx-2);
  font-size: 0.88rem;
  font-style: italic;
  font-family: var(--font-display);
}

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

/* 8. THEME TOGGLE */
#themeToggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.60);
  font-family: var(--font-sans);
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all 0.20s var(--ease-out);
}

#themeToggle:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.28);
  color: rgba(255, 255, 255, 0.92);
}

/* Light → show moon; Dark → show sun */
#themeToggle .icon-moon {
  display: inline;
}

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

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

/* 9. LAYOUT CONTAINER */
.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px;
}

/* 10. INPUT WRAPPER CARDS */
.input-section-wrapper,
.search-wrapper,
.top-search-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  border: 1px solid var(--bd);
  box-shadow: var(--sh-sm);
  padding: 16px 18px 12px;
  margin-bottom: 4px;
}

.dark .input-section-wrapper,
.dark .search-wrapper,
.dark .top-search-card {
  background: var(--surface);
  border-color: var(--bd-mid);
  box-shadow: var(--sh-md);
}

/* 11. TOP MENU — Category Pills */
#topMenu {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 16px 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: 6px 16px;
  border-radius: var(--r-pill);
  font-family: var(--font-sans);
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--tx-2);
  border: 1px solid var(--bd-mid);
  background: var(--surface);
  box-shadow: var(--sh-xs);
  transition: all 0.18s var(--ease-out);
  white-space: nowrap;
}

#topMenu a:hover {
  color: var(--ac);
  background: var(--ac-soft);
  border-color: var(--ac);
  transform: translateY(-1px);
  box-shadow: var(--sh-sm);
}

#topMenu a.active {
  color: var(--tx-inv);
  background: var(--grad-ac);
  border-color: transparent;
  box-shadow: var(--sh-ac);
}

#topMenu h3 {
  font-size: 0.54rem;
  font-weight: 700;
  color: var(--tx-3);
  text-transform: uppercase;
  letter-spacing: 0.20em;
  margin: 0 4px;
  white-space: nowrap;
  opacity: 0.50;
}

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

.dark #topMenu a:hover {
  color: var(--ac);
  background: var(--ac-soft);
  border-color: var(--ac);
}

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

/* 12. STICKY SEARCH BAR */
.input-section {
  display: flex;
  position: sticky;
  top: 0;
  z-index: 40;
  padding: 12px 0 14px;
  gap: 10px;
  align-items: center;

  /* Glassmorphism backdrop */
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(1.7);
  -webkit-backdrop-filter: blur(20px) saturate(1.7);
  border-bottom: 1px solid var(--bd);

  /* Full-bleed within container */
  margin-left: -28px;
  margin-right: -28px;
  padding-left: 28px;
  padding-right: 28px;
}

.dark .input-section {
  background: rgba(16, 15, 11, 0.88);
  border-color: var(--bd);
}

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

.input-section input {
  width: 100%;
  padding: 13px 52px 13px 20px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--bd-mid);
  background: var(--surface);
  font-family: var(--font-sans);
  font-size: 0.94rem;
  font-weight: 400;
  color: var(--tx-1);
  outline: none;
  box-shadow: var(--sh-sm), var(--sh-in);
  transition: border-color 0.18s, box-shadow 0.18s;
}

.input-section input::placeholder {
  color: var(--tx-3);
  font-style: italic;
}

.input-section input:focus {
  border-color: var(--ac);
  box-shadow:
    0 0 0 3px var(--ac-ring),
    var(--sh-sm);
}

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

.dark .input-section input:focus {
  border-color: var(--ac);
  box-shadow: 0 0 0 3px var(--ac-ring), var(--sh-sm);
}

#input-count {
  position: absolute;
  right: 20px;
  bottom: 4px;
  font-size: 9px;
  font-family: var(--font-mono);
  color: var(--tx-3);
  letter-spacing: 0.04em;
  opacity: 0.55;
}

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

.clear-overlay:hover {
  color: var(--ac);
  background: var(--ac-soft);
}

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

/*  Primary button  */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 24px;
  border-radius: var(--r-pill);
  border: none;
  font-family: var(--font-sans);
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  cursor: pointer;
  background: var(--grad-ac);
  color: #fff;
  box-shadow: var(--sh-ac);
  white-space: nowrap;
  transition:
    transform 0.20s var(--ease-spring),
    box-shadow 0.20s,
    opacity 0.16s;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow:
    0 8px 28px rgba(217, 79, 0, 0.38),
    0 2px 8px rgba(217, 79, 0, 0.20);
  opacity: 1;
}

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

/*  Secondary button  */
.btn.secondary {
  background: var(--surface);
  color: var(--tx-2);
  border: 1.5px solid var(--bd-mid);
  box-shadow: var(--sh-xs);
}

.btn.secondary:hover {
  border-color: var(--ac);
  color: var(--ac);
  background: var(--ac-soft);
  box-shadow: var(--sh-sm);
}

/*  Danger / close button  */
button.btn.closeit {
  background: rgba(220, 38, 38, 0.07);
  color: #DC2626;
  border: 1.5px solid rgba(220, 38, 38, 0.18);
}

/*  Menu toggle button  */
button#menu {
  font-size: 1rem;
  height: 40px;
  width: 40px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--bd-mid);
  background: var(--surface);
  box-shadow: var(--sh-xs);
  color: var(--tx-2);
  transition: all 0.18s var(--ease-out);
}

button#menu:hover {
  border-color: var(--ac);
  background: var(--ac-soft);
  color: var(--ac);
}

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

.dark .btn.secondary:hover {
  background: var(--ac-soft);
  color: var(--ac);
  border-color: var(--ac);
}

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

.dark button#menu:hover {
  background: var(--ac-soft);
  border-color: var(--ac);
  color: var(--ac);
}

/* 14. OTHER TOOLS LINKS */
#othertools a {
  padding: 7px 14px;
  background: var(--surface);
  color: var(--tx-2);
  border-radius: var(--r-sm);
  font-family: var(--font-sans);
  font-size: 0.65rem;
  font-weight: 700;
  border: 1px solid var(--bd-soft);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  transition: all 0.18s var(--ease-out);
  box-shadow: var(--sh-xs);
}

#othertools a:hover {
  background: var(--grad-ac);
  color: #fff;
  border-color: transparent;
  transform: translateY(-1px);
  box-shadow: var(--sh-ac);
}

.dark #othertools a {
  background: var(--surface);
  color: var(--tx-2);
  border-color: var(--bd-soft);
}

.dark #othertools a:hover {
  background: var(--grad-ac);
  color: #fff;
  border-color: transparent;
}

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

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

/* 16. RANDOM 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 {
  color: var(--tx-2);
  background: transparent;
  text-align: center;
  border: none;
  font-size: 26px !important;
  padding: 10px 0 0;
  margin: 0;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: color 0.18s, transform 0.22s var(--ease-spring);
}

#randomcloud p:hover {
  color: var(--ac);
  transform: scale(1.12);
}

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

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

/* 17. RANDOM BUTTON */
#randombutton {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: var(--r-pill);
  padding: 13px 30px;
  margin-top: 14px;
  background: var(--grad-ac);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 600;
  font-style: italic;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  box-shadow: var(--sh-ac);
  transition: transform 0.20s var(--ease-spring), box-shadow 0.20s;
}

#randombutton:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 36px rgba(217, 79, 0, 0.42);
}

/* 
   18. 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-size: 0.60rem;
  font-family: var(--font-sans);
  font-weight: 700;
  color: var(--tx-3);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.font-size-controller input[type="range"] {
  width: 200px;
  height: 3px;
  background: var(--surface-3);
  border-radius: var(--r-pill);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  border: none;
}

.font-size-controller input[type="range"]::-webkit-slider-runnable-track {
  background: var(--grad-ac);
  height: 3px;
  border-radius: var(--r-pill);
}

.font-size-controller input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  background: var(--surface);
  border: 2px solid var(--ac);
  border-radius: 50%;
  box-shadow: 0 0 7px rgba(217, 79, 0, 0.28);
  cursor: grab;
  margin-top: -6.5px;
  transition: transform 0.14s var(--ease-spring), box-shadow 0.14s;
}

.font-size-controller input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.30);
  box-shadow: 0 0 14px rgba(217, 79, 0, 0.44);
}

/* 19. RESULTS GRID — Font Cards */
#results {
  width: 100%;
}

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

/*  Individual font card  */
.letrasaestheticlist li {
  display: flex;
  align-items: stretch;
  position: relative;
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--bd);
  background: var(--surface);
  box-shadow: var(--sh-xs);
  transition:
    transform 0.20s var(--ease-out),
    box-shadow 0.20s,
    border-color 0.18s;
}

/* Top accent bar — reveals on hover */
.letrasaestheticlist li::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--grad-ac);
  opacity: 0;
  transition: opacity 0.20s;
}

.letrasaestheticlist li:hover::before {
  opacity: 1;
}

.letrasaestheticlist li:hover {
  border-color: rgba(217, 79, 0, 0.40);
  transform: translateY(-3px);
  box-shadow: var(--sh-md), 0 0 0 1px var(--ac-ring);
}

/* Card text area */
.letrasaestheticlist li p {
  background: transparent;
  padding: 16px 0 28px 16px;
  margin: 0;
  color: var(--tx-1);
  cursor: pointer;
  user-select: none;
  text-align: left;
  width: 100%;
  position: relative;
  white-space: normal;
  word-break: break-word;
  font-family: var(--font-sans);
  overflow: hidden;
  border: none;
  line-height: 1.6;
  transition: background 0.16s;
}

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

/* Card label (font name / metadata) */
.letrasaestheticlist li i,
#flourishList li i {
  position: absolute;
  bottom: 6px;
  left: 16px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  color: var(--tx-3);
  z-index: 2;
  display: flex;
  align-items: baseline;
  gap: 4px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-style: normal;
  opacity: 0.55;
}

/* Copy button inside card */
.letrasaestheticlist li button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 700;
  padding: 8px 13px 8px 10px;
  gap: 4px;
  color: var(--tx-3);
  background: var(--surface-2);
  border: none;
  border-left: 1px solid var(--bd);
  cursor: pointer;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  transition: background 0.16s, color 0.16s;
}

.letrasaestheticlist li button:hover {
  background: var(--grad-ac);
  color: #fff;
}

/* Dark mode — card overrides */
.dark .letrasaestheticlist li {
  background: var(--surface-card);
  border-color: var(--bd);
}

.dark .letrasaestheticlist li:hover {
  border-color: rgba(255, 107, 43, 0.40);
  box-shadow: var(--sh-md), 0 0 0 1px var(--ac-ring);
}

.dark .letrasaestheticlist li p {
  color: var(--tx-1);
}

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

.dark .letrasaestheticlist li button {
  background: var(--surface-2);
  color: var(--tx-3);
  border-color: var(--bd-soft);
}

.dark .letrasaestheticlist li button:hover {
  background: var(--grad-ac);
  color: #fff;
}

/* 20. SECTION GROUP WRAPPER */
.letrasaestheticlist {
  margin-bottom: 32px;
}

.letrasaestheticlist h2 {
  color: var(--tx-3);
  margin-bottom: 12px;
  font-size: 0.60rem;
  display: flex;
  align-items: center;
  gap: 12px;
  letter-spacing: 0.16em;
}

.letrasaestheticlist h2::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--bd-mid), transparent);
}

/* 21. FLOATING ACTION BUTTONS */
.buttons {
  position: fixed;
  right: 18px;
  bottom: 90px;
  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: 1.5px solid var(--bd-mid);
  box-shadow: var(--sh-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--tx-2);
  transition: all 0.20s var(--ease-spring);
}

.buttons button:hover {
  background: var(--grad-ac);
  color: #fff;
  border-color: transparent;
  transform: scale(1.10) translateY(-2px);
  box-shadow: var(--sh-ac);
}

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

#bulbBtn:hover svg {
  stroke: #fff;
}

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

.dark .buttons button:hover {
  background: var(--grad-ac);
  color: #fff;
  border-color: transparent;
  box-shadow: var(--sh-ac);
}

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

.floatmenu h3 {
  font-family: var(--font-sans);
  color: var(--tx-3);
  font-size: 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.20em;
  font-weight: 700;
  margin-bottom: 8px;
}

.floatmenu a,
.right-menu a {
  display: inline-block;
  padding: 6px 13px;
  border-radius: var(--r-sm);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--tx-2);
  background: var(--surface-2);
  border: 1px solid var(--bd-soft);
  margin: 3px;
  white-space: nowrap;
  transition: all 0.16s var(--ease-out);
}

.floatmenu a:hover,
.right-menu a:hover {
  color: var(--ac);
  background: var(--ac-soft);
  border-color: var(--ac);
  transform: translateY(-1px);
}

.dark .f-m {
  background: var(--surface);
  border-color: var(--bd-mid);
  box-shadow: -14px 0 56px rgba(0, 0, 0, 0.50);
}

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

.dark .floatmenu a:hover,
.dark .right-menu a:hover {
  color: var(--ac);
  background: var(--ac-soft);
  border-color: var(--ac);
}

#fMN {
  overflow: auto;
}

.fAr {
  display: none;
}

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

/*  23. CLOSE BUTTON (Drawer) */
.close-button {
  position: fixed;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  font-size: 15px;
  border: 1.5px solid var(--bd-mid);
  border-radius: var(--r-md);
  color: var(--tx-2);
  background: var(--surface);
  box-shadow: var(--sh-sm);
  cursor: pointer;
  z-index: 10000;
  padding: 0;
  transition: all 0.16s var(--ease-out);
}

.close-button:hover {
  border-color: var(--ac);
  background: var(--ac-soft);
  color: var(--ac);
}

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

.dark .close-button:hover {
  background: var(--ac-soft);
  color: var(--ac);
  border-color: var(--ac);
}

/* 24. COPIED TOAST NOTIFICATION */
.copied {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  position: fixed;
  top: 12%;
  right: 0;
  z-index: 9999;
  width: 210px;
  background: var(--grad-hero);
  color: rgba(255, 255, 255, 0.80);
  border-radius: var(--r-lg) 0 0 var(--r-lg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-right: none;
  box-shadow: var(--sh-lg), 0 0 20px rgba(217, 79, 0, 0.18);
  animation: slideIn 0.24s var(--ease-spring);
}

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

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

.copied textarea {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.55);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  resize: none;
  outline: none;
  padding: 6px;
}

.copied-btn {
  position: absolute;
  top: 8px;
  left: 10px;
  background: var(--grad-ac);
  color: #fff;
  border-radius: var(--r-pill);
  padding: 3px 10px;
  font-family: var(--font-sans);
  font-size: 0.60rem;
  font-weight: 700;
  border: none;
  cursor: default;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  box-shadow: var(--sh-ac);
}

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

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

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

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

/* 26. POPUP MODAL */
.flourish-popup {
  position: fixed;
  inset: 0;
  background: rgba(16, 15, 11, 0.52);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  animation: fadeIn 0.18s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

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

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

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

@keyframes popIn {
  from {
    transform: scale(0.93) translateY(14px);
    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(--bd);
  padding: 4px 16px;
}

.popup-header h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  font-style: italic;
  color: var(--tx-1);
  padding: 12px 0;
  margin: 0;
}

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

.popup-header button:hover {
  background: var(--ac-soft);
  color: var(--ac);
}

.dark .popup-box {
  background: var(--surface);
  box-shadow: var(--sh-lg), 0 0 0 1px var(--bd-mid);
}

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

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

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

/* 27. FLOURISH LIST (inside popup) */
#flourishList {
  padding: 12px;
  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(--bd-soft);
  background: var(--surface-2);
  transition:
    transform 0.16s var(--ease-spring),
    border-color 0.16s,
    box-shadow 0.16s;
}

#flourishList li:hover {
  border-color: var(--ac);
  transform: translateY(-2px);
  box-shadow: var(--sh-sm), 0 0 0 1px var(--ac-ring);
}

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

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

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

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

.dark #flourishList li:hover {
  border-color: var(--ac);
}

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

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

/* 28. FLOURISH POPUP FOOTER */
.flourishit {
  padding: 14px 16px;
  text-align: center;
  border-top: 1px solid var(--bd);
  background: var(--surface-2);
}

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

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

.select-flourish label {
  font-family: var(--font-sans);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--tx-2);
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

#flourishSelect {
  appearance: none;
  padding: 8px 26px 8px 13px;
  font-size: 0.82rem;
  font-family: var(--font-sans);
  font-weight: 500;
  border-radius: var(--r-pill);
  border: 1.5px solid var(--bd-mid);
  background: var(--surface);
  color: var(--tx-1);
  cursor: pointer;
  outline: none;
  transition: border-color 0.16s, box-shadow 0.16s;
}

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

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

#flourishRegenerate {
  padding: 10px 26px;
  border-radius: var(--r-pill);
  background: var(--grad-ac);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 600;
  font-style: italic;
  font-size: 0.96rem;
  border: none;
  cursor: pointer;
  box-shadow: var(--sh-ac);
  transition: transform 0.20s var(--ease-spring), box-shadow 0.20s;
}

#flourishRegenerate:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(217, 79, 0, 0.40);
}

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

/* 29. ADS PLACEHOLDER  — AdSense Friendly */
.ads {
  grid-column: 1 / -1;
  display: block;
  width: 100%;
  margin: 14px 0;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px dashed var(--bd-mid);
  overflow: hidden;
  /* No min-height — let AdSense control its own dimensions */
}

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

/* 
   30. FOOTER
    */
footer {
  margin-top: 64px;
  background: var(--grad-hero);
  padding: 28px 0;
  position: relative;
}

/* Warm accent top line */
footer::before {
  content: '';
  display: block;
  height: 1px;
  background: linear-gradient(90deg,
      transparent 0%,
      rgba(217, 79, 0, 0.40) 20%,
      rgba(255, 107, 43, 0.80) 50%,
      rgba(217, 79, 0, 0.40) 80%,
      transparent 100%);
  width: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

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

footer a {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.55);
  transition: color 0.16s;
}

footer a:hover {
  color: rgba(255, 255, 255, 0.92);
}

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

/* 31. INFO / ARTICLE BLOCK */
.info-text {
  font-family: var(--font-sans);
  line-height: 1.80;
  color: var(--tx-2);
  padding: 52px 48px;
  background: var(--surface);
  margin-top: 32px;
  border-radius: var(--r-xl);
  border: 1px solid var(--bd-soft);
  box-shadow: var(--sh-sm);
  white-space: normal;
  word-break: break-word;
  position: relative;
  overflow: hidden;
}

/* Ambient warm glow — top-right corner decoration */
.info-text::after {
  content: '';
  position: absolute;
  top: -80px;
  right: -80px;
  width: 260px;
  height: 260px;
  background: radial-gradient(ellipse, rgba(217, 79, 0, 0.05) 0%, transparent 70%);
  pointer-events: none;
}

.info-text h1 {
  font-family: var(--font-display);
  font-size: 2.3rem;
  font-style: italic;
  font-weight: 600;
  color: var(--tx-1);
  text-align: center;
  margin-bottom: 32px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--bd);
  letter-spacing: -0.01em;
  background: none;
  -webkit-text-fill-color: var(--tx-1);
  line-height: 1.20;
}

.info-text h2 {
  font-family: var(--font-sans);
  font-size: 1.24rem;
  font-weight: 700;
  color: var(--tx-1);
  margin-top: 44px;
  margin-bottom: 12px;
  letter-spacing: -0.01em;
  text-transform: none;
  font-style: normal;
  position: relative;
  padding-left: 16px;
}

/* Warm accent bar on h2 headings */
.info-text h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 3px;
  bottom: 3px;
  width: 3px;
  background: var(--grad-ac);
  border-radius: 3px;
}

.info-text h3 {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  color: var(--tx-1);
  margin-top: 24px;
  margin-bottom: 8px;
  font-style: normal;
}

.info-text p {
  font-size: 0.97rem;
  margin-bottom: 16px;
  color: var(--tx-2);
  text-align: left;
}

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

.info-text li {
  font-size: 0.97rem;
  margin-bottom: 7px;
}

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

.info-text code {
  background: var(--surface-2);
  color: var(--ac);
  padding: 2px 7px;
  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(--bd-soft);
}

.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: 3px solid var(--ac);
  border-radius: var(--r-md);
  padding: 18px 22px;
  margin: 22px 0;
}

.info-text .example-title {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.64rem;
  color: var(--ac);
  margin-top: 12px;
  margin-bottom: 8px;
  letter-spacing: 0.12em;
  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: 10px;
}

.info-text .example-box li {
  font-size: 1rem;
  letter-spacing: 0.02em;
  color: var(--tx-1);
  background: var(--surface);
  padding: 8px 12px;
  margin-bottom: 4px;
  border-radius: var(--r-sm);
  border: 1px solid var(--bd-soft);
}

.copyright-area {
  color: #fff;
}

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

.dark .info-text h1 {
  color: var(--tx-1);
  -webkit-text-fill-color: var(--tx-1);
  border-color: var(--bd);
}

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

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

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

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

.dark .info-text code {
  background: var(--surface-3);
  color: var(--ac);
  border-color: var(--bd-soft);
}

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

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

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

/* 33. RESPONSIVE — Mobile  ≤ 640px */
@media (max-width: 640px) {
  h1 {
    font-size: 1.55rem;
  }

  .container {
    padding: 0 14px;
    max-width: 100%;
  }

  .input-section {
    margin-left: -14px;
    margin-right: -14px;
    padding-left: 14px;
    padding-right: 14px;
  }

  header .inner {
    padding: 0 14px;
    height: 52px;
  }

  footer .inner {
    padding: 0 14px;
  }

  .f-m {
    width: 100%;
  }

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

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

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

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

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

  .floatmenu a {
    display: block;
  }
}

/* 34. ACCESSIBILITY — Keyboard Focus */
:focus-visible {
  outline: 2px solid var(--ac);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

/* 35. 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;
  }
}