/* ==========================================================================
   AI Tools Hub - Modern Responsive SEO Stylesheet
   Follows Universal Frontend Design Constitution (Zero-pill, dual theme, WCAG AA)
   ========================================================================== */

:root {
  --bg-canvas: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-hover: #e2e8f0;
  --border-hairline: rgba(15, 23, 42, 0.08);
  --border-strong: rgba(15, 23, 42, 0.16);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-subtle: #eff6ff;
  --accent-text: #1d4ed8;
  --success: #16a34a;
  --success-subtle: #f0fdf4;
  --warning: #d97706;
  --warning-subtle: #fffbeb;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

html.dark {
  --bg-canvas: #090d16;
  --bg-surface: #0f172a;
  --bg-surface-elevated: #1e293b;
  --bg-subtle: #1e293b;
  --bg-hover: #334155;
  --border-hairline: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --accent-subtle: rgba(59, 130, 246, 0.15);
  --accent-text: #93c5fd;
  --success: #22c55e;
  --success-subtle: rgba(34, 197, 94, 0.15);
  --warning: #f59e0b;
  --warning-subtle: rgba(245, 158, 11, 0.15);
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-sans);
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-canvas);
  color: var(--text-primary);
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}

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

/* ==========================================================================
   Typography & Layout Helpers
   ========================================================================== */
.container {
  width: 100%;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.text-balance {
  text-wrap: balance;
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
}

.section-padding {
  padding-top: 4rem;
  padding-bottom: 4rem;
}

@media (max-width: 768px) {
  .section-padding {
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
  }
}

/* ==========================================================================
   Header & Top Navigation (Strict 3-Zone Contract)
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-hairline);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  height: 4.25rem;
}

/* Zone 1: Single Wordmark */
.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  white-space: nowrap;
  flex-shrink: 0;
}

.brand-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 800;
  font-size: 1rem;
}

/* Zone 2: Navigation Links */
.main-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.nav-link {
  white-space: nowrap;
  flex-shrink: 0;
  padding: 0.375rem 0;
  position: relative;
  transition: color 0.15s ease;
}

.nav-link:hover, .nav-link.active {
  color: var(--accent);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
}

/* Zone 3: Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  flex-shrink: 0;
}

.search-trigger-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.875rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
  border-radius: 0.5rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.search-trigger-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.kbd-shortcut {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.125rem 0.375rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: 0.25rem;
  color: var(--text-muted);
}

.theme-toggle-btn {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.5rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.theme-toggle-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
}

@media (max-width: 1024px) {
  .main-nav {
    display: none;
  }
  .mobile-menu-toggle {
    display: block;
  }
  .search-trigger-btn span.label {
    display: none;
  }
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero-section {
  padding-top: 4.5rem;
  padding-bottom: 4.5rem;
  text-align: center;
  position: relative;
  background: linear-gradient(180deg, var(--bg-surface) 0%, var(--bg-canvas) 100%);
  border-bottom: 1px solid var(--border-hairline);
}

.hero-badge-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
}

.hero-title {
  font-size: clamp(2.25rem, 4.5vw, 3.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
}

.hero-title .gradient-text {
  background: linear-gradient(135deg, #2563eb, #9333ea);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--text-secondary);
  max-width: 44rem;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
  margin-bottom: 2.25rem;
}

.hero-search-container {
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
  position: relative;
}

.hero-search-box {
  display: flex;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 0.75rem;
  padding: 0.5rem 0.625rem 0.5rem 1.125rem;
  box-shadow: var(--shadow-md);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.hero-search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

.hero-search-box svg {
  color: var(--text-muted);
  flex-shrink: 0;
  margin-right: 0.75rem;
}

.hero-search-input {
  width: 100%;
  border: none;
  background: transparent;
  font-size: 1rem;
  color: var(--text-primary);
  outline: none;
}

.hero-search-input::placeholder {
  color: var(--text-muted);
}

.hero-search-btn {
  background: var(--accent);
  color: #ffffff;
  border: none;
  border-radius: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s ease;
}

.hero-search-btn:hover {
  background: var(--accent-hover);
}

.hero-hot-tags {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.625rem;
  margin-top: 1.25rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.hot-tag-link {
  color: var(--text-secondary);
  transition: color 0.15s ease;
}

.hot-tag-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* ==========================================================================
   Section Headers (Editorial Title Case)
   ========================================================================== */
