/* ============================================================
   files-sample.com - Premium stylesheet
   Champagne Gold + Deep Ink editorial aesthetic
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  --gold: #c9a961;
  --gold-soft: #d8bf85;
  --gold-deep: #a8893c;

  --ink: #0a0e1a;
  --ink-soft: #1a1f30;
  --ink-deeper: #050811;

  --paper: #fafaf7;
  --paper-warm: #f5f3ec;
  --line: #e8e6df;

  --text: #0a0e1a;
  --text-muted: #5a6271;
  --text-soft: #6b7280;

  --bg: var(--paper);
  --surface: #ffffff;
  --surface-2: #f7f5ee;
  --border: var(--line);

  --accent: var(--gold);
  --accent-hover: var(--gold-deep);

  --serif: 'Fraunces', Georgia, serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', Menlo, monospace;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --shadow-sm: 0 1px 2px rgba(10, 14, 26, 0.04);
  --shadow: 0 4px 12px rgba(10, 14, 26, 0.06), 0 1px 3px rgba(10, 14, 26, 0.04);
  --shadow-lg: 0 20px 40px -12px rgba(10, 14, 26, 0.15), 0 8px 16px -8px rgba(10, 14, 26, 0.08);
  --shadow-glow: 0 0 0 1px rgba(201, 169, 97, 0.2), 0 8px 24px rgba(201, 169, 97, 0.15);

  --transition: 200ms cubic-bezier(0.22, 1, 0.36, 1);
  --transition-slow: 400ms cubic-bezier(0.22, 1, 0.36, 1);

  --container: 1200px;
  --container-narrow: 720px;
}

[data-theme="dark"] {
  --bg: #0a0e1a;
  --surface: #11162a;
  --surface-2: #161c33;
  --border: #1f2640;

  --text: #f5f3ec;
  --text-muted: #9ca3af;
  --text-soft: #6b7280;

  --line: #1f2640;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.5), 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 20px 40px -12px rgba(0, 0, 0, 0.7), 0 8px 16px -8px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 0 1px rgba(201, 169, 97, 0.3), 0 8px 24px rgba(201, 169, 97, 0.25);
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--transition), color var(--transition);
}
img, svg, video { display: block; max-width: 100%; height: auto; }
button { font-family: inherit; cursor: pointer; border: 0; background: none; padding: 0; color: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; }
a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }
ul, ol { padding: 0; margin: 0; list-style: none; }
h1, h2, h3, h4, h5 { margin: 0; font-family: var(--serif); font-weight: 500; line-height: 1.15; letter-spacing: -0.02em; }
p { margin: 0; }
code { font-family: var(--mono); font-size: 0.9em; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: var(--paper);
  padding: 0.75rem 1rem; z-index: 9999; border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; }

/* ---------- Layout ---------- */
.container { max-width: var(--container); margin: 0 auto; padding: 0 1.5rem; }
.container-narrow { max-width: var(--container-narrow); }
.ta-right { text-align: right; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  border-radius: 999px;
  font-weight: 500; font-size: 0.95rem;
  letter-spacing: -0.005em;
  transition: all var(--transition);
  cursor: pointer;
  white-space: nowrap;
}
.btn-primary {
  background: var(--ink);
  color: var(--paper);
  box-shadow: var(--shadow);
}
.btn-primary:hover {
  background: var(--ink-soft);
  color: var(--paper);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}
[data-theme="dark"] .btn-primary {
  background: var(--gold);
  color: var(--ink);
}
[data-theme="dark"] .btn-primary:hover {
  background: var(--gold-soft);
  color: var(--ink);
}
.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  border-color: var(--text);
  color: var(--text);
  transform: translateY(-1px);
}
.btn-sm { padding: 0.5rem 1rem; font-size: 0.85rem; }

.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  transition: all var(--transition);
  border: 1px solid transparent;
}
.btn-icon:hover {
  background: var(--surface);
  border-color: var(--border);
  transform: translateY(-1px);
}

.icon { flex-shrink: 0; }

/* ---------- Header / Navigation ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition), background-color var(--transition);
}
.site-header.is-scrolled {
  border-bottom-color: var(--border);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px;
  gap: 2rem;
}
.logo {
  display: inline-flex; align-items: center; gap: 0.65rem;
  color: var(--text);
  font-weight: 600;
}
.logo:hover { color: var(--text); }
.logo-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  background: var(--ink);
  color: var(--gold);
  border-radius: 8px;
  transition: transform var(--transition);
}
[data-theme="dark"] .logo-mark { background: var(--gold); color: var(--ink); }
.logo:hover .logo-mark { transform: rotate(-6deg); }
.logo-text {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.primary-nav ul {
  display: flex; gap: 0.25rem;
}
.primary-nav a {
  display: inline-block;
  padding: 0.5rem 0.95rem;
  color: var(--text-muted);
  font-size: 0.92rem; font-weight: 500;
  border-radius: 8px;
  transition: all var(--transition);
}
.primary-nav a:hover { color: var(--text); background: var(--surface-2); }
.primary-nav a.is-active { color: var(--text); background: var(--surface-2); }

.header-actions { display: flex; align-items: center; gap: 0.5rem; }
.header-icon-btn {
  width: 36px; height: 36px;
  border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  transition: all var(--transition);
  text-decoration: none;
}
.header-icon-btn:hover { background: var(--surface-2); color: var(--text); }
.theme-toggle {
  width: 36px; height: 36px;
  border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  transition: all var(--transition);
}
.theme-toggle:hover { background: var(--surface-2); color: var(--text); }
.theme-icon-light, .theme-icon-dark { display: inline-flex; }
[data-theme="light"] .theme-icon-light { display: none; }
[data-theme="dark"] .theme-icon-dark { display: none; }

.mobile-menu-toggle { display: none; }

@media (max-width: 1024px) {
  .primary-nav { display: none; }
  .mobile-menu-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px;
    border-radius: 8px;
    color: var(--text);
  }
  .mobile-menu-toggle:hover { background: var(--surface-2); }
}

/* ---------- Mobile menu ---------- */
.mobile-menu {
  position: fixed; inset: 0; z-index: 200;
  background: var(--bg);
  padding: 1.5rem;
  overflow-y: auto;
  animation: fadeSlide var(--transition);
}
@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}
.mobile-menu-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 2rem;
}
.mobile-menu-close {
  width: 36px; height: 36px;
  border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text);
}
.mobile-menu-close:hover { background: var(--surface-2); }
.mobile-menu nav ul { display: flex; flex-direction: column; gap: 0.25rem; }
.mobile-menu nav a {
  display: block; padding: 1rem;
  color: var(--text);
  font-size: 1.1rem; font-weight: 500;
  border-radius: var(--radius);
}
.mobile-menu nav a:hover { background: var(--surface-2); }
.mobile-menu-divider {
  height: 1px; background: var(--border);
  margin: 0.75rem 0;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 6rem 0 7rem;
  overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 0;
}
.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
}
.hero-orb-1 {
  top: -20%; left: -10%;
  width: 500px; height: 500px;
  background: radial-gradient(circle, var(--gold) 0%, transparent 70%);
  animation: orbFloat 20s ease-in-out infinite;
}
.hero-orb-2 {
  bottom: -30%; right: -15%;
  width: 600px; height: 600px;
  background: radial-gradient(circle, var(--ink) 0%, transparent 70%);
  opacity: 0.15;
  animation: orbFloat 25s ease-in-out infinite reverse;
}
[data-theme="dark"] .hero-orb-2 {
  background: radial-gradient(circle, var(--gold) 0%, transparent 70%);
  opacity: 0.2;
}
@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0); }
  50%      { transform: translate(40px, -30px); }
}
.hero-grid-overlay {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, color-mix(in srgb, var(--text) 6%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, var(--text) 6%, transparent) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: radial-gradient(ellipse at center, black 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 0%, transparent 75%);
}

