/* ==========================================================================
   mauro.build — pixel RPG personal site
   Fonts: Press Start 2P (display) · VT323 (speech) · Source Sans 3 (body)
   ========================================================================== */

:root {
  /* day scene */
  --sky-top: #6fc3ec;
  --sky-low: #b9e2f5;
  --meadow: #57a24e;
  --meadow-dark: #47893f;
  --meadow-light: #63b258;

  /* dark scenes */
  --cave: #0d1220;
  --cave-panel: #151c2e;
  --cave-line: #26304a;
  --night-top: #080b16;
  --night-low: #131a30;

  /* ink */
  --ink: #0d0d0d;
  --paper-white: #fdfdfd;
  --text-on-dark: #e8ecf4;
  --text-on-dark-soft: #c3cbdd;

  /* brand */
  --swiss-red: #e0362e;
  --swiss-red-deep: #b3241d;
  --glow-cyan: #35d0ff;
  --led-green: #51ff7e;
  --led-amber: #ffb636;
  --sun-yellow: #ffd23f;

  --font-display: "Press Start 2P", monospace;
  --font-speech: "VT323", monospace;
  --font-body: "Source Sans 3", "Source Sans Pro", sans-serif;

  --px: 4px; /* base pixel unit for borders */

  /* the road: a left-side lane the whole page follows; content starts
     right of it so the walking character is always visible */
  --road-x: clamp(84px, 9vw, 120px);
  --road-w: clamp(96px, 11vw, 152px);
  --content-left: calc(var(--road-x) + var(--road-w) / 2 + clamp(20px, 4vw, 56px));
  --content-right: clamp(16px, 3vw, 40px);

  /* z-scale */
  --z-scene: 1;
  --z-actor: 2;
  --z-bubble: 3;
  --z-nav: 10;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* smooth only once JS arms it after load — load-time #fragment jumps stay instant */
html.smooth { scroll-behavior: smooth; }

section[id] { scroll-margin-top: 4.5rem; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* pause looping animations for scenes far off-screen —
   but never the walker: he lives in the hero yet walks the whole page */
.offstage * { animation-play-state: paused !important; }
.offstage .mauro-wrap,
.offstage .mauro-wrap * { animation-play-state: running !important; }

/* content floats above the walking sprite (he passes behind it) */
.section-title,
.services__sub,
.cards,
.chart,
.rack-row,
.contact__stage {
  position: relative;
  z-index: var(--z-bubble);
}

body {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--cave);
}

.px { image-rendering: pixelated; }

img, svg { max-width: 100%; display: block; }

/* ---------- a11y ---------- */

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 100;
  background: var(--ink);
  color: #fff;
  padding: 0.75rem 1.25rem;
  font-family: var(--font-display);
  font-size: 0.7rem;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: var(--px) solid var(--swiss-red);
  outline-offset: 2px;
}

/* ---------- pixel border helper ---------- */
/* NES-style: solid border with notched corners via box-shadow,
   plus a chunky offset drop shadow for depth */
.speech,
.card,
.btn-pixel {
  position: relative;
  border: none;
  box-shadow:
    0 calc(-1 * var(--px)) 0 0 var(--ink),
    0 var(--px) 0 0 var(--ink),
    calc(-1 * var(--px)) 0 0 0 var(--ink),
    var(--px) 0 0 0 var(--ink),
    10px 12px 0 0 rgba(6, 10, 18, 0.22);
}

/* ---------- nav ---------- */

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: var(--z-nav);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem clamp(1rem, 4vw, 2.5rem);
  background: rgba(10, 14, 24, 0.92);
}

.nav__logo {
  font-family: var(--font-display);
  font-size: 0.8rem;
  color: #fff;
  text-decoration: none;
  letter-spacing: 0;
}
.nav__logo span { color: var(--swiss-red); }

.nav__menu {
  display: flex;
  gap: clamp(1rem, 3vw, 2.25rem);
}

