/* ==========================================================================
   PenPaperPixel.org - "Obsidian Arcana" Design System
   Modern Dark-Mode First Tabletop RPG UI & Editorial Typography
   ========================================================================== */

:root {
  --bg-obsidian: #090D16;
  --bg-slate: #0F172A;
  --bg-surface: #1E293B;
  --bg-surface-elevated: #283548;
  --border-subtle: #334155;
  --border-focus: #F59E0B;
  
  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --text-dim: #64748B;
  
  --accent-gold: #F59E0B;
  --accent-gold-glow: rgba(245, 158, 11, 0.25);
  --accent-amber: #D97706;
  --accent-crimson: #EF4444;
  --accent-crimson-glow: rgba(239, 68, 68, 0.25);
  --accent-emerald: #10B981;
  --accent-blue: #3B82F6;
  --accent-violet: #8B5CF6;
  
  --font-heading: 'Cinzel', -apple-system, BlinkMacSystemFont, 'Segoe UI', Georgia, serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Menlo, Monaco, Consolas, monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 12px 28px rgba(0,0,0,0.6);
  --shadow-gold: 0 0 20px rgba(245, 158, 11, 0.35);
  --shadow-crimson: 0 0 20px rgba(239, 68, 68, 0.4);
}

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

html {
  font-family: var(--font-sans);
  background-color: var(--bg-obsidian);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at 50% 0%, #172033 0%, #090D16 75%);
}

a {
  color: var(--accent-gold);
  text-decoration: none;
  transition: color 0.15s ease, text-decoration 0.15s ease;
}

a:hover {
  color: #FBBF24;
  text-decoration: underline;
}

/* Container */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Header & Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.875rem 0;
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--text-main);
  text-decoration: none;
}

.brand-link:hover {
  text-decoration: none;
  color: var(--accent-gold);
}

.brand-logo {
  width: 34px;
  height: 34px;
  filter: drop-shadow(0 2px 6px rgba(245, 158, 11, 0.4));
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  list-style: none;
}

.nav-link {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.375rem 0.625rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.nav-link:hover, .nav-link.active {
  color: var(--accent-gold);
  background: rgba(245, 158, 11, 0.1);
  text-decoration: none;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-icon {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-icon:hover {
  color: var(--accent-gold);
  border-color: var(--accent-gold);
}

/* Hero Section */
.hero-section {
  padding: 3.5rem 0 2.5rem;
  text-align: center;
}

.badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.075em;
  padding: 0.35rem 0.875rem;
  border-radius: var(--radius-full);
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--accent-gold);
  margin-bottom: 1.25rem;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #FFFFFF 0%, #E2E8F0 60%, #CBD5E1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.1875rem;
  color: var(--text-muted);
  max-width: 760px;
  margin: 0 auto 2rem;
  line-height: 1.6;
}

/* Tool Interface Panels */
.tool-container {
  background: var(--bg-slate);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  margin-bottom: 3.5rem;
  position: relative;
}

/* Editorial & Article Typography */
.editorial-section {
  padding-bottom: 4rem;
}

.editorial-content {
  font-size: 1.0625rem;
  line-height: 1.75;
  color: #E2E8F0;
}

.editorial-content h2 {
  font-family: var(--font-heading);
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 2.75rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.editorial-content h3 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent-gold);
  margin: 2rem 0 0.75rem;
}

.editorial-content p {
  margin-bottom: 1.35rem;
}

.editorial-content ul, .editorial-content ol {
  margin: 1rem 0 1.5rem 1.75rem;
}

.editorial-content li {
  margin-bottom: 0.5rem;
}

.editorial-content blockquote {
  background: rgba(30, 41, 59, 0.7);
  border-left: 4px solid var(--accent-gold);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-style: italic;
  color: #CBD5E1;
}

/* Callout Box / Alert */
.callout {
  padding: 1.25rem;
  margin: 1.75rem 0;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  display: flex;
  gap: 1rem;
}

.callout-info {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.3);
}

.callout-warning {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.3);
}

.callout-success {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
}

.callout-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

/* Data Tables */
.data-table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 1.75rem 0;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-slate);
}

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

.data-table th {
  background: var(--bg-surface);
  color: var(--accent-gold);
  font-weight: 700;
  padding: 0.875rem 1rem;
  border-bottom: 2px solid var(--border-subtle);
  white-space: nowrap;
}

.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  color: #CBD5E1;
}

.data-table tr:hover td {
  background: rgba(245, 158, 11, 0.05);
}

/* Cluster / Pillar Interlinking Cards */
.pillar-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin: 2rem 0;
}

.pillar-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.pillar-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-gold);
  box-shadow: var(--shadow-gold);
  text-decoration: none;
}

.pillar-card-title {
  font-family: var(--font-heading);
  font-size: 1.1875rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pillar-card:hover .pillar-card-title {
  color: var(--accent-gold);
}

.pillar-card-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1rem;
}

.pillar-card-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-amber);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* FAQ Accordion */
.faq-section {
  margin: 3rem 0;
}

.faq-item {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 0.875rem;
  background: var(--bg-slate);
  overflow: hidden;
}

.faq-trigger {
  width: 100%;
  text-align: left;
  padding: 1.125rem 1.25rem;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 1.0625rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  transition: color 0.15s ease;
}

.faq-trigger:hover {
  color: var(--accent-gold);
}

.faq-content {
  padding: 0 1.25rem 1.25rem;
  color: #CBD5E1;
  font-size: 0.9375rem;
  line-height: 1.6;
}

/* Ad Placement Slots (Non-Intrusive, Zero-CLS Pre-Sized) */
.ad-slot-container {
  min-height: 100px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.4);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  margin: 2.5rem 0;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Footer */
.site-footer {
  margin-top: auto;
  background: #060911;
  border-top: 1px solid var(--border-subtle);
  padding: 3.5rem 0 2rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

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

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

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: var(--text-muted);
}

.footer-links a:hover {
  color: var(--accent-gold);
  text-decoration: none;
}

.footer-bottom {
  padding-top: 1.5rem;
  border-top: 1px solid rgba(51, 65, 85, 0.5);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8125rem;
  color: var(--text-dim);
}

/* Responsive Media Queries */
@media (max-width: 900px) {
  .hero-title {
    font-size: 2rem;
  }
  .tool-container {
    padding: 1.25rem;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1.75rem;
  }
}

@media (max-width: 640px) {
  .nav-links {
    display: none;
  }
  .hero-title {
    font-size: 1.625rem;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
  }
}
