/* ==========================================================================
   Motion layer - the editorial pages only
   ==========================================================================
   Home, Our Story and its chapters, Visit, Private Tastings, Wine Club, News,
   the Journal and the Gallery load this file and js/motion.js. The shop, the
   product pages, the cart, checkout and the account pages never do (Jana,
   2026-10-27: "dont change ANYTHING on the shop page"), so nothing here can
   reach them - including the cursor, which she scoped to these pages too.

   Every hidden-until-revealed state is scoped to html.knk-motion, which
   js/motion.js adds only when the visitor has not asked for reduced motion.
   No script, or reduced motion, and the page is exactly the page underneath.

   Durations follow the 100/300/500 rule for feedback; entrances are longer
   on purpose (this is the brand register: the reveal IS the voice). */

:root {
  --m-expo:  cubic-bezier(.16, 1, .3, 1);
  --m-quart: cubic-bezier(.25, 1, .5, 1);
}

/* ---- The cursor: the ten-ball pyramid off the label ----------------------
   Back at Jana's request, 26 Nov 2026 (it was taken out on 5 Nov). The
   estate's own mark (kanonkop.co.za's favicon, and the stack at the foot of
   every bottle label). Ash Grey at rest, Ribbon Red over anything you can
   press, the I-beam kept in text fields. Mouse and trackpad only - a phone
   has no cursor to replace. The apex is the hotspot: it points like an arrow.
   The PNG pair after the SVG line wins where the browser takes image-set(),
   which keeps the mark crisp on a retina screen. Only the pages that load
   this file get it, so the shop keeps the normal pointer. */
@media (hover: hover) and (pointer: fine) {
  html {
    cursor: url(../assets/img/motion/cursor.svg) 16 1, auto;
    cursor: -webkit-image-set(url(../assets/img/motion/cursor.png) 1x, url(../assets/img/motion/cursor@2x.png) 2x) 16 1, auto;
    cursor: image-set(url(../assets/img/motion/cursor.png) 1x, url(../assets/img/motion/cursor@2x.png) 2x) 16 1, auto;
  }
  a, button, summary, label, select, [role="button"], [role="tab"], .btn, .photo-tile, .gal-item, .m-gun {
    cursor: url(../assets/img/motion/cursor-link.svg) 16 1, pointer;
    cursor: -webkit-image-set(url(../assets/img/motion/cursor-link.png) 1x, url(../assets/img/motion/cursor-link@2x.png) 2x) 16 1, pointer;
    cursor: image-set(url(../assets/img/motion/cursor-link.png) 1x, url(../assets/img/motion/cursor-link@2x.png) 2x) 16 1, pointer;
  }
  input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]),
  textarea, [contenteditable="true"] { cursor: text; }
  :disabled, [aria-disabled="true"] { cursor: not-allowed; }
}

/* ---- The logo's room in the scrolled bar ---------------------------------
   Kanonkop, 24 Nov 2026 ("logo spacing"): once the header turns into the
   cream bar, the lockup filled it with 6px above and below, and WINE ESTATE
   all but touched the rule under it. The bar keeps its height; the logo is
   drawn a little smaller inside it, so it has about 12px of air each side.
   The top-of-page header is unchanged. Editorial pages only, like everything
   in this file: the shop's header is styles.css and is left alone. */
:root { --logo-h-scrolled: 64px; --header-pad-scrolled: .775rem; }
@media (max-width: 1000px) { :root { --logo-h-scrolled: 58px; --header-pad-scrolled: .7125rem; } }
@media (max-width: 620px)  { :root { --logo-h-scrolled: 48px; --header-pad-scrolled: .525rem; } }

/* ---- Spacing pass, 26 Nov 2026 (Kanonkop: "a spacing check across the site")
   Two grey bands back to back (Our Story: The Legends, then Taste the result)
   added their paddings into some 230px of empty grey; the second band now
   starts at its content, so the two read as one band with a pause, not a
   hole. On the home page the wine cards keep two lines for every name so a
   row of four lines up; one card to a row on a phone, a one-line name left
   an empty line above "First vintage". */
