/* =============================================================
   codingthecosmos.com — Design System
   Author: Malcolm Macleod
   Rebuilt 2026 — modern, SEO-friendly static site
   ============================================================= */

/* === Google Fonts === */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Space+Grotesk:wght@400;500;600;700&display=swap');

/* === CSS Custom Properties === */
:root {
  /* Colors */
  --bg:           #0a0e1a;
  --bg-card:      rgba(255,255,255,0.04);
  --bg-card-hover:rgba(255,255,255,0.08);
  --border:       rgba(255,255,255,0.10);
  --border-hover: rgba(59,130,246,0.5);
  --text:         #e2e8f0;
  --text-muted:   #94a3b8;
  --text-faint:   #64748b;
  --accent-blue:  #3b82f6;
  --accent-gold:  #f59e0b;
  --accent-glow:  rgba(59,130,246,0.15);
  --link:         #60a5fa;
  --link-hover:   #93c5fd;

  /* Typography */
  --font-body:    'Inter', system-ui, sans-serif;
  --font-heading: 'Space Grotesk', system-ui, sans-serif;
  --base-size:    1rem;
  --scale:        1.25;

  /* Spacing */
  --space-xs:  0.25rem;
  --space-sm:  0.5rem;
  --space-md:  1rem;
  --space-lg:  1.5rem;
  --space-xl:  2.5rem;
  --space-2xl: 4rem;

  /* Layout */
  --container: 1100px;
  --radius:    0.75rem;
  --radius-sm: 0.375rem;
}

/* === Reset === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* === Base === */
html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--base-size);
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(59,130,246,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 30% at 80% 120%, rgba(245,158,11,0.06) 0%, transparent 50%);
  min-height: 100vh;
}

/* === Typography === */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: #f1f5f9;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.4rem); }
h4 { font-size: 1rem; font-weight: 600; }

p { margin-bottom: var(--space-md); color: var(--text); }
p:last-child { margin-bottom: 0; }

a {
  color: var(--link);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover { color: var(--link-hover); text-decoration: underline; }

strong { color: #f1f5f9; font-weight: 600; }
em { color: var(--accent-gold); font-style: normal; }

abbr[title] { text-decoration: underline dotted; cursor: help; }

/* Math-style inline code */
code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.85em;
  color: var(--accent-gold);
  background: rgba(245,158,11,0.08);
  padding: 0.1em 0.3em;
  border-radius: var(--radius-sm);
}

/* === Layout === */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.section {
  padding: var(--space-2xl) 0;
}

/* === Header / Navigation === */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10,14,26,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.875rem;
  padding-bottom: 0.875rem;
  gap: var(--space-md);
}

.site-logo {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: #f1f5f9;
  white-space: nowrap;
  flex-shrink: 0;
}
.site-logo .logo-accent { color: var(--accent-blue); }
.site-logo:hover { text-decoration: none; color: #fff; }

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  flex-wrap: wrap;
}

.site-nav a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s;
  white-space: nowrap;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: #f1f5f9;
  text-decoration: none;
}
.site-nav a[aria-current="page"] {
  color: var(--accent-blue);
}

/* Mobile hamburger (CSS-only toggle) */
.nav-toggle { display: none; }
.nav-label {
  display: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1.5rem;
  line-height: 1;
  padding: 0.25rem;
}

@media (max-width: 640px) {
  .nav-label { display: block; }
  .site-nav {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(10,14,26,0.97);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: var(--space-xl);
    font-size: 1.25rem;
    z-index: 50;
  }
  .nav-toggle:checked ~ .site-nav { display: flex; }
  .nav-toggle:checked ~ .site-nav::before {
    content: '✕';
    position: fixed;
    top: 1rem;
    right: 1.5rem;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
  }
}

/* === Hero === */
.hero {
  padding: var(--space-2xl) 0 var(--space-xl);
  text-align: center;
}

.hero-eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-blue);
  margin-bottom: var(--space-md);
  padding: 0.3em 0.9em;
  border: 1px solid rgba(59,130,246,0.3);
  border-radius: 2rem;
  background: rgba(59,130,246,0.06);
}

.hero h1 {
  margin-bottom: var(--space-lg);
}

