/* ============================================
   SOFT PROFESSIONAL — Calm, Smooth, Elegant
   ============================================ */

/* ---------- Design Tokens ---------- */
:root {
  /* Core palette — soft, muted, professional */
  --primary: #5b7cfa;
  --primary-hover: #4a68e0;
  --primary-light: #eef2ff;
  --primary-subtle: #dbe4ff;

  --accent: #a78bfa;
  --accent-light: #f5f3ff;

  --mint: #5eead4;
  --mint-light: #f0fdfa;
  --peach: #fdba74;
  --peach-light: #fff7ed;

  /* Neutrals — warm, soft */
  --bg: #fafbfc;
  --bg-warm: #f8f7f4;
  --surface: #ffffff;
  --surface-alt: #f5f7fa;
  --surface-hover: #f0f3f8;
  --border: #e8ecf1;
  --border-strong: #d4dbe4;

  --text: #1e2432;
  --text-secondary: #5a6478;
  --text-muted: #9ba3b4;

  /* Shadows — very soft, layered */
  --shadow-xs: 0 1px 2px rgba(30, 36, 50, 0.03);
  --shadow-sm: 0 1px 3px rgba(30, 36, 50, 0.04), 0 1px 2px rgba(30, 36, 50, 0.03);
  --shadow-md: 0 4px 12px rgba(30, 36, 50, 0.05), 0 2px 4px rgba(30, 36, 50, 0.03);
  --shadow-lg: 0 12px 28px rgba(30, 36, 50, 0.08), 0 4px 8px rgba(30, 36, 50, 0.04);
  --shadow-xl: 0 24px 48px rgba(30, 36, 50, 0.1), 0 8px 16px rgba(30, 36, 50, 0.05);
  --shadow-glow: 0 0 0 4px rgba(91, 124, 250, 0.12);

  /* Radii — soft, modern */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 28px;
  --radius-full: 9999px;

  /* Motion — smooth */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --duration-fast: 180ms;
  --duration: 280ms;
  --duration-slow: 450ms;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --text-xs: 0.75rem;
  --text-sm: 0.8125rem;
  --text-base: 0.9375rem;
  --text-lg: 1.0625rem;
  --text-xl: 1.1875rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;

  /* Layout */
  --header-height: 64px;
  --container-max: 1200px;
  --container-pad: 24px;
}

/* ---------- Dark Theme ---------- */
:root[data-theme="dark"] {
  --primary: #8ba3ff;
  --primary-hover: #a5b8ff;
  --primary-light: #1a1f35;
  --primary-subtle: #252c4a;

  --accent: #c4b5fd;
  --accent-light: #1e1a2e;

  --mint: #5eead4;
  --mint-light: #0d2622;
  --peach: #fdba74;
  --peach-light: #2a1d10;

  --bg: #0f1117;
  --bg-warm: #12141c;
  --surface: #171a24;
  --surface-alt: #1e222e;
  --surface-hover: #252a38;
  --border: #262b3a;
  --border-strong: #363d50;

  --text: #f1f3f9;
  --text-secondary: #b8bfce;
  --text-muted: #6b7488;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.25), 0 1px 2px rgba(0, 0, 0, 0.15);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3), 0 2px 4px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.4), 0 4px 8px rgba(0, 0, 0, 0.25);
  --shadow-xl: 0 24px 48px rgba(0, 0, 0, 0.5), 0 8px 16px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 0 4px rgba(139, 163, 255, 0.15);
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.65;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  background-image:
    radial-gradient(circle at 15% 0%, rgba(91, 124, 250, 0.04), transparent 40%),
    radial-gradient(circle at 85% 100%, rgba(167, 139, 250, 0.04), transparent 40%);
  background-attachment: fixed;
}

:root[data-theme="dark"] body {
  background-image:
    radial-gradient(circle at 15% 0%, rgba(139, 163, 255, 0.06), transparent 40%),
    radial-gradient(circle at 85% 100%, rgba(196, 181, 253, 0.05), transparent 40%);
}

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

button {
  font-family: inherit;
  cursor: pointer;
}

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

