/*
 * Public site. Design language from example/construction/index.html:
 * black, local Inter, full-bleed photos with black fog at the edges,
 * the white-wordmark logo on the photo, pill buttons, text shadows.
 * Public pages ship no JavaScript; interactive bits use <details> and CSS only.
 */

/* Inter (variable, weights 400–700), served locally. SIL Open Font License. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/inter-latin-ext-65edaaef.woff2") format("woff2");
  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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/inter-latin-1f021a24.woff2") format("woff2");
  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;
}

:root {
  --bg: #000;
  --surface: #111113;
  --surface-2: #1c1c1e;
  --line: #2c2c2e;
  --text: #f5f5f7;
  --text-2: #d2d2d7;
  --text-3: #86868b;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --radius: 22px;
  --wide: 1200px;
  --narrow: 760px;
  --shadow-text: 0 1px 3px rgba(0, 0, 0, .85), 0 2px 18px rgba(0, 0, 0, .7);
}

* { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 64px; }
body {
  background: var(--bg);
  color: var(--text);
  font: 17px/1.47 var(--font);
  letter-spacing: -0.022em;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; border-radius: 4px; }

.container { width: min(var(--wide), 100% - 32px); margin-inline: auto; }
.container-narrow { width: min(var(--narrow), 100% - 32px); margin-inline: auto; }

/* ---------- Type ---------- */
.eyebrow { display: block; font-size: 14px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--text-3); }
.headline { font-size: clamp(32px, 5vw, 56px); font-weight: 700; line-height: 1.07; letter-spacing: -0.015em; text-wrap: balance; }
.lead { font-size: clamp(17px, 2vw, 21px); color: var(--text-2); text-wrap: balance; }
.section-head { text-align: center; margin-bottom: 48px; }
.section-head .headline { margin-top: 8px; }
.section-head .lead { margin-top: 14px; }
.muted { color: var(--text-3); }

