:root {
  --ink: #1F2328;
  --ink-2: #5E6670;
  --paper: #FFFFFF;
  --line: #E3E6EA;

  --sky-50: #F4F8FC;
  --sky-100: #EEF5FC;
  --sky-200: #DDEBF9;
  --sky-300: #C2D7EE;
  --sky-400: #9DB3CC;
  --sky-600: #6F8BB0;
  --blue: #3D6BE8;
  --navy: #1B3F8F;

  --dark: #24272C;
  --green: #357D29;
  --tag: #2E7D32;

  --gamedev-bg: #E3EDFC;  --gamedev-fg: #1F4FA8;  --gamedev-tint: #D6E6FB;
  --art-bg: #FDEBDD;      --art-fg: #9A4A12;      --art-tint: #F8E0CC;
  --building-bg: #E2F2E0; --building-fg: #2F6B26; --building-tint: #D9EED3;

  /* In-game look */
  --bubble: #FFFFFF;
  --bubble-ink: #393B3F;
  --game-font: "Nunito Sans", "Segoe UI", system-ui, sans-serif;
  --baseplate: #2A9E4A;
  --studs-green: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26'%3E%3Crect x='6' y='6' width='14' height='14' rx='3.5' fill='%2331AA53' stroke='%231E873C' stroke-width='1.5'/%3E%3Cpath d='M8 17.5V9.5A1.5 1.5 0 0 1 9.5 8h8' fill='none' stroke='%2350C26F' stroke-width='1.2' stroke-linecap='round'/%3E%3C/svg%3E");
  --studs-white: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26'%3E%3Crect x='6' y='6' width='14' height='14' rx='3.5' fill='none' stroke='%23F2F4F6' stroke-width='1.5'/%3E%3C/svg%3E");

  --nav-h: 64px;
  --font: "Comic Neue", "Comic Sans MS", "Chalkboard SE", cursive;

  /* The sky and the baseplate from "portfolio test" (shown until the Studio shot loads, and past
     its edges on very wide screens) */
  --sky: #96A2C2;
  --sky-low: #DAD5D1;
  --ground: #7AC680;
  /* The stage keeps the mockup's shape (1137 x 742) and fits inside the screen */
  --scene-ratio: 1137 / 742;
  --screen-h: 100vh;
  --stage-w: min(100vw, calc(var(--screen-h) * 1137 / 742));
  --reply: #3E5EF6;
  color-scheme: light;
}
@supports (height: 100dvh) {
  :root { --screen-h: 100dvh; }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--ground);
  -webkit-font-smoothing: antialiased;
}

img, video { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.1; }
p { margin: 0; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 6px; }

.skip {
  position: absolute; left: -9999px; top: 8px; z-index: 100;
  background: #fff; padding: 8px 14px; border-radius: 8px; font-weight: 700;
}
.skip:focus { left: 8px; }

/* ---------- The game screen ----------
   The whole window is the game: an empty Roblox baseplate under the sky. Inside it, the stage keeps
   the Figma mockup "proto 1" (1137 x 742) as large as fits: every spot is a percent of the stage,
   every size scales with the stage's width (cqw), so it looks the same at any size. */
.scene {
  position: relative;
  width: 100%; height: var(--screen-h);
  overflow: hidden;
  background: linear-gradient(to bottom, var(--sky) 0%, var(--sky-low) 55%, var(--ground) 56%);
  color: #fff; font-family: var(--game-font);
}
.stage {
  position: absolute; left: 50%; top: 50%; translate: -50% -50%;
  width: var(--stage-w); aspect-ratio: var(--scene-ratio);
  container-type: inline-size;
}

/* The baseplate and sky, the rail line and the train. Each picture is placed by the numbers in
   trains.js, all in the same camera's view, so they line up exactly. */
.world {
  position: absolute; inset: 0; z-index: 1;
  /* The whole scene (sky, ground, rails, train) slides left so the trains sit in the middle of the
     screen: 12.4% of the stage puts the trains' average center at 50%. Everything moves together, so
     the trains stay on the rails. On very wide screens (past about 2.3 : 1) it slides a little less,
     so the sky picture still reaches the right edge (its right edge is 137.6% of the stage). */
  translate: calc(-1 * max(0px, min(0.124 * var(--stage-w), 0.876 * var(--stage-w) - 50vw))) 0;
}
/* The sky and baseplate run far past the stage, so wide and tall screens see more of the world.
   Phones and portrait screens get a taller picture than landscape screens. */
