/* matt.os — retro techy-creative personal site
   Pixel scene up top, a desktop of chunky windows below. Plain HTML + CSS + two small scripts. */

/* Calling Code by Ryoichi Tsunekawa (Dharma Type), SIL Open Font License 1.1.
   Only the Regular weight is free, so everything is set in one weight. */
@font-face {
  font-family: "Calling Code";
  src: url("fonts/CallingCode-Regular.woff2") format("woff2"),
       url("fonts/CallingCode-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --desk: #e9e7f7;
  --desk-dot: #d2cdef;
  --win: #fffdf6;
  --ink: #1d1b3a;
  --line: #1d1b3a;
  --muted: #625f86;
  --soft: #f3f1fb;

  --indigo: #5b54e8;
  --tomato: #ff6a4d;
  --teal: #2bb6a3;
  --sun: #ffcf3f;
  --pink: #ff8fb1;
  --led: #ffb347;
  --purple-ink: #4a43d6;

  --shadow: 0.3rem 0.3rem 0 var(--line);
  --radius: 0.4rem;
  --step: steps(4, jump-end);

  --font: "Calling Code", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --desk: #13122a;
    --desk-dot: #262451;
    --win: #1f1d42;
    --ink: #eceaff;
    --line: #05041a;
    --muted: #a7a4d2;
    --soft: #2a2856;
    --purple-ink: #aaa5ff;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  /* Everything is sized in rem and the root grows with the window:
     ~15.5px on a laptop, ~18px at 1920px wide, ~21px on a big monitor. */
  font-size: clamp(15px, 0.5vw + 8.5px, 24px);
  scroll-behavior: smooth;
  cursor: url("images/cursors/arrow.svg") 0 0, auto;
}

body {
  margin: 0;
  background: var(--desk);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 400;
  font-synthesis: none;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a, button, canvas[data-scene], .win-bar {
  cursor: url("images/cursors/hand.svg") 9 1, pointer;
}

h1, h2, h3, b, strong { font-weight: 400; }
img { max-width: 100%; }

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--indigo);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
}
a:hover { background: var(--sun); color: #1d1b3a; text-decoration-color: currentColor; }

:focus-visible { outline: 3px solid var(--indigo); outline-offset: 3px; }

button { font: inherit; color: inherit; }

.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;
}

.skip {
  position: absolute; left: 1rem; top: -5rem; z-index: 100;
  background: var(--sun); color: #1d1b3a;
  border: 2px solid var(--line); padding: 0.4rem 0.8rem;
}
.skip:focus { top: 0.75rem; }

/* ---------- menu bar ---------- */

.menubar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.45rem 1.25rem;
  background: var(--win);
  border-bottom: 2px solid var(--line);
  font-size: 0.9rem;
}

