/* =========================================================
   Viola Cherchi · MA memory box
   One stylesheet for every page. Mobile first, tokens on :root,
   motion only when the visitor is happy to have it.

   1. Fonts
   2. Tokens
   3. Reset and base
   4. Utilities
   5. Site header
   6. Hero
   7. The memory box: module bands
   8. Tiles
   9. About page
   10. Footer
   11. 404
   12. Motion
   13. Dark mode
   ========================================================= */


/* 1. Fonts ------------------------------------------------
   Two variable files, self-hosted, latin subset only.
   Montserrat carries the brand, Atkinson Hyperlegible Next
   does the reading. */

@font-face {
  font-family: "Montserrat";
  src: url("../fonts/montserrat-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("../fonts/atkinson-hyperlegible-next-wght.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}


/* 2. Tokens ----------------------------------------------- */

:root {
  color-scheme: light dark;

  /* brand colours, kept from the original site */
  --navy: #083d77;
  --cyan: #24daeb;
  --pink: #da4167;
  --pink-strong: #c2305a;   /* the pink, deepened to pass 4.5:1 for text */

  /* roles */
  --color-bg: #ffffff;
  --color-surface: #ffffff;
  --color-text: #1a1a1a;
  --color-heading: var(--navy);
  --color-muted: #4a5563;
  --color-accent: var(--pink-strong);
  --color-frame: var(--cyan);
  --color-wash-cyan: #e6f9fc;
  --color-wash-pink: #fdecf1;
  --color-border: #d7e6ee;
  --color-band: var(--navy);
  --color-band-text: #ffffff;
  --doodle-ink: rgb(8 61 119 / 0.1);
  --ink-filter: none;       /* hand-drawn black ink, flipped in dark mode */
  --shadow: 0 0.75rem 2rem rgb(8 61 119 / 0.12);

  /* type */
  --font-brand: "Montserrat", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --font-body: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", Verdana, system-ui, sans-serif;

  --text-sm: 0.9375rem;
  --text-base: 1.0625rem;
  --text-lg: clamp(1.125rem, 1rem + 0.5vw, 1.3125rem);
  --text-xl: clamp(1.375rem, 1.1rem + 1.1vw, 1.875rem);
  --text-2xl: clamp(1.75rem, 1.3rem + 2vw, 2.75rem);
  --text-display: clamp(3rem, 1.6rem + 7vw, 7.5rem);

  /* space */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-24: 6rem;
  --gutter: clamp(1rem, 0.5rem + 2.5vw, 2.5rem);

  /* shape */
  --radius-sm: 0.375rem;
  --radius-md: 0.75rem;
  --radius-lg: 1.25rem;
  --radius-full: 999px;
  --container: 76rem;
  --tilt: -2.5deg;          /* the tilt of the hand-drawn frame round the selfie */

  /* motion */
  --duration-quick: 180ms;
  --duration-base: 420ms;
  --duration-slow: 800ms;
  --duration-loop: 30s;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --stagger: 60ms;
}


/* 3. Reset and base --------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  isolation: isolate;
}

/* the doodle-faces pattern from the original site, now a light
   alpha mask so its colour comes from a token */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-color: var(--doodle-ink);
  -webkit-mask: url("../images/doodle-faces.webp") 0 0 / 31.25rem auto repeat;
  mask: url("../images/doodle-faces.webp") 0 0 / 31.25rem auto repeat;
}

/* decorative frames and tilted polaroids may overhang the gutter;
   clip them so the page never scrolls sideways */
main { flex: 1; overflow-x: clip; }

img, svg, video { display: block; max-width: 100%; }
img { height: auto; }

input, button, textarea, select { font: inherit; color: inherit; }

h1, h2, h3, h4 {
  font-family: var(--font-brand);
  color: var(--color-heading);
  line-height: 1.15;
  text-wrap: balance;
  overflow-wrap: break-word;
}

