/* ============================================================
   Rob Ward — Midnight Signal Design System
   robyward.com
   ============================================================ */

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

/* --- Design Tokens --- */
:root {
  /* Colour */
  --void: #0A0A0F;
  --bg: #0D0D12;
  --surface: #161620;
  --surface-hover: #1C1C28;
  --surface-border: rgba(255,255,255,0.06);
  --accent: #2080D4;
  --accent-glow: rgba(32,128,212,0.15);
  --accent-hover: #3D96E8;
  --accent-secondary: #64DFDF;
  --text: #F3F4F6;
  --text-muted: #D1D5DB;
  --text-dim: #7C8493;
  --success: #5EEAA0;
  --error: #FF9090;

  /* Radius */
  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;

  /* Type Scale */
  --text-xs: 0.7rem;     /* monospace labels, badges, footer, status */
  --text-sm: 0.8rem;     /* nav, meta, form labels */
  --text-cta: 0.85rem;   /* CTA links, arrows */
  --text-base: 0.9rem;   /* descriptions, briefs */
  --text-body: 0.95rem;  /* article body, form inputs */
  --text-lg: 1rem;       /* contact subtext */

  /* Spacing Scale */
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 20px;
  --space-lg: 32px;
  --space-xl: 48px;
  --space-section: clamp(64px, 10vh, 120px);
  --space-section-sm: clamp(40px, 6vh, 80px);

  /* Easing */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  /* Linebreak */
  --linebreak: linear-gradient(90deg, transparent 0%, rgba(32,128,212,0.25) 50%, transparent 100%);
}

html { scroll-behavior: auto; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* --- Noise Texture Overlay --- */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 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: 1;
}

/* --- Skip to Content (Accessibility) --- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  background: var(--accent);
  color: #fff;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  z-index: 10000;
  font-size: var(--text-cta);
  text-decoration: none;
}
.skip-link:focus {
  top: 16px;
}

/* --- Container --- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
}

.container--narrow {
  max-width: 740px;
}

.container--mid {
  max-width: 900px;
}

/* --- Section Label --- */
.section-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--text-xs);
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: var(--space-xs);
}

.section-heading {
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: var(--space-lg);
}

/* --- Scroll Reveal Defaults (SEO-safe: only hides when JS active) --- */
.js-animate [data-animate] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s var(--ease),
              transform 0.6s var(--ease);
}

.js-animate [data-animate].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================
   NAVBAR — The Floating Rail
   ============================================================ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  padding: 0 24px;
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease), backdrop-filter 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}

.nav.is-scrolled {
  background: rgba(13, 13, 18, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom-color: transparent;
}

.nav.is-scrolled::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--linebreak);
}

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

.nav__brand {
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--text-base);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s ease;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav__link {
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--text-sm);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease, transform 0.2s ease;
}

.nav__link:hover,
.nav__link.is-active {
  color: var(--text);
}

/* Mobile hamburger */
.nav__toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--text);
}

.nav__toggle svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

/* Mobile overlay */
.nav__overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10,10,15,0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  z-index: 1001;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--ease), visibility 0.3s var(--ease);
}

.nav__overlay.is-open {
  display: flex;
  opacity: 1;
  visibility: visible;
}

.nav__overlay a {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.2rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s;
}

.nav__overlay a:hover {
  color: var(--accent);
}

.nav__close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  z-index: 1001;
  z-index: 1000;
}

