/* ================= Fonts =================
   .woff2 files are subsets (Latin + punctuation) of the .ttf originals, which stay as fallback. */
@font-face {
  font-family: "Balsamiq Sans";
  src: url("../Assets/Fonts/BalsamiqSans/BalsamiqSans-Regular.woff2") format("woff2"), url("../Assets/Fonts/BalsamiqSans/BalsamiqSans-Regular.ttf") format("truetype");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Balsamiq Sans";
  src: url("../Assets/Fonts/BalsamiqSans/BalsamiqSans-Bold.woff2") format("woff2"), url("../Assets/Fonts/BalsamiqSans/BalsamiqSans-Bold.ttf") format("truetype");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Balsamiq Sans";
  src: url("../Assets/Fonts/BalsamiqSans/BalsamiqSans-Italic.woff2") format("woff2"), url("../Assets/Fonts/BalsamiqSans/BalsamiqSans-Italic.ttf") format("truetype");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "JF Dot";
  src: url("../Assets/Fonts/JF-Dot/JF-Dot-MPlusH10B.woff2") format("woff2"), url("../Assets/Fonts/JF-Dot/JF-Dot-MPlusH10B.ttf") format("truetype");
  font-weight: 400; font-style: normal; font-display: swap;
}

/* ================= Tokens =================
   Dark palette: plums for surfaces, warm yellows/oranges for accents.
   Text is cream on dark surfaces and dark plum on light accents. */
:root {
  /* plums, light -> dark */
  --plum-1: #804c6d;
  --plum-2: #673c5f;
  --plum-3: #4d2c50;
  --plum-4: #2c1b39;
  --plum-5: #1f1636;
  /* warm accents */
  --orange: #da915e;
  --apricot: #e1ad6b;
  --yellow: #e6c575;
  --cream: #ebd8b0;

  --bg: var(--plum-4);
  --bg-dots: rgba(235, 216, 176, .06);
  --card: var(--plum-3);
  --text: var(--cream);
  --text-soft: #cbb49f;
  --ink: var(--plum-5);    /* outlines, shadows, text on light accents */
  --link: var(--yellow);

  --lilac: var(--plum-1);
  --mustard: var(--yellow);
  --mustard-light: var(--cream);
  --coral: var(--orange);
  --coral-light: var(--apricot);
  --peach: var(--apricot);

  /* pixel world */
  --px-bg: var(--plum-3);
  --px-bg-2: var(--plum-4);
  --px-ink: var(--cream);
  --px-dim: var(--text-soft);
  --px-accent: var(--yellow);
  --px-teal: var(--orange);

  --font-body: "Balsamiq Sans", "Comic Sans MS", "Trebuchet MS", sans-serif;
  --font-pixel: "JF Dot", "Courier New", monospace;

  --line: 3px solid var(--ink);
  --shadow: 5px 5px 0 var(--ink);
  --wobble: 18px 22px 16px 24px / 22px 16px 24px 18px;
  --wobble-2: 24px 14px 22px 16px / 14px 22px 16px 24px;
  --max: 1080px;
}

/* ================= Base ================= */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  background-image: radial-gradient(var(--bg-dots) 1.4px, transparent 1.6px);
  background-size: 22px 22px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--apricot); }
:focus-visible { outline: 3px dashed var(--mustard); outline-offset: 4px; }
h1, h2, h3 { line-height: 1.15; margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; cursor: pointer; }

/* ================= Buttons ================= */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px;
  font-weight: 700; font-size: 17px;
  color: var(--text); text-decoration: none;
  background: var(--card);
  border: var(--line);
  border-radius: var(--wobble-2);
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s;
}
.btn:hover { color: var(--text); background: var(--plum-2); transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn--primary { background: var(--yellow); color: var(--ink); }
.btn--primary:hover { background: var(--cream); color: var(--ink); }
.btn svg { width: 20px; height: 20px; }

/* ================= Nav ================= */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  max-width: var(--max); margin: 0 auto;
  padding: 12px 20px;
}
.nav::before {
  content: ""; position: absolute; inset: 8px 12px;
  background: rgba(77, 44, 80, .96);
  border: var(--line); border-radius: var(--wobble);
  box-shadow: 4px 4px 0 var(--ink);
  z-index: -1;
}
.nav__logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 20px; color: var(--text); text-decoration: none; padding-left: 8px; }
.nav__logo img { width: 40px; height: 40px; transition: transform .3s; }
.nav__logo:hover img { transform: rotate(-12deg) scale(1.1); }
.nav__links { display: flex; flex-wrap: wrap; gap: 4px; padding-right: 8px; }
.nav__links a {
  padding: 6px 12px; border-radius: 999px;
  color: var(--text); font-weight: 700; text-decoration: none;
  transition: background-color .15s, color .15s;
}
.nav__links a:hover { background: var(--plum-1); color: var(--text); }
.nav__links a.is-active { background: var(--yellow); color: var(--ink); }

