@font-face {
  font-family: DM;
  src: url(/assets/fonts/dm-sans.woff2);
  font-display: swap;
  font-weight: 100 900;
}
@font-face {
  font-family: Serif;
  src: url(/assets/fonts/instrument-serif.woff2);
  font-display: swap;
}
@font-face {
  font-family: Mono;
  src: url(/assets/fonts/plex-mono.woff2);
  font-display: swap;
}

:root {
  --night: #0d1330;
  --night-2: #151d44;
  --ink: #fff3dc;
  --muted: #b8bedb;
  --amber: #ffc76b;
  --tram-red: #c4433b;
  --page: min(1160px, 100% - 32px);
  --scene-h: clamp(420px, 64vh, 680px);
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}
body {
  margin: 0;
  background: var(--night);
  color: var(--ink);
  font: 400 17px/1.6 DM, system-ui, sans-serif;
  overflow-x: clip;
}
img {
  display: block;
  max-width: 100%;
}
a {
  color: inherit;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  touch-action: manipulation;
}
:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 3px;
}
.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  z-index: 100;
  padding: 8px 14px;
  background: var(--amber);
  color: var(--night);
}
.skip:focus {
  left: 8px;
}

/* Header */
.hb-head {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px max(16px, (100% - 1160px) / 2);
  background: color-mix(in srgb, var(--night) 82%, transparent);
  backdrop-filter: blur(10px);
}
.hb-sign {
  font: 400 26px/1 Serif, Georgia, serif;
  text-decoration: none;
}
.hb-head nav {
  display: flex;
  gap: 22px;
  margin-left: auto;
  font-size: 15px;
}
.hb-head nav a {
  text-decoration: none;
  color: var(--muted);
}
.hb-head nav a:hover {
  color: var(--ink);
}

