/* christopher r martin MW: motion layer (test copy, 15 November 2026; round 1 changes the same day).
   Loaded after site.css on every page. Everything here is an addition; site.css is unchanged.
   js/motion.js adds these classes to <html>:
     .mo      the visitor has not asked for reduced motion
     .sda     the browser runs scroll-driven animations itself (Chrome, Edge, Safari 26, Firefox 159)
     .no-sda  it does not, so js/motion.js switches classes from a scroll listener instead
   With reduced motion, or with no JavaScript, every section below is a plain static layout.
   Smoothness rule for this file: scroll only ever moves things with translate, scale and opacity, which the
   browser can do without laying the page out again. Nothing here changes a size while you scroll. */

:root { --neon: #5df29a; --pen-blue: #1f4fa3; --pen-red: #b3261e; }

/* ---------- 1. Header: stays as it is on scroll, with the full name (round 3) ---------- */
.crm-name { display: inline-flex; align-items: baseline; }
.crm-name__full, .crm-mw { display: inline-block; }

/* ---------- 2. Opening animation on the home page, once per visit ---------- */
html.intro-on body { visibility: hidden; }
.intro { position: fixed; inset: 0; z-index: 200; visibility: visible; display: grid; place-items: center; background: var(--bg); overflow: hidden; }
.intro__name { display: inline-flex; align-items: baseline; white-space: pre; transform-origin: 0 0; font-family: var(--font-display); font-weight: 300; font-size: clamp(26px, 6.4vw, 88px); line-height: 1.1; text-transform: lowercase; color: var(--accent); }
.intro__mw { font-family: var(--font-sans); font-weight: 600; font-size: .62em; letter-spacing: .14em; margin-left: .32em; text-transform: uppercase; }
/* One letter at a time: each arrives bright and settles to the site green while the next ones arrive */
.intro__name i { display: inline-block; opacity: 0; animation: intro-letter .75s ease-out both; animation-delay: calc(var(--n) * 62ms); }
.intro__name.is-waiting i { animation-play-state: paused; }
@keyframes intro-letter {
  0% { opacity: 0; color: var(--neon); translate: 0 .12em; }
  22% { opacity: 1; color: var(--neon); translate: 0 0; }
  45% { color: var(--neon); }
  100% { opacity: 1; color: var(--accent); }
}

/* ---------- 3. Buttons: a soft patch follows the pointer and the button leans towards it ---------- */
/* The patch is pale on dark buttons and dark on pale ones, so it shows in both themes */
.crm-btn { position: relative; overflow: hidden; isolation: isolate; --glow: 255 255 255; --glow-a: .36; }
.crm-btn--gold, .crm-btn--light, [data-theme="dark"] .crm-btn { --glow: 0 0 0; --glow-a: .3; }
.crm-btn::after {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .35s ease;
  background: radial-gradient(circle 84px at var(--mx, 50%) var(--my, 50%), rgb(var(--glow) / var(--glow-a)), rgb(var(--glow) / calc(var(--glow-a) * .45)) 42%, transparent 72%);
}
@media (hover: hover) { .crm-btn:hover::after { opacity: 1; } }
.crm-btn[aria-disabled="true"]::after { display: none; }
@media (prefers-reduced-motion: reduce) { .crm-btn::after, .lobe-glow { transition: none; } }
/* The lean: js/motion.js sets --tx --ty --rx --ry from where the pointer is on the button; it springs back on leaving */
html.mo .crm-btn:not(.rv), html.mo .crm-btn.rv.is-done { transition: background .2s, color .2s, border-color .2s, transform .6s cubic-bezier(.2, 1.6, .4, 1); }
@media (hover: hover) {
  html.mo .crm-btn:not([aria-disabled="true"]):not(.rv):hover, html.mo .crm-btn.rv.is-done:not([aria-disabled="true"]):hover {
    transform: perspective(520px) translate(var(--tx, 0px), var(--ty, 0px)) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) scale(1.04);
    transition: background .2s, color .2s, border-color .2s, transform .16s ease-out;
  }
}