.hero-content {
  position: relative; z-index: 1;
  text-align: center;
  max-width: 800px; margin: 0 auto;
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 0.55rem;
  padding: 0.4rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.85rem; color: var(--text-muted);
  font-weight: 500;
  box-shadow: var(--shadow-sm);
  animation: fadeIn 0.6s 0.1s both;
}
.hero-eyebrow-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 25%, transparent);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.5; }
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-title {
  font-size: clamp(2.5rem, 7vw, 5.5rem);
  font-weight: 500;
  line-height: 1.05;
  margin: 1.75rem 0 1.5rem;
  animation: fadeIn 0.6s 0.2s both;
}
.hero-title-accent {
  background: linear-gradient(120deg, var(--gold) 0%, var(--gold-deep) 50%, var(--gold) 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-style: italic;
  animation: shimmer 6s linear infinite;
}
@keyframes shimmer {
  to { background-position: 200% center; }
}
.hero-subtitle {
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
  color: var(--text-muted);
  max-width: 620px;
  margin: 0 auto;
  animation: fadeIn 0.6s 0.3s both;
}

.hero-actions {
  display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap;
  margin-top: 2.5rem;
  animation: fadeIn 0.6s 0.4s both;
}

.hero-stats {
  display: flex; align-items: center; justify-content: center;
  gap: 1.75rem;
  margin-top: 4rem;
  animation: fadeIn 0.6s 0.5s both;
}
.hero-stat-value {
  font-family: var(--serif);
  font-size: 2.25rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}
.hero-stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 0.25rem;
}
.hero-stat-divider {
  width: 1px; height: 40px;
  background: var(--border);
}

@media (max-width: 600px) {
  .hero { padding: 3rem 0 4rem; }
  .hero-stats { gap: 1rem; }
  .hero-stat-value { font-size: 1.5rem; }
}

/* ---------- Section header ---------- */
.section-header {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 3.5rem;
}
.section-eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gold-deep);
  margin-bottom: 1rem;
}
[data-theme="dark"] .section-eyebrow { color: var(--gold); }
.section-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 500;
  margin-bottom: 1rem;
}
.section-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ---------- Categories ---------- */
.categories-section { padding: 5rem 0; }
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
}
.category-card {
  position: relative;
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0;
  color: var(--text);
  transition: all var(--transition-slow);
  overflow: hidden;
  isolation: isolate;
}
.category-card:hover {
  color: var(--text);
  border-color: transparent;
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}
.category-card::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--card-color) 0%, transparent 60%);
  opacity: 0;
  transition: opacity var(--transition-slow);
  z-index: -1;
}
.category-card:hover::before { opacity: 0.08; }
.category-card-inner {
  padding: 2rem;
  display: flex; flex-direction: column;
  height: 100%;
  min-height: 240px;
}
.category-card-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--card-color) 15%, transparent);
  color: var(--card-color);
  margin-bottom: 1.5rem;
  transition: transform var(--transition-slow);
}
.category-card:hover .category-card-icon { transform: scale(1.05) rotate(-3deg); }
.category-card-meta {
  position: absolute;
  top: 2rem; right: 2rem;
}
.category-card-count {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  background: var(--surface-2);
  border-radius: 999px;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}
.category-card-title {
  font-size: 1.5rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}
.category-card-description {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 1.5rem;
  flex: 1;
}
.category-card-cta {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-weight: 500;
  color: var(--text);
  font-size: 0.95rem;
  transition: gap var(--transition);
}
.category-card:hover .category-card-cta { gap: 0.7rem; }
.category-card-cta .icon { transition: transform var(--transition); }
.category-card:hover .category-card-cta .icon { transform: translateX(2px); }

/* ---------- Features ---------- */
.features-section {
  padding: 5rem 0;
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: all var(--transition);
}
.feature-card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.feature-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px;
  background: var(--ink);
  color: var(--gold);
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
}
[data-theme="dark"] .feature-icon { background: var(--gold); color: var(--ink); }
.feature-card h3 {
  font-size: 1.15rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
}
.feature-card p {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* ---------- CTA ---------- */
.cta-section { padding: 5rem 0; }
.cta-card {
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius-xl);
  padding: clamp(3rem, 6vw, 5rem);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-card::before {
  content: '';
  position: absolute;
  top: -50%; left: -10%;
  width: 60%; height: 200%;
  background: radial-gradient(circle, var(--gold) 0%, transparent 60%);
  opacity: 0.15;
  pointer-events: none;
}
.cta-card h2 {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  margin-bottom: 0.75rem;
  position: relative;
}
.cta-card p {
  color: rgba(245, 243, 236, 0.7);
  margin-bottom: 1.75rem;
  position: relative;
  font-size: 1.05rem;
}
.cta-card .btn-primary {
  background: var(--gold);
  color: var(--ink);
  position: relative;
}
.cta-card .btn-primary:hover { background: var(--gold-soft); color: var(--ink); }

/* ---------- Page hero (sub-pages) ---------- */
.page-hero {
  padding: 4rem 0 3rem;
  position: relative;
  --accent: var(--gold);
}
.breadcrumb {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb-sep { opacity: 0.4; }

.page-hero-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 64px; height: 64px;
  background: var(--accent);
  color: var(--surface);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}
[data-theme="dark"] .page-hero-icon { color: var(--ink); }

.format-hero-badge {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: var(--ink);
  color: var(--gold);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 1.25rem;
}
[data-theme="dark"] .format-hero-badge { background: var(--gold); color: var(--ink); }

.page-hero-title {
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  font-weight: 500;
  margin-bottom: 1rem;
  max-width: 800px;
}
.page-hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 700px;
  line-height: 1.6;
}

/* ---------- Format list (category page) ---------- */
.format-list-section { padding: 2rem 0 6rem; }
.format-list-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 2rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.format-list-header h2 {
  font-size: 1.5rem;
  font-weight: 500;
}
.search-box {
  display: flex; align-items: center; gap: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.6rem 1rem;
  min-width: 280px;
  color: var(--text-muted);
  transition: border-color var(--transition);
}
.search-box:focus-within { border-color: var(--gold); }
.search-box input {
  flex: 1;
  border: 0; background: transparent;
  color: var(--text);
  outline: 0;
}