.nav__close svg {
  width: 32px;
  height: 32px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

@media (max-width: 768px) {
  .nav__links { display: none; }
  .nav__toggle { display: block; }
}

/* Hide hamburger when overlay is open */
.nav__overlay.is-open ~ .nav .nav__toggle {
  opacity: 0;
  visibility: hidden;
}

/* Alternative approach - hide when body has overlay open */
body:has(.nav__overlay.is-open) .nav__toggle {
  opacity: 0;
  visibility: hidden;
}

/* ============================================================
   HERO — The Opening Shot (Homepage)
   ============================================================ */
.hero {
  position: relative;
  min-height: 100vh;
  height: 100vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  transform: none !important;
  will-change: auto;
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  transform: none !important;
  will-change: auto;
}

.hero__bg img {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
  object-position: center 25%;
  transform: none !important;
  will-change: auto;
  image-rendering: auto;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* Gradient overlay */
.hero__bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, var(--bg) 0%, rgba(13,13,18,0.97) 20%, rgba(10,10,15,0.85) 40%, rgba(10,10,15,0.4) 60%, rgba(10,10,15,0.5) 75%, rgba(10,10,15,0.7) 100%);
  z-index: 1;
}

/* Faint grid pattern */
.hero__grid {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0.035;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 59px, rgba(255,255,255,0.3) 59px, rgba(255,255,255,0.3) 60px),
    repeating-linear-gradient(90deg, transparent, transparent 59px, rgba(255,255,255,0.3) 59px, rgba(255,255,255,0.3) 60px);
  pointer-events: none;
}

.hero__content {
  position: relative;
  z-index: 3;
  padding: 0 clamp(24px, 5vw, 80px) clamp(48px, 8vh, 96px);
  max-width: 800px;
}

@media (max-width: 768px) {
  .hero__content {
    padding: 0 24px 48px;
    max-width: none;
  }
  .hero {
    min-height: 100vh;
    height: auto;
    padding-top: 60px;
  }
}

.hero__name {
  font-size: clamp(3rem, 9vw, 6.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--text);
  margin-bottom: var(--space-sm);
}

.hero__tagline {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(0.8rem, 1.8vw, 1rem);
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: var(--space-md);
}

/* ============================================================
   HERO — Compact (Story, Blog pages)
   ============================================================ */
.hero--compact {
  min-height: auto;
  height: auto;
  padding: 100px 0 clamp(48px, 6vh, 72px);
  display: block;
  text-align: center;
}

.hero--compact .hero__name {
  font-size: clamp(2.2rem, 6vw, 3.5rem);
  margin-bottom: var(--space-sm);
}


.hero--compact .hero__tagline {
  margin-bottom: 0;
}

/* Blog post hero — just the back link, minimal padding */
.hero--minimal {
  padding: 80px 0 var(--space-md);
}

/* Accent glow mesh behind compact hero */
.hero--compact::before {
  content: '';
  position: absolute;
  top: -20%;
  left: 30%;
  width: 60%;
  height: 120%;
  background: radial-gradient(ellipse at center, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}

.hero--compact > * {
  position: relative;
  z-index: 1;
}

/* ============================================================
   ABOUT SECTION — The Statement
   ============================================================ */
.about {
  padding: clamp(40px, 6vh, 80px) 0;
  position: relative;
}

/* Accent glow */
.about::before {
  content: '';
  position: absolute;
  top: 10%;
  right: -10%;
  width: 50%;
  height: 80%;
  background: radial-gradient(ellipse at center, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
  opacity: 0.3;
}

.about__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
}

.about__pullquote {
  font-family: Georgia, 'Times New Roman', serif;
  font-style: italic;
  font-size: clamp(1.3rem, 3vw, 1.6rem);
  line-height: 1.6;
  color: var(--text);
  border-left: 3px solid var(--accent);
  padding-left: 24px;
  margin: 0 0 var(--space-md);
}

.about__pullquote .accent,
.story__pullquote .accent {
  color: var(--accent);
}

.about__text {
  color: var(--text-muted);
  font-size: var(--text-body);
  line-height: 1.85;
  max-width: 640px;
}

.about__text p {
  margin-bottom: var(--space-md);
}

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

.about__text a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

.about__text a:hover {
  color: var(--accent-hover);
}

.about__text strong {
  color: var(--text);
  font-weight: 600;
}

.link-arrow {
  color: var(--accent);
  font-weight: 500;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-cta);
  transition: gap 0.3s var(--ease), color 0.3s;
}

.link-arrow:hover {
  color: var(--accent-hover);
  gap: 10px;
}

