/* ============================================
   FontFlow — Style Sheet
   A stunning dark-themed font manager
   ============================================ */

/* ---------- CSS Custom Properties ---------- */
:root {
  --bg-root: #09090b;
  --bg-primary: #0c0c0e;
  --bg-secondary: #111113;
  --bg-tertiary: #18181b;
  --bg-card: #141416;
  --bg-card-hover: #1c1c1f;
  --bg-elevated: #1e1e21;
  --bg-input: #141416;

  --border: #222225;
  --border-hover: #333338;
  --border-subtle: #1a1a1d;

  --text-primary: #fafafa;
  --text-secondary: #a1a1aa;
  --text-muted: #8c8c94;
  --text-dimmed: #52525b;

  --accent: #10b981;
  --accent-hover: #34d399;
  --accent-subtle: rgba(16, 185, 129, 0.1);
  --accent-glow: rgba(16, 185, 129, 0.15);

  --favorite: #f43f5e;
  --favorite-subtle: rgba(244, 63, 94, 0.1);

  --violet: #8b5cf6;
  --violet-subtle: rgba(139, 92, 246, 0.1);

  --serif-color: #f59e0b;
  --sans-color: #3b82f6;
  --mono-color: #10b981;
  --display-color: #ec4899;
  --hand-color: #8b5cf6;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --sidebar-width: 260px;
  --toolbar-height: 56px;
  --detail-width: 460px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
  --shadow-xl: 0 16px 48px rgba(0,0,0,0.6);

  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 350ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---------- Light Mode Variables ---------- */
[data-theme="light"] {
  --bg-root: #f5f5f7;
  --bg-primary: #ffffff;
  --bg-secondary: #f5f5f7;
  --bg-tertiary: #e8e8ed;
  --bg-card: #ffffff;
  --bg-card-hover: #f5f5f7;
  --bg-elevated: #ffffff;
  --bg-input: #f0f0f2;

  --border: #d1d1d6;
  --border-hover: #a1a1aa;
  --border-subtle: #e4e4e7;

  --text-primary: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-muted: #737378;
  --text-dimmed: #aeaeb2;

  --accent-subtle: rgba(16, 185, 129, 0.08);
  --accent-glow: rgba(16, 185, 129, 0.12);
  --favorite-subtle: rgba(244, 63, 94, 0.08);
  --violet-subtle: rgba(139, 92, 246, 0.08);

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 28px rgba(0,0,0,0.1);
  --shadow-xl: 0 16px 44px rgba(0,0,0,0.12);
}

html[data-theme="dark"] { color-scheme: dark; }
html[data-theme="light"] { color-scheme: light; }

/* Theme transition helper */
html.theme-transitioning,
html.theme-transitioning *,
html.theme-transitioning *::before,
html.theme-transitioning *::after {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease !important;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-root);
  color: var(--text-primary);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

::selection {
  background: var(--accent);
  color: #fff;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--border-hover);
}

.hidden {
  display: none !important;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input {
  font-family: inherit;
  border: none;
  background: none;
  color: inherit;
  outline: none;
}

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

/* ---------- LANDING SCREEN ---------- */
.landing {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-root);
  z-index: 1000;
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.landing.fade-out {
  opacity: 0;
  transform: scale(1.02);
  pointer-events: none;
}

.landing-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.gradient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.4;
  animation: float 20s ease-in-out infinite;
}
.orb-1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #10b981 0%, transparent 70%);
  top: -150px; left: -100px;
  animation-delay: 0s;
}
.orb-2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, #6366f1 0%, transparent 70%);
  bottom: -100px; right: -50px;
  animation-delay: -7s;
}
.orb-3 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, #8b5cf6 0%, transparent 70%);
  top: 40%; left: 50%;
  animation-delay: -14s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -40px) scale(1.05); }
  50% { transform: translate(-20px, 20px) scale(0.95); }
  75% { transform: translate(40px, 30px) scale(1.02); }
}

.landing-content {
  position: relative;
  text-align: center;
  max-width: 480px;
  padding: 40px;
  animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.landing-logo {
  margin-bottom: 24px;
  animation: fadeInUp 0.8s ease-out 0.1s both;
}

.landing-title {
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #fafafa 0%, #a1a1aa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fadeInUp 0.8s ease-out 0.2s both;
}

.landing-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 36px;
  animation: fadeInUp 0.8s ease-out 0.3s both;
}