.section-lg.dark + .section-lg.dark, .section.dark + .section.dark { padding-top: 0; }
@media (max-width: 560px) { #home-wines .wine-card .info h3 { min-height: 0; } }

/* ---- No line below the logo (Jana, 26 Nov 2026) ---------------------------
   Once the header turns into the cream bar it carried a hairline rule along
   its foot, right under the logo. It goes: the bar's own cream and blur set it
   apart from the page. (With the menu open the drawer keeps its rule, from
   styles.css.) The home hero's scroll hint, a short line at the foot of the
   photograph straight below the logo, went too (index.html). */
.site-header, .site-header.scrolled { box-shadow: none; }

/* ---- Journal cards: room under the photograph ------------------------------
   On the home page and the Journal the category sat against the photograph
   and the title ran straight into the summary. */
.journal-card .body { padding-top: var(--space-2); }
.journal-card .date { display: block; font-size: var(--fs-micro); font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--gold-text); }
.journal-card h3 { margin: .4rem 0 .5rem; }

/* ---- Buttons: one size and one alignment (Jana, 30 Nov 2026) --------------
   "Amend all buttons to be the same alignment / sizes". Every button already
   has the same height; where buttons stand together they now share a width
   too. A .btn-set holds them: each takes the width of the widest, side by
   side (or one above the other with .is-stacked, in a half-width column),
   left-aligned unless .is-centered. On a phone every button is the width of
   its column, with a little less padding and tracking so the labels keep to
   one line where they can. The :not(#m-*) only raises these rules above the
   pages' own, as elsewhere in this file. */
