@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wdth,wght@12..96,75..100,300..800&family=JetBrains+Mono:wght@300;400;500;600&family=Geist:wght@300;400;500;600;700&display=swap');

/* ─────────────────────────────────────────────────────────────
   REEYAN — editorial aerospace, dark mode, signal-amber accent
   ───────────────────────────────────────────────────────────── */

:root {
  --ink:        #08090b;
  --ink-2:      #0c0e12;
  --panel:      #12151b;
  --panel-2:    #181c24;
  --paper:      #f3efe6;
  --paper-dim:  #d7d2c5;
  --mute:       #7d8088;
  --mute-2:     #4a4d54;
  --rule:       rgba(243, 239, 230, 0.08);
  --rule-strong:rgba(243, 239, 230, 0.18);
  --accent:     #1D263B;
  --accent-2:   #3a4a6e;
  --accent-soft:rgba(29, 38, 59, 0.4);
  --signal:     #1D263B;

  --font-display: 'Bricolage Grotesque', 'Geist', system-ui, sans-serif;
  --font-body:    'Geist', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, monospace;

  --nav-height: 72px;
  --pad-x: clamp(20px, 4vw, 64px);
  --max-w: 1480px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; background: var(--ink); }

body {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  position: relative;
}

/* hairline grid + grain — subtle atmosphere */
body::before {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 1;
  background-image:
    linear-gradient(to right, var(--rule) 1px, transparent 1px),
    linear-gradient(to bottom, var(--rule) 1px, transparent 1px);
  background-size: clamp(80px, 12vw, 160px) clamp(80px, 12vw, 160px);
  mask-image: radial-gradient(ellipse at center, rgba(0,0,0,0.6) 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, rgba(0,0,0,0.6) 0%, transparent 75%);
  opacity: 0.55;
}

body::after {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 2;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.95 0 0 0 0 0.94 0 0 0 0 0.9 0 0 0 0.5 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  opacity: 0.05;
  mix-blend-mode: overlay;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent); color: var(--ink); }

/* ── STATUS BAR / NAV ───────────────────────────── */

.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-height);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 40px;
  padding: 0 var(--pad-x);
  background: linear-gradient(to bottom, rgba(8,9,11,0.92) 0%, rgba(8,9,11,0.6) 70%, transparent 100%);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  transition: backdrop-filter 0.3s ease, background 0.3s ease, border-color 0.3s ease;
  border-bottom: 1px solid transparent;
}

.site-nav.scrolled {
  background: rgba(8, 9, 11, 0.78);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--rule);
}

.nav-logo {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-variation-settings: "opsz" 96, "wdth" 90;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--paper);
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.nav-logo::before {
  content: '';
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
  animation: pulse-dot 2.4s ease-in-out infinite;
}

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

.nav-menu {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
  justify-self: center;
}

.nav-menu a {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--paper-dim);
  position: relative;
  padding: 6px 0;
  transition: color 0.25s var(--ease);
}

.nav-menu a::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 1px;
  background: var(--accent);
  transition: width 0.35s var(--ease);
}

.nav-menu a:hover { color: var(--paper); }
.nav-menu a:hover::after { width: 100%; }

.nav-clock {
  justify-self: end;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.14em;
  color: var(--mute);
  display: flex;
  align-items: center;
  gap: 14px;
}

.nav-clock .dot { color: var(--accent); }

@media (max-width: 768px) {
  .nav-clock { display: none; }
  .site-nav { grid-template-columns: 1fr auto; }
}

/* ── HERO ───────────────────────────────────────── */

.site-hero {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 640px;
  overflow: hidden;
  background: var(--ink);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.55;
  filter: grayscale(1) contrast(1.1) brightness(0.95);
  transform: scale(1.04);
  animation: hero-drift 22s var(--ease) infinite alternate;
}

@keyframes hero-drift {
  0%   { transform: scale(1.04) translate3d(0, 0, 0); }
  100% { transform: scale(1.08) translate3d(-1%, -1%, 0); }
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8,9,11,0.7) 0%, rgba(8,9,11,0.25) 40%, rgba(8,9,11,0.97) 100%);
}