/* ============================================================
   LINEBREAK — Subtle section rhythm
   ============================================================ */
.linebreak {
  border: none;
  height: 1px;
  background: var(--linebreak);
  margin: 0;
  border-radius: 1px;
}

/* ============================================================
   FEATURED WORK — Side by Side with Vertical Divider
   ============================================================ */
.work {
  padding: var(--space-section) 0;
}

.work__split {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0;
  margin-top: var(--space-lg);
  align-items: start;
}

.work__vdivider {
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(255,255,255,0.06) 20%, rgba(255,255,255,0.06) 80%, transparent);
  align-self: stretch;
  margin: 0 clamp(24px, 4vw, 56px);
}

.work__item {
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  text-align: center;
  padding: 8px 0;
  transition: opacity 0.4s var(--ease);
}

.work__item:hover {
  opacity: 0.85;
}

.work__item:hover .work__cta {
  gap: 10px;
  color: var(--accent-hover);
}

.work__visual {
  width: 100%;
  max-width: 320px;
  margin: 0 auto 28px;
}

.work__badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin-bottom: var(--space-sm);
  display: inline-block;
}

.work__title {
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  font-weight: 600;
  margin-bottom: var(--space-sm);
  line-height: 1.35;
}

.work__desc {
  color: var(--text-muted);
  font-size: var(--text-cta);
  line-height: 1.7;
  max-width: 380px;
  margin: 0 auto var(--space-md);
}

.work__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-cta);
  font-weight: 500;
  color: var(--accent);
  transition: gap 0.3s var(--ease), color 0.3s;
}

@media (max-width: 768px) {
  .work__split {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .work__vdivider {
    width: auto;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06) 20%, rgba(255,255,255,0.06) 80%, transparent);
    margin: var(--space-lg) 0;
  }
}

/* --- Card Visual: Futures Chart (AI Futures Framework) --- */
.card__futures {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card__futures-chart {
  width: 75%;
  height: 75%;
}

.card__futures-shape {
  transition: all 0.8s ease-in-out;
}

.card__futures-dot {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  animation: futuresPulse 3s ease-in-out infinite;
}

.card__futures-dot:nth-child(2) { animation-delay: 0.4s; }
.card__futures-dot:nth-child(3) { animation-delay: 0.8s; }
.card__futures-dot:nth-child(4) { animation-delay: 1.2s; }
.card__futures-dot:nth-child(5) { animation-delay: 1.6s; }
.card__futures-dot:nth-child(6) { animation-delay: 2.0s; }
.card__futures-dot:nth-child(7) { animation-delay: 2.4s; }
.card__futures-dot:nth-child(8) { animation-delay: 2.8s; }

@keyframes futuresPulse {
  0%, 100% { opacity: 0.4; transform: scale(1); box-shadow: none; }
  50%      { opacity: 1;   transform: scale(1.6); box-shadow: 0 0 8px currentColor; }
}

/* --- Card Visual: Typewriter (DTC Playbook) --- */
.card__typewriter {
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--text-xs);
  color: var(--text-dim);
  line-height: 2;
  text-align: left;
  padding: 16px;
  width: 100%;
}

.card__typewriter-line {
  opacity: 0;
  animation: typewriterFadeIn 0.4s ease forwards;
  white-space: nowrap;
  overflow: hidden;
}

.card__typewriter-cursor {
  display: inline-block;
  width: 6px;
  height: 14px;
  background: var(--accent);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: cursorBlink 0.8s step-end infinite;
}

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

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

/* ============================================================
   LATEST THINKING — Vertical Editorial Layout
   ============================================================ */
.thinking {
  padding: var(--space-section) 0;
  position: relative;
}

.thinking__item {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: clamp(24px, 4vw, 48px);
  align-items: center;
  text-decoration: none;
  color: var(--text);
  padding: clamp(32px, 5vh, 48px) 0;
  transition: opacity 0.4s var(--ease);
}

.thinking__item:hover {
  opacity: 0.85;
}

.thinking__item:hover .thinking__title {
  color: var(--accent);
}

