/* Cannonball Musical Instruments: shared design system. Page stylesheets add only their own set piece. */

/* Tokens: palette, type scale, frame measures, timing. Use the variables, never raw values. */
:root {
  --ground: #DCE0F1;
  --ink: #25213B;
  --sun: #F5D342;
  --panel: #EBE8F8;
  --grid: #C8CDE3;
  --display: 'Red Hat Display', 'Avenir Next', 'Segoe UI', sans-serif;
  --text: 'Libre Baskerville', Baskerville, Georgia, serif;
  --fs-body: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
  --fs-small: 0.9375rem;
  --fs-quote: clamp(2.75rem, 6vw, 8rem);
  --fs-title: clamp(2.5rem, 5.2vw, 7rem);
  --fs-sign: clamp(1.75rem, 2.4vw, 2.25rem);
  --fs-sub: clamp(1.375rem, 1.8vw, 1.75rem);
  --line: 0.125rem;
  --hair: 0.0625rem;
  --inset: 0.3125rem;
  --cell: 1.5rem;
  --gutter: clamp(1rem, 4vw, 3rem);
  --gap: clamp(1rem, 2.4vw, 2rem);
  --poster-pad: clamp(2.5rem, 7vh, 5rem);
  --dock-h: 4rem;
  --mast-h: 5.25rem;
  --frame-bg: var(--panel);
  --frame-ink: var(--ink);
  --quick: 180ms;
  --state: 200ms;
}

/* Base: solid lilac ground, Baskerville reading text, no bold tier anywhere. */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-bottom: var(--dock-h);
}
body {
  margin: 0;
  padding-bottom: var(--dock-h);
  background: var(--ground);
  color: var(--ink);
  font: 400 var(--fs-body)/1.65 var(--text);
  overflow-wrap: break-word;
}
img, video, svg { display: block; max-width: 100%; height: auto; }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.25em; }
b, strong { font-weight: 400; background: linear-gradient(transparent 62%, var(--sun) 62%); }
::selection { background: var(--sun); color: var(--ink); }
[hidden] { display: none !important; }

/* Headings: Red Hat Display italic 400, sentence case. h1/h2 default to section-title size, h3 to .sub. */
h1, h2, h3, .quote, .title, .sign, .sub {
  margin: 0;
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
  text-wrap: balance;
}
h1, h2, .title { font-size: var(--fs-title); line-height: 1.04; }
h3, .sub { font-size: var(--fs-sub); line-height: 1.2; }
/* Type roles: .quote (owner line, 5-8rem), .title (section), .sign (small signature h1), .sub, .lead, .note, .measure. */
.quote { font-size: var(--fs-quote); line-height: 1; }
.sign { font-size: var(--fs-sign); line-height: 1.15; }
.lead { font-size: clamp(1.125rem, 1rem + 0.6vw, 1.4375rem); line-height: 1.55; max-width: 34em; }
.note { font-size: var(--fs-small); line-height: 1.5; }
.measure { max-width: 36em; }

/* Links: plain underline, sunflower field on hover and focus. Any <a> in text. */
a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: var(--hair);
  text-underline-offset: 0.22em;
  transition: background-color var(--quick) linear;
}
a:hover, a:focus-visible { background-color: var(--sun); }
:focus-visible { outline: 0.1875rem solid var(--ink); outline-offset: 0.125rem; }

/* Skip link: .skip, appears on keyboard focus only. */
.skip {
  position: absolute;
  left: 0.5rem;
  top: 0.5rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--sun);
  transform: translateY(-300%);
}
.skip:focus { transform: none; }

/* Masthead: .mast holds the business name large (.mast__name, .mast__mark); it scrolls away. On phones the .call cell sits in the same row, at the right. */
.mast {
  padding: 0.75rem var(--gutter) 0.625rem;
  background: var(--ground);
}
.mast__name {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  min-height: 2.75rem;
  font: italic 400 clamp(1.5rem, 3.4vw, 3rem)/1.1 var(--display);
  text-decoration: none;
}
.mast__mark { width: 1.9em; flex: none; }
@media (max-width: 39.99rem) {
  .mast {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
  }
  .mast__name { flex: 0 1 auto; min-width: 0; }
}