.hero-content {
  position: relative;
  z-index: 3;
  padding: 0 var(--pad-x) clamp(60px, 10vh, 110px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 40px;
  max-width: var(--max-w);
  margin: 0 auto;
  width: 100%;
}

.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 28px;
  opacity: 0;
  animation: rise 0.9s var(--ease) 0.1s forwards;
}

.hero-eyebrow::before {
  content: '';
  width: 32px; height: 1px;
  background: var(--accent);
}

.hero-title {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-variation-settings: "opsz" 96, "wdth" 85;
  font-size: clamp(64px, 12vw, 200px);
  font-weight: 700;
  letter-spacing: -0.055em;
  line-height: 0.88;
  color: var(--paper);
  margin: 0;
  opacity: 0;
  animation: rise 1.1s var(--ease) 0.2s forwards;
}

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

.hero-subtitle {
  font-family: var(--font-body);
  font-size: clamp(14px, 1.1vw, 17px);
  font-weight: 400;
  line-height: 1.5;
  color: var(--paper-dim);
  max-width: 360px;
  text-align: right;
  border-left: 1px solid var(--rule-strong);
  padding-left: 20px;
  opacity: 0;
  animation: rise 1s var(--ease) 0.45s forwards;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-telemetry {
  position: absolute;
  left: var(--pad-x);
  top: calc(var(--nav-height) + 32px);
  display: grid;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mute);
  z-index: 3;
}
.hero-telemetry b { color: var(--paper-dim); font-weight: 500; }
.hero-telemetry .row { display: flex; gap: 12px; }

.hero-scroll {
  position: absolute;
  right: var(--pad-x);
  bottom: 32px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--mute);
  cursor: pointer;
  transition: color 0.3s ease;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.hero-scroll:hover { color: var(--accent); }

.hero-scroll::after {
  content: '';
  width: 1px; height: 56px;
  background: linear-gradient(to bottom, var(--mute-2), transparent);
  margin-top: 4px;
}

@media (max-width: 768px) {
  .hero-content {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .hero-subtitle { text-align: left; border-left: none; padding-left: 0; border-top: 1px solid var(--rule-strong); padding-top: 16px; max-width: 100%; }
  .hero-scroll { display: none; }
}

/* ── MARQUEE STRIP ──────────────────────────────── */

.marquee {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  overflow: hidden;
  position: relative;
  background: var(--ink-2);
}

.marquee-track {
  display: flex;
  gap: 60px;
  padding: 18px 0;
  white-space: nowrap;
  animation: marquee 38s linear infinite;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--paper-dim);
  width: max-content;
}

.marquee-track span {
  display: inline-flex;
  align-items: center;
  gap: 60px;
}
.marquee-track span::after {
  content: '◆';
  color: var(--accent);
  font-size: 9px;
}

@keyframes marquee {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-50%, 0, 0); }
}

/* ── POSTS ──────────────────────────────────────── */

.posts-section {
  padding: clamp(60px, 10vh, 120px) var(--pad-x);
  max-width: var(--max-w);
  margin: 0 auto;
  position: relative;
  z-index: 3;
}

.section-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: end;
  gap: 32px;
  margin-bottom: 56px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--rule);
}

.section-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 12px;
}
.section-label::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
}

.section-title {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 96, "wdth" 90;
  font-weight: 600;
  font-size: clamp(28px, 4vw, 56px);
  letter-spacing: -0.035em;
  line-height: 1;
  color: var(--paper);
}

.section-link {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--paper-dim);
  border-bottom: 1px solid var(--rule-strong);
  padding-bottom: 4px;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.section-link:hover { color: var(--accent); border-color: var(--accent); }

/* ── FEATURED LAYOUT ────────────────────────────── */

.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}

.posts-grid.featured {
  grid-template-columns: 1.6fr 1fr 1fr;
  grid-auto-rows: minmax(200px, 1fr);
}

.posts-grid.featured .post-card:first-child {
  grid-row: span 2;
  grid-column: 1;
}

.posts-grid.featured .post-card:first-child .post-card-title {
  font-size: clamp(28px, 4vw, 52px);
}

/* ── POST CARD ──────────────────────────────────── */

.post-card {
  position: relative;
  overflow: hidden;
  background: var(--ink-2);
  cursor: pointer;
  isolation: isolate;
  min-height: 280px;
}

