/* ==========================================================================
   Desk system: the one source of truth for rgenzon.com.
   Direction: "walk into the desk". Every section is a full-bleed painted desk;
   everything on it is an object: paper cards, keycap buttons, tape, cork.
   Loaded LAST on every page so it settles drift from older stylesheets.
   ========================================================================== */
:root {
  /* Brand */
  --ink: #203b36;           /* all text */
  --ink-soft: #456c5a;
  --ink-key: #1d315c;       /* keycap legends */
  --paper: #fbf8ed;         /* cards, name tag, bubbles */
  --tray: #2b4a43;          /* keyboard tray, deep desk green */
  /* Keycap component */
  --key-face: #f3f1e5;
  --key-face-hover: #e6eddf;
  --key-face-pressed: #cbdcc9;
  --key-accent: #f0cf95;
  --key-accent-hover: #f5dcae;
  --key-accent-deep: #c98f3c;
  --edge-light: #fffdf3;
  --edge-dark: #8b9d90;
  --key-depth: #6d8578;
  --key-accent-depth: #a8772f;
  --focus: #f2b632;
  /* Type scale (Outfit) */
  --fs-sm: 15px;
  --fs-body: clamp(15px, 1.15vw, 17px);
  --fs-lead: clamp(17px, 1.5vw, 21px);
  --fs-title: clamp(18px, 1.5vw, 21px);
  /* Shape & depth */
  --radius-key: 7px;
  --radius-card: 3px;
  --shadow-card: 2px 6px 14px #3b302533;
  --shadow-card-lift: 4px 16px 28px #3b302545;
  /* Layout */
  --nav-clear: 96px;        /* room for the floating keyboard tray */
  /* Motion */
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --dur-fast: 140ms;
  --dur-med: 420ms;
  --dur-slow: 820ms;
}

/* ---- Layout: full-bleed scenes, no boxes ---------------------------------- */
body { background: var(--tray); color: var(--ink); }
main, body:not(.dedicated-page) main, .page-main { max-width: none; margin: 0; padding: 0; }
main > .panel, .page-main > .panel {
  width: 100%; max-width: none; margin: 0; border: 0; border-radius: 0; box-shadow: none;
}
main > .hero { height: 100svh; min-height: 640px; }
main > .panel.projects, main > .panel.media, main > .panel.about {
  min-height: 100svh; display: flex; flex-direction: column; justify-content: center;
  padding: var(--nav-clear) clamp(16px, 5vw, 80px) 72px;
}
main > .panel .section-page-link { align-self: center; }
.page-main > .panel { min-height: 100svh; padding-top: calc(var(--nav-clear) + 12px); }
footer { background: var(--tray); color: var(--paper); padding: 40px 16px 56px; }

/* ---- Type ---------------------------------------------------------------- */
.product-preview h3, .featured-episode strong, .product-story-copy h2,
.page-about h2, .story-content h3 { font: 700 var(--fs-title)/1.2 'Outfit', sans-serif; color: var(--ink); }
.product-preview p, .featured-episode > span:not(.featured-image),
.bio, .product-story-copy p { font-size: var(--fs-body); line-height: 1.5; color: var(--ink); }
.panel .products-intro, .panel .media-intro, .panel .page-lead { font-size: var(--fs-lead); color: var(--ink); }

/* ==========================================================================
   Keycap: the ONLY button. Variants: default, accent, icon.
   ========================================================================== */
