@font-face {
  font-family: "Space Grotesk";
  src: url("/fonts/space-grotesk-latin-wght-normal.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #121212;
  --cream: #FBF6EC;
  --sky: #CFE6FF;
  --violet: #6C47FF;
  --violet-dark: #5634e6;
  --coral: #FF5C39;
  --sun: #FFD23F;
  --mint: #3DDC97;
  --muted: #45464d;
  --font: "Space Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --header-h: 68px;
  --border: 2.5px solid var(--ink);
  --shadow: 6px 6px 0 var(--ink);
  color-scheme: light;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

svg text { font-family: var(--font); }

a { color: inherit; }

mark {
  background: var(--sun);
  color: var(--ink);
  padding: 0 0.15em;
  border-radius: 6px;
}

:focus-visible {
  outline: 3px solid var(--violet);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 50;
  background: var(--sun);
  border: var(--border);
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 700;
}
.skip:focus { left: 8px; }

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--header-h);
  background: var(--cream);
  border-bottom: var(--border);
}
.header-inner {
  height: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.logo-badge {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  background: var(--violet);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  border: var(--border);
  border-radius: 9px;
  box-shadow: 3px 3px 0 var(--ink);
}
.logo-word { font-weight: 700; font-size: 20px; letter-spacing: -0.02em; }
.nav { display: flex; align-items: center; gap: 22px; }
.nav a {
  font-weight: 500;
  font-size: 15px;
  text-decoration: none;
  background-image: linear-gradient(var(--sun), var(--sun));
  background-size: 0 40%;
  background-position: 0 85%;
  background-repeat: no-repeat;
  transition: background-size 0.2s;
}
.nav a:hover { background-size: 100% 40%; }
.nav .nav-cta {
  background: var(--violet);
  color: #fff;
  font-weight: 700;
  padding: 7px 14px;
  border: var(--border);
  border-radius: 9px;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform 0.12s, box-shadow 0.12s;
}
.nav .nav-cta:hover { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }

/* Stacked layout: the default (phones, reduced motion, no JS) */
.journey { padding: 32px 0 56px; }
.stage { display: none; }

.scenes {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 16px;
  display: grid;
  gap: 32px;
}
.scene {
  background: #fff;
  border: var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
  scroll-margin-top: calc(var(--header-h) + 16px);
}
.scene-art {
  background: var(--sky);
  border-bottom: var(--border);
}
.scene-art svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 280px;
}
.art-ground { fill: var(--mint); stroke: var(--ink); stroke-width: 2; }
.scene-body { padding: 20px 20px 24px; }
.scene-body > :last-child { margin-bottom: 0; }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.eyebrow::before {
  content: "";
  width: 16px;
  height: 9px;
  background: var(--sun);
  border: 2px solid var(--ink);
}
h1, h2 { margin: 0 0 12px; letter-spacing: -0.02em; line-height: 1.1; }
h1 { font-size: clamp(32px, 7vw, 52px); }
h2 { font-size: clamp(26px, 5vw, 36px); }
.scene-body p { color: var(--muted); margin: 0 0 12px; }

