/* User-approved Krea photograph. No AI edits, resampling or colour corrections.
   Camera crops 138 pixels left (another 3% of the original) and 92 right.
   Visible source width: 1306px. Horizontal registration: 138 / 230 = 60%.
   Every photographed chapter uses the same scale and horizontal registration. */
body.reference-home {
  --reference-scene: url('assets/desk/krea-approved-v21.lossless43.webp');
  --scene-camera-size: 117.61102603% auto;
  --scene-join: .76606432;
  --scene-inset: 0px;
}
body.reference-home::before {
  background-size: var(--scene-camera-size);
  background-position: 60% top;
  mask-image: linear-gradient(to bottom, #000 0, #000 76.606432vw, transparent 76.606432vw);
}
body.reference-home .header { left: 31.675%; top: 1.863vw; width: 44.515%; }
body.reference-home .header .reference-wordmark { font-size: clamp(25px, 2.25vw, 40px); }
body.reference-home .header #site-nav { gap: 1vw; font-size: clamp(10px, .8vw, 14px); }
body.reference-home .ea-header-tools { margin-left: 1vw; }
body.reference-home .hero.shell { height: 46vw; }
body.reference-home .hero-copy { left: 17.182%; top: 8.696vw; width: 27.951%; }
body.reference-home .hero h1 { font-size: 5.25vw; margin: 1.2vw 0; }
body.reference-home:lang(uk) .hero h1 { font-size: 4.5vw; }
body.reference-home .hero-copy .lead { font-size: 1.5vw; }
body.reference-home .hero .actions { gap: .7vw; margin-top: 1.3vw; }
body.reference-home .hero .actions .button,
body.reference-home .hero .actions > .text-link:nth-child(2) { min-height: 3.2vw; padding: .6vw 1vw; font-size: .95vw; }
body.reference-home .hero-media { top: 7.764vw; left: 52.38%; width: 37.268%; }
body.reference-home .collage-proof { padding-left: clamp(75px, 9vw, 140px); }
body.reference-home .desk-scene-middle { height: max(330px, 41.409vw); }
body.reference-home .desk-scene-middle::before,
body.reference-home .desk-scene-lower::before { background-size: var(--scene-camera-size); }
body.reference-home .desk-scene-middle::before {
  background-position: 60% -76.606432vw;
  mask-image: none;
}
body.reference-home .desk-scene-lower { height: max(350px, 86.959vw); }
body.reference-home .desk-scene-lower::before {
  background-position: 60% calc(40px - 120.085758vw);
  inset: -40px 0 0;
  mask-image: none;
}
/* Preserve readable live content on smaller screens. The hero is a close camera
   crop; the middle and lower windows retain the same complete-object framing. */
@media (max-width: 1100px) {
  body.reference-home::before {
    background-size: 1536px auto;
    background-position: -138px top;
    mask-image: linear-gradient(to bottom, #000 0, #000 990px, transparent 1000px);
  }
  body.reference-home .header { left: auto; top: auto; width: calc(100% - 40px); }
  body.reference-home .header .reference-wordmark { font-size: 29px; }
  body.reference-home .ea-header-tools { margin-left: auto; }
  body.reference-home .hero.shell { height: auto; }
  body.reference-home .hero-copy { left: auto; top: auto; width: 100%; }
  body.reference-home .hero h1 { font-size: clamp(51px, 9.2vw, 75px); margin: 23px 0 20px; }
  body.reference-home:lang(uk) .hero h1 { font-size: clamp(44px, 8.2vw, 64px); }
  body.reference-home .hero-copy .lead { font-size: 21px; }
  body.reference-home .hero .actions { gap: 12px; margin-top: 25px; }
  body.reference-home .hero .actions .button,
  body.reference-home .hero .actions > .text-link:nth-child(2) { min-height: 46px; padding: 11px 20px; font-size: 13px; }
  body.reference-home .hero-media { top: auto; left: auto; width: calc(100% - 10px); }
  body.reference-home .desk-scene-middle { height: 46.585vw; }
  body.reference-home .desk-scene-lower { height: 86.959vw; }
  body.reference-home .collage-proof { padding-left: 35px; }
}
@media (max-width: 420px) {
  body.reference-home .header { width: calc(100% - 30px); }
  body.reference-home .header .reference-wordmark { font-size: 27px; }
  body.reference-home .hero h1 { font-size: 12.2vw; }
  body.reference-home:lang(uk) .hero h1 { font-size: 11.3vw; }
  body.reference-home .hero-copy .lead { font-size: 19px; }
}
/* Fit live content inside the existing photographed sheets, not their bounding
   boxes: leave room for the curled corner, sloping edges and gallery controls.
   Keep the approved bitmap and camera crop untouched when adjusting copy. */
body.reference-home .hero-media .gallery-slide { opacity: 0; }
body.reference-home .hero-media .gallery-slide.is-active,
body.reference-home .hero-media .gallery-frame:not(.is-ready) .gallery-slide:first-child { opacity: 1; }
@media (min-width: 1101px) {
  body.reference-home .header { left: 33.8%; width: 40%; }
  body.reference-home .hero-copy { left: 20%; top: 10.1vw; width: 24%; }
  body.reference-home .hero h1 { font-size: 4.5vw; line-height: .92; margin: 1.1vw 0 1.3vw; }
  body.reference-home:lang(uk) .hero h1 { font-size: 3.85vw; }
  body.reference-home .hero-copy .lead { font-size: 1.35vw; line-height: 1.35; }
  body.reference-home .hero .actions { gap: .65vw; margin-top: 1.4vw; }
  body.reference-home .hero .actions .button,
  body.reference-home .hero .actions > .text-link:nth-child(2) { padding: .6vw .85vw; font-size: .9vw; }
  body.reference-home .hero-media { left: 55.4%; top: 8.9vw; width: 30%; }
  body.reference-home .hero-media .gallery { box-shadow: none; }
  body.reference-home .hero-media .gallery-frame { box-shadow: 0 1px 4px #251a122b; }
  body.reference-home .hero-media .gallery-controls {
    position: static;
    transform: none;
    margin: 5px auto 0;
    background: transparent;
    box-shadow: none;
  }
  body.reference-home .hero-media .plugin-details-button { top: -24px; min-height: 20px; }
}
/* A native sticky photograph scrolls in the same browser frame as its text.
   No scroll handlers, top updates or repainting giant fixed backgrounds.
   Once its lower edge meets the viewport, the photograph remains behind paper. */
/* The decorative meter script must not remove a scrollbar after first paint
   and change the viewport-relative registration of the photographed sheets. */
html:has(body.reference-home) { scrollbar-width: none; }
html:has(body.reference-home)::-webkit-scrollbar { width: 0; height: 0; }
html body.reference-home {
  background-image: none;
  --scene-height: 209.49464vw;
  --section-breath: clamp(112px, 11vw, 176px);
}
html body.reference-home::before,
html body.reference-home::after { display: none; }
body.reference-home .desk-backdrop {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  /* A tall photograph must not create scrollable overflow after the footer
     when the audio panel is closed or a wide display makes the photo taller. */
  overflow: clip;
}
body.reference-home .desk-photograph {
  position: sticky;
  top: min(0px, calc(100vh - var(--scene-height)));
  width: 100%;
  height: var(--scene-height);
  background: var(--reference-scene) 60% top / var(--scene-camera-size) no-repeat;
}
html body.reference-home .desk-scene-middle,
html body.reference-home .desk-scene-lower { display: none; }
/* Consistent visible desk space between foreground sheets, including their
   20px deckled overhang. Keep independent section margins from collapsing. */
html body.reference-home .desk-examples {
  margin: clamp(72px, 7vw, 112px) 0 var(--section-breath);
}
html body.reference-home .home-story { margin: 0 auto var(--section-breath); }
html body.reference-home #availability.section.shell { margin: 0 0 var(--section-breath); }
html body.reference-home .hero-media .gallery-frame { transform: none; }
@media (max-width: 1100px) {
  html body.reference-home { --scene-height: 2736px; }
  body.reference-home .desk-photograph { background-size: 1536px auto; background-position: -138px top; }
}
@media (max-width: 760px) {
  html body.reference-home { --section-breath: 96px; }
}

/* Foreground-only paper finish. Keep all photograph pixels and light intact. */
html body.reference-home .home-story {
  isolation: isolate;
  border: 0;
  background: none;
  box-shadow: none;
}
html body.reference-home .home-story::before {
  content: '';
  position: absolute;
  inset: -12px -1px;
  z-index: -1;
  border: solid transparent;
  border-width: 24px 0;
  border-image: var(--foreground-paper-edge) 150 0 150 0 / 24px 0 / 0 stretch;
  background: #f3e4c6 var(--foreground-paper-tile) center / 560px auto repeat;
  background-clip: padding-box;
  filter: drop-shadow(0 2px 2px #543e2630) drop-shadow(0 10px 12px #583c2838);
  pointer-events: none;
}
html body.reference-home .footer {
  margin-bottom: 0;
  border-bottom: 0;
}
html body.reference-home .footer::before {
  content: '';
  position: absolute;
  inset: -20px 0 0;
  z-index: -1;
  border: solid transparent;
  border-width: 30px 0 0;
  border-image-source: var(--foreground-paper-edge);
  border-image-slice: 150 0 0 0;
  border-image-width: 30px 0 0;
  background: #f3e4c6 var(--foreground-paper-tile) center / 560px auto repeat;
  background-clip: padding-box;
  pointer-events: none;
}
@media (min-width: 1101px) {
  html body.reference-home .header { top: 2.65vw; }
  html body.reference-home .hero-media .plugin-details-button {
    top: -21px;
    right: 12px;
  }
}

/* The transparent full-width hero must never intercept header navigation. */
html body.reference-home .header { z-index: 30; }

/* One paper material, with the old edge artwork used ONLY as an alpha mask.
   There is no separate coloured border strip to meet the centre texture. */
html body.reference-home .desk-examples::before,
html body.reference-home #availability.section.shell::before,
html body.reference-home .home-story::before,
html body.reference-home .footer::before {
  border: 0;
  border-image: none;
  background: #f3e4c6 var(--foreground-paper-tile) center top / 560px auto repeat;
  background-clip: border-box;
  -webkit-mask-box-image-source: var(--foreground-paper-edge);
  -webkit-mask-box-image-slice: 150 0 150 0 fill;
  -webkit-mask-box-image-width: 30px 0;
  -webkit-mask-box-image-repeat: stretch;
}
html body.reference-home .footer { background: none; }
html body.reference-home .footer::before {
  -webkit-mask-box-image-slice: 150 0 0 0 fill;
  -webkit-mask-box-image-width: 30px 0 0;
}
html body.reference-home .audio-examples-content { border-top: 0; }
html body.reference-home .audio-examples > summary { border: 0; box-shadow: none; }
@supports not (-webkit-mask-box-image-source: none) {
  html body.reference-home .desk-examples::before,
  html body.reference-home #availability.section.shell::before,
  html body.reference-home .home-story::before {
    clip-path: polygon(0 .6%,8% .2%,19% .5%,31% 0,47% .5%,61% .1%,77% .5%,91% 0,100% .4%,100% 99.6%,88% 100%,72% 99.5%,54% 99.9%,37% 99.5%,21% 100%,8% 99.6%,0 100%);
  }
}