/* Bottom dock: .dock fixed lavender bar, three equal cells, sunflower on [aria-current] or .is-current; .dock__n is the step number. */
.dock {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 50;
  display: flex;
  padding: 0.375rem 0 env(safe-area-inset-bottom, 0);
  background: var(--panel);
  border-top: var(--line) solid var(--ink);
  box-shadow: inset 0 var(--inset) 0 var(--panel), inset 0 0.375rem 0 var(--ink);
}
.dock a {
  flex: 1 1 0;
  min-width: 0;
  display: grid;
  place-items: center;
  min-height: 3.375rem;
  padding: 0.5rem 0.75rem;
  font-size: 1.0625rem;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
}
.dock a + a { border-left: var(--hair) solid var(--ink); }
.dock a:hover { background-color: var(--grid); }
.dock a[aria-current], .dock a.is-current { background-color: var(--sun); }
.dock a:focus-visible { outline-offset: -0.3125rem; }
.dock__n { font-variant-numeric: tabular-nums; }
@media (max-width: 39.99rem) {
  .dock a { padding: 0.375rem 0.25rem; font-size: 0.9rem; line-height: 1.2; }
  .dock__n { display: block; }
}

/* Call control: .call, phones only; a small square icon in the masthead row beside the name. It is in the flow and scrolls away with the masthead. */
.call { display: none; }
@media (max-width: 39.99rem) {
  .call {
    flex: none;
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    border: var(--line) solid var(--ink);
    background: var(--panel);
    color: var(--ink);
    text-decoration: none;
  }
  .call svg { width: 1.375rem; height: 1.375rem; }
}

/* Footer: .foot one compact centred line (.foot__line) on the plain ground; no container or divider. */
.foot {
  padding: 0.75rem var(--gutter) 1rem;
  background: var(--ground);
}
.foot__line {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0 1.125rem;
  font-size: var(--fs-small);
  line-height: 1.4;
  text-align: center;
}
.foot__line a, .foot__line button {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
}
.foot__line button {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  text-decoration-thickness: var(--hair);
  text-underline-offset: 0.22em;
  cursor: pointer;
}
.foot__line button:hover { background-color: var(--sun); }

/* Consent strip: #consent, full-width ink band stuck to the top of the window; one short line, two equal compact choices. */
#consent {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.375rem 1.5rem;
  padding: 0.375rem var(--gutter);
  background: var(--ink);
  color: var(--panel);
  font-size: var(--fs-small);
  line-height: 1.4;
}
#consent p { margin: 0; flex: 1 1 16rem; }
#consent a:hover, #consent a:focus-visible { color: var(--ink); }
#consent :focus-visible { outline-color: var(--sun); }
.consent__choices { display: flex; gap: 0.5rem; flex: 0 1 auto; }
#consent button {
  flex: 1 1 0;
  min-height: 2.75rem;
  padding: 0.25rem 1rem;
  border: var(--hair) solid var(--panel);
  background: var(--ink);
  color: var(--panel);
  font: inherit;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--state) linear, color var(--state) linear, border-color var(--state) linear;
}
#consent button:hover {
  background: var(--sun);
  border-color: var(--sun);
  color: var(--ink);
}
@media (max-width: 39.99rem) {
  #consent { gap: 0.25rem 1rem; }
  #consent p { flex: 1 1 100%; }
  .consent__choices { flex: 1 1 100%; }
  #consent button { padding: 0.25rem 0.5rem; }
}

/* Offer bar: #promo sunflower double-ringed stamp fixed above the dock; presses in with .is-in. */
#promo {
  position: fixed;
  right: var(--gutter);
  bottom: calc(var(--dock-h) + 1rem);
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: min(24rem, calc(100vw - 2 * var(--gutter)));
  padding: 1rem 1.25rem 1rem 1.75rem;
  border: var(--line) solid var(--ink);
  border-radius: 3rem;
  box-shadow: inset 0 0 0 var(--inset) var(--sun), inset 0 0 0 0.375rem var(--ink);
  background: var(--sun);
  font-size: var(--fs-small);
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  transform: translateY(1.5rem) rotate(-3deg) scale(1.12);
  transition: transform var(--quick) cubic-bezier(0.2, 0, 0, 1), opacity var(--quick) linear;
}
#promo.is-in { opacity: 1; pointer-events: auto; transform: rotate(-3deg); }
#promo p { margin: 0; }
#promo a:hover { background-color: var(--panel); }
#promo button {
  flex: none;
  width: 2.75rem;
  height: 2.75rem;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  color: var(--sun);
  font: 400 1.5rem/1 var(--text);
  cursor: pointer;
}
@media (max-width: 39.99rem) {
  #promo { left: var(--gutter); right: var(--gutter); bottom: calc(var(--dock-h) + 0.5rem); padding: 0.625rem 0.75rem 0.625rem 1.25rem; }
  #promo.is-in { transform: none; }
}

