:root {
  --bg: #04111f;
  --bg-deep: #020913;
  --surface: rgba(7, 25, 43, 0.76);
  --surface-soft: rgba(17, 40, 66, 0.72);
  --ink: #eaf4ff;
  --muted: #9cb3c7;
  --line: rgba(173, 224, 255, 0.14);
  --accent: #2bc46d;
  --signal: #ffcc47;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(43,196,109,.18), transparent 24%),
    radial-gradient(circle at right 20%, rgba(95,195,255,.15), transparent 22%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
  min-height: 100vh;
  overflow-x: hidden;
}

body.menu-open { overflow: hidden; }

a { color: inherit; }

.site-shell {
  opacity: 0;
  transform: translateY(24px) scale(.985);
  transition: opacity .8s ease, transform .8s ease;
}

body.site-ready .site-shell {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.page-transition {
  position: fixed;
  inset: 0;
  z-index: 45;
  pointer-events: none;
  overflow: hidden;
}

.page-transition::before,
.page-transition::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateY(100%);
  transition: transform .7s cubic-bezier(.76,0,.24,1);
}

.page-transition::before { background: linear-gradient(180deg, rgba(9,31,50,.96), rgba(4,17,31,.98)); }
.page-transition::after {
  background:
    radial-gradient(circle at center, rgba(43,196,109,.18), transparent 30%),
    linear-gradient(180deg, rgba(17,128,63,.82), rgba(4,17,31,.94));
  clip-path: ellipse(96% 62% at 50% 100%);
  transition-delay: .08s;
}

.page-transition.is-active::before,
.page-transition.is-active::after {
  transform: translateY(0);
}

.entry-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(circle at top, rgba(95,195,255,.14), transparent 26%),
    linear-gradient(180deg, #07192b 0%, #030a13 100%);
  transition: opacity .9s ease, visibility .9s ease;
}

.entry-overlay.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.entry-stage {
  width: min(1040px, 100%);
  min-height: 88vh;
  display: grid;
  align-items: center;
  gap: 28px;
}

.entry-copy { text-align: center; }

.entry-copy p {
  margin: 0 auto 12px;
  max-width: 720px;
  color: var(--muted);
  line-height: 1.8;
}

.retro-copy p {
  max-width: 760px;
}

.pixel-text,
.pixel-title,
.direction-badge,
.pipe-label {
  font-family: "Press Start 2P", monospace;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 14px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--signal);
  font-size: .78rem;
  font-weight: 700;
}

h1, h2, h3, .brand {
  margin: 0;
  font-family: "Bricolage Grotesque", sans-serif;
}

.entry-copy h1,
.hero-copy h1 {
  font-size: clamp(3.4rem, 8vw, 6.8rem);
  line-height: .88;
}

.pixel-title {
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  line-height: 1.45;
  text-transform: uppercase;
}

.entry-zone {
  position: relative;
  min-height: 420px;
  border-radius: 38px;
  border: 1px solid var(--line);
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,0)),
    linear-gradient(180deg, rgba(4,17,31,.28), rgba(4,17,31,.66));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 30px 90px rgba(0,0,0,.35);
}

.entry-zone::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,.9), rgba(0,0,0,.25));
}

.game-board {
  min-height: 820px;
  border-radius: 0;
  border: 4px solid #0b2236;
  box-shadow:
    0 0 0 4px #173650,
    inset 0 0 0 4px rgba(255,255,255,.05),
    0 30px 90px rgba(0,0,0,.35);
  image-rendering: pixelated;
}

.entry-city {
  position: absolute;
  inset: auto 0 115px;
  height: 220px;
  background:
    linear-gradient(180deg, transparent, rgba(0,0,0,.25)),
    url("https://images.unsplash.com/photo-1514565131-fce0801e5785?auto=format&fit=crop&w=1600&q=80") center/cover;
  opacity: .22;
}