.format-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.format-card {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  color: var(--text);
  transition: all var(--transition);
}
.format-card:hover {
  color: var(--text);
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.format-card-ext {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--gold-deep);
  font-weight: 500;
  letter-spacing: 0.02em;
  margin-bottom: 0.75rem;
}
[data-theme="dark"] .format-card-ext { color: var(--gold); }
.format-card-name {
  font-size: 1.5rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
}
.format-card-fullname {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  flex: 1;
}
.format-card-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
}
.format-card:hover .format-card-footer { color: var(--text); }

/* ---------- Files table (format page) ---------- */
.files-section { padding: 2rem 0 6rem; }
.files-section-title {
  font-size: 1.5rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
}
.files-table-wrapper {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 3rem;
}
.files-table {
  width: 100%;
  border-collapse: collapse;
}
.files-table thead {
  background: var(--surface-2);
}
.files-table th {
  padding: 1rem 1.25rem;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.files-table td {
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}
.files-table tr:last-child td { border-bottom: 0; }
.files-table tr { transition: background-color var(--transition); }
.files-table tbody tr:hover { background: var(--surface-2); }
.files-table-label { font-weight: 500; }
.files-table-specs, .files-table-size, .files-table-downloads { color: var(--text-muted); }
.files-table-actions {
  display: inline-flex; gap: 0.5rem; align-items: center;
}

/* Download button - gold pill, prominent */
.btn-download {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  background: var(--gold);
  color: var(--ink);
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.88rem;
  white-space: nowrap;
  transition: all var(--transition);
}
.btn-download:hover {
  background: var(--gold-soft);
  color: var(--ink);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(201,169,97,0.35);
}

/* Format tag badge in table */
.format-tag {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

/* Download button text: show full on desktop, short on tiny phones */
.btn-download-text-short { display: none; }

@media (max-width: 420px) {
  .btn-download-text { display: none; }
  .btn-download-text-short { display: inline; }
}

@media (max-width: 700px) {
  /* Hide Label and Format columns on mobile to keep readable layout */
  .files-table th:nth-child(2),
  .files-table td:nth-child(2),
  .files-table th:nth-child(4),
  .files-table td:nth-child(4) { display: none; }

  /* Reduce padding so columns fit comfortably */
  .files-table th,
  .files-table td {
    padding: 0.85rem 0.65rem;
    font-size: 0.85rem;
  }
  .files-table th {
    font-size: 0.65rem;
    letter-spacing: 0.06em;
  }

  /* Smaller, more compact download button */
  .btn-download {
    padding: 0.5rem 0.85rem;
    font-size: 0.78rem;
    gap: 0.35rem;
  }
  .btn-download .icon {
    width: 14px;
    height: 14px;
  }

  /* Tighter container padding */
  .container { padding: 0 1rem; }

  /* Ad slot spacing */
  .ad-slot-leaderboard {
    min-height: 80px;
    margin: 1.5rem 0;
  }
}

@media (max-width: 420px) {
  /* Very small phones - make table even tighter */
  .files-table th,
  .files-table td {
    padding: 0.75rem 0.5rem;
    font-size: 0.8rem;
  }

  /* On tiny screens, just say "Download" without the format name */
  .btn-download {
    padding: 0.45rem 0.75rem;
    font-size: 0.72rem;
  }

  /* Format hero badge smaller */
  .format-hero-badge {
    font-size: 0.85rem;
    padding: 0.4rem 0.85rem;
  }

  /* Page hero tighter spacing */
  .page-hero {
    padding: 2.5rem 0 2rem;
  }
  .page-hero-title {
    font-size: 1.75rem;
  }
  .page-hero-subtitle {
    font-size: 0.95rem;
  }
}

/* ---------- Format info cards ---------- */
.format-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}
.format-info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
}
.format-info-card h3 {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 1rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: var(--sans);
}
.mime-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}
.mime-list li:last-child { border-bottom: 0; }
.mime-list code {
  background: var(--surface-2);
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-size: 0.85rem;
}
.related-list a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.9rem;
}
.related-list a:last-child { border-bottom: 0; }
.related-list a span {
  font-family: var(--sans);
  color: var(--text-muted);
  font-size: 0.85rem;
}
.related-list a:hover { color: var(--gold-deep); }
[data-theme="dark"] .related-list a:hover { color: var(--gold); }

