/* =========================================================
   Kenjin Rey Cordero — Game QA Portfolio
   ========================================================= */

/* ---------- Design tokens ---------- */
:root {
  color-scheme: light;

  /* Blues and white, kept soft so they're easy on the eyes */
  --bg: #f3f7fc;         /* page background: a whisper of blue, the light twin of dark mode */
  --surface: #ffffff;    /* cards, tickets and chips */
  --paper: #e6eff9;      /* tinted section background */
  --mist: #dbe7f4;       /* chips, placeholders */
  --sky: #bfd3ea;        /* borders, dashed lines */
  --periwinkle: #8aa6d2; /* collision box, decoration */
  --blue: #3a6798;       /* accent: links, icons, outlines */
  --blue-deep: #26496f;  /* accent on hover */
  --fill: #3a6798;       /* solid buttons and checkmarks */
  --fill-hover: #26496f;
  --on-fill: #ffffff;    /* text on a solid fill */
  --ink: #182f48;        /* body text */
  --ink-soft: #4a6079;   /* secondary text */
  --line: #d3e0ee;       /* hairlines */
  --grid: #e2ebf6;       /* hero editor grid */
  --header-bg: rgba(243, 247, 252, .92);
  --shadow: rgba(24, 47, 72, .4);
  --backdrop: rgba(24, 47, 72, .38);

  /* Contact band */
  --navy: #1c3553;
  --navy-line: #36557a;
  --on-navy: #c4d4e6;
  --on-navy-soft: #9fb5cf;
  --on-navy-strong: #ffffff;
  --navy-accent: #bfd3ea;

  /* Profile photo card */
  --photo-top: #a7c1e3;
  --photo-bottom: #41709f;

  /* Achievement toast: dark blue on the light page */
  --ach-bg: #1c3553;
  --ach-icon-bg: #2f5682;
  --ach-ink: #ffffff;
  --ach-sub: #c4d4e6;

  /* Handheld console */
  --console-body: #e8eff8;
  --console-body-2: #d7e3f1;
  --console-edge: #bccde2;
  --console-bezel: #4d6283;
  --console-bezel-ink: #c3d1e4;
  --console-ink: #34598a;
  --console-led: #2c3d57;
  --console-dpad: #22344d;
  --console-dpad-press: #344b6b;
  --console-ab: #3a6798;
  --console-pill: #9fb2cb;
  --console-slot: #b6c7dc;

  /* Animation player: dark like a video player, in both themes */
  --player-bg: #0a0c10;
  --player-bar: #121a24;
  --player-ink: #e6edf5;
  --player-muted: #8f9cad;
  --player-accent: #8cb1df;

  --font: "Futura PT", "futura-pt", Futura, "Jost", "Century Gothic", system-ui, sans-serif;

  /* Type scale */
  --step--1: 0.9375rem;
  --step-0: 1.125rem;
  --step-1: 1.375rem;
  --step-2: clamp(1.5rem, 1.3rem + 0.8vw, 1.875rem);
  --step-3: clamp(2.125rem, 1.5rem + 2.4vw, 3.25rem);
  --step-4: clamp(3.25rem, 1.6rem + 6.4vw, 6.5rem);

  /* Space and shape */
  --space-section: clamp(4.5rem, 3rem + 6vw, 8rem);
  --container: 1140px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius-s: 6px;
  --radius-m: 12px;
  --radius-l: 20px;

  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
}

/* Dark mode: the same blues, turned down for low light.
   js/main.js sets data-theme on <html> and remembers the choice. */
:root[data-theme="dark"] {
  color-scheme: dark;

  --bg: #0e1a28;
  --surface: #16273c;
  --paper: #122134;
  --mist: #1c3048;
  --sky: #2e4b6e;
  --periwinkle: #5d7fae;
  --blue: #8cb1df;
  --blue-deep: #b0cbee;
  --fill: #4271a6;
  --fill-hover: #355d8b;
  --on-fill: #ffffff;
  --ink: #e1eaf4;
  --ink-soft: #a2b5ca;
  --line: #233a55;
  --grid: #142538;
  --header-bg: rgba(14, 26, 40, .9);
  --shadow: rgba(0, 0, 0, .55);
  --backdrop: rgba(3, 9, 16, .6);

  --navy: #0a1421;
  --navy-line: #22374f;
  --on-navy: #b6c7da;
  --on-navy-soft: #8ea3bb;
  --on-navy-strong: #eef4fb;
  --navy-accent: #9fc0e8;

  --photo-top: #2f5480;
  --photo-bottom: #14263b;

  /* Achievement toast: light blue on the dark page */
  --ach-bg: #bcd3ee;
  --ach-icon-bg: #9cbde6;
  --ach-ink: #0e1a28;
  --ach-sub: #26496f;

  --console-body: #1d3149;
  --console-body-2: #172840;
  --console-edge: #0f1d2e;
  --console-bezel: #0b1522;
  --console-bezel-ink: #6f86a6;
  --console-ink: #8cb1df;
  --console-led: #24364d;
  --console-dpad: #0a1320;
  --console-dpad-press: #1b2a3e;
  --console-ab: #4271a6;
  --console-pill: #33506f;
  --console-slot: #0f1d2e;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main { overflow-x: clip; }

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--ink);
}
h2 { font-size: var(--step-3); line-height: 1.08; letter-spacing: -0.02em; }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-0); }

p { margin: 0 0 1em; }

a {
  color: var(--blue);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:hover { color: var(--blue-deep); }

img { display: block; max-width: 100%; height: auto; }
figure { margin: 0; }

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

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

.skip-link {
  position: absolute;
  left: 16px; top: -100px;
  z-index: 100;
  padding: .6em 1em;
  background: var(--fill);
  color: var(--on-fill);
  border-radius: var(--radius-s);
  text-decoration: none;
}
.skip-link:focus { top: 16px; color: var(--on-fill); }

.container {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Buttons and chips ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  padding: .85em 1.4em;
  border: 2px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-size: 1.0625rem;
  font-weight: 500;
  line-height: 1.1;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s;
}
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--fill); color: var(--on-fill); }
.btn-primary:hover { background: var(--fill-hover); color: var(--on-fill); }

.btn-ghost { background: transparent; color: var(--blue); border-color: var(--sky); }
.btn-ghost:hover { border-color: var(--blue); color: var(--blue-deep); }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.tags li {
  padding: .3em .85em;
  border-radius: 999px;
  background: var(--mist);
  color: var(--ink);
  font-size: .9375rem;
  font-weight: 500;
  line-height: 1.35;
}

/* Bug tags get a small bug icon */
.tags-bugs li {
  display: inline-flex;
  align-items: center;
  gap: .45em;
  background: var(--surface);
  border: 1.5px solid var(--sky);
}
.tags-bugs li::before {
  content: "";
  flex: none;
  width: 15px;
  height: 15px;
  background: var(--blue);
  -webkit-mask: var(--bug-icon) center / contain no-repeat;
          mask: var(--bug-icon) center / contain no-repeat;
}
:root {
  --bug-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 9a4 4 0 0 1 8 0v5a4 4 0 0 1-8 0z'/%3E%3Cpath d='M12 9v9M9 6.5 7.5 4.5M15 6.5l1.5-2M8 11H4.5M8 15H5M16 11h3.5M16 15h3'/%3E%3C/svg%3E");
}