.post-card a { display: block; width: 100%; height: 100%; }

.post-card-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1s var(--ease), filter 0.6s ease;
  filter: grayscale(1) brightness(0.55) contrast(1.1);
  z-index: 0;
}

.post-card:hover .post-card-image {
  transform: scale(1.06);
  filter: grayscale(0.6) brightness(0.75) contrast(1.1);
}

.post-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(8,9,11,0.05) 0%, rgba(8,9,11,0.55) 55%, rgba(8,9,11,0.95) 100%);
  z-index: 1;
  transition: opacity 0.5s ease;
}

.post-card:hover::after { opacity: 0.85; }

.post-card-overlay {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px 26px 26px;
}

.post-card-index {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--mute);
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-transform: uppercase;
}

.post-card-index .arrow {
  display: inline-block;
  transition: transform 0.45s var(--ease), color 0.3s ease;
  color: var(--paper-dim);
  font-family: var(--font-body);
  font-size: 14px;
}

.post-card:hover .post-card-index .arrow {
  transform: translate(4px, -4px);
  color: var(--accent);
}

.post-card-bottom {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.post-card-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
}
.post-card-tag::before {
  content: '';
  width: 6px; height: 1px;
  background: var(--accent);
}

.post-card-title {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-variation-settings: "opsz" 48, "wdth" 92;
  font-size: clamp(20px, 2.4vw, 30px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--paper);
}

.post-card-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--paper-dim);
  display: flex;
  gap: 14px;
  align-items: center;
}
.post-card-meta .sep {
  width: 4px; height: 4px;
  background: var(--mute-2);
  border-radius: 50%;
}

/* ── SINGLE POST ────────────────────────────────── */

.post-hero {
  position: relative;
  width: 100%;
  height: 80vh;
  min-height: 520px;
  overflow: hidden;
  background: var(--ink);
}

.post-hero-image {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: grayscale(1) brightness(0.55) contrast(1.1);
  transform: scale(1.02);
}

.post-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8,9,11,0.6) 0%, rgba(8,9,11,0.2) 30%, rgba(8,9,11,0.98) 100%);
}

.post-hero-content {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 0 var(--pad-x) clamp(50px, 8vh, 100px);
  max-width: var(--max-w);
  margin: 0 auto;
}

.post-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 24px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.post-tag::before {
  content: '';
  width: 24px; height: 1px;
  background: var(--accent);
}

.post-title {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-variation-settings: "opsz" 96, "wdth" 88;
  font-size: clamp(40px, 7vw, 110px);
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 0.94;
  color: var(--paper);
  margin-bottom: 32px;
  max-width: 16ch;
}

.post-meta-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 28px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--paper-dim);
  padding-top: 20px;
  border-top: 1px solid var(--rule);
}

.post-meta-bar span { display: inline-flex; align-items: center; gap: 8px; }
.post-meta-bar span::before {
  content: '';
  width: 4px; height: 4px;
  background: var(--accent);
  border-radius: 50%;
}

/* ── ARTICLE BODY ───────────────────────────────── */

.post-body-wrap {
  max-width: 740px;
  margin: 0 auto;
  padding: clamp(60px, 10vh, 120px) var(--pad-x);
  position: relative;
  z-index: 3;
}

.post-body p,
.post-body ul,
.post-body ol {
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 400;
  line-height: 1.72;
  color: var(--paper-dim);
  margin-bottom: 1.4em;
  letter-spacing: -0.005em;
}

.post-body ul, .post-body ol { padding-left: 1.5em; }
.post-body li { margin-bottom: 0.5em; }

.post-body p:first-of-type::first-letter {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 96, "wdth" 80;
  font-weight: 700;
  font-size: 4.5em;
  float: left;
  line-height: 0.85;
  margin: 0.05em 0.12em 0 -0.04em;
  color: var(--accent);
}

.post-body h2 {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 96, "wdth" 90;
  font-weight: 600;
  font-size: clamp(28px, 4.5vw, 48px);
  letter-spacing: -0.035em;
  line-height: 1.05;
  color: var(--paper);
  margin: 2em 0 0.6em;
}

.post-body h3 {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 2em 0 0.6em;
}

