/* ============================================================
   SOCIAL VIBES LAB — Design System
   Cultural Observatory & Lifestyle Research Lab
   ============================================================ */

/* 1. CUSTOM PROPERTIES ====================================== */
:root {
  /* Core palette */
  --bone:        #F4F4F0;
  --graphite:    #1C1D1A;
  --ultramarine: #2838FA;
  --peach:       #FF7E67;

  /* Semantic tokens — light mode */
  --bg:              #F4F4F0;
  --bg-elevated:     #ECEEE8;
  --bg-hover:        rgba(28, 29, 26, 0.04);
  --text-primary:    #1C1D1A;
  --text-secondary:  rgba(28, 29, 26, 0.52);
  --text-muted:      rgba(28, 29, 26, 0.34);
  --border:          rgba(28, 29, 26, 0.1);
  --border-strong:   rgba(28, 29, 26, 0.18);
  --grid-line:       rgba(40, 56, 250, 0.055);
  --grid-line-main:  rgba(40, 56, 250, 0.10);

  /* Typography */
  --font-mono: 'Space Mono', 'JetBrains Mono', 'Courier New', monospace;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;

  /* Spacing scale */
  --sp-1:   4px;
  --sp-2:   8px;
  --sp-3:   12px;
  --sp-4:   16px;
  --sp-5:   20px;
  --sp-6:   24px;
  --sp-8:   32px;
  --sp-10:  40px;
  --sp-12:  48px;
  --sp-16:  64px;
  --sp-20:  80px;
  --sp-24:  96px;
  --sp-32: 128px;

  /* Motion */
  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Layout */
  --nav-h:     60px;
  --max-w:   1280px;
  --col-art:  700px;
}

/* Dark mode overrides */
[data-theme="dark"] {
  --bg:              #1C1D1A;
  --bg-elevated:     #252622;
  --bg-hover:        rgba(244, 244, 240, 0.04);
  --text-primary:    #F4F4F0;
  --text-secondary:  rgba(244, 244, 240, 0.52);
  --text-muted:      rgba(244, 244, 240, 0.32);
  --border:          rgba(244, 244, 240, 0.08);
  --border-strong:   rgba(244, 244, 240, 0.16);
  --grid-line:       rgba(244, 244, 240, 0.03);
  --grid-line-main:  rgba(244, 244, 240, 0.06);
}

/* 2. RESET & BASE =========================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--text-primary);
  font-size: 16px;
  line-height: 1.65;
  min-height: 100vh;
  transition: background-color 0.35s ease, color 0.35s ease;
  position: relative;
}

/* 3. GRAPH PAPER BACKGROUND ================================= */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
    linear-gradient(var(--grid-line-main) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line-main) 1px, transparent 1px);
  background-size:
    28px 28px,
    28px 28px,
    140px 140px,
    140px 140px;
  pointer-events: none;
  z-index: 0;
  transition: opacity 0.35s ease;
}

/* Content above grid */
body > * {
  position: relative;
  z-index: 1;
}

/* 4. TYPOGRAPHY ============================================= */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--text-primary);
}

a {
  color: var(--ultramarine);
  text-decoration: none;
  transition: opacity 0.2s ease;
}
a:hover { opacity: 0.75; }

strong { font-weight: 600; }

/* Mono utility */
.mono {
  font-family: var(--font-mono);
  font-size: 0.8em;
  letter-spacing: 0.01em;
}

/* 5. LAYOUT ================================================= */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--sp-8);
}

@media (max-width: 768px) {
  .container { padding: 0 var(--sp-5); }
}

/* 6. NAVIGATION ============================================= */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 100;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background 0.35s ease, border-color 0.35s ease;
}

.nav::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(var(--bg), 0.85);
  pointer-events: none;
}

.nav-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-8);
}

.nav-logo {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 2px;
  text-decoration: none;
  transition: color 0.2s ease;
}

.nav-logo:hover { opacity: 1; color: var(--ultramarine); }

.nav-logo .dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ultramarine);
  margin-left: 2px;
  transition: background 0.2s ease;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--sp-8);
  list-style: none;
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-decoration: none;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  transition: color 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
  opacity: 1;
}

