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

/* === FONTS (Inter + JetBrains Mono as figmaSans/figmaMono substitutes) === */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;320;330;340;400;450;480;540;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400&display=swap');

:root {
  /* Colors */
  --primary: #000000;
  --on-primary: #ffffff;
  --ink: #000000;
  --canvas: #ffffff;
  --inverse-canvas: #000000;
  --inverse-ink: #ffffff;
  --hairline: #e6e6e6;
  --hairline-soft: #f1f1f1;
  --surface-soft: #f7f7f5;
  --block-lime: #dceeb1;
  --block-lilac: #c5b0f4;
  --block-cream: #f4ecd6;
  --block-pink: #efd4d4;
  --block-mint: #c8e6cd;
  --block-coral: #f3c9b6;
  --block-navy: #1f1d3d;

  /* Spacing */
  --hair: 1px;
  --xxs: 4px;
  --xs: 8px;
  --sm: 12px;
  --md: 16px;
  --lg: 24px;
  --xl: 32px;
  --xxl: 48px;
  --section: 96px;

  /* Radius */
  --rounded-xs: 2px;
  --rounded-sm: 6px;
  --rounded-md: 8px;
  --rounded-lg: 24px;
  --rounded-xl: 32px;
  --rounded-pill: 50px;
  --rounded-full: 9999px;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--canvas);
  color: var(--ink);
  font-size: 18px;
  font-weight: 320;
  line-height: 1.45;
  letter-spacing: -0.26px;
  -webkit-font-smoothing: antialiased;
}

/* === TYPOGRAPHY === */
.display-xl {
  font-size: clamp(48px, 8vw, 86px);
  font-weight: 340;
  line-height: 1.00;
  letter-spacing: -1.72px;
}
.display-lg {
  font-size: clamp(36px, 5vw, 64px);
  font-weight: 340;
  line-height: 1.10;
  letter-spacing: -0.96px;
}
.headline {
  font-size: 26px;
  font-weight: 540;
  line-height: 1.35;
  letter-spacing: -0.26px;
}
.subhead {
  font-size: 26px;
  font-weight: 340;
  line-height: 1.35;
  letter-spacing: -0.26px;
}
.body-lg {
  font-size: 20px;
  font-weight: 330;
  line-height: 1.40;
  letter-spacing: -0.14px;
}
.body { font-size: 18px; font-weight: 320; line-height: 1.45; letter-spacing: -0.26px; }
.body-sm { font-size: 16px; font-weight: 330; line-height: 1.45; letter-spacing: -0.14px; }
.eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.30;
  letter-spacing: 0.54px;
  text-transform: uppercase;
}
.caption {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.00;
  letter-spacing: 0.60px;
  text-transform: uppercase;
}

/* === LAYOUT === */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--xxl);
}
@media (max-width: 768px) {
  .container { padding: 0 var(--lg); }
}

/* === TOP BAR === */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--md) var(--lg);
}
.topbar__title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
  text-decoration: none;
  color: var(--ink);
}
.topbar__link {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.4px;
  color: var(--ink);
  text-decoration: none;
  opacity: 0.6;
  transition: opacity 0.2s;
}
.topbar__link:hover {
  opacity: 1;
}

/* === BUTTONS === */
.btn-primary {
  display: inline-flex;
  align-items: center;
  background: var(--primary);
  color: var(--on-primary);
  font-size: 20px;
  font-weight: 480;
  line-height: 1.40;
  letter-spacing: -0.10px;
  border-radius: var(--rounded-pill);
  padding: 10px 20px;
  border: none;
  cursor: pointer;
  text-decoration: none;
}
.btn-secondary {
  display: inline-flex;
  align-items: center;
  background: var(--canvas);
  color: var(--ink);
  font-size: 20px;
  font-weight: 480;
  line-height: 1.40;
  letter-spacing: -0.10px;
  border-radius: var(--rounded-pill);
  padding: 8px 18px 10px;
  border: var(--hair) solid var(--hairline);
  cursor: pointer;
  text-decoration: none;
}

/* === HERO === */
.hero {
  padding: var(--section) 0;
  text-align: center;
}
.hero .display-xl { max-width: 900px; margin: 0 auto var(--lg); }
.hero .body-lg { max-width: 640px; margin: 0 auto var(--xl); }

/* === MARQUEE === */
.marquee-strip {
  background: var(--inverse-canvas);
  color: var(--inverse-ink);
  height: 36px;
  display: flex;
  align-items: center;
  overflow: hidden;
  white-space: nowrap;
}
.marquee-inner {
  display: flex;
  animation: marquee 60s linear infinite;
  gap: var(--xxl);
}
.marquee-inner span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  opacity: 0.7;
}
@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* === COLOR BLOCK SECTIONS === */
.color-block {
  border-radius: var(--rounded-lg);
  padding: var(--xxl);
  margin: var(--section) 0;
}
.color-block.lime { background: var(--block-lime); }
.color-block.lilac { background: var(--block-lilac); }
.color-block.cream { background: var(--block-cream); }
.color-block.pink { background: var(--block-pink); }
.color-block.mint { background: var(--block-mint); }
.color-block.coral { background: var(--block-coral); }
.color-block.navy { background: var(--block-navy); color: var(--inverse-ink); }

@media (max-width: 768px) {
  .color-block { border-radius: 0; margin-left: calc(-1 * var(--lg)); margin-right: calc(-1 * var(--lg)); padding: var(--xl) var(--lg); }
}

/* === MATERIAL CLUSTER HEADER === */
.cluster-header {
  padding: var(--xxl) 0 var(--lg);
}
.cluster-header .eyebrow { margin-bottom: var(--xs); }