.badge {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  padding: 0.15rem 0.6rem 0.15rem 0.15rem;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--soft);
  box-shadow: 0.15rem 0.15rem 0 var(--line);
}
.badge:hover { background: var(--sun); }
.badge img {
  width: 2.5rem; height: 2.5rem;
  padding: 0.25rem 0.25rem 0;
  image-rendering: pixelated;
  background: var(--indigo);
  border: 2px solid var(--line);
  border-radius: 0.2rem;
}
.badge:hover img { animation: hop 0.5s var(--step); }
.badge-text { display: flex; flex-direction: column; line-height: 1.15; }
.badge-text small { font-size: 0.72rem; color: var(--muted); }
.badge:hover .badge-text small { color: #1d1b3a; }

.tabs { display: flex; gap: 0.5rem; }
.tabs a {
  text-decoration: none;
  padding: 0.25rem 0.85rem;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--win);
  box-shadow: 0.15rem 0.15rem 0 var(--line);
  transition: translate 0.1s var(--step), box-shadow 0.1s var(--step);
}
.tabs a:hover { background: var(--sun); color: #1d1b3a; translate: -1px -1px; box-shadow: 0.25rem 0.25rem 0 var(--line); }
.tabs a[aria-current="page"] { background: var(--indigo); color: #fff; }

.tray { margin-left: auto; display: flex; align-items: center; gap: 0.75rem; }
.sky-btn {
  padding: 0.25rem 0.7rem;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--soft);
  box-shadow: 0.15rem 0.15rem 0 var(--line);
}
.sky-btn:hover { background: var(--sun); color: #1d1b3a; }
.sky-btn:active { translate: 0.15rem 0.15rem; box-shadow: none; }
.sky-label { color: var(--muted); }
.sky-btn:hover .sky-label { color: #1d1b3a; }
.clock { display: inline-flex; align-items: center; gap: 0.4rem; white-space: nowrap; }
.live {
  display: inline-block;
  width: 0.55rem; height: 0.55rem;
  background: var(--tomato);
  border: 2px solid var(--line);
  animation: blink 1.2s steps(1) infinite;
}

/* ---------- hero scene ---------- */

.hero {
  position: relative;
  height: clamp(24rem, 74vh, 56rem);
  border-bottom: 2px solid var(--line);
  background: #241f5e;
  overflow: hidden;
}
.hero-sm { height: clamp(18rem, 46vh, 34rem); }
.hero-home { height: max(40rem, calc(100vh - 3.6rem)); }

/* Windows float over the sky; the bottom ~22% (the promenade and street) stays clear
   so pixel Matt can walk around. Clicks between the windows still reach the scene. */
.hero-wins {
  position: absolute;
  top: clamp(1.25rem, 4vh, 3rem);
  bottom: 22%;
  left: clamp(1rem, 3vw, 3.5rem);
  right: clamp(1rem, 3vw, 3.5rem);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  pointer-events: none;
}
.hero-wins > * { pointer-events: auto; }
.hero-wins .win-about {
  width: min(36rem, 48%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
}
.hero-wins .win-about .win-body {
  overflow-y: auto;
  font-size: 0.92rem;
  scrollbar-width: thin;
  scrollbar-color: var(--indigo) var(--soft);
}
.hero-wins .hello { font-size: clamp(1.8rem, 2.6vw, 2.9rem); }
.hero-side {
  width: min(21rem, 34%);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.9rem;
}
.hero-side .win { width: 100%; }
.hero-side .win-body { padding: 1rem 1.1rem 1.2rem; }
.hero-side .contact-lead { font-size: 0.88rem; margin-bottom: 0.8rem; }
.hero-side .btns { gap: 0.55rem; }
.hero-side .btn { padding: 0.4rem 0.45rem 0.4rem 0.8rem; font-size: 0.92rem; }
.hero-side .btn i { width: 1.6rem; height: 1.6rem; }
.hero-side .hint { pointer-events: none; }
.hero canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
.hero canvas:focus-visible { outline: 3px dashed var(--sun); outline-offset: -6px; }

.hint {
  margin: 0;
  padding: 0.25rem 0.6rem;
  font-size: 0.8rem;
  color: #1d1b3a;
  background: rgba(255, 253, 246, 0.92);
  border: 2px solid #1d1b3a;
  border-radius: var(--radius);
  pointer-events: none;
  animation: nudge 3s var(--step) infinite;
}

/* RPG-style dialog box */
.dialog {
  position: absolute;
  left: clamp(1rem, 3vw, 3rem);
  top: clamp(1.75rem, 5vh, 3rem);
  width: min(38rem, calc(100% - 2rem));
  min-height: 7.5rem;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: start;
  padding: 1rem 2.75rem 1rem 1rem;
  background: var(--win);
  color: var(--ink);
  border: 3px solid var(--line);
  border-radius: var(--radius);
  box-shadow: inset 0 0 0 3px var(--win), inset 0 0 0 5px var(--line), 0.4rem 0.4rem 0 rgba(10, 8, 40, 0.55);
  animation: rise 0.6s steps(5, jump-end) both;
}
.dialog-face {
  width: 4.25rem; height: 4.25rem;
  padding: 0.35rem 0.35rem 0;
  image-rendering: pixelated;
  background: var(--indigo);
  border: 2px solid var(--line);
  border-radius: 0.2rem;
}
.dialog.is-typing .dialog-face { animation: talk 0.25s steps(2) infinite; }
.dialog-name {
  position: absolute;
  top: -1.05rem;
  left: 1rem;
  margin: 0;
  padding: 0 0.6rem;
  font-size: 0.85rem;
  background: var(--indigo);
  color: #fff;
  border: 2px solid var(--line);
  border-radius: 0.2rem;
}
.dialog-lines p { margin: 0; font-size: 1.05rem; line-height: 1.55; min-height: 3.1em; }
/* every line sits in the same spot, so the box is always sized for the longest one (no jumping) */
.js .dialog-lines { display: grid; }
.js .dialog-lines p { grid-area: 1 / 1; visibility: hidden; }
.js .dialog-lines p.is-current { visibility: visible; }
.dialog-next {
  position: absolute;
  right: 0.75rem;
  bottom: 0.6rem;
  width: 1.8rem; height: 1.8rem;
  padding: 0;
  border: 2px solid var(--line);
  border-radius: 0.2rem;
  background: var(--sun);
  color: #1d1b3a;
  font-size: 0.75rem;
  line-height: 1;
  animation: bob 0.9s steps(2) infinite;
}
.dialog-next.is-last { animation: none; }
.dialog-next.is-last::before { content: "↺"; font-size: 1rem; }
.dialog-next.is-last { font-size: 0; }

/* ---------- desktop of windows ---------- */

.desktop {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 2rem;
  align-items: start;
  max-width: 92rem;
  margin: 0 auto;
  padding: 3rem clamp(1rem, 3vw, 3rem) 5rem;
}
body { background-image: radial-gradient(var(--desk-dot) 1.5px, transparent 1.7px); background-size: 1.5rem 1.5rem; }

.win {
  position: relative;
  background: var(--win);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: box-shadow 0.15s var(--step);
}
.win.is-dragging { box-shadow: 0.7rem 0.7rem 0 var(--line); }

.win-photos { grid-column: span 12; }

/* windows "boot" in, a few chunky frames at a time */
.js .win:not(.viewer) { opacity: 0; }
.js .win:not(.viewer).is-open {
  opacity: 1;
  animation: boot 0.55s steps(6, jump-end) var(--boot-delay, 0s) both;
}

.win-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.5rem 0.35rem 0.7rem;
  background: var(--title, var(--indigo));
  color: var(--title-ink, #fff);
  border-bottom: 2px solid var(--line);
  border-radius: calc(var(--radius) - 2px) calc(var(--radius) - 2px) 0 0;
  user-select: none;
  touch-action: none;
}
.win-bar h2 { margin: 0; font-size: 0.9rem; white-space: nowrap; }
.win-bar h2 small { opacity: 0.75; font-size: 0.75rem; }
.win-bar::after { /* classic title-bar stripes */
  content: "";
  order: 2;
  flex: 1;
  height: 0.7rem;
  background: repeating-linear-gradient(180deg, currentColor 0 2px, transparent 2px 4px);
  opacity: 0.35;
}
.win-dot {
  width: 0.75rem; height: 0.75rem;
  background: var(--win);
  border: 2px solid var(--line);
  border-radius: 50%;
}
.win-min {
  order: 3;
  width: 1.6rem; height: 1.6rem;
  padding: 0;
  line-height: 1;
  background: var(--win);
  color: var(--ink);
  border: 2px solid var(--line);
  border-radius: 0.2rem;
}
.win-min:hover { background: var(--sun); color: #1d1b3a; }
.win-body { padding: 1.25rem 1.4rem 1.5rem; }
.win.is-min .win-body { display: none; }
.win.is-min { box-shadow: 0.2rem 0.2rem 0 var(--line); }

.win-body > p { margin: 0 0 0.9rem; max-width: 62ch; }
.win-body > p:last-child { margin-bottom: 0; }

.hello {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 3.4vw, 3.4rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-shadow: 0.055em 0.055em 0 var(--sun);
}
.hello::after {
  content: "";
  display: inline-block;
  width: 0.5em; height: 0.85em;
  margin-left: 0.15em;
  vertical-align: -0.05em;
  background: var(--tomato);
  animation: blink 1s steps(1) infinite;
}

/* photos */
.photos {
  list-style: none;
  margin: 0;
  padding: 0.5rem 0 0.5rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.25rem, 3vw, 3rem);
}
.photo {
  position: relative;
  display: block;
  width: 100%;
  padding: 0.6rem 0.6rem 0.9rem;
  text-align: left;
  background: var(--win);
  border: 2px solid var(--line);
  border-radius: 0.3rem;
  box-shadow: var(--shadow);
  rotate: var(--tilt, -1.5deg);
  animation: float 3.2s var(--step) var(--float-delay, 0s) infinite;
  transition: rotate 0.25s var(--step), scale 0.25s var(--step), box-shadow 0.25s var(--step);
}
.photos li:nth-child(2) .photo { --tilt: 1.5deg; --float-delay: -1.1s; }
.photos li:nth-child(3) .photo { --tilt: -0.75deg; --float-delay: -2.2s; }
.photo img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border: 2px solid var(--line);
  border-radius: 0.2rem;
  background: var(--soft);
}
.photo-cap { display: block; margin-top: 0.7rem; font-size: 0.9rem; line-height: 1.45; }
.photo-cap::before { content: "> "; color: var(--tomato); }
.photo-view {
  position: absolute;
  top: 1.1rem; right: 1.1rem;
  padding: 0.1rem 0.5rem;
  font-size: 0.8rem;
  background: var(--sun);
  color: #1d1b3a;
  border: 2px solid var(--line);
  opacity: 0;
  transition: opacity 0.15s var(--step);
}
.photo:hover, .photo:focus-visible {
  rotate: 0deg;
  scale: 1.03;
  box-shadow: 0.6rem 0.6rem 0 var(--line);
  animation-play-state: paused;
}
.photo:hover .photo-view, .photo:focus-visible .photo-view { opacity: 1; }

/* contact buttons */
.contact-lead { margin-top: 0; }
.btns { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.7rem; }
.btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0.55rem 0.55rem 0.9rem;
  text-decoration: none;
  color: #1d1b3a;
  background: var(--sun);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0.25rem 0.25rem 0 var(--line);
  transition: translate 0.1s var(--step), box-shadow 0.1s var(--step);
}
.btn span { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 0.75rem; }
.btn small { font-size: 0.78rem; opacity: 0.7; }
.btn i {
  font-style: normal;
  display: grid; place-items: center;
  width: 1.8rem; height: 1.8rem;
  background: #1d1b3a;
  color: var(--sun);
  border-radius: 0.2rem;
}
.btn:hover { background: var(--sun); translate: -2px -2px; box-shadow: 0.4rem 0.4rem 0 var(--line); }
.btn:hover i { animation: nudge-x 0.6s var(--step) infinite; }
.btn:active { translate: 0.25rem 0.25rem; box-shadow: 0 0 0 var(--line); }

/* ---------- resume ---------- */

.desktop-resume { align-items: stretch; }
.win-summary { grid-column: span 8; }
.win-pdf { grid-column: span 4; }
.win-edu, .win-skills { grid-column: span 12; }
.win-exp { grid-column: span 8; }
.win-stack {
  grid-column: span 4;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 2rem;
}

.win-summary .hello { font-size: clamp(2rem, 3vw, 3rem); margin-bottom: 0.6rem; }
.win-summary .win-body > p { max-width: 78ch; }
.meta-line {
  list-style: none;
  margin: 0 0 1.1rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 1.1rem;
  font-size: 0.88rem;
  color: var(--muted);
}
.meta-line li { display: flex; align-items: center; gap: 0.5rem; }
.meta-line li::before { content: ""; flex: none; width: 0.4rem; height: 0.4rem; background: var(--tomato); }
.meta-line a { color: var(--ink); }

.win-body h3 { margin: 0; font-size: 1.05rem; line-height: 1.35; }
.entry-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.2rem 1rem;
  margin-bottom: 0.35rem;
}
.where { font-size: 0.8rem; color: var(--muted); white-space: nowrap; }
.win-body .role-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.3rem 1rem;
  margin: 0;
  max-width: none;
}
.role-title { color: var(--purple-ink); }
.win-body h3 .muted { color: var(--muted); }
.win-body .desc { margin-top: 0.5rem; font-size: 0.95rem; }
.when {
  flex: none;
  padding: 0 0.45rem;
  font-size: 0.75rem;
  white-space: nowrap;
  background: var(--soft);
  border: 2px solid var(--line);
  border-radius: 0.2rem;
}
.win-body .sub { margin: 0.7rem 0 0; font-size: 0.85rem; color: var(--muted); }
.win-body .note { margin: 0.6rem 0 0; font-size: 0.9rem; }
.label { color: var(--purple-ink); }

