/* ============================================================
   Salma Petrov: game-menu portfolio
   Edit the palette below to re-theme the whole site.
   ============================================================ */
:root {
  --bg-1: #140d26;
  --bg-2: #2a1745;
  --panel: #1f1438;
  --panel-2: #2b1d4a;
  --ink: #fdf3e7;
  --muted: #b9a9d6;
  --pink: #ff7eb6;
  --teal: #6ee7d8;
  --gold: #ffd36e;
  --line: #fdf3e7;
  --shadow: #0a0614;
  --px: 4px; /* "pixel" unit used for borders and shadows */
  --font-px: "Press Start 2P", ui-monospace, monospace;
  --font-body: "VT323", ui-monospace, monospace;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  background: var(--bg-1);
  font-family: var(--font-body);
  font-size: 1.6rem;
  line-height: 1.25;
  image-rendering: pixelated;
}

/* ---------- Background ---------- */
.sky {
  position: fixed; inset: 0; z-index: -2;
  background:
    radial-gradient(2px 2px at 12% 18%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 28% 62%, var(--teal) 50%, transparent 51%),
    radial-gradient(3px 3px at 45% 30%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 63% 80%, var(--pink) 50%, transparent 51%),
    radial-gradient(2px 2px at 78% 22%, #fff 50%, transparent 51%),
    radial-gradient(3px 3px at 90% 55%, var(--gold) 50%, transparent 51%),
    radial-gradient(2px 2px at 8% 85%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 55% 10%, var(--teal) 50%, transparent 51%),
    linear-gradient(180deg, var(--bg-1) 0%, var(--bg-2) 100%);
  animation: twinkle 4s steps(2) infinite;
}
@keyframes twinkle { 50% { filter: brightness(1.25); } }

.scanlines {
  position: fixed; inset: 0; z-index: 50; pointer-events: none;
  background: repeating-linear-gradient(
    to bottom, rgba(0,0,0,0) 0, rgba(0,0,0,0) 2px, rgba(0,0,0,.14) 3px);
  mix-blend-mode: multiply;
}

/* ---------- Layout ---------- */
#game {
  flex: 1;
  width: min(900px, 100% - 32px);
  margin: 0 auto;
  padding: 56px 0 32px;
}

.view { display: none; }
.view.active { display: block; animation: pop .25s steps(5); }
@keyframes pop {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

#title.active {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center; min-height: 70vh;
}
#menu.active { display: block; }

/* ---------- Title ---------- */
.eyebrow {
  font-family: var(--font-px); font-size: .6rem; letter-spacing: .15em;
  color: var(--teal); margin: 0 0 24px; text-transform: uppercase;
}
.logo { margin: 0; font-family: var(--font-px); line-height: 1.2; }
.logo-line {
  display: block;
  font-size: clamp(2rem, 9vw, 4.5rem);
  color: var(--ink);
  text-shadow: var(--px) var(--px) 0 var(--pink), calc(var(--px) * 2) calc(var(--px) * 2) 0 var(--shadow);
}
.logo-line.accent {
  color: var(--gold);
  text-shadow: var(--px) var(--px) 0 #c0392b, calc(var(--px) * 2) calc(var(--px) * 2) 0 var(--shadow);
}
.tagline { font-size: 1.9rem; color: var(--muted); margin: 28px 0 40px; }

.press-start {
  font-family: var(--font-px); font-size: 1rem; color: var(--ink);
  background: transparent; border: 0; cursor: pointer; padding: 12px 16px;
  animation: blink 1.1s steps(2) infinite;
}
.press-start:hover { color: var(--gold); }
@keyframes blink { 50% { opacity: 0; } }

.hint { margin-top: 28px; color: var(--muted); font-size: 1.3rem; }
kbd {
  font-family: var(--font-px); font-size: .55rem; padding: 3px 6px;
  background: var(--panel-2); border: 2px solid var(--muted); border-radius: 2px;
}

/* ---------- Menu ---------- */
.menu-title {
  font-family: var(--font-px); font-size: 1.2rem; color: var(--teal);
  margin: 0 0 32px; letter-spacing: .1em;
}
.menu-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.menu-item {
  font-family: var(--font-px); font-size: clamp(.75rem, 2.6vw, 1rem);
  color: var(--ink); background: transparent; border: 0; cursor: pointer;
  padding: 12px 20px; text-align: left; width: 100%;
  display: flex; align-items: center; gap: 14px;
}
.menu-item .cursor { visibility: hidden; color: var(--gold); }
.menu-item.selected, .menu-item:hover, .menu-item:focus-visible {
  color: var(--gold); outline: none;
}
.menu-item.selected .cursor, .menu-item:hover .cursor, .menu-item:focus-visible .cursor {
  visibility: visible; animation: nudge .5s steps(2) infinite;
}
@keyframes nudge { 50% { transform: translateX(4px); } }