/* ================= Hero ================= */
.hero {
  max-width: var(--max); margin: 0 auto;
  padding: 56px 20px 80px;
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  align-items: center; gap: 48px;
}
.hero__avatar { position: relative; max-width: 400px; justify-self: center; }
/* idle bob on the wrapper, squish on the image: transforms combine, so neither jumps */
.hero__cat { position: relative; animation: bob 4s ease-in-out infinite; transform-origin: 50% 80%; }
.hero__cat img { transform-origin: 50% 90%; }
.hero__blob {
  position: absolute; inset: 8% 4% 2% 6%;
  background: var(--apricot);
  border: var(--line);
  border-radius: 46% 54% 42% 58% / 55% 44% 56% 45%;
  animation: blob 9s ease-in-out infinite;
}
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-10px) rotate(2deg); } }
@keyframes blob {
  0%, 100% { border-radius: 46% 54% 42% 58% / 55% 44% 56% 45%; }
  50% { border-radius: 56% 44% 52% 48% / 45% 56% 44% 55%; }
}
.hero__hello { margin: 0 0 4px; font-size: 22px; color: var(--text-soft); }
.hero__name { font-size: clamp(40px, 6vw, 68px); font-weight: 700; letter-spacing: -.5px; }
.hero__role { font-size: clamp(20px, 2.4vw, 26px); margin: 16px 0 20px; }

.marker { position: relative; white-space: nowrap; font-weight: 700; color: var(--ink); z-index: 0; padding: 0 2px; }
.marker::after {
  content: ""; position: absolute; z-index: -1;
  left: -4px; right: -4px; top: 6%; bottom: 0;
  background: var(--mustard);
  border-radius: 4px 10px 6px 12px;
  transform: rotate(-1.5deg);
}
.marker--mustard::after { background: var(--mustard-light); }
.marker--coral::after { background: var(--coral-light); }

.hero__facts { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 28px; color: var(--text-soft); }
.hero__facts li::before {
  content: ""; width: 16px; height: 16px; vertical-align: -2px;
  background: url("../Assets/Art/star-yellow.png") center / contain no-repeat;
  filter: drop-shadow(2px 2px 0 var(--ink));
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; }

/* ================= Sections ================= */
.section { max-width: var(--max); margin: 0 auto; padding: 64px 20px; }
.section__title { font-size: clamp(32px, 4.4vw, 46px); margin-bottom: 32px; }
.section__title span { position: relative; display: inline-block; }
.section__title span::after { /* hand-drawn squiggle */
  content: ""; position: absolute; left: 0; right: 0; bottom: -12px; height: 12px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 12'%3E%3Cpath d='M0 6 Q5 0 10 6 T20 6 T30 6 T40 6' fill='none' stroke='%23e6c575' stroke-width='3.5' stroke-linecap='round'/%3E%3C/svg%3E") repeat-x left center / 40px 12px;
}
.section__lead { margin: -12px 0 28px; color: var(--text-soft); }
.subtitle { font-size: 28px; margin: 56px 0 20px; }

.card {
  color: var(--text);
  background: var(--card);
  border: var(--line);
  border-radius: var(--wobble);
  box-shadow: var(--shadow);
}

.sticker {
  display: inline-block;
  padding: 4px 14px;
  font-weight: 700; font-size: 15px; color: var(--ink);
  background: var(--peach);
  border: var(--line); border-radius: 10px 14px 8px 12px;
  transform: rotate(-3deg);
}
.sticker--mustard { background: var(--mustard-light); }
.sticker--coral { background: var(--coral-light); }