/* ---------- Buttons (from construction page) ---------- */
.buttons { display: flex; flex-wrap: wrap; gap: 14px; }
.buttons-center { justify-content: center; }
.button {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 22px; border: 0; border-radius: 980px;
  background: var(--text); color: #000;
  font: inherit; text-decoration: none; cursor: pointer;
  transition: background-color .2s, color .2s;
}
.button:hover { background: #fff; }
.button svg { flex: none; }
.button-outline {
  background: rgba(0, 0, 0, .45);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  color: var(--text); box-shadow: inset 0 0 0 1px var(--text);
}
.button-outline:hover { background: var(--text); color: #000; }
.button-small { padding: 6px 14px; font-size: 14px; }
.link-arrow { color: var(--text); font-weight: 600; text-decoration: none; }
.link-arrow::after { content: " ›"; }
.link-arrow:hover { text-decoration: underline; }

/* Blur-up: a photo's inlined, blurred tiny version (style="--placeholder: url("...")", set by
   site_image_tag) shows under it at once, until the photo itself covers it. No JavaScript. */
img { background: var(--placeholder, none) center / cover no-repeat; }

/* ---------- Photo with black fog (from construction page) ---------- */
.photo-fog {
  background:
    radial-gradient(ellipse 70% 45% at 50% 50%, rgba(0, 0, 0, .45), rgba(0, 0, 0, 0)),
    linear-gradient(180deg,
      #000 0%, rgba(0, 0, 0, .85) 5%, rgba(0, 0, 0, .6) 10%, rgba(0, 0, 0, .38) 15%, rgba(0, 0, 0, .25) 20%,
      rgba(0, 0, 0, .25) 80%, rgba(0, 0, 0, .38) 85%, rgba(0, 0, 0, .6) 90%, rgba(0, 0, 0, .85) 95%, #000 100%),
    var(--photo) var(--photo-position, center 60%) / cover no-repeat,
    var(--photo-placeholder, none) var(--photo-position, center 60%) / cover no-repeat,
    linear-gradient(180deg, #2c2c2e, var(--bg));
  background-color: var(--bg);
}
.photo-fog :is(h1, h2, .lead, .eyebrow) { text-shadow: var(--shadow-text); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(0, 0, 0, .72);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.site-header .container { display: flex; align-items: center; gap: 24px; height: 56px; }
.site-header .brand img { width: 108px; }
.site-nav { display: flex; gap: 22px; margin-left: auto; }
.site-nav a { font-size: 14px; color: var(--text-2); text-decoration: none; }
.site-nav a:hover { color: #fff; }
.menu { display: none; margin-left: auto; }
.menu summary { list-style: none; cursor: pointer; padding: 6px 0; font-size: 14px; color: var(--text-2); }
.menu summary::-webkit-details-marker { display: none; }
.menu nav { position: absolute; inset: 56px 0 auto; padding: 8px 16px 20px; background: rgba(0, 0, 0, .94); border-bottom: 1px solid var(--line); }
.menu nav a { display: block; padding: 12px 0; border-bottom: 1px solid var(--line); text-decoration: none; font-size: 20px; font-weight: 600; }
@media (max-width: 860px) {
  .site-nav, .site-header .header-cta { display: none; }
  .menu { display: block; }
}

/* ---------- Hero ---------- */
.hero { position: relative; isolation: isolate; min-height: calc(100svh - 56px); display: grid; place-items: center; padding: 64px 16px; text-align: center; }
.hero-inner { max-width: 680px; }
.hero .logo { margin: 0 auto; width: min(300px, 62vw); filter: drop-shadow(0 4px 18px rgba(0, 0, 0, .7)); }
.hero h1 { margin-top: 44px; }
.hero h1 .eyebrow { margin-bottom: 14px; color: var(--text-2); }
.hero .lead { margin-top: 14px; }
.hero .buttons { margin-top: 32px; }
@media (max-height: 500px) and (orientation: landscape) {
  .hero .logo { width: 200px; }
  .hero h1 { margin-top: 20px; }
}

/* ---------- Sections ----------
 * The page reads like a film in chapters: photo chapters (one image emerging from black,
 * text laid over it) alternate with quiet typographic interludes on pure black.
 * No cards, boxes or dividing lines: black and space separate the sections.
 */

/* Interlude: pure black, narrow, lots of air */
.interlude { padding-block: clamp(80px, 10vw, 140px); text-align: center; }
.interlude-head { margin-bottom: 56px; }
.interlude-head .headline { margin-top: 10px; }
.interlude-foot { margin-top: 40px; color: var(--text-3); font-size: 15px; }
.interlude-foot .link-arrow { margin-left: 6px; }
.eyebrow { letter-spacing: .14em; font-size: 12px; }

/* Manifesto */
.statement {
  margin-top: 28px;
  font-size: clamp(26px, 3.4vw, 40px); font-weight: 500; line-height: 1.25; letter-spacing: -0.02em;
  color: var(--text); text-wrap: balance;
}
.signature { margin-top: 28px; color: var(--text-3); font-size: 15px; }

/* Chapter: a photo emerging from black on one side, text on the black beside it,
   slightly overlapping the faded edge. Alternates sides (chapter-left / chapter-right = text side). */
.chapter {
  display: grid; grid-template-columns: repeat(12, 1fr); align-items: center;
  width: min(1320px, 100%); margin-inline: auto; padding-block: clamp(32px, 5vw, 64px);
}
/* The photo dissolves into black on all four sides with no visible shape:
   two long fades (44% of each side, horizontal x vertical) multiplied together, each with an eased curve
   instead of a linear ramp, so there is no edge, oval or banding where the photo begins. */
.chapter-photo {
  --fade: transparent 0.0%, rgba(0, 0, 0, 0.02) 3.1%, rgba(0, 0, 0, 0.06) 6.3%, rgba(0, 0, 0, 0.13) 9.4%, rgba(0, 0, 0, 0.22) 12.6%,
          rgba(0, 0, 0, 0.33) 15.7%, rgba(0, 0, 0, 0.45) 18.9%, rgba(0, 0, 0, 0.57) 22.0%, rgba(0, 0, 0, 0.68) 25.1%, rgba(0, 0, 0, 0.78) 28.3%,
          rgba(0, 0, 0, 0.86) 31.4%, rgba(0, 0, 0, 0.92) 34.6%, rgba(0, 0, 0, 0.96) 37.7%, rgba(0, 0, 0, 0.99) 40.9%, #000 44.0%,
          #000 56.0%, rgba(0, 0, 0, 0.99) 59.1%, rgba(0, 0, 0, 0.96) 62.3%, rgba(0, 0, 0, 0.92) 65.4%, rgba(0, 0, 0, 0.86) 68.6%,
          rgba(0, 0, 0, 0.78) 71.7%, rgba(0, 0, 0, 0.68) 74.9%, rgba(0, 0, 0, 0.57) 78.0%, rgba(0, 0, 0, 0.45) 81.1%, rgba(0, 0, 0, 0.33) 84.3%,
          rgba(0, 0, 0, 0.22) 87.4%, rgba(0, 0, 0, 0.13) 90.6%, rgba(0, 0, 0, 0.06) 93.7%, rgba(0, 0, 0, 0.02) 96.9%, transparent 100.0%;
  grid-row: 1; grid-column: 5 / 13; width: 100%; aspect-ratio: 3 / 2; object-fit: cover;
  -webkit-mask-image: linear-gradient(90deg, var(--fade)), linear-gradient(180deg, var(--fade));
  -webkit-mask-composite: source-in;
          mask-image: linear-gradient(90deg, var(--fade)), linear-gradient(180deg, var(--fade));
          mask-composite: intersect;
}
/* Inline padding lines the text up with the header container (1200px inside the 1320px chapter). */
.chapter-text { grid-row: 1; grid-column: 1 / 6; position: relative; z-index: 1; padding-left: max(16px, (min(1320px, 100vw) - var(--wide)) / 2); }
.chapter-right .chapter-photo { grid-column: 1 / 9; }
.chapter-right .chapter-text { grid-column: 8 / 13; padding: 0 max(16px, (min(1320px, 100vw) - var(--wide)) / 2) 0 0; }
.chapter-text :is(.headline, .lead, .eyebrow) { text-shadow: var(--shadow-text); }
.chapter-text .headline { margin-top: 10px; font-size: clamp(30px, 3.6vw, 46px); }
.chapter-text .lead { margin-top: 16px; font-size: 18px; }
.chapter-text .buttons { margin-top: 28px; }
.chapter .eyebrow { color: var(--text-2); }
@media (max-width: 860px) {
  .chapter { grid-template-columns: 1fr; }
  .chapter-photo, .chapter-right .chapter-photo { grid-column: 1; }
  .chapter-text, .chapter-right .chapter-text { grid-row: 2; grid-column: 1; margin-top: -40px; padding: 0 16px; text-align: center; }
  .chapter-text .buttons { justify-content: center; }
}

/* Price list: typographic, hairlines only */
.pricelist { list-style: none; padding: 0; text-align: left; }
.pricelist li { border-top: 1px solid var(--line); }
.pricelist li:last-child { border-bottom: 1px solid var(--line); }
.pricelist :is(a, .pricelist-row) {
  display: flex; align-items: baseline; justify-content: space-between; gap: 24px;
  padding: 22px 4px; text-decoration: none; transition: padding .3s;
}
.pricelist a:hover { padding-inline: 12px 4px; }
.pricelist-name { font-size: 19px; font-weight: 600; letter-spacing: -0.01em; }
.pricelist-name small { display: block; margin-top: 2px; font-size: 15px; font-weight: 400; color: var(--text-3); }
.pricelist-price { flex: none; color: var(--text-2); font-variant-numeric: tabular-nums; }

/* One review, large and calm */
.quote blockquote {
  font-size: clamp(24px, 3vw, 34px); font-weight: 500; line-height: 1.3; letter-spacing: -0.02em; text-wrap: balance;
}
.quote blockquote::before { content: "„"; }
.quote blockquote::after { content: "”"; }
.quote figcaption { margin-top: 24px; color: var(--text-3); font-size: 15px; }
.quote figcaption::before { content: "— "; }

/* Several reviews in a row, scrolled sideways (sections/_reviews). Cards snap into place;
   the next one peeks in at the edge, so it's clear there is more. No JS. */
.reviews {
  width: min(var(--wide), 100%); margin-inline: auto;
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory;
  scroll-padding-inline: 16px; scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}
.reviews:focus-visible { outline-offset: -2px; }
.reviews-track { display: flex; gap: 16px; padding: 0 16px 20px; list-style: none; }
.reviews-track li { flex: 0 0 min(400px, 84%); scroll-snap-align: start; display: flex; }
.review-card {
  display: flex; flex-direction: column; justify-content: space-between; gap: 24px; width: 100%;
  padding: 32px 28px; border-radius: var(--radius); background: var(--surface); text-align: left;
}
.review-card blockquote { font-size: 19px; line-height: 1.5; color: var(--text); }
.review-card blockquote::before { content: "„"; }
.review-card blockquote::after { content: "”"; }
.review-card figcaption { color: var(--text-3); font-size: 15px; }
.review-card figcaption::before { content: "— "; }

/* The ‹ › buttons (public/reviews.js): small, round, over the row's edges, outside it on wide
   screens. Not on phones, where the row is swiped. Once they work, the scrollbar goes. */
.reviews-row { position: relative; width: min(var(--wide), 100%); margin-inline: auto; }
.reviews-arrow {
  position: absolute; top: calc(50% - 10px); translate: 0 -50%; z-index: 1;
  width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%;
  background: rgba(28, 28, 30, .9); color: var(--text); font: 400 24px/1 var(--font); cursor: pointer;
  transition: opacity .2s, background-color .2s;
}
.reviews-arrow:hover { background: var(--surface-2); }
.reviews-arrow:disabled { opacity: 0; pointer-events: none; }
.reviews-arrow[hidden] { display: none; }
.reviews-arrow-prev { left: 8px; }
.reviews-arrow-next { right: 8px; }
@media (min-width: 1320px) { .reviews-arrow-prev { left: -52px; } .reviews-arrow-next { right: -52px; } }
@media (max-width: 640px) { .reviews-arrow { display: none; } }
@media (min-width: 641px) {
  .reviews-arrows .reviews { scrollbar-width: none; }
  .reviews-arrows .reviews::-webkit-scrollbar { display: none; }
}

/* FAQ: <details> accordion */
.faq { text-align: left; }
.faq details { border-bottom: 1px solid var(--line); }
.faq details:first-child { border-top: 1px solid var(--line); }
.faq summary {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 22px 4px; cursor: pointer; list-style: none;
  font-size: 19px; font-weight: 600;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex: none; font-weight: 400; font-size: 24px; line-height: 1; color: var(--text-3); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .answer { padding: 0 4px 24px; color: var(--text-2); }
.faq .answer.prose { font-size: inherit; } /* rich text answers: prose spacing and links, but the FAQ's own size */
.faq .answer.prose :is(h2, h3) { margin-top: 1.2em; font-size: 1.1em; }

/* Contact */
.interlude-contact .headline { margin-top: 10px; }
.interlude-contact .lead { margin-top: 14px; }
.interlude-contact .buttons { margin-top: 32px; }
.addresses { margin-top: 56px; display: flex; justify-content: center; gap: clamp(32px, 8vw, 96px); font-style: normal; color: var(--text-2); font-size: 15px; }
.addresses strong { display: block; margin-bottom: 6px; color: var(--text); font-size: 17px; }
.addresses .link-arrow { display: inline-block; margin-top: 6px; }

/* Price tables (/cennik/): a run of quieter interludes */
.interlude-tight { padding-block: clamp(40px, 5vw, 64px); }
.price-table-head { margin-bottom: 20px; text-align: left; }
.price-table-head h2 { margin-top: 6px; font-size: clamp(24px, 3vw, 32px); font-weight: 700; letter-spacing: -0.015em; }
.price-table-note { margin-top: 20px; text-align: left; color: var(--text-3); font-size: 15px; }
.price-table-note p + p { margin-top: .6em; }

/* Price list category headings (grouped lists, e.g. /realizacje/) */
.pricelist-group { margin: 56px 0 8px; text-align: left; font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
.pricelist-group:first-child { margin-top: 0; }
.service-meta { margin-top: 18px; color: var(--text-2); font-weight: 600; text-shadow: var(--shadow-text); }

/* Rich text from the CMS (Action Text): quiet editorial typography on black */
.interlude-text { text-align: left; }
.interlude-text .interlude-head { text-align: center; }
.prose { color: var(--text-2); font-size: 18px; line-height: 1.65; }
.prose > * + *, .prose .trix-content > * + * { margin-top: 1.1em; }
.prose :is(h2, h3) { color: var(--text); margin-top: 2em; line-height: 1.2; letter-spacing: -0.015em; }
.prose h2 { font-size: clamp(24px, 3vw, 32px); }
.prose h3 { font-size: 21px; }
.prose strong { color: var(--text); font-weight: 600; }
.prose a { color: var(--text); text-underline-offset: 3px; }
.prose :is(ul, ol) { padding-left: 1.3em; }
.prose li + li { margin-top: .4em; }
.prose blockquote { padding-left: 20px; border-left: 2px solid var(--line); color: var(--text); font-style: italic; }
.prose table { width: 100%; border-collapse: collapse; font-size: 16px; }
.prose :is(th, td) { padding: 14px 4px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose th { color: var(--text-3); font-size: 13px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.prose td:last-child, .prose th:last-child { text-align: right; white-space: nowrap; padding-left: 16px; }
.prose small { display: block; color: var(--text-3); font-size: 14px; }
.prose p:empty { display: none; } /* the editor wraps photos in <p>, which leaves empty paragraphs */
.prose figure img { width: 100%; border-radius: 4px; }
.prose figcaption { margin-top: 8px; color: var(--text-3); font-size: 14px; text-align: center; }

/* ---------- Public forms (contact, Safety Box order): no JavaScript ---------- */
.interlude-form .interlude-head { margin-bottom: 40px; }
.form { display: grid; gap: 22px; text-align: left; }
.form fieldset { display: grid; gap: 18px; margin: 0; padding: 0; border: 0; }
.form legend { margin-bottom: 14px; padding: 0; font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form .row-postal { grid-template-columns: 1fr 2fr; }
@media (max-width: 560px) { .form .row, .form .row-postal { grid-template-columns: 1fr; } }
.field { display: grid; gap: 8px; align-content: start; }
.field label { font-size: 14px; color: var(--text-2); }
.field .req { color: var(--text-3); }
.field :is(input, textarea, select) {
  width: 100%; padding: 13px 15px; border: 1px solid var(--line); border-radius: 12px;
  background: #0b0b0c; color: var(--text); font: inherit; font-size: 16px; /* 16px: no zoom on iOS */
  transition: border-color .2s, background-color .2s;
}
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
  background-position: calc(100% - 20px) 55%, calc(100% - 15px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 40px; }
.field :is(input, textarea, select):focus { outline: none; border-color: var(--text-2); background-color: #000; }
.field textarea { resize: vertical; min-height: 140px; }
.field-invalid :is(input, textarea, select) { border-color: #d48cb8; }
.field-error { color: #e7b3d3; font-size: 14px; }
.field-hint { color: var(--text-3); font-size: 13px; }
.form-either { margin-top: -12px; }
.form-alert { padding: 14px 18px; border-radius: 12px; background: rgba(138, 43, 98, .18); border: 1px solid rgba(212, 140, 184, .35); color: var(--text); font-size: 15px; }
.choices { display: flex; flex-wrap: wrap; gap: 10px; }
.choice { position: relative; cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span { display: inline-block; padding: 10px 18px; border-radius: 980px; box-shadow: inset 0 0 0 1px var(--line); color: var(--text-2); transition: box-shadow .2s, color .2s, background-color .2s; }
.choice:hover span { box-shadow: inset 0 0 0 1px var(--text-3); }
.choice input:checked + span { background: var(--text); color: #000; box-shadow: none; }
.choice input:focus-visible + span { outline: 2px solid var(--text); outline-offset: 3px; }
.form-actions { margin-top: 6px; }
.form .button:disabled { opacity: .55; cursor: default; }
.form-alert:focus { outline: none; }
.form-alert a { color: inherit; }
.form-note { color: var(--text-3); font-size: 13px; line-height: 1.5; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Divider ----------
   A hairline fading out at both ends, so it has no hard edge. Used above the footer and by the
   "Linia oddzielająca" section. The sections around it already bring the space, so it adds none. */
.divider {
  height: 1px; margin: 0; border: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .14) 20%, rgba(255, 255, 255, .14) 80%, transparent);
}

/* ---------- Footer ---------- */
.site-footer { padding-block: 0 40px; background: var(--bg); color: var(--text-3); font-size: 13px; }
.site-footer .divider { margin-bottom: 56px; }
.footer-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 32px; }
.footer-top img { width: 140px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.footer-nav a { color: var(--text-2); text-decoration: none; }
.footer-nav a:hover { color: #fff; }
.footer-bottom { margin-top: 56px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .pricelist a { transition: none; }
}

/* ---------- Scroll effect: photos emerge from black and sink back into it ----------
 * Pure CSS scroll-driven animations (no JavaScript): each animation's progress is tied to
 * where its section sits in the viewport. Browsers without support (or with reduced
 * motion turned on) simply show the photos as they are.
 */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    /* Chapter photo: dark and slightly enlarged at the screen edges, fully lit in the middle. */
    .chapter-photo {
      animation: emerge-from-black linear both;
      animation-timeline: view();
      animation-range: cover 0% cover 100%;
    }
    /* Linear on purpose: opacity follows the scroll position 1:1. Eased curves (cubic, expo)
       were tried and felt worse. */
    @keyframes emerge-from-black {
      0%   { opacity: 0; filter: brightness(.25); transform: scale(1.04); }
      35%  { opacity: 1; filter: brightness(1);   transform: scale(1); }
      65%  { opacity: 1; filter: brightness(1);   transform: scale(1); }
      100% { opacity: 0; filter: brightness(.25); transform: scale(1.02); }
    }

    /* Hero: a black veil rises over the photo as the hero scrolls away. */
    .hero::after {
      content: ""; position: absolute; inset: 0; z-index: -1;
      background: #000; opacity: 0; pointer-events: none;
      animation: sink-into-black linear both;
      animation-timeline: view();
      animation-range: exit 0% exit 90%;
    }
    @keyframes sink-into-black { to { opacity: 1; } }
  }
}