/* ---------- 4. The three circles (MW Students, Wine Services) ---------- */
/* Pointer glow inside a circle: dark green in the light theme, pale green in the dark theme */
:root { --lobe-glow: #1e3b33; }
[data-theme="dark"] { --lobe-glow: #dff3e4; }
.lobe-glow-stop { stop-color: var(--lobe-glow); }
.lobe-glow { pointer-events: none; opacity: 0; transition: opacity .4s ease; }
@media (hover: hover) { .crm-lobe-g:hover .lobe-glow { opacity: 1; } }

/* On opening the page each circle grows from its centre, one after another, then the lines and labels fade in */
html.mo .crm-diagram .crm-lobe-g { transform-box: fill-box; transform-origin: 50% 50%; transition: scale 1.2s cubic-bezier(.3, 1.4, .5, 1), opacity .5s ease; }
html.mo .crm-diagram .crm-lobe-g[data-i="0"] { transition-delay: .1s; }
html.mo .crm-diagram .crm-lobe-g[data-i="1"] { transition-delay: .3s; }
html.mo .crm-diagram .crm-lobe-g[data-i="2"] { transition-delay: .5s; }
html.mo .crm-diagram:not(.is-grown) .crm-lobe-g { scale: 0; opacity: 0; }
html.mo .crm-diagram .crm-lead, html.mo .crm-diagram .crm-lead-dot, html.mo .crm-diagram .crm-dlabel, html.mo .crm-diagram svg > g:first-of-type { transition: opacity .8s ease 1.1s; }
html.mo .crm-diagram:not(.is-grown) .crm-lead, html.mo .crm-diagram:not(.is-grown) .crm-lead-dot,
html.mo .crm-diagram:not(.is-grown) .crm-dlabel, html.mo .crm-diagram:not(.is-grown) svg > g:first-of-type { opacity: 0; }

/* MW Students (round 4): the circles fill the screen under the header and stay there while you scroll.
   Scrolling sends the top circle up, the right one right and the left one left, each with its label, until
   all three are gone; then the grid behind them expands and fades; only then does the route come up.
   The route cannot be seen before that, because the pinned section is as tall as the screen.
   Wide screens only: on phones the labels sit under the drawing and the section is taller than the screen.
   .mw-pin is the scroll distance, .mw-pin > .dissolve is the pinned screen. */
.mw-pin__room { display: none; }
@keyframes mw-out { 0% { translate: 0 0; } 62%, 100% { translate: var(--ox, 0px) var(--oy, 0px); } }
@keyframes mw-leads { 0% { opacity: 1; } 7%, 100% { opacity: 0; } }
@keyframes mw-grid { 0%, 64% { scale: 1; opacity: .35; } 100% { scale: 3.4; opacity: 0; } }
@media (min-width: 761px) and (min-height: 600px) {
  html.mo .mw-pin { overflow-x: clip; view-timeline: --mw block; }
  html.mo .mw-pin > .dissolve { position: sticky; top: var(--header-h, 70px); height: calc(100svh - var(--header-h, 70px)); box-sizing: border-box; display: flex; flex-direction: column; justify-content: center; }
  html.mo .mw-pin__room { display: block; height: 150svh; }
  /* The drawing always fits the pinned screen */
  html.mo .mw-pin .crm-diagram { width: 100%; max-width: min(1000px, calc((100svh - var(--header-h, 70px) - 90px) * 1.78)); margin-top: 0; }
  html.mo .mw-pin .crm-diagram svg { overflow: visible; }
  html.mo .mw-pin .crm-diagram svg > g:first-of-type { transform-box: fill-box; transform-origin: 50% 50%; }
  /* Where each circle and its label go: 0 top, 1 right, 2 left */
  html.mo .mw-pin .crm-lobe-g[data-i="0"] { --ox: 0px; --oy: -760px; }
  html.mo .mw-pin .crm-lobe-g[data-i="1"] { --ox: 1100px; --oy: 0px; }
  html.mo .mw-pin .crm-lobe-g[data-i="2"] { --ox: -1100px; --oy: 0px; }
  html.mo .mw-pin .crm-dlabel[data-i="0"] { --ox: 0px; --oy: -100vh; }
  html.mo .mw-pin .crm-dlabel[data-i="1"] { --ox: 100vw; --oy: 0px; }
  html.mo .mw-pin .crm-dlabel[data-i="2"] { --ox: -100vw; --oy: 0px; }
  @supports ((animation-timeline: view()) and (animation-range: entry)) {
    html.mo.sda .mw-pin .crm-lobe-g, html.mo.sda .mw-pin .crm-dlabel { animation: mw-out auto linear both; animation-timeline: --mw; animation-range: contain 0% contain 100%; }
    html.mo.sda .mw-pin .crm-leads { animation: mw-leads auto linear both; animation-timeline: --mw; animation-range: contain 0% contain 100%; }
    html.mo.sda .mw-pin .crm-diagram svg > g:first-of-type { animation: mw-grid auto linear both; animation-timeline: --mw; animation-range: contain 0% contain 100%; }
  }
}
/* The speckled texture on the circles is costly to redraw (Safari especially), so it is switched off while a
   circle is moving and comes back once it is still. js/motion.js adds and removes .is-moving. */
html.mo .crm-diagram.is-moving .crm-lobe { filter: none; }

/* The route's heading sits near the top of its block, not in the middle of it */
.mj-stage .mj-panel { justify-content: flex-start; padding-top: clamp(40px, 7vh, 72px); }

/* ---------- 4b. Testimonials: a full-width dark band, one quote at a time in large type ---------- */
.tm { background: var(--deep); color: var(--on-deep); padding: var(--section) 0; }
.tm > .wrap { padding: 0 var(--gutter); }
.tm__in { position: relative; max-width: 940px; margin: 0 auto; text-align: center; }
.tm .crm-h2 { color: var(--on-deep-accent); }
.tm__in::before { content: "\201C"; display: block; font-family: var(--font-display); font-weight: 300; font-size: 150px; line-height: .6; height: 62px; margin-bottom: 18px; color: var(--gold); }
.tm .crm-carousel { margin-top: var(--space-lg); }
.tm .crm-carousel__track { align-items: center; }
.tm .crm-quote { border-top: 0; padding-top: 0; }
.tm .crm-quote p { font-family: var(--font-display); font-style: normal; font-weight: 300; font-size: clamp(21px, 2.3vw, 31px); line-height: 1.38; margin: 0 0 .7em; color: var(--on-deep); text-wrap: pretty; }
.tm .crm-quote footer { margin-top: 26px; font: 600 12px/1.2 var(--font-sans); letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.tm .crm-carousel__nav { justify-content: center; }
.tm .crm-carousel__btn { border-color: var(--on-deep-line); color: var(--on-deep); }
.tm .crm-carousel__btn:hover { border-color: var(--on-deep-accent); color: var(--on-deep-accent); }
.tm .crm-carousel__dot { border-color: var(--on-deep-accent); }
.tm .crm-carousel__dot[aria-current="true"] { background: var(--on-deep-accent); }
.tm .crm-carousel__btn:focus-visible, .tm .crm-carousel__dot:focus-visible { outline-color: var(--on-deep-accent); }
/* Each quote rises into place as it takes over */
html.mo .tm .crm-carousel__slide { translate: 0 22px; transition: opacity .7s ease, visibility .7s, translate .9s cubic-bezier(.2, .7, .2, 1); }
html.mo .tm .crm-carousel__slide.is-active { translate: 0 0; }
@media (max-width: 760px) {
  .tm { padding: 56px 0; }
  .tm > .wrap { padding: 0 var(--space-md); }
  .tm__in::before { font-size: 110px; height: 46px; }
}

/* ---------- 5. Businesses: the section locks and the cards travel sideways ---------- */
.hz { position: relative; padding: 0 5vw; }
.hz-anchor { position: absolute; left: 0; top: 0; width: 1px; height: 1px; scroll-margin-top: var(--header-h, 70px); }
.hz__bar { display: none; }
html.mo .hz { height: 420svh; padding: 0; view-timeline: --hz block; }
html.mo .hz-anchor { top: calc((100% - 100svh) * (var(--i) + 1) / 4); }
html.mo .hz__stick { position: sticky; top: var(--header-h, 70px); height: calc(100svh - var(--header-h, 70px)); overflow: hidden; display: flex; flex-direction: column; justify-content: center; }
html.mo .hz__track { display: flex; gap: 3.5vw; width: max-content; padding: 0 9vw; will-change: translate; }
html.mo .hz__track > * { flex: none; width: min(64vw, 980px); height: min(68svh, 640px); margin: 0; border-radius: 10px; overflow: hidden; position: relative; }
html.mo .hz__track img { width: 100%; height: 100%; aspect-ratio: auto; object-fit: cover; display: block; }
html.mo .hz__track .pc-lineup { margin: 0; }
html.mo .hz__bar { display: block; height: 2px; margin: 26px 9vw 0; background: var(--line); }
html.mo .hz__bar span { display: block; height: 100%; background: var(--gold); transform-origin: 0 50%; scale: 0 1; }
@keyframes hz-slide { to { translate: calc(-100% + 100vw) 0; } }
@keyframes hz-bar { to { scale: 1 1; } }
@supports ((animation-timeline: view()) and (animation-range: entry)) {
  html.mo.sda .hz__track { animation: hz-slide auto linear both; animation-timeline: --hz; animation-range: contain 0% contain 100%; }
  html.mo.sda .hz__bar span { animation: hz-bar auto linear both; animation-timeline: --hz; animation-range: contain 0% contain 100%; }
}
@media (max-width: 760px) {
  html.mo .hz__track { padding: 0 7vw; gap: 5vw; }
  html.mo .hz__track > * { width: 82vw; height: 62svh; }
  html.mo .hz__bar { margin: 18px 7vw 0; }
}

/* ---------- 6. Free guide: the page in clear blocks ---------- */
.fg-band { border-top: var(--stroke-rule) solid var(--line); }
.fg-band--alt { background: var(--alt); }
.fg-band__in { padding: var(--section) var(--gutter); }
.fg-band .crm-signup { border-top: 0; padding-top: 0; }
.fg-inside .fg-band__in { padding-bottom: var(--space-lg); }
.fg-inside + .fg-band { border-top: 0; }
.fg-inside + .fg-band .fg-band__in { padding-top: var(--space-lg); }
@media (max-width: 760px) { .fg-band__in { padding: 48px var(--space-md); } }

/* The prompt under the opening text: an arrow that bobs, linked to the first drawing */
.fg-scroll { margin: 30px 0 0; }
.fg-scroll a { display: inline-flex; align-items: center; gap: 12px; font: 500 15px/1.3 var(--font-sans); color: var(--accent); text-decoration: none; }
.fg-scroll a:hover { color: var(--ink); }
.fg-scroll a:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.fg-scroll__arrow { flex: none; display: inline-grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--mid); border-radius: 50%; font-size: 16px; }
.fg-scroll__arrow span { display: block; }
@keyframes fg-bob { 0%, 100% { translate: 0 -3px; } 50% { translate: 0 3px; } }
html.mo .fg-scroll__arrow span { animation: fg-bob 1.7s ease-in-out infinite; }

/* The cover starts tilted back and comes up flat as the page opens */
@keyframes fg-rise {
  from { transform: perspective(1200px) translateY(70px) rotateX(38deg) rotateZ(-6deg) scale(.86); }
  to { transform: none; }
}
html.mo .fg-tilt { box-shadow: 0 22px 44px -26px rgb(10 30 24 / .45); transform-origin: 50% 100%; }
html.mo .fg-tilt.rv { transform: perspective(1200px) translateY(70px) rotateX(38deg) rotateZ(-6deg) scale(.86); filter: none; }
html.mo .fg-tilt.rv.is-in { animation: fg-rise 1.5s cubic-bezier(.2, .75, .2, 1) both; }

/* ---------- 7. Free guide: three drawings, each built step by step as its text arrives ---------- */
.gp-head { margin-bottom: var(--space-xl); }
.gp-head__num { font-family: var(--font-display); font-size: 16px; color: var(--muted); margin: 0 0 8px; }
.gp-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: var(--space-xl); }
.gp-fig { grid-column: 2; grid-row: 1; align-self: start; display: grid; place-items: center; }
.gp-steps { grid-column: 1; grid-row: 1; }
.gp-step { padding: var(--space-md) 0; max-width: 30em; }
.gp-step p { font-size: 18.5px; line-height: 1.65; margin: 0 0 14px; }
.gp-step ul { margin: 0 0 14px; padding-left: 1.2em; font-size: 18.5px; line-height: 1.6; }
/* The button sits under the last paragraph of each drawing's text */
.gp-cta { margin: 26px 0 0; }
/* The card the drawing sits in: always a step away from the block behind it */
.gp-card { margin: 0; width: min(100%, 520px); background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 18px 22px 14px; color: var(--ink); box-shadow: 0 24px 50px -34px rgb(10 30 24 / .45); }
.gp-card__top { font-family: var(--font-display); font-size: 15px; text-transform: lowercase; color: var(--ink); }
.gp-card__mw { font: 600 9px var(--font-sans); letter-spacing: .16em; color: var(--accent); margin-left: 6px; text-transform: uppercase; }
.gp-card__cap { text-align: center; margin-top: 6px; font: 600 10px/1.2 var(--font-sans); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.gp-card svg { display: block; width: 100%; height: auto; overflow: visible; }
.gp-shape { fill: none; stroke: var(--ink); stroke-width: 1.1; stroke-linecap: round; stroke-linejoin: round; }
.gp-label { font: 600 6.6px var(--font-sans); letter-spacing: .12em; fill: var(--ink); }
.gp-line { fill: none; stroke: var(--pen-blue); stroke-width: 4.5; stroke-linecap: round; }
.gp-x { fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-linecap: round; }
.gp-q { font: 500 13px var(--font-display); fill: var(--ink); text-anchor: middle; }
.gp-dots { fill: none; stroke: var(--gold); stroke-width: 2; stroke-linecap: round; stroke-dasharray: .1 5; }
.gp-o { fill: rgb(201 149 58 / .3); stroke: var(--gold); stroke-width: 2.2; }
.gp-hand { font-family: "Caveat", "Bradley Hand", "Segoe Print", cursive; font-size: 14px; fill: var(--pen-red); }
.gp-hand--big { font-size: 40px; }
.gp-hand--mid { font-size: 20px; }
.gp-thin { fill: none; stroke: var(--pen-red); stroke-width: 1; stroke-linecap: round; }
.gp-arrow { fill: none; stroke: var(--gold); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.gp-numc { fill: var(--panel); stroke: var(--gold); stroke-width: 1.6; }
.gp-numt { font: 600 10px var(--font-sans); fill: #8a6420; text-anchor: middle; }
.gp-link { fill: none; stroke: var(--gold); stroke-width: 1; stroke-linecap: round; }
[data-theme="dark"] .gp-chapter { --pen-blue: #7ea6ee; --pen-red: #f0958c; }
[data-theme="dark"] .gp-numt { fill: var(--gold); }
@media (max-width: 760px) {
  .gp-head { margin-bottom: var(--space-md); }
  .gp-grid { display: block; }
  .gp-fig { margin-bottom: var(--space-md); }
  .gp-card { padding: 12px 14px 10px; }
  .gp-step p, .gp-step ul { font-size: 16px; }
}

/* The second drawing sits on the left with its text on the right, so the three alternate */
@media (min-width: 761px) {
  .gp-chapter--flip .gp-grid { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); }
  .gp-chapter--flip .gp-fig { grid-column: 1; }
  .gp-chapter--flip .gp-steps { grid-column: 2; justify-self: end; }
}

/* With motion: the card pins beside the text. Each piece of the drawing waits, then draws when its step arrives.
   The pieces run on their own clock (not tied to the scroll position), so they stay smooth with a mouse wheel. */
html.mo .gp-fig { position: sticky; top: calc(var(--header-h, 70px) + 20px); height: calc(100svh - var(--header-h, 70px) - 40px); perspective: 1300px; }
html.mo .gp-card { width: auto; height: min(100%, 660px); aspect-ratio: 400 / 500; max-width: 100%; display: flex; flex-direction: column; opacity: 0; transform: translateY(60px) rotateX(22deg) rotateZ(-4deg) scale(.9); transition: opacity .6s ease, transform 1s cubic-bezier(.2, .75, .2, 1); }
html.mo .gp-chapter.is-in .gp-card { opacity: 1; transform: none; }
/* Each drawing redraws inside its own card only: the page around it is not laid out or painted again while
   the pieces draw. */
.gp-card { contain: layout paint; }
html.mo .gp-card svg { flex: 1; min-height: 0; width: 100%; height: 100%; }
/* Each paragraph starts at the top of its step, so it travels up until it is level with the top of the drawing
   before the next one takes over. The last step is as tall as the pinned drawing, so the last paragraph also
   reaches the top before the drawing lets go. */
html.mo .gp-step { min-height: 70svh; display: flex; flex-direction: column; justify-content: flex-start; padding: 0; }
html.mo .gp-step:last-child { min-height: calc(100svh - var(--header-h, 70px) - 40px); }
html.mo .gp-fig { place-items: start center; }
html.mo .gp-chapter [data-k] { opacity: 0; transition: opacity .3s ease, stroke-dashoffset .3s ease, scale .3s ease; }
html.mo .gp-chapter [data-k="draw"] { stroke-dasharray: 1; stroke-dashoffset: 1; }
html.mo .gp-chapter [data-k="pop"] { transform-box: fill-box; transform-origin: 50% 50%; scale: .3; }
html.mo .gp-chapter [data-k].is-on { opacity: 1; stroke-dashoffset: 0; scale: 1; transition: opacity .5s ease var(--d, 0ms), stroke-dashoffset var(--draw, .9s) cubic-bezier(.45, 0, .2, 1) var(--d, 0ms), scale .6s cubic-bezier(.2, 1.3, .4, 1) var(--d, 0ms); }
@media (max-width: 760px) {
  html.mo .gp-fig { top: var(--header-h, 56px); height: 50svh; z-index: 2; margin: 0 calc(var(--space-md) * -1); padding: 10px 0; }
  html.mo .gp-chapter .gp-fig { background: var(--bg); border-bottom: 1px solid var(--line); }
  html.mo .gp-chapter.fg-band--alt .gp-fig { background: var(--alt); }
  /* The card fills the pinned strip exactly, so it never hangs over the text beneath it */
  html.mo .gp-fig { grid-template-rows: minmax(0, 1fr); grid-template-columns: minmax(0, 1fr); }
  html.mo .gp-card { height: 100%; width: auto; justify-self: stretch; margin: 0 var(--space-md); aspect-ratio: auto; box-sizing: border-box; }
  html.mo .gp-step { min-height: 46svh; justify-content: flex-start; padding-top: 3svh; }
  html.mo .gp-step:last-child { min-height: 46svh; }
  html.mo .gp-fig { place-items: center; }
}