/* ================= Experience ================= */
.timeline { --tl-pad: 36px; --tl-x: 12px; display: grid; gap: 32px; position: relative; padding-left: var(--tl-pad); }
.timeline::before { /* dashed path */
  content: ""; position: absolute; left: calc(var(--tl-x) - 1.5px); top: 12px; bottom: 12px;
  border-left: 3px dashed var(--text-soft);
}
.job { position: relative; padding: 24px 28px 26px; }
.job::before { /* dot on the path */
  content: ""; position: absolute; top: 26px;
  left: calc(var(--tl-x) - var(--tl-pad) - 3px); /* 3px = card border */
  transform: translateX(-50%);
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--mustard); border: var(--line);
}
.job:nth-child(even) { border-radius: var(--wobble-2); }
.job__date { position: absolute; top: -16px; right: 20px; }
.job__role { font-size: 26px; }
.job__company { margin: 2px 0 10px; font-weight: 700; color: var(--yellow); font-size: 19px; }
.job__company span { color: var(--text-soft); font-weight: 400; }
.job__about { margin: 0 0 12px; font-style: italic; color: var(--text-soft); }
.job__list li { position: relative; padding-left: 28px; margin-bottom: 8px; }
.job__list li::before {
  content: ""; position: absolute; left: 2px; top: .4em;
  width: 15px; height: 15px;
  background: url("../Assets/Art/star-yellow.png") center / contain no-repeat;
  filter: drop-shadow(2px 2px 0 var(--ink));
}
.card--small { padding-bottom: 20px; }
.card--small .job__company { margin-bottom: 0; }