p { max-width: 65ch; text-wrap: pretty; overflow-wrap: break-word; }

ul[role="list"], ol[role="list"] { list-style: none; }

/* links: all five states, in order */
a { color: var(--color-heading); text-underline-offset: 0.2em; text-decoration-thickness: 0.08em; }
a:visited { color: var(--color-heading); }
a:hover { color: var(--color-accent); text-decoration-thickness: 0.14em; }
a:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}
a:active { color: var(--color-accent); }

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

::selection { background: var(--cyan); color: var(--navy); }


/* 4. Utilities -------------------------------------------- */

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

.skip-link {
  position: absolute;
  inset-block-start: var(--space-2);
  inset-inline-start: var(--space-2);
  z-index: 10;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  background: var(--color-accent);
  color: #fff;
  font-family: var(--font-brand);
  font-weight: 700;
  translate: 0 -200%;
}
.skip-link:focus-visible { translate: 0 0; color: #fff; }

.container {
  width: min(var(--container), 100% - 2 * var(--gutter));
  margin-inline: auto;
}

/* the pink pill label from the original corner icons: the site's motif */
.pill {
  display: inline-block;
  padding: 0.2em 0.85em;
  border-radius: var(--radius-full);
  background: var(--color-accent);
  color: #fff;
  font-family: var(--font-brand);
  font-size: var(--text-sm);
  font-weight: 650;
  line-height: 1.5;
}

/* hand-drawn ink (the doodle icons) */
.ink { filter: var(--ink-filter); }


/* 5. Site header ------------------------------------------ */

.site-header { padding-block: var(--space-4); }

.site-header > .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.brand {
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.18em;
  text-transform: lowercase;
  color: var(--color-heading);
  text-decoration: none;
}
.brand:visited { color: var(--color-heading); }
.site-header .brand { view-transition-name: brand; }

/* small doodle nav on inner pages */
.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
}

.site-nav a {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 2.75rem;
  padding-inline-end: var(--space-2);
  font-family: var(--font-brand);
  font-weight: 650;
  font-size: var(--text-sm);
  text-decoration: none;
}
.site-nav img { width: 2.75rem; }
.site-nav a[aria-current="page"] span {
  background: var(--color-accent);
  color: #fff;
  padding: 0.1em 0.7em;
  border-radius: var(--radius-full);
}

.motion-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 2.75rem;
  padding: var(--space-2) var(--space-4);
  border: 2px solid var(--color-heading);
  border-radius: var(--radius-full);
  background: var(--color-surface);
  color: var(--color-heading);
  font-family: var(--font-brand);
  font-size: var(--text-sm);
  font-weight: 650;
  cursor: pointer;
}
.motion-toggle:hover { background: var(--color-heading); color: var(--color-bg); }
.motion-toggle::before {
  content: "";
  inline-size: 0.7em;
  block-size: 0.8em;
  border-inline: 0.22em solid currentColor;
}
.motion-toggle[aria-pressed="true"]::before {
  border: 0;
  inline-size: 0.75em;
  background: currentColor;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}
/* the toggle only matters when something is moving */
@media (prefers-reduced-motion: reduce) {
  .motion-toggle { display: none; }
}


/* 6. Hero ------------------------------------------------- */

.hero {
  display: grid;
  gap: var(--space-12);
  padding-block: var(--space-8) var(--space-16);
  align-items: center;
}

.hero-text { position: relative; }

.eyebrow {
  font-family: var(--font-brand);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--color-muted);
}

.hero-mark {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}
.hero-mark .eyebrow { flex: 1 1 14rem; }

.statement {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 0.4em;
  margin-block: var(--space-4) var(--space-6);
  font-family: var(--font-brand);
  font-weight: 800;
  font-size: var(--text-display);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--color-heading);
  text-transform: lowercase;
  max-width: none;
}

