:root {
  --navy: #17181B;
  --panel: #1F2124;
  --panel-2: #1C1E21;
  --line: #F2F2F0;
  --line-dim: rgba(242, 242, 240, 0.10);
  --signal: #FF6A39;
  --muted: #9A9A96;
  --white: #F5F5F3;

  --display: "Space Grotesk", "Inter", sans-serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: "IBM Plex Mono", monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

body {
  margin: 0;
  background:
    linear-gradient(var(--line-dim) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-dim) 1px, transparent 1px),
    var(--navy);
  background-size: 48px 48px, 48px 48px, auto;
  color: var(--white);
  font-family: var(--sans);
  line-height: 1.6;
}

a { color: inherit; }

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.01em;
}

main {
  margin-left: 0;
}

/* ---------- Top nav (flat, horizontal) ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.2rem 2.5rem;
  background: var(--panel-2);
  border-bottom: 1px solid var(--line-dim);
}

.brand {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--white);
  flex-shrink: 0;
}

.topnav {
  display: flex;
  gap: 1.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.topnav a {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  transition: color 0.15s ease;
  padding-bottom: 3px;
  border-bottom: 2px solid transparent;
}

.topnav a:hover { color: var(--white); }

.topnav a.active {
  color: var(--white);
  border-bottom-color: var(--signal);
}

.caret {
  display: inline-block;
  font-size: 0.65em;
  margin-left: 0.2rem;
  transition: transform 0.15s ease, color 0.15s ease;
}

.nav-item.open .caret {
  color: var(--signal);
  transform: rotate(180deg);
}

.nav-contact {
  color: var(--signal) !important;
}

.nav-toggle {
  display: none;
}

/* ---------- Page header (subpages) ---------- */

.page-header {
  max-width: 1080px;
  margin: 0 auto;
  padding: 3.5rem 2rem 2.5rem;
  border-bottom: 1px solid var(--line-dim);
}

.page-header h1 {
  font-size: 2.3rem;
  margin: 0.5rem 0 0.75rem;
}

.page-header p {
  color: var(--muted);
  max-width: 60ch;
  margin: 0;
}

/* ---------- Page shell (content + on-this-page TOC) ---------- */

.page-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  gap: 2.5rem;
  align-items: flex-start;
}

.page-toc {
  flex: 0 0 190px;
  position: sticky;
  top: 90px;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding-top: 4.5rem;
}

.page-toc-label {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.page-toc a {
  font-size: 0.82rem;
  color: var(--muted);
  text-decoration: none;
  padding: 0.3rem 0 0.3rem 0.65rem;
  border-left: 2px solid transparent;
  margin-left: -0.65rem;
  transition: color 0.15s ease, border-color 0.15s ease;
  line-height: 1.35;
}

.page-toc a:hover {
  color: var(--white);
  border-left-color: var(--line-dim);
}

.page-toc a.active {
  color: var(--white);
  border-left-color: var(--signal);
}

.page-main {
  flex: 1;
  min-width: 0;
}

.page-main .block,
.page-main .chapter {
  max-width: 100%;
  margin: 0;
}

@media (max-width: 1080px) {
  .page-toc {
    display: none;
  }

  .page-shell {
    display: block;
    padding: 0;
  }

  .page-main .block,
  .page-main .chapter {
    max-width: 1080px;
    margin: 0 auto;
  }
}

/* ---------- Hero (home only) ---------- */

.hero {
  max-width: 1080px;
  margin: 0 auto;
  padding: 4.5rem 2rem 3.5rem;
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 3rem;
  align-items: center;
}

.hero-media {
  position: relative;
}

.hero-media img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  border: 1px solid var(--line-dim);
}

.corner {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 2px solid var(--signal);
}

.corner-tl { top: -8px; left: -8px; border-right: none; border-bottom: none; }
.corner-br { bottom: -8px; right: -8px; border-left: none; border-top: none; }

.hero-tag {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--signal);
  margin: 0 0 0.9rem 0;
}

.hero-content h1 {
  font-size: 3rem;
  margin-bottom: 1.1rem;
}

.hero-bio {
  max-width: 52ch;
  color: var(--muted);
  font-size: 1.02rem;
  margin-bottom: 1.75rem;
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
}

.btn {
  display: inline-block;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.7rem 1.3rem;
  background: var(--signal);
  color: var(--navy);
  transition: background 0.15s ease, transform 0.15s ease;
}

.btn:hover { background: #FF8557; }

.btn-ghost {
  background: transparent;
  color: var(--white);
  border: 1px solid var(--line-dim);
}

.btn-ghost:hover { background: var(--panel); }

/* ---------- Stat strip ---------- */

.stat-strip {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 2rem 3.5rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line-dim);
  border-bottom: 1px solid var(--line-dim);
}