.stack { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 28px; align-items: start; }
.stack__col { display: grid; gap: 20px; }
.stack__label { margin: 0 0 8px; font-weight: 700; color: var(--text-soft); font-size: 16px; text-transform: uppercase; letter-spacing: 1px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips li {
  padding: 3px 12px; font-size: 16px; color: var(--text);
  background: var(--card); border: 2.5px solid var(--ink);
  border-radius: 12px 8px 14px 9px;
  transition: background-color .15s, color .15s;
}
.chips + .chips { margin-top: 8px; }
.chips li:nth-child(3n+1):hover { background: var(--yellow); color: var(--ink); }
.chips li:nth-child(3n+2):hover { background: var(--orange); color: var(--ink); }
.chips li:nth-child(3n):hover { background: var(--apricot); color: var(--ink); }

/* ================= Pixel world (Games + Playables) ================= */
/* Pixel art assets are drawn at 2x, so 1 art pixel = 2 css px at 1:1. */
.pixel-world {
  --panel: rgba(31, 22, 54, .92);
  position: relative;
  margin: 150px 0 130px;
  color: var(--px-ink);
}
/* Dithered edges: same background + grid as the world, cut out by a mask
   built from Assets/Art/gradient.png in main.js, so the grid continues through */
.pixel-world, .dither-edge {
  background-color: var(--px-bg);
  background-image:
    linear-gradient(rgba(235,216,176,.035) 4px, transparent 4px),
    linear-gradient(90deg, rgba(235,216,176,.035) 4px, transparent 4px);
  background-size: 64px 64px;
}
.dither-edge {
  position: absolute; left: 0; right: 0; height: 64px;
  pointer-events: none;
  visibility: hidden; /* shown once the mask is ready */
  -webkit-mask-repeat: repeat-x; mask-repeat: repeat-x;
  -webkit-mask-size: 64px 64px; mask-size: 64px 64px;
}
.dither-ready .dither-edge { visibility: visible; }
/* the edge ends where the world's grid starts: shift so lines line up */
.dither-edge--top {
  bottom: 100%;
  background-position: 0 0;
  -webkit-mask-image: var(--dither-mask-top); mask-image: var(--dither-mask-top);
}
.dither-edge--bottom {
  top: 100%;
  background-position: 0 var(--grid-shift-bottom, 0px);
  -webkit-mask-image: var(--dither-mask-bottom); mask-image: var(--dither-mask-bottom);
}

.pixel-reveal {
  /* covers the whole pixel world including both dithered edges */
  position: absolute; left: 0; top: -64px; width: 100%; height: calc(100% + 128px);
  pointer-events: none; z-index: 5;
  image-rendering: pixelated;
}

.px-section { max-width: var(--max); margin: 0 auto; padding: 48px 20px 8px; }
.px-section + .px-section { padding-top: 72px; }
.px-showcase-wrap { padding-bottom: 32px; }

/* JF Dot is a 10px-grid font: sizes kept to multiples of 10 so it stays crisp */
.px-title {
  font-family: var(--font-pixel); font-weight: 400;
  font-size: 50px; line-height: 1; letter-spacing: 2px;
  color: var(--px-ink);
  text-shadow: 4px 4px 0 var(--ink);
  margin-bottom: 20px;
}
.px-title__arrow { color: var(--px-accent); }
.px-cursor { color: var(--px-accent); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.px-lead { margin: 0 0 28px; color: var(--px-dim); font-size: 18px; }

/* 9-slice frame from Assets/Art/border.png (tinted copy: border-ink.png) */
.px-frame { position: relative; padding: 12px; }
.px-frame::after {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  border: 28px solid transparent;
  border-image: url("../Assets/Art/border-ink.png") 14 / 28px stretch;
  image-rendering: pixelated;
}
.px-frame__inner { position: relative; height: 100%; border-radius: 16px; overflow: hidden; }

/* 9-slice button from Assets/Art/button.png */
.px-button {
  display: inline-flex; align-items: center; justify-content: center;
  box-sizing: border-box; height: 42px; padding: 0 6px;
  border-style: solid; border-width: 14px;
  border-image: url("../Assets/Art/button.png") 14 fill / 14px stretch;
  image-rendering: pixelated;
  background: none;
  font-family: var(--font-pixel); font-size: 20px; line-height: 14px;
  color: var(--ink); text-decoration: none; white-space: nowrap;
  cursor: pointer;
  padding-top: 4px; /* label sits one art pixel lower */
}
/* main.js pre-renders the 9-slice into one image per size: no seams between slices */
.px-button.is-painted {
  border-image: none; border-color: transparent;
  background-origin: border-box; background-clip: border-box;
  background-size: 100% 100%; background-repeat: no-repeat;
}
.px-button { transition: transform .06s steps(1), filter .1s; }
.px-button:hover { color: var(--ink); filter: brightness(1.08); }
/* pressed: the button sinks by one art pixel and darkens */
.px-button:active, .play-card:active .play-card__play { transform: translateY(2px); filter: brightness(.85); }
.play-card:active .play-card__play { transform: translate(-50%, calc(-50% + 2px)); }
.px-button--icon { width: 42px; padding: 0; }
.px-button--icon svg { width: 16px; height: 16px; flex: none; overflow: visible; }
/* icon art is 24x24 at 1x; shown at 1.5x so it fits the button face */
.px-button--icon img { width: 36px; height: 36px; flex: none; max-width: none; image-rendering: pixelated; }

.px-placeholder {
  background-color: var(--plum-2);
  background-image:
    linear-gradient(45deg, var(--plum-1) 25%, transparent 25%, transparent 75%, var(--plum-1) 75%),
    linear-gradient(45deg, var(--plum-1) 25%, transparent 25%, transparent 75%, var(--plum-1) 75%);
  background-size: 64px 64px; background-position: 0 0, 32px 32px;
}
.has-cover { background-size: cover; background-position: center; }

/* dithered fade from the cover into the info panel */
.px-panel { position: relative; background: var(--panel); }
.px-panel::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 32px;
  background: var(--dither-panel, linear-gradient(transparent, var(--panel)));
  background-repeat: repeat-x;
  background-size: 32px 32px;
  image-rendering: pixelated;
}

.px-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.px-tags + .px-tags { margin-top: 6px; }
.px-tags li {
  font-family: var(--font-pixel); font-size: 15px; line-height: 1;
  padding: 3px 6px 2px;
  color: var(--orange); border: 2px solid var(--orange);
}

/* ================= Showcase (infinite carousel) ================= */
.showcase__viewport {
  overflow: hidden;
  padding: 16px 0 12px;
  touch-action: pan-y;
  cursor: grab;
}
.showcase__viewport.is-dragging { cursor: grabbing; }
.showcase__track {
  display: flex; gap: var(--showcase-gap, 32px);
  transition: transform .55s cubic-bezier(.22, 1, .36, 1);
  will-change: transform;
  user-select: none; -webkit-user-select: none;
}
.showcase__track.no-anim { transition: none; }
.showcase__track.no-fade .showcase__item { transition: none; }
.showcase__item { flex: none; }
.showcase--dim .showcase__item { transition: opacity .3s; }
.showcase--dim .showcase__item:not(.is-active) { opacity: .4; }

.showcase__controls { display: flex; align-items: center; justify-content: center; gap: 20px; margin-top: 8px; }
.showcase__dots { display: flex; gap: 6px; }
.showcase__dot {
  width: 24px; height: 24px; padding: 0; border: 0; background: none; cursor: pointer;
  display: grid; place-items: center;
}
/* dot art is 7x8, shown at 2x like the other pixel assets */
.showcase__dot::before {
  content: ""; width: 14px; height: 16px;
  background: url("../Assets/Art/dot_disabled.png") center / 100% 100% no-repeat;
  image-rendering: pixelated;
}
.showcase__dot.is-active::before { background-image: url("../Assets/Art/dot_enabled.png"); }

/* ================= Game card (landscape) ================= */
.game-card { width: min(660px, 86vw); }
/* 3:2 landscape, but allowed to grow if the text needs more room */
.game-card .px-frame__inner { display: flex; flex-direction: column; justify-content: flex-end; min-height: calc(min(660px, 86vw) * 2 / 3 - 24px); }
.game-card__title {
  font-family: var(--font-pixel); font-weight: 400;
  font-size: 30px; line-height: 1.1; letter-spacing: 1px;
  color: var(--yellow);
  text-shadow: 3px 3px 0 var(--ink);
}
.game-card__panel {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 16px 24px;
  padding: 8px 36px 34px;
}
.game-card__desc { margin: 12px 0 0; font-size: 17px; line-height: 1.5; color: var(--cream); }
.game-card__links { display: flex; flex-direction: column; gap: 10px; }

/* ================= Playable card (portrait) ================= */
.play-card {
  width: 240px; padding: 12px;
  border: 0; background: none; color: inherit; text-align: left; font: inherit;
  cursor: pointer;
  transition: transform .2s steps(3);
}
.play-card:hover { transform: translateY(-6px); }
.play-card .px-frame__inner { aspect-ratio: 9 / 15; display: flex; flex-direction: column; justify-content: flex-end; }
.play-card__label {
  position: absolute; left: 0; right: 0; top: 18%; text-align: center;
  font-family: var(--font-pixel); font-size: 20px; color: var(--cream); opacity: .7;
}
.play-card__play { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); }
.play-card__panel { padding: 4px 22px 24px; }
.play-card__title { display: block; font-family: var(--font-pixel); font-size: 20px; line-height: 1.2; color: var(--yellow); }

