/* ── Navigation ── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-height);
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
}

.nav__inner {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__logo {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  color: var(--text);
  text-transform: uppercase;
}

.nav__logo:hover {
  color: var(--accent);
}

.nav__links {
  display: flex;
  gap: 24px;
  align-items: center;
}

.nav__link {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  padding: 4px 0;
  position: relative;
  transition: color 0.3s var(--ease);
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform 0.3s var(--ease);
}

.nav__link:hover {
  color: var(--text);
}

.nav__link.active {
  color: var(--text);
}

.nav__link.active::after {
  transform: scaleX(1);
}

.nav__toggle {
  display: none;
  font-size: 1.5rem;
  color: var(--text);
  padding: 8px;
  background: rgba(74, 124, 191, 0.06);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* ── Sections ── */
@keyframes sectionIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.section {
  display: none;
  min-height: 100vh;
  padding: calc(var(--nav-height) + 40px) 24px 60px;
  position: relative;
}

.section.active {
  display: block;
  animation: sectionIn 0.35s ease both;
}

.section__inner {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.project-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.project-bg canvas,
.project-bg-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── Hero ── */
#hero {
  min-height: 100vh;
  padding-top: var(--nav-height);
  position: relative;
  overflow: hidden;
}

#hero.active {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.hero__content {
  position: relative;
  z-index: 1;
}

.hero__title {
  font-family: var(--font-mono);
  font-size: clamp(2.2rem, 7vw, 4.5rem);
  font-weight: 300;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text);
  line-height: 1.1;
  margin-bottom: 24px;
}

.hero__title .accent {
  color: var(--accent);
}

.hero__disciplines {
  text-align: left;
  display: inline-block;
  margin: 0 auto;
}

.hero__disciplines li {
  font-family: var(--font-mono);
  font-size: clamp(0.875rem, 1.5vw, 1rem);
  color: var(--text-dim);
  letter-spacing: 0.05em;
  line-height: 2;
  position: relative;
  padding-left: 28px;
}

.hero__disciplines li::before {
  content: attr(data-prefix);
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 400;
}

.hero__tagline {
  margin-top: 32px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  opacity: 0.5;
  font-style: italic;
  letter-spacing: 0.02em;
}

.hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 24px;
}

.hero__stat {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(74, 124, 191, 0.04);
}

.hero__annotations {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.hero__annotation {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  opacity: 0.15;
  letter-spacing: 0.05em;
  user-select: none;
}

.hero__annotation:nth-child(1) { top: 15%; left: 10%; transform: rotate(-3deg); }
.hero__annotation:nth-child(2) { top: 25%; right: 12%; transform: rotate(2deg); }
.hero__annotation:nth-child(3) { top: 60%; left: 8%; transform: rotate(-1deg); }
.hero__annotation:nth-child(4) { top: 70%; right: 10%; transform: rotate(4deg); }
.hero__annotation:nth-child(5) { bottom: 20%; left: 20%; transform: rotate(-2deg); }
.hero__annotation:nth-child(6) { bottom: 30%; right: 18%; transform: rotate(1deg); }

.scroll-indicator {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
  opacity: 0.6;
  animation: scrollPulse 2.5s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; transform: translateX(-50%) translateY(0); }
  50% { opacity: 0.9; transform: translateX(-50%) translateY(3px); }
}

.scroll-indicator__line {
  width: 1px;
  height: 32px;
  background: linear-gradient(to bottom, var(--accent), transparent);
}

.scroll-indicator__chevron {
  font-size: 0.5rem;
  line-height: 1;
  animation: scrollBounce 2.5s ease-in-out infinite;
}

@keyframes scrollBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(4px); }
}

/* ── Project Grid ── */
.section__title {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 32px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

/* ── Blog ── */
.blog-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.blog-entry {
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
}

.blog-entry__number {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 0.1em;
  margin-bottom: 4px;
}

.blog-entry__title {
  font-family: var(--font-mono);
  font-size: 1.125rem;
  color: var(--text);
  margin-bottom: 4px;
}

.blog-entry__date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.blog-entry__excerpt {
  color: var(--text-dim);
  font-size: 0.9375rem;
  margin-bottom: 8px;
}

.blog-entry__full {
  display: none;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-dim);
  line-height: 1.8;
  margin-top: 12px;
  padding: 12px 16px;
  background: var(--bg-raised);
  border-left: 1px solid var(--accent-dim);
  border-radius: var(--radius);
}