/* Image placeholders (swap for <img> later) */
.placeholder {
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background-color: var(--mist);
  background-image: repeating-linear-gradient(135deg, transparent 0 14px, rgba(138, 166, 210, .16) 14px 15px);
  border: 2px dashed var(--sky);
  border-radius: var(--radius-l);
  color: var(--ink-soft);
  font-weight: 500;
  text-align: center;
}
.placeholder small {
  display: block;
  font-size: .875rem;
  font-weight: 400;
}
.ratio-4-5 { aspect-ratio: 4 / 5; }
.ratio-16-9 { aspect-ratio: 16 / 9; }
.ratio-16-10 { aspect-ratio: 16 / 10; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
/* The frosted background sits on its own layer. A blur on the header itself
   would trap the phone menu panel inside the header bar. */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
          backdrop-filter: saturate(1.4) blur(10px);
}
.site-header.is-scrolled { border-bottom-color: var(--line); }

.header-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 72px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.brand-name {
  color: var(--ink);
  font-size: 1.0625rem;
  font-weight: 600;
  text-decoration: none;
}
.brand-name:hover { color: var(--blue); }

/* The KC badge doubles as a coin block (easter egg) */
.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 2px solid var(--blue);
  border-radius: 9px;
  background: var(--bg);
  color: var(--blue);
  font: inherit;
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .02em;
  cursor: pointer;
  transition: background-color .3s, border-color .3s, color .3s;
}
.brand-mark-text { position: relative; z-index: 1; }

/* Bump: the block jumps up a little when hit */
.brand-mark.is-bumped { animation: block-bump .26s cubic-bezier(.3, 0, .4, 1); }
@keyframes block-bump {
  40% { translate: 0 -7px; }
  100% { translate: 0 0; }
}

/* The coin pops out of the top, spins, then drops back and fades */
.coin-pop {
  position: absolute;
  bottom: calc(100% - 6px);
  left: 50%;
  z-index: -1;
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: -7px;
  color: #b9770e;
  font-size: .6875rem;
  font-weight: 700;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
}
.coin-pop svg { width: 14px; height: 14px; }
.coin-pop span { color: #e19b0b; text-shadow: 0 1px 0 var(--bg); }
.brand-mark.is-coin .coin-pop { animation: coin-pop .6s cubic-bezier(.2, .7, .3, 1) forwards; }
.brand-mark.is-coin .coin-pop svg { animation: coin-spin .3s linear 2; }
@keyframes coin-pop {
  0%   { opacity: 0; translate: 0 16px; }
  15%  { opacity: 1; }
  45%  { opacity: 1; translate: 0 -8px; }
  75%  { opacity: 1; translate: 0 -5px; }
  100% { opacity: 0; translate: 0 -1px; }
}
@keyframes coin-spin {
  50% { scale: .15 1; }
}

/* Tiny coin counter that appears after the first coin */
.coin-count {
  position: absolute;
  right: -11px;
  bottom: -7px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 1px 5px 1px 2px;
  border: 1.5px solid var(--bg);
  border-radius: 999px;
  background: #f4b223;
  color: #4a2f00;
  font-size: .625rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0;
  text-align: center;
  scale: 0;
  transition: scale .3s var(--ease-spring);
}
.coin-count svg { width: 10px; height: 10px; flex: none; }
.coin-count.has-coins { scale: 1; }
.coin-count.is-tick { animation: count-tick .3s var(--ease-spring); }
@keyframes count-tick { 50% { scale: 1.35; } }

/* After 5 coins: an empty, dark "used" block with four bolts */
.brand-mark.is-empty {
  border-color: var(--console-dpad);
  background-color: var(--console-dpad);
  background-image:
    radial-gradient(circle at 6px 6px, rgba(255, 255, 255, .28) 1.5px, transparent 2px),
    radial-gradient(circle at calc(100% - 6px) 6px, rgba(255, 255, 255, .28) 1.5px, transparent 2px),
    radial-gradient(circle at 6px calc(100% - 6px), rgba(255, 255, 255, .28) 1.5px, transparent 2px),
    radial-gradient(circle at calc(100% - 6px) calc(100% - 6px), rgba(255, 255, 255, .28) 1.5px, transparent 2px);
  color: rgba(255, 255, 255, .4);
  cursor: default;
}
.brand-mark.is-empty.is-thunk { animation: block-thunk .18s ease-out; }
@keyframes block-thunk {
  50% { translate: 0 -2px; }
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-left: auto;
}
.site-nav ul {
  display: flex;
  gap: 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-nav ul a {
  position: relative;
  padding: 6px 0;
  color: var(--ink-soft);
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
}
.site-nav ul a:hover,
.site-nav ul a[aria-current="true"] { color: var(--blue); }
.site-nav ul a[aria-current="true"]::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--blue);
}

/* Only used by the phone menu */
.nav-toggle,
.nav-close,
.nav-scrim { display: none; }

/* Light / dark switch: the moon means "go dark", the sun means "go light" */
.theme-toggle {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1.5px solid var(--sky);
  border-radius: 50%;
  background: transparent;
  color: var(--blue);
  cursor: pointer;
  transition: border-color .2s;
}
.theme-toggle:hover { border-color: var(--blue); }
.theme-toggle svg {
  grid-area: 1 / 1;
  width: 20px;
  height: 20px;
  transition: opacity .25s, rotate .5s var(--ease-spring);
}
.theme-toggle .icon-sun { opacity: 0; rotate: -90deg; }
[data-theme="dark"] .theme-toggle .icon-moon { opacity: 0; rotate: 90deg; }
[data-theme="dark"] .theme-toggle .icon-sun { opacity: 1; rotate: 0deg; }

@media (max-width: 980px) {
  .nav-toggle {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin-left: auto;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: none;
    color: var(--blue);
    cursor: pointer;
  }
  .nav-toggle svg { width: 26px; height: 26px; }
  .theme-toggle { margin-left: -16px; }

  /* The menu is a panel that slides in from the right edge.
     js/main.js adds .nav-open to <html> while it's showing. */
  .site-nav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: min(80vw, 320px);
    margin: 0;
    padding: 0 24px 32px;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--bg);
    border-left: 1px solid var(--line);
    box-shadow: -24px 0 48px -24px var(--shadow);
    transform: translateX(100%);
    visibility: hidden;
    transition: transform .32s var(--ease-out), visibility 0s linear .32s;
  }
  .nav-open .site-nav {
    transform: none;
    visibility: visible;
    transition: transform .32s var(--ease-out);
  }

  .nav-close {
    display: inline-grid;
    place-items: center;
    flex: none;
    align-self: flex-end;
    width: 44px;
    height: 44px;
    margin: 14px -10px 12px 0;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: none;
    color: var(--blue);
    cursor: pointer;
  }
  .nav-close:hover { background: var(--mist); }
  .nav-close svg { width: 26px; height: 26px; }

  .site-nav ul { flex-direction: column; gap: 0; }
  .site-nav ul a {
    display: block;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
    font-size: 1.1875rem;
  }
  .site-nav ul a[aria-current="true"] { font-weight: 600; }
  .site-nav ul a[aria-current="true"]::after { display: none; }
  .site-nav ul li:last-child a { border-bottom: 0; }

  /* Dims the page beside the panel; tapping it closes the menu */
  .nav-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1;
    background: var(--backdrop);
    opacity: 0;
    visibility: hidden;
    transition: opacity .32s, visibility 0s linear .32s;
  }
  .nav-open .nav-scrim {
    opacity: 1;
    visibility: visible;
    transition: opacity .32s;
  }

  /* Keep the page from scrolling behind the open menu */
  html.nav-open { overflow: hidden; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  isolation: isolate;
  padding-block: clamp(3rem, 2rem + 5vw, 6.5rem) clamp(4rem, 3rem + 5vw, 7.5rem);
}
/* Faint level-editor grid behind the hero */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 40px 40px;
  background-position: center top;
  -webkit-mask-image: linear-gradient(to bottom, #000 40%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 40%, transparent 100%);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, .75fr);
  gap: clamp(40px, 6vw, 88px);
  align-items: center;
}