.thinking__item:hover .thinking__cta {
  gap: 10px;
  color: var(--accent-hover);
}

/* Shared animation container — fixed 16:9 aspect ratio everywhere */
.anim-container {
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  width: 100%;
}

/* Blog hero animations */
.article .anim-container {
  max-width: 320px;
  margin: 0 auto var(--space-lg);
}

.article__hero-visual {
  margin-bottom: var(--space-lg);
}

.thinking__visual {
  width: 280px;
}

.thinking__content {
  display: flex;
  flex-direction: column;
}

.thinking__meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--text-xs);
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-xs);
}

.thinking__title {
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: var(--space-xs);
  transition: color 0.3s var(--ease);
}

.thinking__brief {
  color: var(--text-muted);
  font-size: var(--text-base);
  line-height: 1.7;
  margin-bottom: var(--space-sm);
}

.thinking__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-cta);
  font-weight: 500;
  color: var(--accent);
  transition: gap 0.3s var(--ease), color 0.3s;
}

@media (max-width: 768px) {
  .thinking__item {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .thinking__visual {
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
  }
}

.thinking__footer {
  padding-top: clamp(8px, 2vh, 16px);
  padding-left: calc(280px + clamp(24px, 4vw, 48px));
}

@media (max-width: 768px) {
  .thinking__footer {
    padding-left: 0;
  }
}

.link-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  font-size: var(--text-cta);
  transition: gap 0.2s;
}

.link-cta:hover {
  gap: 12px;
  color: var(--accent-hover);
}

/* --- Card Visual: Scenario Mapper (Blog — AI Futures) --- */
.card__scenario {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card__scenario-grid {
  width: 80%;
  height: 80%;
}

.card__scenario-dot {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  animation: scenarioPulse 3s ease-in-out infinite;
}

.card__scenario-dot--1 { top: 12%; left: 48%; background: var(--accent-secondary); animation-delay: 0s; }
.card__scenario-dot--2 { top: 22%; right: 15%; background: #ff6b6b; animation-delay: 0.4s; }
.card__scenario-dot--3 { top: 55%; right: 8%; background: #ff9090; animation-delay: 0.8s; }
.card__scenario-dot--4 { bottom: 12%; right: 22%; background: var(--accent-secondary); animation-delay: 1.2s; }
.card__scenario-dot--5 { bottom: 10%; left: 25%; background: var(--accent-secondary); animation-delay: 1.6s; }
.card__scenario-dot--6 { top: 50%; left: 8%; background: #9acd32; animation-delay: 2.0s; }
.card__scenario-dot--7 { top: 22%; left: 18%; background: #ff6b6b; animation-delay: 2.4s; }

@keyframes scenarioPulse {
  0%, 100% { opacity: 0.4; transform: scale(1); box-shadow: none; }
  50%      { opacity: 1;   transform: scale(1.5); box-shadow: 0 0 6px currentColor; }
}

/* --- Card Visual: Signal Bars (AI Futures blog post) --- */
.card__signal {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.card__signal-bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 70%;
  padding: 0 24px;
}

.card__signal-bar {
  width: 12px;
  border-radius: 2px 2px 0 0;
  opacity: 0.7;
  animation: signalRand 3s ease-in-out infinite alternate;
}

.card__signal-bar:nth-child(1) { animation-delay: 0s;   animation-duration: 2.4s; }
.card__signal-bar:nth-child(2) { animation-delay: 0.7s; animation-duration: 3.1s; }
.card__signal-bar:nth-child(3) { animation-delay: 0.2s; animation-duration: 2.8s; }
.card__signal-bar:nth-child(4) { animation-delay: 1.1s; animation-duration: 3.5s; }
.card__signal-bar:nth-child(5) { animation-delay: 0.5s; animation-duration: 2.6s; }
.card__signal-bar:nth-child(6) { animation-delay: 1.4s; animation-duration: 3.2s; }
.card__signal-bar:nth-child(7) { animation-delay: 0.3s; animation-duration: 2.9s; }

@keyframes signalRand {
  0%   { height: 25%; opacity: 0.5; }
  25%  { height: 70%; opacity: 0.9; }
  50%  { height: 40%; opacity: 0.6; }
  75%  { height: 85%; opacity: 1; }
  100% { height: 35%; opacity: 0.7; }
}

/* --- Card Visual: Archetype Typewriter (13 Futures blog) --- */
.card__archetype-tw {
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--text-cta);
  font-weight: 500;
  line-height: 2;
  text-align: center;
  padding: 16px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  overflow: hidden;
}

.card__archetype-tw-line {
  opacity: 0;
  white-space: nowrap;
  overflow: hidden;
}

.card__archetype-tw-cursor {
  display: inline-block;
  width: 6px;
  height: 13px;
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: cursorBlink 0.8s step-end infinite;
}

/* ============================================================
   PHILOSOPHY — The Lens
   ============================================================ */
.philosophy {
  padding: clamp(80px, 12vh, 140px) 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.philosophy::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80%;
  height: 100%;
  background: radial-gradient(ellipse at center, var(--accent-glow) 0%, transparent 60%);
  pointer-events: none;
  opacity: 0.3;
}

.philosophy__small {
  font-size: clamp(0.9rem, 2vw, 1.15rem);
  color: var(--text-dim);
  margin-bottom: var(--space-sm);
  position: relative;
}

.philosophy__big {
  font-family: Georgia, 'Times New Roman', serif;
  font-style: italic;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
  position: relative;
}

.philosophy__big .accent {
  color: var(--accent);
}

/* ============================================================
   CONTACT — The Signal
   ============================================================ */
.contact {
  padding: var(--space-section) 0;
}

.contact__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}

.contact__heading {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-sm);
}

.contact__subtext {
  color: var(--text-muted);
  font-size: var(--text-lg);
  line-height: 1.7;
  margin-bottom: var(--space-lg);
}

/* Social links */
.socials {
  display: flex;
  gap: 24px;
}

.socials a {
  color: var(--text-dim);
  text-decoration: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--text-xs);
  letter-spacing: 0.05em;
  transition: color 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

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

.socials svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* Form */
.form-group {
  margin-bottom: var(--space-md);
}

.form-group label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: var(--space-xs);
  letter-spacing: 0.02em;
}

.form-group input,
.form-group textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: var(--text-body);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-dim);
}