.landing-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 32px;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-normal);
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.3), inset 0 1px 0 rgba(255,255,255,0.1);
  animation: fadeInUp 0.8s ease-out 0.4s both;
}
.landing-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(16, 185, 129, 0.4), inset 0 1px 0 rgba(255,255,255,0.15);
}
.landing-btn:active {
  transform: translateY(0);
}

.landing-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 20px;
  animation: fadeInUp 0.8s ease-out 0.5s both;
}

/* ---------- LOADING SCREEN ---------- */
.loading-screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-root);
  z-index: 999;
  gap: 24px;
}

.loading-spinner {
  position: relative;
  width: 48px;
  height: 48px;
}

.spinner-ring {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-text {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.loading-dots::after {
  content: '';
  animation: dots 1.5s steps(4) infinite;
}

@keyframes dots {
  0%  { content: ''; }
  25% { content: '.'; }
  50% { content: '..'; }
  75% { content: '...'; }
  100% { content: ''; }
}

/* ---------- ERROR SCREEN ---------- */
.error-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-root);
  z-index: 998;
}

.error-content {
  text-align: center;
  max-width: 420px;
  padding: 40px;
}
.error-content svg { margin-bottom: 20px; }
.error-content h2 { font-size: 1.5rem; margin-bottom: 12px; }
.error-content p { color: var(--text-secondary); line-height: 1.6; }

/* ---------- APP LAYOUT ---------- */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  grid-template-rows: 1fr;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  animation: fadeIn 0.5s ease-out;
  transition: grid-template-columns 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.app.detail-open {
  grid-template-columns: var(--sidebar-width) 1fr var(--detail-width);
}

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

/* ---------- SIDEBAR ---------- */
.sidebar {
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
  border-right: 1px solid var(--border);
  height: 100vh;
  overflow: hidden;
  z-index: 10;
}

.sidebar-header {
  padding: 18px 20px 12px;
  flex-shrink: 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-text {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.sidebar-search {
  padding: 0 14px 14px;
  flex-shrink: 0;
}

.search-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}
.search-wrapper:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

.search-icon {
  flex-shrink: 0;
  color: var(--text-muted);
}

.search-wrapper input {
  flex: 1;
  font-size: 0.85rem;
  min-width: 0;
}
.search-wrapper input::placeholder {
  color: var(--text-muted);
}

.search-shortcut {
  font-size: 0.7rem;
  font-family: inherit;
  padding: 2px 6px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0 8px;
}

.nav-group {
  margin-bottom: 8px;
}

.nav-group-title {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 16px 12px 6px;
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}
.nav-item:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}
.nav-item.active {
  background: var(--accent-subtle);
  color: var(--accent);
}

.nav-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav-item.active .nav-icon {
  color: var(--accent);
}

.nav-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.nav-dot.serif { background: var(--serif-color); }
.nav-dot.sans-serif { background: var(--sans-color); }
.nav-dot.monospace { background: var(--mono-color); }
.nav-dot.display { background: var(--display-color); }
.nav-dot.handwriting { background: var(--hand-color); }

.nav-label {
  flex: 1;
}

.nav-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  min-width: 20px;
  text-align: right;
}

.sidebar-footer {
  padding: 14px 14px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
  margin-bottom: 12px;
}

.sidebar-stats {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ---------- THEME TOGGLE ---------- */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: all var(--transition-fast);
  flex-shrink: 0;
}
.theme-toggle:hover {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

/* Show sun in dark mode, moon in light mode */
.theme-icon-moon { display: none; }
[data-theme="light"] .theme-icon-sun { display: none; }
[data-theme="light"] .theme-icon-moon { display: block; }

/* Landing page theme toggle */
.landing-theme-toggle {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--text-muted);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition-fast);
  z-index: 10;
}
.landing-theme-toggle:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
  border-color: var(--border-hover);
}

/* ---------- MAIN CONTENT ---------- */
.main-content {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background: var(--bg-root);
}

/* ---------- TOOLBAR ---------- */
.toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  height: var(--toolbar-height);
  min-height: var(--toolbar-height);
  border-bottom: 1px solid var(--border);
  background: var(--bg-primary);
  flex-shrink: 0;
  z-index: 5;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.view-toggle {
  display: flex;
  gap: 2px;
  background: var(--bg-tertiary);
  padding: 3px;
  border-radius: var(--radius-sm);
}