.stat {
  padding: 1.75rem 1.25rem;
  border-left: 1px solid var(--line-dim);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.stat:first-child { border-left: none; }

.stat-num {
  font-family: var(--display);
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--signal);
}

.stat-label {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
}

/* ---------- Section blocks ---------- */

.block {
  max-width: 1080px;
  margin: 0 auto;
  padding: 4.5rem 2rem;
}

.block-panel {
  max-width: none;
  background: var(--panel-2);
  border-top: 1px solid var(--line-dim);
  border-bottom: 1px solid var(--line-dim);
}

.block-panel > * {
  max-width: 1080px;
  margin-left: auto;
  margin-right: auto;
}

.block-head {
  margin-bottom: 2.5rem;
}

.eyebrow-mono {
  display: block;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--signal);
  margin-bottom: 0.6rem;
  letter-spacing: 0.02em;
}

.block-head h2 {
  font-size: 1.9rem;
}

/* Awards */

.award-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line-dim);
  border: 1px solid var(--line-dim);
}

.award-card {
  background: var(--navy);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

a.award-card {
  text-decoration: none;
  transition: background 0.15s ease;
}

a.award-card:hover {
  background: var(--panel);
}

.award-year {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--signal);
}

.award-card h3 {
  font-size: 1.05rem;
}

.award-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Press */

.press-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

.press-card {
  display: block;
  text-decoration: none;
  padding: 1.5rem;
  border: 1px solid var(--line-dim);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.press-card:hover {
  border-color: var(--signal);
  transform: translateY(-2px);
}

.press-source {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.press-card h3 {
  font-size: 1.05rem;
  margin: 0.6rem 0 1rem;
  color: var(--white);
}

.press-link {
  font-size: 0.85rem;
  color: var(--signal);
}

.press-note {
  margin-top: 1.5rem;
  font-size: 0.85rem;
  color: var(--muted);
  font-style: italic;
}

/* Projects */

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.project-card {
  border: 1px solid var(--line-dim);
  overflow: hidden;
}

.project-media {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--panel);
}

.project-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-card h3,
.project-card > .project-year,
.project-card > p {
  margin: 0;
  padding: 0 1.25rem;
}

.project-year {
  display: block;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--signal);
  margin-top: 1.1rem !important;
}

.project-card h3 {
  font-size: 1.05rem;
  margin: 0.5rem 0 0.6rem !important;
}

.project-card p {
  color: var(--muted);
  font-size: 0.9rem;
  padding-bottom: 1.25rem !important;
}

/* Entry list (Robotics, Community) */

.entry-list {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.entry {
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--line-dim);
}

.entry:last-child { border-bottom: none; padding-bottom: 0; }

.entry h3 {
  font-size: 1.1rem;
  margin-bottom: 0.4rem;
}

.entry p {
  margin: 0;
  color: var(--muted);
}

/* Horizontal timeline */

.timeline-h {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.timeline-h-entry {
  border-top: 2px solid var(--signal);
  padding-top: 1rem;
}

.timeline-h-year {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
}

.timeline-h-entry h3 {
  font-size: 1.05rem;
  margin: 0.4rem 0 0.35rem;
}

.timeline-h-entry p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Contact */

.contact-block {
  text-align: center;
  padding-top: 3rem;
  padding-bottom: 3rem;
}

.contact-block h2 {
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
}

.site-footer {
  text-align: center;
  padding: 2rem 2rem 3rem;
}

.site-footer a {
  font-size: 0.85rem;
  color: var(--muted);
  text-decoration: none;
}

.site-footer a:hover { color: var(--white); }

/* ---------- Storytelling chapters ---------- */

.chapter {
  max-width: 1080px;
  margin: 0 auto;
  padding: 4.5rem 2rem;
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 2.5rem;
}

.chapter-panel {
  max-width: none;
  background: var(--panel-2);
  border-top: 1px solid var(--line-dim);
  border-bottom: 1px solid var(--line-dim);
}

.chapter-panel > .chapter-marker,
.chapter-panel > .chapter-body {
  max-width: 1080px;
}

.chapter-panel {
  display: block;
}

.chapter-panel .chapter-inner {
  display: grid;
}

.chapter-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.chapter-num {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--signal);
  border: 1px solid var(--signal);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chapter-line {
  width: 1px;
  flex: 1;
  background: var(--line-dim);
}

.chapter-line-end {
  background: linear-gradient(to bottom, var(--line-dim), transparent);
}

.chapter-body h2 {
  font-size: 1.9rem;
  margin: 0.4rem 0 1.2rem;
}

.chapter-text {
  color: var(--muted);
  max-width: 62ch;
  margin: 0 0 1.1rem;
}

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

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.5rem;
}