/* ---------- Menu: HUD ---------- */
#menu .menu-title { text-align: center; }
#menu .hint { text-align: center; }

.hud {
  display: grid; grid-template-columns: auto 1fr; gap: 16px 28px; align-items: center;
  padding: 16px 20px; margin-bottom: 28px;
}
.hud-player { display: flex; align-items: center; gap: 14px; }
.hud-face {
  width: 78px; height: 78px; padding: 4px; background: #4a3380; /* 64px of art = 2x a 32px drawing */
  border: 3px solid var(--teal);
}
.hud-face svg, .hud-face img,
.preview-art img, .menu-item .icon img {
  width: 100%; height: 100%; display: block; image-rendering: pixelated; object-fit: contain;
}
.hud-face svg { image-rendering: pixelated; }
.hud-name { font-family: var(--font-px); font-size: .8rem; color: var(--gold); margin: 0 0 8px !important; }
.hud-class { font-family: var(--font-px); font-size: .5rem; color: var(--muted); margin: 0 !important; }

.xp-label {
  display: flex; justify-content: space-between;
  font-family: var(--font-px); font-size: .5rem; color: var(--teal); margin-bottom: 8px;
}
.xp-bar { height: 18px; background: var(--shadow); border: 3px solid var(--line); padding: 2px; }
.xp-bar i {
  display: block; height: 100%; width: 0;
  background: repeating-linear-gradient(90deg, var(--pink) 0 8px, #ff9fc9 8px 10px);
  transition: width 1.2s steps(14);
}

.hud-stats {
  grid-column: 1 / -1; list-style: none; margin: 0 !important; padding: 12px 0 0 !important;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  border-top: 3px dashed rgba(253, 243, 231, .25);
}
.hud-stats li { margin: 0; display: flex; align-items: center; gap: 10px; }
.hud-stats li::marker { content: ""; }
.hud-stats b { font-family: var(--font-px); font-size: 1.1rem; color: var(--gold); text-shadow: 2px 2px 0 var(--shadow); }
.hud-stats span { font-family: var(--font-px); font-size: .45rem; line-height: 1.6; color: var(--muted); }

/* ---------- Menu: list + preview ---------- */
.menu-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 28px; align-items: start; margin-bottom: 8px;
}
.menu-list { gap: 4px; }
.menu-item { padding: 12px 14px; border: 3px solid transparent; }
.menu-item.selected, .menu-item:hover, .menu-item:focus-visible {
  background: rgba(255, 211, 110, .08); border-color: rgba(255, 211, 110, .55);
}
.menu-item .icon { width: 32px; height: 32px; flex: none; image-rendering: pixelated; }
.menu-item .icon svg { width: 100%; height: 100%; display: block; }
.menu-item .label { flex: 1; }
.menu-item .tag {
  font-size: .5rem; background: var(--pink); color: var(--bg-1);
  padding: 4px 6px; animation: blink 1.2s steps(2) infinite;
}