.blog-entry__full.visible {
  display: block;
}

.blog-entry__read {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  display: inline-block;
}

.blog-entry__read:hover {
  color: var(--text);
}

.blog-entry__read.open {
  color: var(--text);
}

/* ── About / Mission Profile ── */
.about__section {
  margin-bottom: 32px;
}

.about__label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
  margin-bottom: 12px;
}

.about__value {
  font-size: 1.125rem;
  color: var(--text);
  line-height: 1.8;
}

.about__value ul li {
  padding-left: 24px;
  position: relative;
  color: var(--text-dim);
}

.about__value ul li::before {
  content: '├─ ';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-family: var(--font-mono);
}

.about__value ul li:last-child::before {
  content: '└─ ';
}

.about__tagline {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--text-dim);
  font-style: italic;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

/* ── Back button ── */
.project-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin-bottom: 24px;
  transition: color 0.3s var(--ease), gap 0.3s var(--ease);
}

.project-back:hover {
  color: var(--accent);
  gap: 10px;
}

/* ── Footer ── */
.footer {
  border-top: 1px solid var(--border);
  padding: 24px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .nav {
    padding: 0 16px;
  }

  .nav__links {
    display: none;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 15, 0.98);
    flex-direction: column;
    justify-content: center;
    gap: 32px;
  }

  .nav__links.open {
    display: flex;
    animation: navLinksIn 0.25s ease both;
  }

  @keyframes navLinksIn {
    from { opacity: 0; }
    to   { opacity: 1; }
  }

  .nav__link {
    font-size: 1rem;
  }

  .nav__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    background: rgba(74, 124, 191, 0.1);
    border-color: var(--accent-dim);
  }

  .section {
    padding-left: 16px;
    padding-right: 16px;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .hero__title {
    font-size: clamp(1.6rem, 10vw, 2.5rem);
    margin-bottom: 16px;
  }

  .hero__tagline {
    font-size: 0.6875rem;
    margin-top: 20px;
  }

  .hero__disciplines li {
    font-size: 0.75rem;
    padding-left: 18px;
    line-height: 1.8;
  }

  .hero__annotation {
    display: none;
  }

  .scroll-indicator {
    bottom: 16px;
  }

  .project-header__title {
    font-size: 1.5rem;
  }

  .project-header__subtitle {
    font-size: 0.75rem;
  }

  .section__title {
    font-size: 1.25rem;
    margin-bottom: 24px;
  }

  [style*="grid-template-columns:"] {
    grid-template-columns: 1fr !important;
  }

  .spec-table {
    font-size: 0.6875rem;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .spec-table td:first-child {
    width: 100px;
  }

  .orbit-container canvas {
    aspect-ratio: 3/2;
  }
}

@media (max-width: 480px) {
  .hero__title {
    font-size: clamp(1.3rem, 8vw, 1.8rem);
  }

  .hero__disciplines li {
    font-size: 0.6875rem;
    padding-left: 14px;
  }

  .hero__tagline {
    font-size: 0.625rem;
  }

  .project-card__title {
    font-size: 1.0625rem;
  }

  .project-card__tag {
    font-size: 0.625rem;
    padding: 1px 6px;
  }

  .blog-entry__title {
    font-size: 1rem;
  }

  .about__value {
    font-size: 1rem;
  }

  .spec-table td:first-child {
    width: 80px;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .project-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .project-header__title {
    font-size: 1.75rem;
  }

  .section__title {
    font-size: 1.35rem;
  }
}

/* ── YouTube Page ── */
#yt {
  background: #050508;
}

#ytContainer {
  max-width: 800px;
  margin: 0 auto;
}

#ytVideoWrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid rgba(74, 124, 191, 0.15);
}

#ytPlayer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.yt-link {
  display: inline-block;
  margin-top: 24px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  border: 1px solid var(--accent);
  padding: 8px 16px;
  transition: all 0.3s var(--ease);
}