.view-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 8px;
  border-radius: 4px;
  color: var(--text-muted);
  transition: all var(--transition-fast);
}
.view-btn:hover {
  color: var(--text-secondary);
}
.view-btn.active {
  background: var(--bg-elevated);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.toolbar-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
}

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

.toolbar-center {
  flex: 1;
  min-width: 0;
}

.preview-input-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  max-width: 560px;
  margin: 0 auto;
}
.preview-input-wrapper:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

.preview-icon {
  flex-shrink: 0;
  color: var(--text-muted);
}

.preview-input-wrapper input {
  flex: 1;
  font-size: 0.85rem;
  min-width: 0;
}
.preview-input-wrapper input::placeholder {
  color: var(--text-muted);
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.size-control {
  display: flex;
  align-items: center;
  gap: 10px;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 120px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -6px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
  transition: transform var(--transition-fast);
}
input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.size-value {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  min-width: 42px;
  text-align: right;
}

.toolbar-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: all var(--transition-fast);
}
.toolbar-icon-btn:hover {
  color: var(--text-secondary);
  background: var(--bg-tertiary);
}

/* ---------- FONT CONTAINER ---------- */
.font-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 24px;
  scroll-behavior: smooth;
}

/* ---------- FONT GRID VIEW ---------- */
.font-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 12px;
}

.font-grid.list-view {
  grid-template-columns: 1fr;
  gap: 4px;
}

.font-grid.waterfall-view {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ---------- FONT CARD ---------- */
.font-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  cursor: pointer;
  transition: all var(--transition-normal);
  opacity: 0;
  transform: translateY(10px);
  contain: layout style;
}
.font-card.visible {
  opacity: 1;
  transform: translateY(0);
}
.font-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
}
.font-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.font-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.font-card-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.font-card-category-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.font-card-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.font-card-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.font-card-badge {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg-tertiary);
  color: var(--text-muted);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.font-card-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0;
  transition: opacity var(--transition-fast);
}
.font-card:hover .font-card-actions {
  opacity: 1;
}

.font-card-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: all var(--transition-fast);
}
.font-card-action-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}
.font-card-action-btn.favorited {
  color: var(--favorite);
  opacity: 1;
}
.font-card-action-btn.favorited svg {
  fill: var(--favorite);
}

/* Always show favorited state */
.font-card .font-card-action-btn.favorited {
  opacity: 1;
}

.font-card-preview {
  font-size: 42px;
  line-height: 1.3;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: font-size var(--transition-normal);
  margin-bottom: 14px;
  min-height: 1.3em;
}

.font-card-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.font-card-style-tag {
  font-size: 0.7rem;
  color: var(--text-muted);
  padding: 2px 6px;
  background: var(--bg-tertiary);
  border-radius: 3px;
}
.font-card-style-tag.more {
  color: var(--text-dimmed);
}

/* LIST VIEW CARD */
.font-card.list-card {
  display: grid;
  grid-template-columns: 220px 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 14px 20px;
  border-radius: var(--radius-sm);
}
.font-card.list-card .font-card-header {
  margin-bottom: 0;
}
.font-card.list-card .font-card-preview {
  margin-bottom: 0;
  font-size: 28px;
}
.font-card.list-card .font-card-footer {
  display: none;
}

/* WATERFALL VIEW CARD */
.font-card.waterfall-card {
  border-radius: 0;
  border-left: none;
  border-right: none;
  border-bottom: none;
  padding: 12px 20px;
}
.font-card.waterfall-card:first-child {
  border-top: none;
}
.font-card.waterfall-card .font-card-header {
  margin-bottom: 4px;
}
.font-card.waterfall-card .font-card-preview {
  margin-bottom: 0;
}
.font-card.waterfall-card .font-card-footer {
  display: none;
}

/* ---------- EMPTY STATE ---------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 40px;
  text-align: center;
  gap: 12px;
}
.empty-state h3 {
  font-size: 1.1rem;
  color: var(--text-secondary);
}
.empty-state p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ---------- DETAIL PANEL ---------- */
.detail-panel {
  position: fixed;
  right: 0;
  top: 0;
  width: var(--detail-width);
  height: 100vh;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border);
  z-index: 50;
  transform: translateX(100%);
  transition: transform var(--transition-smooth);
  overflow: hidden;
}
.detail-panel.open {
  transform: translateX(0);
}