/* ---------- Preview modal ---------- */
.preview-modal {
  position: fixed; inset: 0;
  z-index: 300;
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
  animation: fadeIn 0.2s;
}
.preview-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(10, 14, 26, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.preview-modal-content {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  max-width: 900px; width: 100%;
  max-height: 85vh;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.preview-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.preview-modal-header h3 {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 500;
}
.preview-modal-body {
  padding: 1.5rem;
  overflow: auto;
  flex: 1;
}
.preview-loading {
  text-align: center;
  color: var(--text-muted);
  padding: 3rem;
}
.preview-error {
  text-align: center;
  color: var(--text);
  padding: 3rem 2rem;
  background: var(--surface-2);
  border-radius: var(--radius);
  line-height: 1.6;
}
.preview-error small {
  display: block;
  margin-top: 0.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.preview-code {
  background: var(--ink-deeper);
  color: #e8e6df;
  padding: 1.5rem;
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 0.85rem;
  line-height: 1.65;
  overflow: auto;
  white-space: pre;
  margin: 0;
  max-height: 60vh;
}
.preview-image {
  max-width: 100%;
  max-height: 60vh;
  margin: 0 auto;
  border-radius: var(--radius);
  display: block;
}
.preview-audio, .preview-video {
  width: 100%;
  border-radius: var(--radius);
}

/* ---------- Empty state ---------- */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

/* ---------- Content / prose pages ---------- */
.content-section { padding: 1rem 0 6rem; }
.prose { font-size: 1.05rem; line-height: 1.75; color: var(--text); }
.prose h2 {
  font-size: 1.6rem;
  font-weight: 500;
  margin: 2.5rem 0 0.75rem;
}
.prose h2:first-child { margin-top: 0; }
.prose p { margin-bottom: 1.25rem; color: var(--text); }
.prose ul {
  list-style: disc;
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
}
.prose li { margin-bottom: 0.5rem; }
.prose strong { font-weight: 600; }

/* ---------- Forms ---------- */
.contact-form {
  display: flex; flex-direction: column; gap: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-top: 2rem;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
}
.contact-form label {
  display: flex; flex-direction: column; gap: 0.4rem;
}
.contact-form span {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}
.contact-form input, .contact-form textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  color: var(--text);
  outline: 0;
  transition: border-color var(--transition);
  font-family: inherit;
  resize: vertical;
}
.contact-form input:focus, .contact-form textarea:focus {
  border-color: var(--gold);
}

.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  font-size: 0.95rem;
}
.alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
[data-theme="dark"] .alert-success { background: #022c22; color: #6ee7b7; border-color: #064e3b; }
[data-theme="dark"] .alert-error { background: #2d0a0a; color: #fca5a5; border-color: #7f1d1d; }

.contact-info {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  text-align: center;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  padding: 4rem 0 2rem;
  margin-top: 4rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}
@media (max-width: 800px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
}
@media (max-width: 500px) {
  .footer-grid { grid-template-columns: 1fr; }
}
.footer-brand .logo { margin-bottom: 1rem; }
.footer-tagline {
  color: var(--text-muted);
  font-size: 0.92rem;
  max-width: 300px;
  line-height: 1.55;
}
.footer-col h4 {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 1rem;
}
.footer-col ul { display: flex; flex-direction: column; gap: 0.6rem; }
.footer-col a {
  color: var(--text);
  font-size: 0.92rem;
  transition: color var(--transition);
}
.footer-col a:hover { color: var(--gold-deep); }
[data-theme="dark"] .footer-col a:hover { color: var(--gold); }
.footer-stat {
  font-family: var(--serif);
  font-weight: 500;
  color: var(--text);
}
.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 1rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ---------- Error page ---------- */
.error-section {
  padding: 6rem 0;
  text-align: center;
}
.error-code {
  font-family: var(--serif);
  font-size: clamp(5rem, 18vw, 12rem);
  font-weight: 500;
  line-height: 1;
  color: var(--gold);
  margin-bottom: 1rem;
}
.error-title {
  font-size: 2rem;
  margin-bottom: 1rem;
}
.error-subtitle {
  color: var(--text-muted);
  margin-bottom: 2rem;
}

/* ============================================================
   ADDITIONS - ad slots, format page sidebar layout, download header
   ============================================================ */

/* Ad slot - universal label */
.ad-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-soft);
  display: block;
  text-align: center;
}

/* Horizontal banner ad (homepage, category page, format page in-content) */
.ad-slot-leaderboard {
  width: 100%;
  min-height: 100px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 1rem;
  margin: 2rem 0;
}

/* Sidebar ad (format page right column) */
.ad-slot-sidebar {
  width: 300px;
  min-height: 600px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

/* Format page - table on left, sticky ad on right */
.format-content-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
  align-items: start;
}
.format-content-main { min-width: 0; }
.format-content-sidebar {
  position: sticky;
  top: 90px;
}

/* Hide sidebar on smaller screens */
@media (max-width: 1100px) {
  .format-content-layout { grid-template-columns: 1fr; }
  .format-content-sidebar { display: none; }
}

/* Download column header aligns with the gold pill button */
.th-download { text-align: left; }
.td-download { white-space: nowrap; }

/* ============================================================
   FONT LIBRARY (category=fonts page + font detail page)
   ============================================================ */

.font-style-section {
  margin-top: 3rem;
}
.font-style-heading {
  font-size: 1.25rem;
  font-weight: 500;
  margin-bottom: 1.25rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--border);
  font-family: var(--sans);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
}

.font-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.font-card {
  display: flex; flex-direction: column; align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  color: var(--text);
  text-align: center;
  transition: all var(--transition);
  min-height: 180px;
  justify-content: center;
}
.font-card:hover {
  color: var(--text);
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.font-card-preview {
  font-size: 4rem;
  font-weight: 500;
  line-height: 1;
  margin-bottom: 1rem;
  color: var(--text);
}
.font-card-name {
  font-size: 1.05rem;
  font-weight: 500;
  margin-bottom: .25rem;
}
.font-card-meta {
  font-size: .8rem;
  color: var(--text-muted);
}

/* Font detail page */
.font-hero-meta {
  margin-bottom: 1rem;
}
.font-style-badge {
  display: inline-block;
  padding: .35rem .85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
}

.font-preview-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  text-align: center;
  margin-bottom: 2rem;
}
.font-preview-text {
  font-size: clamp(1.5rem, 4vw, 3rem);
  font-weight: 400;
  line-height: 1.3;
  margin-bottom: 2rem;
  color: var(--text);
}
.font-preview-sizes {
  display: flex; flex-direction: column; gap: 1rem;
  text-align: left;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.font-download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}
.font-download-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.font-download-ext {
  font-family: var(--mono);
  font-size: .85rem;
  color: var(--gold-deep);
  font-weight: 500;
  margin-bottom: .5rem;
}
[data-theme="dark"] .font-download-ext { color: var(--gold); }
.font-download-name {
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: .35rem;
}
.font-download-desc {
  font-size: .85rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  line-height: 1.5;
  min-height: 2.5rem;
}

/* Font weights download table (font detail page) */
.font-weights-table {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.font-weights-table table {
  width: 100%;
  border-collapse: collapse;
}
.font-weights-table th,
.font-weights-table td {
  padding: 1rem 1.25rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.font-weights-table th {
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: .75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
}
.font-weights-table tbody tr:last-child td { border-bottom: none; }
.font-weights-table tbody tr:hover { background: var(--surface-2); }

.weight-name {
  font-weight: 500;
  font-size: 1rem;
  margin-bottom: .15rem;
}
.weight-num {
  font-family: var(--mono);
  font-size: .75rem;
  color: var(--text-muted);
}

.btn-download-mini {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .4rem .75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--mono);
  font-size: .8rem;
  color: var(--text);
  transition: all var(--transition);
}
.btn-download-mini:hover {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--ink);
}
[data-theme="dark"] .btn-download-mini:hover {
  background: var(--gold);
  color: var(--ink);
}

/* Mobile - stack the table cells */
@media (max-width: 700px) {
  .font-weights-table th:nth-child(n+2),
  .font-weights-table td:nth-child(n+2) {
    padding: .5rem .35rem;
    text-align: center;
  }
  .font-weights-table th { font-size: .65rem; }
  .btn-download-mini { padding: .3rem .5rem; font-size: .7rem; gap: .2rem; }
  .btn-download-mini .icon { width: 12px; height: 12px; }
}

.weights-group-heading {
  font-size: 1rem;
  font-weight: 500;
  margin: 2rem 0 .75rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-family: var(--sans);
}
.weights-group-heading:first-child { margin-top: 0; }

/* ============================================================
   PRIORITY UPGRADES - Format comparison, license, polish
   ============================================================ */