.nav-links a.active {
  color: var(--ultramarine);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: var(--sp-6);
}

/* Theme toggle */
.theme-toggle {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: none;
  border: 1px solid var(--border);
  padding: var(--sp-1) var(--sp-3);
  border-radius: 3px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  white-space: nowrap;
}

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

/* Mobile nav */
@media (max-width: 640px) {
  .nav-links { gap: var(--sp-5); }
  .nav-links a { font-size: 0.68rem; }
  .theme-toggle { font-size: 0.65rem; padding: 2px 6px; }
}

/* 7. PAGE WRAPPER =========================================== */
.page-content {
  padding-top: var(--nav-h);
  min-height: 100vh;
}

/* 8. HERO — HOME ============================================ */
.hero {
  position: relative;
  overflow: hidden;
  padding: var(--sp-32) 0 var(--sp-24);
  border-bottom: 1px solid var(--border);
}

.hero-aura {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.hero-aura::before {
  content: '';
  position: absolute;
  width: 55%;
  height: 90%;
  top: -15%;
  right: -8%;
  background: radial-gradient(ellipse, rgba(40, 56, 250, 0.10) 0%, transparent 65%);
  filter: blur(60px);
  animation: aura-drift-a 12s ease-in-out infinite alternate;
}

.hero-aura::after {
  content: '';
  position: absolute;
  width: 45%;
  height: 70%;
  bottom: -20%;
  left: 5%;
  background: radial-gradient(ellipse, rgba(255, 126, 103, 0.09) 0%, transparent 65%);
  filter: blur(50px);
  animation: aura-drift-b 14s ease-in-out infinite alternate;
}

@keyframes aura-drift-a {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(-4%, 6%) scale(1.08); }
}

@keyframes aura-drift-b {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(3%, -5%) scale(1.1); }
}

.hero-kicker {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ultramarine);
  margin-bottom: var(--sp-5);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.hero-kicker::before {
  content: '//';
  opacity: 0.5;
}

.hero-title {
  font-size: clamp(3.2rem, 7vw, 6.5rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.0;
  max-width: 14ch;
  color: var(--text-primary);
  margin-bottom: var(--sp-8);
}

.hero-title em {
  font-style: normal;
  color: var(--ultramarine);
}

.hero-desc {
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--text-secondary);
  max-width: 48ch;
  margin-bottom: var(--sp-10);
}

.hero-ctas {
  display: flex;
  gap: var(--sp-4);
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 12px 22px;
  border-radius: 3px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s ease, background 0.2s ease;
}

.btn:hover { opacity: 1; transform: translateY(-1px); }

.btn-primary {
  background: var(--graphite);
  color: var(--bone);
}

[data-theme="dark"] .btn-primary {
  background: var(--bone);
  color: var(--graphite);
}

.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,0.18);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
}

.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--text-secondary);
}

.btn .arrow {
  transition: transform 0.2s var(--ease-out);
}
.btn:hover .arrow {
  transform: translateX(3px);
}

/* 9. HOME — ABOUT STRIP ===================================== */
.about-strip {
  padding: var(--sp-20) 0;
  border-bottom: 1px solid var(--border);
}

.about-strip-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-16);
  align-items: start;
}

.about-strip-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--sp-4);
}

.about-strip-heading {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: var(--text-primary);
}

.about-strip-text {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-top: var(--sp-4);
}

.topic-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-top: var(--sp-6);
}

@media (max-width: 768px) {
  .about-strip-inner {
    grid-template-columns: 1fr;
    gap: var(--sp-8);
  }
}

/* 10. TAGS ================================================== */
.tag {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 2px;
  transition: border-color 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}

.tag::before { content: '['; margin-right: 2px; opacity: 0.5; }
.tag::after  { content: ']'; margin-left:  2px; opacity: 0.5; }

.tag-blue {
  color: var(--ultramarine);
  border-color: rgba(40, 56, 250, 0.25);
}

.tag-peach {
  color: var(--peach);
  border-color: rgba(255, 126, 103, 0.25);
}