/* === TIMELINE === */
.timeline {
  position: relative;
  padding-left: 40px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 0;
  bottom: 0;
  width: var(--hair);
  background: var(--hairline);
}
.timeline-entry {
  position: relative;
  margin-bottom: var(--xxl);
  padding-bottom: var(--xxl);
  border-bottom: var(--hair) solid var(--hairline-soft);
}
.timeline-entry:last-child { border-bottom: none; }
.timeline-entry::before {
  content: '';
  position: absolute;
  left: -33px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: var(--rounded-full);
  background: var(--ink);
  border: 2px solid var(--canvas);
}
.navy .timeline-entry::before { border-color: var(--block-navy); }
.lilac .timeline-entry::before { border-color: var(--block-lilac); }
.cream .timeline-entry::before { border-color: var(--block-cream); }
.mint .timeline-entry::before { border-color: var(--block-mint); }
.pink .timeline-entry::before { border-color: var(--block-pink); }
.coral .timeline-entry::before { border-color: var(--block-coral); }
.lime .timeline-entry::before { border-color: var(--block-lime); }

.entry-year {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  margin-bottom: var(--xxs);
}
.entry-title {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.45;
  margin-bottom: var(--xs);
}
.entry-designer {
  font-size: 20px;
  font-weight: 480;
  line-height: 1.40;
  letter-spacing: -0.10px;
  margin-bottom: var(--sm);
}
.entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--xs);
  margin-bottom: var(--md);
}
.entry-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: var(--xxs) var(--xs);
  border-radius: var(--rounded-pill);
  background: rgba(0,0,0,0.06);
}
.navy .entry-tag { background: rgba(255,255,255,0.12); }

.entry-description {
  font-size: 18px;
  font-weight: 320;
  line-height: 1.45;
  letter-spacing: -0.26px;
  max-width: 720px;
  margin-bottom: var(--lg);
}

/* === IMAGE GRID === */
.entry-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--sm);
}
.entry-images figure {
  border-radius: var(--rounded-md);
  overflow: hidden;
  background: var(--surface-soft);
  position: relative;
}
.navy .entry-images figure { background: rgba(255,255,255,0.08); }
.entry-images img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}
.entry-images figure:hover img { transform: scale(1.03); }
.entry-images figcaption {
  padding: var(--xs) var(--sm);
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.4px;
}

/* Diagram placeholder */
.diagram-placeholder {
  width: 100%;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-soft);
  border-radius: var(--rounded-md);
  border: var(--hair) dashed var(--hairline);
}
.navy .diagram-placeholder { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.15); }
.diagram-placeholder span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  opacity: 0.4;
}

/* === FILTER PILLS === */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--xs);
  padding: var(--lg) 0;
  position: sticky;
  top: 56px;
  z-index: 90;
  background: var(--canvas);
}
.filter-pill {
  font-size: 16px;
  font-weight: 480;
  letter-spacing: -0.10px;
  padding: 8px 18px;
  border-radius: var(--rounded-pill);
  border: none;
  cursor: pointer;
  background: var(--canvas);
  color: var(--ink);
  border: var(--hair) solid var(--hairline);
  transition: all 0.15s ease;
}
.filter-pill:hover { background: var(--surface-soft); }
.filter-pill.active {
  background: var(--primary);
  color: var(--on-primary);
  border-color: var(--primary);
}

/* === FOOTER === */
.site-footer {
  background: var(--canvas);
  padding: 64px 32px;
  border-top: var(--hair) solid var(--hairline);
  text-align: center;
}
.site-footer .caption { margin-bottom: var(--sm); }
.footer-links {
  display: flex;
  justify-content: center;
  gap: var(--lg);
  flex-wrap: wrap;
  list-style: none;
}
.footer-links a {
  font-size: 16px;
  font-weight: 330;
  color: var(--ink);
  text-decoration: none;
}
.footer-links a:hover { text-decoration: underline; }

/* === SECTION SPACER === */
.section-spacer { height: var(--section); }

/* === SCROLL BEHAVIOR === */
html { scroll-behavior: smooth; }

/* === LIGHTBOX === */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.lightbox-overlay.active {
  opacity: 1;
  visibility: visible;
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: none;
  border: none;
  color: #fff;
  font-size: 32px;
  cursor: pointer;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--rounded-full);
  transition: background 0.15s ease;
}
.lightbox-close:hover { background: rgba(255,255,255,0.1); }
.lightbox-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--rounded-full);
  transition: background 0.15s ease;
}
.lightbox-arrow:hover { background: rgba(255,255,255,0.1); }
.lightbox-arrow:disabled { opacity: 0.2; cursor: default; }
.lightbox-arrow:disabled:hover { background: none; }
.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }
.lightbox-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: calc(100vw - 160px);
  max-height: calc(100vh - 120px);
}
.lightbox-img {
  max-width: 100%;
  max-height: calc(100vh - 200px);
  object-fit: contain;
  border-radius: var(--rounded-md);
}
.lightbox-info {
  margin-top: var(--md);
  text-align: center;
  color: #fff;
}
.lightbox-info-title {
  font-size: 20px;
  font-weight: 540;
  margin-bottom: var(--xxs);
}
.lightbox-info-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  opacity: 0.6;
}
.lightbox-info-caption {
  font-size: 14px;
  font-weight: 330;
  opacity: 0.7;
  margin-top: var(--xxs);
}
.entry-images figure { cursor: pointer; }
@media (max-width: 768px) {
  .lightbox-content { max-width: calc(100vw - 32px); }
  .lightbox-prev { left: 4px; }
  .lightbox-next { right: 4px; }
}

/* Image error fallback */
.entry-images img[data-fallback]::after {
  content: attr(alt);
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  inset: 0;
  background: var(--surface-soft);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.5;
}
