/* "From roof to pint" (story/story.js), the nine chapters on /brewing/. Every picture is drawn finished; the
   motion below only runs off the scroll position (no clocks, so nothing plays
   by itself), only with scroll timelines, and only with motion on: the OS
   setting and the site's Animations switch (html[data-motion="reduce"]). */
.rtp {
  --rtp-roof: #F6F4EE; --rtp-wall: #F2C7BF; --rtp-shutter: #5E9C7A; --rtp-water: #2FA3A0; --rtp-deep: #0E5A63;
  --rtp-cedar: #6A3F26; --rtp-malt: #D49A3A; --rtp-copper: #B8652A; --rtp-hop: #8DB45A; --rtp-ice: #BFE6F2;
  position: relative; display: grid; grid-template-columns: 96px minmax(0, 1fr); background: #071B20; color: #F4EFE6;
  view-timeline-name: --rtp; padding-bottom: clamp(48px, 7vw, 96px);
}
.rtp__rail { position: relative; }
.lt { position: sticky; top: 72px; display: block; width: 96px; height: calc(100svh - 96px); margin-top: 40px; overflow: visible; }
.lt__trail { fill: none; stroke: #F4EFE6; stroke-opacity: .12; stroke-width: 2; stroke-dasharray: .004 .012; }
.lt__tail { fill: none; stroke: #F4EFE6; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
.lt__wing, .lt__body { fill: #F6F4EE; }
.lt__bar, .lt__mask { fill: none; stroke: #1B1A17; stroke-width: 3; stroke-linecap: round; }
.lt__beak { fill: #F2A33A; }
.lt__streamers { fill: none; stroke: #F6F4EE; stroke-width: 2; }
.rtp__body { min-width: 0; }
.rtp__head { padding-block: clamp(48px, 7vw, 96px) clamp(24px, 3vw, 40px); display: grid; gap: 10px; }
.rtp__head h2 { margin: 0; }
.rtp__lede { margin: 0; color: rgba(244, 239, 230, .78); }
.rtp__chapters { display: grid; gap: clamp(40px, 7vw, 96px); }
.ch { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(20px, 4vw, 56px); align-items: center; padding: clamp(18px, 3vw, 32px); border-radius: 20px; background: var(--ch-bg, rgba(255, 255, 255, .04)); }
.ch--flip .ch__art { order: 2; }
.ch__svg { display: block; width: 100%; height: auto; overflow: visible; }
.ch__n { margin: 0; font-family: var(--font-display); font-size: clamp(2.6rem, 6vw, 4.5rem); line-height: .8; color: var(--ch-accent, var(--rtp-water)); }
.ch__text h3 { margin: 8px 0 0; }
.ch__chip { display: inline-block; margin: 10px 0 0; padding: 4px 12px; border-radius: 999px; border: 1.5px solid currentColor; font-weight: 700; font-size: .9375rem; color: var(--ch-accent, var(--rtp-water)); }
.ch__p { margin: 12px 0 0; font-size: clamp(1.0625rem, 1rem + .3vw, 1.25rem); line-height: 1.5; }
/* Brewhouse photos (story.js photosHTML): the same frame as a film slot. */
.ch__pic { margin: 18px 0 0; max-width: 560px; aspect-ratio: 3 / 2; border-radius: 14px; overflow: clip; background: color-mix(in srgb, currentColor 8%, transparent); }
.ch__pic img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ch__pics { display: grid; gap: 8px; margin-top: 18px; max-width: 560px; }
.ch__pics--2 { grid-template-columns: 1fr 1fr; }
.ch__pics--3 { grid-template-columns: 1fr 1fr 1fr; }
.ch__pics .ch__pic { margin: 0; aspect-ratio: 1; border-radius: 10px; }
.ch__film + .ch__pics { margin-top: 8px; }
.ch__go { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 0; }
.ch--roof { --ch-bg: #0D2730; --ch-accent: #8FD3E8; }
.ch--runoff { --ch-bg: #0B2B2E; --ch-accent: var(--rtp-water); }
.ch--mash { --ch-bg: #2A1E10; --ch-accent: var(--rtp-malt); }
.ch--boil { --ch-bg: #2B160C; --ch-accent: #E58A4E; }
.ch--whirlpool { --ch-bg: #18222A; --ch-accent: #A9C1CF; }
.ch--ferment { --ch-bg: #172214; --ch-accent: var(--rtp-hop); }
.ch--cold { --ch-bg: #0E2333; --ch-accent: var(--rtp-ice); }
.ch--canning { --ch-bg: #1E1E22; --ch-accent: #E9D9A0; }
.ch--pour { --ch-bg: #2A2410; --ch-accent: #F7CF0B; }

/* The drawings: thick, rounded line work in the Bermuda palette. */
.ch__svg * { stroke-linecap: round; stroke-linejoin: round; }
.ch__svg .roof { fill: var(--rtp-roof); }
.ch__svg .roof-steps { fill: none; stroke: var(--rtp-cedar); stroke-opacity: .35; stroke-width: 2.5; }
.ch__svg .gutter, .ch__svg .pipe { fill: none; stroke: #C8C2B4; stroke-width: 6; }
.ch__svg .wall { fill: var(--rtp-wall); }
.ch__svg .shutter { fill: var(--rtp-shutter); }
.ch__svg .window { fill: #2B4A55; }
.ch__svg .door { fill: var(--rtp-cedar); }
.ch__svg .ground { fill: none; stroke: #F4EFE6; stroke-opacity: .3; stroke-width: 2; }
.ch__svg .drop { fill: none; stroke: #8FD3E8; stroke-width: 2.5; }
.ch__svg .tank { fill: none; stroke: #C8C2B4; stroke-width: 4; }
.ch__svg .tank-water { fill: var(--rtp-water); fill-opacity: .55; }
.ch__svg .flow { fill: none; stroke: var(--rtp-water); stroke-width: 5; stroke-dasharray: 1; stroke-dashoffset: 0; }
.ch__svg .ripple { fill: none; stroke: #8FD3E8; stroke-width: 2; }
.ch__svg .vessel, .ch__svg .kettle { fill: #B9BDC0; }
.ch__svg .vessel-top { fill: #DADDDF; }
.ch__svg .mash-top { fill: var(--rtp-malt); }
.ch__svg .grain ellipse { fill: #F1C56E; }
.ch__svg .thermo rect:first-child, .ch__svg .thermo circle { fill: #F4EFE6; }
.ch__svg .thermo-fill { fill: #D9473A; }
.ch__svg .thermo circle { fill: #D9473A; }
.ch__svg .thermo path { stroke: #F4EFE6; stroke-width: 2; }
.ch__svg .thermo text { fill: #F4EFE6; font: 700 15px var(--font-body); }
.ch__svg .steam { fill: none; stroke: #F4EFE6; stroke-opacity: .5; stroke-width: 4; }
.ch__svg .kettle-band { stroke: #8E9499; stroke-width: 4; }
.ch__svg .wort { fill: var(--rtp-copper); }
.ch__svg .bubbles-boil { fill: none; stroke: #F6D2A8; stroke-width: 2.5; }
.ch__svg .flame { fill: #F2A33A; }
.ch__svg .hop path:first-child { fill: var(--rtp-hop); }
.ch__svg .hop path + path { fill: none; stroke: #4E6E2E; stroke-width: 2; }
.ch__svg .arm { fill: none; stroke: #A9C1CF; stroke-width: 9; stroke-opacity: .85; }
.ch__svg .arm--thin { stroke-width: 4; stroke-opacity: .45; }
.ch__svg .eye { fill: #18222A; stroke: #F4EFE6; stroke-width: 3; }
.ch__svg .trub circle { fill: var(--rtp-hop); }
.ch__svg .tank-body { fill: #C7CBCE; }
.ch__svg .tank-body--cold { fill: #DCEFF7; }
.ch__svg .tank-lid { fill: #E3E6E8; }
.ch__svg .airlock { fill: none; stroke: #F4EFE6; stroke-width: 3; }
.ch__svg .fbub { fill: #F4EFE6; fill-opacity: .7; }
.ch__svg .legs { fill: none; stroke: #8E9499; stroke-width: 5; }
.ch__svg .frost { stroke: #FFFFFF; stroke-width: 3; }
.ch__svg .snow { color: var(--rtp-ice); }
.ch__svg .keepcold { fill: var(--rtp-ice); font: 700 16px var(--font-label); letter-spacing: .5em; }
.ch__svg .filler { fill: #B9BDC0; }
.ch__svg .filler-nozzle { stroke: #F7CF0B; stroke-width: 5; }
.ch__svg .cl-can rect { fill: #DADDDF; }
.ch__svg .cl-can path { stroke: #8E9499; stroke-width: 2; }
.ch__svg .belt { fill: #2B2B30; stroke: #8E9499; stroke-width: 3; }
.ch__svg .roller { fill: #8E9499; }
/* The brewhouse as filmed (6 Nov 2026): stainless, blue valve handles, the 32° North label roll. */
.ch__svg .vessel-shine { fill: none; stroke: #E8EBED; stroke-opacity: .55; stroke-width: 3; }
.ch__svg .manway-rim { fill: #DADDDF; stroke: #8E9499; stroke-width: 3; }
.ch__svg .rake { fill: none; stroke: #E8EBED; stroke-width: 3; }
.ch__svg .rake-hub { fill: #E8EBED; }
.ch__svg .gauge circle { fill: #F4EFE6; stroke: #8E9499; stroke-width: 3; }
.ch__svg .gauge-band { fill: none; stroke: #D9473A; stroke-width: 4; }
.ch__svg .gauge-needle { stroke: #1B1A17; stroke-width: 2.5; }
.ch__svg .pipework, .ch__svg .hose { fill: none; stroke: #9AA0A5; stroke-width: 6; }
.ch__svg .hose { stroke: #5B6166; }
.ch__svg .valve { stroke: #2F6FB0; stroke-width: 5; }
.ch__svg .kettle-jacket { stroke: #8E9499; stroke-width: 2.5; }
.ch__svg .kettle-rim { fill: #DADDDF; stroke: #8E9499; stroke-width: 3; }
.ch__svg .panel rect:first-child { fill: #D3D6D8; }
.ch__svg .panel .screen { fill: #3E8FD6; }
.ch__svg .panel path { stroke: #6A7075; stroke-width: 4; }
.ch__svg .panel .panel-post { stroke: #8E9499; stroke-width: 5; }
.ch__svg .pool-rim { fill: none; stroke: #C9CDD0; stroke-width: 14; }
.ch__svg .pool-wort { fill: var(--rtp-copper); }
.ch--whirlpool .ch__svg .arm { stroke: #F6D2A8; }
.ch--whirlpool .ch__svg .eye { fill: #8C4A1E; stroke: #F6D2A8; stroke-width: 2; }
.ch__svg .inlet { stroke: #9AA0A5; stroke-width: 6; }
.ch__svg .jacket { stroke: #9AA0A5; stroke-width: 3; }
.ch__svg .manway { fill: #DADDDF; stroke: #8E9499; stroke-width: 3; }
.ch__svg .top-fittings path { fill: none; stroke: #9AA0A5; stroke-width: 4; }
.ch__svg .top-fittings circle { fill: #F4EFE6; stroke: #8E9499; stroke-width: 2; }
.ch__svg .feet { stroke: #8E9499; stroke-width: 5; }
.ch__svg .controller rect { fill: #2B2B30; stroke: #8E9499; stroke-width: 2; }
.ch__svg .controller text { fill: #F2A33A; font: 700 15px var(--font-body); }
.ch__svg .controller path { stroke: #8E9499; stroke-width: 2; }
.ch__svg .rail { fill: none; stroke: #B9BDC0; stroke-width: 4; }
.ch__svg .rail-can { fill: #DADDDF; stroke: #8E9499; stroke-width: 1.5; }
.ch__svg .filler rect { fill: #B9BDC0; }
.ch__svg .filler-heads { stroke: #DADDDF; stroke-width: 6; }
.ch__svg .seamer path { stroke: #B9BDC0; stroke-width: 10; }
.ch__svg .seamer rect { fill: #8E9499; }
.ch__svg .label-roll circle:first-child { fill: #5E2E8C; }
.ch__svg .label-core { fill: #F4EFE6; }
.ch__svg .label-edge { fill: none; stroke: #F4EFE6; stroke-width: 3; }
.ch__svg .cl-can--labelled rect { fill: #5E2E8C; }
.ch__svg .cl-can--labelled path { stroke: #F4EFE6; }
.pour-stage { position: relative; width: min(100%, 300px); aspect-ratio: 3 / 4; margin-inline: auto; }
.pour-stage > svg, .pour-stage > canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.pour-stage > canvas { opacity: 0; transition: opacity .4s; }
.pour-stage.is-3d > canvas { opacity: 1; }
.pour-stage.is-3d > svg { opacity: 0; }

/* Phones: the chapters stack; the longtail flies along the top of the story. */
@media (max-width: 760px) {
  .rtp { grid-template-columns: minmax(0, 1fr); }
  .rtp__rail { position: sticky; top: 64px; z-index: 2; height: 0; }
  .lt { position: absolute; top: 0; right: 10px; width: 44px; height: 70svh; margin: 0; }
  .ch { grid-template-columns: minmax(0, 1fr); }
  .ch--flip .ch__art { order: 0; }
  .ch__art { max-width: 420px; }
}


/* The way out: to the taproom, through the moongate. */
.rtp-visit { padding-block: clamp(56px, 8vw, 112px); }
.rtp-visit__in { display: grid; gap: 14px; justify-items: start; }
.rtp-visit__in h2 { margin: 0; }
.rtp-visit__p { margin: 0; font-size: clamp(1.0625rem, 1rem + .3vw, 1.25rem); }
.rtp-visit__go { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 0; }

/* ---- Motion, off the scroll only ---- */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    html:not([data-motion="reduce"]) .lt__tail { animation: lt-draw linear both; animation-timeline: --rtp; animation-range: contain 0% contain 100%; }
    html:not([data-motion="reduce"]) .lt__bird { animation: lt-fly linear both; animation-timeline: --rtp; animation-range: contain 0% contain 100%; }
    html:not([data-motion="reduce"]) .ch__art { animation: ch-in linear both; animation-timeline: view(); animation-range: entry 0% cover 30%; }
    html:not([data-motion="reduce"]) .ch__svg .drop { animation: rain linear both; animation-timeline: view(); animation-range: cover 10% cover 90%; }
    html:not([data-motion="reduce"]) .ch__svg .flow { animation: flow linear both; animation-timeline: view(); animation-range: entry 40% cover 55%; }
    html:not([data-motion="reduce"]) .ch__svg .steam { animation: steam linear both; animation-timeline: view(); animation-range: cover 10% cover 90%; }
    html:not([data-motion="reduce"]) .ch__svg .hop { animation: hop-drop linear both; animation-timeline: view(); animation-range: entry 60% cover 60%; }
    html:not([data-motion="reduce"]) .ch__svg .swirl { transform-box: view-box; transform-origin: 200px 150px; animation: swirl linear both; animation-timeline: view(); animation-range: cover 0% cover 100%; }
    html:not([data-motion="reduce"]) .ch__svg .fbub { animation: fbub linear both; animation-timeline: view(); animation-range: cover 10% cover 90%; }
    html:not([data-motion="reduce"]) .ch__svg .cl-cans { animation: cans linear both; animation-timeline: view(); animation-range: cover 10% cover 80%; }
    html:not([data-motion="reduce"]) .ch__svg .snow { transform-box: fill-box; transform-origin: center; animation: snow linear both; animation-timeline: view(); animation-range: entry 40% cover 60%; }
    /* The moongate: the way to the taproom opens up through a circle, like Bermuda's stone arches. */
    html:not([data-motion="reduce"]) .moongate { animation: moongate linear both; animation-timeline: view(); animation-range: entry 0% entry 100%; }
  }
}
@keyframes lt-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes lt-fly { from { transform: translate(60px, 56px) rotate(-6deg); } 50% { transform: translate(60px, 56px) rotate(6deg); } to { transform: translate(60px, 56px) rotate(-4deg); } }
@keyframes ch-in { from { opacity: 0; transform: translateY(48px) scale(.96); } }
@keyframes rain { from { transform: translateY(-40px); opacity: 0; } 15% { opacity: 1; } to { transform: translateY(70px); } }
@keyframes flow { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes steam { from { transform: translateY(18px); opacity: 0; } to { transform: translateY(-12px); opacity: 1; } }
@keyframes hop-drop { from { transform: translateY(-60px); opacity: 0; } to { opacity: 1; } }
@keyframes swirl { from { transform: rotate(-160deg); } to { transform: rotate(40deg); } }
@keyframes fbub { from { transform: translateY(70px); opacity: 0; } 20% { opacity: 1; } to { transform: translateY(-40px); opacity: .4; } }
@keyframes cans { from { transform: translateX(-120px); } to { transform: translateX(40px); } }
@keyframes snow { from { transform: rotate(-90deg) scale(.6); opacity: 0; } }
@keyframes moongate { from { clip-path: circle(22% at 50% 18%); } to { clip-path: circle(110% at 50% 30%); } }