.detail-panel-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 24px 24px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.detail-title {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.detail-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.detail-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.detail-fav-btn,
.detail-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: all var(--transition-fast);
}
.detail-fav-btn:hover,
.detail-close-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}
.detail-fav-btn.favorited {
  color: var(--favorite);
}
.detail-fav-btn.favorited svg {
  fill: var(--favorite);
}

.detail-body {
  flex: 1;
  overflow-y: auto;
  padding: 0 24px 24px;
}

.detail-section {
  padding: 20px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.detail-section:last-child {
  border-bottom: none;
}

.detail-section-title {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
}

/* Detail Styles */
.detail-styles {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-style-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
  cursor: pointer;
}
.detail-style-item:hover {
  background: var(--bg-tertiary);
}

.detail-style-name {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.detail-style-preview {
  font-size: 1.1rem;
  color: var(--text-primary);
}

/* Detail Specimen */
.detail-specimen {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.specimen-size {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.specimen-text {
  color: var(--text-primary);
  line-height: 1.4;
  word-break: break-word;
}

/* Detail Character Map */
.detail-charmap {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
  gap: 4px;
}

.charmap-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  font-size: 1.2rem;
  color: var(--text-primary);
  transition: all var(--transition-fast);
  cursor: pointer;
}
.charmap-cell:hover {
  background: var(--bg-elevated);
  transform: scale(1.15);
  box-shadow: var(--shadow-md);
  z-index: 1;
}
.charmap-cell.active {
  background: var(--accent-subtle);
  color: var(--accent);
  box-shadow: inset 0 0 0 2px var(--accent);
  transform: scale(1.1);
  z-index: 1;
}

/* ---------- GLYPH INSPECTOR ---------- */
.glyph-inspector {
  padding: 0;
}
.glyph-inspector-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  margin-bottom: 8px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
}
.glyph-inspector-char {
  font-size: 42px;
  line-height: 1;
  color: var(--text-primary);
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  flex-shrink: 0;
}
.glyph-inspector-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.glyph-inspector-unicode {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  font-family: 'SF Mono', 'Consolas', 'Menlo', monospace;
}
.glyph-inspector-name {
  font-size: 0.75rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.glyph-inspector-width {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.glyph-copy-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: all var(--transition-fast);
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
}
.glyph-copy-btn:hover {
  background: var(--bg-elevated);
  color: var(--accent);
}
#glyphCanvas {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  display: block;
}

/* Detail Pangrams */
.detail-pangrams {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pangram-item {
  font-size: 1.1rem;
  line-height: 1.5;
  color: var(--text-primary);
  padding: 12px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
}

.pangram-lang {
  display: block;
  font-size: 0.7rem;
  font-family: 'Inter', sans-serif;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ---------- DETAIL OVERLAY ---------- */
.detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-smooth);
  backdrop-filter: blur(4px);
}
.detail-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

/* ---------- CONTEXT MENU ---------- */
.context-menu {
  position: fixed;
  z-index: 100;
  min-width: 200px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-md);
  padding: 6px;
  box-shadow: var(--shadow-xl);
  animation: contextIn 0.15s ease-out;
  backdrop-filter: blur(20px);
}

@keyframes contextIn {
  from { opacity: 0; transform: scale(0.95) translateY(-4px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.context-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  text-align: left;
}
.context-item:hover {
  background: var(--accent-subtle);
  color: var(--text-primary);
}
.context-item svg {
  flex-shrink: 0;
}

.context-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

/* ---------- TOAST NOTIFICATIONS ---------- */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s var(--transition-spring);
  backdrop-filter: blur(20px);
}

.toast.fade-out {
  animation: toastOut 0.3s ease-in forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-10px) scale(0.95); }
}

.toast-icon {
  flex-shrink: 0;
  color: var(--accent);
}

/* ---------- RANGE SLIDER TRACK FILL ---------- */
input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
}

/* ---------- TOOLBAR WHEN FONT VIEW OPEN ---------- */
.app.detail-open .toolbar-left,
.app.detail-open .toolbar-right {
  display: none;
}