.statement del {
  position: relative;
  font-size: 0.42em;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--color-muted);
  text-decoration: none;
}
/* the strike is a drawn line, so it can animate */
.statement del::after {
  content: "";
  position: absolute;
  inset-inline: -0.1em;
  inset-block-start: 55%;
  block-size: 0.14em;
  border-radius: var(--radius-full);
  background: var(--color-accent);
  rotate: -4deg;
  transform-origin: left center;
}

.statement ins {
  position: relative;
  text-decoration: none;
}
/* a cyan swoosh under "graduated!", like the underline on the old signature */
.statement ins::after {
  content: "";
  position: absolute;
  inset-inline: 0 0.3em;
  inset-block-end: -0.06em;
  block-size: 0.12em;
  border-radius: var(--radius-full);
  background: var(--color-frame);
  rotate: -1.5deg;
  z-index: -1;
}

.lede { font-size: var(--text-lg); }
.lede + p { margin-block-start: var(--space-4); }

/* rotating "class of 2026" stamp */
.stamp {
  flex: 0 0 auto;
  inline-size: clamp(5rem, 3.5rem + 6vw, 8.5rem);
  color: var(--color-accent);
  rotate: 12deg;
}
.stamp text {
  font-family: var(--font-brand);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  fill: currentColor;
}
.stamp .year {
  font-size: 19px;
  letter-spacing: 0;
  fill: var(--color-heading);
}

/* selfie with the four doodle icons sitting on its corners */
.portrait {
  display: grid;
  inline-size: min(100%, 30rem);
  margin-inline: auto;
  padding: 3.5rem clamp(2rem, 1rem + 4vw, 3rem) 4.5rem;
}
.portrait > * { grid-area: 1 / 1; }

.portrait > img { inline-size: 100%; }

.portrait ul {
  display: grid;
  grid-template-columns: auto auto;
  justify-content: space-between;
  align-content: space-between;
}

.portrait a {
  display: grid;
  justify-items: center;
  gap: var(--space-1);
  inline-size: clamp(5.5rem, 4rem + 5vw, 7.5rem);
  text-decoration: none;
}
.portrait li:nth-child(1) { translate: -30% -45%; }
.portrait li:nth-child(2) { translate: 30% -45%; }
.portrait li:nth-child(3) { translate: -30% 30%; }
.portrait li:nth-child(4) { translate: 30% 30%; }

.portrait a img {
  inline-size: 100%;
  filter: var(--ink-filter) drop-shadow(0 0.35rem 0.4rem rgb(0 0 0 / 0.1));
}

.portrait a span {
  padding: 0.2em 0.8em;
  border-radius: var(--radius-full);
  background: var(--color-accent);
  color: #fff;
  font-family: var(--font-brand);
  font-size: 0.8125rem;
  font-weight: 650;
  line-height: 1.3;
  text-align: center;
  inline-size: max-content;
  max-inline-size: min(9rem, 27vw);
}

@media (min-width: 56rem) {
  .hero {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    padding-block: var(--space-12) var(--space-24);
  }
}


/* 7. The memory box: module bands ------------------------ */

.box-intro {
  padding-block: var(--space-8);
  border-block-start: 3px solid var(--color-frame);
}

.box-intro h2 { font-size: var(--text-2xl); }
.box-intro p { margin-block: var(--space-2) var(--space-6); font-size: var(--text-lg); }

.module-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.module-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: var(--space-2) var(--space-4);
  border: 2px solid var(--color-heading);
  border-radius: var(--radius-full);
  background: var(--color-surface);
  font-family: var(--font-brand);
  font-size: var(--text-sm);
  font-weight: 650;
  text-decoration: none;
}
.module-nav a:hover { background: var(--color-heading); color: var(--color-bg); }

.module {
  padding-block: var(--space-16);
  scroll-margin-block-start: var(--space-4);
}