.name-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* The collision box around the name */
.hitbox {
  position: relative;
  font-size: var(--step-4);
  margin-left: -.12em;
  padding: .1em .08em .12em .12em;
  border: 2px dashed var(--periwinkle);
  border-radius: 2px;
}
.hitbox .handle {
  position: absolute;
  width: 11px;
  height: 11px;
  background: var(--bg);
  border: 2px solid var(--blue);
  border-radius: 2px;
  transition: opacity .4s ease .35s, transform .4s ease .35s;
}
.handle[data-corner="tl"] { top: -6.5px; left: -6.5px; }
.handle[data-corner="tr"] { top: -6.5px; right: -6.5px; }
.handle[data-corner="bl"] { bottom: -6.5px; left: -6.5px; }
.handle[data-corner="br"] { bottom: -6.5px; right: -6.5px; }

.hero-name {
  font-size: 1em;
  font-weight: 600;
  line-height: .98;
  letter-spacing: -.03em;
}
.hero-name .line { display: block; }

/* The "bug": the last letter falls through the floor of the box */
.clip {
  display: inline-block;
  translate: 0 .52em;
  rotate: -9deg;
  transform-origin: 50% 85%;
  cursor: pointer;
  transition: translate .8s var(--ease-spring), rotate .8s var(--ease-spring), color .3s;
  animation: jitter 4.5s ease-in-out 1.5s infinite;
}
.clip:hover { color: var(--blue); }

@keyframes jitter {
  0%, 86%, 100% { transform: none; }
  88% { transform: translate(.04em, -.03em) rotate(5deg); }
  90% { transform: translate(-.02em, .02em) rotate(-4deg); }
  92% { transform: translate(.03em, 0) rotate(2deg); }
  94% { transform: none; }
}

/* Fixed state */
.hitbox.is-fixed {
  border-style: solid;
  animation: box-fixed 1.4s var(--ease-out) forwards;
}
.hitbox.is-fixed .handle { opacity: 0; transform: scale(.4); }
.hitbox.is-fixed .clip {
  translate: 0 0;
  rotate: 0deg;
  animation: none;
  cursor: default;
}
.hitbox.is-fixed .clip:hover { color: inherit; }

@keyframes box-fixed {
  0%   { border-color: var(--blue); }
  100% { border-color: transparent; }
}

.bug-pin {
  display: inline-flex;
  align-items: center;
  gap: .5em;
  margin-top: 1.35rem;
  padding: .45em 1em .45em .75em;
  border: 1.5px solid var(--sky);
  border-radius: 999px;
  background: var(--surface);
  color: var(--blue);
  font: inherit;
  font-size: .9375rem;
  font-weight: 500;
  line-height: 1.3;
  cursor: pointer;
  transition: border-color .2s, background-color .2s;
}
.bug-pin:hover { border-color: var(--blue); }
.bug-pin svg { width: 18px; height: 18px; flex: none; }
.bug-pin.is-fixed { background: var(--mist); border-color: transparent; }

.hero-role {
  margin: 1.75rem 0 .75rem;
  color: var(--blue);
  font-size: var(--step-1);
  font-weight: 500;
  line-height: 1.35;
}
.hero-lede {
  max-width: 34em;
  color: var(--ink-soft);
  font-size: 1.1875rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: 2rem;
}

/* ---------- Handheld console (profile photos + Konami code) ---------- */
.console {
  position: relative;
  justify-self: end;
  width: 100%;
  max-width: 340px;
  padding: 12px 18px 30px;
  border-radius: 16px 16px 64px 16px;
  background: linear-gradient(160deg, var(--console-body), var(--console-body-2));
  box-shadow:
    inset -5px -6px 0 var(--console-edge),
    inset 2px 2px 0 rgba(255, 255, 255, .35),
    0 30px 50px -28px var(--shadow);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* Top edge with a little power switch */
.console-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 -6px 12px;
  padding: 0 8px 8px;
  border-bottom: 2px solid var(--console-edge);
}
.console-switch {
  width: 30px;
  height: 9px;
  padding: 1px;
  border-radius: 5px;
  background: var(--console-edge);
}
.console-switch span {
  display: block;
  width: 12px;
  height: 7px;
  margin-left: auto;
  border-radius: 4px;
  background: var(--console-ink);
}
.console-top-label,
.console-btn-label {
  color: var(--console-ink);
  font-size: .625rem;
  font-weight: 600;
  letter-spacing: .12em;
}

/* Dark bezel around the screen */
.console-bezel {
  padding: 12px 22px 20px;
  border-radius: 10px 10px 36px 10px;
  background: var(--console-bezel);
}
.console-bezel-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 -8px 6px;
  color: var(--console-bezel-ink);
  font-size: .5625rem;
  font-weight: 600;
  letter-spacing: .14em;
  line-height: 1;
  white-space: nowrap;
}
.console-led {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--console-led);
  transition: background-color .15s, box-shadow .15s;
}
.console-led.is-blink { background: var(--sky); box-shadow: 0 0 6px var(--sky); }
.console-led.is-win { background: #7cf29a; box-shadow: 0 0 10px #7cf29a; }
.console-stripes {
  flex: 1;
  height: 6px;
  border-block: 2px solid var(--periwinkle);
  border-top-color: var(--blue);
}

/* The screen: the photo card, with the head popping out over the bezel */
.console-screen {
  --card-top: 12%;
  --screen-radius: 6px;
  position: relative;
  aspect-ratio: 4 / 5;
}

.console-brand {
  margin: 14px 4px 0;
  color: var(--console-ink);
  line-height: 1;
}
.console-brand-name { font-size: 1.375rem; font-style: italic; font-weight: 700; letter-spacing: -.01em; }
.console-brand-tag { font-size: .6875rem; font-weight: 600; letter-spacing: .16em; }

/* D-pad and A/B */
.console-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 22px 2px 0;
}
.dpad {
  display: grid;
  grid-template: repeat(3, 32px) / repeat(3, 32px);
  filter: drop-shadow(0 3px 0 var(--console-edge));
}
.dpad-btn,
.dpad-center { background: var(--console-dpad); }
.dpad-btn {
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  color: rgba(255, 255, 255, .22);
  cursor: pointer;
  transition: background-color .1s;
}
.dpad-btn svg { width: 11px; height: 11px; fill: currentColor; }
.dpad-up    { grid-area: 1 / 2; border-radius: 6px 6px 0 0; }
.dpad-left  { grid-area: 2 / 1; border-radius: 6px 0 0 6px; }
.dpad-right { grid-area: 2 / 3; border-radius: 0 6px 6px 0; }
.dpad-down  { grid-area: 3 / 2; border-radius: 0 0 6px 6px; }
.dpad-center {
  grid-area: 2 / 2;
  background-image: radial-gradient(circle, rgba(255, 255, 255, .1) 0 5px, transparent 6px);
}

.ab {
  display: flex;
  gap: 14px;
  margin-right: 2px;
  rotate: -25deg;
}
.ab-item,
.menu-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.ab-item:first-child { margin-top: 26px; } /* B sits lower, like a real handheld */
.ab-btn {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--console-ab);
  box-shadow: inset -3px -4px 0 rgba(0, 0, 0, .18), 0 3px 0 var(--console-edge);
  cursor: pointer;
}
.console-btn-label { font-size: .75rem; letter-spacing: .06em; }

/* Select and Start */
.console-menu {
  display: flex;
  gap: 16px;
  margin: 26px 0 0 50px;
}
.menu-item { rotate: -25deg; }
.menu-btn {
  width: 44px;
  height: 12px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: var(--console-pill);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .15), 0 2px 0 var(--console-edge);
  cursor: pointer;
}
.menu-item .console-btn-label { font-size: .5625rem; letter-spacing: .14em; }

