/* ─── FONTS ─────────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Source+Serif+4:ital,opsz,wght@0,8..60,400;0,8..60,600;1,8..60,400&family=JetBrains+Mono:wght@400;500&display=swap');

/* ─── TOKENS ─────────────────────────────────────────────────────────────── */
:root {
  --canvas:  #EBF1F7;
  --ink:     #0C1A27;
  --blue:    #1C5F8C;
  --amber:   #BF6005;
  --muted:   #7890A2;
  --surface: #D2E1EE;

  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body:    'Source Serif 4', Georgia, serif;
  --font-mono:    'JetBrains Mono', monospace;

  --prose-width: 68ch;
  --page-pad: clamp(1.25rem, 5vw, 3rem);
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

/* ─── TYPOGRAPHY ─────────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  line-height: 1.15;
  font-weight: 700;
  color: var(--ink);
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.25rem); }
h3 { font-size: clamp(1.125rem, 2.5vw, 1.5rem); }

p { max-width: var(--prose-width); }

a {
  color: var(--blue);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s ease, color 0.2s ease;
}

a:hover { text-decoration-color: currentColor; }

a:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 2px;
}

img { max-width: 100%; height: auto; display: block; }

/* ─── LAYOUT ─────────────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1080px;
  margin-inline: auto;
  padding-inline: var(--page-pad);
}

/* ─── SKIP LINK ──────────────────────────────────────────────────────────── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--ink);
  color: var(--canvas);
  padding: 0.5rem 1rem;
  font-family: var(--font-display);
  font-size: 0.875rem;
  z-index: 999;
  transition: top 0.2s;
  text-decoration: none;
}
.skip-link:focus { top: 1rem; }

/* ─── NAVIGATION ─────────────────────────────────────────────────────────── */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--canvas);
  border-bottom: 1px solid var(--surface);
}

.site-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 1rem;
}

.nav-logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.nav-logo:hover { color: var(--blue); text-decoration: none; }

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.nav-links a:hover,
.nav-links .current-menu-item > a,
.nav-links .current_page_item > a,
.nav-links .current-menu-ancestor > a {
  color: var(--ink);
  border-bottom-color: var(--blue);
}

@media (max-width: 640px) {
  .nav-links { gap: 1.25rem; }
  .nav-links a { font-size: 0.8rem; }
}

/* ─── FOOTER ─────────────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--surface);
  padding-block: 3rem;
  margin-top: 6rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
  flex-wrap: wrap;
}

.footer-copy {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
}

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

.footer-links a {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  text-decoration: none;
}
.footer-links a:hover { color: var(--blue); }

/* ─── LABEL / MONO ───────────────────────────────────────────────────────── */
.label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  color: var(--muted);
  text-transform: uppercase;
}

/* ─── BUTTON ─────────────────────────────────────────────────────────────── */
.btn-outline {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink);
  text-decoration: none;
  padding: 0.6rem 1.25rem;
  border: 1.5px solid var(--ink);
  transition: background 0.2s ease, color 0.2s ease;
}
.btn-outline:hover {
  background: var(--ink);
  color: var(--canvas);
  text-decoration: none;
}
.btn-outline:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

/* ─── GHOST COUNTER ──────────────────────────────────────────────────────── */
.section-block { position: relative; }

.section-counter {
  position: absolute;
  top: -0.25rem;
  left: -3rem;
  font-family: var(--font-mono);
  font-size: 3.5rem;
  font-weight: 500;
  color: var(--blue);
  opacity: 0.12;
  line-height: 1;
  user-select: none;
  pointer-events: none;
}
@media (max-width: 900px) { .section-counter { display: none; } }

/* ─── POST META ──────────────────────────────────────────────────────────── */
.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.post-meta-field { display: flex; flex-direction: column; gap: 0.125rem; }

.post-meta-key {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.post-meta-key::after { content: '_'; opacity: 0.5; }

.post-meta-val {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink);
  font-weight: 500;
}

/* ─── KINETIC INTRO ──────────────────────────────────────────────────────── */
.kinetic-intro { display: flex; flex-wrap: wrap; gap: 0 0.35em; }

.kinetic-intro .word {
  display: inline-block;
  opacity: 0;
  transform: translateY(6px);
  animation: wordFade 0.28s ease forwards;
}

@keyframes wordFade {
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .kinetic-intro .word { opacity: 1; transform: none; animation: none; }
}

/* ─── PILLAR TAG ─────────────────────────────────────────────────────────── */
.pillar-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--blue);
  border: 1px solid var(--surface);
  padding: 0.2em 0.6em;
  border-radius: 2px;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.pillar-tag:hover {
  background: var(--surface);
  border-color: var(--blue);
  text-decoration: none;
  color: var(--blue);
}

/* ─── POST CARD ──────────────────────────────────────────────────────────── */
.post-card {
  border-top: 1px solid var(--surface);
  padding-top: 1.5rem;
  margin-top: 1.5rem;
}

.post-card-title {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  transition: color 0.2s ease;
  display: block;
  margin-bottom: 0.4rem;
}
.post-card-title:hover { color: var(--blue); text-decoration: none; }

.post-card-desc {
  font-size: 0.95rem;
  color: var(--muted);
  max-width: 60ch;
  margin-top: 0.35rem;
}

/* ─── PROSE ──────────────────────────────────────────────────────────────── */
.prose { max-width: var(--prose-width); }
.prose h2 { margin-top: 2.5rem; margin-bottom: 0.75rem; }
.prose h3 { margin-top: 2rem; margin-bottom: 0.5rem; }
.prose p { margin-bottom: 1.25rem; }
.prose ul, .prose ol { padding-left: 1.5rem; margin-bottom: 1.25rem; }
.prose li { margin-bottom: 0.35rem; }
.prose blockquote {
  border-left: 3px solid var(--blue);
  padding-left: 1.25rem;
  margin-left: 0;
  margin-block: 1.5rem;
  color: var(--muted);
  font-style: italic;
}
.prose code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--surface);
  padding: 0.15em 0.4em;
  border-radius: 2px;
}

/* ─── INSIGHTS INDEX ─────────────────────────────────────────────────────── */
.pillar-section { margin-bottom: 4rem; }

.pillar-heading {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.25rem;
}

.pillar-heading h2 {
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font-display);
}

/* ─── CONNECT CARDS ──────────────────────────────────────────────────────── */
.connect-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
  margin-bottom: 4rem;
}

.connect-card {
  padding: 1.75rem;
  border: 1px solid var(--surface);
}

.connect-card-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 0.75rem;
}

.connect-card p {
  font-size: 0.95rem;
  color: var(--muted);
}

/* ─── HOME FEATURED ──────────────────────────────────────────────────────── */
.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

/* ─── WP ADMIN BAR OFFSET ───────────────────────────────────────────────── */
.admin-bar .site-nav { top: 32px; }
@media screen and (max-width: 782px) {
  .admin-bar .site-nav { top: 46px; }
}