/* surface rhythm: navy, open, cyan wash, open, pink wash */
.module.band { background: var(--color-band); }
.module.band .module-head :is(h3, p:not(.pill)) { color: var(--color-band-text); }
.module.wash-cyan { background: var(--color-wash-cyan); }
.module.wash-pink { background: var(--color-wash-pink); }

.module-head {
  display: grid;
  gap: var(--space-2);
  justify-items: start;
  margin-block-end: var(--space-8);
}
.module-head h3 { font-size: var(--text-2xl); }
.module-head p:not(.pill) { font-size: var(--text-lg); }

/* the two short modules share one band */
.module-pair {
  display: grid;
  gap: var(--space-12) var(--gutter);
}
@media (min-width: 52rem) {
  .module-pair { grid-template-columns: 1fr 1fr; }
}


/* 8. Tiles ------------------------------------------------ */

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17.5rem), 1fr));
  grid-auto-flow: dense;
  gap: var(--space-6);
}
.module-pair .tiles { grid-template-columns: 1fr; }
.module-pair .tile-media { aspect-ratio: 21 / 9; }

@media (min-width: 40rem) {
  .tiles > .wide { grid-column: span 2; }
}

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: var(--shadow);
}

/* the cyan frame, waiting behind each tile */
.tile::before {
  content: "";
  position: absolute;
  inset: -0.5rem;
  border: 3px solid var(--color-frame);
  border-radius: calc(var(--radius-lg) + 0.25rem);
  rotate: var(--tilt);
  opacity: 0;
  pointer-events: none;
}

.tile-media {
  order: -1;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--color-wash-cyan);
}
.tile-media > img {
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
  object-position: top;
}

/* PDFs sit on the tile like paper on a desk */
.tile-media.paper,
.tile-media.doodle-art {
  position: relative;
}
.tile-media.paper { background: var(--color-wash-pink); }
.tile-media.paper > img,
.tile-media.doodle-art > img {
  position: absolute;
  inset: 0;
  margin: auto;
  inline-size: auto;
  block-size: auto;
  max-inline-size: 82%;
  max-block-size: 84%;
  object-fit: contain;
}
.tile-media.paper > img {
  box-shadow: 0 0.4rem 1rem rgb(0 0 0 / 0.18);
  rotate: -2deg;
}

/* crits: the slide decks fanned out like a hand of cards */
.tile-media.fan {
  display: grid;
  place-items: center;
  background: var(--color-wash-pink);
}
.tile-media.fan > img {
  grid-area: 1 / 1;
  inline-size: 52%;
  box-shadow: 0 0.4rem 1rem rgb(0 0 0 / 0.2);
  border-radius: 2px;
}
.tile-media.fan > img:nth-child(1) { rotate: -14deg; translate: -38% 6%; }
.tile-media.fan > img:nth-child(2) { rotate: -5deg; translate: -13% -2%; }
.tile-media.fan > img:nth-child(3) { rotate: 5deg; translate: 13% -2%; }
.tile-media.fan > img:nth-child(4) { rotate: 14deg; translate: 38% 6%; }

.tile-media.doodle-art > img { block-size: 70%; }

.tile-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  flex: 1;
  padding: var(--space-6) var(--space-6) var(--space-12);
}

.tile-type {
  order: -1;
  font-family: var(--font-brand);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent);
}

.tile h4 {
  font-size: clamp(1.25rem, 1.1rem + 0.45vw, 1.5rem);
  color: var(--color-heading);
  hyphens: auto;
}
.tile.wide h4 { font-size: var(--text-xl); }
.tile h4 a { text-decoration: none; color: inherit; }
.tile h4 a:visited { color: inherit; }

/* the whole tile is the link target */
.tile h4 a::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: var(--radius-lg);
}
.tile h4 a:focus-visible { outline: none; }
.tile:has(h4 a:focus-visible) {
  outline: 3px solid var(--color-accent);
  outline-offset: 4px;
}