.game-hud {
  position: absolute;
  left: 24px;
  right: 24px;
  top: 22px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border: 4px solid #173650;
  background: rgba(3,10,19,.84);
  color: #d9f4ff;
  font-size: .7rem;
  line-height: 1.8;
  z-index: 3;
}

.entry-platform {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 120px;
  height: 26px;
  background: linear-gradient(180deg, #1d3145, #0e1a26);
}

.entry-platform::after {
  content: "";
  position: absolute;
  inset: auto 0 -46px;
  height: 46px;
  background:
    linear-gradient(90deg, rgba(255,255,255,.05) 0 12%, transparent 12% 100%),
    linear-gradient(180deg, #15283a, #0b1620);
  background-size: 42px 100%;
}

.pipe {
  position: absolute;
  left: 50%;
  bottom: 120px;
  width: 230px;
  height: 170px;
  transform: translateX(-50%);
}

.center-pipe {
  bottom: 18px;
  z-index: 1;
}

.small-pipe {
  position: relative;
  left: auto;
  bottom: auto;
  width: 148px;
  height: 126px;
  transform: none;
}

.small-pipe .pipe-rim {
  left: -10px;
  right: -10px;
  height: 32px;
}

.small-pipe .pipe-body {
  inset: 20px 0 0;
}

.center-pipe.small-pipe {
  width: 148px;
  height: 126px;
}

.center-pipe.small-pipe .pipe-shadow {
  width: 210px;
  height: 28px;
  bottom: -14px;
}

.pipe-rim {
  position: absolute;
  left: -16px;
  right: -16px;
  top: 0;
  height: 42px;
  border-radius: 22px;
  background: linear-gradient(180deg, #38db80, #149148);
  box-shadow: inset 0 6px 0 rgba(255,255,255,.2), 0 18px 24px rgba(0,0,0,.3);
}

.pipe-body {
  position: absolute;
  inset: 28px 0 0;
  border-radius: 0 0 28px 28px;
  background:
    linear-gradient(90deg, rgba(255,255,255,.18), transparent 20%, transparent 78%, rgba(0,0,0,.18)),
    linear-gradient(180deg, #16a44f, #0c6c33);
}

.pipe-shadow {
  position: absolute;
  left: 50%;
  bottom: -16px;
  width: 320px;
  height: 36px;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(0,0,0,.38), transparent 70%);
}

.mascot-button {
  position: absolute;
  left: 50%;
  bottom: 258px;
  width: 190px;
  height: 210px;
  transform: translateX(-50%);
  border: 0;
  background: transparent;
  z-index: 2;
  pointer-events: none;
}

.mascot-button:focus-visible {
  outline: 3px solid var(--signal);
  outline-offset: 8px;
  border-radius: 26px;
}

.mascot-wrap {
  position: absolute;
  inset: 0;
  transform-origin: center bottom;
  transition: transform .45s ease;
  animation: idleBounce 1s steps(2, end) infinite;
}

.entry-overlay.is-direction-left .mascot-wrap { transform: translate(-210px, 18px); }
.entry-overlay.is-direction-right .mascot-wrap { transform: translate(210px, 18px); }
.entry-overlay.is-direction-up .mascot-wrap { transform: translate(0, -182px); }
.entry-overlay.is-direction-down .mascot-wrap { transform: translate(0, 124px); }

.mascot {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 124px;
  height: 182px;
  transform: translateX(-50%);
  filter: drop-shadow(0 12px 0 rgba(0,0,0,.16));
}

.head, .cap-top, .cap-brim, .cap-mark, .moustache, .body, .overalls,
.overall-strap-left, .overall-strap-right, .arm-left, .arm-right,
.glove-left, .glove-right, .leg-left, .leg-right, .shoe-left, .shoe-right,
.eye-left, .eye-right, .overall-button-left, .overall-button-right {
  position: absolute;
}

.head { left: 34px; top: 28px; width: 58px; height: 60px; background: #ffcaa8; border-radius: 18px 18px 22px 22px; box-shadow: 0 0 0 4px #1b120d inset; }
.cap-top { left: 22px; top: 14px; width: 82px; height: 34px; background: #df2f2d; box-shadow: 0 0 0 4px #7c1414 inset; }
.cap-brim { left: 28px; top: 36px; width: 74px; height: 14px; background: #b71f1f; border-radius: 0 0 10px 10px; box-shadow: 0 0 0 4px #651212 inset; }
.cap-mark { left: 53px; top: 18px; width: 22px; height: 22px; display: grid; place-items: center; background: #fff7f7; color: #df2f2d; font-size: .82rem; font-weight: 800; box-shadow: 0 0 0 3px #c7c9d1 inset; }
.eye-left, .eye-right { top: 52px; width: 6px; height: 9px; background: #1b120d; border-radius: 3px; }
.eye-left { left: 48px; }
.eye-right { left: 71px; }
.moustache { left: 36px; top: 66px; width: 54px; height: 14px; background: #412816; border-radius: 4px 4px 10px 10px; box-shadow: 0 0 0 3px #20140d inset; }
.body { left: 29px; top: 84px; width: 64px; height: 60px; background: #77ff6f; border-radius: 12px 12px 18px 18px; box-shadow: 0 0 0 4px #2e8b2d inset; }
.overalls { left: 23px; top: 96px; width: 76px; height: 68px; background: #f5f7fb; border-radius: 14px 14px 16px 16px; box-shadow: 0 0 0 4px #b5bcc8 inset; }
.overall-strap-left, .overall-strap-right { top: 86px; width: 18px; height: 44px; background: #f5f7fb; box-shadow: 0 0 0 3px #b5bcc8 inset; }
.overall-strap-left { left: 24px; }
.overall-strap-right { right: 24px; }
.overall-button-left, .overall-button-right { top: 103px; width: 8px; height: 8px; background: #ffd166; box-shadow: 0 0 0 2px #7b5a11 inset; }
.overall-button-left { left: 38px; }
.overall-button-right { right: 38px; }
.arm-left, .arm-right { top: 92px; width: 20px; height: 56px; background: #ffcaa8; border-radius: 10px 10px 12px 12px; box-shadow: 0 0 0 4px #1b120d inset; }
.arm-left { left: 8px; transform: rotate(12deg); animation: armLeftWalk .42s steps(2, end) infinite; }
.arm-right { right: 8px; transform: rotate(-12deg); animation: armRightWalk .42s steps(2, end) infinite; }
.glove-left, .glove-right { top: 132px; width: 22px; height: 20px; background: #f7f9ff; border-radius: 8px; box-shadow: 0 0 0 4px #c6cbd6 inset; }
.glove-left { left: 4px; }
.glove-right { right: 4px; }
.leg-left, .leg-right { bottom: 20px; width: 20px; height: 42px; background: #ffffff; border-radius: 8px 8px 10px 10px; box-shadow: 0 0 0 4px #c6cbd6 inset; }
.leg-left { left: 34px; animation: legLeftWalk .42s steps(2, end) infinite; }
.leg-right { right: 34px; animation: legRightWalk .42s steps(2, end) infinite; }
.shoe-left, .shoe-right { bottom: 0; width: 30px; height: 16px; background: #5d2d17; border-radius: 8px 8px 10px 10px; box-shadow: 0 0 0 4px #2f160b inset; }
.shoe-left { left: 24px; }
.shoe-right { right: 24px; }

.entry-hint {
  position: absolute;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  padding: 14px 18px;
  border-radius: 999px;
  background: rgba(4,17,31,.74);
  border: 1px solid var(--line);
  color: var(--muted);
}

.choice-pipe {
  position: absolute;
  display: grid;
  justify-items: center;
  gap: 10px;
  z-index: 2;
  transition: transform .28s ease, filter .28s ease;
}

.choice-pipe.is-selected {
  filter: drop-shadow(0 0 20px rgba(255,204,71,.35));
}

.pipe-left.is-selected,
.pipe-right.is-selected {
  transform: scale(1.06);
}

.pipe-up.is-selected,
.pipe-down.is-selected {
  transform: translateX(-50%) scale(1.06);
}

.pipe-up {
  top: 170px;
  left: 50%;
  transform: translateX(-50%);
}

.pipe-left {
  left: 36px;
  bottom: 182px;
}

.pipe-right {
  right: 36px;
  bottom: 182px;
}

.pipe-down {
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
}

.choice-pipe-center {
  gap: 12px;
  z-index: 3;
  align-items: center;
}

.direction-badge,
.pipe-label {
  padding: 10px 12px;
  border: 4px solid #173650;
  background: rgba(3,10,19,.92);
  color: #f8f4d4;
  font-size: .6rem;
  line-height: 1.6;
  text-align: center;
}

.direction-badge {
  color: #7ceeb2;
}

.entry-overlay.is-playing.is-direction-left .mascot-wrap,
.entry-overlay.is-playing.is-direction-right .mascot-wrap,
.entry-overlay.is-playing.is-direction-up .mascot-wrap,
.entry-overlay.is-playing.is-direction-down .mascot-wrap {
  animation: none;
}

.entry-overlay.is-playing .arm-left,
.entry-overlay.is-playing .arm-right,
.entry-overlay.is-playing .leg-left,
.entry-overlay.is-playing .leg-right {
  animation-duration: .2s;
}

.entry-overlay.is-playing.is-direction-left .mascot-wrap { animation: pipeLeft .95s steps(5, end) forwards; }
.entry-overlay.is-playing.is-direction-right .mascot-wrap { animation: pipeRight .95s steps(5, end) forwards; }
.entry-overlay.is-playing.is-direction-up .mascot-wrap { animation: pipeUp .95s steps(5, end) forwards; }
.entry-overlay.is-playing.is-direction-down .mascot-wrap { animation: pipeDown .95s steps(5, end) forwards; }
.entry-overlay.is-playing.is-direction-down .mascot-button { z-index: 2; }
.entry-overlay.is-playing.is-direction-down .choice-pipe-center { z-index: 4; }

.entry-overlay.is-playing .entry-hint { opacity: 0; transform: translateX(-50%) translateY(18px); transition: opacity .3s ease, transform .3s ease; }

@keyframes idleBounce {
  0% { transform: translateY(0); }
  100% { transform: translateY(-4px); }
}

@keyframes armLeftWalk {
  0% { transform: rotate(12deg) translateY(0); }
  100% { transform: rotate(22deg) translateY(3px); }
}

@keyframes armRightWalk {
  0% { transform: rotate(-12deg) translateY(3px); }
  100% { transform: rotate(-24deg) translateY(0); }
}

@keyframes legLeftWalk {
  0% { transform: translateY(0); }
  100% { transform: translateY(4px); }
}

@keyframes legRightWalk {
  0% { transform: translateY(4px); }
  100% { transform: translateY(0); }
}

@keyframes pipeLeft {
  0% { transform: translate(0, 0) scale(1); }
  45% { transform: translate(-210px, 18px) scale(1); }
  100% { transform: translate(-210px, 122px) scale(.76); opacity: .96; }
}

@keyframes pipeRight {
  0% { transform: translate(0, 0) scale(1); }
  45% { transform: translate(210px, 18px) scale(1); }
  100% { transform: translate(210px, 122px) scale(.76); opacity: .96; }
}

@keyframes pipeUp {
  0% { transform: translate(0, 0) scale(1); }
  45% { transform: translate(0, -182px) scale(1); }
  100% { transform: translate(0, -112px) scale(.76); opacity: .96; }
}

@keyframes pipeDown {
  0% { transform: translate(0, 0) scale(1); }
  45% { transform: translate(0, 124px) scale(1); }
  100% { transform: translate(0, 212px) scale(.76); opacity: .96; }
}

.wrap { width: min(1220px, calc(100% - 34px)); margin: 0 auto; }
.topbar, .nav, .hero-actions, .stat-row, .footer-row { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.topbar { padding: 22px 0 12px; color: var(--muted); font-size: .9rem; }
.nav { align-items: center; padding: 10px 0 20px; }
.brand { text-decoration: none; font-size: 2rem; }
.nav-links { display: flex; gap: 22px; flex-wrap: wrap; }
.nav-links a, .button, .brand, .contact-card a, .footer-row a { text-decoration: none; transition: transform .28s ease, opacity .28s ease, color .28s ease, background-color .28s ease; }
.nav-links a:hover, .button:hover, .brand:hover, .contact-card a:hover, .footer-row a:hover { transform: translateY(-2px); }
.hero-shell { padding-bottom: 42px; }
.hero, .intro-grid, .contact-grid, .subpage-hero, .subpage-grid { display: grid; grid-template-columns: .92fr 1.08fr; gap: 24px; align-items: center; }
.hero { min-height: 82vh; }
.hero-stage { position: relative; min-height: 700px; }
.hero-copy p, .contact-copy p, .card p, .contact-card p, .showcase-card p { line-height: 1.8; color: var(--muted); }
.hero-image { position: absolute; inset: 0; border-radius: 36px; overflow: hidden; background: linear-gradient(180deg, rgba(4,17,31,.14), rgba(4,17,31,.74)), url("https://images.unsplash.com/photo-1585704032915-c3400ca199e7?auto=format&fit=crop&w=1600&q=80") center/cover; box-shadow: 0 36px 90px rgba(0,0,0,.36); }
.hero-image::before { content: ""; position: absolute; left: 8%; right: 8%; bottom: 17%; height: 18px; border-radius: 999px; background: linear-gradient(90deg, rgba(43,196,109,.18), rgba(255,255,255,.14), rgba(43,196,109,.18)); }
.hero-image::after { content: ""; position: absolute; width: 180px; height: 180px; right: 10%; top: 12%; border-radius: 50%; background: radial-gradient(circle, rgba(43,196,109,.22), transparent 70%); }
.floating-card, .glass-card, .contact-card, .card, .showcase-card { background: var(--surface); border: 1px solid var(--line); border-radius: 28px; backdrop-filter: blur(18px); box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 24px 60px rgba(0,0,0,.18); }
.floating-card { position: absolute; right: 20px; bottom: 20px; width: min(360px, calc(100% - 40px)); padding: 24px; }
.glass-card { position: absolute; left: 20px; top: 20px; width: min(250px, calc(100% - 40px)); padding: 20px; }
.mini-label { display: inline-block; margin-bottom: 10px; letter-spacing: .18em; text-transform: uppercase; font-size: .74rem; color: var(--signal); }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 22px; border-radius: 999px; border: 1px solid transparent; background: var(--accent); color: #08141f; font-weight: 700; }
.button.alt { background: transparent; color: var(--ink); border-color: var(--line); }
.button.light { background: var(--signal); color: #12171d; }
main section { padding: 92px 0; }
.stat-row { margin-top: 22px; }
.stat { flex: 1 1 150px; padding: 18px; border-radius: 24px; background: var(--surface-soft); border: 1px solid var(--line); }
.stat strong { display: block; font-size: 2rem; font-family: "Bricolage Grotesque", sans-serif; }
.section-title { max-width: 760px; margin-bottom: 22px; }
.section-title h2 { font-size: clamp(2.4rem, 5vw, 4.8rem); line-height: .9; }
.service-grid, .showcase-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card, .showcase-card, .contact-card { padding: 24px; }
.card h3, .showcase-card h3, .contact-card h3 { font-size: 1.7rem; }
.card-image, .showcase-image, .subpage-image { min-height: 240px; border-radius: 24px; background-size: cover; background-position: center; margin-bottom: 18px; box-shadow: 0 24px 50px rgba(0,0,0,.2); }
.service-a { background-image: linear-gradient(180deg, rgba(4,17,31,.08), rgba(4,17,31,.42)), url("https://images.unsplash.com/photo-1620626011761-996317b8d101?auto=format&fit=crop&w=1200&q=80"); }
.service-b { background-image: linear-gradient(180deg, rgba(4,17,31,.08), rgba(4,17,31,.42)), url("https://images.unsplash.com/photo-1581578731548-c64695cc6952?auto=format&fit=crop&w=1200&q=80"); }
.service-c { background-image: linear-gradient(180deg, rgba(4,17,31,.08), rgba(4,17,31,.42)), url("https://images.unsplash.com/photo-1504307651254-35680f356dfd?auto=format&fit=crop&w=1200&q=80"); }
.showcase-a { background-image: linear-gradient(180deg, rgba(4,17,31,.12), rgba(4,17,31,.44)), url("https://images.unsplash.com/photo-1494526585095-c41746248156?auto=format&fit=crop&w=1400&q=80"); }
.showcase-b { background-image: linear-gradient(180deg, rgba(4,17,31,.12), rgba(4,17,31,.44)), url("https://images.unsplash.com/photo-1505693416388-ac5ce068fe85?auto=format&fit=crop&w=1400&q=80"); }
.showcase-c { background-image: linear-gradient(180deg, rgba(4,17,31,.12), rgba(4,17,31,.44)), url("https://images.unsplash.com/photo-1512918728675-ed5a9ecdebfd?auto=format&fit=crop&w=1400&q=80"); }
.footer { padding: 24px 0 44px; }
.footer-row { padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); }
.subpage-shell { padding-bottom: 40px; }
.subpage-hero { min-height: 68vh; }
.subpage-image { min-height: 520px; }
.about-image { background-image: linear-gradient(180deg, rgba(4,17,31,.12), rgba(4,17,31,.5)), url("https://images.unsplash.com/photo-1513694203232-719a280e022f?auto=format&fit=crop&w=1400&q=80"); }
.services-image { background-image: linear-gradient(180deg, rgba(4,17,31,.12), rgba(4,17,31,.5)), url("https://images.unsplash.com/photo-1621905252472-e8f65c8c3a3f?auto=format&fit=crop&w=1400&q=80"); }
.projects-image { background-image: linear-gradient(180deg, rgba(4,17,31,.12), rgba(4,17,31,.5)), url("https://images.unsplash.com/photo-1484154218962-a197022b5858?auto=format&fit=crop&w=1400&q=80"); }
.contact-image { background-image: linear-gradient(180deg, rgba(4,17,31,.12), rgba(4,17,31,.5)), url("https://images.unsplash.com/photo-1505693416388-ac5ce068fe85?auto=format&fit=crop&w=1400&q=80"); }
.detail-stack { display: grid; gap: 18px; }
.reveal { transform: translateY(28px); opacity: 0; transition: transform .6s ease, opacity .6s ease; }
.reveal.show { transform: translateY(0); opacity: 1; }

@media (max-width: 960px) {
  .hero, .intro-grid, .contact-grid, .subpage-hero, .subpage-grid, .service-grid, .showcase-grid { grid-template-columns: 1fr; }
  .hero-stage { min-height: 520px; }
  .entry-zone { min-height: 720px; }
  .game-board { min-height: 720px; }
  .game-hud { font-size: .58rem; }
  .pipe-left { left: 8px; bottom: 188px; }
  .pipe-right { right: 8px; bottom: 188px; }
  .pipe-up { top: 182px; }
  .pipe-down { bottom: 18px; }
  .mascot-button { bottom: 258px; }
  .topbar, .nav, .hero-actions, .footer-row, .stat-row { flex-direction: column; align-items: flex-start; }
}