/* Pressed (by tap, click or the keyboard) */
.dpad-btn:active, .dpad-btn.is-pressed { background-color: var(--console-dpad-press); }
.ab-btn:active, .ab-btn.is-pressed,
.menu-btn:active, .menu-btn.is-pressed { translate: 0 2px; box-shadow: inset -2px -2px 0 rgba(0, 0, 0, .2); }
.console :focus-visible { outline-offset: 2px; }

/* Speaker slots, bottom right */
.console-speaker {
  position: absolute;
  right: 26px;
  bottom: 30px;
  display: flex;
  gap: 7px;
  rotate: -25deg;
}
.console-speaker span {
  width: 5px;
  height: 40px;
  border-radius: 3px;
  background: var(--console-slot);
  box-shadow: inset 1px 1px 2px rgba(0, 0, 0, .25);
}

/* Blue card with the same faint level-editor grid as the hero */
.photo-card {
  position: absolute;
  inset: var(--card-top) 0 0 0;
  border-radius: var(--screen-radius);
  background-color: var(--photo-bottom);
  background-image:
    linear-gradient(rgba(255, 255, 255, .1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .1) 1px, transparent 1px),
    linear-gradient(165deg, var(--photo-top), var(--photo-bottom));
  background-size: 28px 28px, 28px 28px, 100% 100%;
  background-position: -1px -1px, -1px -1px, 0 0;
}
/* The whole photo is a button: click for the next one */
.photo-button {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: var(--screen-radius);
  background: none;
  cursor: pointer;
}
.photo {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  /* Round the bottom corners to match the card */
  clip-path: inset(0 round 0 0 var(--screen-radius) var(--screen-radius));
  filter: drop-shadow(0 12px 18px rgba(12, 28, 48, .28));
  transform-origin: 50% 90%;
  opacity: 0;
  visibility: hidden;
  transition: transform .35s var(--ease-spring);
}
.photo.is-current,
.photo.is-leaving { opacity: 1; visibility: visible; }
.photo-button:hover .photo.is-current { transform: scale(1.025) rotate(-1deg); }

/* The pop: the old photo shrinks away, the new one bounces up */
.photo.is-leaving { animation: photo-out .22s ease-in both; }
.photo.is-entering { animation: photo-pop .62s var(--ease-spring) both; }
@keyframes photo-out {
  to { opacity: 0; transform: scale(.82) translateY(4%); }
}
@keyframes photo-pop {
  0%   { opacity: 0; transform: scale(.5) rotate(-7deg); }
  45%  { opacity: 1; transform: scale(1.08) rotate(2.5deg); }
  70%  { transform: scale(.97) rotate(-1deg); }
  100% { opacity: 1; transform: none; }
}
.is-popping .photo-card { animation: card-boing .5s var(--ease-spring); }
@keyframes card-boing {
  30% { transform: scale(.965, 1.02); }
  60% { transform: scale(1.015, .985); }
}
.photo-card { transform-origin: 50% 100%; }

/* Little bubbles that float off the card on each click */
.photo-bubbles span {
  position: absolute;
  left: var(--l);
  top: var(--t);
  width: var(--s);
  height: var(--s);
  border: 2px solid var(--blue);
  border-radius: 50%;
  background: color-mix(in srgb, var(--sky) 40%, transparent);
  opacity: 0;
  pointer-events: none;
}
.photo-bubbles span:nth-child(even) { border-color: var(--periwinkle); }
.is-popping .photo-bubbles span { animation: bubble .75s ease-out var(--d, 0s) both; }
@keyframes bubble {
  0%   { opacity: 0; transform: translate(0, 0) scale(.3); }
  25%  { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--x), var(--y)) scale(1.1); }
}

/* "Click me!" with a twirly arrow pointing at the screen. Goes away after the first click.
   Desktop: in the gap to the left of the console. Phones: above its top-right corner. */
.photo-hint {
  position: absolute;
  top: 8%;
  right: calc(100% - 4px);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  color: var(--blue);
  pointer-events: none;
  transition: opacity .4s, translate .4s;
  animation: hint-bob 2.8s ease-in-out 1.6s infinite;
}
.photo-hint-text {
  margin-right: -2px;
  font-size: 1.25rem;
  font-style: italic;
  font-weight: 600;
  line-height: 1;
  rotate: 8deg;
}
.photo-hint svg { width: 86px; height: 86px; margin-top: 2px; scale: -1 1; } /* points down-right */
/* The arrow draws itself in once, shortly after the page loads */
.photo-hint-line {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: hint-draw 1s ease-out .6s forwards;
}
.photo-hint-head { opacity: 0; animation: hint-head .2s ease-out 1.5s forwards; }
@keyframes hint-draw { to { stroke-dashoffset: 0; } }
@keyframes hint-head { to { opacity: 1; } }
@keyframes hint-bob {
  0%, 100% { translate: 0 0; }
  50% { translate: -3px 4px; }
}
.hero-photo.has-clicked .photo-hint { opacity: 0; animation: none; translate: 6px -6px; }

.photo-button:focus-visible { outline-offset: 6px; }

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .console { justify-self: center; max-width: 320px; margin-top: 72px; }
  .photo-hint { top: -84px; right: -4px; }
  .photo-hint svg { scale: 1 1; } /* points down-left */
}
@media (max-width: 360px) {
  .console { padding-inline: 14px; }
  .dpad { grid-template: repeat(3, 28px) / repeat(3, 28px); }
  .ab-btn { width: 38px; height: 38px; }
}

/* ---------- Achievement toast (speedrun easter egg) ---------- */
.achievement {
  position: fixed;
  top: 14px;
  left: 0;
  right: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  gap: 14px;
  width: max-content;
  max-width: calc(100vw - 32px);
  margin-inline: auto;
  padding: 6px 30px 6px 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--ach-bg);
  box-shadow: 0 18px 40px -14px rgba(8, 18, 32, .5);
  color: var(--ach-ink);
  pointer-events: none;
  translate: 0 -140%;
  visibility: hidden;
}
.achievement.is-showing {
  visibility: visible;
  animation: ach-in .6s var(--ease-spring) forwards;
}
.achievement.is-leaving {
  visibility: visible;
  animation: ach-out .4s ease-in forwards;
}
@keyframes ach-in {
  from { translate: 0 -140%; }
  to   { translate: 0 0; }
}
@keyframes ach-out {
  from { translate: 0 0; opacity: 1; }
  to   { translate: 0 -140%; opacity: 0; }
}
/* One shine sweeps across after it lands */
.achievement::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .28) 50%, transparent 65%);
  translate: -100% 0;
}
.achievement.is-showing::after { animation: ach-shine .9s ease-out .55s; }
@keyframes ach-shine { to { translate: 100% 0; } }