/* ================= Player modal ================= */
.player { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; }
.player[hidden] { display: none; }
.player__backdrop {
  position: absolute; inset: 0;
  background: rgba(31, 22, 54, .8);
  opacity: 0; transition: opacity .3s ease;
}
.player.is-open .player__backdrop { opacity: 1; }
/* the window follows the screen: portrait on tall screens, landscape on wide ones */
.player__window {
  height: min(88vh, 900px);
  aspect-ratio: 9 / 17;
  max-width: 94vw;
  will-change: transform;
}
@media (orientation: landscape) {
  .player__window {
    aspect-ratio: 16 / 9;
    height: auto;
    width: min(92vw, 1400px, calc(88vh * 16 / 9));
    max-width: none;
  }
}
.player__window .px-frame__inner { display: flex; flex-direction: column; background: var(--plum-5); }
.player__bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  position: relative; z-index: 2;
  padding: 12px 14px 10px 24px;
  background: var(--plum-5);
}
/* dark dithered fade (gradient_small.png) hanging over the top of the game; clicks pass through */
.player__bar::after {
  content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 32px;
  background: var(--dither-bar, linear-gradient(var(--plum-5), transparent 45%)) left top / 32px 32px repeat-x;
  image-rendering: pixelated;
  pointer-events: none;
}
.player__title {
  font-family: var(--font-pixel); font-size: 20px; color: var(--yellow);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.player__controls { display: flex; gap: 6px; }
.player__screen { position: relative; flex: 1; background: var(--plum-5); }
.player__loader {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  /* same backdrop as the pixel world, so the dark disc reads */
  background-color: var(--px-bg);
  background-image:
    linear-gradient(rgba(235,216,176,.035) 4px, transparent 4px),
    linear-gradient(90deg, rgba(235,216,176,.035) 4px, transparent 4px);
  background-size: 64px 64px;
  transition: opacity .3s;
}
.player__loader[hidden] { display: none; }
.player__loader.is-done { opacity: 0; }
/* 64x64 art canvas shown at 4x */
.player__loader canvas { width: 256px; height: 256px; max-width: 70%; height: auto; aspect-ratio: 1; image-rendering: pixelated; }

/* "REDIRECT!" pops up when the build tries to open the store */
.redirect-pop {
  position: absolute; left: 50%; top: 45%; z-index: 3;
  font-family: var(--font-pixel); font-size: 30px; line-height: 1;
  color: var(--yellow); text-shadow: 3px 3px 0 var(--ink);
  white-space: nowrap; pointer-events: none;
  /* movement snaps in pixel steps, the fade stays smooth */
  animation: pop-rise 1.2s steps(12) forwards, pop-fade 1.2s ease-in forwards;
}
@keyframes pop-rise { from { transform: translate(-50%, 0); } to { transform: translate(-50%, -96px); } }
@keyframes pop-fade { 0%, 40% { opacity: 1; } 100% { opacity: 0; } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.player__screen iframe { width: 100%; height: 100%; border: 0; display: block; background: var(--plum-5); }
body.is-locked { overflow: hidden; }

/* ================= Contacts ================= */
.contact { display: flex; align-items: center; gap: 36px; padding: 32px 36px; }
.contact__cat { width: 140px; flex: none; transform: rotate(-8deg); }
.contact__lead { margin: 0 0 16px; font-size: 26px; font-weight: 700; }
.contact__rows { display: grid; justify-items: start; gap: 6px; margin: 0 0 24px -12px; }
/* the whole row copies its value */
.contact__row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px;
  padding: 6px 12px;
  font-size: 19px; text-align: left; color: inherit;
  background: none; border: 0; border-radius: 12px;
  transition: background-color .15s;
}
.contact__row:hover { background: rgba(235, 216, 176, .08); }
.contact__label { min-width: 72px; font-weight: 700; color: var(--text-soft); }
.contact__value { font-weight: 700; color: var(--link); word-break: break-all; }
/* copy.png is a white icon: used as a mask so it takes any color */
.copy-icon {
  width: 22px; height: 22px; flex: none;
  background-color: var(--yellow);
  -webkit-mask: url("../Assets/Art/copy.png") center / contain no-repeat;
          mask: url("../Assets/Art/copy.png") center / contain no-repeat;
  transition: background-color .15s;
}
.contact__row:hover .copy-icon { background-color: var(--cream); }

/* "Copied!" rises from the click and fades */
.copied-pop {
  position: fixed; z-index: 200; pointer-events: none;
  font-weight: 700; font-size: 20px; white-space: nowrap;
  color: var(--yellow); text-shadow: 2px 2px 0 var(--ink);
  animation: copied-pop 1s ease-out forwards;
}
@keyframes copied-pop {
  0% { opacity: 0; transform: translate(-50%, -50%); }
  15% { opacity: 1; }
  45% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, calc(-50% - 60px)); }
}
.socials { display: flex; flex-wrap: wrap; gap: 14px; }