.nav__menu a {
  color: var(--text-on-dark);
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  padding: 0.25rem 0.1rem;
  border-bottom: 3px solid transparent;
}
.nav__menu a:hover { color: #fff; border-bottom-color: var(--swiss-red); }

.nav__toggle { display: none; }

/* ---------- section titles ---------- */

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 3.5vw, 2rem);
  text-align: center;
  line-height: 1.5;
  text-wrap: balance;
  /* share the center axis of the max-width-capped block below */
  margin-left: var(--content-left);
  margin-right: auto;
  max-width: 880px;
}
#about-title, #contact-title { max-width: 720px; }
#skills-title { max-width: 960px; }
.section-title--light { color: var(--ink); }
.section-title--dark { color: #fff; }

/* ---------- speech bubbles ---------- */

.speech {
  background: var(--paper-white);
  color: var(--ink);
  padding: 1.5rem 2rem;
}

.speech--hero {
  position: absolute;
  bottom: calc(100% + clamp(48px, 10vh, 110px));
  left: var(--content-left);
  z-index: var(--z-bubble);
  width: min(640px, calc(100% - var(--content-left) - var(--content-right)));
  text-align: center;
  padding: 2rem 1.5rem 2.25rem;
}

.speech__line1 {
  font-family: var(--font-speech);
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  line-height: 1;
}

.caret {
  display: inline-block;
  width: 0.55em;
  height: 0.15em;
  margin-left: 2px;
  background: var(--ink);
  vertical-align: baseline;
  animation: blink 1s steps(1) infinite;
}
.caret--done { animation: none; opacity: 0; }

@keyframes blink { 50% { opacity: 0; } }

.speech__name {
  font-family: var(--font-display);
  font-size: clamp(2rem, 7vw, 4.25rem);
  letter-spacing: 0.02em;
  margin-top: 1.25rem;
  line-height: 1;
}

.speech__tail {
  position: absolute;
  bottom: calc(-1 * var(--px) * 7);
  left: 28px;
  width: calc(var(--px) * 8);
  height: calc(var(--px) * 7);
  background: var(--paper-white);
  clip-path: polygon(0 0, 100% 0, 0 100%);
  box-shadow: none;
}

.speech--talk {
  max-width: 56ch;
  font-family: var(--font-speech);
  font-size: clamp(1.35rem, 2.6vw, 1.7rem);
  line-height: 1.25;
}
.speech--talk strong { color: var(--swiss-red-deep); }

/* ---------- bio slider (humble ←→ AI-augmented) ---------- */

.speech--bio {
  max-width: 660px;
  margin: 0;
}
/* slider sits ABOVE the text: the control never moves while the
   description below grows and shrinks — no reserved dead space */
.bio-slider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 3px solid #e4e4e4;
  font-family: var(--font-speech);
  font-size: 1.35rem;
  line-height: 1;
}
.bio-slider__label--l { color: #4a4a4a; }
.bio-slider__label--r { color: var(--swiss-red-deep); }

.bio-slider input {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 12px;
  margin: 0 var(--px);
  background:
    repeating-linear-gradient(to right, #cfd4da 0 2px, transparent 2px 25%) 0 0 / 100% 100%,
    #e9ebee;
  box-shadow:
    0 -2px 0 0 var(--ink), 0 2px 0 0 var(--ink),
    -2px 0 0 0 var(--ink), 2px 0 0 0 var(--ink);
  cursor: pointer;
}
.bio-slider input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 28px;
  background: var(--swiss-red);
  box-shadow:
    0 -3px 0 0 var(--ink), 0 3px 0 0 var(--ink),
    -3px 0 0 0 var(--ink), 3px 0 0 0 var(--ink);
}
.bio-slider input::-moz-range-thumb {
  width: 20px;
  height: 28px;
  border: none;
  border-radius: 0;
  background: var(--swiss-red);
  box-shadow:
    0 -3px 0 0 var(--ink), 0 3px 0 0 var(--ink),
    -3px 0 0 0 var(--ink), 3px 0 0 0 var(--ink);
}
.bio-slider input:focus-visible { outline-offset: 6px; }

html:not(.js) .bio-slider { display: none; }

/* ---------- HERO scene ---------- */

.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 45rem; /* rem so 200% text zoom grows the scene with the type */
  overflow: hidden;
  background: linear-gradient(var(--sky-top), var(--sky-low) 55%, var(--sky-low));
}