.tile p:not(.tile-type) { color: var(--color-muted); }

/* the go arrow from the original site */
.tile .go {
  position: absolute;
  inset-inline-end: var(--space-4);
  inset-block-end: var(--space-3);
  inline-size: 3.5rem;
}

/* tiles holding a little list of links */
.tile-links {
  display: grid;
  gap: var(--space-1) var(--space-6);
  margin-block-start: var(--space-2);
}
.tile.wide .tile-links { grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); }
.tile-links a {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  column-gap: var(--space-3);
  min-height: 2.75rem;
  padding-block: var(--space-2);
  border-block-end: 1px dashed var(--color-border);
  font-weight: 650;
  line-height: 1.35;
  text-decoration: none;
}
.tile-links a::after {
  content: "→";
  grid-column: 2;
  grid-row: 1 / span 2;
  color: var(--color-accent);
}
.tile-links small {
  grid-column: 1;
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--color-muted);
}
.tile-links a:hover span:first-child { text-decoration: underline; }


/* 9. About page ------------------------------------------- */

.about-intro {
  padding-block: var(--space-8) var(--space-12);
  display: grid;
  gap: var(--space-4);
  justify-items: start;
}
.about-intro h1 { font-size: var(--text-display); line-height: 1; letter-spacing: -0.03em; text-transform: lowercase; }
.about-intro .note { font-size: var(--text-lg); color: var(--color-muted); }

.moments {
  display: grid;
  gap: var(--space-16);
  padding-block-end: var(--space-24);
}

.moment {
  display: grid;
  gap: var(--space-6);
  align-items: center;
}

/* polaroids, slightly squint, the way they land on a fridge */
.polaroid {
  position: relative;
  inline-size: min(100% - 1.5rem, 22rem);
  justify-self: center;
  padding: var(--space-3) var(--space-3) var(--space-12);
  background: #fff;
  box-shadow: var(--shadow);
  rotate: var(--tilt);
}
.moment:nth-child(even) .polaroid { rotate: calc(var(--tilt) * -1); }
.polaroid::before {
  content: "";
  position: absolute;
  inset: -0.6rem;
  border: 3px solid var(--color-frame);
  rotate: 3deg;
  pointer-events: none;
}
.moment:nth-child(3n) .polaroid::before { border-color: var(--pink); }
.moment > p { font-size: var(--text-lg); }

.moment.closing { justify-items: start; }
.moment.closing p {
  font-family: var(--font-brand);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--color-heading);
  line-height: 1.4;
}

@media (min-width: 48rem) {
  .moment { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: var(--space-12); }
  .moment:nth-child(even) .polaroid { order: 2; }
  .moment.closing { grid-template-columns: 1fr; }
}


/* 10. Footer ---------------------------------------------- */

.site-footer {
  padding-block: var(--space-12);
  border-block-start: 3px solid var(--color-frame);
  background: var(--color-bg);
}
.site-footer > .container {
  display: grid;
  gap: var(--space-6);
}
.footer-brand { font-size: 1.25rem; }
.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-6);
}
.site-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  font-family: var(--font-brand);
  font-weight: 650;
  font-size: var(--text-sm);
}
.site-footer small { font-size: var(--text-sm); color: var(--color-muted); }

@media (min-width: 48rem) {
  .site-footer > .container {
    grid-template-columns: auto 1fr;
    align-items: center;
    column-gap: var(--space-12);
  }
  .site-footer small { grid-column: 1 / -1; }
}


/* 11. 404 ------------------------------------------------- */

.lost {
  display: grid;
  gap: var(--space-6);
  justify-items: start;
  padding-block: var(--space-16) var(--space-24);
}
.lost img { inline-size: 9rem; }
.lost h1 { font-size: var(--text-2xl); }
.lost p { font-size: var(--text-lg); }


/* 12. Motion ----------------------------------------------
   Everything below is opt-in. With reduced motion the page
   shows the end state of every interaction. */

