/* Legend Tools - Production Design System & Global Stylesheet
   Brand: Legend Tools (legendtools.online)
   Theme: Default Dark Mode with Light Theme Toggle, Violet/Cyan/Gold Accents
   Performance: Zero External Fonts, Pure CSS3, Glassmorphism, Zero-CLS Ad Slots
*/

:root {
  /* Dark Theme Colors (Default) */
  --bg-primary: #080c14;
  --bg-surface: #0f172a;
  --bg-card: #141e33;
  --bg-card-hover: #1a2742;
  --bg-elevated: #1e293b;
  --bg-input: #0b1120;

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: #8b5cf6;
  --border-accent: rgba(139, 92, 246, 0.3);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-inverse: #080c14;

  /* Accent Colors */
  --accent-violet: #8b5cf6;
  --accent-violet-light: #a78bfa;
  --accent-cyan: #06b6d4;
  --accent-cyan-light: #22d3ee;
  --accent-gold: #f59e0b;
  --accent-emerald: #10b981;
  --accent-rose: #f43f5e;

  /* Gradients */
  --grad-primary: linear-gradient(135deg, #8b5cf6 0%, #06b6d4 100%);
  --grad-surface: linear-gradient(180deg, rgba(20, 30, 51, 0.7) 0%, rgba(15, 23, 42, 0.7) 100%);
  --grad-gold: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  --grad-glow: radial-gradient(circle at 50% 0%, rgba(139, 92, 246, 0.15), transparent 70%);

  /* Layout & Spacing */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;
  --container-max: 1200px;
  --header-height: 72px;

  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 25px rgba(139, 92, 246, 0.25);

  /* Typography Stack */
  --font-system: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-elevated: #f1f5f9;
  --bg-input: #ffffff;

  --border-subtle: #e2e8f0;
  --border-focus: #7c3aed;
  --border-accent: rgba(124, 58, 237, 0.3);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-inverse: #ffffff;

  --accent-violet: #7c3aed;
  --accent-violet-light: #6d28d9;
  --accent-cyan: #0891b2;
  --accent-cyan-light: #0e7490;
  --accent-gold: #d97706;

  --grad-primary: linear-gradient(135deg, #7c3aed 0%, #0891b2 100%);
  --grad-surface: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  --grad-glow: radial-gradient(circle at 50% 0%, rgba(124, 58, 237, 0.08), transparent 70%);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.08);
  --shadow-glow: 0 0 20px rgba(124, 58, 237, 0.15);
}

/* ==========================================================================
   RESET & BASE TYPOGRAPHY
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-system);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-image: var(--grad-glow);
  background-attachment: fixed;
}

img, svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--accent-cyan);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-violet-light);
  text-decoration: underline;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

/* Accessibility Skip Link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  background: var(--accent-violet);
  color: #ffffff !important;
  padding: 0.75rem 1.5rem;
  z-index: 99999;
  border-radius: var(--radius-sm);
  font-weight: 700;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 1rem;
}

/* Container */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

/* ==========================================================================
   HEADER & NAVIGATION
   ========================================================================== */
.top-announcement-strip {
  background: linear-gradient(90deg, #1e1b4b 0%, #0f172a 100%);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.4rem 0;
  font-size: 0.82rem;
  color: var(--text-secondary);
  text-align: center;
}

[data-theme="light"] .top-announcement-strip {
  background: #f1f5f9;
  color: #334155;
}

.site-header {
  position: sticky;
  top: 0;
  height: var(--header-height);
  background: rgba(8, 12, 20, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 1000;
  display: flex;
  align-items: center;
  transition: background-color var(--transition-normal);
}

[data-theme="light"] .site-header {
  background: rgba(255, 255, 255, 0.88);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none !important;
}

.brand-name {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.brand-accent {
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.main-nav {
  display: none;
}

@media (min-width: 900px) {
  .main-nav {
    display: block;
  }
}

.nav-list {
  display: flex;
  list-style: none;
  align-items: center;
  gap: 1.75rem;
}

.nav-link {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.5rem 0.25rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: color var(--transition-fast);
}

.nav-link:hover, .nav-link.active {
  color: var(--text-primary);
  text-decoration: none;
}

.nav-link.active {
  color: var(--accent-cyan);
  font-weight: 600;
}

/* Dropdown Menu */
.has-dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 260px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 0.5rem 0;
  list-style: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all var(--transition-normal);
  z-index: 1050;
}

.has-dropdown:hover .dropdown-menu,
.has-dropdown:focus-within .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-link {
  display: block;
  padding: 0.6rem 1.25rem;
  color: var(--text-secondary);
  font-size: 0.88rem;
  transition: all var(--transition-fast);
}

.dropdown-link:hover {
  color: var(--text-primary);
  background: var(--bg-card);
  text-decoration: none;
  padding-left: 1.4rem;
}

.dropdown-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 0.4rem 0;
}

.view-all-link {
  color: var(--accent-cyan) !important;
  font-weight: 600;
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.theme-toggle {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.theme-toggle:hover {
  border-color: var(--border-focus);
  box-shadow: var(--shadow-sm);
}

.sun-icon { display: none; }
.moon-icon { display: block; }

[data-theme="light"] .sun-icon { display: block; }
[data-theme="light"] .moon-icon { display: none; }

.mobile-menu-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

@media (min-width: 900px) {
  .mobile-menu-btn { display: none; }
}

.hamburger-bar {
  width: 20px;
  height: 2px;
  background-color: var(--text-primary);
  transition: all var(--transition-fast);
}

/* Mobile Drawer */
.mobile-drawer {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.mobile-drawer.open {
  opacity: 1;
  visibility: visible;
}

.mobile-drawer-inner {
  position: absolute;
  top: 0;
  right: 0;
  width: 85%;
  max-width: 380px;
  height: 100%;
  background: var(--bg-surface);
  padding: 1.5rem;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform var(--transition-normal);
}

.mobile-drawer.open .mobile-drawer-inner {
  transform: translateX(0);
}

.mobile-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.mobile-drawer-close {
  background: none;
  border: none;
  font-size: 2rem;
  line-height: 1;
  color: var(--text-secondary);
  cursor: pointer;
}

.mobile-nav-list {
  list-style: none;
}

.mobile-nav-link {
  display: block;
  padding: 0.7rem 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
}

.mobile-group-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-top: 1.25rem;
  margin-bottom: 0.35rem;
}

.mobile-nav-sub {
  display: block;
  padding: 0.45rem 0.5rem;
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.accent-sub {
  color: var(--accent-cyan);
  font-weight: 600;
}

/* ==========================================================================
   BUTTONS & FORM CONTROLS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.4rem;
  min-height: 44px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none !important;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
}

.btn-primary {
  background: var(--grad-primary);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(139, 92, 246, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5);
  color: #ffffff;
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-accent);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
}

.btn-outline:hover {
  background: rgba(6, 182, 212, 0.1);
  color: var(--accent-cyan-light);
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  min-height: 36px;
  font-size: 0.85rem;
}

/* Form Inputs */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.45rem;
  color: var(--text-primary);
}

.form-help {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: normal;
}

.form-input, .form-select {
  width: 100%;
  padding: 0.7rem 0.95rem;
  min-height: 44px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.input-with-symbol {
  position: relative;
  display: flex;
  align-items: center;
}

.input-symbol {
  position: absolute;
  left: 0.95rem;
  color: var(--text-muted);
  font-weight: 600;
  pointer-events: none;
}

.input-with-symbol .form-input {
  padding-left: 2rem;
}

.input-suffix {
  position: absolute;
  right: 0.95rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  pointer-events: none;
}

.input-with-suffix .form-input {
  padding-right: 2.2rem;
}

/* Range Sliders */
.form-range {
  width: 100%;
  height: 6px;
  background: var(--bg-card);
  border-radius: var(--radius-full);
  outline: none;
  -webkit-appearance: none;
  margin: 0.6rem 0;
}

.form-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-cyan);
  cursor: pointer;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* ==========================================================================
   CARDS & GRIDS
   ========================================================================== */
.card {
  background: var(--grad-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  position: relative;
  transition: transform var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--border-accent);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.card-desc {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

/* ==========================================================================
   HERO & 3D VISUAL SECTION
   ========================================================================== */
.hero-section {
  position: relative;
  padding: 4rem 0 3.5rem;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  align-items: center;
}

@media (min-width: 992px) {
  .hero-grid {
    grid-template-columns: 1.15fr 0.85fr;
  }
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-full);
  color: var(--accent-violet-light);
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.hero-title {
  font-size: 2.5rem;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
}

@media (min-width: 768px) {
  .hero-title { font-size: 3.25rem; }
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 2rem;
  max-width: 600px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}

/* 3D Canvas & CSS 3D Fallback */
.hero-visual-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-width: 440px;
  margin: 0 auto;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: radial-gradient(circle at center, rgba(139, 92, 246, 0.15) 0%, rgba(6, 182, 212, 0.05) 50%, transparent 75%);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
}

#hero-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* CSS 3D Fallback when Three.js is not loaded or prefers-reduced-motion */
.css-3d-scene {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 800px;
}

.css-cube {
  width: 120px;
  height: 120px;
  position: relative;
  transform-style: preserve-3d;
  animation: rotateCube 14s infinite linear;
}

.cube-face {
  position: absolute;
  width: 120px;
  height: 120px;
  border: 1px solid var(--accent-cyan);
  background: rgba(139, 92, 246, 0.1);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: var(--accent-cyan);
  font-size: 1.5rem;
}

.face-front  { transform: translateZ(60px); }
.face-back   { transform: rotateY(180deg) translateZ(60px); }
.face-right  { transform: rotateY(90deg) translateZ(60px); }
.face-left   { transform: rotateY(-90deg) translateZ(60px); }
.face-top    { transform: rotateX(90deg) translateZ(60px); }
.face-bottom { transform: rotateX(-90deg) translateZ(60px); }

@keyframes rotateCube {
  0% { transform: rotateX(0deg) rotateY(0deg); }
  100% { transform: rotateX(360deg) rotateY(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .css-cube { animation: none; transform: rotateX(25deg) rotateY(35deg); }
}

/* Stats Strip */
.stats-strip {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  padding: 1.75rem 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  text-align: center;
}

@media (min-width: 768px) {
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
}

.stat-number {
  font-size: 2.2rem;
  font-weight: 800;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
  margin-bottom: 0.35rem;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ==========================================================================
   CALCULATOR UI & TOOL WORKSPACE
   ========================================================================== */
.tool-workspace {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-lg);
  margin-bottom: 2.5rem;
}

.tool-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 992px) {
  .tool-grid {
    grid-template-columns: 1.1fr 0.9fr;
  }
}

.tool-inputs-pane {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.5rem;
}

.tool-results-pane {
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.currency-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}

.currency-selector-pills {
  display: flex;
  gap: 0.35rem;
}

.currency-pill {
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.currency-pill.active {
  background: var(--accent-violet);
  color: #ffffff;
  border-color: var(--accent-violet);
}

.result-metric-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  text-align: center;
}

.result-metric-highlight {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--accent-cyan);
  line-height: 1.1;
  margin-top: 0.35rem;
  font-family: var(--font-mono);
}

.result-breakdown-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: 0.9rem;
}

.result-breakdown-table th, .result-breakdown-table td {
  padding: 0.65rem 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.result-breakdown-table td:last-child {
  text-align: right;
  font-family: var(--font-mono);
  font-weight: 600;
}

.chart-wrapper {
  margin: 1rem 0;
  text-align: center;
  min-height: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.tool-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.verified-rate-notice {
  font-size: 0.82rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.verified-rate-notice a {
  color: var(--accent-violet-light);
  text-decoration: underline;
}

/* ==========================================================================
   BLOG POST & EDITORIAL STYLES
   ========================================================================== */
.reading-progress-bar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  height: 3px;
  width: 0%;
  background: var(--grad-primary);
  z-index: 1001;
  transition: width 0.1s ease;
}

.article-header {
  padding: 2.5rem 0 1.5rem;
  text-align: left;
}

.article-title {
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.2;
  margin: 0.75rem 0 1rem;
}

@media (min-width: 768px) {
  .article-title { font-size: 2.85rem; }
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.toc-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--accent-violet);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
}

.toc-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.toc-list {
  list-style: none;
  padding-left: 0;
}

.toc-list li {
  margin-bottom: 0.4rem;
}

.toc-list a {
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.toc-list a:hover {
  color: var(--accent-cyan);
}

.article-body {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-secondary);
}

.article-body h2 {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border-subtle);
}

.article-body h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 1.75rem 0 0.75rem;
}

.article-body p {
  margin-bottom: 1.35rem;
}

.article-body ul, .article-body ol {
  margin: 1rem 0 1.5rem 1.75rem;
}

.article-body li {
  margin-bottom: 0.5rem;
}

.article-body strong {
  color: var(--text-primary);
}

.callout-box {
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin: 1.75rem 0;
}

.callout-box-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent-cyan);
  margin-bottom: 0.4rem;
}

.article-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.75rem 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.article-table th {
  background: var(--bg-card);
  padding: 0.85rem 1rem;
  text-align: left;
  font-weight: 700;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-subtle);
}

.article-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.author-box {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin: 3rem 0 2rem;
}

.author-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--grad-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #ffffff;
  font-size: 1.5rem;
  flex-shrink: 0;
}