/* Focus ring for keyboard navigation */
.font-card:focus-visible,
.nav-item:focus-visible,
.view-btn:focus-visible,
.landing-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Smooth font-family transitions for cards */
.font-card-preview {
  transition: font-size var(--transition-normal);
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 900px) {
  .app {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: none;
  }
  .font-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- ANIMATIONS ---------- */
@keyframes cardEntrance {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Stagger animation for cards */
.font-card.visible {
  animation: cardEntrance 0.4s ease-out forwards;
}

/* Skeleton Loading */
.skeleton {
  background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-card-hover) 50%, var(--bg-tertiary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================
   FONT SHOWCASE
   Apple-style immersive font display
   ============================================ */

/* --- Container --- */
.font-showcase {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
  padding-bottom: 40px;
  animation: showcaseEnter 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* --- Hero Section --- */
.showcase-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 420px;
  padding: 80px 48px;
  overflow: hidden;
  border-bottom: 1px solid var(--border-subtle);
}

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

.showcase-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.2;
  animation: showcaseOrbFloat 20s ease-in-out infinite;
}

.sc-orb-1 {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, #10b981, transparent 70%);
  top: -140px;
  right: -80px;
}

.sc-orb-2 {
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, #8b5cf6, transparent 70%);
  bottom: -120px;
  left: -60px;
  animation-delay: -7s;
}

.sc-orb-3 {
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, #3b82f6, transparent 70%);
  top: 40%;
  left: 40%;
  animation-delay: -14s;
}

@keyframes showcaseOrbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(25px, -35px) scale(1.06); }
  66% { transform: translate(-20px, 25px) scale(0.95); }
}

.showcase-hero-content {
  position: relative;
  text-align: center;
  z-index: 1;
}

.showcase-hero-letter {
  font-size: clamp(120px, 18vw, 220px);
  line-height: 1;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, #10b981, #3b82f6, #6366f1, #ec4899, #f59e0b, #10b981);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 24px;
  opacity: 0;
  animation: showcaseHeroLetterIn 1s cubic-bezier(0.16, 1, 0.3, 1) 0.1s forwards,
             heroGradientShift 8s ease-in-out 1.1s infinite;
}

@keyframes heroGradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes showcaseHeroLetterIn {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.92);
    filter: blur(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

.showcase-hero-name {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  opacity: 0;
  animation: showcaseHeroFadeUp 0.8s ease-out 0.35s forwards;
}

.showcase-hero-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  opacity: 0;
  animation: showcaseHeroFadeUp 0.8s ease-out 0.5s forwards;
}

@keyframes showcaseHeroFadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Generic Section --- */
.showcase-section {
  padding: 56px 48px;
  border-bottom: 1px solid var(--border-subtle);
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.showcase-section:last-child {
  border-bottom: none;
}

.showcase-section.showcase-visible {
  opacity: 1;
  transform: translateY(0);
}

.showcase-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 28px;
}

/* --- Type Scale --- */
.showcase-scale {
  display: flex;
  flex-direction: column;
}

.showcase-scale-row {
  display: flex;
  align-items: baseline;
  gap: 24px;
  padding: 16px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.showcase-scale-row:last-child {
  border-bottom: none;
}

.showcase-scale-size {
  font-size: 0.7rem;
  color: var(--text-dimmed);
  min-width: 32px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.showcase-scale-text {
  color: var(--text-primary);
  line-height: 1.2;
  overflow-wrap: break-word;
  word-break: break-word;
  transition: color 0.3s ease;
}

.showcase-scale-row:hover .showcase-scale-text {
  color: var(--accent);
}

.showcase-scale-row:hover .showcase-scale-size {
  color: var(--accent);
}

/* --- Alphabet --- */
.showcase-alphabet {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.showcase-alphabet:last-child {
  margin-bottom: 0;
}

.showcase-letter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 56px;
  font-size: 28px;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: default;
  position: relative;
  z-index: 0;
}

.showcase-letter::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--accent), #6366f1);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

.showcase-letter:hover {
  color: #fff;
  transform: scale(1.3) translateY(-4px);
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
}

.showcase-letter:hover::after {
  opacity: 1;
}

/* --- Color Cards --- */
.showcase-colors-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.showcase-color-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px 36px;
  border-radius: var(--radius-xl);
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: default;
  overflow: hidden;
}

.showcase-color-card:hover {
  transform: translateY(-8px) scale(1.03);
  box-shadow: 0 28px 56px -16px rgba(0, 0, 0, 0.5);
}

.showcase-color-letter {
  position: relative;
  z-index: 1;
  font-size: 72px;
  line-height: 1;
  margin-bottom: 10px;
}