/* 11. HOME — FEATURED FIELD NOTES ========================== */
.featured-section {
  padding: var(--sp-20) 0;
  border-bottom: 1px solid var(--border);
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--sp-10);
  gap: var(--sp-4);
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.section-link {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--ultramarine);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}
.section-link:hover { opacity: 1; }

/* Featured cards (home page grid) */
.featured-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  border: 1px solid var(--border);
  background: var(--border);
}

.featured-card {
  background: var(--bg);
  padding: var(--sp-8);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: background 0.25s ease;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  min-height: 220px;
}

.featured-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 80% 120% at var(--mx, 50%) var(--my, 150%),
    rgba(255, 126, 103, 0.1) 0%,
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.featured-card:hover::before { opacity: 1; }
.featured-card:hover { background: var(--bg-elevated); opacity: 1; }

.card-id {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--text-primary);
  flex: 1;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: auto;
}

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

/* 12. FIELD NOTES — ARCHIVE LIST =========================== */
.archive-hero {
  padding: var(--sp-24) 0 var(--sp-16);
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.archive-hero-aura {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.archive-hero-aura::after {
  content: '';
  position: absolute;
  width: 50%;
  height: 200%;
  top: -50%;
  right: 0;
  background: radial-gradient(ellipse, rgba(40, 56, 250, 0.07) 0%, transparent 60%);
  filter: blur(60px);
}

.archive-kicker {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ultramarine);
  margin-bottom: var(--sp-4);
}

.archive-title {
  font-size: clamp(2.4rem, 5vw, 4.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--text-primary);
  margin-bottom: var(--sp-5);
}

.archive-subtitle {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

/* Filter bar */
.filter-bar {
  padding: var(--sp-5) 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
  overflow-x: auto;
}

.filter-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-right: var(--sp-2);
  white-space: nowrap;
}

.filter-btn {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  background: none;
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.filter-btn:hover,
.filter-btn.active {
  color: var(--ultramarine);
  border-color: rgba(40, 56, 250, 0.35);
  background: rgba(40, 56, 250, 0.05);
}

/* Field Note rows */
.field-notes-list {
  list-style: none;
}

.field-note {
  position: relative;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.field-note::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 70% 200% at var(--mx, 50%) var(--my, 50%),
    rgba(255, 126, 103, 0.09) 0%,
    transparent 65%
  );
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  z-index: 0;
}

.field-note::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--ultramarine);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.3s var(--ease-out);
}

.field-note:hover::before { opacity: 1; }
.field-note:hover::after  { transform: scaleY(1); }

.field-note-link {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: var(--sp-8);
  align-items: center;
  padding: var(--sp-6) var(--sp-8);
  text-decoration: none;
  color: inherit;
  position: relative;
  z-index: 1;
  transition: transform 0.2s var(--ease-out);
}

.field-note:hover .field-note-link {
  transform: translateX(4px);
}

.fn-id {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  white-space: nowrap;
}

.fn-body {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  min-width: 0;
}

.fn-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--text-primary);
  transition: color 0.2s ease;
}

.field-note:hover .fn-title { color: var(--text-primary); }

.fn-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1);
}

.fn-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--sp-1);
  min-width: 80px;
}