.post-body a {
  color: var(--paper);
  background-image: linear-gradient(var(--accent), var(--accent));
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 100% 1px;
  padding-bottom: 2px;
  transition: background-size 0.4s var(--ease), color 0.3s ease;
}
.post-body a:hover {
  color: var(--ink);
  background-size: 100% 100%;
}

.post-body strong { color: var(--paper); font-weight: 600; }
.post-body em { color: var(--accent-2); font-style: normal; }

.post-body blockquote {
  border-left: 2px solid var(--accent);
  padding: 8px 0 8px 28px;
  margin: 2.4em 0;
  font-family: var(--font-display);
  font-variation-settings: "opsz" 48, "wdth" 95;
  font-weight: 500;
  font-size: 24px;
  line-height: 1.4;
  color: var(--paper);
  letter-spacing: -0.02em;
}

.post-body hr {
  border: none;
  height: 1px;
  background: var(--rule-strong);
  margin: 3.5em 0;
  position: relative;
}
.post-body hr::after {
  content: '◆';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: var(--ink);
  padding: 0 14px;
  color: var(--accent);
  font-size: 10px;
}

.post-body figure { margin: 2.5em 0; }
.post-body figcaption {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--mute);
  text-align: center;
  margin-top: 14px;
  text-transform: uppercase;
}

.post-body code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--panel);
  padding: 2px 8px;
  border-radius: 3px;
  color: var(--accent-2);
  border: 1px solid var(--rule);
}

.post-body pre {
  background: var(--ink-2);
  border: 1px solid var(--rule);
  padding: 24px 28px;
  overflow-x: auto;
  margin: 2em 0;
  border-radius: 4px;
  position: relative;
}
.post-body pre::before {
  content: '// CODE';
  position: absolute;
  top: 8px; right: 14px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.22em;
  color: var(--mute-2);
}
.post-body pre code {
  background: none;
  padding: 0;
  border: none;
  color: var(--paper-dim);
  font-size: 14px;
  line-height: 1.65;
}

.post-body img { border-radius: 2px; }

/* ── PAGE / TAG / AUTHOR HEADER ─────────────────── */

.page-header,
.tag-header {
  padding: calc(var(--nav-height) + 80px) var(--pad-x) 60px;
  border-bottom: 1px solid var(--rule);
  max-width: var(--max-w);
  margin: 0 auto;
  position: relative;
  z-index: 3;
}

.page-title {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 96, "wdth" 85;
  font-weight: 700;
  font-size: clamp(56px, 10vw, 160px);
  letter-spacing: -0.055em;
  line-height: 0.9;
  color: var(--paper);
}

.page-desc {
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.55;
  color: var(--paper-dim);
  margin-top: 24px;
  max-width: 600px;
}

.tag-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.tag-label::before {
  content: '';
  width: 24px; height: 1px;
  background: var(--accent);
}

/* ── PAGINATION ─────────────────────────────────── */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 60px;
  padding: 80px var(--pad-x);
  border-top: 1px solid var(--rule);
  margin-top: 80px;
}

.pagination a {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--paper-dim);
  border-bottom: 1px solid var(--rule-strong);
  padding-bottom: 4px;
  transition: color 0.25s ease, border-color 0.25s ease;
}
.pagination a:hover { color: var(--accent); border-color: var(--accent); }

.pagination .page-number {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--mute);
}

/* ── FOOTER ─────────────────────────────────────── */

.site-footer {
  padding: 80px var(--pad-x) 40px;
  border-top: 1px solid var(--rule);
  background: var(--ink);
  position: relative;
  z-index: 3;
  max-width: var(--max-w);
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 60px;
  padding-bottom: 60px;
}

.footer-mark {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 96, "wdth" 85;
  font-weight: 700;
  font-size: clamp(48px, 8vw, 120px);
  letter-spacing: -0.055em;
  line-height: 0.9;
  color: var(--paper);
}
.footer-mark .accent { color: var(--accent); font-weight: 700; }

.footer-col h4 {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 18px;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links a {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--paper-dim);
  transition: color 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.footer-links a:hover { color: var(--accent); }
.footer-links a::before { content: '→'; color: var(--mute-2); transition: color 0.2s, transform 0.3s var(--ease); }
.footer-links a:hover::before { color: var(--accent); transform: translateX(3px); }

.footer-base {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 30px;
  border-top: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mute);
  flex-wrap: wrap;
  gap: 16px;
}