.site-header nav a, .site-header nav button, .site-header .menu-toggle,
.section-page-link, .hero-work-link, .product-preview a, .product-visit, .product-page .product-story-copy a, .booking-open,
.contact-submit, .media-filters button, .github-content > a,
.story-close, .contact-close, .github-close, .product-close {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; margin: 0;
  border: 1px solid var(--edge-dark); border-radius: var(--radius-key);
  background: linear-gradient(170deg, var(--edge-light), var(--key-face) 45%);
  color: var(--ink-key); box-shadow: inset 0 -3px 0 #0000000f, 0 4px 0 var(--key-depth), 0 6px 8px #1c2b2633;
  font: 600 var(--fs-sm)/1 'Outfit', sans-serif; letter-spacing: 0; text-decoration: none;
  cursor: pointer; transform: none;
  transition: background var(--dur-fast) ease-out, box-shadow var(--dur-fast) ease-out, translate var(--dur-fast) ease-out;
}
:is(.site-header nav a, .site-header nav button, .site-header .menu-toggle, .section-page-link, .hero-work-link,
  .product-preview a, .product-visit, .product-page .product-story-copy a, .booking-open, .contact-submit, .media-filters button, .github-content > a,
  .story-close, .contact-close, .github-close, .product-close):hover {
  background: linear-gradient(170deg, var(--edge-light), var(--key-face-hover) 45%); color: var(--ink-key);
  translate: 0 2px; box-shadow: inset 0 -3px 0 #0000000f, 0 2px 0 var(--key-depth), 0 3px 4px #1c2b2633; transform: none;
}
:is(.site-header nav a, .site-header nav button, .site-header .menu-toggle, .section-page-link, .hero-work-link,
  .product-preview a, .product-visit, .product-page .product-story-copy a, .booking-open, .contact-submit, .media-filters button, .github-content > a,
  .story-close, .contact-close, .github-close, .product-close):active,