.form-group textarea {
  min-height: 140px;
  resize: vertical;
}

/* Button — magnetic hover */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Inter', sans-serif;
  font-size: var(--text-body);
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.25s var(--ease),
              box-shadow 0.25s ease;
}

.btn:hover {
  transform: scale(1.03);
}

.btn:active {
  transform: scale(0.97);
}

.btn--primary,
.btn--primary:hover {
  background: var(--accent);
  color: #fff;
  padding: 14px 32px;
  text-decoration: none;
}

.btn--primary:hover {
  box-shadow: 0 4px 20px var(--accent-glow);
}

.btn--primary .btn__bg {
  position: absolute;
  inset: 0;
  background: var(--accent-hover);
  transform: translateX(-101%);
  transition: transform 0.35s var(--ease);
}

.btn--primary:hover .btn__bg {
  transform: translateX(0);
}

.btn__label {
  position: relative;
  z-index: 1;
}

.btn--full {
  width: 100%;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.form-status {
  margin-top: var(--space-sm);
  min-height: 24px;
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--text-sm);
}

.form-status.success { color: var(--success); }
.form-status.error { color: var(--error); }

@media (max-width: 768px) {
  .contact__grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }
}

/* ============================================================
   FOOTER — The Baseline
   ============================================================ */
.footer {
  background: var(--void);
  border-radius: 0;
  padding: clamp(48px, 8vh, 80px) 24px 32px;
  margin-top: 0;
  border-top: none;
  position: relative;
}

.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--linebreak);
}

.footer__inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 32px;
  align-items: start;
}

