/* gabrielatudor.ro — quiet editorial */

@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-display: swap;
  font-weight: 200 900;
  src: url(../fonts/source-serif-4-latin-ext-opsz-normal.woff2?v=ae2b8105) format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-display: swap;
  font-weight: 200 900;
  src: url(../fonts/source-serif-4-latin-opsz-normal.woff2?v=4c4d14ec) format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Source Serif 4";
  font-style: italic;
  font-display: swap;
  font-weight: 200 900;
  src: url(../fonts/source-serif-4-latin-ext-opsz-italic.woff2?v=f7ac5481) format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Source Serif 4";
  font-style: italic;
  font-display: swap;
  font-weight: 200 900;
  src: url(../fonts/source-serif-4-latin-opsz-italic.woff2?v=7be705ca) format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Palette from the memorial book cover: cloud cream, slate sea, sky, cloud gold.
   Gold is decorative only: never use it for text on the cream page (1.96:1). */
:root {
  --bg: #f3eee2;      /* cloud cream */
  --surface: #eae3d2;
  --text: #30383f;    /* slate sea, 10.3:1 on --bg */
  --muted: #545f67;   /* 5.7:1 on --bg */
  --line: #d6cdb8;
  --accent: #4a6b8a;  /* sky, 4.8:1 on --bg */
  --sky: #b9cce0;     /* pale sky: rules, tints, links on --sea (7.3:1) */
  --gold: #c9a85c;    /* cloud light: decoration; 5.2:1 on --sea only */
  --sea: #30383f;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --measure: 38rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-size: clamp(1.0625rem, 0.3vw + 1rem, 1.1875rem);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -3rem;
  padding: 0.4rem 0.8rem;
  background: var(--text);
  color: var(--bg);
  z-index: 10;
}
.skip-link:focus { top: 0.5rem; }

/* Header + menu */
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding: 1rem var(--gutter);
  border-bottom: 1px solid var(--line);
}

/* Logo: Gabriela's own signature, vector from the 2009 site */
.site-name {
  display: block;
  line-height: 0;
  transition: transform 0.3s ease;
}
.site-name img { width: auto; height: 2.75rem; }
.site-name:hover { transform: rotate(-2deg); }

@media (max-width: 40rem) {
  .site-name img { height: 2.25rem; }
}

/* Menu: one row of links on wide screens. On phones the same list opens from a "Meniu" button as a
   popover panel (scripts/menu.py writes the markup). No JavaScript; without popover support the list shows. */
.menu-open,
.menu-close { display: none; }
.site-menu { /* undo the browser's popover styles: on wide screens the menu is a plain block */
  display: block;
  position: static;
  inset: auto;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: visible;
  background: none;
  color: inherit;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.95rem;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 0.25rem 0;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] { color: var(--text); text-decoration: underline; }
.site-nav a:hover { text-decoration: underline wavy var(--gold); text-decoration-thickness: 1.5px; }

.site-nav .lang {
  padding-left: 1.35rem;
  border-left: 1px solid var(--line);
  letter-spacing: 0.06em;
}

@media (max-width: 48rem) {
  .menu-open {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.45rem 0.95rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: none;
    color: var(--text);
    font: inherit;
    font-size: 0.95rem;
    cursor: pointer;
  }
  .menu-open::before { /* three pencil lines */
    content: "";
    width: 1rem;
    height: 0.7rem;
    background:
      linear-gradient(currentColor 0 0) top / 100% 1.5px no-repeat,
      linear-gradient(currentColor 0 0) center / 100% 1.5px no-repeat,
      linear-gradient(currentColor 0 0) bottom / 100% 1.5px no-repeat;
  }
  .site-menu:not(:popover-open) { display: none; }
  .site-menu:popover-open {
    position: fixed;
    inset: 0 0 auto 0;
    max-height: 100svh;
    margin: 0;
    padding: 1rem var(--gutter) 1.75rem;
    overflow: auto;
    border-bottom: 1px solid var(--line);
    background: var(--bg);
    box-shadow: 0 18px 40px -16px rgb(48 56 63 / 0.45);
  }
  .site-menu::backdrop { background: rgb(28 34 39 / 0.35); }
  .menu-close {
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    margin: 0 0 0.5rem auto;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: none;
    color: var(--text);
    font: 400 1.75rem/1 var(--serif);
    cursor: pointer;
  }
  .site-nav ul { flex-direction: column; gap: 0; font-size: 1.15rem; }
  .site-nav li a { display: block; padding: 0.6rem 0; border-bottom: 1px solid var(--line); }
  .site-nav .lang { padding: 0.6rem 0 0; border: 0; }
  .site-nav .lang a { border: 0; }
}