.preview { margin: 0; text-align: left; min-height: 300px; }
.preview-art {
  width: 124px; height: 124px; padding: 10px; margin-bottom: 18px; /* 96px of art = 3x */
  background: #4a3380; border: var(--px) solid var(--teal);
  box-shadow: var(--px) var(--px) 0 var(--shadow);
}
.preview-art svg { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.preview-art.swap { animation: pop .2s steps(4); }
.preview h3 { color: var(--gold); font-size: .95rem; margin-bottom: 14px; }
.preview-meta {
  display: inline-block; font-family: var(--font-px); font-size: .55rem;
  color: var(--bg-1); background: var(--teal); padding: 6px 8px; margin: 6px 0 0 !important;
}

/* ---------- Menu: ground strip ---------- */
/* The strip is 56px tall; the extra height above it is headroom for the hamster. */
.ground { position: relative; height: 96px; margin-top: 20px; overflow: hidden; }
.ground::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 56px;
  border-top: var(--px) solid #5bbf6a;
  background:
    repeating-linear-gradient(90deg, #5bbf6a 0 4px, #4aa75a 4px 8px) top / 100% 8px no-repeat,
    repeating-linear-gradient(90deg, #4a3126 0 16px, #3b261d 16px 32px) bottom / 100% 40px no-repeat;
}
.hamster {
  position: absolute; bottom: 52px; left: -80px; width: 48px; height: 28px; z-index: 1;
  animation: dash 16s linear infinite;
}
.hamster svg { width: 100%; height: 100%; display: block; image-rendering: pixelated; animation: hop .3s steps(2) infinite; }
@keyframes dash { to { left: 100%; } }
@keyframes hop { 50% { transform: translateY(-3px); } }

@media (max-width: 720px) {
  .menu-layout { grid-template-columns: 1fr; }
  .preview { min-height: 0; }
  .hud { grid-template-columns: 1fr; }
  .hud-stats { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Sub-screens ---------- */
.screen h2 {
  font-family: var(--font-px); font-size: clamp(1rem, 3.4vw, 1.6rem);
  color: var(--gold); margin: 12px 0 24px; outline: none;
  text-shadow: 3px 3px 0 var(--shadow);
}
.screen-note { color: var(--muted); margin: -8px 0 20px; }
.screen-note code, .panel code { color: var(--teal); }

.back {
  font-family: var(--font-px); font-size: .65rem; color: var(--ink);
  background: var(--panel-2); border: var(--px) solid var(--line);
  padding: 10px 14px; cursor: pointer; box-shadow: var(--px) var(--px) 0 var(--shadow);
}
.back:hover, .back:focus-visible { color: var(--gold); border-color: var(--gold); outline: none; }

/* Pixel-bordered panel: stepped corners via clip-path */
.panel {
  position: relative;
  background: var(--panel);
  border: var(--px) solid var(--line);
  padding: 20px 22px;
  margin: 0 0 24px;
  box-shadow: calc(var(--px) * 2) calc(var(--px) * 2) 0 var(--shadow);
}
.panel h3 {
  font-family: var(--font-px); font-size: .8rem; line-height: 1.6;
  color: var(--teal); margin: 0 0 12px;
}
.panel p { margin: 0 0 10px; }
.panel ul { margin: 0 0 12px; padding-left: 1.2em; }
.panel li { margin-bottom: 6px; }
.panel li::marker { color: var(--pink); content: "\25B8  "; }
.muted { color: var(--muted); }
.item-title { color: var(--gold); font-size: 1.7rem; }
.date { color: var(--muted); font-size: 1.4rem;}
.date::before { content: "\2022\00a0"; }

.badge {
  display: inline-block; font-family: var(--font-px); font-size: .5rem;
  background: var(--teal); color: var(--bg-1); padding: 5px 8px; margin-bottom: 10px;
}
.badge.hot { background: var(--pink); animation: blink 1.4s steps(2) infinite; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; }
.tags span {
  font-size: 1.25rem; padding: 2px 10px; background: var(--panel-2);
  border: 2px solid var(--muted); color: var(--ink);
}

.level.featured { border-color: var(--gold); }
.level.featured::before {
  content: "\2605  FEATURED SIDE QUEST"; position: absolute; top: -14px; right: 16px;
  font-family: var(--font-px); font-size: .5rem; background: var(--gold); color: var(--bg-1);
  padding: 5px 8px;
}

/* ---------- Profile ---------- */
.profile { display: grid; grid-template-columns: 160px 1fr; gap: 24px; align-items: center; }
.avatar {
  width: 152px; height: 152px; background: var(--panel-2); /* 128px of art = 4x */
  border: var(--px) solid var(--teal); padding: 8px;
}
.avatar svg, .avatar img { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.stats { margin: 0; display: grid; gap: 8px; }
.stats div { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.stats dt { font-family: var(--font-px); font-size: .6rem; color: var(--pink); min-width: 110px; padding-top: 6px; }
.stats dd { margin: 5px; }

/* ---------- Inventory ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 24px; }
.slots { list-style: none !important; padding: 0 !important; display: flex; flex-wrap: wrap; gap: 8px; }
.slots li {
  margin: 0; padding: 4px 10px; background: var(--panel-2);
  border: 2px solid var(--muted); font-size: 1.3rem;
  transition: transform .1s steps(2), border-color .1s;
}
.slots li::marker { content: ""; }
.slots li:hover { transform: translateY(-3px); border-color: var(--gold); color: var(--gold); }

/* ---------- Buttons & links ---------- */
.links { display: flex; flex-wrap: wrap; gap: 12px; margin: 16px 0 0 !important; }
.btn {
  font-family: var(--font-px); font-size: .65rem; color: var(--bg-1);
  background: var(--gold); text-decoration: none; padding: 12px 16px;
  border: var(--px) solid var(--line); box-shadow: var(--px) var(--px) 0 var(--shadow);
  transition: transform .08s steps(2);
}
.btn:hover, .btn:focus-visible { background: var(--pink); outline: none; transform: translate(-2px, -2px); }
.btn:active { transform: translate(2px, 2px); box-shadow: none; }
.btn.disabled { opacity: .45; pointer-events: none; }

/* ---------- Collapsible projects ---------- */
.project { padding: 0; }
.project > summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 22px;
}
.project > summary::-webkit-details-marker { display: none; }
.project > summary:focus-visible { outline: 3px dashed var(--gold); outline-offset: -6px; }
.proj-head { display: block; min-width: 0; }
.proj-head h3 { margin: 6px 0 8px; font-size: 1rem; transition: color .1s steps(2); }
.proj-sub { display: block; }
.project > summary:hover h3, .project > summary:focus-visible h3 { color: var(--gold); }

/* A pixel "+" box that turns into a "-" when the project is open */
.proj-toggle {
  flex: none; width: 38px; height: 38px; display: grid; place-items: center;
  background: var(--panel-2); border: 3px solid var(--line);
  box-shadow: 3px 3px 0 var(--shadow);
  font-family: var(--font-px); font-size: 1rem; color: var(--ink);
}
.proj-toggle::before { content: "+"; }
.project[open] .proj-toggle::before { content: "\2212"; }
.project > summary:hover .proj-toggle { color: var(--gold); border-color: var(--gold); }

.proj-body { padding: 16px 22px 22px; border-top: 3px dashed rgba(253, 243, 231, .25); }

/* ---------- Screenshot carousels (one inside each project) ---------- */
.carousel { max-width: 560px; margin: 22px auto 0; }
.carousel:focus-visible { outline: 3px dashed var(--gold); outline-offset: 4px; }
.carousel-label {
  font-family: var(--font-px); font-size: .55rem; color: var(--gold);
  margin: 0 0 10px !important;
}

.carousel-frame {
  position: relative; overflow: hidden; aspect-ratio: 16 / 9;
  background: var(--shadow); border: var(--px) solid var(--teal);
  box-shadow: var(--px) var(--px) 0 var(--shadow);
  touch-action: pan-y; /* let the page scroll vertically, we handle horizontal swipes */
}
.carousel-track { display: flex; height: 100%; transition: transform .45s steps(8); }
.slide { flex: 0 0 100%; height: 100%; margin: 0; position: relative; }
/* Screenshots are usually not pixel art, so smooth them (the page default is pixelated) */
.slide img {
  width: 100%; height: 100%; display: block; object-fit: contain;
  image-rendering: auto; background: var(--shadow); user-select: none;
}

.slot {
  width: 100%; height: 100%; display: grid; place-content: center; justify-items: center;
  gap: 8px; text-align: center; color: var(--muted);
  background: repeating-conic-gradient(var(--panel-2) 0% 25%, var(--panel) 0% 50%) 0 0 / 28px 28px;
}
.slot svg { width: 48px; height: 48px; image-rendering: pixelated; }
.slot b { font-family: var(--font-px); font-size: .5rem; line-height: 1.8; color: var(--gold); }
.slot span { font-size: 1.15rem; }

.car-btn {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  font-family: var(--font-px); font-size: .65rem; color: var(--ink);
  background: rgba(10, 6, 20, .75); border: 3px solid var(--line);
  padding: 10px 8px; cursor: pointer;
}
.car-btn.prev { left: 6px; }
.car-btn.next { right: 6px; }
.car-btn:hover, .car-btn:focus-visible { color: var(--gold); border-color: var(--gold); outline: none; }

.carousel-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 12px; }
.carousel-caption { margin: 0 !important; font-size: 1.35rem; min-height: 1.25em; }
.carousel-count { margin: 0 !important; font-family: var(--font-px); font-size: .5rem; color: var(--teal); white-space: nowrap; }

.carousel-dots { display: flex; justify-content: center; gap: 8px; margin-top: 10px; }
.dot {
  width: 12px; height: 12px; padding: 0; cursor: pointer;
  background: var(--panel-2); border: 3px solid var(--muted);
}
.dot:hover { border-color: var(--gold); }
.dot[aria-current="true"] { background: var(--gold); border-color: var(--gold); }

@media (max-width: 600px) {
  .project > summary { padding: 16px; }
  .proj-body { padding: 14px 16px 18px; }
}

/* ---------- Art gallery ---------- */
.art-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 40px;
}
.art-card {
  width: 100%; display: block; padding: 0; cursor: pointer; text-align: left;
  background: var(--panel); color: var(--ink); font-family: var(--font-body);
  border: var(--px) solid var(--line);
  box-shadow: calc(var(--px) * 2) calc(var(--px) * 2) 0 var(--shadow);
  transition: transform .1s steps(2);
}
.art-card:hover, .art-card:focus-visible {
  transform: translate(-2px, -2px); border-color: var(--gold); outline: none;
}
.art-thumb { display: block; aspect-ratio: 1; background: var(--shadow); overflow: hidden; }
.art-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; image-rendering: auto; }
.art-thumb img.pixel { image-rendering: pixelated; }
.art-thumb .slot { height: 100%; }
.art-info { display: block; padding: 10px 12px 12px; border-top: 3px dashed rgba(253, 243, 231, .25); }
.art-info b { display: block; font-family: var(--font-px); font-size: .55rem; line-height: 1.6; color: var(--gold); margin-bottom: 4px; }
.art-info span { color: var(--muted); font-size: 1.2rem; }

/* Viewer */
#lightbox {
  width: min(760px, 94vw); max-height: 92vh; padding: 18px; color: var(--ink);
  background: var(--panel); border: var(--px) solid var(--gold);
  box-shadow: calc(var(--px) * 2) calc(var(--px) * 2) 0 var(--shadow);
}
#lightbox::backdrop { background: rgba(10, 6, 20, .85); }
#lightbox figure { margin: 12px 0; }
.lb-art { background: var(--shadow); border: 3px solid var(--teal); display: grid; place-items: center; }
.lb-art img { max-width: 100%; max-height: 64vh; display: block; image-rendering: auto; }
.lb-art img.pixel { image-rendering: pixelated; }
.lb-art .slot { width: 100%; aspect-ratio: 4 / 3; }
#lightbox figcaption { margin-top: 12px; }
#lightbox figcaption b { display: block; font-family: var(--font-px); font-size: .8rem; color: var(--gold); margin-bottom: 6px; }
#lightbox figcaption span { color: var(--muted); }
.lb-close {
  font-family: var(--font-px); font-size: .6rem; color: var(--ink); cursor: pointer;
  background: var(--panel-2); border: 3px solid var(--line); padding: 8px 10px;
}
.lb-close:hover, .lb-close:focus-visible { color: var(--gold); border-color: var(--gold); outline: none; }
.lb-nav { display: flex; align-items: center; justify-content: center; gap: 16px; }
.lb-nav .car-btn { position: static; transform: none; }
#lb-count { font-family: var(--font-px); font-size: .55rem; color: var(--teal); }


/* ---------- Research ---------- */
.paper h3 { color: var(--gold); font-size: .85rem; }
.paper .meta { color: var(--muted); }
.paper.placeholder { border-style: dashed; }

/* ---------- Contact ---------- */
.center { text-align: center; }
.center .links { justify-content: center; }
.big { font-family: var(--font-px); font-size: 1rem; color: var(--gold); margin-bottom: 16px !important; }

/* ---------- HUD & footer ---------- */
.hud-btn {
  position: fixed; top: 14px; right: 14px; z-index: 60;
  font-family: var(--font-px); font-size: .5rem; color: var(--ink);
  background: var(--panel-2); border: 3px solid var(--line); padding: 8px 10px; cursor: pointer;
}
.hud-btn:hover, .hud-btn:focus-visible { color: var(--gold); outline: none; }
.footer { text-align: center; color: var(--muted); padding: 24px 12px 32px; font-size: 1.25rem; }

/* ---------- Focus ---------- */
a:focus-visible, button:focus-visible { outline: 3px dashed var(--gold); outline-offset: 3px; }

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
  body { font-size: 1.45rem; }
  .profile { grid-template-columns: 1fr; justify-items: center; text-align: left; }
  .stats dt { min-width: 100%; }
  #game { padding-top: 64px; }
}

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

.hud-btn {
  position: fixed; top: 14px; right: 14px; z-index: 60;
  font-family: var(--font-px); font-size: .5rem; color: var(--ink);
  background: var(--panel-2); border: 3px solid var(--line); padding: 8px 10px; cursor: pointer;
  white-space: nowrap;
}
.hud-btn:hover, .hud-btn:focus-visible { color: var(--gold); outline: none; }

/* Shift the music button left of the SFX button */
#music-toggle { right: 116px; }

.hud-btn { top: 8px; right: 8px; padding: 6px 8px; }
#music-toggle { right: 100px; }