/* George Paraschos — console / CRT portfolio. Grey plastic TV, pale CRT glass, burgundy (#38070e) details. */
:root {
  --bezel: #a3a39e;
  --bezel-hi: #cfcfca;
  --bezel-lo: #6f6f6b;
  --screen: #e4e5e0;
  --screen-2: #d6d8d1;
  --screen-3: #c3c6bd;
  --ink: #111216;
  --ink-2: #544a4b;
  --paper: #f1efe8;
  --accent: #38070e;
  --accent-2: #5c1220;
  --gold: #d6a84a;
  --red: #d8452c;
  --green: #2fa85c;
  --pixel: 'Press Start 2P', ui-monospace, monospace;
  --display: 'Inter Tight', 'Arial Black', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --hud-h: 52px;
  --foot-h: 34px;
  --pad: clamp(16px, 4vw, 56px);
  --checker: repeating-conic-gradient(var(--accent) 0 25%, var(--paper) 0 50%);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  background: #0f0f0f;
  color: var(--ink);
  font-family: var(--mono);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
.px { font-family: var(--pixel); letter-spacing: 0.02em; }
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
img { display: block; }
::selection { background: var(--accent); color: var(--paper); }

/* ---------- console bezel ---------- */
.console {
  position: fixed;
  inset: 0;
  padding: clamp(8px, 2vw, 30px) clamp(8px, 2vw, 30px) clamp(40px, 5vw, 64px);
  background: radial-gradient(130% 90% at 50% -10%, var(--bezel-hi), var(--bezel) 45%, var(--bezel-lo) 100%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .25), inset 0 -4px 0 rgba(0, 0, 0, .3);
}
.console::before { /* plastic grain */
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .3;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 .6 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.bezel-bottom {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: clamp(40px, 5vw, 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.emboss {
  font-family: var(--pixel);
  font-size: clamp(12px, 1.5vw, 18px);
  color: var(--bezel-lo);
  text-shadow: 0 1px 0 rgba(255, 255, 255, .22), 0 -1px 0 rgba(0, 0, 0, .35);
  letter-spacing: .2em;
}
.led {
  position: absolute;
  left: clamp(18px, 3vw, 44px);
  width: 9px; height: 9px;
  border-radius: 50%;
  background: #7fe07a;
  box-shadow: 0 0 8px #7fe07a, inset 0 -1px 2px rgba(0, 0, 0, .3);
}
.grille {
  position: absolute;
  right: clamp(18px, 3vw, 44px);
  width: clamp(48px, 7vw, 96px);
  height: 14px;
  border-radius: 3px;
  background: repeating-linear-gradient(90deg, var(--bezel-lo) 0 4px, transparent 4px 8px);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .35);
}

/* ---------- CRT screen ---------- */
.screen {
  position: relative;
  height: 100%;
  overflow: hidden;
  border-radius: clamp(14px, 2.4vw, 32px);
  background: radial-gradient(120% 90% at 50% 40%, #eeefea 0%, var(--screen) 50%, var(--screen-2) 100%);
  box-shadow:
    0 0 0 clamp(4px, .55vw, 7px) #1b1b1b,
    0 0 0 calc(clamp(4px, .55vw, 7px) + 2px) rgba(0, 0, 0, .2),
    0 4px 0 calc(clamp(4px, .55vw, 7px) + 1px) rgba(255, 255, 255, .15);
}
.stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  pointer-events: none;
}
.fx {
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  border-radius: inherit;
  background:
    repeating-linear-gradient(0deg, rgba(20, 20, 20, .06) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at 50% 50%, transparent 58%, rgba(30, 24, 24, .3) 100%);
  animation: flicker 5s infinite steps(1);
}
.fx::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(60% 40% at 22% 8%, rgba(255, 255, 255, .25), transparent 70%);
}
@keyframes flicker { 0%, 100% { opacity: 1; } 48% { opacity: .93; } 49% { opacity: 1; } 92% { opacity: .96; } }

.glitch {
  position: absolute;
  inset: 0;
  z-index: 25;
  pointer-events: none;
  opacity: 0;
  background:
    repeating-linear-gradient(0deg, transparent 0 14px, rgba(56, 7, 14, .14) 14px 16px),
    linear-gradient(transparent 30%, rgba(228, 229, 224, .9) 30% 34%, transparent 34% 62%, rgba(56, 7, 14, .2) 62% 64%, transparent 64%);
}
.glitch.on { animation: glitch .26s steps(4) 1; }
@keyframes glitch {
  0% { opacity: 1; transform: translateX(-6px); }
  33% { opacity: .8; transform: translateX(8px) scaleY(1.1); }
  66% { opacity: .6; transform: translateX(-3px); }
  100% { opacity: 0; transform: none; }
}

.crt-on {
  position: absolute;
  inset: 0;
  z-index: 30;
  pointer-events: none;
  background: #0f0f0f;
  clip-path: inset(50% 0 50% 0);
}
.crt-on::after {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 2px;
  background: #fff;
  box-shadow: 0 0 18px 4px rgba(255, 238, 230, .85);
  opacity: 0;
}
.crt-on.run { animation: crtOn .7s ease-out 1 forwards; }
.crt-on.run::after { animation: crtLine .7s ease-out 1 forwards; }
@keyframes crtOn { 0% { clip-path: inset(0 0 0 0); } 45% { clip-path: inset(0 0 0 0); } 100% { clip-path: inset(50% 0 50% 0); } }
@keyframes crtLine { 0% { opacity: 1; transform: scaleX(0); } 35% { opacity: 1; transform: scaleX(1); } 100% { opacity: 0; transform: scaleX(1) scaleY(40); } }

/* ---------- HUD ---------- */
.hud {
  position: absolute;
  left: 0; right: 0;
  z-index: 12;
  display: flex;
  align-items: center;
  padding: 0 var(--pad);
}
.hud-top {
  top: 0;
  height: var(--hud-h);
  gap: 16px;
  border-bottom: 2px solid var(--ink);
  background: var(--screen);
}
.hud-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-size: 13px; }
.crumbs {
  flex: 1;
  font-size: 9px;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs span { margin: 0 8px; }
.hud-actions { display: flex; gap: 8px; margin-left: auto; }
.hud-btn {
  font-size: 9px;
  padding: 8px 10px;
  border: 2px solid var(--ink);
  background: transparent;
  cursor: pointer;
  text-decoration: none;
  line-height: 1;
}
.hud-btn:hover, .hud-btn:focus-visible { background: var(--ink); color: var(--screen); outline: none; }
.hud-btn[aria-pressed='false'] b { opacity: .45; }
.hud-bottom {
  bottom: 0;
  height: var(--foot-h);
  justify-content: space-between;
  gap: 12px;
  font-size: 8px;
  color: var(--ink-2);
  border-top: 2px solid var(--ink);
  background: var(--screen);
}
.status { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
#status-dot { width: 7px; height: 7px; background: var(--green); display: inline-block; animation: blink 1.6s steps(1) infinite; }

.screen.is-boot .hud { display: none; }

/* ---------- pages ---------- */
.pages {
  position: absolute;
  inset: var(--hud-h) 0 var(--foot-h) 0;
  z-index: 5;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--ink) transparent;
}
.screen.is-boot .pages { inset: 0; }
.page {
  display: none;
  min-height: 100%;
  padding: clamp(12px, 3vh, 44px) var(--pad) clamp(12px, 2.6vh, 32px);
}
.page.active { display: block; animation: pageIn .32s steps(5) 1; }
/* slide in from above: moving down would briefly overflow and flash a scrollbar */
@keyframes pageIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

.page-head { flex: none; text-align: center; margin-bottom: clamp(10px, 2.6vh, 36px); }
.page-head h2 { margin: 0; font-size: clamp(14px, min(2.4vw, 3.2vh), 28px); line-height: 1.3; }
.page-head .sub { margin: clamp(6px, 1.2vh, 12px) 0 0; font-size: clamp(8px, .9vw, 10px); color: var(--ink-2); line-height: 1.8; }

/* inner pages fill the screen: the 3D views give up space first, so nothing scrolls unless the text really can't fit */
.page:not(.boot).active { display: flex; flex-direction: column; height: 100%; }
.split, .game-grid, .detail { flex: 1; min-height: 0; }

.view { position: relative; }

/* ---------- boot ---------- */
.boot { display: none; min-height: 100%; padding: 24px var(--pad); }
.boot.active { display: flex; flex-direction: column; height: 100%; }
.boot-corner { display: flex; justify-content: space-between; font-size: 9px; color: var(--ink-2); }
.boot-center {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
/* the 3D view takes whatever height is left, so the start screen never scrolls */
.boot-view { flex: 1 1 0; min-height: 120px; max-height: 52vh; width: min(96vh, 92vw); margin-bottom: 1vh; cursor: pointer; }
.wordmark {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .25em;
  font-weight: 400;
  font-size: clamp(22px, 4.6vw, 58px);
  line-height: 1;
  color: var(--ink);
  text-shadow: 4px 4px 0 var(--accent), 8px 8px 0 var(--screen-3);
}
.wordmark span:last-child { font-size: .62em; letter-spacing: .12em; text-shadow: 3px 3px 0 var(--accent); }
.tagline { margin: clamp(10px, 2.4vh, 22px) 0 clamp(10px, 2.6vh, 26px); font-size: clamp(8px, 1vw, 11px); letter-spacing: .14em; color: var(--ink-2); }
.boot-load { display: flex; flex-direction: column; align-items: center; gap: 10px; font-size: 10px; min-height: 44px; }
.bar { display: block; width: 200px; height: 14px; border: 2px solid var(--ink); padding: 2px; }
.bar b {
  display: block;
  height: 100%;
  width: 0;
  background: repeating-linear-gradient(90deg, var(--accent) 0 8px, transparent 8px 10px);
  transition: width .15s steps(3);
}
.press {
  min-height: 44px;
  font-size: clamp(11px, 1.3vw, 14px);
  background: none;
  border: 0;
  padding: 10px 16px;
  cursor: pointer;
  animation: blink 1.1s steps(1) infinite;
}
.press:focus-visible { outline: 2px dashed var(--ink); outline-offset: 4px; }
.caret { display: inline-block; margin-right: 8px; }
@keyframes blink { 0%, 60% { opacity: 1; } 61%, 100% { opacity: 0; } }
.boot-foot { text-align: center; font-size: 8px; color: var(--ink-2); margin: 0; }

/* ---------- selection frame (game-style corner brackets) ---------- */
.tile::after,
.game-card::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  --c: var(--accent);
  background:
    linear-gradient(var(--c), var(--c)) top left / 16px 3px no-repeat,
    linear-gradient(var(--c), var(--c)) top left / 3px 16px no-repeat,
    linear-gradient(var(--c), var(--c)) top right / 16px 3px no-repeat,
    linear-gradient(var(--c), var(--c)) top right / 3px 16px no-repeat,
    linear-gradient(var(--c), var(--c)) bottom left / 16px 3px no-repeat,
    linear-gradient(var(--c), var(--c)) bottom left / 3px 16px no-repeat,
    linear-gradient(var(--c), var(--c)) bottom right / 16px 3px no-repeat,
    linear-gradient(var(--c), var(--c)) bottom right / 3px 16px no-repeat;
  transition: opacity .1s steps(2);
}

/* ---------- home: always fits the screen (no scrolling) ---------- */
.page[data-page='home'].active {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding-top: clamp(14px, 2.6vh, 36px);
}
.page[data-page='home'] .page-head { flex: none; margin-bottom: clamp(6px, 1.6vh, 22px); }
.home-grid {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: clamp(6px, 1.6vh, 22px) clamp(6px, 2vw, 26px);
  max-width: 1040px;
  margin: 0 auto;
}
.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 0;
  padding: 6px 6px 12px;
  text-decoration: none;
  outline: none;
}
.tile .view { flex: 1; min-height: 0; width: 100%; }
.tile .view::before { /* checker floor fades in on select */
  content: '';
  position: absolute;
  left: 18%; right: 18%; bottom: 6%;
  height: 22%;
  border-radius: 50%;
  background: var(--checker) 0 0 / 18px 18px;
  opacity: 0;
  transform: perspective(300px) rotateX(55deg);
  transition: opacity .15s steps(3);
}
.tile .label { font-size: clamp(9px, 1vw, 12px); padding: 7px 10px; line-height: 1.4; text-align: center; }
.tile .label::before { content: '▶ '; visibility: hidden; }
.tile:hover::after, .tile:focus-visible::after, .tile.is-sel::after { opacity: 1; }
.tile:hover .view::before, .tile:focus-visible .view::before, .tile.is-sel .view::before { opacity: .22; }
.tile:hover .label, .tile:focus-visible .label, .tile.is-sel .label { background: var(--accent); color: var(--paper); }
.tile:hover .label::before, .tile:focus-visible .label::before, .tile.is-sel .label::before { visibility: visible; animation: blink .8s steps(1) infinite; }

.ticker {
  flex: none;
  margin: clamp(10px, 2.4vh, 32px) calc(var(--pad) * -1) 0;
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  overflow: hidden;
  background: var(--accent);
  color: var(--paper);
  font-size: 10px;
  padding: 10px 0;
  white-space: nowrap;
}
.ticker-track { display: inline-block; animation: tick 40s linear infinite; }
.ticker-track span { margin: 0 22px; }
.ticker-track i {
  display: inline-block;
  width: 10px; height: 10px;
  background: repeating-conic-gradient(var(--paper) 0 25%, var(--accent) 0 50%) 0 0 / 5px 5px;
  vertical-align: middle;
}
@keyframes tick { to { transform: translateX(-50%); } }

/* ---------- work: game select ---------- */
.game-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: minmax(0, 1fr);
  width: 100%;
  gap: clamp(8px, 2vw, 28px);
  max-width: 1150px;
  margin: 0 auto;
}
.game-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  padding: 14px 14px 18px;
  text-decoration: none;
  outline: none;
  border: 2px solid transparent;
  transition: background-color .1s steps(2);
}
.game-card .num { font-size: 9px; color: var(--ink-2); }
.game-card .view { width: 100%; flex: 1; min-height: 0; }
.game-card .name { font-family: var(--display); font-weight: 800; font-size: clamp(20px, 2vw, 28px); letter-spacing: -0.035em; line-height: 1.05; margin: 0; }
.game-card .pill { align-self: flex-start; }
.game-card .play { font-size: 9px; margin: 4px 0 0; visibility: hidden; }
.game-card:hover, .game-card:focus-visible, .game-card.is-sel { background: var(--screen-2); }
.game-card:hover::after, .game-card:focus-visible::after, .game-card.is-sel::after { opacity: 1; }
.game-card:hover .play, .game-card:focus-visible .play, .game-card.is-sel .play { visibility: visible; animation: blink .8s steps(1) infinite; }