/* Comparison table section (on category pages) */
.comparison-section {
  padding: 3rem 0 1rem;
}
.comparison-section .section-title {
  text-align: left;
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: .5rem;
  text-wrap: balance;
}
.comparison-section .section-subtitle {
  text-align: left;
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  max-width: 60ch;
}
.comparison-table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
  font-size: .95rem;
}
.comparison-table th {
  background: var(--surface-2);
  padding: 1rem 1.25rem;
  text-align: left;
  font-family: var(--mono);
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.comparison-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.comparison-table tr:last-child td { border-bottom: none; }
.comparison-table tr:hover { background: var(--surface-2); }
.comparison-table .comparison-format {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 1rem;
  color: var(--gold-deep);
}
[data-theme="dark"] .comparison-table .comparison-format { color: var(--gold); }

.comparison-takeaway {
  margin-top: 1.5rem;
  padding: 1.25rem 1.5rem;
  background: color-mix(in srgb, var(--gold) 8%, transparent);
  border-left: 3px solid var(--gold);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: .95rem;
  line-height: 1.6;
}
.comparison-takeaway strong { color: var(--gold-deep); }
[data-theme="dark"] .comparison-takeaway strong { color: var(--gold); }

/* License chip on format pages */
.license-info { padding: .5rem 0; }
.license-chip {
  display: inline-block;
  padding: .35rem .85rem;
  background: color-mix(in srgb, var(--gold) 12%, transparent);
  color: var(--gold-deep);
  border: 1px solid color-mix(in srgb, var(--gold) 30%, transparent);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: .8rem;
  font-weight: 500;
  letter-spacing: .02em;
}
[data-theme="dark"] .license-chip { color: var(--gold); }
.license-note {
  margin-top: .75rem;
  color: var(--text-muted);
  font-size: .9rem;
  line-height: 1.5;
}
.license-link {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  margin-top: .5rem;
  font-size: .85rem;
  color: var(--gold-deep);
  text-decoration: none;
}
[data-theme="dark"] .license-link { color: var(--gold); }
.license-link:hover { text-decoration: underline; }

/* TINY STUFF - polish fixes */

/* text-wrap: balance on titles */
.hero-title,
.section-title,
.page-hero-title {
  text-wrap: balance;
}

/* font-feature-settings for Fraunces alternates */
.hero-title,
.page-hero-title,
.section-title {
  font-feature-settings: "ss01", "ss02", "kern";
  font-variant-numeric: oldstyle-nums;
}

/* Faster category card hover */
.category-card {
  transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1),
              border-color 250ms cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Gold CTA hover with shadow-glow */
.btn-primary:hover {
  box-shadow: var(--shadow-glow), 0 0 0 1px var(--gold);
}

/* Reduced motion - pause animations */
@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;
    animation-play-state: paused !important;
  }
}

/* Improved ad slot - intentional looking */
.ad-slot-leaderboard,
.ad-slot-mid,
.ad-slot-sidebar {
  background: var(--paper-warm, color-mix(in srgb, var(--gold) 4%, var(--surface)));
  border: 1px dashed color-mix(in srgb, var(--gold) 25%, var(--border));
  border-radius: var(--radius);
  padding: 1.5rem 1.25rem;
  text-align: center;
  position: relative;
}
.ad-label {
  display: block;
  font-family: var(--mono);
  font-size: .65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .15em;
  color: var(--text-muted);
  opacity: .65;
  margin-bottom: .5rem;
}

/* Trust signals: byline + last-updated */
.byline {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1rem 0;
  margin: 1rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  font-size: .85rem;
  color: var(--text-muted);
}
.byline-author {
  font-weight: 500;
  color: var(--text);
}
.byline-meta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.byline-meta time {
  font-family: var(--mono);
  font-size: .8rem;
}

/* SHA-256 checksum display */
.checksum {
  font-family: var(--mono);
  font-size: .7rem;
  color: var(--text-muted);
  margin-top: .25rem;
  word-break: break-all;
  display: block;
}
.checksum-label {
  display: inline-block;
  padding: 1px 6px;
  background: var(--surface-2);
  border-radius: 3px;
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-right: .5rem;
  color: var(--text-muted);
}

/* ============================================================
   HERO SEARCH BAR with chips
   ============================================================ */
.hero-search-wrap {
  max-width: 640px;
  margin: 2.5rem auto 0;
}
.hero-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .5rem .5rem .5rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.04);
  transition: all 250ms cubic-bezier(0.4, 0, 0.2, 1);
}
[data-theme="dark"] .hero-search {
  box-shadow: 0 1px 2px rgba(0,0,0,0.3), 0 8px 24px rgba(0,0,0,0.3);
}
.hero-search:focus-within {
  border-color: var(--gold);
  box-shadow:
    0 0 0 4px color-mix(in srgb, var(--gold) 18%, transparent),
    0 8px 24px color-mix(in srgb, var(--gold) 12%, transparent);
}
.hero-search > .icon { color: var(--text-muted); flex-shrink: 0; }
.hero-search input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 1.05rem;
  font-family: var(--sans);
  color: var(--text);
  outline: none;
  min-width: 0;
  padding: .5rem 0;
}
.hero-search input::placeholder { color: var(--text-muted); }

.hero-search-submit {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .65rem 1.25rem;
  background: var(--ink);
  color: var(--paper);
  border: none;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 200ms;
  flex-shrink: 0;
}
.hero-search-submit:hover {
  background: var(--gold);
  color: var(--ink);
  transform: translateX(2px);
}
[data-theme="dark"] .hero-search-submit {
  background: var(--gold);
  color: var(--ink);
}
[data-theme="dark"] .hero-search-submit:hover {
  background: var(--gold-deep);
  color: var(--paper);
}
.hero-search-submit .icon { transition: transform 200ms; }
.hero-search-submit:hover .icon { transform: translateX(3px); }

/* Mobile: stack the submit below */
@media (max-width: 540px) {
  .hero-search-submit span { display: none; }
  .hero-search-submit {
    width: 40px;
    height: 40px;
    padding: 0;
    justify-content: center;
  }
}

/* Popular chips */
.hero-search-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  margin-top: 1.25rem;
  padding: 0 .5rem;
}
.hero-search-chips-label {
  font-family: var(--mono);
  font-size: .75rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-right: .25rem;
}
.hero-chip {
  display: inline-flex;
  align-items: center;
  padding: .35rem .85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: .8rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  transition: all 200ms;
}
.hero-chip:hover {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--ink);
  transform: translateY(-1px);
}

/* ============================================================
   TRENDING STRIP
   ============================================================ */
.trending-section {
  padding: 2rem 0 1rem;
  border-top: 1px solid var(--border);
}
.trending-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  gap: 1rem;
}
.trending-title {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin: 0;
}
.trending-title .icon { color: var(--gold); }
.trending-meta {
  font-family: var(--mono);
  font-size: .75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
}
.trending-rail {
  display: flex;
  gap: .85rem;
  overflow-x: auto;
  padding: .25rem 0 1rem;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}
.trending-rail::-webkit-scrollbar { height: 6px; }
.trending-rail::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.trending-card {
  flex: 0 0 auto;
  width: 200px;
  padding: 1rem 1.15rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  transition: all 250ms;
  text-decoration: none;
  color: var(--text);
}
.trending-card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  color: var(--text);
}
.trending-ext {
  font-family: var(--mono);
  font-size: .75rem;
  font-weight: 600;
  color: var(--gold-deep);
  text-transform: lowercase;
}
[data-theme="dark"] .trending-ext { color: var(--gold); }
.trending-name {
  font-family: var(--mono);
  font-size: .85rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.trending-downloads {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-family: var(--mono);
  font-size: .75rem;
  color: var(--text-muted);
}

/* ============================================================
   LIVE PREVIEW SHOWCASE
   ============================================================ */
.preview-showcase-section {
  padding: 4rem 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.preview-showcase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 2.5rem;
}
.preview-showcase-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 250ms;
}
.preview-showcase-card:hover {
  border-color: var(--gold);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.preview-showcase-media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--ink);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.preview-showcase-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.preview-showcase-code {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 1.25rem;
  background: var(--ink);
  color: #d8bf85;
  font-family: var(--mono);
  font-size: .8rem;
  line-height: 1.5;
  overflow: auto;
  white-space: pre;
}
.preview-showcase-code code { color: inherit; background: none; padding: 0; }