/* Hero */
.hb-hero {
  position: relative;
  background: linear-gradient(180deg, #0b1029 0%, #18224f 46%, #2c2f62 70%, #0d1330 100%);
  padding-bottom: 28px;
}
.hb-copy {
  position: absolute;
  z-index: 5;
  top: clamp(20px, 5vh, 48px);
  left: max(16px, (100% - 1160px) / 2);
  max-width: 600px;
  pointer-events: none;
}
.hb-kicker {
  margin: 0 0 10px;
  color: var(--amber);
  font: 600 13px/1.2 Mono, ui-monospace, monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.hb-copy h1 {
  margin: 0;
  font: 400 clamp(34px, 4.6vw, 62px) / 1.02 Serif, Georgia, serif;
  text-shadow: 0 2px 24px rgba(5, 8, 25, 0.9);
}

.hb-scene {
  position: relative;
  height: var(--scene-h);
  overflow: hidden;
}
.hb-sky {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(1px 1px at 12% 18%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 27% 8%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 44% 22%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 61% 12%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 73% 26%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 86% 9%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 94% 30%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 52% 4%, #fff 50%, transparent 51%);
  opacity: 0.7;
}
.hb-moon {
  position: absolute;
  right: 12%;
  top: 9%;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #fff1c9;
  box-shadow: 0 0 60px 12px rgba(255, 228, 160, 0.25);
}
.hb-world {
  position: absolute;
  left: 0;
  top: 0;
  width: 4440px;
  height: 720px;
  transform-origin: 0 0;
  will-change: transform;
}
.hb-skyline {
  position: absolute;
  left: 0;
  top: 0;
  width: 3200px;
  max-width: none;
  left: 300px;
  height: 720px;
  will-change: transform;
}
.hb-street {
  position: absolute;
  inset: 0;
}
.hb-street > * {
  position: absolute;
}
.hb-wire {
  left: 0;
  right: 0;
  top: 300px;
  height: 2px;
  background: #4f5a86;
}
.hb-walk {
  left: 0;
  right: 0;
  top: 556px;
  height: 32px;
  background: linear-gradient(#3a4474, #2a335e);
  box-shadow: 0 -2px 0 #56619a;
}
.hb-road {
  left: 0;
  right: 0;
  top: 588px;
  bottom: 0;
  background: #121834;
}
.hb-rail {
  left: 0;
  right: 0;
  height: 3px;
  background: #7f8bb8;
}
.hb-rail.r1 {
  top: 606px;
}
.hb-rail.r2 {
  top: 618px;
}
.hb-pole {
  top: 290px;
  height: 298px;
  width: 8px;
  background: #3b4677;
}
.hb-lamppost {
  top: 380px;
  height: 208px;
  width: 6px;
  background: #3b4677;
}
.hb-lamppost::before {
  content: "";
  position: absolute;
  left: -14px;
  top: -6px;
  width: 34px;
  height: 10px;
  border-radius: 6px;
  background: #ffe2a2;
  box-shadow: 0 0 40px 18px rgba(255, 210, 120, 0.28);
}

/* Stop totems: a lit poster made of each app's own art. */
.hb-totem {
  top: 296px;
  width: 140px;
  height: 262px;
  padding: 46px 10px 12px;
  border-radius: 10px 10px 4px 4px;
  background: linear-gradient(#2a3463, #1c2449);
  box-shadow: inset 0 0 0 3px #4a5590;
  cursor: pointer;
  transition: box-shadow 400ms;
}
.hb-totem.active {
  box-shadow:
    inset 0 0 0 3px var(--amber),
    0 0 60px 6px rgba(255, 199, 107, 0.35);
}
.hb-disc {
  position: absolute;
  left: 50%;
  top: -28px;
  width: 64px;
  height: 64px;
  translate: -50% 0;
  border-radius: 16px;
  box-shadow: 0 0 0 4px #1c2449;
}
.hb-totem.active .hb-disc {
  box-shadow:
    0 0 0 4px var(--amber),
    0 0 30px rgba(255, 199, 107, 0.6);
}
.hb-lightbox {
  position: relative;
  height: 172px;
  overflow: hidden;
  border-radius: 4px;
  background: #0c1129;
  filter: brightness(0.62) saturate(0.8);
  transition: filter 500ms;
}
.hb-totem.active .hb-lightbox {
  filter: none;
}
.hb-plate {
  display: block;
  margin-top: 8px;
  text-align: center;
  font: 700 13px/1.1 DM, sans-serif;
  color: var(--ink);
}
.pst {
  position: absolute;
  inset: 0;
}
.pst .bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pst-ram .bg {
  object-position: 30% 100%;
  image-rendering: pixelated;
}
.pst-ram .spr {
  position: absolute;
  left: 30px;
  bottom: 26px;
  width: 60px;
  height: auto;
  image-rendering: pixelated;
}
.pst-ram .spr.jump {
  animation: poster-jump 0.6s ease-out;
}
@keyframes poster-jump {
  50% {
    transform: translateY(-36px);
  }
}
.pst-chef .bg {
  object-position: 50% 50%;
}
.pst-chef .spr {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 112px;
  translate: -50% 0;
}
.pst-thumb {
  background: #fbf3e2;
}
.pst-thumb .spr {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 150px;
  translate: -50% -50%;
}
.pst-thumb .spr.hop {
  animation: poster-jump 0.5s ease-out;
}
.pst-tq {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  place-items: center;
  padding: 8px;
  background: #f4f1ea;
  font-size: 22px;
}
.pst-tq span {
  transition: transform 200ms, opacity 200ms;
}
.pst-tq span.gone {
  opacity: 0.12;
  transform: scale(0.7);
}
.pst-tq span.pop {
  transform: scale(1.35);
}
.pst-hm {
  padding: 14px 12px;
  background: #f7f3ea;
  color: #2b2a26;
}
.pst-hm .clock {
  display: block;
  font: 700 26px/1 DM, sans-serif;
}
.pst-hm .type {
  margin: 8px 0 0;
  font: 400 11px/1.45 Georgia, serif;
}
.pst-hm .type::after {
  content: "|";
  color: #2f4b7c;
}
.pst-ct {
  background: #06080b;
}
.pst-ct svg {
  position: absolute;
  inset: 6px 6px 26px;
  width: calc(100% - 12px);
  height: calc(100% - 32px);
}
.pst-ct path {
  fill: none;
  stroke: #3d6bff;
  stroke-width: 2.5;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 4px #3d6bff);
}
.pst-ct b {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 6px;
  text-align: center;
  font: 800 13px/1 DM, sans-serif;
  color: #d6ff3d;
}

/* The tram */
.hb-tram {
  top: 242px;
  left: 0;
  width: 380px;
  height: 370px;
  z-index: 3;
  will-change: transform;
}
.hb-tram svg {
  overflow: visible;
}
.hb-tram.left svg {
  transform: scaleX(-1);
}
.hb-door rect {
  transition: transform 450ms ease-in-out;
}
.hb-tram.open .hb-door .l {
  transform: translateX(-22px);
}
.hb-tram.open .hb-door .r {
  transform: translateX(22px);
}
.hb-doorlight {
  opacity: 0;
  transition: opacity 400ms;
}
.hb-tram.open .hb-doorlight {
  opacity: 0.55;
}
.hb-door {
  isolation: isolate;
}
.hb-beam {
  position: absolute;
  right: -170px;
  top: 298px;
  width: 180px;
  height: 46px;
  background: linear-gradient(90deg, rgba(255, 240, 190, 0.35), transparent);
  clip-path: polygon(0 40%, 100% 0, 100% 100%, 0 60%);
}
.hb-tram.left .hb-beam {
  right: auto;
  left: -170px;
  transform: scaleX(-1);
}

/* The story card */
.hb-card {
  position: absolute;
  z-index: 6;
  left: max(16px, (100% - 1160px) / 2);
  bottom: 112px;
  width: min(380px, 100% - 32px);
  padding: 18px 20px 20px;
  border-radius: 16px;
  background: rgba(13, 19, 48, 0.86);
  backdrop-filter: blur(12px);
  box-shadow:
    0 0 0 1px rgba(255, 199, 107, 0.25),
    0 20px 50px rgba(0, 0, 0, 0.45);
}
.hb-card-head {
  display: flex;
  gap: 14px;
  align-items: center;
}
.hb-card-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
}
.hb-card-kind {
  margin: 0;
  font: 600 12px/1 Mono, monospace;
  color: var(--amber);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.hb-card-name {
  margin: 4px 0 0;
  font: 400 32px/1 Serif, Georgia, serif;
}
.hb-card-line {
  margin: 12px 0 10px;
  color: #e6e2d8;
  font-size: 16px;
  line-height: 1.45;
}
.hb-card-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}
.hb-card-stats li {
  padding: 3px 10px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  font: 600 13px/1.6 DM, sans-serif;
}
.hb-visit {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 99px;
  background: var(--amber);
  color: var(--night);
  font-weight: 800;
  text-decoration: none;
}
.hb-card.swap {
  animation: card-in 400ms ease-out;
}
@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

/* Controls */
.hb-controls {
  width: var(--page);
  margin: 14px auto 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px 16px;
  align-items: center;
}
.hb-stops {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.hb-stops button {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 6px 14px 6px 6px;
  border: 0;
  border-radius: 99px;
  background: var(--night-2);
  font-size: 14px;
  font-weight: 600;
}
.hb-stops img {
  border-radius: 8px;
}
.hb-stops [aria-pressed="true"] {
  background: var(--amber);
  color: var(--night);
}
.hb-play {
  display: flex;
  gap: 8px;
}
.hb-play button {
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 99px;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
}
.hb-progress {
  grid-column: 1 / -1;
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}
.hb-progress i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--amber);
}

/* Projects */
.hb-projects {
  width: var(--page);
  margin: 0 auto;
  padding: clamp(64px, 9vw, 110px) 0 0;
}
.hb-projects h2 {
  max-width: 760px;
  margin: 0 0 32px;
  font: 400 clamp(30px, 4vw, 48px) / 1.05 Serif, Georgia, serif;
}
.hb-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.hb-pcard {
  display: grid;
  gap: 6px;
  align-content: start;
  padding: 20px;
  border-radius: 18px;
  background: var(--night-2);
  text-decoration: none;
  transition: transform 160ms ease-out, background 160ms;
}
.hb-pcard:hover {
  transform: translateY(-4px);
  background: #1c2656;
}
.hb-pcard img {
  border-radius: 16px;
  margin-bottom: 8px;
}
.hb-pcard .k {
  font: 600 12px/1 Mono, monospace;
  color: var(--amber);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.hb-pcard b {
  font: 400 28px/1.1 Serif, Georgia, serif;
}
.hb-pcard p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}
.hb-pcard ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
  padding: 0;
  list-style: none;
}
.hb-pcard li {
  padding: 2px 9px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.07);
  font-size: 13px;
}
.hb-pcard .go {
  font-weight: 700;
  color: var(--amber);
}

/* About + contact (profile.html markup) */
.profile {
  width: var(--page);
  margin: 0 auto;
  padding: clamp(72px, 10vw, 120px) 0 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}
.eyebrow {
  margin: 0 0 10px;
  color: var(--amber);
  font: 600 13px/1.2 Mono, monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.bio-title {
  margin: 0 0 18px;
  font: 400 clamp(40px, 5vw, 64px) / 1 Serif, Georgia, serif;
}
.bio-title em,
.contact h2 em {
  color: var(--amber);
}
.profile p {
  color: #e2dfd6;
}
.underlink {
  font-weight: 700;
  color: var(--amber);
}
.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  font-size: 20px;
}
.experience h3 {
  margin: 0 0 12px;
  font: 600 13px/1.2 Mono, monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.experience article {
  padding: 16px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.experience h4 {
  margin: 0 0 4px;
  font-size: 18px;
}
.experience p {
  margin: 0;
  color: var(--muted);
}
.contact {
  width: var(--page);
  margin: 0 auto;
  padding: clamp(64px, 9vw, 110px) 0;
}
.contact h2 {
  margin: 0 0 12px;
  font: 400 clamp(40px, 5vw, 64px) / 1 Serif, Georgia, serif;
}
.hb-foot {
  display: flex;
  justify-content: space-between;
  padding: 22px max(16px, (100% - 1160px) / 2);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--muted);
  font-size: 14px;
}

/* Phones: the copy sits above the street, the card below it. */
@media (max-width: 760px) {
  :root {
    --scene-h: 400px;
  }
  .hb-head nav {
    gap: 14px;
    font-size: 14px;
  }
  .hb-copy {
    position: static;
    padding: 24px 16px 8px;
  }
  .hb-card {
    position: relative;
    left: auto;
    bottom: auto;
    margin: -60px 16px 0;
    width: auto;
  }
  .hb-controls {
    grid-template-columns: 1fr;
  }
  .hb-stops {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
  }
  .hb-stops button {
    flex: 0 0 auto;
  }
  .hb-grid {
    grid-template-columns: 1fr;
  }
  .profile {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}
@media (min-width: 761px) and (max-width: 1060px) {
  .hb-grid {
    grid-template-columns: 1fr 1fr;
  }
}

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