.hero__sky { position: absolute; inset: 0; z-index: var(--z-scene); }

.sun {
  position: absolute;
  top: 10%;
  right: 8%;
  width: clamp(56px, 8vw, 96px);
}

/* clouds park on-canvas so they exist without animation; motion drifts them */
.cloud { position: absolute; width: clamp(90px, 12vw, 160px); }
.cloud--1 { top: 14%; left: 14%; animation: drift 70s linear infinite; }
.cloud--2 { top: 30%; left: 46%; animation: drift 95s linear infinite; animation-delay: -40s; }
.cloud--3 { top: 7%;  left: 72%; animation: drift 120s linear infinite; animation-delay: -70s; }

@keyframes drift {
  from { transform: translateX(-65vw); }
  to   { transform: translateX(65vw); }
}

.hero__alps {
  position: absolute;
  left: 0; right: 0;
  bottom: calc(max(38%, 18.75rem) - 4px);
  z-index: var(--z-scene);
}
.alps { width: 100%; }
.alps--back  { height: clamp(90px, 16vw, 200px); margin-bottom: calc(clamp(60px, 11vw, 140px) * -0.72); }
.alps--front { height: clamp(60px, 11vw, 140px); display: block; }

.hero__meadow {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: var(--z-actor);
  height: max(38%, 18.75rem);
  background: var(--meadow);
}
.hero__meadow::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--meadow-light) 0 0),
    linear-gradient(var(--meadow-light) 0 0),
    linear-gradient(var(--meadow-dark) 0 0),
    linear-gradient(var(--meadow-light) 0 0),
    linear-gradient(var(--meadow-dark) 0 0),
    linear-gradient(var(--meadow-light) 0 0),
    linear-gradient(var(--meadow-dark) 0 0),
    linear-gradient(var(--meadow-light) 0 0);
  background-repeat: no-repeat;
  background-size: 40px 6px, 28px 6px, 48px 6px, 32px 6px, 40px 6px, 44px 6px, 30px 6px, 36px 6px;
  background-position: 26% 22%, 36% 58%, 55% 32%, 74% 66%, 88% 18%, 47% 82%, 64% 12%, 81% 44%;
}

.path {
  position: absolute;
  bottom: 0;
  left: var(--road-x);
  transform: translateX(-50%);
  width: var(--road-w);
  height: 100%;
}

.mauro-wrap {
  position: absolute;
  left: var(--road-x);
  transform: translateX(-50%);
  top: 24px;
  z-index: var(--z-actor);
}

/* walker mode (JS + motion allowed): sprite stays on screen and the world
   scrolls past — he "walks" down the trail through the scenes */
.mauro-wrap.walker--fixed {
  position: fixed;
  top: calc(100svh - max(38%, 18.75rem) + 24px);
}
.mauro-wrap.walker--hidden { visibility: hidden; }

/* walk cycle: swap leg frames while scrolling */
.legs--a, .legs--b { visibility: hidden; }
.is-walking .legs--idle { visibility: hidden; }
.is-walking .legs--a { animation: stride-a 0.42s steps(1) infinite; }
.is-walking .legs--b { animation: stride-b 0.42s steps(1) infinite; }
@keyframes stride-a {
  0%, 49% { visibility: visible; }
  50%, 100% { visibility: hidden; }
}
@keyframes stride-b {
  0%, 49% { visibility: hidden; }
  50%, 100% { visibility: visible; }
}

.mauro {
  width: clamp(72px, 9vw, 104px);
  animation: idle-bob 1.6s steps(2) infinite;
}

@keyframes idle-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(3px); }
}

.sprite-eyes { animation: eye-blink 4.5s steps(1) infinite; }
@keyframes eye-blink {
  0%, 92%, 100% { opacity: 1; }
  94%, 98% { opacity: 0; }
}

.mauro-shadow {
  width: 70%;
  height: 10px;
  margin: 2px auto 0;
  background: rgba(0, 0, 0, 0.3);
}