.showcase-color-word {
  position: relative;
  z-index: 1;
  font-size: 0.8rem;
  opacity: 0.8;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 500;
}

/* --- Gradient Words --- */
.showcase-gradients-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.showcase-gradient-item {
  font-size: clamp(48px, 5vw, 80px);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.03em;
  text-align: center;
  padding: 44px 24px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-card);
  transition: all 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: default;
}

.showcase-gradient-item:hover {
  transform: scale(1.04) translateY(-4px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-lg);
}

/* --- Contrast --- */
.showcase-contrast-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.showcase-contrast-card {
  padding: 48px 36px;
  border-radius: var(--radius-xl);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.showcase-contrast-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
}

.showcase-contrast-light {
  background: #f8f9fa;
  color: #111113;
}

.showcase-contrast-dark {
  background: #111113;
  color: #f8f9fa;
  border: 1px solid var(--border);
}

.showcase-contrast-text {
  font-size: 1.35rem;
  line-height: 1.7;
}

/* --- Numbers --- */
.showcase-numbers {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.showcase-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 76px;
  height: 90px;
  font-size: 44px;
  color: var(--text-primary);
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: default;
  position: relative;
  overflow: hidden;
  z-index: 0;
}

.showcase-number::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent), #6366f1);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

.showcase-number:hover {
  color: #fff;
  transform: scale(1.18) translateY(-4px);
  box-shadow: 0 14px 32px rgba(16, 185, 129, 0.3);
}

.showcase-number:hover::before {
  opacity: 1;
}

.showcase-number span {
  position: relative;
  z-index: 1;
}

/* --- Weights Gallery --- */
.showcase-weights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}

.showcase-weight-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 16px 20px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: default;
  border: 1px solid transparent;
}

.showcase-weight-card:hover {
  background: var(--bg-elevated);
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.showcase-weight-preview {
  font-size: 40px;
  line-height: 1.1;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.showcase-weight-name {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  text-align: center;
}

/* --- Quote --- */
.showcase-quote-section {
  text-align: center;
  padding: 72px 48px !important;
  position: relative;
  overflow: hidden;
}

.showcase-quote-section::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.05), transparent 70%);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.showcase-quote-mark {
  font-size: 140px;
  line-height: 0.6;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  opacity: 0.25;
  margin-bottom: 4px;
}

.showcase-quote {
  font-size: clamp(1.3rem, 2.5vw, 2rem);
  line-height: 1.65;
  color: var(--text-primary);
  max-width: 680px;
  margin: 0 auto 20px;
  font-style: italic;
  position: relative;
}

.showcase-quote-author {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  font-style: normal;
  letter-spacing: 0.02em;
}

/* --- Big Statement --- */
.showcase-statement-section {
  padding: 88px 32px !important;
  text-align: center;
  overflow: hidden;
}

.showcase-statement {
  font-size: clamp(64px, 12vw, 200px);
  line-height: 1;
  letter-spacing: -0.05em;
  background: linear-gradient(180deg, var(--text-primary) 0%, var(--text-dimmed) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
  transition: letter-spacing 0.5s ease;
}

.showcase-statement-section:hover .showcase-statement {
  letter-spacing: -0.02em;
}

/* --- Responsive Showcase --- */
@media (max-width: 1400px) {
  .showcase-section {
    padding: 44px 36px;
  }
  .showcase-hero {
    padding: 64px 36px;
    min-height: 360px;
  }
}

@media (max-width: 1100px) {
  .showcase-colors-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .showcase-gradients-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 800px) {
  .showcase-section {
    padding: 36px 24px;
  }
  .showcase-colors-grid {
    grid-template-columns: 1fr;
  }
  .showcase-contrast-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   PROMO BANNER — Font Generator
   ============================================ */

/* --- Sidebar FAQ Link --- */
.sidebar-faq-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  margin-bottom: 10px;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}
.sidebar-faq-link:hover {
  color: var(--accent);
}

/* --- Sidebar Banner --- */
.promo-banner {
  display: flex;
  position: relative;
  overflow: hidden;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #7c3aed 0%, #c026d3 40%, #f43f5e 100%);
  color: #fff;
  text-decoration: none;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.3), inset 0 1px 0 rgba(255,255,255,0.15);
}

.promo-banner:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.4), inset 0 1px 0 rgba(255,255,255,0.2);
}