.pill {
  display: inline-block;
  margin: 0;
  font-size: 9px;
  padding: 6px 10px 5px;
  background: var(--accent);
  color: var(--paper);
  border-radius: 999px;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .25);
}

/* ---------- project detail ---------- */
.detail {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(12px, 3vw, 48px);
  grid-template-rows: minmax(0, 1fr);
  align-items: center;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}
.detail-stage { position: relative; height: 100%; width: 100%; margin: 0 auto; }
.detail-view { position: absolute; inset: 0; cursor: grab; touch-action: pan-y; }
.detail-view.dragging { cursor: grabbing; }
.hint { position: absolute; left: 0; right: 0; bottom: 0; text-align: center; font-size: 8px; color: var(--ink-2); margin: 0; }
.idx { font-size: 10px; color: var(--ink-2); margin: 0 0 14px; }
.d-name {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(28px, min(4.6vw, 7vh), 70px);
  letter-spacing: -0.045em;
  line-height: .95;
  margin: 0 0 clamp(10px, 2vh, 18px);
  text-shadow: 4px 4px 0 var(--screen-3);
}
.d-desc { font-size: clamp(13px, min(1.15vw, 2vh), 16px); line-height: 1.55; margin: clamp(10px, 2.2vh, 22px) 0; max-width: 48ch; }
.stats { display: grid; grid-template-columns: auto 1fr; gap: clamp(5px, 1vh, 10px) 16px; margin: 0 0 clamp(10px, 2.2vh, 22px); align-items: center; }
.stats dt { font-family: var(--pixel); font-size: 9px; }
.stats dd { margin: 0; display: flex; gap: 4px; }
.stats dd i { width: 16px; height: 12px; border: 2px solid var(--ink); }
.stats dd i.on { background: var(--accent); border-color: var(--accent); }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 clamp(12px, 2.6vh, 26px); padding: 0; }
.tags li { font-size: 9px; padding: 7px 9px; border: 2px solid var(--ink); background: var(--paper); }