.list { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.list li { color: var(--muted); padding-left: 14px; border-left: 4px solid var(--sun); }
.list strong { display: block; color: var(--ink); }

.project-cards { display: grid; gap: 16px; margin-top: 8px; }
.project-cards:empty { display: none; }
.project-card {
  display: block;
  text-decoration: none;
  background: var(--cream);
  border: var(--border);
  border-top: 12px solid var(--c, var(--violet));
  border-radius: 12px;
  box-shadow: 4px 4px 0 var(--ink);
  padding: 14px 16px;
  transition: transform 0.12s, box-shadow 0.12s;
}
a.project-card:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.project-card h3 { margin: 0 0 4px; font-size: 20px; }
.project-card p { margin: 0 0 10px; color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.tags li {
  font-size: 12px;
  font-weight: 700;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 6px;
  padding: 1px 8px;
}
.visit { display: inline-block; margin-top: 10px; font-weight: 700; }
.has-projects .projects-empty { display: none; }

@media (min-width: 720px) {
  .scene { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
  .scene-art { border-bottom: 0; border-right: var(--border); display: flex; align-items: flex-end; }
  .scene-body { padding: 32px; align-self: center; }
  .project-cards { grid-template-columns: 1fr; }
}

/* Side-scrolling layout: desktop with motion allowed (class set by app.js) */
.mode-scroll .journey { padding: 0; position: relative; }
.mode-scroll .stage {
  display: block;
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow: hidden;
  background: var(--sky);
}
.mode-scroll .scenes {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}
.mode-scroll .project-cards { display: none; }

.layer {
  position: absolute;
  left: 0;
  top: 0;
  will-change: transform;
}

.building { cursor: pointer; }
.building .b-front { transition: fill 0.15s; }
.building:hover .b-front { fill: #FFF6D6; }
.building:focus { outline: none; }
.building:focus-visible .b-front { stroke: var(--violet); stroke-width: 6; }
#flag:focus { outline: none; }
#flag:focus-visible use { stroke: var(--violet); }

.bot { position: absolute; z-index: 2; }
.bot svg { display: block; width: 100%; height: 100%; overflow: visible; }
.bot.back svg { transform: scaleX(-1); }
.leg { transform-box: view-box; transform-origin: 23px 47px; }
.bot.walking .leg-a { animation: step 0.34s ease-in-out infinite alternate; }
.bot.walking .leg-b { animation: step 0.34s ease-in-out infinite alternate-reverse; }
.bot.walking .bot-body { animation: bob 0.17s ease-in-out infinite alternate; }
@keyframes step { from { transform: rotate(-22deg); } to { transform: rotate(22deg); } }
@keyframes bob { to { transform: translateY(-2px); } }

.hud {
  position: absolute;
  top: 20px;
  left: 24px;
  right: 24px;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  pointer-events: none;
}
.bubble {
  pointer-events: auto;
  max-width: 400px;
  background: #fff;
  border: var(--border);
  border-radius: 14px;
  box-shadow: 5px 5px 0 var(--ink);
  padding: 12px 16px;
}
.bubble strong { display: block; font-size: 19px; line-height: 1.25; }
.bubble p { margin: 4px 0 0; color: var(--muted); font-size: 15px; }
#bubble-extra:empty { display: none; }
#bubble-extra .tags { margin-top: 10px; }
#bubble-extra .visit {
  background: var(--violet);
  color: #fff;
  text-decoration: none;
  padding: 6px 12px;
  border: var(--border);
  border-radius: 8px;
  box-shadow: 3px 3px 0 var(--ink);
}
.counter {
  background: var(--sun);
  border: var(--border);
  border-radius: 9px;
  box-shadow: 3px 3px 0 var(--ink);
  font-weight: 700;
  font-size: 13px;
  padding: 4px 10px;
  white-space: nowrap;
}
.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 3;
  background: var(--ink);
  color: var(--cream);
  font-weight: 700;
  font-size: 14px;
  padding: 6px 14px;
  border-radius: 999px;
  transition: opacity 0.3s;
}
.scroll-hint span { display: inline-block; animation: nudge 1s ease-in-out infinite alternate; }
@keyframes nudge { to { transform: translateY(3px); } }
.stage.scrolled .scroll-hint { opacity: 0; }

/* Footer */
.site-footer {
  background: var(--ink);
  color: var(--cream);
  border-top: var(--border);
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 36px 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  flex-wrap: wrap;
}
.footer-word {
  margin: 0;
  font-size: clamp(40px, 9vw, 110px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.9;
  color: transparent;
  -webkit-text-stroke: 2px var(--cream);
}
.footer-meta { text-align: right; font-size: 14px; }
.footer-meta a { font-weight: 700; text-decoration: none; }
.footer-meta a:hover { color: var(--sun); }
.footer-meta p { margin: 4px 0 0; opacity: 0.75; }

/* 404 */
.notfound {
  min-height: 100vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 24px;
  background: var(--sky);
}
.notfound-card {
  background: #fff;
  border: var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 32px 28px;
  max-width: 420px;
}
.notfound svg { width: 92px; height: auto; margin-bottom: 12px; transform: rotate(-8deg); }
.notfound h1 { margin-bottom: 8px; }
.notfound p { color: var(--muted); margin: 0 0 24px; }
.btn {
  display: inline-block;
  background: var(--violet);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  padding: 10px 18px;
  border: var(--border);
  border-radius: 10px;
  box-shadow: 4px 4px 0 var(--ink);
}
.btn:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }

@media (max-width: 600px) {
  :root { --header-h: 60px; }
  .header-inner { padding: 0 16px; }
  .logo-word { font-size: 17px; }
  .nav a:not(.nav-cta) { display: none; }
  .footer-meta { text-align: left; }
}

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