/* ============================================================
   James Ainslie — Personal Site Theme
   Dark craftsman aesthetic. JetBrains Mono + DM Sans + Fraunces.
   ============================================================ */

/* --- Reset & Variables --- */
:root {
  --bg: #0c0e12;
  --surface: #13161c;
  --surface-raised: #191d25;
  --surface-hover: #1e232d;
  --border: #252b38;
  --border-accent: #2d3548;
  --text: #c8cdd8;
  --text-muted: #6b7280;
  --text-dim: #4a5060;
  --heading: #e8ecf4;
  --accent-orange: #e8804a;
  --accent-orange-dim: #c06030;
  --accent-blue: #5b9cf5;
  --accent-blue-dim: #3a6bbd;
  --accent-green: #6bc96b;
  --accent-green-dim: #3d8a3d;
  --accent-purple: #a78bfa;
  --accent-purple-dim: #7c5cc7;
  --accent-yellow: #e5c07b;
  --accent-yellow-dim: #b89550;
  --accent-red: #f47067;
  --accent-red-dim: #c04840;
  --accent-cyan: #56d4dd;
  --accent-cyan-dim: #2fa5ad;
  --accent-pink: #e879a8;
  --accent-pink-dim: #b85580;
  --mono: 'JetBrains Mono', monospace;
  --sans: 'DM Sans', sans-serif;
  --display: 'Fraunces', serif;
  --radius: 8px;
  --radius-lg: 12px;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Noise texture --- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
}

a { color: var(--accent-orange); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-yellow); }

/* ============================================================
   Navigation
   ============================================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(12, 14, 18, 0.82);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--display);
  font-weight: 900;
  font-size: 1.1rem;
  color: var(--heading);
  letter-spacing: -0.02em;
  text-decoration: none;
}

.nav-logo:hover { color: var(--accent-orange); }

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

.nav-links a {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
  text-decoration: none;
  letter-spacing: 0.02em;
}

.nav-links a:hover {
  color: var(--heading);
  background: var(--surface-hover);
}

.nav-links a.active {
  color: var(--accent-orange);
  background: rgba(232, 128, 74, 0.08);
}

/* ============================================================
   Page Shell
   ============================================================ */
.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 80px 1.5rem 2rem;  /* 80px accounts for fixed nav */
  min-height: 100vh;
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--border);
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-left {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-dim);
}

.footer-links {
  display: flex;
  gap: 1.25rem;
  list-style: none;
}

.footer-links a {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

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

.footer-links svg {
  width: 14px;
  height: 14px;
  opacity: 0.6;
}

/* ============================================================
   Section Headings
   ============================================================ */
.section-heading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.section-heading h2 {
  font-family: var(--display);
  font-weight: 900;
  font-size: 1.5rem;
  color: var(--heading);
  letter-spacing: -0.01em;
}

.section-heading::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border-accent), transparent);
}

/* ============================================================
   Cards (generic)
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}

.card:hover {
  border-color: var(--border-accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* ============================================================
   Badges / Tags
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 100px;
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: var(--bg);
  white-space: nowrap;
}

.badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ============================================================
   Animations
   ============================================================ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-in {
  animation: fadeUp 0.5s ease both;
}

.delay-1 { animation-delay: 0.05s; }
.delay-2 { animation-delay: 0.1s; }
.delay-3 { animation-delay: 0.15s; }
.delay-4 { animation-delay: 0.2s; }
.delay-5 { animation-delay: 0.25s; }
.delay-6 { animation-delay: 0.3s; }
.delay-7 { animation-delay: 0.35s; }
.delay-8 { animation-delay: 0.4s; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 640px) {
  .page { padding: 72px 1rem 1.5rem; }
  .nav-inner { padding: 0 1rem; }
  .site-footer {
    flex-direction: column;
    align-items: flex-start;
    padding: 1.5rem 1rem;
  }
}

@media print {
  body { background: #fff; color: #111; }
  body::before { display: none; }
  .nav { display: none; }
  .card { border-color: #ddd; }
}