.hero h1 .gradient-text {
  background: linear-gradient(135deg, #60a5fa 0%, #a78bfa 50%, #f59e0b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-muted);
  max-width: 700px;
  margin: 0 auto var(--space-xl);
  line-height: 1.7;
}

.hero-cta {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.65em 1.5em;
  border-radius: 0.5rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  border: none;
}

.btn-primary {
  background: var(--accent-blue);
  color: #fff;
}
.btn-primary:hover {
  background: #2563eb;
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(59,130,246,0.3);
}

.btn-outline {
  border: 1px solid var(--border);
  color: var(--text);
  background: transparent;
}
.btn-outline:hover {
  border-color: var(--accent-blue);
  color: var(--link-hover);
  text-decoration: none;
  background: var(--accent-glow);
}

.btn-sm {
  font-size: 0.8rem;
  padding: 0.4em 0.9em;
}

/* === Cards === */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-xl);
  transition: background 0.25s, border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}
.card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(59,130,246,0.12);
}
.card a { color: inherit; }
.card a:hover { text-decoration: none; }

/* Card grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-lg);
}

.card-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: var(--space-lg);
}

/* Article card specifics */
.article-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.article-num {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-blue);
}

.article-card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #f1f5f9;
  line-height: 1.4;
  margin-bottom: 0;
}

.article-card p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
  flex: 1;
}

.article-links {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-top: var(--space-sm);
}

/* === Feature cards (homepage) === */
.feature-card {
  text-align: center;
  padding: var(--space-xl) var(--space-lg);
}

.feature-icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-md);
  display: block;
}

.feature-card h3 {
  font-size: 1.2rem;
  margin-bottom: var(--space-sm);
}

.feature-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: var(--space-lg);
}

/* === Section headings === */
.section-header {
  margin-bottom: var(--space-xl);
}

.section-header h2 {
  margin-bottom: var(--space-sm);
}

.section-header p {
  color: var(--text-muted);
  max-width: 600px;
}

.section-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-blue);
  margin-bottom: var(--space-sm);
}

/* === Divider === */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0;
}

/* === Callout / Quote === */
.callout {
  background: rgba(59,130,246,0.06);
  border-left: 3px solid var(--accent-blue);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: var(--space-lg);
  margin: var(--space-xl) 0;
  font-size: 0.95rem;
  color: var(--text-muted);
  font-style: italic;
}

.callout-gold {
  background: rgba(245,158,11,0.06);
  border-left-color: var(--accent-gold);
}

/* === Tag / Badge === */
.tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.2em 0.6em;
  border-radius: 0.25rem;
  background: rgba(59,130,246,0.12);
  color: var(--accent-blue);
  border: 1px solid rgba(59,130,246,0.2);
}

.tag-gold {
  background: rgba(245,158,11,0.10);
  color: var(--accent-gold);
  border-color: rgba(245,158,11,0.2);
}

/* === File list (for orbitals pages) === */
.file-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.file-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: background 0.2s, border-color 0.2s;
}

.file-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
}

.file-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  margin-top: 0.1em;
}

.file-name {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.82rem;
  color: var(--link);
  display: block;
  margin-bottom: 0.15rem;
}

.file-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: block;
}

/* === Image gallery === */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space-md);
}

.gallery-item img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: border-color 0.2s, transform 0.2s;
}
.gallery-item:hover img {
  border-color: var(--accent-blue);
  transform: scale(1.02);
}

.gallery-item figcaption {
  font-size: 0.75rem;
  color: var(--text-faint);
  margin-top: 0.3rem;
  text-align: center;
}

/* === Footer === */
.site-footer {
  margin-top: var(--space-2xl);
  border-top: 1px solid var(--border);
  padding: var(--space-xl) 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.footer-copy {
  font-size: 0.82rem;
  color: var(--text-faint);
}

.footer-links {
  display: flex;
  gap: var(--space-lg);
  flex-wrap: wrap;
}

.footer-links a {
  font-size: 0.82rem;
  color: var(--text-faint);
}
.footer-links a:hover {
  color: var(--link-hover);
}

/* === Page hero (inner pages) === */
.page-hero {
  padding: var(--space-2xl) 0 var(--space-xl);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-2xl);
}

.page-hero h1 {
  margin-bottom: var(--space-md);
}

.page-hero p {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 720px;
  line-height: 1.7;
}

/* === Breadcrumb === */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-faint);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}

.breadcrumb a { color: var(--text-faint); }
.breadcrumb a:hover { color: var(--link-hover); }
.breadcrumb span { color: var(--text-faint); }

/* === Sub-section nav (orbitals) === */
.sub-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
}

/* === Responsive tweaks === */
@media (max-width: 768px) {
  .section { padding: var(--space-xl) 0; }
  .card { padding: var(--space-lg); }
  .hero { padding: var(--space-xl) 0 var(--space-lg); }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .card-grid, .card-grid-2 {
    grid-template-columns: 1fr;
  }
}

/* === Utility === */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border-width: 0;
}