.d-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.btn {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 10px;
  padding: 12px 16px;
  border: 2px solid var(--ink);
  background: var(--screen);
  box-shadow: 4px 4px 0 var(--ink);
  text-decoration: none;
  cursor: pointer;
  outline: none;
  transition: transform .06s, box-shadow .06s;
}
.btn:hover, .btn:focus-visible { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); background: var(--screen-2); }
.btn:active { transform: translate(4px, 4px); box-shadow: 0 0 0 var(--ink); }
.btn.primary { background: var(--accent); color: var(--paper); }
.btn.primary:hover, .btn.primary:focus-visible { background: var(--accent-2); }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* ---------- screenshots viewer (projects without a public repo) ---------- */
.shots {
  position: absolute;
  inset: var(--hud-h) 0 var(--foot-h) 0;
  z-index: 15;
  container-type: size;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(10px, 2.4vh, 24px) var(--pad);
  background: rgba(228, 229, 224, .92);
  animation: pageIn .22s ease-out;
}
.shots[hidden] { display: none; }
.shots-win {
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.4vh, 12px);
  height: 100%;
  /* as wide as the screenshot at this height (1360×840), never wider than the screen */
  width: min(100%, 1120px, calc((100cqh - 126px) * 1.62 + 42px));
  padding: clamp(10px, 1.6vh, 16px);
  background: var(--paper);
  border: 3px solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
}
.shots-bar { display: flex; align-items: center; gap: 12px; font-size: 10px; white-space: nowrap; }
#shots-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.shots-n { margin-left: auto; color: var(--ink-2); }
.shots-frame { display: block; flex: 1; min-height: 0; border: 2px solid var(--ink); background: #0a0c12; cursor: zoom-in; }
.shots-frame img { display: block; width: 100%; height: 100%; object-fit: contain; }
.shots-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.shots-cap { flex: 1; min-width: 160px; margin: 0; font-size: 9px; line-height: 1.6; color: var(--accent); }

/* ---------- split layouts ---------- */
.split {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: clamp(16px, 4vw, 56px);
  grid-template-rows: minmax(0, 1fr);
  align-items: center;
  width: 100%;
  max-width: 1150px;
  margin: 0 auto;
}
.split-view { align-self: stretch; display: flex; flex-direction: column; justify-content: center; min-height: 0; }
.split-view .view { width: 100%; flex: 1; min-height: 0; max-height: 560px; }

/* about: dialog + player card */
.dialog {
  position: relative;
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 18px;
  padding: 18px 24px 30px 18px;
  background: var(--paper);
  border: 3px solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
  cursor: pointer;
  outline: none;
  min-height: clamp(100px, 16vh, 150px);
}
.dialog:focus-visible { box-shadow: 6px 6px 0 var(--ink), 0 0 0 4px var(--screen), 0 0 0 7px var(--accent); }
.portrait { width: 84px; height: 84px; border: 2px solid var(--ink); background: var(--screen-2); overflow: hidden; }
.portrait .view { width: 100%; height: 100%; }
.speaker { font-size: 10px; margin: 4px 0 12px; color: var(--accent); }
.line { font-size: clamp(15px, 1.3vw, 18px); line-height: 1.6; margin: 0; min-height: 3.2em; }
.more { position: absolute; right: 16px; bottom: 10px; font-size: 10px; animation: blink .8s steps(1) infinite; }
.card {
  display: grid;
  grid-template-columns: auto 1fr;
  margin: clamp(12px, 2.8vh, 28px) 0 clamp(12px, 2.6vh, 26px);
  border: 2px solid var(--ink);
}
.card dt, .card dd { margin: 0; padding: clamp(5px, 1.1vh, 10px) 14px; border-bottom: 2px solid var(--ink); }
.card dt { font-family: var(--pixel); font-size: 9px; background: var(--ink); color: var(--screen); display: flex; align-items: center; }
.card dd { font-size: 14px; background: var(--paper); }
.card dt:last-of-type, .card dd:last-of-type { border-bottom: 0; }
.card dd.ok::before { content: ''; display: inline-block; width: 8px; height: 8px; background: var(--green); margin-right: 8px; animation: blink 1.6s steps(1) infinite; }

/* skills: inventory slots */
.inventory { display: grid; gap: clamp(10px, 2.2vh, 22px); }
.inv-group h3 { font-size: 10px; margin: 0 0 10px; padding-bottom: 8px; border-bottom: 2px solid var(--ink); display: flex; justify-content: space-between; }
.inv-group h3 small { font-size: 8px; color: var(--ink-2); }
.slots { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.slot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: clamp(4px, .9vh, 8px) 10px;
  border: 2px solid var(--ink);
  background: var(--paper);
  font-size: 13px;
  box-shadow: 3px 3px 0 var(--ink);
  outline: none;
  cursor: default;
  transition: transform .06s, box-shadow .06s;
}
.slot i { width: 10px; height: 10px; background: var(--checker) 0 0 / 5px 5px; flex: none; }
.slot:hover, .slot:focus-visible { background: var(--accent); color: var(--paper); transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.slot:hover i, .slot:focus-visible i { background: var(--paper); }

/* quests */
.quests { list-style: none; padding: 0; margin: 0 0 clamp(14px, 3vh, 28px); border-top: 2px solid var(--ink); }
.quests li { display: grid; grid-template-columns: 18px 1fr auto; gap: 14px; align-items: center; padding: clamp(7px, 1.6vh, 14px) 6px; border-bottom: 2px solid var(--ink); }
.quests i { width: 16px; height: 16px; border: 2px solid var(--ink); }
.quests li.done i { background: linear-gradient(var(--accent), var(--accent)) center / 8px 8px no-repeat; }
.quests li.done .q { text-decoration: line-through; color: var(--ink-2); }
.quests .q { font-size: 15px; }
.quests .s { font-family: var(--pixel); font-size: 8px; padding: 5px 7px; background: var(--ink); color: var(--screen); }
.quests li.done .s { background: var(--green); color: var(--ink); }
.main-quest { border: 3px solid var(--ink); background: var(--paper); box-shadow: 6px 6px 0 var(--accent); padding: 18px 20px 20px; display: grid; gap: 12px; }
.main-quest p { margin: 0; }
.main-quest p.px { font-size: 10px; color: var(--accent); }
.main-quest .btn { justify-self: start; }

/* contact */
.form { display: grid; gap: clamp(8px, 1.6vh, 14px); }
.field { display: grid; gap: 6px; }
.field span { font-size: 9px; }
.field input, .field textarea {
  width: 100%;
  border: 2px solid var(--ink);
  background: var(--paper);
  padding: 12px 14px;
  font-size: 15px;
  border-radius: 0;
  outline: none;
  resize: vertical;
  box-shadow: inset 3px 3px 0 var(--screen-3);
}
.field input:focus, .field textarea:focus { border-color: var(--accent); box-shadow: inset 3px 3px 0 var(--screen-3), 0 0 0 3px var(--screen), 0 0 0 5px var(--accent); }
.field.bad input, .field.bad textarea { border-color: var(--red); }
.field.bad span { color: var(--red); }
.form-status { font-size: 9px; margin: 0; line-height: 1.6; }
.form-status.ok { color: var(--green); }
.form-status.err { color: var(--red); }
.form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.social-links { display: grid; gap: 12px; }
.contact-side { display: flex; flex-direction: column; justify-content: center; gap: 14px; align-self: stretch; min-height: 0; }
.contact-side .split-view { flex: 1; min-height: 90px; }
.form { margin-bottom: 0; }
.social-card {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: 'k arrow' 'h arrow';
  gap: 6px 16px;
  align-items: center;
  padding: 11px 16px;
  border: 3px solid var(--ink);
  background: var(--paper);
  box-shadow: 5px 5px 0 var(--ink);
  text-decoration: none;
  outline: none;
  transition: transform .06s, box-shadow .06s;
}
.social-card span { grid-area: k; font-size: 9px; color: var(--ink-2); }
.social-card b { grid-area: h; font-family: var(--display); font-weight: 800; font-size: clamp(18px, 1.8vw, 24px); letter-spacing: -0.03em; line-height: 1.1; overflow-wrap: anywhere; }
.social-card em { grid-area: arrow; font-style: normal; font-size: 14px; }
.social-card:hover, .social-card:focus-visible { transform: translate(3px, 3px); box-shadow: 2px 2px 0 var(--ink); background: var(--accent); color: var(--paper); }
.social-card:hover span, .social-card:focus-visible span { color: var(--screen-3); }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  :root { --hud-h: 48px; }
  .page:not(.boot).active { height: auto; min-height: 100%; }
  .detail, .split { grid-template-columns: 1fr; grid-template-rows: none; }
  .detail-stage { height: auto; aspect-ratio: 1; width: min(100%, 460px); }
  .split-view { order: -1; max-width: 340px; width: 100%; margin: 0 auto; }
  .split-view .view { flex: none; aspect-ratio: 1; }
  .contact-side .split-view .view { aspect-ratio: 2; }
  .game-grid { grid-template-columns: 1fr; grid-template-rows: none; max-width: 460px; }
  .game-card .view { flex: none; aspect-ratio: 1.5; }
  .crumbs { display: none; }
  .keys { display: none; }
  .hud-bottom { justify-content: flex-end; }
  .shots-win { height: auto; max-height: 100%; width: 100%; }
  .shots-frame { flex: none; }
  .shots-frame img { height: auto; }
}
@media (max-width: 560px) {
  .home-grid { grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(3, minmax(0, 1fr)); }
  .hud-brand span { display: none; }
  .tile .label { font-size: 8px; padding: 6px 6px; }
  .d-actions .btn { flex: 1 1 auto; justify-content: center; }
  .dialog { grid-template-columns: 60px 1fr; padding: 14px 16px 28px 14px; }
  .portrait { width: 60px; height: 60px; }
  .boot-view { width: 92vw; }
}

/* very short screens: let the menu scroll instead of squashing the tiles */
@media (max-height: 520px) {
  .page[data-page='home'].active { height: auto; }
  .home-grid { grid-template-rows: none; }
  .tile .view { flex: none; aspect-ratio: 1.3; }
}

@media (prefers-reduced-motion: reduce) {
  .fx, .ticker-track, .press, .more, .tile .label::before, #status-dot { animation: none !important; }
  .page.active { animation: none; }
}