/* ---------- Layout ---------- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
}

/* ---------- Header ---------- */
header {
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  border-bottom: 1px solid var(--border);
}

.header-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  gap: 16px;
}

.brand-link a {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: var(--text-lg);
  letter-spacing: -0.02em;
  color: var(--text);
  transition: opacity var(--duration-fast) var(--ease-out);
}

.brand-link a:hover {
  opacity: 0.85;
}

.brand-link img {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  object-fit: cover;
  box-shadow: var(--shadow-xs);
}

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

/* Theme toggle */
#themeToggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 8px 14px;
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: all var(--duration-fast) var(--ease-out);
}

#themeToggle:hover {
  background: var(--primary-light);
  border-color: var(--primary-subtle);
  color: var(--primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

#themeToggle .theme-icon {
  font-size: 0.875rem;
  line-height: 1;
}

/* Desktop nav */
.nav-desktop {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-desktop > a {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: var(--text-sm);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  transition: all var(--duration-fast) var(--ease-out);
}

.nav-desktop > a:hover,
.nav-desktop > a.active {
  color: var(--primary);
  background: var(--primary-light);
}

/* More dropdown */
.more-wrapper {
  position: relative;
}

.more-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font: inherit;
  font-weight: 500;
  font-size: var(--text-sm);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  transition: all var(--duration-fast) var(--ease-out);
}

.more-btn:hover,
.more-btn[aria-expanded="true"] {
  background: var(--primary-light);
  color: var(--primary);
}

.more-btn svg {
  width: 14px;
  height: 14px;
  transition: transform var(--duration-fast) var(--ease-out);
}

.more-btn[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 210px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 8px;
  box-shadow: var(--shadow-lg);
  display: none;
  flex-direction: column;
  z-index: 1000;
  animation: dropdownIn var(--duration-fast) var(--ease-out);
}

@keyframes dropdownIn {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.more-wrapper:hover .dropdown,
.more-btn[aria-expanded="true"] + .dropdown {
  display: flex;
}

.dropdown a {
  color: var(--text-secondary);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  white-space: nowrap;
  transition: all var(--duration-fast) var(--ease-out);
}

.dropdown a:hover {
  background: var(--primary-light);
  color: var(--primary);
  transform: translateX(3px);
}

/* Hamburger */
.hamburger {
  display: none;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px;
  color: var(--text);
  transition: all var(--duration-fast) var(--ease-out);
}

.hamburger:hover {
  background: var(--primary-light);
  border-color: var(--primary-subtle);
  color: var(--primary);
}

.hamburger svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  display: block;
}

.hamburger line {
  transition: all var(--duration) var(--ease-smooth);
  transform-origin: center;
}

.hamburger.active line:nth-child(1) {
  transform: translateY(5px) rotate(45deg);
}

.hamburger.active line:nth-child(2) {
  opacity: 0;
}

.hamburger.active line:nth-child(3) {
  transform: translateY(-5px) rotate(-45deg);
}

/* Mobile menu */
.mobile-menu {
  display: none;
  flex-direction: column;
  background: var(--surface);
  border-top: 1px solid var(--border);
  overflow: hidden;
  max-height: 0;
  transition: max-height var(--duration-slow) var(--ease-out);
}

.mobile-menu.active {
  display: flex;
  max-height: 500px;
}

.mobile-nav {
  display: flex;
  flex-direction: column;
  padding: 12px var(--container-pad) 20px;
}

.mobile-nav a {
  color: var(--text-secondary);
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-weight: 500;
  font-size: var(--text-sm);
  transition: all var(--duration-fast) var(--ease-out);
}

.mobile-nav a:last-child {
  border-bottom: none;
}

.mobile-nav a:hover,
.mobile-nav a.active {
  color: var(--primary);
  padding-left: 8px;
}