.chalet {
  position: absolute;
  left: clamp(30%, 34vw, 38%);
  top: -34px;
  width: clamp(110px, 14vw, 180px);
}

.pine { width: clamp(56px, 7vw, 90px); position: absolute; }
.pine--1 { right: clamp(4%, 10vw, 14%); top: -20px; }
.pine--2 { right: clamp(14%, 20vw, 24%); top: 34%; width: clamp(44px, 5.5vw, 70px); }

.scroll-hint {
  position: absolute;
  bottom: 1.25rem;
  left: var(--road-x);
  transform: translateX(-50%);
  z-index: var(--z-bubble);
  width: 42px;
  padding: 6px;
  animation: hint-bob 1.2s steps(2) infinite;
}
@keyframes hint-bob {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 6px); }
}
.scroll-hint svg path { fill: #ffffff; }
.scroll-hint { filter: drop-shadow(0 2px 0 rgba(0,0,0,0.5)); }
.scroll-hint:focus-visible { outline-color: var(--ink); }

/* ---------- ABOUT ---------- */

.about {
  position: relative;
  background: var(--meadow);
  padding: clamp(3rem, 7vw, 5rem) 0 0;
  overflow: hidden;
}

.about__scene { position: absolute; inset: 0; pointer-events: none; }
.about-path {
  position: absolute;
  top: 0; bottom: 0;
  left: var(--road-x);
  transform: translateX(-50%);
  width: var(--road-w);
  height: 100%;
}
/* props live in the open meadow right of / below the bio bubble */
.edelweiss { position: absolute; width: 22px; }
.edelweiss--1 { right: 20%; top: 26%; }
.edelweiss--2 { left: 56%; top: 80%; width: 18px; }
.edelweiss--3 { right: 9%; top: 58%; }
.boulder { position: absolute; width: 44px; }
.boulder--1 { right: 28%; top: 72%; }
.boulder--2 { left: 38%; top: 86%; width: 34px; }
.pine--about { position: absolute; right: 6%; top: 44%; width: clamp(48px, 6vw, 76px); }

.about .section-title,
.about__bubbles { position: relative; }
/* bubbles float above the walking sprite (he passes behind them) */
.about__bubbles { z-index: var(--z-bubble); }
.about .section-title { margin-bottom: 2.5rem; }
.about .section-title--light {
  color: #fff;
  /* solid 8-direction pixel outline: keeps white type AA-readable on meadow green */
  text-shadow:
    3px 0 0 var(--ink), -3px 0 0 var(--ink), 0 3px 0 var(--ink), 0 -3px 0 var(--ink),
    3px 3px 0 var(--ink), -3px -3px 0 var(--ink), 3px -3px 0 var(--ink), -3px 3px 0 var(--ink);
}

.about__bubbles {
  display: flex;
  flex-direction: column;
  gap: clamp(2.25rem, 12vh, 7rem);
  align-items: flex-start;
  max-width: 720px;
  margin: 0 var(--content-right) 0 var(--content-left);
  /* runway: the walker crosses the whole meadow before the cave mouth */
  padding-bottom: clamp(4rem, 22vh, 14rem);
}
.speech--talk-right { align-self: flex-end; }

.ground-transition {
  display: block;
  width: 100%;
  height: 48px;
}

/* ---------- SERVICES ---------- */

.services {
  background: var(--cave);
  padding: clamp(3.5rem, 8vw, 6rem) 0 0;
  position: relative;
}

/* ---------- datacenter walkway: the trail, raised-floor edition ---------- */

.walkway {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--road-x);
  transform: translateX(-50%);
  width: var(--road-w);
  background:
    /* cyan guide lights along both edges */
    repeating-linear-gradient(to bottom, transparent 0 34px, #2aa3c9 34px 38px) 6px 0 / 4px 100% no-repeat,
    repeating-linear-gradient(to bottom, transparent 0 34px, #2aa3c9 34px 38px) calc(100% - 6px) 0 / 4px 100% no-repeat,
    /* floor tiles */
    repeating-linear-gradient(to bottom, #182136 0 46px, #101828 46px 50px);
  /* beveled edges: lit left curb, shadowed right curb */
  box-shadow:
    inset 3px 0 0 rgba(190, 215, 255, 0.14),
    inset -4px 0 0 rgba(0, 0, 0, 0.45);
}
.walkway--ends {
  bottom: auto;
  height: 58%;
  /* stepped pixel dissolve, not a smooth alpha fade */
  -webkit-mask-image: linear-gradient(to bottom,
    #000 0 calc(100% - 90px),
    rgba(0,0,0,0.65) calc(100% - 90px) calc(100% - 60px),
    rgba(0,0,0,0.3) calc(100% - 60px) calc(100% - 30px),
    transparent calc(100% - 30px));
  mask-image: linear-gradient(to bottom,
    #000 0 calc(100% - 90px),
    rgba(0,0,0,0.65) calc(100% - 90px) calc(100% - 60px),
    rgba(0,0,0,0.3) calc(100% - 60px) calc(100% - 30px),
    transparent calc(100% - 30px));
}

.services__sub {
  text-align: center;
  font-family: var(--font-speech);
  font-size: 1.5rem;
  color: var(--glow-cyan);
  margin: 1rem auto 0 var(--content-left);
  max-width: 880px;
}

.cards {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: 2rem;
  max-width: 880px;
  margin: 3rem var(--content-right) 0 var(--content-left);
}

.card {
  background: linear-gradient(160deg, #1a2338, var(--cave-panel) 55%);
  box-shadow:
    0 calc(-1 * var(--px)) 0 0 var(--cave-line),
    0 var(--px) 0 0 var(--cave-line),
    calc(-1 * var(--px)) 0 0 0 var(--cave-line),
    var(--px) 0 0 0 var(--cave-line),
    10px 12px 0 0 rgba(0, 0, 0, 0.35);
  padding: 2rem 1.75rem 1.75rem;
}
.card:hover {
  transform: translate(-2px, -2px);
  box-shadow:
    0 calc(-1 * var(--px)) 0 0 var(--glow-cyan),
    0 var(--px) 0 0 var(--glow-cyan),
    calc(-1 * var(--px)) 0 0 0 var(--glow-cyan),
    var(--px) 0 0 0 var(--glow-cyan),
    14px 16px 0 0 rgba(0, 0, 0, 0.35);
}

.card__icon { width: 64px; height: 64px; margin-bottom: 1.25rem; }

.card h3 {
  font-family: var(--font-display);
  font-size: 0.85rem;
  line-height: 1.7;
  color: #fff;
  margin-bottom: 0.75rem;
}

.card p { color: var(--text-on-dark-soft); max-width: 46ch; }

.card__tag {
  margin-top: 1rem;
  font-family: var(--font-speech);
  font-size: 1.2rem;
  color: var(--led-green);
}

/* ---------- achievements (the numbers, RPG-style) ---------- */

.achievements {
  position: relative;
  z-index: var(--z-bubble);
  max-width: 960px;
  margin: clamp(3rem, 6vw, 4.5rem) var(--content-right) 0 var(--content-left);
}
.achievements__title {
  font-family: var(--font-speech);
  font-size: 1.6rem;
  color: var(--glow-cyan);
  margin-bottom: 1.25rem;
}
.achievements ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.achievements li {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--text-on-dark);
  font-size: 1.125rem;
}
.achievements li strong {
  font-family: var(--font-display);
  font-size: clamp(0.8rem, 1.4vw, 0.95rem);
  line-height: 1.8;
  color: var(--led-amber);
  margin: 0 0.4em;
}
.achievements .px { width: 28px; flex: none; }

.rack-row {
  position: relative;
  margin-top: clamp(3rem, 7vw, 5rem);
  overflow: hidden;
  display: flex;
  justify-content: flex-start;
  align-items: flex-end;
  gap: 16px;
  padding-left: var(--content-left);
}
.racks { width: min(400px, 30vw); height: auto; display: block; }

/* LED blink phases */
.led--a { animation: led 2.1s steps(1) infinite; }
.led--b { animation: led 1.7s steps(1) infinite; animation-delay: 0.6s; }
.led--c { animation: led 2.6s steps(1) infinite; animation-delay: 1.1s; }
@keyframes led { 0%, 70%, 100% { opacity: 1; } 78%, 92% { opacity: 0.15; } }

/* ---------- SKILLS ---------- */

.skills {
  position: relative;
  background: linear-gradient(var(--cave), var(--night-top) 30%);
  padding: clamp(3.5rem, 8vw, 6rem) 0 0;
  overflow: hidden;
}

.stars {
  position: absolute;
  inset: 0 0 auto 0;
  height: 48%;
  z-index: 0; /* behind the walkway and all content */
  pointer-events: none;
  overflow: hidden;
}
.walkway { z-index: 1; }
/* skills: keep stars in the sliver of sky above the chart */
.skills .stars { height: 14%; }
/* square pixel stars, two phase groups */
.stars::before,
.stars::after {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 3px;
  height: 3px;
  background: transparent;
}
.stars::before {
  box-shadow:
    12vw 9vh 0 #ffffff, 27vw 4vh 0 #ffe9a8, 44vw 14vh 0 #ffffff,
    61vw 6vh 0 #ffffff, 75vw 16vh 0 #ffe9a8, 88vw 8vh 0 #ffffff,
    7vw 28vh 0 #ffffff, 93vw 26vh 0 #ffffff, 52vw 24vh 0 #ffe9a8,
    34vw 33vh 0 #ffffff, 81vw 38vh 0 #ffffff;
  animation: twinkle 3.4s steps(1) infinite;
}
.stars::after {
  box-shadow:
    18vw 18vh 0 #ffffff, 39vw 7vh 0 #ffffff, 56vw 15vh 0 #ffe9a8,
    68vw 27vh 0 #ffffff, 84vw 5vh 0 #ffffff, 23vw 24vh 0 #ffffff,
    4vw 12vh 0 #ffe9a8, 96vw 36vh 0 #ffffff, 47vw 38vh 0 #ffffff;
  animation: twinkle 2.7s steps(1) infinite;
  animation-delay: 1.3s;
}
@keyframes twinkle { 0%, 100% { opacity: 0.95; } 50% { opacity: 0.4; } }

.chart {
  position: relative;
  max-width: 960px;
  margin: 3rem var(--content-right) 0 var(--content-left);
}

.chart__scale {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 0.9rem;
  /* label column + grid gap, so scale steps sit over the track fifths */
  margin-left: calc(clamp(150px, 24%, 250px) + 0.75rem);
}
.chart__scale span {
  font-family: var(--font-speech);
  font-size: clamp(0.95rem, 1.6vw, 1.25rem);
  color: var(--text-on-dark-soft);
  line-height: 1.1;
  padding-right: 0.5rem;
}

.chart__rows { display: flex; flex-direction: column; gap: 1.1rem; }

.chart__row {
  display: grid;
  grid-template-columns: clamp(150px, 24%, 250px) 1fr;
  align-items: center;
  column-gap: 0.75rem;
}

.chart__label {
  color: var(--text-on-dark);
  font-weight: 600;
  font-size: 1rem;
  text-align: right;
  line-height: 1.25;
}

.chart__track {
  position: relative;
  height: 26px;
  background: var(--cave-panel);
  box-shadow:
    0 -2px 0 0 var(--cave-line), 0 2px 0 0 var(--cave-line),
    -2px 0 0 0 var(--cave-line), 2px 0 0 0 var(--cave-line);
  /* vertical scale gridlines */
  background-image:
    linear-gradient(to right, transparent calc(20% - 1px), var(--cave-line) calc(20% - 1px) 20%, transparent 20%),
    linear-gradient(to right, transparent calc(40% - 1px), var(--cave-line) calc(40% - 1px) 40%, transparent 40%),
    linear-gradient(to right, transparent calc(60% - 1px), var(--cave-line) calc(60% - 1px) 60%, transparent 60%),
    linear-gradient(to right, transparent calc(80% - 1px), var(--cave-line) calc(80% - 1px) 80%, transparent 80%);
}

.chart__bar {
  height: 100%;
  width: var(--lvl);
  background: repeating-linear-gradient(
    to right,
    var(--swiss-red) 0 20px,
    #ef564e 20px 24px
  );
}
/* fill animation clips paint only — no layout work */
.js-armed .chart__bar { clip-path: inset(0 100% 0 0); }
.js-armed .chart--filled .chart__bar {
  clip-path: inset(0 0 0 0);
  transition: clip-path 1.1s steps(12);
}

/* ---------- CONTACT ---------- */

.contact {
  position: relative;
  background: linear-gradient(var(--night-top), var(--night-low));
  padding: clamp(3.5rem, 8vw, 6rem) 0 0;
  overflow: hidden;
}

.night-horizon {
  display: block;
  width: 100%;
  height: clamp(80px, 12vw, 140px);
  margin-top: clamp(3rem, 7vw, 5rem);
}

.contact__stage {
  position: relative;
  max-width: 720px;
  margin: 2.5rem var(--content-right) 0 var(--content-left);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.25rem;
}
.contact__stage--cta {
  margin-top: 2.5rem;
  padding-bottom: clamp(3rem, 7vw, 5rem);
}

.contact__bubble { text-align: center; }

/* the walking character stops HERE: the arrival sprite stands exactly on the
   road line, so the fixed walker hands off to it seamlessly */
.contact__scene {
  position: relative;
  z-index: var(--z-bubble);
  /* full page width: the road position is page-anchored, so the arrival
     spot must be too, or the walker hand-off jumps sideways */
  margin: 2.5rem 0 0;
  height: 170px;
  padding-bottom: 12px;
}
.contact__scene::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 12px;
  background: linear-gradient(#26304a 0 4px, #141b2e 4px);
}
.mauro--wave {
  position: absolute;
  bottom: 10px;
  left: var(--road-x);
  /* margin centering, not translateX: the idle-bob keyframes own `transform` */
  width: clamp(72px, 9vw, 104px);
  margin-left: calc(clamp(72px, 9vw, 104px) / -2);
  animation: idle-bob 1.6s steps(2) infinite;
}
.wave-arm { animation: wave 0.9s steps(2) infinite; }
@keyframes wave {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-1.5px); }
}
.conduit {
  position: absolute;
  bottom: 10px;
  left: calc(var(--road-x) + var(--road-w) / 2 + 12px);
  width: clamp(64px, 8vw, 88px);
}

.btn-pixel {
  display: inline-block;
  background: var(--swiss-red-deep); /* 6.6:1 with white text */
  color: #fff;
  font-family: var(--font-display);
  font-size: clamp(0.75rem, 1.6vw, 0.95rem);
  text-decoration: none;
  padding: 1.1rem 1.75rem;
  box-shadow:
    0 calc(-1 * var(--px)) 0 0 #7c1712,
    0 var(--px) 0 0 #7c1712,
    calc(-1 * var(--px)) 0 0 0 #7c1712,
    var(--px) 0 0 0 #7c1712,
    0 calc(var(--px) * 2) 0 0 #7c1712;
}
.btn-pixel:hover, .btn-pixel:focus-visible {
  background: #d02f27; /* still 5.1:1 */
}
.btn-pixel:active {
  transform: translateY(var(--px));
  box-shadow:
    0 calc(-1 * var(--px)) 0 0 #7c1712,
    0 var(--px) 0 0 #7c1712,
    calc(-1 * var(--px)) 0 0 0 #7c1712,
    var(--px) 0 0 0 #7c1712;
}

.contact__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.75rem 2.5rem;
}