.footer-copy { color: var(--paper-dim); }

/* ── ERROR ──────────────────────────────────────── */

.error-wrap {
  min-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px var(--pad-x) 80px;
  position: relative;
}

.error-code {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 96, "wdth" 80;
  font-weight: 700;
  font-size: clamp(160px, 26vw, 380px);
  letter-spacing: -0.07em;
  line-height: 1;
  background: linear-gradient(180deg, var(--paper) 0%, transparent 110%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  opacity: 0.5;
}

.error-msg {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 96, "wdth" 90;
  font-weight: 600;
  font-size: clamp(28px, 4vw, 56px);
  letter-spacing: -0.035em;
  margin-top: -0.3em;
  color: var(--paper);
}

.error-sub {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: 20px;
}

.error-link {
  margin-top: 40px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--paper);
  border: 1px solid var(--rule-strong);
  padding: 14px 28px;
  transition: all 0.3s var(--ease);
}
.error-link:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--ink);
}

/* ── KOENIG CARD WIDTHS ─────────────────────────── */

.post-body .kg-width-wide {
  margin-left: calc(50% - 50vw + var(--pad-x));
  margin-right: calc(50% - 50vw + var(--pad-x));
  width: auto;
  max-width: calc(100vw - var(--pad-x) * 2);
}

.post-body .kg-width-full {
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  width: 100vw;
  max-width: 100vw;
}

.post-body .kg-image { max-width: 100%; }

.post-body .kg-gallery-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 2.5em 0;
}
.post-body .kg-gallery-row { display: flex; gap: 6px; }
.post-body .kg-gallery-image img { width: 100%; height: 100%; object-fit: cover; }

.post-body .kg-embed-card { margin: 2em 0; }
.post-body .kg-embed-card iframe { width: 100%; }

.post-body .kg-bookmark-card {
  border: 1px solid var(--rule-strong);
  margin: 2em 0;
  background: var(--panel);
  transition: border-color 0.3s ease, transform 0.3s var(--ease);
}
.post-body .kg-bookmark-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.post-body .kg-bookmark-container { display: flex; color: inherit; text-decoration: none; }
.post-body .kg-bookmark-content { padding: 24px; }
.post-body .kg-bookmark-title {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 48, "wdth" 92;
  font-size: 18px;
  font-weight: 600;
  color: var(--paper);
  letter-spacing: -0.02em;
}
.post-body .kg-bookmark-description {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--paper-dim);
  margin-top: 6px;
}
.post-body .kg-bookmark-metadata {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--mute);
  margin-top: 12px;
}
.post-body .kg-bookmark-thumbnail img { width: 200px; height: 100%; object-fit: cover; }

/* ── REVEAL ON SCROLL ───────────────────────────── */

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero-bg { animation: none; }
  .marquee-track { animation: none; }
  .hero-eyebrow, .hero-title, .hero-subtitle { opacity: 1; animation: none; }
}

/* ── NO FEATURE IMAGE ───────────────────────────── */

.post-no-image {
  padding-top: var(--nav-height);
  background: var(--ink);
  position: relative;
}

.post-header-plain {
  padding: clamp(60px, 10vh, 120px) var(--pad-x) 60px;
  max-width: var(--max-w);
  margin: 0 auto;
  border-bottom: 1px solid var(--rule);
}

/* ── RESPONSIVE ─────────────────────────────────── */

@media (max-width: 1024px) {
  .posts-grid { grid-template-columns: repeat(2, 1fr); }
  .posts-grid.featured { grid-template-columns: 1fr; }
  .posts-grid.featured .post-card:first-child { grid-row: auto; grid-column: auto; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-mark { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
  .nav-menu { display: none; }
  .posts-grid { grid-template-columns: 1fr; }
  .section-header { grid-template-columns: 1fr; gap: 12px; }
  .section-header .section-link { justify-self: start; }
  .footer-grid { grid-template-columns: 1fr; gap: 40px; }
  .footer-base { flex-direction: column; align-items: flex-start; }
  .post-meta-bar { gap: 16px; }
  body::before { background-size: 80px 80px; }
}
