@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=Inter:ital,wght@0,300;0,400;0,500;1,400&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Tokens ──────────────────────────────────── */

:root {
  --bg:          #08080e;
  --surface:     #0c0c18;
  --surface-2:   #111124;
  --border:      #1a1a32;
  --text:        #deded8;
  --text-muted:  #68687e;
  --accent:      #005ce6;
  --accent-soft: rgba(0, 92, 230, 0.1);
  --accent-glow: rgba(0, 92, 230, 0.25);

  --font-display: 'Space Grotesk', sans-serif;
  --font-body:    'Inter', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;

  --nav-height: 60px;
  --max-width:  900px;
  --px:         2rem;
}

/* ── Reset ───────────────────────────────────── */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.75;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Subtle cobalt grid */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 92, 230, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 92, 230, 0.04) 1px, transparent 1px);
  background-size: 72px 72px;
  pointer-events: none;
  z-index: 0;
}

/* CRT scanlines */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(0, 0, 0, 0.03) 3px,
    rgba(0, 0, 0, 0.03) 4px
  );
  pointer-events: none;
  z-index: 9999;
}

/* ── Selection & scrollbar ───────────────────── */

::selection {
  background: var(--accent-soft);
  color: var(--text);
}

::-webkit-scrollbar        { width: 6px; }
::-webkit-scrollbar-track  { background: var(--bg); }
::-webkit-scrollbar-thumb  { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ── Animations ──────────────────────────────── */

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

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

/* ── Navigation ──────────────────────────────── */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--px);
  background: rgba(8, 8, 14, 0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

.brand {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text);
}

.brand em {
  color: var(--accent);
  font-style: normal;
}

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

.site-nav a {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text-muted);
  transition: color 0.15s;
  position: relative;
  padding-bottom: 3px;
}

/* // prefix on active page */
.site-nav a[aria-current]::before {
  content: '//';
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--accent);
  margin-right: 0.35em;
  letter-spacing: -0.05em;
  opacity: 0.9;
}

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

.site-nav a:hover,
.site-nav a[aria-current] {
  color: var(--text);
}

.site-nav a:hover::after,
.site-nav a[aria-current]::after {
  width: 100%;
}

/* ── Layout ──────────────────────────────────── */

main {
  padding-top: var(--nav-height);
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ── Home / Hero ─────────────────────────────── */

.hero {
  min-height: calc(100vh - var(--nav-height));
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 5rem var(--px);
  max-width: var(--max-width);
  margin: 0 auto;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.5rem;
  animation: fadeUp 0.6s ease both;
  animation-delay: 0.1s;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 13vw, 8.5rem);
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 1.5rem;
  text-shadow:
    0 0 40px rgba(0, 92, 230, 0.18),
    0 0 100px rgba(0, 92, 230, 0.07);
  animation: fadeUp 0.7s ease both;
  animation-delay: 0.25s;
}

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

.hero-sub {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  margin-bottom: 3.5rem;
  animation: fadeUp 0.6s ease both;
  animation-delay: 0.45s;
}

/* ── Section cards ───────────────────────────── */

.section-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  max-width: 520px;
  border: 1px solid var(--border);
  animation: fadeUp 0.6s ease both;
  animation-delay: 0.6s;
}

.section-card {
  display: block;
  padding: 1.5rem 1.75rem;
  background: var(--surface);
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s;
  position: relative;
}

.section-card + .section-card {
  border-left: 1px solid var(--border);
}

/* Targeting bracket — top-left */
.section-card::before {
  content: '';
  position: absolute;
  top: 10px;
  left: 10px;
  width: 12px;
  height: 12px;
  border-top: 1.5px solid var(--accent);
  border-left: 1.5px solid var(--accent);
  opacity: 0;
  transform: translate(4px, 4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Targeting bracket — bottom-right */
.section-card::after {
  content: '';
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 12px;
  height: 12px;
  border-bottom: 1.5px solid var(--accent);
  border-right: 1.5px solid var(--accent);
  opacity: 0;
  transform: translate(-4px, -4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.section-card:hover {
  background: var(--surface-2);
}

.section-card:hover::before,
.section-card:hover::after {
  opacity: 1;
  transform: translate(0, 0);
}

.card-label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.card-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ── Card avatars ────────────────────────────── */

.card-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  margin-bottom: 1.25rem;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
  flex-shrink: 0;
}

.card-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease, filter 0.3s ease;
}

.card-avatar-mono {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--accent);
  user-select: none;
}

/* Chris — solid ring, scales up on hover */
.section-card--chris .card-avatar {
  border: 2px solid rgba(0, 92, 230, 0.55);
}

.section-card--chris:hover .card-avatar {
  box-shadow: 0 0 0 3px var(--accent), 0 0 22px rgba(0, 92, 230, 0.4);
  transform: scale(1.05);
}

/* Iffo — dashed ring, scanline texture */
.section-card--iffo .card-avatar {
  border: 2px dashed rgba(0, 92, 230, 0.55);
  background-image: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(0, 92, 230, 0.07) 3px,
    rgba(0, 92, 230, 0.07) 4px
  );
}