.btn-pixel--alt {
  background: #1d2942;
  box-shadow:
    0 calc(-1 * var(--px)) 0 0 #0b101d,
    0 var(--px) 0 0 #0b101d,
    calc(-1 * var(--px)) 0 0 0 #0b101d,
    var(--px) 0 0 0 #0b101d,
    0 calc(var(--px) * 2) 0 0 #0b101d,
    10px 12px 0 0 rgba(0, 0, 0, 0.35);
}
.btn-pixel--alt:hover, .btn-pixel--alt:focus-visible {
  background: #2a3a5f;
}

.contact__mail {
  font-family: var(--font-speech);
  font-size: 1.4rem;
  color: var(--text-on-dark-soft);
}

.footer {
  background: var(--night-low);
  border-top: 2px solid var(--cave-line);
  padding: 1.75rem 1.5rem 2rem;
  text-align: center;
}
.footer p {
  color: #9aa5bd;
  font-size: 0.95rem;
}

/* ---------- reveal on scroll (enhance-only: visible by default) ---------- */

.js-armed .reveal {
  opacity: 0;
  transform: translateY(12px);
}
.js-armed .reveal.reveal--in {
  opacity: 1;
  transform: none;
  transition: opacity 0.4s steps(5), transform 0.4s steps(5);
}