.footer { text-align: center; padding: 32px 20px 48px; color: var(--text-soft); font-size: 15px; }
.footer p { margin: 0; }

/* ================= Micro-interactions ================= */
/* Rule: never rotate/scale elements with text (it renders blurry); images and decorations are fine. */

/* scroll progress */
.progress {
  position: fixed; left: 0; top: 0; z-index: 60;
  width: 100%; height: 4px;
  background: var(--yellow);
  transform-origin: 0 50%; transform: scaleX(0);
  pointer-events: none;
}

/* nav: sliding pill behind the active link */
.nav__links { position: relative; }
.nav__links a { position: relative; z-index: 1; }
.nav__pill {
  position: absolute; z-index: 0; left: 0; top: 0;
  border-radius: 999px; background: var(--yellow);
  opacity: 0;
  transition: transform .35s cubic-bezier(.34, 1.4, .64, 1), width .35s cubic-bezier(.34, 1.4, .64, 1), opacity .2s;
  pointer-events: none;
}
.nav__links.has-pill a.is-active { background: transparent; }
.nav__logo:active img { transform: rotate(-360deg) scale(.9); transition: transform .5s; }

/* avatar: click to pet */
.hero__avatar { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.hero__avatar:focus-visible { outline-offset: 0; border-radius: 50%; }
.hero__blob { transition: transform .4s cubic-bezier(.34, 1.56, .64, 1); }
.hero__avatar:hover .hero__blob { transform: scale(1.05); }
.hero__avatar.is-petted .hero__cat img { animation: squish .5s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes squish {
  0% { transform: scale(1, 1); }
  30% { transform: scale(1.1, .88) translateY(14px); }
  60% { transform: scale(.94, 1.08) translateY(-12px); }
  100% { transform: scale(1, 1); }
}
/* hero stars pulse */
.hero__facts li::before { display: inline-block; margin-right: 8px; animation: pulse 1.8s ease-in-out infinite; }
.hero__facts li:nth-child(2)::before { animation-delay: .9s; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.35); } }