.achievement-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--ach-icon-bg);
  color: var(--ach-ink);
}
.achievement-icon svg { width: 26px; height: 26px; }
.achievement.is-showing .achievement-icon { animation: ach-icon .5s var(--ease-spring) .35s both; }
@keyframes ach-icon {
  from { scale: .4; rotate: -20deg; }
  to   { scale: 1; rotate: 0deg; }
}
.achievement-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}
.achievement-text strong { font-size: 1.0625rem; font-weight: 700; }
.achievement-text span {
  overflow: hidden;
  color: var(--ach-sub);
  font-size: 1rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Konami code: heart rain ---------- */
.heart-rain {
  position: fixed;
  inset: 0;
  z-index: 300;
  overflow: hidden;
  pointer-events: none;
}
.heart-rain svg {
  position: absolute;
  top: -60px;
  left: var(--x);
  width: var(--size);
  height: auto;
  image-rendering: pixelated;
  animation: heart-fall var(--dur) linear var(--delay) forwards;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .15));
}
@keyframes heart-fall {
  0%   { opacity: 0; transform: translate(0, 0) rotate(0deg); }
  8%   { opacity: 1; }
  25%  { transform: translate(var(--sway), 28vh) rotate(calc(var(--spin) * .25)); }
  50%  { transform: translate(calc(var(--sway) * -1), 55vh) rotate(calc(var(--spin) * .5)); }
  75%  { transform: translate(var(--sway), 82vh) rotate(calc(var(--spin) * .75)); }
  90%  { opacity: 1; }
  100% { opacity: 0; transform: translate(0, calc(100vh + 80px)) rotate(var(--spin)); }
}
/* Reduced motion: the hearts just appear in place and fade, no falling */
.heart-rain.is-calm svg {
  top: var(--y);
  animation: heart-fade 2.4s ease-in-out var(--delay) forwards;
}
@keyframes heart-fade {
  0%, 100% { opacity: 0; }
  20%, 70% { opacity: 1; }
}

/* ---------- Sections ---------- */
.section { padding-block: var(--space-section); }
.section-tint { background: var(--paper); }

.section-head {
  max-width: 40rem;
  margin-bottom: clamp(2.5rem, 2rem + 2vw, 4rem);
}
.section-lede {
  margin: .85rem 0 0;
  color: var(--ink-soft);
  font-size: var(--step-1);
  line-height: 1.5;
}

/* ---------- About ---------- */
/* Heading on the left, story on the right */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, .75fr) minmax(0, 1.5fr);
  gap: clamp(24px, 6vw, 96px);
  align-items: start;
}
.about-copy p {
  max-width: 34em;
  font-size: 1.25rem;
  line-height: 1.6;
}
.about-copy p:last-child { margin-bottom: 0; }

@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; }
  .about-copy p { font-size: 1.1875rem; }
}

/* ---------- How I test (level path) ---------- */
.steps {
  --steps-gap: clamp(24px, 3vw, 44px);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--steps-gap);
  margin: 0;
  padding: 0;
  list-style: none;
}
.step { position: relative; }
.step-num {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 1.5rem;
  border: 2px solid var(--blue);
  border-radius: 50%;
  background: var(--surface);
  color: var(--blue);
  font-size: 1.375rem;
  font-weight: 600;
}
.step:last-child .step-num { border-color: var(--fill); background: var(--fill); color: var(--on-fill); }

/* Dashed path between steps */
.step:not(:last-child)::before {
  content: "";
  position: absolute;
  top: 27px;
  left: 66px;
  right: calc(-1 * var(--steps-gap) + 10px);
  border-top: 2px dashed var(--sky);
}
.step h3 { margin-bottom: .5rem; font-size: var(--step-1); }
.step p { margin: 0; color: var(--ink-soft); font-size: 1.0625rem; }

@media (max-width: 900px) {
  .steps { grid-template-columns: 1fr; --steps-gap: 2rem; }
  .step {
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: 1.25rem;
  }
  .step-num { margin-bottom: 0; }
  .step:not(:last-child)::before {
    top: 66px;
    bottom: calc(-1 * var(--steps-gap) + 10px);
    left: 27px;
    right: auto;
    border-top: 0;
    border-left: 2px dashed var(--sky);
  }
  .step h3 { margin-top: .7rem; }
}

/* ---------- QA work ---------- */
.project {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}
.project-flip .project-media { order: 2; }
.project + .project { margin-top: clamp(4rem, 3rem + 4vw, 6.5rem); }

.project-kind {
  margin: .3rem 0 1.25rem;
  color: var(--blue);
  font-size: var(--step-1);
  font-weight: 500;
}
.meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .9rem 1.5rem;
  margin: 0 0 1.4rem;
  padding: 1.1rem 0;
  border-block: 1px solid var(--line);
}
.meta dt { color: var(--ink-soft); font-size: .875rem; }
.meta dd { margin: 0; font-size: 1rem; font-weight: 500; }

.project-body > p { max-width: 34em; }
.project-body h4 { margin: 1.5rem 0 .75rem; }

.report-showcase {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
  gap: clamp(32px, 5vw, 64px);
  align-items: start;
  padding: clamp(24px, 4vw, 56px);
  border-radius: var(--radius-l);
  background: var(--paper);
}
.report-intro h2 { margin-bottom: .9rem; font-size: var(--step-2); line-height: 1.15; }
.report-intro > p { color: var(--ink-soft); }
.report-parts {
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}
.report-parts li {
  position: relative;
  padding: .55rem 0 .55rem 1.6rem;
  border-top: 1px solid var(--line);
  font-size: 1.0625rem;
}
.report-parts li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.15rem;
  width: 10px;
  height: 10px;
  border: 2px solid var(--blue);
  border-radius: 2px;
}

@media (max-width: 860px) {
  .project,
  .report-showcase { grid-template-columns: 1fr; }
  .project-flip .project-media { order: 0; }
}

/* ---------- Bug ticket (shared by example + hero dialog) ---------- */
.ticket {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--surface);
  box-shadow: 0 1px 0 var(--line), 0 24px 48px -28px var(--shadow);
}
.ticket-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
  padding: .85rem 1.25rem;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.ticket-id {
  margin-right: .25rem;
  color: var(--ink-soft);
  font-size: .9375rem;
  font-weight: 600;
}
.chip {
  padding: .2em .75em;
  border-radius: 999px;
  font-size: .8125rem;
  font-weight: 600;
  line-height: 1.45;
}
.chip-sev { background: var(--mist); color: var(--blue-deep); }
.chip-status {
  border: 1.5px solid var(--periwinkle);
  background: var(--surface);
  color: var(--blue);
}
.chip-status.is-fixed { border-color: var(--fill); background: var(--fill); color: var(--on-fill); }
.chip-priority { border: 1.5px solid var(--periwinkle); background: var(--surface); color: var(--blue); }

.ticket-body { padding: 1.25rem 1.5rem 1.5rem; }
.ticket-title {
  margin-bottom: 1rem;
  font-size: var(--step-1);
  line-height: 1.3;
}
.ticket-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem 1.5rem;
  margin: 0 0 1.25rem;
  padding: .9rem 0;
  border-block: 1px solid var(--line);
}
.ticket-fields dt { color: var(--ink-soft); font-size: .8125rem; }
.ticket-fields dd { margin: 0; font-size: .9375rem; font-weight: 500; line-height: 1.4; }

/* Build numbers and file names */
.ticket code {
  font-family: inherit;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.ticket-desc {
  margin: 0 0 1.25rem;
  font-size: 1rem;
  line-height: 1.55;
}

.ticket-files {
  display: grid;
  gap: .5rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: .9375rem;
  line-height: 1.45;
}
.ticket-files li {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  padding: .6rem .8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
}
.ticket-files svg { flex: none; width: 18px; height: 18px; margin-top: .1em; color: var(--blue); }
.ticket-files code { display: block; color: var(--ink); }
.ticket-files span { color: var(--ink-soft); }

.ticket-label {
  margin: 0 0 .35rem;
  color: var(--ink-soft);
  font-size: .875rem;
  font-weight: 600;
}
.ticket ol {
  margin: 0 0 1.25rem;
  padding-left: 1.25rem;
  font-size: 1rem;
  line-height: 1.55;
}
.ticket ol li { padding-left: .2rem; }
.ticket ol li + li { margin-top: .2rem; }

.ticket-compare {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
  margin: 0;
}
.ticket-compare:not(:last-child) { margin-bottom: 1.25rem; }
.ticket-compare div {
  padding: .75rem 1rem;
  border-left: 3px solid var(--sky);
  border-radius: var(--radius-s);
  background: var(--paper);
}
.ticket-compare .actual { border-left-color: var(--blue); }
.ticket-compare dt { color: var(--ink-soft); font-size: .8125rem; font-weight: 600; }
.ticket-compare dd { margin: 0; font-size: 1rem; line-height: 1.45; }

.ticket-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-top: 1.5rem;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin: -6px -8px -6px auto;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--ink-soft);
  cursor: pointer;
}
.icon-btn:hover { background: var(--mist); color: var(--ink); }
.icon-btn svg { width: 20px; height: 20px; }