.backdrop {
  position: absolute; z-index: 0;
  left: var(--bdw-l); top: var(--bdw-t); width: var(--bdw-w); height: var(--bdw-h);
  pointer-events: none; user-select: none;
  opacity: 0; transition: opacity 0.4s ease;
}
.backdrop.is-in { opacity: 1; }
.backdrop img { display: block; width: 100%; height: 100%; max-width: none; }
@media (max-width: 760px), (max-aspect-ratio: 6/5) {
  .backdrop { left: var(--bdt-l); top: var(--bdt-t); width: var(--bdt-w); height: var(--bdt-h); }
}
.shot {
  position: absolute; display: block; max-width: none;
  pointer-events: none; user-select: none; -webkit-user-drag: none;
}
.shot--rails { z-index: 1; opacity: 0; transition: opacity 0.35s ease; }
.shot--rails.is-in { opacity: 1; }
.shot--rails.is-out { opacity: 0; }

/* A train ("car") is its sharp picture plus a motion-blurred copy. Switching trains moves the whole
   car along the track by scaling it about the track's vanishing point: every line through that point
   maps onto itself, so the wheels stay on the rails at any distance. site.js drives it all with
   transform and opacity only, which the browser animates on the GPU. */
.car { position: absolute; inset: 0; z-index: 2; transform-origin: var(--vp, 7.365% 52.991%); pointer-events: none; }
.car.is-leaving { z-index: 3; } /* it's driving toward the camera, so it passes in front */
.shot--blur { opacity: 0; }

/* VFX drawn by ChatGPT: speed lines that converge on the vanishing point, brake sparks */
.fx { position: absolute; display: block; max-width: none; pointer-events: none; user-select: none; opacity: 0; }
.fx--speed { z-index: 4; filter: drop-shadow(0 0 2px rgba(150, 195, 255, 0.9)); }
.fx--sparks { z-index: 6; filter: brightness(1.35) drop-shadow(0 0 3px rgba(255, 170, 60, 0.95)); }

/* The message that started it: avatar, name, white bubble, and your blue "ok" */
/* Back to the profile page, above the chat (like the leave button in a game) */
.back-btn {
  position: absolute; z-index: 5; left: 2.463%; top: 2.4%;
  display: inline-flex; align-items: center; gap: 0.3em;
  padding: 0.38em 0.85em 0.38em 0.55em;
  font: 800 clamp(13px, 1.3cqw, 18px)/1.1 var(--game-font); color: #fff; text-decoration: none;
  background: rgba(25, 27, 29, 0.6); border-radius: clamp(6px, 0.7cqw, 10px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  transition: background-color 0.15s ease, transform 0.15s ease;
}
.back-btn svg { width: 1em; height: 1em; flex: none; }
.back-btn:hover { background: rgba(25, 27, 29, 0.78); }
.back-btn:active { transform: scale(0.95); }
.back-btn:focus-visible { outline: 3px solid var(--reply); outline-offset: 2px; }

/* Inside the main page's game window: the window has its own close button, so no Back button, and
   the chat goes back to the top. Until the loading screen lifts, the intro animations wait. */
.is-client .back-btn { display: none; }
.is-client .chat { top: 5.256%; }
.client-wait *, .client-wait *::before, .client-wait *::after { animation-play-state: paused !important; }

.chat {
  position: absolute; z-index: 3; left: 2.463%; top: 9.8%;
  display: flex; align-items: flex-start; gap: 0.19em;
  font-size: clamp(13px, 1.407cqw, 20px);
}
.chat-avatar {
  flex: none; width: 4.19em; height: 4.19em; border-radius: 50%; object-fit: cover;
  filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.25));
}
.chat-body { display: flex; flex-direction: column; align-items: flex-start; }
.chat-from {
  margin: 0 0 0.25em 0.31em; white-space: nowrap;
  font-size: 0.8125em; font-weight: 600; line-height: 1.23;
  color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}