/* ---------- Hero Section ---------- */
.head-info {
  padding: 15px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.head-info::before {
  content: '';
  position: absolute;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 500px;
  background: radial-gradient(ellipse, rgba(91, 124, 250, 0.08), transparent 70%);
  pointer-events: none;
  filter: blur(40px);
}

:root[data-theme="dark"] .head-info::before {
  background: radial-gradient(ellipse, rgba(139, 163, 255, 0.1), transparent 70%);
}

.head-info .cnt {
  max-width: 680px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.head-info h1 {
  font-size: var(--text-4xl);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
  color: var(--text);
}

.head-info h1 em {
  font-style: normal;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.head-info p {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  line-height: 1.7;
  margin: 0 auto;
  max-width: 520px;
}

/* ---------- Input Section ---------- */
.input-sec {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 20px 0 24px;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.input-info {
  display: block;
  text-align: center;
  padding: 0 0 14px;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.input {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: 6px 8px;
  box-shadow: var(--shadow-md);
  transition: all var(--duration) var(--ease-out);
  position: relative;
  max-width: 820px;
  margin: 0 auto;
}

.input:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-lg);
}

.input:focus-within {
  border-color: var(--primary);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

#inputText {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: var(--text-lg);
  padding: 16px 20px;
  font-weight: 400;
  min-width: 0;
  text-align: center;
  font-family: inherit;
  letter-spacing: -0.01em;
}

#inputText::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

#inputCount {
  position: absolute;
  left: 24px;
  bottom: 6px;
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* Input action buttons */
.input button {
  position: absolute;
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--duration-fast) var(--ease-out);
  flex-shrink: 0;
}

.input button:hover {
  background: var(--surface-alt);
  color: var(--text);
}

/* ============================================
   ★★ DECORATE BUTTON — Soft premium star ★★
   ============================================ */
#bioIdeas {
  position: absolute;
  right: 8px;
  top: -5px;
  transform: translateY(-50%);
  width: auto;
  height: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #5b7cfa 0%, #a78bfa 100%);
  color: white;
  border: none;
  border-radius: var(--radius-full);
  padding: 5px 10px;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration) var(--ease-out);
  letter-spacing: 0.01em;
  box-shadow:
    0 4px 14px rgba(91, 124, 250, 0.3),
    0 2px 4px rgba(91, 124, 250, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  overflow: hidden;
  white-space: nowrap;
  position: absolute;
}

/* Soft glow halo */
#bioIdeas::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: linear-gradient(135deg, #5b7cfa, #a78bfa, #5b7cfa);
  border-radius: inherit;
  z-index: -1;
  opacity: 0;
  filter: blur(12px);
  transition: opacity var(--duration) var(--ease-out);
}

/* Shimmer sweep */
#bioIdeas::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transform: skewX(-20deg);
  transition: left 0.6s var(--ease-out);
}

#bioIdeas:hover::before {
  opacity: 1;
}

#bioIdeas:hover::after {
  left: 150%;
}

#bioIdeas:hover {
  transform: translateY(-50%) translateY(-2px) scale(1.02);
  box-shadow:
    0 8px 24px rgba(91, 124, 250, 0.4),
    0 4px 8px rgba(91, 124, 250, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

#bioIdeas:active {
  transform: translateY(-50%) scale(0.98);
  box-shadow:
    0 2px 8px rgba(91, 124, 250, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Decorate label */
#bioIdeas .decorate-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  position: relative;
  z-index: 1;
}

#bioIdeas .decorate-icon {
  font-size: 1rem;
  line-height: 1;
  animation: gentleFloat 3s ease-in-out infinite;
}

@keyframes gentleFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-2px) rotate(8deg); }
}

button#clearInput {
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
}

button#clearInput:hover {
  background: var(--primary-light);
  color: var(--primary);
}

button.mood-scroll-btn {
  border-radius: var(--radius-md);
  border: none;
  padding: 10px;
}

/* ---------- Font Results Layout ---------- */
.font-results {
  display: flex;
  align-items: flex-start;
  gap: 32px;
  padding: 10px;
}

/* ---------- Font Category Sidebar ---------- */
.font-category {
  order: 1;
  flex: 0 0 172px;
  position: sticky;
  top: calc(var(--header-height) + 110px);
  align-self: flex-start;
  max-height: calc(100vh - var(--header-height) - 150px);
  overflow-y: auto;
  border-radius: var(--radius-xl);
  padding: 5px;
}