/* ==========================================================================
   FAQ ACCORDION
   ========================================================================== */
.faq-section {
  margin: 3rem 0;
}

.faq-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.faq-question {
  width: 100%;
  padding: 1.15rem 1.25rem;
  background: none;
  border: none;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
  cursor: pointer;
}

.faq-icon {
  transition: transform var(--transition-fast);
  color: var(--accent-violet);
  flex-shrink: 0;
}

.faq-item.open .faq-icon {
  transform: rotate(180deg);
}

.faq-answer {
  padding: 0 1.25rem 1.15rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  display: none;
}

.faq-item.open .faq-answer {
  display: block;
}

/* ==========================================================================
   BREADCRUMBS
   ========================================================================== */
.breadcrumb-nav {
  padding: 1rem 0 0.5rem;
  font-size: 0.85rem;
}

.breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  list-style: none;
  gap: 0.5rem;
  color: var(--text-muted);
}

.breadcrumb-list li + li::before {
  content: "/";
  margin-right: 0.5rem;
  color: var(--text-muted);
}

.breadcrumb-list a {
  color: var(--text-secondary);
}

.breadcrumb-list a:hover {
  color: var(--accent-cyan);
}

/* ==========================================================================
   ZERO CLS AD SLOTS
   ========================================================================== */