@media (max-width: 520px) {
  .ticket-compare { grid-template-columns: 1fr; }
  .ticket-fields { grid-template-columns: 1fr; }
  .ticket-body { padding: 1.1rem 1.15rem 1.25rem; }
}

/* Dialog */
.ticket-dialog {
  width: min(560px, calc(100% - 32px));
  max-height: calc(100% - 32px);
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  overflow: auto;
}
.ticket-dialog::backdrop {
  background: var(--backdrop, rgba(24, 47, 72, .38));
  -webkit-backdrop-filter: blur(3px);
          backdrop-filter: blur(3px);
}
.ticket-dialog[open] { animation: ticket-in .35s var(--ease-out); }
@keyframes ticket-in {
  from { opacity: 0; transform: translateY(14px) scale(.98); }
}

/* Projects reuse the .project rows from QA work */

/* ---------- Animation player (Smart Motorcycle) ----------
   Each scene page draws at 1280×720. js/main.js shrinks it to fit
   the stage and plays the scenes one after another. */
.anim-player {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  background: var(--player-bg);
  color: var(--player-ink);
}
.anim-stage {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--player-bg);
}
.anim-stage iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 1280px;
  height: 720px;
  border: 0;
  transform-origin: 0 0;
  transform: translate(var(--anim-x, 0), var(--anim-y, 0)) scale(var(--anim-scale, .4));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .4s, visibility 0s linear .4s;
}
.anim-stage iframe.is-active {
  opacity: 1;
  visibility: visible;
  transition: opacity .4s;
}

.anim-controls {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem .6rem;
  background: var(--player-bar);
}
.anim-btn {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--player-ink);
  cursor: pointer;
  transition: background-color .2s;
}
.anim-btn:hover { background: rgba(255, 255, 255, .1); }
.anim-btn svg { width: 20px; height: 20px; }
.anim-player .icon-play,
.anim-player .icon-shrink,
.carousel .icon-shrink,
.anim-player.is-paused .icon-pause,
.is-full .icon-expand { display: none; }
.anim-player.is-paused .icon-play,
.is-full .icon-shrink { display: block; }

/* One button per scene, with a bar that fills as the scene plays */
.anim-scenes {
  display: flex;
  flex: 1;
  gap: .75rem;
  min-width: 0;
}
.anim-scene {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: .4rem;
  min-width: 0;
  padding: .3rem .25rem;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--player-muted);
  font: inherit;
  font-size: .8125rem;
  font-weight: 500;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
}
.anim-scene:hover,
.anim-scene[aria-current="true"] { color: var(--player-ink); }
.anim-scene-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.anim-bar {
  display: block;
  height: 3px;
  overflow: hidden;
  border-radius: 2px;
  background: rgba(255, 255, 255, .16);
}
.anim-bar span {
  display: block;
  height: 100%;
  background: var(--player-accent);
  transform: scaleX(var(--progress, 0));
  transform-origin: left;
}
.anim-player :focus-visible { outline-color: var(--player-accent); outline-offset: 1px; }

/* ---------- Screenshot carousel (Zero Trust) ---------- */
.carousel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  background: var(--player-bg);
  color: var(--player-ink);
}
.carousel-viewport {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  cursor: pointer; /* clicking the picture holds it for 4 more seconds */
}
.carousel-track {
  display: flex;
  height: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
  transition: transform .55s var(--ease-out);
}
.carousel-slide { flex: 0 0 100%; height: 100%; }
.carousel-slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Left and right buttons over the picture */
.carousel-arrow {
  position: absolute;
  top: 50%;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 50%;
  background: rgba(10, 12, 16, .55);
  color: #fff;
  cursor: pointer;
  translate: 0 -50%;
  -webkit-backdrop-filter: blur(4px);
          backdrop-filter: blur(4px);
  transition: background-color .2s;
}
.carousel-arrow:hover { background: rgba(10, 12, 16, .85); }
.carousel-arrow svg { width: 22px; height: 22px; }
.carousel-prev { left: 12px; }
.carousel-next { right: 12px; }

/* Shows for a moment after a click holds the picture */
.carousel-held {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: .3em .75em;
  border-radius: 999px;
  background: rgba(10, 12, 16, .75);
  color: #fff;
  font-size: .8125rem;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}
.carousel.is-held .carousel-held { opacity: 1; }

.carousel-bar {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .5rem .6rem .5rem .9rem;
  background: var(--player-bar);
}
.carousel-info {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: .4rem;
  min-width: 0;
}
.carousel-caption {
  margin: 0;
  overflow: hidden;
  font-size: .8125rem;
  font-weight: 500;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.carousel-count { margin-left: .35em; color: var(--player-muted); }
/* Fills up while the picture waits, then the next one slides in */
.carousel-timer {
  display: block;
  height: 3px;
  overflow: hidden;
  border-radius: 2px;
  background: rgba(255, 255, 255, .16);
}
.carousel-timer span {
  display: block;
  height: 100%;
  background: var(--player-accent);
  transform: scaleX(var(--progress, 0));
  transform-origin: left;
}

.carousel-dots { display: flex; flex: none; }
.carousel-dot {
  display: grid;
  place-items: center;
  width: 20px;
  height: 28px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.carousel-dot::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .3);
  transition: background-color .2s, transform .2s;
}
.carousel-dot:hover::before { background: rgba(255, 255, 255, .6); }
.carousel-dot[aria-current="true"]::before { background: var(--player-accent); transform: scale(1.3); }
.carousel :focus-visible { outline-color: var(--player-accent); outline-offset: 1px; }

@media (max-width: 400px) {
  .carousel-dot { width: 16px; }
  .carousel-arrow { width: 36px; height: 36px; }
}

/* Full screen (or the full-window fallback on phones that can't go full screen) */
.anim-player.is-full,
.carousel.is-full {
  display: flex;
  flex-direction: column;
  border: 0;
  border-radius: 0;
}
.anim-player.is-full .anim-stage,
.carousel.is-full .carousel-viewport {
  flex: 1;
  aspect-ratio: auto;
  min-height: 0;
}
.is-expanded {
  position: fixed;
  inset: 0;
  z-index: 100;
}
html:has(.is-expanded) { overflow: hidden; }