/* Home panorama: Iosif Király's collage of the Pro Helvetia terrace, kept whole (never cropped).
   It fills the width; below 150 px of height it stays 150 px high and scrolls sideways (js/panorama.js). */
.panorama { margin: 0; }
.panorama-scroll {
  container-type: inline-size;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
}
.panorama img {
  width: max(100cqw, 9.375rem * 2268 / 291);
  max-width: none;
}
.panorama figcaption {
  padding: 0.3rem var(--gutter) 0;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: right;
}

/* Slideshow */
.slideshow {
  position: relative;
  height: min(64svh, 36rem, 110vw);
  min-height: 18rem;
  margin: clamp(1.5rem, 4vw, 3rem) var(--gutter) 0;
}

/* Each photo is a print on the table: paper border, soft shadow, a slight tilt.
   Sized to the photo itself (never upscaled past its own pixels), centred in the frame. */
.slideshow { container-type: size; }

/* Size comes from each slide's inline --ar (aspect ratio) and --w (pixel width), not from the
   decoded file, so the box is right before the photo loads (no layout shift). */
.slideshow img {
  --pad: clamp(0.4rem, 1.2vw, 0.75rem);
  position: absolute;
  inset: 0;
  margin: auto;
  width: min(100cqw, 100cqh * var(--ar, 1), var(--w, 100cqw) + 2 * var(--pad));
  height: auto;
  aspect-ratio: var(--ar, auto);
  object-fit: contain;
  padding: var(--pad);
  background: #fbf8f1;
  box-shadow: 0 1px 2px rgb(48 56 63 / 0.12), 0 18px 40px -16px rgb(48 56 63 / 0.45);
  opacity: 0;
  transform: rotate(var(--tilt, 0deg)) scale(0.985);
  transition: opacity 1.6s ease-in-out, transform 1.6s ease-in-out;
}
.slideshow img.is-active { opacity: 1; transform: rotate(var(--tilt, 0deg)); }
.slideshow img:nth-child(3n + 1) { --tilt: -1.4deg; }
.slideshow img:nth-child(3n + 2) { --tilt: 1deg; }
.slideshow img:nth-child(3n) { --tilt: -0.4deg; }
@media (prefers-reduced-motion: reduce) {
  .slideshow img { transition: opacity 1.6s ease-in-out; }
}

/* Wide screens: gallery left, held in view (sticky) while the In Memoriam text scrolls on the right.
   Sticky ends with .home-layout, so after the last paragraph the gallery scrolls up with the page. */
@media (min-width: 72rem) {
  .home-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, calc(var(--measure) + 2 * var(--gutter)));
    align-items: start;
    column-gap: clamp(1rem, 3vw, 3rem);
    max-width: 96rem;
    margin: 0 auto;
    padding-left: var(--gutter);
  }
  .home-layout .slideshow {
    position: sticky;
    top: 1.5rem;
    height: calc(100svh - 7.5rem); /* fits under the header on load, holds 1.5rem from the top once scrolled */
    max-height: 52rem;
    margin: 1.5rem 0 0;
  }
  /* Prints hang from the top of the frame: the panorama above pushes the frame down on load,
     and a centred print would start below the fold. */
  .home-layout .slideshow img { margin: 0 auto; }
  .home-layout .page { margin: 0; }
}

/* Text column */
.page {
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 4rem) var(--gutter) clamp(3rem, 8vw, 6rem);
}

.page h1 {
  margin: 0 0 0.25rem;
  font-size: clamp(2rem, 4vw + 1rem, 3rem);
  font-weight: 500;
  line-height: 1.15;
  text-align: center;
}

.page .dates {
  margin: 0 0 2.5rem;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-align: center;
  hyphens: manual; /* names in subtitles must not break */
}

.page h2 {
  margin: 3rem 0 1.25rem;
  font-size: 1.35rem;
  font-weight: 600;
}
/* A short hand-drawn wave of the cover's sea under section headings */
.page h2::after,
.scene h2::after {
  content: "";
  display: block;
  width: 5.5rem;
  height: 0.6rem;
  margin-top: 0.45rem;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 88 10'%3E%3Cpath d='M1 6c7-5 11-5 18 0s11 5 18 0 11-5 18 0 11 5 18 0 8-4 14-1' fill='none' stroke='%23b9cce0' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center / contain;
}
.scene h2::after { margin-inline: auto; }