/* ---------- responsive ---------- */

@media (max-width: 700px) {
  /* narrower road gutter on small screens */
  :root { --road-x: 44px; --road-w: 76px; }

  .racks { width: min(400px, 34vw); }

  /* bio slider: labels above full-width track */
  .bio-slider { flex-wrap: wrap; justify-content: space-between; row-gap: 0.75rem; }
  .bio-slider input { flex: 1 1 100%; order: 2; }

  /* no-JS fallback: links stay inline and wrap */
  .nav__menu { flex-wrap: wrap; justify-content: flex-end; gap: 0.25rem 1rem; }

  html.js .nav__toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
  }
  html.js .nav__toggle span {
    width: 26px;
    height: 4px;
    background: #fff;
  }
  /* dropdown styled like a speech bubble, not default UI */
  html.js .nav__menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 10px;
    flex-direction: column;
    gap: 0;
    background: var(--paper-white);
    min-width: 210px;
    padding: 0.5rem 0;
    display: none;
    box-shadow:
      0 calc(-1 * var(--px)) 0 0 var(--ink),
      0 var(--px) 0 0 var(--ink),
      calc(-1 * var(--px)) 0 0 0 var(--ink),
      var(--px) 0 0 0 var(--ink);
  }
  html.js .nav__menu.is-open { display: flex; }
  html.js .nav__menu a {
    padding: 0.7rem 1.5rem;
    border-bottom: none;
    color: var(--ink);
    font-family: var(--font-speech);
    font-size: 1.45rem;
    line-height: 1.1;
  }
  html.js .nav__menu a:hover { color: var(--swiss-red-deep); }

  .chalet { display: none; }
  .pine--2 { display: none; }

  .cards { grid-template-columns: 1fr; column-gap: 0; }
  .chart__row { grid-template-columns: 1fr; gap: 0.35rem; }
  .chart__label { text-align: left; }
  .chart__scale { margin-left: 0; }
  .chart__scale span { font-size: 0.85rem; }

  .contact__scene { gap: 1.5rem; }
}

/* ---------- small phones ---------- */

@media (max-width: 480px) {
  .btn-pixel { font-size: 0.7rem; padding: 1rem 1.25rem; }
  .bio-slider { font-size: 1.05rem; }
  .achievements li { font-size: 1rem; gap: 0.75rem; }
  .achievements li strong { font-size: 0.7rem; }
  /* scale: keep only the two end labels; gridlines still mark the steps */
  .chart__scale span:nth-child(2),
  .chart__scale span:nth-child(3),
  .chart__scale span:nth-child(4) { visibility: hidden; }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cloud, .mauro, .mauro--wave, .wave-arm, .sprite-eyes,
  .led--a, .led--b, .led--c, .stars, .scroll-hint, .caret {
    animation: none !important;
  }
  .js-armed .reveal { opacity: 1; transform: none; }
  .js-armed .chart__bar { clip-path: none; transition: none; }
  .mauro-wrap { position: absolute !important; top: 24px !important; visibility: visible !important; }
  .legs--a, .legs--b { visibility: hidden !important; }
  .legs--idle { visibility: visible !important; }
}