.preview-showcase-audio-wrap {
  flex-direction: column;
  gap: 1rem;
  padding: 1.5rem;
}
.preview-showcase-waveform {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 100%;
  height: 70px;
}
.preview-showcase-waveform span {
  width: 3px;
  background: var(--gold);
  border-radius: 2px;
  opacity: .8;
  animation: waveform-bounce 1.2s ease-in-out infinite alternate;
}
@keyframes waveform-bounce {
  0%   { transform: scaleY(0.4); }
  100% { transform: scaleY(1); }
}
.preview-showcase-audio {
  width: 100%;
  max-width: 240px;
}

.preview-showcase-meta {
  padding: 1.25rem 1.5rem 1.5rem;
}
.preview-showcase-ext {
  display: inline-block;
  font-family: var(--mono);
  font-size: .7rem;
  font-weight: 600;
  color: var(--gold-deep);
  background: color-mix(in srgb, var(--gold) 12%, transparent);
  padding: .2rem .65rem;
  border-radius: 999px;
  margin-bottom: .75rem;
}
[data-theme="dark"] .preview-showcase-ext { color: var(--gold); }
.preview-showcase-meta h3 {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 500;
  margin: 0 0 .35rem;
}
.preview-showcase-meta p {
  font-size: .9rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.55;
}

/* ============================================================
   SEARCH PAGE
   ============================================================ */
.search-page-form {
  display: flex;
  gap: .5rem;
  align-items: center;
  max-width: 600px;
  margin-top: 2rem;
  padding: .65rem .65rem .65rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
}
.search-page-form .icon { color: var(--text-muted); }
.search-page-form input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 1rem;
  outline: none;
  color: var(--text);
}
.search-page-form input::placeholder { color: var(--text-muted); }
.search-page-form .btn { flex-shrink: 0; }

.search-results-section { padding: 3rem 0 4rem; }
.search-results-heading {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 500;
  margin-bottom: 1.25rem;
}

.search-files-list {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.search-file-row {
  display: grid;
  grid-template-columns: 60px 1fr auto auto;
  align-items: center;
  gap: 1rem;
  padding: .85rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: all 200ms;
}
.search-file-row:hover {
  border-color: var(--gold);
  background: var(--surface-2);
  color: var(--text);
}
.search-file-ext {
  font-family: var(--mono);
  font-size: .85rem;
  color: var(--gold-deep);
  font-weight: 500;
}
[data-theme="dark"] .search-file-ext { color: var(--gold); }
.search-file-name {
  font-family: var(--mono);
  font-size: .9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-file-meta {
  font-size: .8rem;
  color: var(--text-muted);
  white-space: nowrap;
}
@media (max-width: 600px) {
  .search-file-row {
    grid-template-columns: 50px 1fr auto;
  }
  .search-file-meta { display: none; }
}

/* Mobile preview showcase tweaks */
@media (max-width: 700px) {
  .preview-showcase-grid { grid-template-columns: 1fr; }
}

/* Search dropdown (hero search live results) */
.hero-search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-height: 450px;
  overflow-y: auto;
  z-index: 50;
  text-align: left;
}
.search-result-section { padding: .65rem 0; }
.search-result-section + .search-result-section { border-top: 1px solid var(--border); }
.search-result-label {
  font-family: var(--mono);
  font-size: .65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--text-muted);
  padding: .5rem 1.25rem;
}
.search-result-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .65rem 1.25rem;
  text-decoration: none;
  color: var(--text);
  transition: background 150ms;
}
.search-result-item:hover { background: var(--surface-2); color: var(--text); }
.search-result-ext {
  font-family: var(--mono);
  font-size: .8rem;
  color: var(--gold-deep);
  font-weight: 600;
  width: 50px;
  flex-shrink: 0;
}
[data-theme="dark"] .search-result-ext { color: var(--gold); }
.search-result-name {
  font-size: .9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-result-empty {
  padding: 2rem 1.25rem;
  text-align: center;
  color: var(--text-muted);
  font-size: .9rem;
}
.search-result-all {
  display: block;
  padding: .75rem 1.25rem;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  text-align: center;
  font-family: var(--mono);
  font-size: .8rem;
  color: var(--gold-deep);
  text-decoration: none;
  font-weight: 500;
}
[data-theme="dark"] .search-result-all { color: var(--gold); }
.search-result-all:hover { background: color-mix(in srgb, var(--gold) 8%, var(--surface-2)); }

/* ============================================================
   FOUNDER BLOCK (about page)
   ============================================================ */
.founder-block {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 1.75rem;
  align-items: start;
  padding: 1.5rem;
  margin: 2rem 0 3rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.founder-avatar {
  width: 96px;
  height: 96px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-deep) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -.02em;
  flex-shrink: 0;
}
.founder-name {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 500;
  margin: 0 0 .25rem;
}
.founder-title {
  color: var(--text-muted);
  font-size: .9rem;
  margin: 0 0 .75rem;
  font-family: var(--mono);
}
.founder-bio {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  margin: 0 0 1rem;
}
.founder-meta-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.25rem;
  font-size: .85rem;
  color: var(--text-muted);
}
.founder-meta-list li {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}
.founder-meta-list .icon { color: var(--gold); }

@media (max-width: 600px) {
  .founder-block {
    grid-template-columns: 1fr;
    gap: 1rem;
    text-align: center;
  }
  .founder-avatar { margin: 0 auto; }
  .founder-meta-list { justify-content: center; }
}

/* Built-with footer badge (E-E-A-T tech credibility) */
.built-with {
  font-family: var(--mono);
  font-size: .7rem;
  color: var(--text-muted);
  letter-spacing: .05em;
  margin-top: .75rem;
  opacity: .7;
}
.built-with strong { color: var(--gold-deep); font-weight: 500; }
[data-theme="dark"] .built-with strong { color: var(--gold); }

/* ============================================================
   SEARCH OVERLAY (header search button opens this)
   ============================================================ */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 8vh 1.5rem 1.5rem;
  animation: search-overlay-fade-in 200ms ease-out;
}
.search-overlay[hidden] { display: none; }