/* section title squiggle flows on hover */
.section__title span::after { transition: background-position .6s ease; }
.section__title:hover span::after { background-position: 40px center; }

/* chips lift */
.chips li { transition: background-color .15s, color .15s, transform .15s, box-shadow .15s; }
.chips li:hover { transform: translate(-2px, -2px); box-shadow: 3px 3px 0 var(--ink); }

/* timeline dot pops when its card appears */
.job.is-visible::before { animation: dot-pop .6s .2s cubic-bezier(.34, 1.8, .64, 1) backwards; }
@keyframes dot-pop { from { transform: translateX(-50%) scale(0); } to { transform: translateX(-50%) scale(1); } }
.job:hover::before { background: var(--orange); transition: background-color .2s; }
.job__list li::before { transition: transform .3s; }
.job__list li:hover::before { transform: scale(1.4); }

/* contact cat waves */
.contact__cat { transition: transform .3s cubic-bezier(.34, 1.56, .64, 1); }
.contact__cat:hover { transform: rotate(6deg) translateY(-6px); }

/* particle bursts: motion (with gravity) is simulated in main.js */
/* stars.png is a 4-frame strip of 9x9 stars, shown at 2x; main.js steps the frames */
.burst {
  position: fixed; left: 0; top: 0; z-index: 200; pointer-events: none;
  width: 18px; height: 18px;
  background: url("../Assets/Art/stars.png") 0 0 / 72px 18px no-repeat;
  image-rendering: pixelated;
  will-change: transform;
}
/* the cat's stars: the smooth hand-drawn star with the usual ink shadow */
.burst--soft {
  background: url("../Assets/Art/star-yellow.png") center / contain no-repeat;
  image-rendering: auto;
  filter: drop-shadow(2px 2px 0 var(--ink));
}

/* ================= Scroll-in animation ================= */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .5s ease, transform .5s cubic-bezier(.34, 1.4, .64, 1); }
.reveal.is-visible { opacity: 1; transform: none; }

/* ================= Responsive ================= */
@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; text-align: center; padding-top: 32px; gap: 24px; }
  .hero__avatar { max-width: 260px; }
  .hero__facts, .hero__actions { justify-content: center; }
  .contact { flex-direction: column; text-align: center; padding: 28px 20px; }
  .contact__rows { justify-items: center; margin-left: 0; }
  .contact__row, .socials { justify-content: center; }
  .contact__label { min-width: 0; }
  .px-title { font-size: 40px; }
  .game-card .px-frame__inner { min-height: 340px; }
  .game-card__title { font-size: 20px; }
  .game-card__panel { grid-template-columns: minmax(0, 1fr); padding: 4px 24px 26px; }
  .game-card__links { flex-direction: row; flex-wrap: wrap; }
  .stack { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  body { font-size: 17px; }
  .nav { padding: 10px 14px; }
  .nav__logo span { display: none; }
  .nav__links { flex-wrap: nowrap; gap: 2px; }
  .nav__links a { padding: 5px 7px; font-size: 15px; }
  .timeline { --tl-pad: 26px; --tl-x: 8px; }
  .job { padding: 26px 18px 20px; }
  .job::before { width: 18px; height: 18px; }
  .job__date { right: 12px; font-size: 14px; }
  .job__role { font-size: 22px; }
  .px-title { font-size: 30px; }
  .play-card { width: 62vw; }
}
@media (max-width: 560px) and (orientation: portrait) {
  .player__window { height: auto; width: 94vw; max-height: 90vh; }
}

@media (max-width: 420px) {
  .nav__logo { display: none; }
  .nav { justify-content: center; }
}

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