.footer__brand {
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.footer__brand-tagline {
  font-size: var(--text-xs);
  color: var(--text-dim);
  margin-top: 4px;
  letter-spacing: 0;
  text-transform: none;
}

.footer__nav {
  display: flex;
  gap: 24px;
}

.footer__nav a {
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--text-xs);
  color: var(--text-dim);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: color 0.2s;
}

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

.footer__right {
  text-align: right;
}

.footer__status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--text-xs);
  color: var(--text-dim);
  letter-spacing: 0.05em;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.3s ease;
}

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

.footer__status-label {
  transition: opacity 0.2s ease;
}

.footer__status:hover .footer__status-label {
  display: none;
}

.footer__status-hover {
  display: none;
}

.footer__status:hover .footer__status-hover {
  display: inline;
}

.footer__status-dot {
  width: 6px;
  height: 6px;
  background: var(--success);
  border-radius: 50%;
  animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(94, 234, 160, 0.4); }
  50% { opacity: 0.7; box-shadow: 0 0 0 4px rgba(94, 234, 160, 0); }
}

.footer__bottom {
  max-width: 1100px;
  margin: var(--space-lg) auto 0;
  padding-top: var(--space-md);
  border-top: 1px solid var(--surface-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer__copy {
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--text-xs);
  color: var(--text-dim);
  letter-spacing: 0.05em;
}

.footer__socials {
  display: flex;
  gap: 16px;
}

.footer__socials a {
  color: var(--text-dim);
  transition: color 0.2s;
}

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

.footer__socials svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

@media (max-width: 768px) {
  .footer__inner {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .footer__nav { justify-content: center; }
  .footer__right { text-align: center; }
  .footer__bottom { flex-direction: column; gap: 16px; text-align: center; }
  .footer__socials { justify-content: center; }
}

/* ============================================================
   DIVIDER
   ============================================================ */
.divider {
  border: none;
  height: 1px;
  background: var(--surface-border);
  margin: 0;
}

/* ============================================================
   STORY PAGE
   ============================================================ */
.story {
  padding: clamp(48px, 6vh, 64px) 0 var(--space-section);
}

.story h2 {
  font-size: clamp(1.4rem, 3vw, 1.75rem);
  font-weight: 700;
  margin: clamp(40px, 6vh, 64px) 0 20px;
  color: var(--text);
  line-height: 1.3;
}

.story p {
  font-size: 17px;
  line-height: 1.8;
  margin-bottom: var(--space-md);
  color: var(--text-muted);
}

.story strong {
  color: var(--text);
  font-weight: 600;
}

.story a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

.story a:hover {
  color: var(--accent-hover);
}

/* Timeline marker */
.story__marker {
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--text-xs);
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  display: block;
  margin-bottom: var(--space-xs);
  margin-top: clamp(40px, 6vh, 64px);
}

.story__marker + h2 {
  margin-top: 0;
}

/* Pull quote in story */
.story__pullquote {
  font-family: Georgia, 'Times New Roman', serif;
  font-style: italic;
  font-size: clamp(1.3rem, 3vw, 1.6rem);
  line-height: 1.6;
  color: var(--text);
  border-left: 3px solid var(--accent);
  padding-left: 24px;
  margin: var(--space-xl) 0;
}

/* Back link */
.back-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  text-decoration: none;
  font-size: var(--text-cta);
  transition: color 0.2s;
  justify-content: flex-start;
  text-align: left;
}

/* Back link at top of page (story, blog index) */
.hero .back-link {
  margin-bottom: var(--space-md);
}

/* Back link at bottom of article/story */
.article .back-link,
.story .back-link {
  margin-top: var(--space-xl);
}

.back-link:hover {
  color: var(--accent-hover);
}

/* ============================================================
   BLOG INDEX
   ============================================================ */
.blog-grid {
  padding: clamp(16px, 2vh, 24px) 0 var(--space-section);
}