.font-category::-webkit-scrollbar {
  width: 4px;
}

.font-category::-webkit-scrollbar-track {
  background: transparent;
}

.font-category::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--radius-full);
}

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

.font-menu button {
  display: block;
  width: 100%;
  padding: 11px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  text-align: left;
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1.4;
  transition: all var(--duration-fast) var(--ease-out);
  position: relative;
}

.font-menu button b {
  display: block;
  font-size: 1.15rem;
  line-height: 1.2;
  margin-bottom: 3px;
  color: var(--text);
  font-weight: 700;
  transition: color var(--duration-fast) var(--ease-out);
}

.font-menu button:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.font-menu button:hover b {
  color: var(--primary);
}

.font-menu button.active {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  box-shadow: 0 4px 12px rgba(91, 124, 250, 0.25);
}

.font-menu button.active b {
  color: white;
}

/* Horizontal font menu (top) */
.font-menu-top {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  padding: 4px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.font-menu-top::-webkit-scrollbar {
  display: none;
}

.font-menu-top button {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: 500;
  white-space: nowrap;
  transition: all var(--duration-fast) var(--ease-out);
}

.font-menu-top button b {
  font-size: 0.9rem;
  line-height: 1;
  color: var(--text-muted);
  font-weight: 600;
  transition: color var(--duration-fast) var(--ease-out);
}

.font-menu-top button:hover {
  border-color: var(--primary-subtle);
  background: var(--primary-light);
  color: var(--primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.font-menu-top button:hover b {
  color: var(--primary);
}

.font-menu-top button.active,
button.mood-category.active {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(91, 124, 250, 0.25);
}

.font-menu-top button.active b {
  color: white;
}

/* ---------- Font List ---------- */
.fontslist-sec {
  order: 2;
  flex: 1;
  min-width: 0;
}

.fontslist-sec > h4 {
  margin: 0 0 20px;
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.fontslist {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
  padding: 0 0 24px;
}

/* ---------- Font Cards ---------- */
.fontslist p,
.bio-list p {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--duration-slow) var(--ease-out),
              transform var(--duration-slow) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.bio-list p {
  opacity: 1;
  transform: none;
}

.fontslist p.font-item-visible {
  opacity: 1;
  transform: translateY(0);
}

.fontslist p:hover,
.bio-list p:hover {
  border-color: var(--primary-subtle);
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}

/* Font text */
i.font-text {
  font-style: normal;
}

.fontslist p b,
.bio-list p b {
  display: block;
  font-size: 1.15rem;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text);
  padding: 18px 18px 0;
  word-break: break-word;
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease-out);
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI',
    'Noto Sans', 'Noto Sans Math', 'Noto Sans Symbols', 'Noto Sans Symbols 2',
    'Noto Sans Canadian Aboriginal', 'Noto Sans Javanese', 'Noto Sans Balinese',
    'Noto Sans Cherokee', 'Noto Serif Tibetan', 'Segoe UI Symbol', 'Apple Symbols',
    sans-serif;
}

.fontslist p[data-font-id="aestheticFonts"] b,
.aesthetic {
  font-family: Arial, Helvetica, sans-serif;
}

.fontslist p:hover b {
  color: var(--primary);
}

.fontslist p div i {
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 500;
}

.fontslist p div,
.bio-list button {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
  align-items: center;
  margin: 0 12px 10px;
}

/* Card action buttons */
.fontslist p button,
.bio-list button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: 5px 10px;
  font-size: var(--text-xs);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.fontslist p button:hover,
.bio-list button:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.fontslist p button:nth-child(3),
.styles-list p button {
  font-family: 'Material Symbols Outlined', sans-serif;
}

.styles-list p {
  opacity: 1;
}

/* ---------- Load More ---------- */
#loadMoreContainer {
  width: 100%;
  text-align: center;
  margin-top: 36px;
  padding: 20px 0;
  grid-column: 1 / -1;
}

#loadMoreContainer button,
.mood-load-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--surface);
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  padding: 15px 40px;
  font-size: var(--text-base);
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all var(--duration) var(--ease-out);
  min-width: 100%;
  letter-spacing: -0.01em;
  margin-bottom: 100px;
}

