:root {
  --bg: #0b0d0c;
  --bg-raised: #121614;
  --fg: #e8e8e8;
  --muted: #9aa39a;
  --lime: #bef264;
  --spark: #7dd3fc;
  --violet: #a78bfa;
  --border: #223026;
  --max-w: 72rem;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
}

#spark-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.55;
}

.topbar, main, footer { position: relative; z-index: 1; }

.topbar {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: rgba(11, 13, 12, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  z-index: 10;
}

.wordmark {
  color: var(--fg);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}
.wordmark .dot { color: var(--lime); }

.nav { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}
.nav a:hover { color: var(--lime); }

.hero {
  min-height: 92vh;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: clamp(2rem, 5vw, 4rem);
  padding: 2rem clamp(1.5rem, 6vw, 6rem);
  position: relative;
  overflow: hidden;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.hero-portrait {
  flex: 0 0 auto;
  margin: 0;
  position: relative;
  z-index: 1;
}
.hero-portrait img {
  display: block;
  width: clamp(220px, 26vw, 360px);
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(190, 242, 100, 0.25);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(190, 242, 100, 0.12);
}
.hero-portrait figcaption {
  margin-top: 0.6rem;
  color: var(--muted);
  font-family: ui-monospace, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-align: right;
}

@media (max-width: 760px) {
  .hero {
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
  }
  .hero-portrait {
    order: -1;
    align-self: center;
  }
  .hero-portrait figcaption {
    text-align: center;
  }
}

.hero-glow {
  position: absolute;
  top: 50%;
  left: 70%;
  width: 60vw;
  height: 60vw;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(190, 242, 100, 0.12), transparent 60%);
  pointer-events: none;
}

.eyebrow {
  color: var(--spark);
  font-family: ui-monospace, monospace;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 1rem;
}

.hero h1 {
  font-size: clamp(2.2rem, 6vw, 4.2rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  max-width: 40rem;
  margin: 0 0 1.2rem;
}
.hero h1 .glow {
  color: var(--lime);
  text-shadow: 0 0 24px rgba(190, 242, 100, 0.5);
}

.lede {
  color: var(--muted);
  max-width: 34rem;
  font-size: 1.1rem;
  margin: 0 0 2rem;
}

.cta {
  display: inline-block;
  color: var(--bg);
  background: var(--lime);
  padding: 0.8rem 1.6rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  transition: transform 0.15s, box-shadow 0.15s;
}
.cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(190, 242, 100, 0.25);
}

.section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 6rem 1.5rem;
  border-top: 1px solid var(--border);
}

.section h2 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  margin: 0 0 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.tag {
  font-family: ui-monospace, monospace;
  font-size: 0.85rem;
  color: var(--bg);
  background: var(--lime);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.section-intro {
  color: var(--muted);
  max-width: 40rem;
  margin: 0 0 3rem;
}

/* Timeline */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 2px solid var(--border);
}

.timeline li {
  position: relative;
  padding: 0 0 2.5rem 2rem;
}
.timeline li::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 0.35rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 10px rgba(190, 242, 100, 0.7);
}

.timeline .year {
  display: block;
  font-family: ui-monospace, monospace;
  color: var(--spark);
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
}

.timeline h3 { margin: 0 0 0.4rem; font-size: 1.15rem; }
.timeline p { margin: 0; color: var(--muted); max-width: 40rem; }

/* Gallery */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--lime);
}

.card img {
  width: 100%;
  height: 170px;
  object-fit: cover;
  display: block;
}

.card-body { padding: 1.2rem; position: relative; }
.card-body.no-img { padding-top: 1.4rem; }

.card-body h3 { margin: 0 0 0.5rem; font-size: 1.05rem; }
.card-body p { margin: 0 0 1.2rem; color: var(--muted); font-size: 0.92rem; }

.year-badge {
  font-family: ui-monospace, monospace;
  font-size: 0.75rem;
  color: var(--lime);
  border: 1px solid var(--border);
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
}

/* Patents */
.patent-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.patent {
  display: grid;
  grid-template-columns: 8rem 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 0.9rem 1.1rem;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  color: var(--fg);
  transition: border-color 0.2s;
}
.patent:hover { border-color: var(--spark); }

.patent-no { font-family: ui-monospace, monospace; color: var(--spark); font-size: 0.85rem; }
.patent-title { font-size: 0.95rem; }
.patent-year { color: var(--muted); font-size: 0.85rem; font-family: ui-monospace, monospace; }

@media (max-width: 640px) {
  .patent { grid-template-columns: 1fr; gap: 0.3rem; }
}

/* Quotes */
.quote {
  border-left: 3px solid var(--lime);
  padding: 0.2rem 0 0.2rem 1.5rem;
  margin: 0 0 2rem;
  font-size: 1.15rem;
  font-style: italic;
  max-width: 42rem;
}
.quote cite {
  display: block;
  margin-top: 0.6rem;
  font-style: normal;
  font-size: 0.85rem;
  color: var(--muted);
}

.disputed-note {
  font-size: 0.85rem;
  color: var(--muted);
  max-width: 42rem;
  border: 1px dashed var(--border);
  padding: 1rem;
  border-radius: 8px;
  margin: 1rem 0 2.5rem;
}

.reading-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.reading-list a {
  color: var(--spark);
  text-decoration: none;
  font-size: 0.95rem;
}
.reading-list a:hover { text-decoration: underline; }

/* Legacy */
.legacy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
}
.legacy-item {
  padding: 1.4rem;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.legacy-item h3 { margin: 0 0 0.5rem; font-size: 1rem; color: var(--lime); }
.legacy-item p { margin: 0; color: var(--muted); font-size: 0.9rem; }

/* Sources */
.source-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.7rem;
}
.source-grid a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: color 0.2s, border-color 0.2s;
}
.source-grid a:hover { color: var(--spark); border-color: var(--spark); }

.site-footer {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
}