.post-card {
  display: block;
  background: linear-gradient(135deg, rgba(32,128,212,0.06) 0%, transparent 60%);
  border: none;
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 32px;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.4s var(--ease),
              box-shadow 0.4s var(--ease),
              background 0.4s var(--ease);
  margin-bottom: var(--space-md);
}

.post-card:hover {
  background: linear-gradient(135deg, rgba(32,128,212,0.12) 0%, transparent 60%);
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3),
              inset 3px 0 12px -4px rgba(32,128,212,0.3);
}

.post-card__meta {
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted);
  font-size: var(--text-sm);
  letter-spacing: 0.03em;
  margin-bottom: var(--space-sm);
}

.post-card__title {
  font-size: clamp(1.3rem, 3vw, 1.7rem);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: var(--space-sm);
}

.post-card__excerpt {
  color: var(--text-muted);
  font-size: var(--text-body);
  line-height: 1.65;
  margin-bottom: var(--space-sm);
}

.post-card__read {
  color: var(--accent);
  font-weight: 500;
  font-size: var(--text-cta);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: gap 0.2s;
}

.post-card:hover .post-card__read {
  gap: 8px;
}

/* ============================================================
   BLOG POST — Article
   ============================================================ */

/* Reading Progress Bar */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: rgba(32,128,212,0.1);
  z-index: 9999;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.1s ease-out;
}

.reading-progress__bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
  width: 100%;
  transform: scaleX(var(--progress, 0));
  transform-origin: left;
}
.article {
  padding: 0 0 var(--space-section);
  max-width: 720px;
  margin: 0 auto;
}

.article__meta {
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-dim);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-lg);
}

.article h1 {
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-xl);
}

.article__intro {
  font-family: Georgia, 'Times New Roman', serif;
  font-style: italic;
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: var(--space-lg);
  border-left: 3px solid var(--accent);
  padding-left: 20px;
}

.article h2 {
  font-size: clamp(1.3rem, 3vw, 1.6rem);
  font-weight: 700;
  margin-top: var(--space-xl);
  margin-bottom: var(--space-md);
  line-height: 1.3;
}

.article p {
  font-size: 17px;
  line-height: 1.8;
  margin-bottom: var(--space-md);
  color: var(--text);
}

@media (max-width: 768px) {
  .article {
    padding: clamp(12px, 2vh, 20px) 0 clamp(48px, 8vh, 80px);
  }
  .hero--compact {
    padding: 64px 0 12px;
  }
  .article p {
    font-size: 16px;
    line-height: 1.75;
    margin-bottom: var(--space-sm);
  }
}

.article strong {
  font-weight: 600;
}

.article a:not(.btn) {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

.article a:not(.btn):hover {
  color: var(--accent-hover);
}

/* Article figure */
.article__figure {
  margin: var(--space-lg) 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--surface-border);
}

.article__figure img {
  width: 100%;
  height: auto;
  display: block;
}

/* Highlight box */
.highlight-box {
  background: linear-gradient(90deg, var(--surface) 0%, rgba(22, 22, 32, 0.5) 50%, transparent 100%);
  border-left: 3px solid var(--accent);
  padding: 24px 28px;
  margin: var(--space-lg) 0;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.highlight-box p {
  margin-bottom: 0;
  color: var(--text-muted);
  font-size: var(--text-body);
}

.highlight-box strong {
  color: var(--text);
}

/* CTA box */
.cta-box {
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 40px;
  margin: var(--space-xl) 0;
  text-align: center;
}

.cta-box h3 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

.cta-box p {
  color: var(--text-muted);
  margin-bottom: var(--space-md);
  font-size: var(--text-body);
}

.cta-box .btn {
  text-decoration: none;
  color: #fff;
}

/* Tags */
.article__tags {
  display: flex;
  gap: 8px;
  margin-top: var(--space-xl);
  padding-top: 24px;
  border-top: 1px solid var(--surface-border);
}

.tag {
  background: var(--surface);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: var(--text-sm);
  font-weight: 500;
}

/* ============================================================
   UTILITY
   ============================================================ */
.text-accent { color: var(--accent); }
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}