/* Scan line that sweeps top → bottom on hover */
.section-card--iffo .card-avatar::after {
  content: '';
  position: absolute;
  top: -110%;
  left: 0;
  right: 0;
  height: 100%;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(0, 92, 230, 0.22) 50%,
    transparent 100%
  );
  transition: top 0.55s ease;
  pointer-events: none;
}

.section-card--iffo:hover .card-avatar {
  box-shadow: 0 0 0 3px var(--accent), 0 0 22px rgba(0, 92, 230, 0.4);
}

.section-card--iffo:hover .card-avatar::after {
  top: 110%;
}

/* ── Timeline ────────────────────────────────── */

.timeline-section {
  padding: 3rem var(--px) 6rem;
  animation: fadeUp 0.6s ease both;
  animation-delay: 0.45s;
}

.timeline {
  position: relative;
  max-width: 1040px;
  margin: 0 auto;
  padding: 1rem 0 2rem;
}

/* Vertical spine */
.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  transform: translateX(-0.5px);
  background: linear-gradient(
    to bottom,
    transparent,
    var(--border) 3%,
    var(--border) 97%,
    transparent
  );
}

/* Entry row — 3-column grid */
.tl-entry {
  display: grid;
  grid-template-columns: 1fr 60px 1fr;
  margin-bottom: 2.5rem;
  align-items: start;
}

/* Centre dot */
.tl-node {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  justify-content: center;
  padding-top: 1.3rem;
  position: relative;
  z-index: 2;
}

.tl-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bg);
  border: 1.5px solid rgba(0, 92, 230, 0.55);
  box-shadow: 0 0 0 3px rgba(0, 92, 230, 0.07);
  flex-shrink: 0;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.tl-entry:hover .tl-dot {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(0, 92, 230, 0.18), 0 0 14px rgba(0, 92, 230, 0.4);
}

/* Card */
.tl-card {
  display: block;
  position: relative;
  text-decoration: none;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 1.25rem 1.5rem;
  transition: border-color 0.2s, background 0.2s;
}

.tl-entry:hover .tl-card {
  border-color: rgba(0, 92, 230, 0.35);
  background: var(--surface-2);
}

/* Left entries */
.tl-left .tl-card {
  grid-column: 1;
  grid-row: 1;
}

.tl-left .tl-card::after {
  content: '';
  position: absolute;
  top: 1.5rem;
  right: -30px;
  width: 30px;
  height: 1px;
  background: var(--border);
  transition: background 0.2s;
}

.tl-entry.tl-left:hover .tl-card::after {
  background: rgba(0, 92, 230, 0.35);
}

/* Right entries */
.tl-right .tl-card {
  grid-column: 3;
  grid-row: 1;
}

.tl-right .tl-card::before {
  content: '';
  position: absolute;
  top: 1.5rem;
  left: -30px;
  width: 30px;
  height: 1px;
  background: var(--border);
  transition: background 0.2s;
}

.tl-entry.tl-right:hover .tl-card::before {
  background: rgba(0, 92, 230, 0.35);
}

/* Card content */
.tl-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.tl-year {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  color: var(--accent);
  text-transform: uppercase;
}

.tl-location {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.tl-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.4rem;
  line-height: 1.3;
}

.tl-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Tag chips on card */
.tl-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.75rem;
}

.tl-tag {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 0.15em 0.5em;
  transition: border-color 0.15s, color 0.15s;
}

.tl-entry:hover .tl-tag {
  border-color: rgba(0, 92, 230, 0.3);
}