@keyframes search-overlay-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.search-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--ink) 70%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.search-overlay-panel {
  position: relative;
  width: 100%;
  max-width: 680px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: search-overlay-slide 200ms cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes search-overlay-slide {
  from { transform: translateY(-12px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.search-overlay-form {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.search-overlay-form > .icon { color: var(--text-muted); flex-shrink: 0; }
.search-overlay-form input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 1.1rem;
  color: var(--text);
  outline: none;
  font-family: var(--sans);
}
.search-overlay-form input::placeholder { color: var(--text-muted); }
.search-overlay-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: none;
  background: var(--surface-2);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 200ms;
}
.search-overlay-close:hover {
  background: var(--gold);
  color: var(--ink);
}

.search-overlay-results {
  max-height: 60vh;
  overflow-y: auto;
}
.search-overlay-hint {
  padding: 2rem 1.5rem 2.25rem;
  text-align: center;
  color: var(--text-muted);
  font-size: .95rem;
}
.search-overlay-hint-line {
  margin: 0 0 1.25rem;
  color: var(--text-muted);
  font-size: .95rem;
}
.search-overlay-hint-line strong {
  color: var(--text);
  font-family: var(--mono);
  font-size: .85rem;
  font-weight: 500;
  background: var(--surface-2);
  padding: 1px 7px;
  border-radius: 4px;
  margin: 0 1px;
}
.search-overlay-quickchips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .4rem;
  margin: 1.25rem 0 1.5rem;
}
.search-overlay-hint-keys {
  margin: 1rem 0 0;
  font-size: .8rem;
  color: var(--text-muted);
}
.search-overlay-hint kbd {
  display: inline-block;
  padding: 2px 7px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: .75rem;
  margin: 0 .15rem;
  box-shadow: 0 1px 0 var(--border);
}

/* Search overlay results - reuses existing search-result-* but in panel */
.search-overlay-results .search-result-section { padding: .75rem 0; }
.search-overlay-results .search-result-section + .search-result-section { border-top: 1px solid var(--border); }
.search-overlay-results .search-result-label { padding: .5rem 1.5rem; }
.search-overlay-results .search-result-item { padding: .75rem 1.5rem; gap: 1rem; }
.search-overlay-results .search-result-all { padding: 1rem 1.5rem; }

/* ============================================================
   PRIMARY NAV DROPDOWN - polished pro design
   ============================================================ */
.nav-item-dropdown { position: relative; }
.nav-item-dropdown > a {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  position: relative;
}
.nav-caret {
  transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  opacity: .5;
}
.nav-item-dropdown:hover .nav-caret,
.nav-item-dropdown:focus-within .nav-caret {
  transform: rotate(-180deg);
  opacity: .9;
}

.nav-dropdown {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  width: 460px;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow:
    0 4px 12px color-mix(in srgb, var(--ink) 8%, transparent),
    0 24px 48px -12px color-mix(in srgb, var(--ink) 22%, transparent);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 200ms, transform 250ms cubic-bezier(0.16, 1, 0.3, 1), visibility 0s linear 200ms;
  z-index: 100;
  overflow: hidden;
}
[data-theme="dark"] .nav-dropdown {
  box-shadow:
    0 4px 12px rgba(0,0,0,0.5),
    0 24px 48px -12px rgba(0,0,0,0.7);
}
/* Bridge zone for hover stability */
.nav-dropdown::before {
  content: '';
  position: absolute;
  top: -14px;
  left: 0;
  right: 0;
  height: 14px;
}
.nav-item-dropdown:hover .nav-dropdown,
.nav-item-dropdown:focus-within .nav-dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
  transition: opacity 200ms, transform 250ms cubic-bezier(0.16, 1, 0.3, 1), visibility 0s linear 0s;
}

/* Header with category color */
.nav-dropdown-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.15rem 1.4rem;
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--dd-color, var(--gold)) 14%, var(--surface)) 0%,
    color-mix(in srgb, var(--dd-color, var(--gold)) 4%, var(--surface)) 100%);
  border-bottom: 1px solid var(--border);
  position: relative;
}
.nav-dropdown-header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--dd-color, var(--gold)) 20%,
    var(--dd-color, var(--gold)) 80%,
    transparent 100%);
  opacity: .8;
}
.nav-dropdown-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 11px;
  background: var(--dd-color, var(--gold));
  color: white;
  flex-shrink: 0;
  box-shadow:
    0 4px 12px color-mix(in srgb, var(--dd-color, var(--gold)) 35%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
.nav-dropdown-title {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 3px;
  letter-spacing: -0.01em;
}
.nav-dropdown-meta {
  font-size: .78rem;
  color: var(--text-muted);
  font-weight: 400;
  font-family: var(--sans);
}

/* Format grid */
.nav-dropdown-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  padding: .65rem;
}
.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .55rem .65rem;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  transition: background 150ms;
  position: relative;
  overflow: hidden;
}
.nav-dropdown-item:hover {
  background: color-mix(in srgb, var(--dd-color, var(--gold)) 10%, var(--surface-2));
  color: var(--text);
}

/* File extension badge - the visual anchor each row was missing */
.nav-dropdown-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-width: 44px;
  height: 32px;
  padding: 0 .5rem;
  background: color-mix(in srgb, var(--dd-color, var(--gold)) 15%, var(--surface-2));
  color: var(--dd-color, var(--gold-deep));
  border: 1px solid color-mix(in srgb, var(--dd-color, var(--gold)) 25%, transparent);
  border-radius: 7px;
  font-family: var(--mono);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .02em;
  transition: all 200ms;
}
[data-theme="dark"] .nav-dropdown-badge {
  background: color-mix(in srgb, var(--dd-color, var(--gold)) 18%, var(--surface-2));
  color: var(--dd-color, var(--gold));
}
.nav-dropdown-item:hover .nav-dropdown-badge {
  background: var(--dd-color, var(--gold));
  color: white;
  border-color: var(--dd-color, var(--gold));
  transform: scale(1.04);
}

.nav-dropdown-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.nav-dropdown-name {
  font-size: .9rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 1px;
}
.nav-dropdown-fullname {
  font-size: .72rem;
  color: var(--text-muted);
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Footer "View all" link - polished */
.nav-dropdown-all {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .95rem 1.4rem;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  font-size: .85rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  transition: all 200ms;
  font-family: var(--sans);
  white-space: nowrap;
}
.nav-dropdown-all > span {
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-dropdown-all:hover {
  background: color-mix(in srgb, var(--dd-color, var(--gold)) 10%, var(--surface-2));
  color: var(--dd-color, var(--gold-deep));
}
[data-theme="dark"] .nav-dropdown-all:hover { color: var(--dd-color, var(--gold)); }
.nav-dropdown-all .icon {
  transition: transform 200ms;
  flex-shrink: 0;
  color: var(--dd-color, var(--gold-deep));
}
[data-theme="dark"] .nav-dropdown-all .icon { color: var(--dd-color, var(--gold)); }
.nav-dropdown-all:hover .icon {
  transform: translateX(4px);
}

/* Hide dropdown on mobile breakpoint */
@media (max-width: 1024px) {
  .nav-dropdown { display: none; }
  .nav-caret { display: none; }
}

/* ============================================================
   ALL FORMATS GRID (homepage)
   ============================================================ */
.all-formats-section {
  padding: 4rem 0;
}
.all-formats-group { margin-bottom: 2.5rem; }
.all-formats-group:last-child { margin-bottom: 0; }

.all-formats-group-header {
  display: flex;
  align-items: center;
  gap: .85rem;
  margin-bottom: 1rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--border);
}
.all-formats-group-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--card-color, #c9a961) 15%, transparent);
  color: var(--card-color, var(--gold));
}
.all-formats-group-title {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 500;
  margin: 0;
  flex: 1;
}
.all-formats-group-all {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  font-family: var(--mono);
  font-size: .8rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 200ms;
}
.all-formats-group-all:hover { color: var(--gold-deep); }
[data-theme="dark"] .all-formats-group-all:hover { color: var(--gold); }

