@font-face {
  font-family: 'Press Start 2P';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/press-start-2p-latin.woff2') format('woff2');
}

@font-face {
  font-family: 'VT323';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/vt323-latin.woff2') format('woff2');
}

:root {
  color-scheme: dark;
  --night: #0B0B1E;
  --panel: #1A1A3A;
  --ink: #F1F0E4;
  --action: #FFCC33;
  --brand: #4D7CFE;
  --alert: #FF4D5E;
  --success: #3EDB7F;
  --display: 'Press Start 2P', monospace;
  --body: 'VT323', monospace;
  --trail-x: 2.5vw;
  background: var(--night);
  color: var(--ink);
  font-family: var(--body);
}

* { box-sizing: border-box; }
body { margin: 0; }
img { max-width: 100%; image-rendering: pixelated; }
a { color: inherit; text-underline-offset: 0.25em; }
button, input, textarea { font: inherit; }
::selection { color: var(--night); background: var(--ink); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 5px; }
input, textarea { caret-color: var(--ink); }
html { scrollbar-color: var(--brand) var(--night); }

.first-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 1536 / 1024;
}

.map-plate {
  position: absolute;
  left: 0;
  top: 6.84%;
  width: 100%;
  height: 73.63%;
  object-fit: cover;
}

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

h1, h2, h3 { font-family: var(--display); font-weight: 400; margin: 0; }
p { font-size: 28px; line-height: 1.15; margin: 0; }
.site-header {
  position: fixed;
  z-index: 10;
  inset: 0 0 auto;
  height: 4.5573vw;
  background: var(--night);
  border-bottom: 2px solid var(--brand);
  font-family: var(--display);
}
.brand-link {
  position: absolute;
  left: 3.78%;
  top: 0.8vw;
  display: flex;
  align-items: center;
  gap: 2.734375vw;
  text-decoration: none;
  font-size: 1.5625vw;
  min-height: 44px;
}
.brand-link img { width: 3.125vw; height: 3.125vw; }
.level-links {
  position: absolute;
  left: 33.53%;
  top: 0.75vw;
  display: flex;
  gap: 1.5vw;
  align-items: center;
}
.level-links a, .language-links a {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 0.91vw;
}
.level-links a { text-transform: uppercase; }
.level-links a[aria-current] { color: var(--action); border-bottom: 3px solid var(--action); }
.language-links { position: absolute; right: 2.8%; top: 0.75vw; display: flex; align-items: center; }
.language-links a[aria-current] { color: var(--action); }
.hero-heading {
  position: absolute;
  top: 14.06%;
  left: 4.23%;
  font-size: 2.734375vw;
  line-height: 1.35;
  letter-spacing: 0;
}
.hero-heading span { display: block; }
.hero-description {
  position: absolute;
  top: 26.66%;
  left: 4.43%;
  width: 25.39%;
  font-size: max(20px, 1.82292vw);
  line-height: 1.05;
}
.primary-action {
  position: absolute;
  top: 36.52%;
  left: 4.43%;
  width: 25.2%;
  min-height: 44px;
  height: 6.05%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0 1.3vw;
  color: var(--night);
  background: var(--action);
  border: 3px solid var(--ink);
  font: max(11px, 0.78125vw)/1.5 var(--display);
  text-decoration: none;
}
.primary-action:hover { background: var(--ink); }
.level-hud {
  position: absolute;
  top: 7.81%;
  left: 81.77%;
  width: 15.63%;
  height: 5.57%;
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  gap: 0.6vw;
  border: 2px solid var(--brand);
  background: var(--night);
  font: 0.91vw var(--display);
}
.reward-icon { color: var(--action); }
.level-name { font-family: var(--body); font-size: 1.3vw; }
.map-character { position: absolute; left: 39.52%; top: 45.51%; width: 3.125%; height: auto; transform: translate(var(--map-x, 0px), var(--map-y, 0px)); }
.map-destination {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  color: var(--ink);
  background: var(--night);
  border: 3px solid var(--ink);
  font: 1.04vw/1.4 var(--display);
  text-decoration: none;
}
.map-destination:not(.destination-start) {
  padding: 3px;
  border: 0;
  background: var(--ink);
  clip-path: polygon(8px 0, calc(100% - 8px) 0, calc(100% - 8px) 4px, calc(100% - 4px) 4px, calc(100% - 4px) 8px, 100% 8px, 100% calc(100% - 8px), calc(100% - 4px) calc(100% - 8px), calc(100% - 4px) calc(100% - 4px), calc(100% - 8px) calc(100% - 4px), calc(100% - 8px) 100%, 8px 100%, 8px calc(100% - 4px), 4px calc(100% - 4px), 4px calc(100% - 8px), 0 calc(100% - 8px), 0 8px, 4px 8px, 4px 4px, 8px 4px);
}
.map-destination:not(.destination-start):hover { background: var(--action); }
.map-destination:not(.destination-start):focus-visible { background: var(--action); }
.map-destination:focus-visible .destination-label { background: var(--panel); }
.destination-label {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--night);
  clip-path: polygon(6px 0, calc(100% - 6px) 0, calc(100% - 6px) 3px, calc(100% - 3px) 3px, calc(100% - 3px) 6px, 100% 6px, 100% calc(100% - 6px), calc(100% - 3px) calc(100% - 6px), calc(100% - 3px) calc(100% - 3px), calc(100% - 6px) calc(100% - 3px), calc(100% - 6px) 100%, 6px 100%, 6px calc(100% - 3px), 3px calc(100% - 3px), 3px calc(100% - 6px), 0 calc(100% - 6px), 0 6px, 3px 6px, 3px 3px, 6px 3px);
}
.map-destination:hover { border-color: var(--action); }
.destination-mi-menu { left: 49.09%; top: 23.63%; width: 10.22%; height: 4.49%; }
.destination-sofi-poa { left: 70.64%; top: 36.04%; width: 11.39%; height: 5.18%; }
.destination-magicpass { left: 76.43%; top: 60.25%; width: 11.3%; height: 5.27%; }
.destination-start { left: 16.08%; top: 66.31%; width: 10%; height: 5.47%; flex-direction: column; border: 0; }
.destination-start span { font: 1.3vw var(--body); text-transform: uppercase; }
.destination-start { font-size: 1.3vw; }
.portfolio-preview { position: relative; margin-top: -10.354vw; padding: 0 4.43vw 6vw; }
.portfolio-preview h2 { font-size: 1.69vw; line-height: 1.35; }
.portfolio-intro { position: absolute; top: 0.78vw; right: 4%; font-size: max(20px, 1.3vw); }
.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1vw; margin-top: 1.37vw; }
.project-preview {
  position: relative;
  min-height: 210px;
  padding: 0 0 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.project-sign { display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: center; gap: 1.25vw; border: 2px solid var(--brand); background: var(--panel); padding: 1.7vw; }
.project-mi-menu { --project-color: #E59A28; }
.project-sofi-poa { --project-color: #2563EB; --project-accent: #B45309; }
.project-magicpass { --project-color: #2418FB; --project-accent: #00AFFB; --project-detail: #FC2CB2; }
.project-preview img { width: 64px; height: 64px; object-fit: contain; }
.project-preview h3 { font-size: 1.04vw; }
.project-preview a { display: flex; align-items: center; font-size: 24px; min-height: 44px; margin: 0 1.7vw; }
.project-description, .project-preview .technology-list { margin: 0 1.7vw; }
.project-preview a { margin-top: auto; }
.project-description { font-size: max(24px, 1.7vw); }
.project-preview::after { content: ''; position: absolute; inset: auto 1.7vw 40px auto; width: 12px; height: 12px; background: var(--project-color); }
.mission-scene { position: relative; height: 152px; display: flex; justify-content: center; align-items: flex-end; padding-bottom: 32px; }
.scene-prop { width: 96px; height: 96px; object-fit: contain; image-rendering: pixelated; }
.project-preview .scene-prop { width: 96px; height: 96px; }
.mission-platform { position: absolute; bottom: 0; width: 76%; height: 32px; background: var(--brand); border: 4px solid var(--ink); }
.mission-platform::before { content: ''; position: absolute; inset: -16px -4px auto; height: 16px; background: url('../sprites/ground.svg') left bottom / 32px 32px repeat-x; }
.mission-platform::after { content: ''; position: absolute; inset: 8px 12px; border-top: 4px dashed var(--night); }
.project-mi-menu .mission-scene { justify-content: flex-start; padding-left: 14%; }
.project-magicpass .mission-scene { justify-content: flex-end; padding-right: 14%; }
.project-preview h3 { overflow-wrap: anywhere; }
.technology-list { display: flex; flex-wrap: wrap; gap: 8px 16px; padding: 0; margin: 0; list-style: none; font-size: 24px; line-height: 1.3; }
.technology-list li { border: 1px solid var(--brand); padding: 4px 8px; }
.content-level { position: relative; padding: 7vw 8vw; border-top: 2px solid var(--brand); scroll-margin-top: 100px; }
main > section::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 var(--trail-x);
  width: 16px;
  background: url('../sprites/trail.svg') center top / 16px 32px repeat-y;
  image-rendering: pixelated;
  pointer-events: none;
}
.content-level::after {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 32px;
  background: url('../sprites/ground.svg') left bottom / 32px 32px repeat-x;
  image-rendering: pixelated;
  pointer-events: none;
}
.section-level {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin-right: 20px;
  padding: 8px;
  border: 2px solid var(--brand);
  background: var(--night);
  font-size: 12px;
  line-height: 1.5;
  white-space: nowrap;
}
section[id], article[id] { scroll-margin-top: 100px; }
.content-level h2 { font-size: clamp(20px, 2.1vw, 32px); line-height: 1.5; }
.content-level h3 { font-size: clamp(14px, 1.2vw, 20px); line-height: 1.6; }
.content-level p { font-size: clamp(24px, 2vw, 32px); line-height: 1.3; }
.content-level p, .project-description { text-wrap: pretty; }
.section-title { display: flex; align-items: center; gap: 24px; margin-bottom: 32px; }
.level-sprite { flex-shrink: 0; width: 64px; height: 64px; object-fit: contain; }
.experience-scene { display: grid; grid-template-columns: 160px minmax(0, 1fr) minmax(260px, 0.85fr); align-items: start; gap: 40px; }
.experience-copy { max-width: 42ch; }
.guide-scene { position: relative; margin-top: 40px; min-height: 240px; display: grid; justify-items: center; }
.guide-character { width: 128px; height: 192px; image-rendering: pixelated; }
.guide-platform, .station-platform { position: absolute; bottom: 0; width: 100%; height: 32px; background: var(--brand); border: 4px solid var(--ink); }
.inventory { padding: 24px; border: 4px solid var(--ink); background: var(--night); }
.experience-technologies { margin-top: 24px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.experience-technologies li { display: grid; min-height: 72px; align-content: center; text-align: center; padding: 12px 8px; border: 2px solid var(--brand); font-size: 24px; overflow-wrap: anywhere; }
.experience-level { background: var(--panel); }
.section-intro { margin: 24px 0 48px; }
.service-list { display: grid; gap: 56px; }
.service-entry { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 24px 40px; align-items: center; padding: 0; width: 82%; }
.service-entry:nth-child(2) { margin-left: 9%; }
.service-entry:nth-child(3) { margin-left: 18%; }
.service-platform { grid-row: span 2; position: relative; display: grid; place-items: center; height: 160px; padding-bottom: 32px; }
.service-platform span { position: absolute; inset: auto 0 0; height: 32px; background: var(--brand); border: 4px solid var(--ink); }
.service-platform span::before { content: ''; position: absolute; inset: -16px -4px auto; height: 16px; background: url('../sprites/ground.svg') left bottom / 32px 32px repeat-x; }
.service-entry p { max-width: 54ch; margin-top: 16px; }
.service-action { grid-column: 2; display: flex; align-items: center; width: fit-content; border: 2px solid var(--ink); font: 12px/1.6 var(--display); min-height: 48px; padding: 12px 16px; }
.service-action:hover { border-color: var(--action); }
.contact-level { background: var(--panel); }
.contact-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 7vw; }
.contact-station { position: relative; width: 240px; height: 216px; padding: 24px 32px; margin-bottom: 40px; }
.contact-station > img:first-child { width: 160px; height: 160px; }
.station-mail { position: absolute; right: 0; top: 0; width: 64px; height: 64px; }
.station-platform { left: 0; }
#contact-form { padding: 32px; border: 4px solid var(--ink); background: var(--night); }
.direct-links { display: grid; gap: 16px; margin-top: 32px; }
.direct-links a { display: flex; align-items: center; min-height: 48px; font-size: 28px; }
.contact-address { margin-top: 32px; overflow-wrap: anywhere; }
.form-field { display: grid; gap: 8px; margin-top: 24px; }
label { font-size: 28px; }
input, textarea { width: 100%; min-width: 0; padding: 12px; border: 2px solid var(--brand); color: var(--ink); background: var(--night); font-size: 24px; line-height: 1.3; border-radius: 0; }
textarea { resize: vertical; min-height: 150px; }
.field-hint, .field-error { font-size: 22px; line-height: 1.2; }
.field-error { color: var(--alert); }
[aria-invalid="true"] { border-color: var(--alert); }
.contact-level .form-note { font-size: 22px; margin-top: 16px; }
.send-button, .secret-button { min-height: 48px; padding: 16px 24px; border: 2px solid var(--ink); font: 12px/1.6 var(--display); cursor: pointer; border-radius: 0; }
.send-button { margin-top: 24px; color: var(--night); background: var(--action); }
.send-button:hover { background: var(--ink); }
.send-button:disabled { color: var(--ink); background: var(--panel); cursor: wait; }
.contact-level .form-status { font-size: 24px; margin-top: 20px; }
.form-status[data-state="error"] { color: var(--alert); }
.form-status[data-state="success"], .game-status { color: var(--success); }
.honeypot { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.site-footer { padding: 48px 8vw 110px; display: flex; align-items: center; gap: 48px; }
.site-footer img { width: 304px; height: 64px; }
.response-heading { font-size: clamp(20px, 3vw, 40px); line-height: 1.5; margin-top: 32px; }
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 30; padding: 12px 24px; color: var(--night); background: var(--ink); font-size: 24px; }
.skip-link:focus { top: 8px; }
.game-only { display: none; }
.has-js .game-only { display: block; }
.collectible { width: 48px; height: 48px; margin-top: 32px; color: var(--action); background: var(--night); border: 2px solid var(--brand); cursor: pointer; }
.collectible:disabled { cursor: default; border-color: var(--success); }
.game-extra { margin-top: 64px; padding-top: 32px; border-top: 2px solid var(--brand); }
.game-extra p { margin: 20px 0; max-width: 65ch; }
.secret-button { color: var(--ink); background: var(--night); }
.secret-button:hover { border-color: var(--action); }
.map-character.journey-active { position: fixed; z-index: 8; inset: calc(var(--header-height, 70px) + 24px) auto auto calc(var(--trail-x) - 16px); width: 48px; height: 72px; transform: translateY(var(--journey-offset, 0px)); pointer-events: none; }
.level-hud.is-travelling { position: fixed; z-index: 11; inset: 4.5573vw 4vw auto auto; width: 200px; height: 48px; font-size: 12px; }
.level-hud.is-travelling .level-name { font-size: 22px; }
.level-sprite.is-visible, .scene-prop.is-visible { animation: sprite-step 1.6s steps(2, end) infinite; }
.collectible.is-visible:not(:disabled) img { animation: coin-step 1.6s steps(2, end) infinite; }
.game-status.is-visible.is-unlocked { animation: reward-step 0.8s steps(4, end) 1; }
@keyframes sprite-step { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes coin-step { 0%, 100% { transform: scaleX(1); } 50% { transform: scaleX(0.5); } }
@keyframes reward-step { from { transform: translateY(8px); } to { transform: translateY(0); } }

@media (min-width: 1101px) {
  .site-header.journey-active { height: calc(4.5573vw + 48px); }
  section[id], article[id] { scroll-margin-top: calc(4.5573vw + 64px); }
}

@media (max-width: 1100px) {
  .site-header { height: 94px; }
  .brand-link { left: 24px; top: 8px; gap: 16px; font-size: 18px; }
  .brand-link img { width: 32px; height: 32px; }
  .language-links { top: 2px; right: 16px; }
  .language-links a { font-size: 12px; }
  .level-links { left: 24px; right: 24px; top: 48px; gap: 16px; justify-content: space-between; }
  .level-links a { font-size: 11px; }
  .first-frame { margin-top: 40px; }
  .hero-heading { font-size: 3vw; }
  .hero-description { top: 27%; width: 30%; font-size: 20px; line-height: 1.15; }
  .primary-action { top: 41%; font-size: 11px; height: auto; min-height: 64px; }
  .level-hud, .level-hud.is-travelling { position: fixed; z-index: 11; inset: 0 140px auto auto; width: 200px; height: 44px; font-size: 12px; }
  .level-name { font-size: 22px; }
  .map-destination { font-size: 11px; }
  .map-destination:not(.destination-start) { min-width: 120px; }
  .project-preview h3 { font-size: 13px; }
  .project-sign { grid-template-columns: 48px minmax(0, 1fr); gap: 12px; padding: 20px; }
  .project-preview img { width: 48px; height: 48px; }
  .project-preview .scene-prop { width: 96px; height: 96px; }
  .experience-scene { grid-template-columns: 128px minmax(0, 1fr); gap: 32px; }
  .inventory { grid-column: 1 / -1; }
  .experience-technologies { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .service-entry { grid-template-columns: 128px minmax(0, 1fr); }
  .service-action { grid-column: 2; }
}

@media (max-width: 760px) {
  :root { --trail-x: 8px; }
  .site-header { height: 190px; }
  .brand-link { left: 16px; font-size: 16px; gap: 12px; }
  .level-links { left: 16px; right: 16px; top: 50px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 4px; }
  .level-links a { font-size: 11px; }
  .first-frame { margin-top: 190px; aspect-ratio: auto; height: auto; padding-bottom: 16px; display: flow-root; }
  .title-screen { position: relative; padding: 32px 24px 300px; }
  .map-plate { top: auto; bottom: 0; height: 300px; object-fit: cover; object-position: 70% center; }
  .hero-heading, .hero-description, .primary-action { position: relative; inset: auto; width: auto; }
  .hero-heading { font-size: clamp(24px, 6.6vw, 44px); line-height: 1.5; }
  .hero-description { margin-top: 20px; font-size: 26px; line-height: 1.2; max-width: 32ch; }
  .primary-action { margin-top: 24px; padding: 16px; height: auto; max-width: 450px; font-size: 11px; }
  .primary-action svg { flex-shrink: 0; }
  .level-hud, .level-hud.is-travelling { inset: 138px 16px auto auto; width: calc((100% - 36px) / 2); font-size: 11px; }
  .level-name { font-size: 20px; }
  .level-hud.is-travelling .level-name { font-size: 20px; }
  .map-character { left: 32px; top: auto; bottom: 64px; width: 48px; }
  .map-destination { top: auto; font-size: 11px; }
  .destination-mi-menu { left: 8%; bottom: 204px; width: 42%; height: 48px; }
  .destination-sofi-poa { left: 45%; bottom: 130px; width: 48%; height: 48px; }
  .destination-magicpass { left: 44%; bottom: 56px; width: 49%; height: 48px; }
  .destination-start { left: 5%; bottom: 12px; width: 34%; height: 48px; font-size: 12px; }
  .destination-start span { font-size: 20px; }
  .portfolio-preview { margin-top: 0; padding: 48px 24px 56px; }
  main > section::before { width: 8px; background-size: 16px 32px; }
  .portfolio-preview h2 { font-size: 20px; line-height: 1.6; }
  .portfolio-intro { position: static; margin-top: 16px; font-size: 24px; }
  .project-grid { grid-template-columns: 1fr; gap: 24px; margin-top: 32px; }
  .project-preview { gap: 24px; }
  .project-sign { padding: 24px; gap: 16px; grid-template-columns: 48px minmax(0, 1fr); }
  .project-preview h3 { font-size: 14px; line-height: 1.5; }
  .content-level { padding: 56px 24px; }
  section[id], article[id] { scroll-margin-top: 206px; }
  .section-title { gap: 16px; align-items: flex-start; }
  .content-level h2 { font-size: 20px; }
  .section-level { font-size: 11px; margin-right: 12px; padding: 6px; }
  .section-title .level-sprite { width: 48px; height: 48px; }
  .experience-scene { display: flex; flex-direction: column; gap: 32px; }
  .guide-scene { width: 128px; margin: 0 auto; min-height: 224px; }
  .inventory { width: 100%; padding: 16px; }
  .experience-technologies { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .service-list { gap: 48px; }
  .service-entry { gap: 16px; grid-template-columns: 80px minmax(0, 1fr); width: 100%; }
  .service-entry:nth-child(2), .service-entry:nth-child(3) { margin-left: 0; }
  .service-platform { height: 128px; }
  .service-platform .scene-prop { width: 64px; height: 64px; }
  .service-action { grid-column: 1 / -1; font-size: 11px; width: 100%; }
  .contact-columns { grid-template-columns: 1fr; gap: 40px; }
  .contact-station { margin: 0 auto 32px; }
  #contact-form { padding: 20px; }
  .direct-links a { font-size: 26px; }
  .site-footer { padding: 40px 24px 100px; display: grid; gap: 24px; }
  .site-footer img { max-width: 100%; height: auto; }
  .map-character.journey-active { left: 0; width: 24px; height: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  .level-sprite.is-visible, .scene-prop.is-visible, .collectible.is-visible:not(:disabled) img, .game-status.is-visible.is-unlocked { animation: none; }
  .map-character, .map-character.journey-active { transform: none; }
}