.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 2rem;
  gap: 1.5rem;
}

.section-header-content {
  max-width: 48rem;
}

.section-kicker {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin-bottom: 0.375rem;
}

.section-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.25;
}

.section-desc {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

.section-more-link {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.section-more-link:hover {
  text-decoration: underline;
}

/* ==========================================================================
   Grid & Card Layouts
   ========================================================================== */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

@media (min-width: 1280px) {
  .tools-grid.cols-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

.tool-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: 0.75rem;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  position: relative;
}

.tool-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.tool-card-header {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  margin-bottom: 0.875rem;
}

.tool-avatar {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.5rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--text-primary);
  flex-shrink: 0;
  overflow: hidden;
}

.tool-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tool-info {
  flex: 1;
  min-width: 0;
}

.tool-name-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tool-title {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tool-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 1rem;
  flex: 1;
}

/* Zero-Pill Metadata (Clean typography with separators) */
.tool-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.375rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-hairline);
}

.meta-separator {
  color: var(--text-muted);
  opacity: 0.5;
}

.meta-pricing {
  font-weight: 600;
}

.meta-pricing.free {
  color: var(--success);
}

.meta-pricing.freemium {
  color: var(--accent);
}

.meta-pricing.paid {
  color: var(--warning);
}

.tool-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.875rem;
  gap: 0.75rem;
}

.btn-detail {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.btn-detail:hover {
  color: var(--accent);
}

.btn-visit {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.btn-visit:hover {
  text-decoration: underline;
}

/* ==========================================================================
   Category Bento Grid
   ========================================================================== */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.category-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: 0.75rem;
  padding: 1.125rem;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
}

.category-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.category-card-top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.category-icon-box {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.5rem;
  background: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.category-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
}

.category-desc {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ==========================================================================
   Interactive Filter Controls (Segmented Tabs)
   ========================================================================== */
.filter-tabs-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
  scrollbar-width: thin;
}

.filter-tab-btn {
  padding: 0.4375rem 0.875rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.filter-tab-btn:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}

.filter-tab-btn.active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

/* ==========================================================================
   Breadcrumb Navigation
   ========================================================================== */
.breadcrumb-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.breadcrumb-nav a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.breadcrumb-sep {
  opacity: 0.5;
}

.breadcrumb-current {
  color: var(--text-primary);
  font-weight: 500;
}

/* ==========================================================================
   Tool Detail Page Styling
   ========================================================================== */
.tool-detail-header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-hairline);
  padding-top: 2.5rem;
  padding-bottom: 2.5rem;
}

.tool-header-grid {
  display: flex;
  align-items: flex-start;
  gap: 1.75rem;
}

.tool-detail-avatar {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 0.75rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 800;
  flex-shrink: 0;
  overflow: hidden;
}

.tool-header-main {
  flex: 1;
}

.tool-detail-h1 {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.tool-tagline {
  font-size: 1.125rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1rem;
}

.tool-quick-specs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.tool-quick-specs span strong {
  color: var(--text-primary);
}

.tool-header-cta {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex-shrink: 0;
}

.btn-primary-visit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--accent);
  color: #ffffff;
  font-size: 0.9375rem;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  transition: background 0.15s ease;
  white-space: nowrap;
}

.btn-primary-visit:hover {
  background: var(--accent-hover);
}

.detail-layout-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 2rem;
  margin-top: 2rem;
}

@media (max-width: 992px) {
  .detail-layout-grid {
    grid-template-columns: 1fr;
  }
  .tool-header-grid {
    flex-direction: column;
  }
  .tool-header-cta {
    width: 100%;
  }
}