/* Poster: <section class="poster"> one viewport-tall screen on the 24px registration grid; .poster--auto drops the height. Keep all text inside .panel. */
.poster {
  position: relative;
  display: grid;
  align-content: center;
  gap: var(--gap);
  min-height: calc(100vh - var(--dock-h));
  min-height: calc(100svh - var(--dock-h));
  padding: var(--poster-pad) var(--gutter);
  background-color: var(--ground);
  background-image:
    linear-gradient(var(--grid) var(--hair), transparent var(--hair)),
    linear-gradient(90deg, var(--grid) var(--hair), transparent var(--hair));
  background-size: var(--cell) var(--cell);
}
.poster--auto { min-height: 0; }
.poster > * { width: 100%; max-width: 86rem; margin-inline: auto; }

/* Double frame: 2px outer line, 1px inner line inset 5px, square. .frame on anything; .panel, .mount, .btn, .stamp carry it already. */
.frame, .panel, .mount, .btn, .stamp {
  --frame-bg: var(--panel);
  border: var(--line) solid var(--frame-ink);
  border-radius: 0;
  box-shadow: inset 0 0 0 var(--inset) var(--frame-bg), inset 0 0 0 0.375rem var(--frame-ink);
  background: var(--frame-bg);
  transition: border-color var(--quick) linear, box-shadow var(--quick) linear, background-color var(--quick) linear;
}

/* Text panel: .panel opaque lavender for all copy; .panel--sun sunflower field; .panel--tight less padding. */
.panel { padding: clamp(1.25rem, 3vw, 2.75rem); }
.panel--tight { padding: 1rem 1.125rem; }
.panel--sun { --frame-bg: var(--sun); }
.panel > :last-child { margin-bottom: 0; }
.panel > * + h2, .panel > * + h3 { margin-top: 0.75em; }
.panel > h1 + *, .panel > h2 + *, .panel > h3 + * { margin-top: 0.6em; }

/* Photo mount: <figure class="mount"> img + figcaption; ratios .mount--tall (4:5), .mount--wide (16:9), .mount--square. */
.mount {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0.375rem;
}
.mount img, .mount video {
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
}
.mount--tall img, .mount--tall video { aspect-ratio: 4 / 5; }
.mount--wide img, .mount--wide video { aspect-ratio: 16 / 9; }
.mount--square img, .mount--square video { aspect-ratio: 1; }
.mount figcaption {
  padding: 0.625rem 0.75rem 0.5rem;
  font-size: var(--fs-small);
  line-height: 1.45;
}
/* Crop helpers for using one photograph as two matched halves: .crop-left, .crop-right on the img. */
.crop-left { object-position: left center; }
.crop-right { object-position: right center; }

/* The matched pair (recurring device): .pair two equal frames, then a .rimline as last child; .pair--stack goes one column on phones. */
.pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
  align-items: start;
}
.pair > .rimline { grid-column: 1 / -1; }
.pair--stretch { align-items: stretch; }

/* Registration line: .rimline ruler with a long tick under each frame centre (--tick-a, --tick-b); .rimline--mid one centre tick. Keep it clear of text. */
.rimline {
  --tick-a: calc(25% - var(--gap) / 4);
  --tick-b: calc(75% + var(--gap) / 4);
  height: 1rem;
  border-top: var(--line) solid var(--ink);
  background:
    linear-gradient(var(--ink), var(--ink)) var(--tick-a) 0 / var(--line) 100% no-repeat,
    linear-gradient(var(--ink), var(--ink)) var(--tick-b) 0 / var(--line) 100% no-repeat,
    repeating-linear-gradient(90deg, var(--ink) 0 var(--hair), transparent var(--hair) var(--cell)) 0 0 / 100% 35% no-repeat;
}
.rimline--mid { --tick-a: 50%; --tick-b: 50%; }
@media (max-width: 47.99rem) {
  .pair--stack { grid-template-columns: minmax(0, 1fr); }
  .pair--stack > .rimline { --tick-a: 50%; --tick-b: 50%; }
}

