:root {
  color-scheme: dark;
  --bg: #050816;
  --panel: rgba(8, 15, 30, 0.86);
  --text: #f5f7ff;
  --muted: #9fb0d3;
  --accent: #7ef0a8;
  --border: rgba(255, 255, 255, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

img {
  max-width: 100%;
}

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: linear-gradient(180deg, rgba(5, 8, 22, 0.9), rgba(5, 8, 22, 0.25));
  backdrop-filter: blur(16px);
}

.brand {
  color: white;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.92rem;
}

.site-nav {
  display: flex;
  gap: 1rem;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 180ms ease;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--text);
}

.profile-float {
  position: fixed;
  top: 5.8rem;
  left: 1.4rem;
  z-index: 18;
  width: 150px;
  padding: 0.65rem;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(8, 15, 30, 0.88);
  backdrop-filter: blur(10px);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.34);
  animation: profile-float-in 700ms ease both;
}

.profile-float img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 13px;
  border: 1px solid rgba(255, 255, 255, 0.28);
}

.profile-name {
  margin: 0.55rem 0 0;
  font-size: 0.77rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #d8e8ff;
  text-align: center;
}

@keyframes profile-float-in {
  from {
    opacity: 0;
    transform: translate3d(-16px, 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.loading-section {
  min-height: 100vh;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.shared-terminal-wrap {
  pointer-events: none;
}

.shared-terminal {
  position: fixed;
  left: clamp(170px, 14vw, 280px);
  top: 18vh;
  bottom: auto;
  width: min(900px, 53vw);
  z-index: 11;
  pointer-events: auto;
}

.shared-side-rail {
  position: static;
  z-index: 12;
}

.shared-intro-wrap {
  pointer-events: none;
}

.shared-intro {
  position: fixed;
  left: calc(clamp(170px, 14vw, 280px) + min(900px, 53vw) + 1rem);
  top: 18vh;
  width: min(432px, 27.6vw);
  min-height: 430px;
  z-index: 11;
  pointer-events: auto;
}

.shared-banner {
  position: fixed;
  top: 5.8rem;
  right: 0.9rem;
  width: min(360px, calc(100vw - 1.8rem));
  z-index: 12;
}

.shared-tech-wrap {
  position: fixed;
  right: 3.2rem;
  bottom: 6rem;
  width: auto;
  max-width: min(760px, 47vw);
  z-index: 13;
  pointer-events: none;
}

.shared-tech-wrap.is-empty {
  display: none;
}

.shared-tech-title {
  display: none !important;
  height: 0;
  margin: 0;
  overflow: hidden;
}

.shared-tech-grid {
  --hex-w: 132px;
  --hex-h: 148px;
  --hex-gap: 8px;
  --hex-overlap: 30px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0;
  width: max-content;
}

.tech-row {
  display: flex;
  justify-content: flex-end;
  gap: var(--hex-gap);
  margin-top: calc(var(--hex-overlap) * -1);
}

.tech-row:first-child {
  margin-top: 0;
}

.tech-row.is-shifted {
  transform: translateX(calc((var(--hex-w) + var(--hex-gap)) / -2));
}

.tech-hex {
  width: var(--hex-w);
  height: var(--hex-h);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  border: 0;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 0.46rem;
  box-shadow: none;
  background: #1f2c45;
}

.tech-hex span {
  display: block;
  font-size: 0.8rem;
  line-height: 1.22;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #f7f9ff;
  font-weight: 800;
  max-width: 78%;
}

.tech-hex.theme-aqua {
  background: #20aeca;
}

.tech-hex.theme-coral {
  background: #f27566;
}

.tech-hex.theme-slate {
  background: #b8bac2;
}

.tech-hex.theme-ink {
  background: #1f2739;
}

.tech-hex.theme-white {
  background: #ffffff;
}

.tech-hex.theme-white span {
  color: #1a2233;
}

.tech-empty {
  color: #d3ddf5;
  text-align: right;
  font-size: 0.82rem;
  padding-right: 0.35rem;
}

.city-section {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: 6rem 2rem 4rem;
  isolation: isolate;
}

.section-background {
  position: absolute;
  inset: 0;
  background-color: #0b1430;
  background-image:
    linear-gradient(120deg, rgba(5, 8, 24, 0.9), rgba(5, 8, 24, 0.55)),
    linear-gradient(180deg, rgba(123, 188, 255, 0.1), transparent 55%),
    radial-gradient(circle at top right, rgba(126, 240, 168, 0.22), transparent 40%),
    linear-gradient(180deg, #0b1430 0%, #10264d 45%, #0a1026 100%);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transform: translate3d(0, var(--parallax-offset, 0px), 0);
  transition: transform 90ms linear;
  z-index: -2;
}

/* When a photo is supplied via inline style, remove the star-field pseudo-elements */
.section-background[style] {
  background-size: cover;
  background-position: center;
}

.section-background::before,
.section-background::after {
  content: '';
  position: absolute;
  inset: 0;
  background-repeat: no-repeat;
  background-size: cover;
  opacity: 0.95;
}

.section-background::before {
  background-image: linear-gradient(180deg, transparent 0%, rgba(1, 4, 10, 0.3) 100%),
    radial-gradient(circle at 20% 25%, rgba(255,255,255,0.9) 0 3px, transparent 3px),
    radial-gradient(circle at 40% 40%, rgba(255,255,255,0.9) 0 3px, transparent 3px),
    radial-gradient(circle at 63% 28%, rgba(255,255,255,0.9) 0 3px, transparent 3px),
    radial-gradient(circle at 82% 35%, rgba(255,255,255,0.9) 0 3px, transparent 3px),
    linear-gradient(180deg, transparent 0%, transparent 64%, rgba(0,0,0,0.3) 64%, rgba(0,0,0,0.3) 100%);
  background-position: center center;
  transform: scale(1.04);
}

.section-background::after {
  background-image: linear-gradient(180deg, transparent 0%, transparent 72%, rgba(2, 6, 16, 0.7) 72%, rgba(2, 6, 16, 0.7) 100%),
    linear-gradient(90deg, transparent 0%, transparent 13%, rgba(255,255,255,0.16) 13%, rgba(255,255,255,0.16) 14%, transparent 14%, transparent 100%),
    linear-gradient(90deg, transparent 0%, transparent 43%, rgba(255,255,255,0.16) 43%, rgba(255,255,255,0.16) 44%, transparent 44%, transparent 100%),
    linear-gradient(90deg, transparent 0%, transparent 74%, rgba(255,255,255,0.16) 74%, rgba(255,255,255,0.16) 75%, transparent 75%, transparent 100%);
  opacity: 0.35;
}

.scene-content {
  width: min(1380px, 100%);
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  justify-items: start;
  gap: 2rem;
  z-index: 1;
}

.terminal-card,
.intro-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
}

.terminal-card {
  min-height: 430px;
  overflow: hidden;
}

.terminal-head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.dot-red { background: #ff5f56; }
.dot-yellow { background: #ffbd2e; }
.dot-green { background: #27c93f; }

.terminal-title {
  margin-left: auto;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #adc1e7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 63%;
}

.terminal-body {
  padding: 1.25rem;
  font-family: 'IBM Plex Mono', monospace;
  line-height: 1.7;
  color: #dce8ff;
}

.terminal-output {
  min-height: 330px;
}

.prompt-line {
  margin-bottom: 0.7rem;
}

.prompt {
  color: var(--accent);
}

.typed-line {
  color: #f5f7ff;
}

.blinking-cursor {
  display: inline-block;
  width: 0.7ch;
  height: 1.1em;
  background: var(--accent);
  animation: blink 750ms steps(1) infinite;
  margin-left: 0.1em;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.intro-card {
  padding: 2rem;
  max-width: 470px;
}

.city-section .intro-card[aria-hidden="true"] {
  display: none;
}

.eyebrow {
  margin: 0 0 0.5rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-size: 0.76rem;
  font-weight: 700;
}

.intro-card h1,
.intro-card h2 {
  margin: 0 0 0.85rem;
  font-size: clamp(1.8rem, 3vw, 2.7rem);
  line-height: 1.08;
}

.intro-card p {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
}

.city-banner {
  width: min(350px, calc(100vw - 2rem));
  padding: 1rem 1rem 1.2rem;
  border: 5px solid #f4f6f9;
  border-radius: 14px;
  background: #0a9f79;
  color: #f5f8fc;
  text-align: center;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

.city-banner::before {
  content: '';
  position: absolute;
  inset: 0.42rem;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 8px;
  pointer-events: none;
}

.city-banner p {
  margin: 0;
}

.sign-direction,
.sign-city,
.sign-state {
  text-transform: uppercase;
  letter-spacing: 0.11em;
  font-weight: 700;
}

.sign-direction {
  font-size: 0.74rem;
  margin-bottom: 0.6rem;
}

.sign-routes {
  display: flex;
  justify-content: center;
  gap: 0.8rem;
  margin-bottom: 0.7rem;
}

.interstate-shield {
  position: relative;
  width: 86px;
  aspect-ratio: 1 / 1;
  display: inline-block;
  background-image: url('/images/interstate.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.28));
}

.shield-word {
  position: absolute;
  inset: 20% 0 auto 0;
  display: block;
  text-align: center;
  font-size: 0.44rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #ffffff;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.shield-number {
  position: absolute;
  left: 0;
  right: 0;
  top: 56%;
  display: block;
  text-align: center;
  font-size: 1.28rem;
  font-weight: 700;
  line-height: 1;
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.65);
  transform: translateY(-50%);
}

.sign-city {
  font-size: 1.06rem;
  margin-bottom: 0.2rem;
}

.sign-state {
  font-size: 0.95rem;
  opacity: 0.96;
}

.site-footer {
  padding: 2rem;
  text-align: center;
  background: #03060e;
  color: var(--muted);
}

.site-footer a {
  color: var(--accent);
  text-decoration: none;
}

@media (max-width: 900px) {
  .shared-terminal {
    position: relative;
    left: auto;
    bottom: auto;
    top: auto;
    width: min(94vw, 860px);
    margin: 7.3rem auto 0.7rem;
    z-index: 8;
  }

  .shared-side-rail {
    position: relative;
    top: auto;
    right: auto;
    width: min(94vw, 860px);
    margin: 0 auto 0.7rem;
    gap: 0.85rem;
  }

  .shared-intro {
    position: relative;
    left: auto;
    top: auto;
    width: min(94vw, 860px);
    min-height: auto;
  }

  .shared-banner {
    position: relative;
    top: auto;
    right: auto;
    width: min(320px, calc(100vw - 2rem));
    margin: 0 auto;
  }

  .shared-tech-wrap {
    position: relative;
    right: auto;
    bottom: auto;
    width: min(94vw, 860px);
    margin: 0 auto 1rem;
    max-width: none;
  }

  .shared-tech-title,
  .tech-empty {
    text-align: left;
    padding-right: 0;
  }

  .shared-tech-grid {
    --hex-w: 92px;
    --hex-h: 103px;
    --hex-gap: 6px;
    --hex-overlap: 22px;
    align-items: flex-start;
    width: max-content;
  }

  .tech-row {
    justify-content: flex-start;
    gap: var(--hex-gap);
    margin-top: calc(var(--hex-overlap) * -1);
  }

  .tech-row.is-shifted {
    transform: translateX(calc((var(--hex-w) + var(--hex-gap)) / 2));
  }

  .tech-hex {
    border-width: 0;
  }

  .tech-hex span {
    font-size: 0.62rem;
  }

  .scene-content {
    grid-template-columns: 1fr;
    justify-content: flex-start;
    justify-items: stretch;
  }

  .intro-card {
    max-width: 100%;
  }
}

@media (max-width: 640px) {
  .profile-float {
    top: 7.75rem;
    left: 0.75rem;
    width: 116px;
    padding: 0.45rem;
    border-radius: 14px;
  }

  .profile-name {
    font-size: 0.65rem;
  }

  .site-header {
    padding: 1rem 1rem 0.75rem;
    flex-direction: column;
    gap: 0.6rem;
  }

  .site-nav {
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
  }

  .city-section {
    padding: 8rem 1rem 3rem;
  }

  .city-banner {
    width: min(320px, calc(100vw - 2rem));
    padding: 0.9rem 0.9rem 1.1rem;
  }

  .interstate-shield {
    width: 74px;
  }

  .shield-number {
    font-size: 1.12rem;
  }

  .terminal-card,
  .intro-card {
    border-radius: 18px;
  }

  .terminal-title {
    font-size: 0.62rem;
    max-width: 56%;
  }

  .tech-row {
    margin-top: calc(var(--hex-overlap) * -1);
    gap: var(--hex-gap);
  }

  .tech-row.is-shifted {
    transform: translateX(calc((var(--hex-w) + var(--hex-gap)) / 2));
  }

  .shared-tech-grid {
    --hex-w: 74px;
    --hex-h: 83px;
    --hex-gap: 4px;
    --hex-overlap: 14px;
  }

  .tech-hex {
    padding: 0.28rem;
    border-width: 0;
  }

  .tech-hex span {
    font-size: 0.52rem;
  }
}