#loadMoreContainer button:hover,
.mood-load-more:hover {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(91, 124, 250, 0.3);
}

#loadMoreContainer button:active,
.mood-load-more:active {
  transform: translateY(0);
}

/* ---------- Overlays & Modals ---------- */
.mood-overlay,
.bio-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 25, 40, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 999;
  cursor: pointer;
  animation: fadeIn var(--duration) var(--ease-out);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.mood-container,
.bio-container {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  max-width: 700px;
  width: 100%;
  height: 80vh;
  z-index: 10000;
  background: var(--surface);
  border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
  padding: 28px 24px 24px;
  display: flex;
  gap: 20px;
  box-shadow: var(--shadow-xl);
  animation: slideUp var(--duration-slow) var(--ease-out);
}

@keyframes slideUp {
  from { transform: translateX(-50%) translateY(100%); }
  to { transform: translateX(-50%) translateY(0); }
}

.mood-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1rem;
  transition: all var(--duration-fast) var(--ease-out);
  line-height: 1;
  font-weight: 500;
}

.mood-close:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary-subtle);
  transform: rotate(90deg);
}

.mood-styles,
.bio-list {
  flex: 1;
  overflow-y: auto;
  max-height: 100%;
  padding-right: 4px;
}

.mood-styles > h3 {
  margin: 0 0 16px;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.mood-menu-wrapper,
.bio-menu {
  width: 110px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 50px;
  flex-shrink: 0;
}

.mood-menu-wrapper > h3 {
  margin: 0;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.mood-categories {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.mood-categories::-webkit-scrollbar {
  display: none;
}

.mood-categories button,
.mood-categories a {
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-alt);
  color: var(--text-secondary);
  cursor: pointer;
  text-align: center;
  font-size: var(--text-xs);
  font-weight: 500;
  transition: all var(--duration-fast) var(--ease-out);
}

.mood-categories button:hover,
.mood-categories a:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary-subtle);
  transform: translateY(-1px);
}

button.mood-category.active {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  border-color: transparent;
}

/* ---------- Footer ---------- */
footer {
  background: var(--surface);
  color: var(--text);
  padding: 40px 20px;
  text-align: center;
  border-top: 1px solid var(--border);
}

.foot-menu {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.foot-menu a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  text-decoration: none;
  background: var(--surface-alt);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  font-size: var(--text-sm);
  font-weight: 500;
}

.foot-menu a:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary-subtle);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* ---------- Site Info (Content Pages) ---------- */
.site-info {
  max-width: 720px;
  margin: 0 auto;
  padding: 56px 20px 72px;
  color: var(--text);
  font-size: var(--text-base);
  line-height: 1.8;
}

.site-info h2 {
  font-size: var(--text-3xl);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.025em;
  margin: 48px 0 20px;
  color: var(--text);
}

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

.site-info h3 {
  font-size: var(--text-2xl);
  font-weight: 700;
  line-height: 1.3;
  margin: 36px 0 14px;
  color: var(--text);
  letter-spacing: -0.02em;
}

.site-info h4 {
  font-size: var(--text-lg);
  font-weight: 700;
  margin: 28px 0 12px;
  padding-left: 16px;
  border-left: 4px solid var(--primary);
  border-radius: 2px;
  color: var(--text);
}

.site-info h5 {
  font-size: var(--text-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 28px 0 12px;
  color: var(--text-muted);
}

.site-info p {
  margin-bottom: 18px;
  color: var(--text-secondary);
}

.site-info strong,
.site-info b {
  color: var(--text);
  font-weight: 700;
}

.site-info em {
  color: var(--text-secondary);
  font-style: italic;
}

.site-info ul {
  list-style: none;
  margin: 20px 0 28px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.site-info ul li {
  position: relative;
  padding: 14px 18px 14px 46px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  word-break: break-word;
  color: var(--text-secondary);
  transition: all var(--duration-fast) var(--ease-out);
}

.site-info ul li:hover {
  border-color: var(--primary-subtle);
  box-shadow: var(--shadow-sm);
  transform: translateX(3px);
  color: var(--text);
}

.site-info ul li::before {
  content: '';
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary), var(--accent));
}