.files { list-style: none; margin: 0.5rem 0 0; padding: 0; display: grid; gap: 0.4rem; font-size: 0.92rem; }
.files li { display: flex; align-items: center; gap: 0.6rem; }
.files li::before { /* tiny pixel file icon */
  content: "";
  flex: none;
  width: 0.85rem; height: 1.05rem;
  background: var(--win);
  border: 2px solid var(--line);
  box-shadow: inset 0 0.25rem 0 var(--sun);
}

/* two schools side by side */
.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem; }
.cols > .entry + .entry { padding-left: 2rem; border-left: 2px dashed var(--desk-dot); }

/* job history as a little timeline */
.roles { list-style: none; margin: 0.9rem 0 0; padding: 0 0 0 1.6rem; position: relative; display: grid; gap: 0.85rem; }
.roles::before {
  content: "";
  position: absolute;
  left: 0.4rem; top: 0.6rem; bottom: 0.6rem;
  border-left: 2px dashed var(--muted);
}
.roles > li { position: relative; }
.roles > li::before {
  content: "";
  position: absolute;
  left: -1.55rem; top: 0.35rem;
  width: 0.8rem; height: 0.8rem;
  background: var(--win);
  border: 2px solid var(--line);
}
.roles > li.is-now::before { background: var(--tomato); animation: blink 1.2s steps(1) infinite; }
.is-now .when { background: var(--sun); color: #1d1b3a; }

.bullets { list-style: none; margin: 0.6rem 0 0; padding: 0; display: grid; gap: 0.45rem; max-width: 72ch; }
.bullets li { position: relative; padding-left: 1.3rem; font-size: 0.95rem; }
.bullets li::before { content: "▸"; position: absolute; left: 0; color: var(--tomato); }

/* pdf download */
.file { display: flex; align-items: center; gap: 0.9rem; margin-bottom: 1.2rem; }
.file img {
  flex: none;
  width: 3.4rem; height: 3.4rem;
  image-rendering: pixelated;
  animation: idle-bob 2.8s steps(2) infinite;
}
.win-body .file p { margin: 0; display: flex; flex-direction: column; line-height: 1.35; overflow-wrap: anywhere; }
.file small { font-size: 0.78rem; color: var(--muted); }
.btn-quiet { background: var(--win); color: var(--ink); }
.btn-quiet i { background: var(--ink); color: var(--win); }
.btn-quiet:hover { color: #1d1b3a; }
.btn-quiet:hover i { background: #1d1b3a; color: var(--sun); }

/* skills */
.skills { margin: 0; display: flex; flex-wrap: wrap; gap: 1rem; }
.skills > div {
  flex: 1 1 14rem;
  padding: 0.8rem 0.9rem 0.95rem;
  background: var(--soft);
  border: 2px solid var(--line);
  border-radius: 0.3rem;
}
.skills dt { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.6rem; font-size: 0.88rem; line-height: 1.3; }
.skills dt::before { content: ""; flex: none; width: 0.7rem; height: 0.7rem; background: var(--dot, var(--indigo)); border: 2px solid var(--line); }
.skills > div:nth-child(2) { --dot: var(--teal); }
.skills > div:nth-child(3) { --dot: var(--tomato); }
.skills > div:nth-child(4) { --dot: var(--sun); }
.skills > div:nth-child(5) { --dot: var(--pink); }
.skills dd { margin: 0; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chips li {
  padding: 0.05rem 0.5rem;
  font-size: 0.8rem;
  line-height: 1.5;
  background: var(--win);
  border: 2px solid var(--line);
  border-radius: 0.2rem;
  box-shadow: 0.12rem 0.12rem 0 var(--line);
  transition: translate 0.1s var(--step), box-shadow 0.1s var(--step);
}
.chips li:hover { translate: -1px -1px; background: var(--sun); color: #1d1b3a; box-shadow: 0.2rem 0.2rem 0 var(--line); }

/* ---------- photo viewer ---------- */

.viewer {
  padding: 0;
  width: min(60rem, 94vw);
  max-height: 94vh;
  color: var(--ink);
  overflow: hidden;
}
.viewer[open] { animation: boot 0.4s steps(5, jump-end) both; }
.viewer::backdrop { background: rgba(18, 16, 42, 0.7); }
.viewer-body { margin: 0; padding: 1rem; display: grid; gap: 0.75rem; }
.viewer-body img {
  display: block;
  width: 100%;
  max-height: 74vh;
  object-fit: contain;
  background: var(--soft);
  border: 2px solid var(--line);
}
.viewer-body figcaption::before { content: "> "; color: var(--tomato); }

/* ---------- motion ---------- */

@keyframes blink { 50% { opacity: 0; } }
@keyframes bob { 50% { translate: 0 0.2rem; } }
@keyframes idle-bob { 50% { translate: 0 -0.15rem; } }
@keyframes hop { 0%, 100% { translate: 0 0; } 25% { translate: 0 -0.5rem; } 50% { translate: 0 -0.7rem; } 75% { translate: 0 -0.3rem; } }
@keyframes float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -0.4rem; } }
@keyframes talk { 50% { translate: 0 -2px; } }
@keyframes nudge { 0%, 80%, 100% { rotate: 0deg; } 85% { rotate: -2deg; } 90% { rotate: 2deg; } 95% { rotate: -1deg; } }
@keyframes nudge-x { 50% { translate: 0.2rem 0; } }
@keyframes rise { from { translate: 0 -1.5rem; } to { translate: 0 0; } }
@keyframes boot {
  0%   { opacity: 0; scale: 0.6; clip-path: inset(0 0 100% 0); }
  30%  { opacity: 1; scale: 1.02; clip-path: inset(0 0 85% 0); }
  60%  { clip-path: inset(0 0 40% 0); }
  100% { opacity: 1; scale: 1; clip-path: inset(-2rem -2rem -2rem -2rem); }
}

/* ---------- small screens ---------- */

@media (max-width: 820px) {
  .menubar { gap: 0.6rem; padding: 0.4rem 0.75rem; }
  .badge-text, .sky-label, .clock { display: none; }
  .badge { padding: 0.15rem; }
  .badge img { width: 2.3rem; height: 2.3rem; }

  .hero { height: auto; display: flex; flex-direction: column; background: transparent; border-bottom: 0; }
  .hero canvas { position: relative; height: 56vh; min-height: 20rem; border-bottom: 2px solid var(--line); }
  .hero-home { height: auto; }
  .hero-wins {
    position: static;
    flex-direction: column;
    align-items: stretch;
    gap: 1.5rem;
    padding: 1.5rem 0.9rem 0.5rem;
    pointer-events: auto;
  }
  .hero-wins .win-about, .hero-side { width: auto; max-height: none; }
  .hero-wins .win-about .win-body { overflow: visible; font-size: 1rem; }
  .hero-side { align-items: stretch; }
  .hero-side .hint { position: absolute; top: 0.6rem; right: 0.6rem; }
  .hero-sm canvas { height: 38vh; min-height: 15rem; }
  .hint { font-size: 0.7rem; }
  .dialog {
    position: relative;
    left: auto; bottom: auto;
    width: auto;
    margin: -2.5rem 0.75rem 1rem;
    grid-template-columns: auto 1fr;
    padding: 0.9rem 2.6rem 0.9rem 0.8rem;
  }
  .dialog-face { width: 3.25rem; height: 3.25rem; }
  .dialog-lines p { font-size: 0.95rem; }

  .desktop { grid-template-columns: 1fr; gap: 1.5rem; padding-top: 2rem; }
  .desktop > .win, .desktop > .win-stack { grid-column: 1 / -1; }
  .win-stack { gap: 1.5rem; }
  .cols { grid-template-columns: 1fr; gap: 1.5rem; }
  .cols > .entry + .entry { padding: 1.5rem 0 0; border-left: 0; border-top: 2px dashed var(--desk-dot); }
  .photos { grid-template-columns: 1fr; max-width: 22rem; margin: 0 auto; gap: 2rem; }
}

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