.site-header nav a[aria-current=page], .media-filters button[aria-pressed=true], .site-header .menu-toggle[aria-expanded=true] {
  translate: 0 4px; background: var(--key-face-pressed); box-shadow: inset 0 2px 3px #0000001f, 0 0 0 var(--key-depth);
}
/* Accent: the one main action in a view. */
.hero-work-link, .contact-submit, .site-header nav [data-open-contact], .product-visit, .product-page .product-story-copy a, .booking-open {
  background: linear-gradient(170deg, #fff4dc, var(--key-accent) 45%); border-color: var(--key-accent-depth);
  box-shadow: inset 0 -3px 0 #0000000f, 0 4px 0 var(--key-accent-depth), 0 6px 8px #1c2b2633;
}
:is(.hero-work-link, .contact-submit, .site-header nav [data-open-contact], .product-visit, .product-page .product-story-copy a, .booking-open):hover {
  background: linear-gradient(170deg, #fff4dc, var(--key-accent-hover) 45%);
  box-shadow: inset 0 -3px 0 #0000000f, 0 2px 0 var(--key-accent-depth), 0 3px 4px #1c2b2633;
}
/* Icon: square close keys in dialogs. */
.story-close, .contact-close, .github-close, .product-close { width: 34px; min-height: 34px; height: 34px; padding: 0; font-size: 20px; }
.contact-submit { justify-self: start; margin-top: 12px; }
:is(a, button, input, textarea, summary, [tabindex]):focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }

/* ---- Card: paper pinned to the desk -------------------------------------- */
.product-preview, .featured-episode { background: var(--paper); border-radius: var(--radius-card); box-shadow: var(--shadow-card); }

/* ==========================================================================
   Motion (site-motion.js): keycaps type in, cards drop onto the desk,
   one hero opening sequence. Reduced motion: everything simply visible.
   ========================================================================== */
@media (prefers-reduced-motion: no-preference) {
  .motion-ready [data-reveal="drop"] {
    opacity: 0; translate: 0 -46px; rotate: -5deg; scale: 1.04;
    transition: opacity var(--dur-slow) var(--ease-out), translate var(--dur-slow) var(--ease-spring),
                rotate var(--dur-slow) var(--ease-spring), scale var(--dur-slow) var(--ease-out),
                transform 260ms var(--ease-out), box-shadow var(--dur-fast) ease-out;
    transition-delay: calc(var(--i, 0) * 90ms);
  }
  .motion-ready [data-reveal].is-in { opacity: 1; translate: 0 0; rotate: none; scale: 1; }
  :is(.product-preview, .featured-episode):hover,
  .motion-ready :is(.product-preview, .featured-episode)[data-reveal].is-in:hover {
    transition-delay: 0ms; box-shadow: var(--shadow-card-lift); translate: 0 -4px;
  }

  .motion-ready .hero .hi, .motion-ready .hero h1 > span, .motion-ready .hero-description,
  .motion-ready .hero-work-link { animation: hero-in var(--dur-slow) var(--ease-out) both; }
  .motion-ready .hero .hi { animation-delay: 80ms; }
  .motion-ready .hero .name-first { animation-delay: 160ms; display: inline-block; }
  .motion-ready .hero .name-last { animation-delay: 240ms; display: inline-block; }
  .motion-ready .hero-description { animation-delay: 340ms; }
  .motion-ready .hero-work-link { animation-delay: 440ms; }
  .motion-ready .hero-person { animation: hero-person-in 1100ms var(--ease-out) 120ms both; }
  .motion-ready .hero-snapshot { animation: snapshot-drop 900ms var(--ease-spring) 620ms both; }

  [data-parallax] { translate: 0 calc(var(--px, 0) * 1px); will-change: translate; }
  .scroll-pencil { position: fixed; z-index: 50; inset: 0 0 auto; height: 3px; pointer-events: none;
    background: var(--key-accent-deep); transform-origin: 0 50%; transform: scaleX(var(--progress, 0)); }
}
@keyframes hero-in { from { opacity: 0; translate: 0 26px; } }
@keyframes hero-person-in { from { opacity: 0; translate: 40px 30px; scale: .96; } }
@keyframes snapshot-drop { from { opacity: 0; translate: 0 -60px; rotate: -14deg; } }

/* ==========================================================================
   Desk play (desk-play.js): touchable objects, look-around depth, tilting paper.
   ========================================================================== */
.desk-touch { z-index: 3; pointer-events: none; }
.desk-touch-target { fill: transparent; pointer-events: auto; cursor: pointer; }
.illustrated-object.is-touchable { pointer-events: auto; cursor: pointer; z-index: 3; }
.hero-snapshot { cursor: pointer; }
.desk-particle, .desk-bubble { position: absolute; z-index: 60; pointer-events: none; translate: -50% -50%; }
.desk-particle { font: 700 22px/1 'Outfit', sans-serif; color: var(--ink-key); text-shadow: 0 1px 0 var(--edge-light); }
.desk-particle.is-heart { color: #c2456b; font-size: 24px; }
.desk-particle.is-steam { color: #fffdf3; font-size: 26px; text-shadow: 0 0 6px #fff8; }
.desk-particle.is-key { display: grid; place-items: center; width: 30px; height: 30px; font-size: 15px;
  border: 1px solid var(--edge-dark); border-radius: var(--radius-key); background: linear-gradient(170deg, var(--edge-light), var(--key-face) 45%);
  box-shadow: 0 3px 0 var(--key-depth); }
.desk-bubble { padding: 8px 12px; border: 2px solid var(--ink); border-radius: 12px; background: var(--paper);
  box-shadow: 0 3px 0 var(--ink); color: var(--ink); font: 600 14px/1.2 'Outfit', sans-serif; white-space: nowrap; }
.desk-bubble::after { content: ''; position: absolute; left: 50%; bottom: -8px; width: 12px; height: 12px; translate: -50% 0; rotate: 45deg;
  background: var(--paper); border: solid var(--ink); border-width: 0 2px 2px 0; }

@media (prefers-reduced-motion: no-preference) and (pointer: fine) {
  .hero.is-lookable { background-position: var(--look-bg, 50% 50%); }
  .hero.is-lookable :is(.hero-note, .hero-person, .hero-snapshot, .hero-atmosphere:not(.desk-touch)) { translate: var(--look, 0 0); }
  .is-tiltable { position: relative; transform-style: preserve-3d;
    transform: perspective(700px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg)) rotate(var(--rest-rotate, 0deg)); }
  .product-preview { --rest-rotate: -1.5deg; } .product-preview:nth-child(2) { --rest-rotate: 1deg; } .product-preview:nth-child(3) { --rest-rotate: -.5deg; }
  .featured-episode:nth-child(1) { --rest-rotate: -2deg; } .featured-episode:nth-child(3) { --rest-rotate: 2deg; }
  .is-tiltable::after { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity var(--dur-fast);
    background: radial-gradient(circle at var(--glare-x, 50%) var(--glare-y, 50%), #ffffff55, transparent 55%); }
  .is-tiltable:hover::after { opacity: 1; }
  .illustrated-object.is-touchable:hover { filter: drop-shadow(0 6px 6px #2d241a40) brightness(1.04); }
}

/* Menu key only exists on small screens (keycap rule above sets display). */
@media (min-width: 761px) { .site-header .menu-toggle { display: none; } }
/* Where one desk meets the next: a soft table-edge shadow instead of a hard seam. */
main > .panel + .panel { box-shadow: inset 0 22px 24px -18px #1c2b2659; }

/* ==========================================================================
   Spacing: one scale, one rhythm for every section.
   heading → intro: --space-3 · intro → content: --space-6 · content → link: --space-6
   ========================================================================== */
:root {
  --space-1: 4px; --space-2: 8px; --space-3: 16px; --space-4: 24px;
  --space-5: 32px; --space-6: 48px; --space-7: 64px; --space-8: 96px;
  --gutter: clamp(16px, 5vw, 80px);
}
main > .panel:not(.hero), .page-main > .panel {
  padding: var(--nav-clear) var(--gutter) var(--space-8);
}
main > .panel .bead-heading, .page-main > .panel .bead-heading { margin: 0 auto var(--space-3); }
.panel :is(.products-intro, .media-intro, .page-lead) { max-width: 36rem; margin: 0 auto; padding: 0; background: none; line-height: 1.5; }
.panel :is(.product-previews, .featured-episodes) { margin: var(--space-6) auto; }
.panel .about-intro { margin: var(--space-5) auto var(--space-6); }
main > .panel .section-page-link { margin: 0 auto; }
main > .panel.about .objects { margin: var(--space-7) auto 0; }
.page-main > .panel > :is(.media-filters, .product-stories, .booking-frame, .page-memories) { margin-top: var(--space-6); }
@media (max-width: 760px) {
  :root { --nav-clear: 84px; }
  main > .panel:not(.hero), .page-main > .panel { padding-bottom: var(--space-7); }
  .panel :is(.product-previews, .featured-episodes) { margin: var(--space-5) auto; }
}

/* ==========================================================================
   Scene harmony: the hero is the one full-color desk. The sections below share
   one warm-paper light so they read as one desk, not four posters.
   ========================================================================== */
main:has(> .hero) > .panel:not(.hero) { position: relative; isolation: isolate; }
main:has(> .hero) > .panel:not(.hero)::before {
  content: ''; display: block !important; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: var(--scene-light, #e8dcc0); mix-blend-mode: color; opacity: var(--scene-tone, .4);
}
main > .panel.projects { --scene-tone: .6; }
main > .panel.media { --scene-tone: .45; }
main > .panel.about { --scene-tone: .6; }
main:has(> .hero) > .panel:not(.hero) > :not(.illustrated-object, .note, .painted-desk-life, .desk-touch) { position: relative; z-index: 2; }

/* ==========================================================================
   Footer: a bookend to the keyboard tray. One slim ink-green strip.
   ========================================================================== */
footer {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--space-4);
  padding: var(--space-5) var(--gutter); background: var(--tray); color: var(--paper); text-align: left;
  box-shadow: inset 0 3px 0 #ffffff14;
}
footer .footer-sign { margin: 0; font: 600 var(--fs-body)/1.3 'Outfit', sans-serif; color: var(--paper); }
footer .social-links {
  display: flex; gap: 6px; margin: 0; padding: 6px 6px 9px; border-radius: 12px;
  background: #00000026; box-shadow: inset 0 2px 4px #0003;
}
footer .social-links a, footer .social-links a:nth-child(odd), footer .social-links a:nth-child(even) { width: 40px; height: 40px; }
footer .social-links svg { width: 17px; height: 17px; }
footer > div { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--space-4); margin: 0; }
footer > div a { color: var(--paper); font: 500 var(--fs-sm)/1 'Outfit', sans-serif; text-decoration: underline;
  text-decoration-color: #fbf8ed66; text-underline-offset: 5px; }
footer > div a:hover { text-decoration-color: var(--key-accent); }
footer small { grid-column: 1 / -1; justify-self: center; font-size: 13px; color: #fbf8edb3; }
@media (max-width: 760px) {
  footer { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: var(--space-3); padding-block: var(--space-6); }
  footer > div { justify-content: center; }
}

/* Scene touch layers (desk-play.js) */
.desk-touch--scene { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.page-main > .panel { position: relative; isolation: isolate; }
.desk-touch--scene svg { width: 100%; height: 100%; display: block; }
.desk-particle.is-pin { color: #d4473a; font-size: 34px; }
.desk-particle.is-star { color: #e9b92f; }
.desk-particle.is-leaf { color: #5d8a4f; }
.hero-person.is-touchable { cursor: pointer; pointer-events: auto; }
.desk-hint-note {
  position: relative; z-index: 5; display: block; width: fit-content; margin: var(--space-4) 0 0;
  padding: var(--space-2) var(--space-3); background: var(--paper); box-shadow: var(--shadow-card); rotate: -1.5deg;
  font: 600 var(--fs-sm)/1.3 'Outfit', sans-serif; color: var(--ink);
}
@media (prefers-reduced-motion: no-preference) {
  .desk-hint-note { animation: hint-in 600ms var(--ease-spring) both; }
  .desk-hint-note.is-leaving { opacity: 0; transition: opacity 400ms; }
  .hero.is-hinting .desk-touch-target { stroke: #fffdf3; stroke-width: 5; stroke-dasharray: 14 12; fill: #fffdf31a;
    animation: hint-pulse 1.6s ease-in-out 3; }
}
@keyframes hint-in { from { opacity: 0; translate: 0 12px; } }
@keyframes hint-pulse { 50% { stroke-opacity: .15; fill-opacity: 0; } }

/* Painted-desk overlays (desk-life.js) must cover the panel exactly like its
   center-top/cover background, now that panels are full-screen. */
.page-book > .painted-desk-life, .page-about > .painted-desk-life { inset: 0; width: 100%; height: 100%; aspect-ratio: auto; }

/* Inner pages: the painting stays screen-sized (cover of the first screen),
   anchored to the top; the paper color continues below as you read. The
   animated details and touch targets use the exact same box so they stay on
   their objects. */
.page-main > :is(.page-media, .page-about, .page-book) {
  --scene-w: max(100%, calc(100svh * 1672 / 941));
  background-size: var(--scene-w) auto !important;
  background-position: center top !important;
  background-repeat: no-repeat !important;
}
.page-main > :is(.page-media, .page-about, .page-book) > :is(.painted-desk-life, .desk-touch--scene) {
  inset: 0 auto auto 50%; translate: -50% 0; width: var(--scene-w); height: auto; aspect-ratio: 1672 / 941;
}
.page-main > .page-media { background-color: #e9dfc4 !important; }
.page-main > .page-about { background-color: #cfe3c3 !important; }
.page-main > .page-book { background-color: #a9c7c6 !important; }

/* Home Products: crop the painted wooden frame off the cork board by drawing the
   painting slightly larger than the section. Touch targets use the same box. */
main:has(> .hero) > .panel.projects { background-image: none !important; overflow: hidden; }
main:has(> .hero) > .panel.projects::after,
main:has(> .hero) > .panel.projects > .desk-touch--scene,
main:has(> .hero) > .panel.projects > .painted-desk-life {
  inset: -4% -3%; width: auto; height: auto; aspect-ratio: auto;
}
main:has(> .hero) > .panel.projects::after {
  content: ''; position: absolute; z-index: -1; pointer-events: none;
  background: #d7ba91 url('/assets/project-board.png') center / cover no-repeat;
}
/* The desk dog sits on the board, clear of the section edge. */
main:has(> .hero) > .panel.projects > .object-dog { top: auto; bottom: 10%; right: 4%; }
/* The board's monitor screen sits mostly off the top edge here, so skip its typing lines. */
main:has(> .hero) > .panel.projects .desk-screen { display: none; }

/* Photos hang from a pushpin drawn in the paintings' ink style; sway pivots from the pin. */
.objects .object, .page-memories figure { position: relative; overflow: visible; }
.objects .object::before, .page-memories figure::before {
  content: ''; position: absolute; z-index: 3; top: -22px; left: 50%; width: 36px; height: 36px; translate: -28% 0;
  background: var(--pin, url('/assets/pins/pin-red.svg')) center / contain no-repeat; pointer-events: none;
}
.objects .object:nth-child(4n+2)::before, .page-memories figure:nth-child(4n+2)::before { --pin: url('/assets/pins/pin-yellow.svg'); }
.objects .object:nth-child(4n+3)::before, .page-memories figure:nth-child(4n+3)::before { --pin: url('/assets/pins/pin-blue.svg'); }
.objects .object:nth-child(4n+4)::before, .page-memories figure:nth-child(4n+4)::before { --pin: url('/assets/pins/pin-green.svg'); }
.objects .object.scene-active, .page-memories figure.scene-active { transform-origin: 50% 6px; }

/* Hero text rhythm: greeting sits on the name; description and button breathe evenly. */
.hero-note .hi { margin: 0 0 var(--space-2); }
.hero-note h1 { margin: 0; line-height: .95; }
.hero-note .hero-description { margin: var(--space-4) 0 0; line-height: 1.45; }
.hero-note .hero-work-link { margin-top: var(--space-5); }
/* Hero: lift the block clear of the mug, keep the description light and evenly broken. */
main > .hero .hero-note { top: 33%; }
.hero-note .hero-description {
  max-width: 30ch; font: 400 var(--fs-lead)/1.45 'Outfit', sans-serif; color: var(--ink); text-wrap: balance;
}
@media (max-width: 760px) { main > .hero .hero-note { top: 17%; } .hero-note .hero-description { font-size: 15px; } }

/* Paper cards: room to breathe inside and between; one gentle, even tilt rhythm. */
.panel .product-previews { width: min(1080px, 100%); gap: clamp(20px, 3vw, 40px); }
.panel .product-preview { padding: var(--space-5) var(--space-5) var(--space-5); gap: 0; }
.panel .product-preview h3 { margin: 0 0 var(--space-3); }
.panel .product-preview p { margin: 0 0 var(--space-4); max-width: none; }
.panel .product-preview a { margin: auto 0 0; align-self: flex-start; }
.panel .featured-episodes { width: min(1080px, 100%); max-width: none; gap: clamp(20px, 3vw, 40px); }
.panel .featured-episode { padding: var(--space-3) var(--space-3) var(--space-4); gap: var(--space-2); }
@media (prefers-reduced-motion: no-preference) and (pointer: fine) {
  .product-preview { --rest-rotate: -.8deg; } .product-preview:nth-child(2) { --rest-rotate: .6deg; } .product-preview:nth-child(3) { --rest-rotate: -.4deg; }
  .featured-episode:nth-child(1) { --rest-rotate: -.8deg; } .featured-episode:nth-child(2) { --rest-rotate: .6deg; } .featured-episode:nth-child(3) { --rest-rotate: -.4deg; }
}
.panel .product-preview { column-gap: var(--space-3); }
.panel .featured-episode { padding: var(--space-4) var(--space-4) var(--space-5); gap: 0; }
.panel .featured-episode .featured-image { margin-bottom: var(--space-4); }
.panel .featured-episode strong { margin: 0 0 var(--space-2); }
.panel .featured-episode > span:not(.featured-image) { margin: 0; text-wrap: pretty; }
/* Inner pages: the painting fades into the page color instead of ending in a hard line.
   The fade layer uses the painting's exact box (same size/position). */
.page-main > .page-book  { --page-tone: #a9c7c6; background-image: linear-gradient(to bottom, transparent 55%, var(--page-tone) 100%), url('/assets/booking-desk.webp') !important; }
.page-main > .page-media { --page-tone: #e9dfc4; background-image: linear-gradient(to bottom, transparent 55%, var(--page-tone) 100%), url('/assets/music-desk.png') !important; }
.page-main > .page-about { --page-tone: #cfe3c3; background-image: linear-gradient(to bottom, transparent 55%, var(--page-tone) 100%), url('/assets/desk-paper.png') !important; }
.page-main > :is(.page-media, .page-about, .page-book) { background-color: var(--page-tone) !important; }
.page-main > :is(.page-media, .page-about, .page-book) {
  background-size: var(--scene-w) calc(max(100vw, 100svh * 1672 / 941) * 941 / 1672), var(--scene-w) auto !important;
}

/* ==========================================================================
   Phone layout: sections size to their content, cards stay compact.
   ========================================================================== */
@media (max-width: 760px) {
  main:has(> .hero) > .panel:not(.hero) { min-height: 0; padding: calc(var(--nav-clear) - 8px) var(--space-3) var(--space-7); }
  .hero-note h1 { font-size: clamp(48px, 14vw, 60px); }
  .hero-note .hero-description { max-width: 26ch; }
  .panel .product-previews, .panel .featured-episodes { width: 100%; max-width: 420px; gap: var(--space-3); margin: var(--space-5) auto; }
  .panel .product-preview { padding: var(--space-4); }
  .panel .product-preview h3 { margin-bottom: var(--space-2); }
  .panel .product-preview p { margin-bottom: var(--space-3); }
  .panel .featured-episode, .panel .featured-episode:nth-child(n) {
    display: grid; grid-template-columns: 120px minmax(0, 1fr); grid-template-rows: auto auto; align-items: center;
    column-gap: var(--space-3); row-gap: var(--space-1); padding: var(--space-3);
  }
  .panel .featured-episode .featured-image { grid-row: 1 / 3; margin: 0; }
  .panel .featured-episode strong { margin: 0; align-self: end; }
  .panel .featured-episode > span:not(.featured-image) { align-self: start; }
  main > .panel.about .objects { margin-top: var(--space-6); }
  main > .panel .section-page-link { margin-top: var(--space-1); }
}
@media (max-width: 760px) {
  /* Inner-page intros sit on a paper note so they stay readable over the painted objects. */
  .page-main > .panel :is(.page-lead, .media-intro, .products-intro),
  .page-main > .page-book > p {
    width: fit-content; max-width: min(34ch, 100%); margin: 0 auto; padding: var(--space-2) var(--space-3);
    background: var(--paper) !important; border-radius: var(--radius-card); box-shadow: var(--shadow-card);
    font-size: 15px; line-height: 1.45;
  }
}
@media (max-width: 760px) {
  .media-filters { display: flex; flex-wrap: nowrap; justify-content: center; gap: var(--space-2); }
  .media-filters button { padding: 0 12px; min-height: 42px; font-size: 14px; white-space: nowrap; }
}
/* Social keys sit directly on the footer, no tray behind them. */
footer .social-links { padding: 0; background: none; box-shadow: none; border-radius: 0; width: auto; }
/* Footer: more air between its rows and around its edges. */
footer { padding-block: var(--space-6); row-gap: var(--space-5); }
footer .social-links { gap: 10px; }
footer > div { gap: var(--space-5); }
footer small { margin-top: var(--space-1); }
@media (max-width: 760px) {
  footer { padding: var(--space-7) var(--space-4) var(--space-6); gap: var(--space-5); }
  footer > div { gap: var(--space-4); }
}