.site-info a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  transition: all var(--duration-fast) var(--ease-out);
  border-bottom: 1.5px solid transparent;
}

.site-info a:hover {
  color: var(--primary-hover);
  border-bottom-color: var(--primary-hover);
}

/* ---------- Copy Message ---------- */
.copy-message {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration) var(--ease-out);
  border-radius: var(--radius-xl);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--primary);
  letter-spacing: 0.02em;
}

.copy-message.show {
  opacity: 1;
}

/* ---------- Ads ---------- */
.responsive-ad {
  width: 320px;
  height: 100px;
}

@media (min-width: 500px) {
  .responsive-ad {
    width: 468px;
    height: 60px;
  }
}

@media (min-width: 800px) {
  .responsive-ad {
    width: 100%;
    height: 250px;
  }
}

/* ---------- Responsive: Tablet & Mobile ---------- */
@media (max-width: 768px) {
  :root {
    --container-pad: 18px;
  }

  .fontslist p b,
  .bio-list p b {
    font-size: 1.05rem;
  }

  .site-info img {
    width: 100%;
  }

  .header-flex {
    height: 58px;
    gap: 10px;
  }

  .nav-desktop {
    display: none;
  }

  .right-actions {
    display: flex !important;
  }

  .hamburger {
    display: block;
  }

  .head-info h1 {
    font-size: var(--text-3xl);
  }

  .head-info p {
    font-size: var(--text-base);
  }

  #inputText {
    font-size: var(--text-base);
    padding: 14px 14px;
  }

  .input-sec {
    padding: 15px 5px 0 5px;
  }


  #bioIdeas .decorate-icon {
    font-size: 0.8rem;
  }


  .font-menu button {
    flex: 0 0 calc(50% - 3px);
    padding: 10px 8px;
    font-size: 0.7rem;
  }

  .fontslist-sec {
    order: 1;
  }
  .font-results{
        gap: 2px;
  }
  .font-category {
    flex: 0 0 80px;
  }

  .fontslist {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .site-info {
    padding: 36px 18px 56px;
  }

  .site-info h2 {
    font-size: var(--text-2xl);
  }

  .site-info h3 {
    font-size: var(--text-xl);
  }

  .mood-container,
  .bio-container {
    left: 0;
    transform: translateX(0);
    max-width: 100%;
    width: 100%;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    gap: 8px;
    padding: 22px 16px 16px;
  }

  .mood-menu-wrapper,
  .bio-menu {
    width: 90px;
  }

  .foot-menu {
    gap: 6px;
  }

  .foot-menu a {
    font-size: var(--text-xs);
    padding: 7px 14px;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .fontslist {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ---------- Accessibility ---------- */
*:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

::selection {
  background: var(--primary-subtle);
  color: var(--primary-hover);
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--radius-full);
  border: 2px solid var(--bg);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

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

/* ---------- High Contrast ---------- */
@media (prefers-contrast: high) {
  .fontslist p,
  .bio-list p {
    border-width: 2px;
  }

  .font-menu button {
    border-width: 2px;
  }

  .input {
    border-width: 2px;
  }
}

/* ---------- Print ---------- */
@media print {
  header,
  .input-sec,
  .font-menu-top,
  .font-category,
  #loadMoreContainer,
  footer,
  #bioIdeas {
    display: none !important;
  }

  body {
    background: white;
    color: black;
  }

  .head-info {
    background: white;
    color: black;
  }

  .head-info h1 em {
    color: black;
    -webkit-text-fill-color: black;
  }

  .fontslist p {
    break-inside: avoid;
    border: 1px solid #ccc;
    box-shadow: none;
    opacity: 1;
    transform: none;
  }

  .fontslist p button,
  .copy-message {
    display: none !important;
  }
}