.fn-date {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.fn-read {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.fn-arrow {
  font-size: 1rem;
  color: var(--text-muted);
  transition: color 0.2s ease, transform 0.25s var(--ease-out);
  margin-top: 2px;
}

.field-note:hover .fn-arrow {
  color: var(--ultramarine);
  transform: translateX(4px);
}

@media (max-width: 640px) {
  .field-note-link {
    grid-template-columns: 60px 1fr;
    gap: var(--sp-4);
    padding: var(--sp-5) var(--sp-5);
  }
  .fn-meta { display: none; }
}

/* 13. ARTICLE PAGE ========================================== */
.article-header {
  padding: var(--sp-24) 0 var(--sp-12);
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.article-header-aura {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.article-header-aura::before {
  content: '';
  position: absolute;
  width: 60%;
  height: 300%;
  top: -100%;
  right: -5%;
  background: radial-gradient(ellipse, rgba(255, 126, 103, 0.08) 0%, transparent 60%);
  filter: blur(70px);
}

.article-header-aura::after {
  content: '';
  position: absolute;
  width: 40%;
  height: 200%;
  top: -50%;
  left: 0;
  background: radial-gradient(ellipse, rgba(40, 56, 250, 0.07) 0%, transparent 60%);
  filter: blur(60px);
}

.article-eyebrow {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  margin-bottom: var(--sp-5);
  flex-wrap: wrap;
}

.article-fn-id {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--ultramarine);
  opacity: 0.8;
}

.article-title {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  max-width: 18ch;
  color: var(--text-primary);
  margin-bottom: var(--sp-6);
}

.article-meta-row {
  display: flex;
  align-items: center;
  gap: var(--sp-6);
  flex-wrap: wrap;
}

.article-meta-item {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.article-meta-item::before {
  content: '—';
  opacity: 0.4;
}

.article-meta-item:first-child::before { display: none; }

/* Article body */
.article-body {
  padding: var(--sp-16) 0 var(--sp-24);
}

.article-content {
  max-width: var(--col-art);
}

.article-lead {
  font-size: 1.2rem;
  line-height: 1.75;
  color: var(--text-secondary);
  margin-bottom: var(--sp-10);
  padding-bottom: var(--sp-10);
  border-bottom: 1px solid var(--border);
}

.article-content h2 {
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-top: var(--sp-16);
  margin-bottom: var(--sp-5);
  padding-left: var(--sp-5);
  border-left: 2px solid var(--ultramarine);
}

.article-content h3 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin-top: var(--sp-10);
  margin-bottom: var(--sp-4);
}

.article-content h3::before {
  content: '// ';
  font-family: var(--font-mono);
  font-size: 0.8em;
  color: var(--peach);
  opacity: 0.7;
}

.article-content h4 {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: var(--font-mono);
  margin-top: var(--sp-8);
  margin-bottom: var(--sp-3);
}

.article-content p {
  font-size: 1rem;
  line-height: 1.85;
  color: var(--text-secondary);
  margin-bottom: var(--sp-5);
}

.article-content p:last-child { margin-bottom: 0; }

/* Article navigation */
.article-nav {
  border-top: 1px solid var(--border);
  padding: var(--sp-10) 0;
}

.article-nav-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
}

.article-nav-link {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-6);
  border: 1px solid var(--border);
  border-radius: 4px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.article-nav-link:hover {
  border-color: var(--border-strong);
  background: var(--bg-hover);
  opacity: 1;
}

.article-nav-link.next { text-align: right; }

.article-nav-dir {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.article-nav-title {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  line-height: 1.3;
}

.article-nav-id {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--ultramarine);
  opacity: 0.7;
}

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

/* 14. THESIS PAGE =========================================== */
.thesis-hero {
  padding: var(--sp-32) 0 var(--sp-20);
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.thesis-aura {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.thesis-aura::before {
  content: '';
  position: absolute;
  width: 60%;
  height: 140%;
  top: -20%;
  left: -10%;
  background: radial-gradient(ellipse, rgba(40, 56, 250, 0.08) 0%, transparent 65%);
  filter: blur(80px);
}

.thesis-aura::after {
  content: '';
  position: absolute;
  width: 50%;
  height: 100%;
  bottom: -30%;
  right: 0;
  background: radial-gradient(ellipse, rgba(255, 126, 103, 0.08) 0%, transparent 65%);
  filter: blur(70px);
}

.thesis-title {
  font-size: clamp(3rem, 6vw, 5.5rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.05;
  color: var(--text-primary);
  margin-bottom: var(--sp-8);
  max-width: 16ch;
}

.thesis-intro {
  font-size: 1.15rem;
  line-height: 1.75;
  color: var(--text-secondary);
  max-width: 52ch;
}

/* Thesis sections */
.thesis-body {
  padding: var(--sp-20) 0;
}

.thesis-section {
  padding: var(--sp-16) 0;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: var(--sp-16);
  align-items: start;
}

.thesis-section:last-child { border-bottom: none; }

.thesis-section-label {
  position: sticky;
  top: calc(var(--nav-h) + var(--sp-8));
}

.thesis-section-num {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--sp-3);
}

.thesis-section-heading {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text-primary);
}

.thesis-section-content p {
  font-size: 1rem;
  line-height: 1.85;
  color: var(--text-secondary);
  margin-bottom: var(--sp-5);
}

.thesis-section-content p:last-child { margin-bottom: 0; }

.thesis-section-content h4 {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: var(--sp-8);
  margin-bottom: var(--sp-3);
}

.thesis-principles {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
  margin-top: var(--sp-6);
}

.thesis-principle {
  display: flex;
  gap: var(--sp-5);
  align-items: flex-start;
  padding: var(--sp-5);
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-hover);
}

.principle-num {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--ultramarine);
  min-width: 40px;
  padding-top: 3px;
  opacity: 0.7;
}

.principle-text {
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--text-secondary);
}