.ad-slot-wrapper {
  margin: 2.25rem 0;
  text-align: center;
}

.ad-slot-label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.ad-slot {
  min-height: 100px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

[data-theme="light"] .ad-slot {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.1);
}

.ad-slot-in-content .ad-slot {
  min-height: 250px;
}

.ad-placeholder-text {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
  margin-top: auto;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  padding: 4rem 0 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  margin-bottom: 3rem;
}

@media (min-width: 600px) {
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; }
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.footer-brand-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
}

.footer-tagline {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.footer-email {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.footer-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--accent-emerald);
  font-weight: 600;
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-emerald);
}

.footer-heading {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.65rem;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.footer-links a:hover {
  color: var(--text-primary);
}

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
}

.footer-legal-notice {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

.footer-copy-row {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

@media (min-width: 600px) {
  .footer-copy-row {
    flex-direction: row;
  }
}

.back-to-top {
  background: none;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.82rem;
  transition: all var(--transition-fast);
}

.back-to-top:hover {
  color: var(--text-primary);
  border-color: var(--border-focus);
}

/* ==========================================================================
   COOKIE CONSENT BANNER
   ========================================================================== */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-focus);
  padding: 1.25rem 0;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
  z-index: 9999;
}

.cookie-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}

@media (min-width: 768px) {
  .cookie-content {
    flex-direction: row;
  }
}

.cookie-text {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.cookie-actions {
  display: flex;
  gap: 0.75rem;
  flex-shrink: 0;
}