.promo-banner:active {
  transform: translateY(0);
}

.promo-banner-shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 30%,
    rgba(255, 255, 255, 0.15) 45%,
    rgba(255, 255, 255, 0.25) 50%,
    rgba(255, 255, 255, 0.15) 55%,
    transparent 70%
  );
  background-size: 250% 100%;
  animation: promoShimmer 3s ease-in-out infinite;
  pointer-events: none;
}

@keyframes promoShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.promo-banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.promo-banner-icon {
  flex-shrink: 0;
  opacity: 0.9;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
}

.promo-banner-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.promo-banner-title {
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.3;
  text-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

.promo-banner-cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  opacity: 0.9;
  letter-spacing: 0.02em;
}

.promo-banner-cta svg {
  transition: transform 0.3s ease;
}

.promo-banner:hover .promo-banner-cta svg {
  transform: translateX(3px);
}

/* --- Landing Page Banner --- */
.landing-promo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
  margin-top: 28px;
  padding: 12px 24px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #7c3aed 0%, #c026d3 40%, #f43f5e 100%);
  color: #fff;
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.3), inset 0 1px 0 rgba(255,255,255,0.15);
  animation: fadeInUp 0.8s ease-out 0.6s both;
}

.landing-promo:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 30px rgba(124, 58, 237, 0.45), inset 0 1px 0 rgba(255,255,255,0.2);
}

.landing-promo:active {
  transform: translateY(0) scale(1);
}

.landing-promo-shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 30%,
    rgba(255, 255, 255, 0.15) 45%,
    rgba(255, 255, 255, 0.25) 50%,
    rgba(255, 255, 255, 0.15) 55%,
    transparent 70%
  );
  background-size: 250% 100%;
  animation: promoShimmer 3s ease-in-out infinite;
  pointer-events: none;
}

.landing-promo-icon {
  flex-shrink: 0;
  opacity: 0.9;
}

.landing-promo-text {
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0,0,0,0.15);
  white-space: nowrap;
}

.landing-promo-cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
  opacity: 0.9;
  padding-left: 10px;
  border-left: 1px solid rgba(255,255,255,0.3);
  white-space: nowrap;
}

.landing-promo-cta svg {
  transition: transform 0.3s ease;
}

.landing-promo:hover .landing-promo-cta svg {
  transform: translateX(3px);
}

/* ============================================
   LIGHT MODE SPECIFIC OVERRIDES
   ============================================ */

[data-theme="light"] .landing-title {
  background: linear-gradient(135deg, #1d1d1f 0%, #6e6e73 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

[data-theme="light"] .landing-bg .gradient-orb {
  opacity: 0.2;
}

[data-theme="light"] .showcase-scale-row {
  border-bottom-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .showcase-contrast-dark {
  background: #1d1d1f;
  color: #f5f5f7;
}

[data-theme="light"] .showcase-contrast-light {
  background: #ffffff;
  color: #1d1d1f;
  border: 1px solid var(--border);
}

[data-theme="light"] .detail-overlay {
  background: rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .font-card {
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

[data-theme="light"] .font-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

[data-theme="light"] .context-menu {
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}

[data-theme="light"] .toast {
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
  background: #c7c7cc;
}

[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
  background: #aeaeb2;
}

[data-theme="light"] .showcase-hero-bg .showcase-orb {
  opacity: 0.12;
}

/* ============================================
   APP MODALS (Permission / Unsupported)
   ============================================ */
.app-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  animation: modalFadeIn 0.3s ease;
}
.app-modal-overlay.hidden {
  display: none;
}
@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.app-modal {
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  max-width: 440px;
  width: 90%;
  text-align: center;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
  animation: modalSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modalSlideIn {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.app-modal-icon {
  margin-bottom: 20px;
}
.app-modal-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}
.app-modal-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 28px;
}
.app-modal-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 32px;
  background: linear-gradient(135deg, var(--accent), #6366f1);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
}
.app-modal-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.4);
}
.app-modal-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}
.app-modal-note {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 16px;
}
.app-modal-browsers {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.app-modal-browser-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  text-decoration: none;
  transition: all 0.2s ease;
}
.app-modal-browser-link:hover {
  background: var(--bg-elevated);
  transform: translateX(4px);
}
.app-modal-browser-link span {
  font-size: 0.8rem;
  color: var(--text-muted);
}