.page p { margin: 0 0 1.25rem; hyphens: auto; }
.page a { hyphens: none; }

.page .lead::first-letter {
  float: left;
  font-size: 3.6em;
  line-height: 0.85;
  padding: 0.08em 0.12em 0 0;
  color: var(--accent);
}

.page .note { color: var(--muted); font-size: 0.95rem; }

/* Biography: one entry per ● from the memorial book */
.chronicle {
  margin: 0;
  padding: 0;
  list-style: none;
}
.chronicle li {
  position: relative;
  margin: 0 0 0.9rem;
  padding-left: 1.4rem;
  hyphens: auto;
}
.chronicle li::before {
  content: "●";
  content: "●" / "";  /* decorative: not read by screen readers */
  position: absolute;
  left: 0;
  top: 0.05em;
  color: var(--gold);
  font-size: 0.7em;
  line-height: 2.4;
}

/* Biography prints: small photos beside their entry, a click opens them large (js/video.js).
   Narrow screens: under the entry. Wide screens: out in the side margins, alternating sides. */
.print {
  width: min(100%, 22rem);
  margin: 0.9rem 0 1.4rem;
}
.print-open {
  display: block;
  width: 100%;
  padding: clamp(0.3rem, 0.8vw, 0.5rem);
  border: 0;
  background: #fbf8f1;
  box-shadow: 0 1px 2px rgb(48 56 63 / 0.12), 0 14px 30px -14px rgb(48 56 63 / 0.45);
  cursor: zoom-in;
  transform: rotate(var(--tilt));
  transition: transform 0.3s ease;
}
.print-right { --tilt: 1deg; }
.print-left { --tilt: -1.2deg; }
.print-open:hover { transform: rotate(0deg) translateY(-3px); }
.print-open img { width: 100%; aspect-ratio: var(--ar); } /* --ar inline, like the slides: Chrome flags lazy images sized only by attributes */
.print figcaption {
  margin-top: 0.55rem;
  color: var(--muted);
  font-size: 0.85rem;
  font-style: italic;
  line-height: 1.4;
  hyphens: manual;
}

@media (min-width: 76rem) {
  .chronicle { --pw: clamp(13rem, (100vw - 43rem) / 2 - 3.5rem, 17rem); }
  .chronicle .print {
    position: absolute;
    top: 0.2rem;
    width: var(--pw);
    margin: 0;
  }
  .chronicle .print-right { right: calc(-1 * (var(--pw) + 2rem)); }
  .chronicle .print-left { left: calc(-1 * (var(--pw) + 2rem)); }
}

/* Cântare / Lament: the Plopiș photo beside the poem */
.lament {
  display: grid;
  justify-items: center;
  gap: 2.5rem;
}
.lament .print { margin: 0; width: min(100%, 18rem); } /* the poem leads; the photo stays small */
.page-intro { max-width: var(--measure); margin: 0 auto 2.5rem; }
.poem { font-size: 1.1rem; line-height: 1.8; }
.poem p { margin: 0 0 1.6rem; }
.poem .poem-author { margin: 2rem 0 0; color: var(--muted); font-style: italic; }
@media (min-width: 56rem) {
  .lament {
    grid-template-columns: auto auto;
    justify-content: center;
    align-items: start;
    column-gap: 4rem;
  }
  .lament .print { position: sticky; top: 1.5rem; }
}

/* Interview: the questions stand apart from Gabriela's answers */
.interview .source { margin: 0 0 2rem; color: var(--muted); font-style: italic; text-align: center; }
.interview .q { margin: 2.25rem 0 0.6rem; font-weight: 600; }
.interview .source + .q { margin-top: 0; }

/* ArtistNe(s)t: the logo as the page title, two prints side by side, a link to the supplement */
.page h1.logo-title { margin-top: 1rem; line-height: 0; }
.logo-title img { width: min(100%, 24rem); margin: 0 auto; mix-blend-mode: multiply; }
.duo {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  align-items: start;
  gap: 2rem;
  margin: 2.5rem 0;
}
.duo .print { width: 100%; margin: 0; }
.doc-link { margin: 2.5rem 0 0; text-align: center; }
.doc-link a {
  display: inline-block;
  padding: 0.8rem 1.4rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  text-decoration: none;
}
.doc-link a:hover { border-color: var(--accent); }