.btn-set:not(#m-set) {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: var(--space-2);
  width: max-content; max-width: 100%; justify-content: start; align-items: stretch;
}
.btn-set:not(#m-set) > .btn { margin: 0; }
.btn-set.is-stacked:not(#m-set) { grid-auto-flow: row; grid-auto-rows: 1fr; }
.btn-set.is-centered:not(#m-set) { margin-inline: auto; }
@media (max-width: 600px) {
  :is(main, body > section) .btn:not(#m-btn):not(.hist-card .btn) {
    display: flex; width: 100%; padding-inline: 1.2em; letter-spacing: .1em; text-wrap: balance;
  }
  .btn-set:not(#m-set) { grid-auto-flow: row; grid-auto-rows: 1fr; width: 100%; }
}

/* ---- Key figures on one line (Jana, 30 Nov 2026) ---------------------------
   "180–365 m" broke after the number, leaving the m on a line of its own. The
   figures keep to one line and are a little smaller, which is what the
   longest needs to fit its column at every width (checked from 1440 down to
   320); all four stay the same size. */
.stat .num { white-space: nowrap; font-size: clamp(2.1rem, 4.2vw, 3.6rem); }
@media (max-width: 800px) { .stat .num { font-size: clamp(1.75rem, 8.6vw, 2.4rem); } }

/* ---- Dark bands are Ash Grey ----------------------------------------------
   The estate, 4 Nov 2026: "change the black to the ash grey we use. The black
   is too abrupt and not on brand. The grey sticks to vintage and the Kanonkop
   website of old." Flat, as on the old site. Cream text clears AA on it
   (4.9:1); the gold that styles.css gives labels, leads, numbers and the gold
   button on black does not (2-3:1), so on grey they are cream as well. */
.dark { background: var(--ash-grey); }
.dark .eyebrow, .dark .lead, .dark .stat .num, .dark .btn-gold { color: var(--parchment); }
.dark .stat .label, .dark .small-note { color: rgba(255, 252, 223, .85); }
.dark .btn-gold:hover { background: var(--parchment); border-color: var(--parchment); color: var(--ink); }

/* ---- Buttons: red, see-through on hover ------------------------------------
   Wiam, 20 Nov 2026: "keep the buttons red, and make them see through when
   you hover on them. Essentially inverting the interface as it is currently."
   Jana, 23 Nov: on the editorial pages only - this file never reaches the
   shop, which keeps its own buttons. Every kind (outline, solid, light, gold)
   is filled Ribbon Red; under the pointer it empties to its outline: red on
   the cream, cream on the grey bands and over photographs. The :not(#m-btn)
   (no element has that id) only lifts these rules above styles.css's own
   button rules, the way !important would but without its side effects. */
.btn:not(#m-btn) { background: var(--maroon); border-color: var(--maroon); color: var(--parchment); }
.btn:not(#m-btn):hover:not(:disabled),
.btn:not(#m-btn):focus-visible { background: transparent; border-color: var(--maroon); color: var(--maroon); }
:is(.dark, .dark-soft, .hero, .maroon-bg) .btn:not(#m-btn):hover:not(:disabled),
:is(.dark, .dark-soft, .hero, .maroon-bg) .btn:not(#m-btn):focus-visible { border-color: var(--parchment); color: var(--parchment); }

/* ---- One spacing rhythm on every editorial page (4 Nov 2026) ---------------
   Two section sizes: .section-lg for content (104px a side on a desktop),
   .section for compact bands (72px: a row of figures, a short call to
   action). styles.css tightens the top of a section that continues the
   ground of the one above to 64px, so two plain sections stand 168px apart.
   Three things broke that rhythm:
   1. styles.css tightened a plain section after a coloured band as well (it
      only looks at the section itself), so content sat 64px under a band
      but 104px above one. A section that changes ground keeps its padding.
   2. A cannon divider or a heading block closing a section added its own
      bottom margin to the section's padding (216px apart instead of 168px).
   3. Content bands were a mix of both sizes - mended in the pages, which now
      use .section-lg for every band that carries a heading and text. */
:is(.dark, .dark-soft, [class*="-bg"]) + .section:not(.dark):not(.dark-soft):not([class*="-bg"]) { padding-top: var(--space-6); }
:is(.dark, .dark-soft, [class*="-bg"]) + .section-lg:not(.dark):not(.dark-soft):not([class*="-bg"]) { padding-top: var(--space-7); }
.cannon-divider:last-child { margin-bottom: 0; }
/* the same for a heading block's margin when nothing follows it */
:is(.section, .section-lg) > :is(.container, .container-narrow) > :last-child { margin-bottom: 0; }
/* and for the last step of a numbered process (its hairline is already gone) */
.step:last-child { padding-bottom: 0; }

/* ---- The site's own reveals, made to play --------------------------------
   styles.css forces every .reveal visible after 3s in case main.js fails.
   It also meant anything scrolled to after those 3s simply appeared. Here
   js/motion.js is the guarantee instead (it adds .revealed itself, and takes
   html.knk-motion off again if anything goes wrong), so the failsafe can
   stand down and the reveals play wherever you meet them. */
.knk-motion .reveal, .knk-motion .reveal-stagger > * { animation: none; }

/* ---- Headings rise line by line ------------------------------------------
   Each word sits in a clipping box and rises out of it; words on the same
   line move together, each line 90ms after the one above. */
.knk-motion .m-w {
  display: inline-block; overflow: hidden; vertical-align: top;
  /* room for descenders and italic overhang without moving the text */
  padding: 0 .08em .14em; margin: 0 -.08em -.14em;
}
.knk-motion .m-w > span {
  display: inline-block; transform: translateY(108%);
  transition: transform 1.05s var(--m-expo);
  transition-delay: calc(var(--l, 0) * 90ms + var(--m-d, 0ms));
}
.knk-motion .m-split.m-in .m-w > span { transform: none; }
/* a heading already on screen at load is held back until it has been split,
   or it would show, vanish into its boxes and rise again; three seconds is
   the longest it may wait */
.knk-motion .hero h1:not(.m-split):not(.m-skip),
.knk-motion main h1:not(.m-split):not(.m-skip) { opacity: 0; animation: m-failsafe 1ms linear 3s forwards; }
.knk-motion .hero .hero-inner > :not(h1) { animation: m-failsafe 1ms linear 3s forwards; }
@keyframes m-failsafe { to { opacity: 1; transform: none; } }

/* the eyebrow's rule draws in from the text */
.knk-motion .m-eyebrow::before, .knk-motion .m-eyebrow::after {
  transform: scaleX(0); transition: transform .9s var(--m-expo) .2s;
}
.knk-motion .m-eyebrow::before { transform-origin: right; }
.knk-motion .m-eyebrow::after { transform-origin: left; }
.knk-motion .m-eyebrow.m-in::before, .knk-motion .m-eyebrow.m-in::after { transform: none; }

/* ---- Photographs open as they arrive -------------------------------------
   A wipe upward, like a cellar door, while the picture settles from a slight
   zoom. Portraits and gallery tiles keep their own hover zoom, so they only
   take the wipe. */
.knk-motion .m-unveil {
  clip-path: inset(100% 0 0 0);
  transition: clip-path 1.3s var(--m-expo);
  transition-delay: var(--m-d, 0ms);
}
.knk-motion .m-unveil.m-in { clip-path: inset(0); }
.knk-motion .m-unveil.m-zoom img {
  scale: 1.16; transition: scale 1.9s var(--m-expo);
  transition-delay: var(--m-d, 0ms);
}
/* split images also drift against the scroll, so they stay a little larger
   than their frame and never show an edge */
.knk-motion .m-unveil.m-zoom.m-in img { scale: 1; }
.knk-motion .split-media.m-unveil { overflow: hidden; }
.knk-motion .split-media.m-unveil.m-in img { scale: 1.08; }
/* the library's portraits are shot upright; the gallery's 3:2 tiles crop to
   the middle and took heads off - bias the crop towards the top third */
.gal-item img { object-position: 50% 28%; }

/* ---- Rules draw ---------------------------------------------------------- */
.knk-motion .cannon-divider::before, .knk-motion .cannon-divider::after,
.knk-motion hr.hairline {
  transform: scaleX(0); transition: transform 1.3s var(--m-expo) .35s;
}
.knk-motion .cannon-divider::before { transform-origin: right; }
.knk-motion .cannon-divider::after,
.knk-motion hr.hairline { transform-origin: left; }
.knk-motion .cannon-divider.m-in::before, .knk-motion .cannon-divider.m-in::after,
.knk-motion hr.hairline.m-in { transform: none; }

/* ---- The cannon draws itself (dividers, the Our Story emblem) ------------
   The same traced engraving as the home page's logo: outline first, then the
   ink, then the smoke. Time-based here - a small mark gets a small moment. */
.m-cannon { display: block; height: auto; overflow: visible; color: var(--ash-grey); }
.cannon-divider .m-cannon { width: 54px; }
.dark .m-cannon { color: var(--parchment); }
.m-cannon path { fill: currentColor; }
.knk-motion .m-cannon path {
  fill-opacity: 0; stroke: currentColor; stroke-width: 7; stroke-dasharray: 1 1; stroke-dashoffset: 1;
  transition: stroke-dashoffset 1.5s var(--m-quart), fill-opacity .8s var(--m-quart), stroke-opacity .6s;
  transition-delay: calc(var(--i, 0) * 40ms), calc(900ms + var(--i, 0) * 20ms), 1.5s;
}
.knk-motion .m-cannon .ld-dot {
  stroke: none; opacity: 0; scale: .2; transform-box: fill-box; transform-origin: center;
  transition: opacity .5s var(--m-quart), scale .7s var(--m-expo), fill-opacity .1s;
  transition-delay: calc(1000ms + var(--i, 0) * 6ms);
}
.knk-motion .m-cannon.m-in path { stroke-dashoffset: 0; fill-opacity: 1; stroke-opacity: 0; }
.knk-motion .m-cannon.m-in .ld-dot { opacity: 1; scale: 1; }

/* ---- Home: the cannon fires ------------------------------------------------
   js/motion.js plays the shot (Web Animations); these are its pieces. The
   home divider's gun is drawn a little larger, so the moment can be seen.
   The rings keep a hairline at any size, and roll out well past the gun. */
.cannon-divider .m-cannon.m-gun { width: 120px; }
.m-gun .ld-cannon { transform-box: fill-box; transform-origin: 30% 85%; }
.m-blast circle { transform-box: fill-box; transform-origin: center; opacity: 0; }
.m-blast .m-ring { fill: none; stroke: currentColor; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.m-blast .m-ring-red, .m-blast .m-flash { stroke: var(--maroon); }
.m-blast .m-flash { fill: var(--maroon); }
.m-blast .m-smoke { fill: url(#m-smoke-g); stroke: none; }
.m-blast .m-ball { fill: var(--cellar); stroke: none; }

/* ---- Our Story timeline: the century draws across ------------------------ */
.knk-motion .hist .hist-rule { transform: scaleX(0); transform-origin: left; transition: transform 1.8s var(--m-expo) .2s; }
.knk-motion .hist .hist-tick,
.knk-motion .hist .hist-era,
.knk-motion .hist .hist-decade { opacity: 0; transition: opacity .6s var(--m-quart); }
.knk-motion .hist .hist-tick { transition-delay: calc(.5s + var(--i, 0) * 28ms); }
.knk-motion .hist .hist-era { transition-delay: calc(.3s + var(--i, 0) * 80ms); }
.knk-motion .hist .hist-decade { transition-delay: calc(.6s + var(--i, 0) * 50ms); }
.knk-motion .hist.m-in .hist-rule { transform: none; }
.knk-motion .hist.m-in .hist-tick, .knk-motion .hist.m-in .hist-era { opacity: 1; }
.knk-motion .hist.m-in .hist-decade { opacity: .5; }

/* ---- Our Story, timeline C: the runner on the axis --------------------------
   The runner sits on the rule over the moment being shown (whose own year
   chip steps aside for the runner's counting one); the trail fills the rule
   behind it. Lanes as in our-story.html: chip 26-42, rule 54, markers ~56.
   C's scene (further down) shows the lane. Timeline A, the carousel, has no
   runner: it moves only when the visitor moves it (24 Nov 2026). */
.m-runner-lane { display: none; position: absolute; left: 10px; right: 10px; top: 0; bottom: 0; pointer-events: none; }
.m-trail { position: absolute; left: 0; top: 53.5px; height: 2px; background: var(--maroon); }
.m-runner {
  position: absolute; top: 49.5px; width: 13px; height: 13px; margin-left: -6.5px;
  border-radius: 50%; background: var(--maroon);
  box-shadow: 0 0 0 3px var(--cream-bg, var(--cream)), 0 0 0 4px rgba(157, 34, 53, .35);
}
.m-runner-year {
  position: absolute; top: 26px; translate: -50% 0;
  font-family: var(--font-text); font-size: 10px; font-weight: 600; letter-spacing: .06em;
  font-variant-numeric: tabular-nums; color: var(--maroon);
  background: var(--cream-bg, var(--cream)); padding: 0 4px; border-radius: 2px; white-space: nowrap;
}

/* ---- Scroll to read --------------------------------------------------------
   The opening paragraph's words light one after another as js/motion.js
   raises --w; each word knows its place (--k) and takes about four words
   to come fully up. */
.knk-motion .m-read .m-r { opacity: clamp(.18, calc(.18 + (var(--w, 0) - var(--k)) * .22), 1); }

/* ---- Home: the story and the visit slide in from opposite sides ------------
   In place of the colour block that used to divide them (the estate, 4 Nov
   2026). --m-from is -1 for the left column, 1 for the right. This replaces
   the site's own rise for those columns. */
.knk-motion .m-slide,
.knk-motion .m-slide.revealed {
  transform: none;
  transition: opacity .9s var(--m-quart), translate 1.3s var(--m-expo);
  transition-delay: var(--m-d, 0ms);
}
.knk-motion .m-slide:not(.m-in) { opacity: 0; translate: calc(var(--m-from, -1) * clamp(48px, 7vw, 110px)) 0; }

/* ---- Home: the Wine Club invitation's seal is pressed on -------------------
   It arrives a beat after the card, from a little above and turned, and
   settles flat - like a seal set down by hand. */
.knk-motion .invite-card .club-seal {
  transition: opacity .5s var(--m-quart) .55s, scale .9s var(--m-expo) .55s, rotate .9s var(--m-expo) .55s;
}
.knk-motion .invite-card:not(.m-in) .club-seal { opacity: 0; scale: 1.5; rotate: -14deg; }

/* ---- Home: the Wine Club invitation comes in an envelope --------------------
   js/motion.js builds the envelope and moves its parts from the scroll; these
   are the parts. While the card is inside it sits between the envelope's
   back and its front pocket; drawn out, it comes in front of everything. The
   flap shows its inside once it has turned past upright. */
.m-env-back, .m-env-front, .m-env-flap, .m-env-seal { display: none; }
.m-env-stage.is-on .m-env-box {
  position: sticky; top: 0; height: 100vh; width: 100vw; margin-left: calc(50% - 50vw);
  overflow: hidden; perspective: 1800px;
}
.m-env-stage.is-on :is(.m-env-back, .m-env-front, .m-env-flap, .m-env-seal) { display: block; position: absolute; left: 50%; top: 0; }
.m-env-stage.is-on .invite-card { position: absolute; left: 50%; top: 0; margin: 0; width: min(620px, calc(100vw - 72px)); z-index: 2; }
.m-env-stage.is-on .invite-card.is-out { z-index: 6; }
.m-env-back { z-index: 1; background: var(--cream-deep); box-shadow: inset 0 0 0 1px rgba(183, 154, 99, .6); }
.m-env-front { z-index: 3; overflow: visible; filter: drop-shadow(0 26px 30px rgba(34, 34, 33, .3)); }
.m-env-front path { fill: var(--parchment); stroke: var(--gold); stroke-width: 1; vector-effect: non-scaling-stroke; }
.m-env-front .fold { fill: none; opacity: .55; }
.m-env-flap { z-index: 4; transform-origin: 50% 0; filter: drop-shadow(0 5px 5px rgba(34, 34, 33, .16)); }
.m-env-flap svg { display: block; width: 100%; height: 100%; overflow: visible; }
.m-env-flap path { fill: var(--parchment); stroke: var(--gold); stroke-width: 1; vector-effect: non-scaling-stroke; }
.m-env-flap.is-open { z-index: 0; }
.m-env-flap.is-open path { fill: var(--cream-deep); }
.m-env-seal {
  z-index: 5; background: url(../assets/img/k-seal.png) center / contain no-repeat;
  clip-path: inset(0 50% 0 0);
}
.m-env-seal-r { clip-path: inset(0 0 0 50%); }

/* ---- Our Story, timeline B: each moment slides in from its side of the line */
.knk-motion .hist-vertical .hist-card {
  transition: opacity .8s var(--m-quart), translate 1.1s var(--m-expo);
}
.knk-motion .hist-vertical .hist-card:not(.m-in) { opacity: 0; translate: -56px 0; }
.knk-motion .hist-vertical .hist-card.is-right:not(.m-in) { translate: 56px 0; }
@media (max-width: 760px) {
  .knk-motion .hist-vertical .hist-card:not(.m-in),
  .knk-motion .hist-vertical .hist-card.is-right:not(.m-in) { translate: 32px 0; }
}

/* ---- Our Story, timeline C: the century as a film (9 Nov 2026) -------------
   js/motion.js (centuryFilm) builds the scene and moves it from the scroll;
   these are its pieces. The moments are the page's own cards, stacked in one
   place: the picture on the left, the words on the right under one shared
   year counter, the axis along the foot. The script sets the --film-*
   lengths from the screen. On a phone the picture sits on top. Selectors
   carry .hist.m-film-on so they outrank our-story.html's own card styles,
   which load after this file. */
.m-plate, .m-film-head { display: none; }
.hist.m-film-on { position: sticky; margin-top: 0; }
.hist.m-film-on .hist-strip {
  position: absolute; left: 0; right: 0; top: var(--film-pad); bottom: var(--film-axis);
  display: block; overflow: visible; padding: 0; margin: 0;
  scroll-snap-type: none; -webkit-mask-image: none; mask-image: none;
}
.hist.m-film-on .hist-card,
.hist.m-film-on .hist-card[data-media] {
  position: absolute; inset: 0; display: block; width: auto; margin: 0; flex: none;
  opacity: 1; background: none; border: 0; box-shadow: none;
}
/* every card stays in place: a photograph can stand on screen for moments
   after its own (the script uncovers and puts away the pictures, and only
   the moment being read shows its words) */
.hist.m-film-on .hist-card :is(figure, .m-plate) {
  display: block; position: absolute; left: 0; top: 0; bottom: 0; width: 46%;
  margin: 0; min-height: 0; overflow: hidden; background: var(--ash-grey);
  clip-path: inset(100% 0 0 0);
}
.hist.m-film-on .hist-card figure::before { content: none; }
.hist.m-film-on .hist-card figure img { transform-origin: 50% 70%; }
/* the hairline inset from the edge, as on the site's other photographs */
.hist.m-film-on .hist-card :is(figure, .m-plate)::after {
  content: ''; position: absolute; inset: 14px; border: 1px solid rgba(255, 252, 223, .5); pointer-events: none;
}
/* a moment with no photograph: Ash Grey, and the cannon in Vintage Cream */
.hist.m-film-on .m-plate::before {
  content: ''; position: absolute; inset: 0; margin: auto; width: 36%; height: 36%;
  background: var(--parchment); opacity: .92;
  -webkit-mask: url(../assets/img/canon.png) center / contain no-repeat;
          mask: url(../assets/img/canon.png) center / contain no-repeat;
}
.hist.m-film-on .hist-card .hist-body,
.hist.m-film-on .hist-card[data-media] .hist-body {
  position: absolute; left: var(--film-text-x); right: 0; top: var(--film-body-top);
  display: block; max-width: 36rem; min-height: 0; padding: 0;
}
/* only the moment being read can be clicked or tabbed to */
.hist.m-film-on .hist-card:not(.is-current) .hist-body { visibility: hidden; }
.hist.m-film-on .hist-card .hist-body > * { animation: none; }
/* the counter shows the year; the card keeps its own for screen readers */
.hist.m-film-on .hist-card .hist-year {
  position: absolute; width: 1px; height: 1px; margin: 0; padding: 0; border: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.hist.m-film-on .hist-card h3 { font-size: clamp(1.45rem, 2.3vw, 2rem); line-height: 1.15; margin: 0 0 .55em; }
/* since 20 Nov 2026 each moment is one or two of Wiam's sentences and no
   title, so the sentence itself is set large, in the serif */
.hist.m-film-on .hist-card .hist-lead {
  font-family: var(--font-display); font-size: clamp(1.3rem, 1.9vw, 1.7rem); line-height: 1.38;
  color: var(--ink); margin: 0;
}
.hist.m-film-on .hist-card .hist-more { font-size: var(--fs-body); line-height: 1.7; }
/* inside the scene the link is a quiet line, not a boxed button: the box
   cost the height that lets the scene run on a laptop's shorter window */
.hist.m-film-on .hist-card .btn {
  margin-top: var(--space-2); padding: 0 0 3px; border: 0; border-bottom: 1px solid currentColor;
  background: none; overflow: visible;
  /* the scroll moves it with the other lines; the button's own 'all .35s'
     would make it trail behind them */
  transition: color .3s var(--ease-lux);
}
.hist.m-film-on .hist-card .hist-body .btn:hover:not(:disabled) { background: none; color: var(--maroon-deep); }
.hist.m-film-on :is(.hist-rail, .hist-controls) { display: none; }

/* the year counter, with the era and where you are above it */
.hist.m-film-on .m-film-head {
  display: block; position: absolute; left: var(--film-text-x); right: 0;
  top: calc(var(--film-pad) + var(--film-head-top)); max-width: 36rem; pointer-events: none;
}
.m-film-era {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 1em; margin: 0 0 .6rem;
  font-family: var(--font-text); font-size: var(--fs-micro); font-weight: 600;
  letter-spacing: .3em; text-transform: uppercase; color: var(--gold-text);
}
.m-film-era-name { display: inline-flex; align-items: center; gap: .9em; }
.m-film-era-name::before { content: ''; width: 2.2em; height: 1px; background: currentColor; opacity: .65; }
.m-film-era-name.m-flip { animation: m-flip .7s var(--m-expo); }
@keyframes m-flip { from { opacity: 0; translate: 0 7px; } }
.m-film-count { position: relative; flex: none; white-space: nowrap; letter-spacing: .16em; font-variant-numeric: tabular-nums; }
/* "Scroll", with a small arrow nodding down, in the count's place until the
   scene starts to move (beside it, it ran into the longer chapter names) */
.m-film-n { opacity: 0; transition: opacity .5s var(--m-quart); }
.m-film-n.is-shown { opacity: 1; }
.m-film-cue {
  position: absolute; right: 0; top: 0;
  display: inline-flex; align-items: center; gap: .6em; color: var(--maroon); transition: opacity .5s var(--m-quart);
}
.m-film-cue::after { content: '\2193'; letter-spacing: 0; animation: m-nod 1.6s ease-in-out infinite; }
.m-film-cue.is-gone { opacity: 0; }
@keyframes m-nod { 50% { translate: 0 3px; } }
.m-odo {
  display: flex; align-items: flex-start; margin: 0; padding-bottom: .06em; border-bottom: 1px solid var(--gold);
  font-family: var(--font-display); font-weight: 400; line-height: 1.1; letter-spacing: 0;
  font-size: clamp(4rem, min(8.5vw, 13vh), 8rem); color: var(--maroon);
  font-variant-numeric: lining-nums tabular-nums;
}
/* each digit is a window onto a column of 0-9 that the script rolls */
.m-odo-d {
  display: block; height: 1.1em; overflow: hidden;
  -webkit-mask-image: linear-gradient(transparent, #000 16%, #000 84%, transparent);
          mask-image: linear-gradient(transparent, #000 16%, #000 84%, transparent);
}
.m-odo-col { display: block; will-change: transform; }
.m-odo-col span { display: block; height: 1.1em; text-align: center; }
/* the day and month, where the entry gives them ("1 January") */
.m-odo-note {
  align-self: flex-end; margin: 0 0 1.4em 1em;
  font-family: var(--font-text); font-size: var(--fs-micro); font-weight: 600; line-height: 1.3;
  letter-spacing: .2em; text-transform: uppercase; color: var(--gold-text);
}

/* the axis along the foot: the runner counts along it, and every marker it
   has passed turns red */
.hist.m-film-on .hist-axis { position: absolute; left: 0; right: 0; bottom: 0; margin: 0; }
.hist.m-film-on .m-runner-lane { display: block; }
.hist.m-film-on .hist-tick[aria-selected="true"] .tick-year { opacity: 0; }
/* the page marks the moment being read as selected; here the runner says
   that, so a marker is only red once the runner has reached it */
.hist.m-film-on .hist-tick[aria-selected="true"]::after { transform: none; background: var(--parchment); border-color: #6b5636; }
.hist.m-film-on .hist-tick.is-passed::after { background: var(--maroon); border-color: var(--maroon); }

/* a laptop's short window (about 650px of page): a little tighter all round,
   so the scene still fits rather than falling back to B */
@media (min-width: 761px) and (max-height: 700px) {
  .m-odo { font-size: clamp(3.5rem, min(8.5vw, 11.5vh), 8rem); }
  .m-film-era { margin-bottom: .35rem; }
  .hist.m-film-on .hist-card h3 { margin-bottom: .4em; }
  .hist.m-film-on .hist-card .hist-lead { line-height: 1.5; margin-bottom: .6em; }
  .hist.m-film-on .hist-card .hist-more { line-height: 1.6; }
}

/* stacked (a phone, an upright tablet): the picture across the top */
.hist.m-film-stacked .hist-card :is(figure, .m-plate) { right: 0; bottom: auto; width: auto; height: var(--film-fig-h); }
@media (max-width: 760px) {
  .hist.m-film-on .hist-card :is(figure, .m-plate)::after { inset: 10px; }
  /* room under the rule for the decades (the page's phone axis is 64px) */
  .hist.m-film-on .hist-axis { height: 88px; }
  .m-film-era-name::before { width: 1.2em; }
  .hist.m-film-on .hist-card h3 { font-size: 1.25rem; }
  .hist.m-film-on .hist-card .hist-lead { font-size: 1.18rem; line-height: 1.4; }
  .hist.m-film-on .hist-card .hist-more { font-size: var(--fs-sm); line-height: 1.6; }
  .m-odo { font-size: clamp(3rem, 14vw, 4rem); }
  .m-film-era { margin-bottom: .3rem; letter-spacing: .22em; }
}

/* ---- Page heroes (home too, since 5 Nov): the opening sequence ----------- */
.knk-motion .hero .hero-inner > :not(h1) {
  opacity: 0; transform: translateY(18px);
  transition: opacity .8s var(--m-quart), transform 1s var(--m-expo);
}
.knk-motion .hero .hero-inner > :not(h1):nth-child(n+3) { transition-delay: .35s; }
.knk-motion .hero.m-in .hero-inner > * { opacity: 1; transform: none; }
.knk-motion .hero .hero-media { will-change: translate; }

/* ---- Between pages: a soft crossfade, the header held still --------------
   Only between pages that both load this file, so leaving for the shop is
   the ordinary page load it always was. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  .site-header { view-transition-name: knk-header; }
  ::view-transition-old(root) { animation: m-vt-out .3s var(--m-quart) both; }
  ::view-transition-new(root) { animation: m-vt-in .6s var(--m-expo) both; }
}
@keyframes m-vt-out { to { opacity: 0; } }
@keyframes m-vt-in { from { opacity: 0; transform: translateY(12px); } }