.all-formats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: .75rem;
}
.format-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .25rem;
  padding: 1.25rem .75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  text-align: center;
  transition: all 250ms cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  min-height: 110px;
}
.format-tile::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 50%, color-mix(in srgb, var(--card-color, var(--gold)) 8%, transparent) 100%);
  opacity: 0;
  transition: opacity 250ms;
}
.format-tile:hover {
  border-color: var(--card-color, var(--gold));
  transform: translateY(-3px);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--card-color, var(--gold)) 18%, transparent);
  color: var(--text);
}
.format-tile:hover::before { opacity: 1; }
.format-tile-ext {
  font-family: var(--mono);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--card-color, var(--gold-deep));
  position: relative;
  z-index: 1;
}
[data-theme="dark"] .format-tile-ext { color: var(--card-color, var(--gold)); }
.format-tile-name {
  font-size: .85rem;
  font-weight: 500;
  position: relative;
  z-index: 1;
}
.format-tile-fullname {
  font-size: .7rem;
  color: var(--text-muted);
  position: relative;
  z-index: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* ============================================================
   MODERN TRENDING TILES (replaces old horizontal rail)
   ============================================================ */
.trending-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 2.5rem;
}
.trending-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--text);
  overflow: hidden;
  transition: all 250ms cubic-bezier(0.4, 0, 0.2, 1);
}
.trending-tile:hover {
  border-color: var(--card-color, var(--gold));
  transform: translateY(-3px);
  box-shadow: 0 12px 32px color-mix(in srgb, var(--card-color, var(--gold)) 20%, transparent);
  color: var(--text);
}
.trending-tile-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 120px;
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--card-color, var(--gold)) 18%, var(--surface)) 0%,
    color-mix(in srgb, var(--card-color, var(--gold)) 8%, var(--surface)) 100%);
}
.trending-tile-icon {
  color: var(--card-color, var(--gold));
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.trending-tile-icon .icon { width: 48px; height: 48px; }
.trending-tile-rank {
  position: absolute;
  top: .85rem;
  right: .85rem;
  padding: .25rem .6rem;
  background: var(--ink);
  color: var(--gold);
  font-family: var(--mono);
  font-size: .75rem;
  font-weight: 600;
  border-radius: 999px;
  letter-spacing: .03em;
}

.trending-tile-body {
  padding: 1.25rem 1.25rem .75rem;
  flex: 1;
}
.trending-tile-ext {
  display: inline-block;
  font-family: var(--mono);
  font-size: .7rem;
  font-weight: 600;
  text-transform: lowercase;
  color: var(--card-color, var(--gold-deep));
  background: color-mix(in srgb, var(--card-color, var(--gold)) 12%, transparent);
  padding: .15rem .55rem;
  border-radius: 999px;
  margin-bottom: .5rem;
}
[data-theme="dark"] .trending-tile-ext { color: var(--card-color, var(--gold)); }
.trending-tile-name {
  font-family: var(--mono);
  font-size: .95rem;
  font-weight: 500;
  margin: 0 0 .35rem;
  word-break: break-all;
  color: var(--text);
}
.trending-tile-desc {
  font-size: .85rem;
  color: var(--text-muted);
  margin: 0;
}

.trending-tile-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .85rem 1.25rem;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}
.trending-tile-downloads {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-family: var(--mono);
  font-size: .8rem;
  color: var(--text-muted);
}
.trending-tile-arrow {
  display: inline-flex;
  color: var(--text-muted);
  transition: transform 200ms;
}
.trending-tile:hover .trending-tile-arrow {
  transform: translateX(4px);
  color: var(--card-color, var(--gold-deep));
}

/* ============================================================
   DEEP DIVE TECHNICAL ARTICLE (on format pages)
   ============================================================ */
.deep-dive {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem 2.25rem;
  margin: 2rem 0 3rem;
  position: relative;
}
.deep-dive::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold) 0%, var(--gold-deep) 100%);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.deep-dive-header { margin-bottom: 1.5rem; }
.deep-dive-eyebrow {
  display: inline-block;
  font-family: var(--mono);
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--gold-deep);
  margin-bottom: .65rem;
}
[data-theme="dark"] .deep-dive-eyebrow { color: var(--gold); }
.deep-dive-title {
  font-family: var(--serif);
  font-size: clamp(1.4rem, 2.5vw, 1.85rem);
  font-weight: 500;
  margin: 0;
  line-height: 1.25;
  text-wrap: balance;
}
.deep-dive-intro {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 2rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px dashed var(--border);
}
.deep-dive-intro p { margin: 0; }

.deep-dive-h3 {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: 1.05rem;
  font-weight: 500;
  margin: 1.85rem 0 .85rem;
  color: var(--text);
}
.deep-dive-h3 .icon { color: var(--gold); flex-shrink: 0; }

.deep-dive-list {
  margin: 0 0 1.5rem;
  padding: 0;
  list-style: none;
}
.deep-dive-list li {
  position: relative;
  padding: .35rem 0 .35rem 1.5rem;
  font-size: .95rem;
  line-height: 1.65;
  color: var(--text);
}
.deep-dive-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: .85rem;
  width: 6px;
  height: 6px;
  background: var(--gold);
  border-radius: 999px;
}
.deep-dive-list li strong { color: var(--text); font-weight: 600; }

.deep-dive-warnings li::before {
  background: #d97706;
  border-radius: 2px;
}

.deep-dive p {
  font-size: .95rem;
  line-height: 1.7;
  color: var(--text);
  margin: .25rem 0 1.5rem;
}

.deep-dive-tools {
  background: color-mix(in srgb, var(--gold) 6%, var(--surface-2));
  border: 1px solid color-mix(in srgb, var(--gold) 25%, var(--border));
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  font-size: .9rem;
  line-height: 1.6;
  color: var(--text);
  margin-top: 1rem;
}
.deep-dive-tools strong { color: var(--gold-deep); }
[data-theme="dark"] .deep-dive-tools strong { color: var(--gold); }

@media (max-width: 700px) {
  .deep-dive { padding: 1.5rem 1.25rem; }
  .all-formats-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: .5rem; }
  .format-tile { padding: 1rem .5rem; min-height: 95px; }
}