/* ---------- Skills ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}

.checklist-panel {
  padding: clamp(22px, 3vw, 36px);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  background: var(--surface);
}
.checklist-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .25rem 1rem;
}
.checklist-head h3 { font-size: var(--step-1); }
.checklist-score {
  margin: 0;
  color: var(--blue);
  font-size: .9375rem;
  font-weight: 500;
}
.checklist {
  margin: 1.1rem 0 0;
  padding: 0;
  list-style: none;
}
.checklist li {
  display: flex;
  align-items: flex-start;
  gap: .8rem;
  padding: .65rem 0;
  border-top: 1px dashed var(--sky);
  font-weight: 500;
  line-height: 1.45;
}
.checklist li::before {
  content: "";
  flex: none;
  width: 22px;
  height: 22px;
  margin-top: .05em;
  border-radius: 6px;
  background: var(--fill) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5.5 12.5l4.2 4.2L18.5 8'/%3E%3C/svg%3E") center / 16px no-repeat;
}

.toolbox { margin: 0; }
.toolbox > div {
  padding: 1.4rem 0;
  border-bottom: 1px solid var(--line);
}
.toolbox > div:first-child { padding-top: .25rem; }
.toolbox > div:last-child { border-bottom: 0; }
.toolbox dt { margin-bottom: .75rem; font-weight: 600; }
.toolbox dd { margin: 0; }

/* Tool logos on the skill tags, drawn in the site's blue so they suit both themes.
   Logos come from Simple Icons (CC0) and Devicon (MIT) on the jsDelivr CDN. */
.tags li.logo {
  display: inline-flex;
  align-items: center;
  gap: .45em;
}
.tags li.logo::before {
  content: "";
  flex: none;
  width: 15px;
  height: 15px;
  background: var(--blue);
  -webkit-mask: var(--logo) center / contain no-repeat;
          mask: var(--logo) center / contain no-repeat;
}
.logo-unity        { --logo: url("https://cdn.jsdelivr.net/npm/simple-icons@16.36.0/icons/unity.svg"); }
.logo-renpy        { --logo: url("https://cdn.jsdelivr.net/npm/simple-icons@16.36.0/icons/renpy.svg"); }
.logo-platformio   { --logo: url("https://cdn.jsdelivr.net/npm/simple-icons@16.36.0/icons/platformio.svg"); }
.logo-react        { --logo: url("https://cdn.jsdelivr.net/npm/simple-icons@16.36.0/icons/react.svg"); }
.logo-expo         { --logo: url("https://cdn.jsdelivr.net/npm/simple-icons@16.36.0/icons/expo.svg"); }
.logo-cpp          { --logo: url("https://cdn.jsdelivr.net/npm/simple-icons@16.36.0/icons/cplusplus.svg"); }
.logo-python       { --logo: url("https://cdn.jsdelivr.net/npm/simple-icons@16.36.0/icons/python.svg"); }
.logo-typescript   { --logo: url("https://cdn.jsdelivr.net/npm/simple-icons@16.36.0/icons/typescript.svg"); }
.logo-javascript   { --logo: url("https://cdn.jsdelivr.net/npm/simple-icons@16.36.0/icons/javascript.svg"); }
.logo-firebase     { --logo: url("https://cdn.jsdelivr.net/npm/simple-icons@16.36.0/icons/firebase.svg"); }
.logo-git          { --logo: url("https://cdn.jsdelivr.net/npm/simple-icons@16.36.0/icons/git.svg"); }
.logo-github       { --logo: url("https://cdn.jsdelivr.net/npm/simple-icons@16.36.0/icons/github.svg"); }
.logo-figma        { --logo: url("https://cdn.jsdelivr.net/npm/simple-icons@16.36.0/icons/figma.svg"); }
.logo-csharp       { --logo: url("https://cdn.jsdelivr.net/npm/devicon@2.18.0/icons/csharp/csharp-plain.svg"); }
.logo-visualstudio { --logo: url("https://cdn.jsdelivr.net/npm/devicon@2.18.0/icons/visualstudio/visualstudio-plain.svg"); }
.logo-vscode       { --logo: url("https://cdn.jsdelivr.net/npm/devicon@2.18.0/icons/vscode/vscode-plain.svg"); }
.logo-canva        { --logo: url("https://cdn.jsdelivr.net/npm/devicon@2.18.0/icons/canva/canva-original.svg"); }
/* Canva's logo is lettering inside a circle, so in one colour it's just a dot: show its own colours */
.tags li.logo-canva::before {
  background: var(--logo) center / contain no-repeat;
  -webkit-mask: none;
          mask: none;
}

@media (max-width: 860px) {
  .skills-grid { grid-template-columns: 1fr; }
}

/* ---------- Education ---------- */
.edu-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(40px, 5vw, 72px);
}
.edu-grid h3 { margin-bottom: 1.5rem; font-size: var(--step-1); }

.timeline {
  margin: 0;
  padding: 0;
  list-style: none;
}
.timeline li {
  position: relative;
  margin-left: 6px;
  padding: 0 0 1.9rem 1.75rem;
  border-left: 2px solid var(--sky);
}
.timeline li:last-child { padding-bottom: 0; border-left-color: transparent; }
.timeline li::before {
  content: "";
  position: absolute;
  left: -8px;
  top: .3em;
  width: 14px;
  height: 14px;
  border: 2px solid var(--blue);
  border-radius: 50%;
  background: var(--bg);
}
.timeline time {
  display: block;
  color: var(--blue);
  font-size: .9375rem;
  font-weight: 500;
}
.timeline strong {
  display: block;
  margin: .1rem 0 .15rem;
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.35;
}
.timeline span { color: var(--ink-soft); font-size: 1rem; }

@media (max-width: 760px) {
  .edu-grid { grid-template-columns: 1fr; }
}

/* ---------- Contact ---------- */
.contact {
  padding-block: var(--space-section);
  background: var(--navy);
  color: var(--on-navy);
}
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: clamp(40px, 6vw, 96px);
  align-items: end;
}
.contact h2 {
  max-width: 11em;
  color: var(--on-navy-strong);
  font-size: clamp(2.5rem, 1.5rem + 3.4vw, 4.25rem);
  line-height: 1.02;
  letter-spacing: -.025em;
}
.contact-intro p {
  max-width: 28em;
  margin: 1.25rem 0 0;
  font-size: var(--step-1);
  line-height: 1.5;
}

/* Email and GitHub as tidy rows */
.contact-methods {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--navy-line);
}
/* Label and "Copied" share the top line, so nothing shifts when it appears */
.contact-methods li {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: .4rem .75rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--navy-line);
}
.contact-label {
  grid-area: 1 / 1;
  color: var(--on-navy-soft);
  font-size: .9375rem;
}
/* Email copies when clicked; GitHub opens the profile */
.contact-row {
  grid-area: 2 / 1 / 3 / -1;
  display: flex;
  align-items: center;
  gap: .375rem;
  min-width: 0;
}
.contact-value {
  display: inline-flex;
  align-items: center;
  gap: .55em;
  min-width: 0;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: var(--on-navy-strong);
  font: inherit;
  font-size: clamp(1.125rem, 1rem + .6vw, 1.375rem);
  font-weight: 500;
  line-height: 1.4;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.contact-value:hover { color: var(--on-navy-strong); }
.contact-value > svg { width: 20px; height: 20px; flex: none; color: var(--on-navy); }
.contact-text {
  min-width: 0;
  overflow-wrap: anywhere;
  text-decoration: underline 2px transparent;
  text-underline-offset: .25em;
  transition: text-decoration-color .2s;
}
.contact-value:hover .contact-text { text-decoration-color: var(--navy-accent); }

/* Small icon after each address: copy for email, open for GitHub */
.copy-icon,
.link-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  margin-left: .15em;
  border: 1px solid var(--navy-line);
  border-radius: 8px;
  color: var(--on-navy);
  transition: background-color .2s, border-color .2s, color .2s;
}
.copy-icon svg,
.link-icon svg { grid-area: 1 / 1; width: 16px; height: 16px; }
.contact-value:hover .copy-icon,
.contact-value:hover .link-icon { border-color: var(--navy-accent); color: var(--on-navy-strong); }
.copy-icon .icon-check { display: none; }
.contact-value.is-copied .copy-icon { border-color: var(--navy-accent); background: var(--navy-accent); color: var(--navy); }
.contact-value.is-copied .icon-copy { display: none; }
.contact-value.is-copied .icon-check { display: block; }