/* Fotografii: prints in loose columns, like photos laid out on a table */
.gallery {
  columns: 15rem;
  column-gap: 2rem;
  margin: 0 0 3rem;
}
.gallery .print {
  display: inline-block; /* keeps a print and its caption in one column */
  width: 100%;
  margin: 0 0 2rem;
  break-inside: avoid;
}
/* A short gallery (the 3 drawings) as a grid: column balancing stacks 2 of 3 equal prints in one column */
.gallery-few {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  column-gap: 2rem;
  align-items: start;
}
@media (max-width: 40rem) { /* two small columns on phones; a tap opens the photo large */
  .gallery { columns: 2; column-gap: 1rem; }
  .gallery-few { grid-template-columns: repeat(2, 1fr); column-gap: 1rem; }
  .gallery .print { margin-bottom: 1.25rem; }
  .gallery .print figcaption { font-size: 0.78rem; }
}

/* Home scene: the whole 2009 drawing; every figure is a button with its old sound.
   Layers are pre-multiplied onto --bg, so no blend mode is needed (transforms would isolate it). */
.scene {
  max-width: calc(60rem + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter) clamp(3rem, 8vw, 5rem);
  text-align: center;
}
.scene h2 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
}
.scene-hint {
  margin: 0.25rem 0 1.25rem;
  color: var(--muted);
  font-style: italic;
}
.scene-scroll {
  overflow-x: auto;
  overscroll-behavior-x: contain;
}
.scene-stage {
  position: relative;
  min-width: 560px; /* keeps the smallest figure ≥ 24 px wide to tap; narrower screens scroll inside */
  aspect-ratio: 800 / 544;
  margin: 0;
  padding: 0;
  list-style: none;
}
.scene-item {
  position: absolute;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  transform-origin: 50% 85%;
  transition: transform 0.2s ease;
}
.scene-item img { display: block; width: 100%; height: 100%; object-fit: contain; }
.scene-item:not(.scene-island):hover { transform: translateY(-3px) rotate(-2deg); }
.scene-item:focus-visible { outline: 2px dashed var(--accent); outline-offset: 3px; border-radius: 6px; }
.scene-item.is-playing:not(.scene-island) { animation: wiggle 0.45s ease-in-out infinite alternate; }
.scene-item.scene-plane.is-playing { animation: fly 3s ease-in-out infinite alternate; }

@keyframes wiggle {
  from { transform: rotate(-3deg); }
  to { transform: rotate(3deg); }
}
@keyframes fly {
  from { transform: translate(0, 0) rotate(0); }
  to { transform: translate(-45%, 15%) rotate(-4deg); }
}
@media (prefers-reduced-motion: reduce) {
  .scene-item, .scene-item.is-playing { animation: none !important; transition: none; }
  .scene-item.is-playing { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }
}

/* Video page */
.page.wide { max-width: calc(64rem + 2 * var(--gutter)); }

/* The memorial DVD cover heads the page as a large print */
.video-cover {
  max-width: 40rem;
  margin: 0 auto clamp(2.5rem, 6vw, 4rem);
}
.video-cover img {
  width: 100%;
  padding: clamp(0.4rem, 1.2vw, 0.75rem);
  background: #fbf8f1;
  box-shadow: 0 1px 2px rgb(48 56 63 / 0.12), 0 18px 40px -16px rgb(48 56 63 / 0.45);
  transform: rotate(-0.6deg);
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 26rem), 1fr));
  gap: 2.5rem 2rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.video { margin: 0; }

.video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--text);
  outline: clamp(0.35rem, 1vw, 0.6rem) solid #fbf8f1;  /* print border, like the slideshow */
  box-shadow: 0 18px 40px -18px rgb(48 56 63 / 0.5);
  transition: transform 0.3s ease;
}
.video-grid > li:nth-child(odd) .video-frame { transform: rotate(-0.6deg); }
.video-grid > li:nth-child(even) .video-frame { transform: rotate(0.5deg); }
.video-grid > li .video-frame:hover { transform: rotate(0deg) translateY(-3px); }