@media (prefers-reduced-motion: no-preference) {

  @view-transition { navigation: auto; }

  /* hero: "studying" gets crossed out, "graduated!" lands */
  .statement del::after {
    animation: strike var(--duration-base) var(--ease-out) 500ms both;
  }
  .statement ins {
    animation: land var(--duration-slow) var(--ease-out) 850ms both;
  }

  /* the stamp turns slowly; it pauses on hover, on focus,
     offscreen, and whenever "Pause motion" is pressed */
  .stamp {
    animation: spin var(--duration-loop) linear infinite;
  }
  .hero:is(:hover, :focus-within) .stamp,
  .stamp[data-offscreen],
  :root[data-motion="paused"] .stamp {
    animation-play-state: paused;
  }

  /* tiles: picked up out of the box, the cyan frame appears */
  .tile,
  .tile::before,
  .tile .go,
  .tile-media > img {
    transition:
      translate var(--duration-base) var(--ease-out),
      rotate var(--duration-base) var(--ease-out),
      scale var(--duration-base) var(--ease-out),
      opacity var(--duration-quick) linear;
  }

  /* doodle icons give a little bounce */
  .portrait a img,
  .site-nav img { transition: scale var(--duration-quick) var(--ease-out), rotate var(--duration-quick) var(--ease-out); }

  /* gentle reveal as tiles scroll in, where the browser supports it */
  @supports (animation-timeline: view()) {
    .tiles > li {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 60%;
    }
  }
}

/* hover and focus states (motion-free fallbacks live in the
   frame simply appearing) */
.tile:focus-within::before { opacity: 1; }

@media (hover: hover) {
  .tile:hover::before { opacity: 1; }
  .tile:has(h4 a):hover { translate: 0 -0.35rem; }
  .tile:has(h4 a):hover .go { translate: 0.4rem 0; }
  .tile:has(h4 a):hover .tile-media > img { scale: 1.04; }
  .tile:has(h4 a):hover .tile-media.paper > img { scale: 1.04; rotate: 0deg; }
  .tile:has(h4 a):hover .tile-media.doodle-art > img { scale: 1.06; rotate: -4deg; }
  .portrait a:hover img,
  .site-nav a:hover img { scale: 1.08; rotate: -4deg; }
}

.tile:has(h4 a:focus-visible) { translate: 0 -0.35rem; }
.tile:has(h4 a:focus-visible) .go { translate: 0.4rem 0; }
.portrait a:focus-visible img,
.site-nav a:focus-visible img { scale: 1.08; rotate: -4deg; }

@keyframes strike { from { scale: 0 1; } }
@keyframes land { from { opacity: 0; translate: 0 0.35em; } }
@keyframes spin { to { rotate: 372deg; } }
@keyframes rise { from { opacity: 0; translate: 0 1.5rem; } }


/* 13. Dark mode -------------------------------------------
   A nod to the light and dark mode seminar: the site follows
   the visitor's system setting. */

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #0b1724;
    --color-surface: #132436;
    --color-text: #e8eef4;
    --color-heading: #bdf3f9;
    --color-muted: #b4c2d0;
    --color-accent: #ff8fab;
    --color-wash-cyan: #0f2a3b;
    --color-wash-pink: #2a1826;
    --color-border: #2c4258;
    --color-band: #05203f;
    --doodle-ink: rgb(189 243 249 / 0.06);
    --ink-filter: invert(1) hue-rotate(180deg);
    --shadow: 0 0.75rem 2rem rgb(0 0 0 / 0.4);
  }

  .pill,
  .portrait a span,
  .site-nav a[aria-current="page"] span,
  .skip-link { color: #1a0710; }
  .skip-link:focus-visible { color: #1a0710; }
  .polaroid { background: #f4f1ea; }
  .tile-media > img:not(.ink) { filter: brightness(0.92); }
}