.copy-status { grid-area: 1 / 2; color: var(--navy-accent); font-size: .9375rem; font-weight: 500; }
.contact :focus-visible { outline-color: var(--navy-accent); }

@media (max-width: 860px) {
  .contact-grid { grid-template-columns: 1fr; }
}
@media (max-width: 400px) {
  .contact-value { gap: .45em; font-size: 1.0625rem; }
  .copy-icon, .link-icon { width: 28px; height: 28px; }
}

/* =========================================================
   Motion: bubbly, game-flavoured, each plays once.
   Only when <html> has .can-animate (set in the <head>, skipped for reduced motion).
   Sections marked data-reveal animate when they scroll into view (js/main.js adds .is-in).
   ========================================================= */
@keyframes rise     { from { opacity: 0; translate: 0 14px; } }
@keyframes drop-in  { from { opacity: 0; translate: 0 -.35em; } }
@keyframes pop-in   { 0% { opacity: 0; scale: .3; } 60% { opacity: 1; scale: 1.15; } 100% { scale: 1; } }
@keyframes fade-in  { from { opacity: 0; } }

/* --- Hero intro (on page load): name drops in, the box draws, then the "o" falls through --- */
.can-animate .hero-name .line { animation: drop-in .6s var(--ease-spring) backwards; }
.can-animate .hero-name .line:nth-child(2) { animation-delay: .12s; }
.can-animate .hitbox:not(.is-fixed) { animation: box-in .5s ease .4s backwards; }
@keyframes box-in { from { border-color: transparent; } }
.can-animate .hitbox:not(.is-fixed) .handle { animation: pop-in .4s var(--ease-spring) .55s backwards; }
.can-animate .hitbox:not(.is-fixed) .handle[data-corner="tr"] { animation-delay: .62s; }
.can-animate .hitbox:not(.is-fixed) .handle[data-corner="bl"] { animation-delay: .69s; }
.can-animate .hitbox:not(.is-fixed) .handle[data-corner="br"] { animation-delay: .76s; }
.can-animate .clip { animation: clip-fall 1s cubic-bezier(.3, .6, .4, 1) .9s backwards, jitter 4.5s ease-in-out 3s infinite; }
@keyframes clip-fall {
  0%, 35% { translate: 0 0; rotate: 0deg; }
  50%     { translate: 0 0; rotate: 8deg; }   /* wobble... */
  78%     { translate: 0 .64em; rotate: -13deg; } /* ...and through the floor */
  90%     { translate: 0 .47em; rotate: -7deg; }
  100%    { translate: 0 .52em; rotate: -9deg; }
}
.can-animate .bug-pin     { animation: rise .5s var(--ease-out) 1.25s backwards; }
.can-animate .hero-role   { animation: rise .5s var(--ease-out) .5s backwards; }
.can-animate .hero-lede   { animation: rise .5s var(--ease-out) .6s backwards; }
.can-animate .hero-actions { animation: rise .5s var(--ease-out) .7s backwards; }
.can-animate .console     { animation: console-in .8s var(--ease-spring) .3s backwards; }
@keyframes console-in { from { opacity: 0; translate: 0 40px; rotate: 3deg; } }

/* --- How I test: steps pop in one by one, the dashed path draws between them --- */
.can-animate .steps:not(.is-in) .step-num,
.can-animate .steps:not(.is-in) .step h3,
.can-animate .steps:not(.is-in) .step p { opacity: 0; }
.can-animate .steps:not(.is-in) .step::before { clip-path: inset(0 100% 0 0); }
.steps.is-in .step-num { animation: pop-in .5s var(--ease-spring) calc(var(--i, 0) * .22s) backwards; }
.steps.is-in .step h3,
.steps.is-in .step p { animation: rise .5s var(--ease-out) calc(var(--i, 0) * .22s + .1s) backwards; }
.steps.is-in .step::before { animation: path-draw .4s ease-out calc(var(--i, 0) * .22s + .25s) backwards; }
@keyframes path-draw { from { clip-path: inset(0 100% 0 0); } }
@media (max-width: 900px) {
  .can-animate .steps:not(.is-in) .step::before { clip-path: inset(0 0 100% 0); }
  .steps.is-in .step::before { animation-name: path-draw-down; }
  @keyframes path-draw-down { from { clip-path: inset(0 0 100% 0); } }
}

/* --- Bug report: the ticket slides in like a new one arriving --- */
.can-animate .report-showcase:not(.is-in) .ticket,
.can-animate .report-showcase:not(.is-in) .report-parts li { opacity: 0; }
.report-showcase.is-in .ticket { animation: ticket-arrive .7s var(--ease-spring) .15s backwards; }
@keyframes ticket-arrive { from { opacity: 0; translate: 48px 0; rotate: 2deg; } }
.report-showcase.is-in .report-parts li { animation: rise .45s var(--ease-out) calc(var(--i, 0) * .1s + .1s) backwards; }

/* --- QA work and projects: the picture pops, the tags bubble up one by one --- */
.can-animate .project:not(.is-in) .project-media,
.can-animate .project:not(.is-in) .tags li { opacity: 0; }
.project.is-in .project-media { animation: media-pop .7s var(--ease-spring) backwards; }
@keyframes media-pop { from { opacity: 0; scale: .94; } }
.project.is-in .tags li { animation: pop-in .45s var(--ease-spring) calc(var(--i, 0) * .08s + .3s) backwards; }

/* --- Skills: the test checklist runs, each box ticks in turn --- */
.can-animate .checklist-panel:not(.is-in) .checklist li::before {
  background-color: transparent;
  background-size: 0 0;
  box-shadow: inset 0 0 0 2px var(--sky);
}
.checklist-panel.is-in .checklist li::before { animation: tick .45s var(--ease-spring) calc(var(--i, 0) * .16s + .15s) backwards; }
@keyframes tick {
  0%  { background-color: transparent; background-size: 0 0; box-shadow: inset 0 0 0 2px var(--sky); }
  50% { scale: 1.25; }
}
.can-animate .toolbox:not(.is-in) .tags li { opacity: 0; }
.toolbox.is-in .tags li { animation: pop-in .4s var(--ease-spring) calc(var(--i, 0) * .04s) backwards; }

/* --- Education: timeline dots pop in like save points --- */
.can-animate .edu-grid:not(.is-in) .timeline li { opacity: 0; }
.edu-grid.is-in .timeline li { animation: rise .45s var(--ease-out) calc(var(--i, 0) * .15s) backwards; }
.edu-grid.is-in .timeline li::before { animation: pop-in .45s var(--ease-spring) calc(var(--i, 0) * .15s + .12s) backwards; }

/* --- Small touches: springy buttons, wiggly bugs, hopping logos --- */
.btn { transition: background-color .2s, color .2s, border-color .2s, translate .35s var(--ease-spring), scale .15s; }
.btn:hover { translate: 0 -2px; }
.btn:active { transform: none; translate: 0 0; scale: .96; }
.tags-bugs li:hover::before { animation: bug-wiggle .5s ease-in-out; }
@keyframes bug-wiggle {
  25% { rotate: -18deg; }
  50% { rotate: 14deg; translate: 1px 0; }
  75% { rotate: -8deg; }
}
.tags li.logo::before { transition: translate .3s var(--ease-spring); }
.tags li.logo:hover::before { translate: 0 -3px; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .clip { animation: none; }
  ::view-transition-old(root),
  ::view-transition-new(root) { animation: none; }
  /* A gentle fade isn't motion, so the Konami hearts still get to show */
  .heart-rain.is-calm svg { animation-duration: 2.4s !important; }
}