@media (max-width: 900px) {
  .thesis-section {
    grid-template-columns: 1fr;
    gap: var(--sp-6);
  }
  .thesis-section-label { position: static; }
}

/* 15. PULL QUOTE =========================================== */
.pull-quote {
  border-left: 2px solid var(--ultramarine);
  padding: var(--sp-5) var(--sp-8);
  margin: var(--sp-8) 0;
  background: rgba(40, 56, 250, 0.04);
}

.pull-quote p {
  font-size: 1.15rem;
  font-style: italic;
  line-height: 1.6;
  color: var(--text-primary) !important;
  margin: 0 !important;
}

/* 16. FOOTER ================================================ */
.footer {
  border-top: 1px solid var(--border);
  padding: var(--sp-12) 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-8);
  flex-wrap: wrap;
}

.footer-logo {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 4px;
}

.footer-tagline {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.footer-nav {
  display: flex;
  gap: var(--sp-6);
  list-style: none;
}

.footer-nav a {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-nav a:hover {
  color: var(--text-primary);
  opacity: 1;
}

.footer-copy {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-top: var(--sp-5);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-4);
}

/* 17. BACK LINK ============================================= */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: var(--sp-8);
  transition: color 0.2s ease;
}

.back-link:hover {
  color: var(--ultramarine);
  opacity: 1;
}

/* 18. DECORATIVE ELEMENTS =================================== */
.scan-line {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--ultramarine), transparent);
  opacity: 0.3;
  margin: var(--sp-16) 0;
}

.data-point {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.data-point::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ultramarine);
  animation: pulse 2.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50%       { opacity: 1;   transform: scale(1.2); }
}

/* 19. ANIMATIONS ============================================ */
.fade-up {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-up:nth-child(2) { transition-delay: 0.1s; }
.fade-up:nth-child(3) { transition-delay: 0.2s; }
.fade-up:nth-child(4) { transition-delay: 0.3s; }
.fade-up:nth-child(5) { transition-delay: 0.4s; }

/* Stagger for field notes */
.field-note:nth-child(n) { transition-delay: calc(n * 0.04s); }

/* 20. SCROLLBAR ============================================= */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* 21. SELECTION ============================================= */
::selection {
  background: rgba(40, 56, 250, 0.2);
  color: var(--text-primary);
}

/* 22. FOCUS VISIBLE ========================================= */
:focus-visible {
  outline: 2px solid var(--ultramarine);
  outline-offset: 3px;
  border-radius: 2px;
}

/* 23. MISC UTILITIES ======================================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.text-mono {
  font-family: var(--font-mono);
}

.text-ultramarine { color: var(--ultramarine); }
.text-peach       { color: var(--peach); }
.text-muted       { color: var(--text-muted); }

/* 24. RESPONSIVE HELPERS ==================================== */
@media (max-width: 768px) {
  .hero-title  { font-size: clamp(2.8rem, 10vw, 4rem); }
  .thesis-title { font-size: clamp(2.4rem, 9vw, 3.5rem); }
  .archive-title { font-size: clamp(2rem, 8vw, 3rem); }
  .article-title { font-size: clamp(2rem, 7vw, 2.8rem); }
  .article-content h2 { font-size: 1.4rem; }
}

@media (max-width: 480px) {
  :root { --nav-h: 54px; }
  .nav-logo { font-size: 0.82rem; }
}