/* Filter bar */
.tl-filters {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
  max-width: 1040px;
  margin-left: auto;
  margin-right: auto;
}

.tl-filter-label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  flex-shrink: 0;
}

.tl-filter-tags {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.tl-filter-btn {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.3em 0.8em;
  cursor: pointer;
  border-radius: 0;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.tl-filter-btn:hover {
  border-color: rgba(0, 92, 230, 0.5);
  color: var(--text);
}

.tl-filter-btn.is-active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(0, 92, 230, 0.1);
}

/* Hidden entries — fade + collapse */
.tl-entry {
  transition: opacity 0.25s ease, max-height 0.35s ease, margin-bottom 0.3s ease;
  max-height: 800px;
  overflow: hidden;
}

.tl-entry--hidden {
  opacity: 0;
  max-height: 0;
  margin-bottom: 0;
  pointer-events: none;
}

/* Image strip */
.tl-images {
  display: flex;
  gap: 4px;
  margin-top: 0.875rem;
}

.tl-image {
  flex: 1;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 1px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  min-width: 0;
}

.tl-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.tl-entry:hover .tl-image img {
  opacity: 0.9;
}

/* ── Timeline mobile ─────────────────────────── */

@media (max-width: 768px) {
  .timeline::before {
    left: 20px;
    transform: none;
  }

  .tl-entry {
    grid-template-columns: 40px 1fr;
  }

  .tl-node {
    grid-column: 1;
    grid-row: 1;
  }

  .tl-left .tl-card,
  .tl-right .tl-card {
    grid-column: 2;
    grid-row: 1;
  }

  /* Hide desktop connectors */
  .tl-left .tl-card::after,
  .tl-right .tl-card::before {
    display: none;
  }

  /* Single mobile connector — node to card */
  .tl-node::after {
    content: '';
    position: absolute;
    top: calc(1.3rem + 3px);
    right: 0;
    width: 50%;
    height: 1px;
    background: var(--border);
  }
}

/* ── Inner pages ─────────────────────────────── */

.page-header {
  padding: 5rem var(--px) 3rem;
  max-width: var(--max-width);
  margin: 0 auto;
  border-bottom: 1px solid var(--border);
}

.page-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
  animation: fadeUp 0.5s ease both;
  animation-delay: 0.15s;
}

.page-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 7vw, 4.5rem);
  font-weight: 700;
  line-height: 1.0;
  letter-spacing: -0.02em;
  animation: fadeUp 0.6s ease both;
  animation-delay: 0.3s;
}

.page-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3.5rem var(--px) 6rem;
  animation: fadeUp 0.6s ease both;
  animation-delay: 0.45s;
}

/* ── Prose ───────────────────────────────────── */

.prose {
  max-width: 65ch;
}

.prose p {
  margin-bottom: 1.3rem;
  color: var(--text);
}

.prose h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text);
  margin: 2.5rem 0 0.75rem;
}

.prose h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text);
  margin: 2rem 0 0.5rem;
}

.prose a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: opacity 0.15s;
}

.prose a:hover {
  opacity: 0.75;
}

.prose ul,
.prose ol {
  padding-left: 1.25rem;
  margin-bottom: 1.3rem;
}

.prose li {
  margin-bottom: 0.4rem;
}

.prose code {
  font-family: var(--font-mono);
  font-size: 0.82em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 0.15em 0.45em;
  border-radius: 2px;
  color: var(--accent);
}

.prose blockquote {
  border-left: 2px solid var(--accent);
  padding-left: 1.25rem;
  margin: 1.75rem 0;
  color: var(--text-muted);
  font-style: italic;
}

.prose hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

/* ── Footer ──────────────────────────────────── */

.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  padding: 1.75rem var(--px);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-brand {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.footer-brand em {
  color: var(--accent);
  font-style: normal;
}

.footer-meta {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5em;
}

.footer-status {
  color: var(--accent);
  animation: pulse 2.5s ease-in-out infinite;
  line-height: 1;
}

/* ── Reduced motion ──────────────────────────── */

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

/* ── Responsive ──────────────────────────────── */

@media (max-width: 640px) {
  :root { --px: 1.25rem; }

  .section-cards {
    grid-template-columns: 1fr;
  }

  .section-card + .section-card {
    border-left: none;
    border-top: 1px solid var(--border);
  }

  .site-nav {
    gap: 1.25rem;
  }
}