.chip {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--white);
  border: 1px solid var(--line-dim);
  padding: 0.45rem 0.8rem;
  white-space: nowrap;
}

.press-inline {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line-dim);
}

.press-inline-label {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--signal);
  margin: 0 0 1.25rem;
}

@media (max-width: 880px) {
  .topnav {
    position: fixed;
    top: 61px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--panel-2);
    border-bottom: 1px solid var(--line-dim);
    transform: translateY(-150%);
    transition: transform 0.2s ease;
    padding: 0.5rem 2rem 1rem;
    max-height: calc(100vh - 61px);
    overflow-y: auto;
  }

  .topnav.open {
    transform: translateY(0);
  }

  .topnav a {
    width: 100%;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--line-dim);
  }

  .nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 34px;
    height: 34px;
    border: 1px solid var(--line-dim);
    background: transparent;
    cursor: pointer;
    align-items: center;
  }

  .nav-toggle span {
    width: 16px;
    height: 2px;
    background: var(--white);
  }
}

/* ---------- Nav dropdowns (hover with delay on desktop, tap on mobile) ---------- */

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
}

.dropdown-panel {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 260px;
  z-index: 60;
}

.dropdown-panel.align-right {
  left: auto;
  right: 0;
}

.dropdown-panel-inner {
  background: var(--panel-2);
  padding: 0.6rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 3px solid var(--signal);
  border-left: 1px solid var(--line-dim);
  border-right: 1px solid var(--line-dim);
  border-bottom: 1px solid var(--line-dim);
  box-shadow: 0 16px 32px rgba(0,0,0,0.4);
}

.nav-item.open .dropdown-panel {
  display: block;
}

a.dropdown-card {
  display: block;
  text-decoration: none;
  padding: 0.6rem 0;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--white);
  border-bottom: 1px solid var(--line-dim);
  transition: color 0.12s ease;
}

a.dropdown-card:last-child {
  border-bottom: none;
}

a.dropdown-card:hover,
a.dropdown-card:focus {
  color: var(--signal);
}

.dropdown-card-sub {
  display: none;
}

@media (max-width: 880px) {
  .nav-item {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
  }

  .dropdown-panel {
    display: none;
    position: static;
    width: 100%;
  }

  .nav-item.open .dropdown-panel {
    display: block;
  }

  .dropdown-panel-inner {
    border-top: none;
    border-left: 2px solid var(--line-dim);
    background: transparent;
    padding: 0.25rem 0 0.5rem 0.75rem;
    margin-left: 0.2rem;
  }

  a.dropdown-card {
    padding: 0.5rem 0;
    font-size: 0.8rem;
  }
}


.year-cards-section {
  max-width: 1080px;
  margin: 0 auto;
  padding: 1rem 2rem 4.5rem;
}

.year-cards-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  background: var(--line-dim);
  border: 1px solid var(--line-dim);
}

.year-card {
  background: var(--navy);
  padding: 1.75rem 1.5rem;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: background 0.15s ease;
}

.year-card:hover {
  background: var(--panel);
}

.year-card-year {
  font-family: var(--display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--signal);
}

.year-card-headline {
  font-size: 0.92rem;
  color: var(--white);
  font-weight: 500;
  line-height: 1.4;
}

.year-card-more {
  margin-top: auto;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
}

@media (max-width: 880px) {
  .year-cards-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Year detail pages ---------- */

.year-nav {
  display: flex;
  justify-content: space-between;
  max-width: 1080px;
  margin: 0 auto;
  padding: 1.5rem 2rem 0;
  font-family: var(--mono);
  font-size: 0.8rem;
}

.year-nav a {
  text-decoration: none;
  color: var(--muted);
}

.year-nav a:hover { color: var(--signal); }

.year-nav .disabled {
  color: rgba(154, 154, 150, 0.3);
  pointer-events: none;
}



.media-gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
  margin-top: 1.75rem;
}

.media-gallery img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--line-dim);
  cursor: zoom-in;
}

.video-embed {
  margin-top: 1.5rem;
}

.video-embed video {
  width: 100%;
  max-width: 640px;
  display: block;
  border: 1px solid var(--line-dim);
  background: #000;
}

.media-caption {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
  margin: 0.6rem 0 0;
}

@media (max-width: 880px) {
  .media-gallery {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero {
    grid-template-columns: 1fr;
    padding-top: 3rem;
  }

  .hero-media { max-width: 220px; }

  .hero-content h1 { font-size: 2.2rem; }

  .stat-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat:nth-child(3) { border-left: none; }

  .award-grid,
  .press-grid,
  .project-grid,
  .timeline-h {
    grid-template-columns: 1fr;
  }
}