.chat-from strong { font-weight: 700; }
/* the "ok" lines up with the right edge of the message above it */
.chat-thread { display: flex; flex-direction: column; align-items: flex-end; gap: 0.5625em; }
.chat-bubble {
  position: relative; padding: 0.5em 0.75em; border-radius: 0.75em;
  font-weight: 600; line-height: 1.375; white-space: nowrap;
  box-shadow: 0 1px 2px rgba(31, 35, 40, 0.06), 0 0 0 1px rgba(31, 35, 40, 0.05);
}
.chat-bubble--them { background: var(--bubble); color: var(--bubble-ink); transform-origin: 0 50%; }
.chat-bubble--me { background: var(--reply); color: #fff; transform-origin: 100% 50%; }
.chat-text { position: relative; }

/* Hotbar: pick a train like picking a tool in a Roblox game */
.hotbar-wrap {
  position: absolute; z-index: 4; left: 50%; bottom: 2.6%; translate: -50% 0;
  display: flex; flex-direction: column; align-items: center; gap: 0.45cqw;
}
.hotbar-name {
  font-size: clamp(13px, 1.5cqw, 20px); font-weight: 800; line-height: 1.2; white-space: nowrap;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6), 0 0 1px rgba(0, 0, 0, 0.6);
}
.hotbar { display: flex; gap: clamp(4px, 0.55cqw, 8px); }
.slot {
  position: relative; flex: none; width: clamp(38px, 4.75cqw, 62px); aspect-ratio: 1;
  padding: 0; border: 0; border-radius: clamp(6px, 0.7cqw, 10px); cursor: pointer;
  background: rgba(25, 27, 29, 0.55); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
  transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.slot:hover { background: rgba(25, 27, 29, 0.72); }
.slot:active { transform: scale(0.95); }
.slot[aria-pressed="true"] { background: rgba(25, 27, 29, 0.78); box-shadow: inset 0 0 0 2px #fff; }
.slot:focus-visible { outline: 3px solid var(--reply); outline-offset: 2px; }
.slot-img { position: absolute; inset: 6%; width: 88%; height: 88%; object-fit: contain; pointer-events: none; }
.slot-key {
  position: absolute; left: 7%; top: 2%; z-index: 1;
  font-size: clamp(10px, 1.05cqw, 14px); font-weight: 800; line-height: 1.3; color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 10px; border: 0;
  font: inherit; font-size: 17px; font-weight: 700; text-decoration: none; cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease;
}
.btn:active { transform: scale(0.98); }
.btn-dark { background: var(--dark); color: #fff; }
.btn-dark:hover { background: #3A3E45; }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { background: #2C6B22; }

/* Work */
.work {
  padding: clamp(24px, 4vw, 48px) 0 clamp(56px, 8vw, 96px);
}
/* Timeline */
.timeline { position: relative; --progress: 0; }
.timeline::before, .timeline::after {
  content: ""; position: absolute; left: 7px; top: 8px; bottom: 0;
  width: 2px; border-radius: 2px; background: rgba(255, 255, 255, 0.3);
}
.timeline::after {
  background: rgba(255, 255, 255, 0.85);
  transform-origin: top; transform: scaleY(var(--progress));
}

.year { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 24px; }
.year + .year { margin-top: 48px; }
.year-label {
  position: sticky; top: calc(var(--nav-h) + 24px); align-self: start; z-index: 2;
  display: flex; align-items: center; gap: 12px;
  font-size: clamp(20px, 2.2vw, 24px); font-weight: 700; line-height: 1; color: var(--navy);
}
.year-label::before {
  content: ""; flex: none; width: 17px; height: 17px; border-radius: 50%;
  background: #fff; border: 3px solid #23753A;
}
.year-text { padding: 5px 12px; border-radius: 999px; background: #fff; box-shadow: 0 1px 2px rgba(31, 35, 40, 0.06), 0 0 0 1px rgba(31, 35, 40, 0.05); }
.year-items { display: flex; flex-direction: column; gap: 40px; }

/* Project: chat bubble on the baseplate, then a white panel (cover + text), case study underneath */
.project-card {
  display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
  gap: 8px 28px; align-items: center;
  padding: 10px; border-radius: 16px; background: #fff; box-shadow: 0 1px 2px rgba(31, 35, 40, 0.06), 0 0 0 1px rgba(31, 35, 40, 0.05);
}
.cover {
  display: block; width: 100%; padding: 0; border: 0; margin: 0;
  aspect-ratio: 16 / 10; position: relative; overflow: hidden;
  border-radius: 10px; background: var(--sky-100); cursor: pointer; font: inherit; color: inherit;
}
.cover img, .cover video { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.cover:hover img, .cover:hover video { transform: scale(1.02); }
.cover--gamedev { background: var(--gamedev-tint); }
.cover--3d { background: var(--art-tint); }
.cover--building { background: var(--building-tint); }
.cover-placeholder {
  display: flex; width: 100%; height: 100%; align-items: center; justify-content: center;
  color: rgba(31, 35, 40, 0.5); font-size: 16px;
}
.tag {
  position: absolute; left: 0; bottom: 12px;
  background: var(--tag); color: #fff;
  font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 3px 16px 3px 10px;
  clip-path: polygon(0 0, 100% 0, calc(100% - 9px) 100%, 0 100%);
}

.project-title { font-size: clamp(22px, 2.2vw, 26px); font-weight: 700; }
.project-meta { margin-top: 4px; color: var(--ink-2); font-size: 16px; }

.chips { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-block; font-size: 13px; font-weight: 700; line-height: 1.5;
  padding: 1px 10px; border-radius: 999px; white-space: nowrap;
}
.chip--gamedev { background: var(--gamedev-bg); color: var(--gamedev-fg); }
.chip--3d { background: var(--art-bg); color: var(--art-fg); }
.chip--building { background: var(--building-bg); color: var(--building-fg); }
.chip-new {
  display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 999px;
  background: #fff; font-size: 10px; line-height: 16px; letter-spacing: 0.06em;
  text-transform: uppercase; vertical-align: 1px;
}

/* The goal, shown as a chat message above the project */
.project .request { grid-column: 1 / -1; }
.request { display: flex; align-items: flex-start; gap: 14px; margin: 0 0 6px; }
.avatar {
  flex: none; width: 44px; height: 44px; border-radius: 50%; object-fit: cover;
  background: var(--sky-200); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--sky-300);
}
/* Your animated avatar: the thinking spritesheet standing right on the page, no circle.
   A soft drop shadow follows your character's outline, and the edges fade out in a soft oval
   so the cut-off shoulders and wings don't show a hard edge. */
.avatar--sprite {
  --size: 64px;
  display: block; width: var(--size); height: var(--size);
  border: 0; border-radius: 0; box-shadow: none;
  background: var(--sprite) 0 0 / calc(var(--size) * var(--frames)) var(--size) no-repeat;
  filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.35));
  -webkit-mask-image: radial-gradient(ellipse 62% 72% at 50% 38%, #000 74%, transparent 100%);
  mask-image: radial-gradient(ellipse 62% 72% at 50% 38%, #000 74%, transparent 100%);
  animation: think-loop var(--loop) steps(var(--frames)) infinite;
}
@keyframes think-loop { to { background-position: calc(var(--size) * var(--frames) * -1) 0; } }

.request-body { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
/* Name over the bubble, like the name over a player's head */
.request-from {
  margin: 0 0 4px 4px; font-family: var(--game-font); font-size: 13px; font-weight: 600; line-height: 1.2;
  color: rgba(255, 255, 255, 0.88); text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}
.request-from strong { color: #fff; font-weight: 700; }

/* In-game bubble chat: soft gray rounded box, centered text, a small tail at the bottom */
.request-bubble {
  position: relative; min-width: 0; max-width: 520px;
  padding: 8px 12px; border-radius: 12px;
  background: var(--bubble); color: var(--bubble-ink); font-family: var(--game-font);
  text-align: center; transform-origin: 0 50%;
  box-shadow: 0 1px 2px rgba(31, 35, 40, 0.06), 0 0 0 1px rgba(31, 35, 40, 0.05);
}
.request:not(.request--thought) .request-bubble::after {
  /* tail on the left, pointing at the head photo */
  content: ""; position: absolute; left: -5px; top: 8px;
  width: 12px; height: 12px; border-radius: 0 0 0 3px;
  background: var(--bubble); transform: rotate(45deg);
}
.request-text { position: relative; font-size: 16px; font-weight: 600; line-height: 1.35; }

.typing { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; gap: 5px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: #8A9097; }

/* Your own ideas: a cloud-shaped thought bubble, with dots trailing back to your avatar */
.request--thought { position: relative; gap: 24px; }
.request--thought .request-bubble {
  --r: 12px;
  padding: calc(var(--r) + 2px) calc(var(--r) + 10px);
  background: var(--bubble); border-radius: 0;
  -webkit-mask:
    radial-gradient(var(--r) at 50% var(--r), #000 97%, #0000) 50% 0 / calc(var(--r) * 1.9) 51% repeat-x,
    radial-gradient(var(--r) at 50% calc(100% - var(--r)), #000 97%, #0000) 50% 100% / calc(var(--r) * 1.9) 51% repeat-x,
    radial-gradient(var(--r) at var(--r) 50%, #000 97%, #0000) 0 50% / 51% calc(var(--r) * 1.9) repeat-y,
    radial-gradient(var(--r) at calc(100% - var(--r)) 50%, #000 97%, #0000) 100% 50% / 51% calc(var(--r) * 1.9) repeat-y,
    linear-gradient(#000 0 0) 50% 50% / calc(100% - 2 * var(--r)) calc(100% - 2 * var(--r)) no-repeat;
  mask:
    radial-gradient(var(--r) at 50% var(--r), #000 97%, #0000) 50% 0 / calc(var(--r) * 1.9) 51% repeat-x,
    radial-gradient(var(--r) at 50% calc(100% - var(--r)), #000 97%, #0000) 50% 100% / calc(var(--r) * 1.9) 51% repeat-x,
    radial-gradient(var(--r) at var(--r) 50%, #000 97%, #0000) 0 50% / 51% calc(var(--r) * 1.9) repeat-y,
    radial-gradient(var(--r) at calc(100% - var(--r)) 50%, #000 97%, #0000) 100% 50% / 51% calc(var(--r) * 1.9) repeat-y,
    linear-gradient(#000 0 0) 50% 50% / calc(100% - 2 * var(--r)) calc(100% - 2 * var(--r)) no-repeat;
}
.request--thought::before,
.request--thought::after {
  content: ""; position: absolute; border-radius: 50%; background: var(--bubble);
}
/* dots go from the head (top of the avatar) up toward the cloud */
.request--thought::before { width: 12px; height: 12px; left: 72px; top: 22px; }
.request--thought::after { width: 7px; height: 7px; left: 65px; top: 13px; }

.project-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 12px; }
.project-foot .case-toggle { margin-top: 0; }

/* Knowledge points */
.medal { display: block; flex: none; overflow: visible; }

/* Small "+25" next to each skill and lesson */
.xp {
  display: inline-flex; align-items: center; gap: 4px; vertical-align: middle;
  color: #7A5600; font-size: 14px; font-weight: 700; line-height: 1.4; white-space: nowrap;
}
.xp img { width: 18px; height: 18px; }
.xp-word { font-weight: 400; color: var(--ink-2); }

/* The medal on each project card */
.xp-medal { display: inline-flex; align-items: center; gap: 6px; font-size: 16px; white-space: nowrap; }
.xp-medal .medal { width: 32px; height: 32px; filter: drop-shadow(0 2px 0 rgba(31, 35, 40, 0.15)); }
.xp-amount { font-weight: 700; }

/* Total in the top bar */
.knowledge-total {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 12px 3px 4px; border-radius: 999px;
  background: #FFF4CF; border: 1px solid #F1D27A; color: #6B4E00;
  font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.knowledge-total img { width: 26px; height: 26px; }
.knowledge-word { font-weight: 400; }

/* "Badge earned" at the end of an opened project */
.badge-earned {
  display: flex; align-items: center; gap: 20px;
  padding-top: 22px; border-top: 1px solid var(--line);
}
.badge-tile {
  flex: none; width: 116px; height: 116px; border-radius: 12px;
  display: grid; place-items: center; background: var(--dark);
}
.badge-tile .medal { width: 78px; height: auto; }
.badge-name { font-size: 22px; font-weight: 700; }
.badge-note { margin-top: 2px; color: var(--ink-2); font-size: 16px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.case-toggle {
  margin-top: 12px; padding: 4px 0; border: 0; background: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  font: inherit; font-size: 17px; font-weight: 700; color: var(--navy);
}
.case-toggle:hover { text-decoration: underline; }
.case-toggle .arrow { display: inline-block; transition: transform 0.2s ease; }
.case-toggle[aria-expanded="true"] .arrow { transform: rotate(180deg); }

.case {
  margin-top: 16px; display: grid; gap: 26px;
  padding: clamp(20px, 3vw, 32px);
  background: #fff; border-radius: 16px; box-shadow: 0 1px 2px rgba(31, 35, 40, 0.06), 0 0 0 1px rgba(31, 35, 40, 0.05);
  animation: case-in 0.25s ease;
}
@keyframes case-in { from { opacity: 0; transform: translateY(-6px); } }
.case h4 {
  margin-bottom: 8px; font-size: 14px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2);
}
.case-text { font-size: 19px; }
.skill-rows { margin: 0; }
.skill-row {
  display: grid; grid-template-columns: 215px minmax(0, 1fr); gap: 16px;
  padding: 12px 0; border-top: 1px solid var(--line);
}
.skill-row dt { padding-top: 2px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; align-self: start; }
.skill-row dd { margin: 0; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.gallery img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 10px; }
.case-links { display: flex; flex-wrap: wrap; gap: 10px; }

/* What I learned (check) vs. still learning (dashed circle) */
.lessons {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px 36px;
  padding-top: 22px; border-top: 1px solid var(--line);
}
.lesson-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.lesson-list li { position: relative; padding-left: 34px; }
.lesson-list li::before {
  content: ""; position: absolute; left: 0; top: 2px;
  width: 22px; height: 22px; border-radius: 50%;
}
.lesson-list.is-learned li::before { background: var(--tag); }
.lesson-list.is-learned li::after {
  content: ""; position: absolute; left: 8px; top: 6px; width: 6px; height: 11px;
  border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg);
}
.lesson-list.is-not-yet li::before { border: 2px dashed var(--sky-600); background: #fff; }
.lesson-kind {
  display: block; margin-bottom: 2px; font-size: 12px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2);
}

.milestone {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
  padding: 14px 18px; border-radius: 12px; background: #fff; box-shadow: 0 1px 2px rgba(31, 35, 40, 0.06), 0 0 0 1px rgba(31, 35, 40, 0.05);
}
.milestone-label {
  font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--navy); background: var(--sky-200); padding: 2px 10px; border-radius: 999px;
}
.milestone-text { font-size: 20px; font-weight: 700; }
.milestone-date { color: var(--ink-2); font-size: 16px; }


/* Scroll reveal */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.6s ease, transform 0.6s ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }

/* The small print, in the corner of the game screen */
.scene-note {
  position: absolute; z-index: 5; right: 14px; bottom: 10px;
  display: flex; flex-direction: column; align-items: flex-end;
  font-size: 12px; font-weight: 600; line-height: 1.35; color: rgba(255, 255, 255, 0.88);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Phones and portrait screens: the stage is the whole screen. Message on top, the train across the
   middle, the hotbar along the bottom. The track is drawn bigger here (128% wide) so the trains are
   easier to see, and it isn't slid left: at -28% the trains are already in the middle. The train sits
   halfway between the message and the hotbar, but never so low that the sky picture (it reaches 52% of
   the screen's width above the track's picture) stops short of the top of the screen. */
@media (max-width: 760px), (max-aspect-ratio: 6/5) {
  .stage { left: 0; top: 0; translate: none; width: 100%; height: 100%; aspect-ratio: auto; }
  .world {
    inset: auto; left: -28%; width: 128%; aspect-ratio: var(--scene-ratio); translate: none;
    top: min(52cqw, calc(50% + 15px - 42.4cqw));
  }
  .back-btn { left: 4%; top: 12px; font-size: 14px; }
  .chat { left: 4%; top: 54px; font-size: 14px; }
  .hotbar-wrap { bottom: 28px; gap: 4px; }
  .hotbar-name { font-size: 14px; }
  .slot { width: clamp(32px, 11.6cqw, 46px); }
  .scene-note { left: 0; right: 0; bottom: 6px; flex-direction: row; justify-content: center; gap: 0 8px; font-size: 10.5px; }
}

/* Small screens */
@media (max-width: 760px) {
  .wrap { padding: 0 16px; }


  .year { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .year + .year { margin-top: 14px; }
  .year-label { top: var(--nav-h); padding: 6px 0; }
  .year-text { padding: 2px 10px; }
  .year-items { padding-left: 32px; gap: 28px; }
  .project-card { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 6px 6px 4px; border-radius: 14px; }
  .request { gap: 10px; margin-bottom: 6px; }
  .avatar { width: 36px; height: 36px; }
  .avatar--sprite { --size: 48px; }
  .request-from { margin-bottom: 1px; font-size: 12px; }
  .request-bubble { padding: 5px 10px; border-radius: 10px; }
  .request:not(.request--thought) .request-bubble::after { left: -4px; top: 6px; width: 10px; height: 10px; }
  .request-text { font-size: 15px; }
  .request--thought { gap: 18px; }
  .request--thought .request-bubble { --r: 7px; padding: calc(var(--r) + 1px) calc(var(--r) + 6px); }
  .request--thought::before { width: 8px; height: 8px; left: 55px; top: 17px; }
  .request--thought::after { width: 5px; height: 5px; left: 50px; top: 10px; }
  .request-role { display: none; }
  .project .cover { aspect-ratio: 4 / 1; }
  .project .tag { bottom: 8px; font-size: 11px; padding: 2px 14px 2px 8px; }
  .project-title { font-size: 20px; }
  .project-meta { margin-top: 2px; font-size: 14px; }
  .project-info { margin-top: 8px; }
  .project-foot { margin-top: 4px; }
  .xp-medal { font-size: 15px; }
  .xp-medal .medal { width: 28px; height: 28px; }
  .xp-medal .xp-word { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
  .badge-tile { width: 96px; height: 96px; }
  .badge-tile .medal { width: 64px; height: auto; }
  .badge-name { font-size: 19px; }
  .knowledge-total { padding: 3px 10px 3px 6px; font-size: 15px; }
  .knowledge-word { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
  .project-info .chips { margin-top: 8px; gap: 5px; }
  .project-info .chip { font-size: 12px; padding: 1px 8px; }
  .project-info .chip-new { margin-left: 4px; padding: 0 4px; font-size: 9px; line-height: 14px; }
  .case-toggle { margin-top: 4px; }
  .skill-row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
}

/* ---------- In-game animations ----------
   When a project scrolls into view: "•••" typing dots, the message pops in,
   then the knowledge medal flips in like a badge being awarded. */
@keyframes bubble-pop {
  0% { opacity: 0; transform: scale(0.4); }
  70% { opacity: 1; transform: scale(1.05); }
  100% { opacity: 1; transform: none; }
}
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; visibility: hidden; } }
@keyframes typing-dot {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.45; }
  30% { transform: translateY(-4px); opacity: 1; }
}
@keyframes medal-earn {
  0% { opacity: 0; transform: perspective(160px) rotateY(-180deg) scale(0.3); }
  60% { opacity: 1; transform: perspective(160px) rotateY(20deg) scale(1.15); }
  100% { opacity: 1; transform: none; }
}
@keyframes rise-in { from { opacity: 0; transform: translateY(10px); } }

.js .project.is-visible .request-bubble { animation: bubble-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 0.15s both; }
.js .project.is-visible .typing { display: flex; animation: fade-out 0.15s 1s forwards; }
.js .project.is-visible .typing i { animation: typing-dot 0.6s 0.2s 2; }
.js .project.is-visible .typing i:nth-child(2) { animation-delay: 0.3s; }
.js .project.is-visible .typing i:nth-child(3) { animation-delay: 0.4s; }
.js .project.is-visible .request-text { animation: fade-in 0.3s 1.05s both; }
.js .project.is-visible .xp-medal .medal { animation: medal-earn 0.7s ease-out 1.3s both; }

/* The panel's opening: "•••", the message pops in, your "ok" pops in, then the train rolls in */
.js .chat-avatar, .js .chat-from { animation: fade-in 0.3s ease 0.05s both; }
.js .chat-bubble--them { animation: bubble-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 0.15s both; }
.js .chat .typing { display: flex; animation: fade-out 0.15s 0.75s forwards; }
.js .chat .typing i { animation: typing-dot 0.5s 0.2s 1; }
.js .chat .typing i:nth-child(2) { animation-delay: 0.28s; }
.js .chat .typing i:nth-child(3) { animation-delay: 0.36s; }
.js .chat-bubble--them .chat-text { animation: fade-in 0.25s 0.8s both; }
.js .chat-bubble--me { animation: bubble-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 1.05s both; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .case { animation: none; }
  .cover img, .cover video, .case-toggle .arrow { transition: none; }
  .avatar--sprite { animation: none; }
  .js .project.is-visible .request-bubble,
  .js .project.is-visible .request-text,
  .js .project.is-visible .xp-medal .medal { animation: none; }
  .js .project.is-visible .typing { display: none; }
  /* the panel shows up all at once, and trains swap without rolling */
  .js .chat-avatar, .js .chat-from, .js .chat-bubble--them,
  .js .chat-bubble--them .chat-text, .js .chat-bubble--me { animation: none; }
  .js .chat .typing { display: none; }
  .fx { display: none; }
  .shot--rails, .backdrop { transition: none; }
  .slot { transition: none; }
}