.video-play {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-play {
  padding: 0;
  background: none;
  cursor: pointer;
}

.video-play img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-icon {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 4rem;
  height: 4rem;
  margin: -2rem 0 0 -2rem;
  border-radius: 50%;
  background: rgb(48 56 63 / 0.8);
  transition: background 0.2s;
}
.video-icon::after {
  content: "";
  position: absolute;
  left: 1.6rem;
  top: 1.25rem;
  border-style: solid;
  border-width: 0.75rem 0 0.75rem 1.2rem;
  border-color: transparent transparent transparent var(--bg);
}
.video-play:hover .video-icon,
.video-play:focus-visible .video-icon { background: var(--accent); }

.archive-title { margin-top: clamp(3.5rem, 8vw, 5.5rem) !important; }
.archive-title + .note { margin: 0 0 2rem; }

/* The radio programme has no picture: a slate card with the ArtistNe(s)t logo in light lines */
.video-frame.is-audio-thumb { background: var(--sea); }
.is-audio-thumb .video-play img {
  width: 66%;
  height: auto;
  aspect-ratio: var(--ar); /* inline on the <img>; a lazy image needs a CSS shape, see CLAUDE.md */
  margin: auto;
  position: absolute;
  inset: 0;
  object-fit: contain;
  filter: invert(1);
  mix-blend-mode: screen;
  opacity: 0.85;
}
.is-audio-thumb .video-icon { top: auto; bottom: 1.25rem; margin-top: 0; width: 3rem; height: 3rem; margin-left: -1.5rem; }
.is-audio-thumb .video-icon::after { left: 1.15rem; top: 0.9rem; border-width: 0.6rem 0 0.6rem 0.95rem; }

.video figcaption {
  margin-top: 0.75rem;
  line-height: 1.45;
}
.video figcaption .note { display: block; margin-top: 0.2rem; }

/* Video modal (native <dialog>, built by js/video.js) */
.video-modal {
  width: min(70rem, 92vw, calc((88svh - 3.5rem) * 16 / 9));
  max-width: none;
  max-height: none;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}
.video-modal[open] { animation: modal-in 0.15s ease-out; }
.video-modal::backdrop { background: rgb(28 34 39 / 0.9); }

.video-modal-frame {
  aspect-ratio: 16 / 9;
  background: #000;
}
.video-modal-frame.is-audio {
  aspect-ratio: auto;
  padding: clamp(1.5rem, 5vw, 3rem);
  background: var(--sea);
}
.video-modal-frame audio { display: block; width: 100%; }
/* A biography print, opened large: the dialog shrinks to the photo */
.video-modal:has(.is-image) { width: fit-content; } /* a modal dialog with width: auto stretches to the viewport */
.video-modal-frame.is-image { aspect-ratio: auto; background: none; }
.video-modal-frame.is-image figure { margin: 0; }
.video-modal-frame.is-image img {
  width: auto;
  height: auto;
  max-width: 92vw;
  max-height: calc(88svh - 7rem);
  padding: clamp(0.35rem, 1vw, 0.6rem);
  background: #fbf8f1;
}
.video-modal-frame.is-image figcaption {
  contain: inline-size; /* the photo sets the width; a long caption wraps under it */
  margin: 0.75rem auto 0;
  color: var(--bg);
  font-size: 0.95rem;
  font-style: italic;
  line-height: 1.45;
  text-align: center;
}
.video-modal-frame video,
.video-modal-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-modal-close {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  margin: 0 0 0.6rem auto;
  padding: 0;
  border: 2px solid var(--bg);
  border-radius: 50%;
  background: var(--text);
  color: var(--bg);
  font: 400 2rem/1 var(--serif);
  cursor: pointer;
}
.video-modal-close:hover,
.video-modal-close:focus-visible { background: var(--accent); }
.video-modal-close:focus-visible { outline-color: var(--bg); }

body:has(.video-modal[open]) { overflow: hidden; }

@keyframes modal-in {
  from { opacity: 0; transform: scale(0.97); }
}
@media (prefers-reduced-motion: reduce) {
  .video-modal[open] { animation: none; }
}

/* Doodles from the 2009 drawing: pencil scans; multiply drops their white paper into the page */
.doodle {
  display: block;
  width: auto;
  mix-blend-mode: multiply;
  pointer-events: none;
  user-select: none;
}
.doodle-head {
  height: 4.25rem;
  margin: 0 auto 1rem;
  transform: rotate(-4deg);
}

/* Footer: a band of slate sea, as on the book cover */
.site-footer {
  padding: 2.5rem var(--gutter) 2rem;
  background: var(--sea);
  color: var(--bg);
  font-size: 0.95rem;
  text-align: center;
}
.site-footer p { margin: 0; }
.site-footer a { color: var(--sky); }
.site-footer a:hover { color: var(--bg); }
.site-footer :focus-visible { outline-color: var(--sky); }
.doodle-foot {
  height: 2.25rem;
  margin: 0 auto 0.9rem;
  filter: invert(1);       /* black pencil → light lines */
  mix-blend-mode: screen;  /* the inverted paper (now black) disappears on the slate */
  opacity: 0.85;
}