.content-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: 0.75rem;
  padding: 1.75rem;
  margin-bottom: 1.75rem;
}

.content-box-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.125rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-hairline);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.feature-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.feature-item svg {
  color: var(--success);
  flex-shrink: 0;
  margin-top: 0.2rem;
}

.pros-cons-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 640px) {
  .pros-cons-grid {
    grid-template-columns: 1fr;
  }
}

.pro-item, .con-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.5;
  margin-bottom: 0.625rem;
}

.pro-item svg {
  color: var(--success);
  flex-shrink: 0;
  margin-top: 0.2rem;
}

.con-item svg {
  color: var(--warning);
  flex-shrink: 0;
  margin-top: 0.2rem;
}

.meta-spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.meta-spec-table tr {
  border-bottom: 1px solid var(--border-hairline);
}

.meta-spec-table tr:last-child {
  border-bottom: none;
}

.meta-spec-table th {
  text-align: left;
  padding: 0.75rem 0.5rem 0.75rem 0;
  color: var(--text-muted);
  font-weight: 500;
  width: 35%;
}

.meta-spec-table td {
  padding: 0.75rem 0;
  color: var(--text-primary);
  font-weight: 500;
}

/* ==========================================================================
   Comparison Table Styles
   ========================================================================== */
.comparison-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-hairline);
  border-radius: 0.75rem;
  background: var(--bg-surface);
  margin-top: 1.5rem;
  margin-bottom: 2rem;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9375rem;
}

.comparison-table th, .comparison-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-hairline);
  vertical-align: top;
}

.comparison-table th {
  background: var(--bg-subtle);
  font-weight: 700;
  color: var(--text-primary);
}

.comparison-table tr:hover td {
  background: var(--bg-subtle);
}

/* ==========================================================================
   Tutorial Step List
   ========================================================================== */
.tutorial-steps {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.tutorial-step-card {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: 0.75rem;
  padding: 1.5rem;
}

.step-number {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--accent-subtle);
  color: var(--accent);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1rem;
}

.step-content h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.step-content p {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.6;
}

/* ==========================================================================
   Prompt Cards & Code Blocks
   ========================================================================== */
.prompt-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.prompt-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  gap: 1rem;
}

.prompt-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.prompt-code-block {
  background: var(--bg-canvas);
  border: 1px solid var(--border-hairline);
  border-radius: 0.5rem;
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-primary);
  margin-bottom: 0.875rem;
  position: relative;
  word-break: break-word;
  white-space: pre-wrap;
}

.copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: 0.375rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.copy-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* ==========================================================================
   Global Search Modal
   ========================================================================== */
.search-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10vh;
  padding-left: 1rem;
  padding-right: 1rem;
}

.search-modal-backdrop.open {
  display: flex;
}

.search-modal-dialog {
  width: 100%;
  max-width: 600px;
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: 0.75rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  animation: modalSlide 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlide {
  from { opacity: 0; transform: scale(0.96) translateY(-8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.search-modal-input-wrap {
  display: flex;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-hairline);
  gap: 0.75rem;
}

.search-modal-input {
  width: 100%;
  border: none;
  background: transparent;
  font-size: 1.125rem;
  color: var(--text-primary);
  outline: none;
}

.search-results-list {
  max-height: 400px;
  overflow-y: auto;
  padding: 0.5rem;
  list-style: none;
}

.search-result-item a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  color: var(--text-primary);
  transition: background 0.1s ease;
}

.search-result-item a:hover {
  background: var(--bg-subtle);
}

.search-result-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  margin-top: auto;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-hairline);
  padding-top: 3.5rem;
  padding-bottom: 2.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 3rem;
}

@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

.footer-brand p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-top: 0.75rem;
  max-width: 20rem;
}

.footer-col-title {
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid var(--border-hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.footer-bottom-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.footer-bottom-links a:hover {
  color: var(--text-primary);
}