/* Page opening: <section class="poster opening"> with .opening__text (a .panel holding h1 + .lead + link) beside .opening__view (a .mount). Fits the first window. */
.opening {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  align-items: stretch;
  min-height: calc(100vh - var(--dock-h) - var(--mast-h));
  min-height: calc(100svh - var(--dock-h) - var(--mast-h));
  padding-top: clamp(1rem, 3vh, 2rem);
}
.opening__text {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.opening__view img, .opening__view video { height: clamp(16rem, 58vh, 38rem); }
@media (max-width: 47.99rem) {
  .opening { grid-template-columns: minmax(0, 1fr); }
  .opening__view img, .opening__view video { height: 34vh; min-height: 12rem; }
}

/* Facts ledger: <dl class="facts"> of <div><dt><dd></div> rows running the full width, alternate rows on the ground colour. */
.facts { margin: 0; }
.facts > div {
  display: grid;
  grid-template-columns: minmax(8rem, 1fr) minmax(0, 2fr);
  gap: 0.25rem 1.5rem;
  padding: 0.75rem 0.875rem;
}
.facts > div:nth-child(odd) { background: var(--ground); }
.facts dt { font-family: var(--display); font-style: italic; }
.facts dd { margin: 0; }
@media (max-width: 29.99rem) {
  .facts > div { grid-template-columns: minmax(0, 1fr); }
}

/* Framed link or button: .btn (double frame, square); sunflower when hovered, .is-on, aria-pressed or aria-current. .btn-row lines several up. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  min-height: 3rem;
  padding: 0.75rem 1.375rem;
  color: var(--ink);
  font: 400 1rem/1.3 var(--text);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover, .btn.is-on, .btn[aria-pressed="true"], .btn[aria-current] {
  --frame-bg: var(--sun);
  background-color: var(--sun);
}
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}
@media (max-width: 39.99rem) {
  .btn-row--scroll { flex-wrap: nowrap; overflow-x: auto; padding: 0.375rem; }
  .btn-row--scroll .btn { flex: none; }
}

/* Dealer stamp: <a class="stamp reveal"> round sunflower double ring, slightly rotated; presses in once when seen. */
.stamp {
  --frame-bg: var(--sun);
  display: grid;
  place-items: center;
  width: clamp(11rem, 18vw, 15rem);
  aspect-ratio: 1;
  padding: 1.5rem;
  border-radius: 50%;
  color: var(--ink);
  font: italic 400 clamp(1.5rem, 2.3vw, 2rem)/1.1 var(--display);
  text-align: center;
  text-decoration: none;
  transform: rotate(-8deg);
}
.stamp:hover, .stamp:focus-visible {
  --frame-bg: var(--panel);
  background-color: var(--panel);
}
.js .stamp.reveal { opacity: 0; transform: rotate(-8deg) scale(1.12); }
.js .stamp.reveal.is-in {
  opacity: 1;
  transform: rotate(-8deg);
  transition: transform var(--quick) cubic-bezier(0.2, 0, 0, 1), opacity var(--quick) linear,
    box-shadow var(--quick) linear, background-color var(--quick) linear;
}

/* Reveal on scroll: .reveal on a frame; its lines register from grid colour to ink (180ms) when seen. Nothing moves. */
.js .reveal { --frame-ink: var(--grid); }
.js .reveal.is-in { --frame-ink: var(--ink); }

/* Hand-off: .handoff, the last block of a page: a .panel with the next step on the left and a .btn or .stamp on the right. */
.handoff {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap);
}
.handoff > :first-child { flex: 1 1 20rem; }

/* Reduced motion: every state change is immediate. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0s !important;
    animation-duration: 0s !important;
    scroll-behavior: auto !important;
  }
  .js .stamp.reveal { opacity: 1; transform: rotate(-8deg); }
}

/* Print: chrome off, grid off; pages add their own print layout. */
@media print {
  .dock, .call, #consent, #promo, .skip { display: none !important; }
  body { padding-bottom: 0; }
  .poster { min-height: 0; background-image: none; }
}

/* A page never scrolls sideways. */
html, body { overflow-x: clip; }
/* Past a full-HD window the whole page grows with the window - type, gaps and pictures
   together - so a very wide screen (or a page zoomed far out) shows the same composition,
   not a small column of text lost in an enormous picture. */
@media (min-width: 1921px) { html { font-size: calc(100vw / 120); } }
/* What can be pressed in the chrome lies above the page: a huge headline's line box reaching
   into the navigation must not swallow the clicks meant for the links. */
header a, header button, nav a, nav button { position: relative; z-index: 2; }
/* A visitor who asked the system for less motion gets none, whatever a page forgot. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
