/* ─── TOKENS ──────────────────────────────────────────── */
:root {
  --bg:          #F4F7F5;
  --bg-surface:  #FFFFFF;
  --bg-card:     #FFFFFF;
  --bg-card-h:   #F0F9F5;
  --border:      #DDE8E3;
  --border-b:    #B8D4C8;
  --accent:      #00915A;
  --accent-dim:  rgba(0,145,90,.08);
  --accent-glow: rgba(0,145,90,.18);
  --text:        #0D1512;
  --text-2:      #4A6B5C;
  --text-3:      #7A9B8C;

  --font-display: 'Syne', sans-serif;
  --font-mono:    'IBM Plex Mono', monospace;
  --font-body:    'IBM Plex Sans', sans-serif;

  --ease-out:    cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ─── RESET ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }

/* ─── DOT GRID ────────────────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle, #A8C8BB 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: .55;
  pointer-events: none;
  z-index: 0;
}
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  opacity: .5;
  pointer-events: none;
  z-index: 0;
}

/* ─── NAV ──────────────────────────────────────────────── */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 0 40px;
  transition: background .3s var(--ease-out), border-color .3s;
  border-bottom: 1px solid transparent;
}
#navbar.scrolled {
  background: rgba(244,247,245,.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom-color: var(--border);
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  font-family: var(--font-mono);
  font-size: .9rem;
  font-weight: 500;
  letter-spacing: .12em;
  color: var(--accent);
}
.nav-back {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .1em;
  color: var(--text-2);
  transition: color .2s;
}
.nav-back:hover { color: var(--accent); }
.nav-back svg { transition: transform .2s var(--ease-out); }
.nav-back:hover svg { transform: translateX(-3px); }
.nav-links {
  display: flex;
  gap: 28px;
}
.nav-links a {
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .1em;
  color: var(--text-2);
  transition: color .2s;
}
.nav-links a:hover { color: var(--accent); }

/* ─── PROJECT HERO ─────────────────────────────────────── */
.proj-hero {
  position: relative;
  z-index: 1;
  padding: 120px 40px 72px;
  border-bottom: 1px solid var(--border);
}
.proj-hero-inner {
  max-width: 900px;
  margin: 0 auto;
}
.proj-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .1em;
  color: var(--text-3);
  margin-bottom: 24px;
}
.proj-breadcrumb a { color: var(--accent); }
.proj-breadcrumb a:hover { text-decoration: underline; }
.proj-year-tags {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.proj-year {
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .1em;
  color: var(--accent);
}
.proj-tag {
  font-family: var(--font-mono);
  font-size: .62rem;
  padding: 3px 10px;
  border-radius: 2px;
  border: 1px solid var(--border-b);
  color: var(--text-2);
  letter-spacing: .06em;
}
.proj-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: -.025em;
  color: var(--text);
  margin-bottom: 16px;
}
.proj-tagline {
  font-size: 1.1rem;
  color: var(--text-2);
  line-height: 1.65;
  max-width: 680px;
  margin-bottom: 36px;
}
.proj-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #FFFFFF;
  font-family: var(--font-mono);
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .1em;
  padding: 12px 24px;
  border-radius: 3px;
  transition: transform .2s var(--ease-spring), box-shadow .2s;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--accent-glow);
}
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border-b);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: .75rem;
  letter-spacing: .1em;
  padding: 12px 24px;
  border-radius: 3px;
  transition: border-color .2s, color .2s, transform .2s var(--ease-spring);
}
.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

/* ─── CONTENT SECTIONS ─────────────────────────────────── */
.proj-body {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 40px;
  position: relative;
  z-index: 1;
}
.proj-section {
  padding: 64px 0;
  border-bottom: 1px solid var(--border);
}
.proj-section:last-child { border-bottom: none; }
.section-label {
  font-family: var(--font-mono);
  font-size: .65rem;
  letter-spacing: .18em;
  color: var(--accent);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-label::after {
  content: '';
  width: 40px;
  height: 1px;
  background: var(--accent);
}
.proj-section h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.4rem, 3vw, 2rem);
  letter-spacing: -.02em;
  color: var(--text);
  margin-bottom: 20px;
  line-height: 1.15;
}
.proj-section p {
  font-size: 1rem;
  color: var(--text-2);
  line-height: 1.8;
  margin-bottom: 16px;
  max-width: 720px;
}
.proj-section p:last-child { margin-bottom: 0; }
.proj-section p strong { color: var(--text); font-weight: 500; }