.yt-link:hover {
  background: rgba(74, 124, 191, 0.12);
  padding: 8px 20px;
}

/* ── 404 / Not Found ── */
#notfound {
  display: none;
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  background: var(--bg);
  padding: 0;
}

#notfound.active {
  display: flex;
  align-items: center;
  justify-content: center;
  animation: none;
}

.notfound-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.notfound-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(74, 124, 191, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(74, 124, 191, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
}

.notfound-star {
  position: absolute;
  width: 2px;
  height: 2px;
  background: var(--accent);
  border-radius: 50%;
  animation: starTwinkle 3s ease-in-out infinite alternate;
}

@keyframes starTwinkle {
  from { opacity: 0.2; }
  to   { opacity: 0.8; }
}

/* ── Rocket ── */
.notfound-rocket {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  transform: translate(-50%, -50%);
  animation: rocketFlight 3s ease-out forwards;
}

@keyframes rocketFlight {
  0%   { transform: translate(-50%, 100vh) rotate(45deg); opacity: 0; }
  10%  { opacity: 1; }
  60%  { transform: translate(-50%, -50%) rotate(0deg); }
  80%  { transform: translate(-50%, calc(-50% - 10px)) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(0deg); opacity: 1; }
}

.rocket-body {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.rocket-nose {
  width: 0;
  height: 0;
  border-left: 18px solid transparent;
  border-right: 18px solid transparent;
  border-bottom: 30px solid var(--text);
}

.rocket-fuselage {
  width: 36px;
  height: 60px;
  background: linear-gradient(180deg, var(--text) 0%, var(--text-dim) 100%);
  border-radius: 2px;
  position: relative;
}

.rocket-window {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
}

.rocket-fin-left {
  position: absolute;
  bottom: 0;
  left: -16px;
  width: 0;
  height: 0;
  border-top: 20px solid transparent;
  border-bottom: 10px solid transparent;
  border-right: 16px solid var(--text-dim);
}

.rocket-fin-right {
  position: absolute;
  bottom: 0;
  right: -16px;
  width: 0;
  height: 0;
  border-top: 20px solid transparent;
  border-bottom: 10px solid transparent;
  border-left: 16px solid var(--text-dim);
}

.rocket-exhaust {
  width: 20px;
  height: 8px;
  background: var(--accent-dim);
  border-radius: 0 0 2px 2px;
}

/* ── Flame ── */
.rocket-flame {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: -2px;
}

.flame-core {
  width: 8px;
  height: 24px;
  background: linear-gradient(to bottom, #fff, var(--accent));
  border-radius: 0 0 4px 4px;
  animation: flameFlicker 0.15s ease-in-out infinite alternate;
}

.flame-outer {
  width: 14px;
  height: 16px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  border-radius: 0 0 6px 6px;
  margin-top: -4px;
  animation: flameFlicker 0.2s ease-in-out infinite alternate-reverse;
}

@keyframes flameFlicker {
  from { transform: scaleY(1) scaleX(1); opacity: 0.8; }
  to   { transform: scaleY(1.3) scaleX(0.9); opacity: 1; }
}

/* ── 404 Content ── */
.notfound-content {
  position: relative;
  z-index: 3;
  text-align: center;
  opacity: 0;
  animation: contentFadeIn 0.8s ease 0.5s forwards;
}

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

.notfound-code {
  font-family: var(--font-mono);
  font-size: 6rem;
  font-weight: 300;
  color: var(--text);
  letter-spacing: 0.05em;
  line-height: 1;
  text-shadow: 0 0 60px rgba(74, 124, 191, 0.15);
}

.notfound-label {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  color: var(--accent);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin-top: 8px;
}

.notfound-desc {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-dim);
  margin-top: 16px;
  letter-spacing: 0.05em;
}

.notfound-btn {
  display: inline-block;
  margin-top: 32px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  border: 1px solid var(--accent);
  padding: 10px 20px;
  transition: all 0.3s var(--ease);
}

.notfound-btn:hover {
  background: rgba(74, 124, 191, 0.12);
  padding: 10px 24px;
}

@media (max-width: 768px) {
  .notfound-code {
    font-size: 3.5rem;
  }
  .notfound-label {
    font-size: 1rem;
  }
}