/* ─── PIPELINE / ARCHITECTURE ──────────────────────────── */
.pipeline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
  margin: 32px 0;
  padding: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
  overflow-x: auto;
}
.pipeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.pipeline-node {
  background: var(--accent-dim);
  border: 1px solid rgba(0,145,90,.2);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .06em;
  padding: 8px 14px;
  border-radius: 3px;
  text-align: center;
  white-space: nowrap;
}
.pipeline-sub {
  font-family: var(--font-mono);
  font-size: .58rem;
  color: var(--text-3);
  text-align: center;
  max-width: 90px;
  line-height: 1.3;
}
.pipeline-arrow {
  font-family: var(--font-mono);
  color: var(--text-3);
  font-size: 1rem;
  padding: 0 6px;
  flex-shrink: 0;
  line-height: 1;
  margin-top: -18px;
}

/* ─── STACK GRID ────────────────────────────────────────── */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 24px;
}
.stack-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 18px 20px;
  transition: border-color .2s;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.stack-card:hover { border-color: var(--border-b); }
.stack-card-label {
  font-family: var(--font-mono);
  font-size: .6rem;
  letter-spacing: .14em;
  color: var(--accent);
  margin-bottom: 10px;
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-family: var(--font-mono);
  font-size: .64rem;
  color: var(--text-2);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 3px 8px;
}

/* ─── SPEC TABLE ────────────────────────────────────────── */
.spec-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 24px;
  font-size: .9rem;
}
.spec-table th, .spec-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.spec-table th {
  font-family: var(--font-mono);
  font-size: .65rem;
  letter-spacing: .1em;
  color: var(--text-3);
  font-weight: 400;
  background: var(--bg);
}
.spec-table td { color: var(--text-2); }
.spec-table td strong { color: var(--text); font-weight: 500; }
.spec-table tr:last-child td { border-bottom: none; }

/* ─── IMAGE GRID ────────────────────────────────────────── */
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 24px;
}
.image-grid.two-col { grid-template-columns: repeat(2, 1fr); }
.img-card {
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border);
  aspect-ratio: 4/3;
  background: var(--bg-card);
}
.img-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s var(--ease-out), filter .4s;
  filter: grayscale(15%) brightness(.95);
}
.img-card:hover img { transform: scale(1.03); filter: grayscale(0%) brightness(1); }
.img-caption {
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--text-3);
  padding: 8px 12px;
  letter-spacing: .06em;
}

/* ─── HIGHLIGHT BOXES ───────────────────────────────────── */
.highlight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 24px;
}
.highlight-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  padding: 18px 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.highlight-card h3 {
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .1em;
  color: var(--accent);
  margin-bottom: 8px;
}
.highlight-card p {
  font-size: .85rem;
  color: var(--text-2);
  line-height: 1.55;
  margin: 0;
}

/* ─── FOOTER ────────────────────────────────────────────── */
footer {
  position: relative;
  z-index: 1;
  padding: 32px 40px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 40px;
}
.footer-copy {
  font-family: var(--font-mono);
  font-size: .65rem;
  color: var(--text-3);
  letter-spacing: .06em;
}
.footer-copy span { color: var(--accent); }
.footer-nav {
  display: flex;
  gap: 20px;
}
.footer-nav a {
  font-family: var(--font-mono);
  font-size: .65rem;
  letter-spacing: .1em;
  color: var(--text-3);
  transition: color .2s;
}
.footer-nav a:hover { color: var(--accent); }

/* ─── REVEAL ANIMATIONS ─────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .6s var(--ease-out), transform .6s var(--ease-out);
}
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-d1 { transition-delay: .1s; }
.reveal-d2 { transition-delay: .2s; }
.reveal-d3 { transition-delay: .3s; }

/* ─── RESPONSIVE ────────────────────────────────────────── */
@media (max-width: 768px) {
  #navbar { padding: 0 20px; }
  .proj-hero { padding: 96px 20px 48px; }
  .proj-body { padding: 0 20px; }
  .proj-section { padding: 48px 0; }
  .pipeline { padding: 16px; }
  footer { flex-direction: column; gap: 12px; padding: 24px 20px; }
  .image-grid.two-col { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
