/* The home page hero (how it behaves: assets/hero/README.md). The fonts, the reset, the buttons and the focus ring
   come from the site's CSS; these names point at its tokens. */
:root { --paper: var(--brand-offwhite); --ink: var(--brand-black); --g3: var(--brand-grey-300); }

.hero { position: relative; height: 100svh; -webkit-font-smoothing: antialiased; }
.hero__stage { position: sticky; top: 0; height: 100svh; overflow: hidden; }
.motion:not(.no-frames) .hero { height: 440vh; } /* Act 2's pin, from first paint, so a returning visitor who scrolls before frames.json arrives sees no jump; dropped only if it fails: 111vh of turn, 120 of photo, then the callouts and the hold (timeline.js) */

/* Measured from the black toolbar's foot, so the hero has room under it */
.hero__copy { position: absolute; left: max(5vw, env(safe-area-inset-left, 0px)); top: calc(var(--toolbar-height) + 12svh); width: 44vw; }
.hero__h1 { margin: 0; }
.hero__title { text-wrap: balance; } /* no lone last word on phones ("Live events" stays together) */
.hero__title { display: block; font-size: clamp(48px, 7.6vw, 150px); font-weight: 800; font-stretch: 62%; letter-spacing: -0.035em; word-spacing: 0.1em; line-height: 0.88; text-transform: uppercase; }
.hero__body { margin: 0.8em 0 0; max-width: 34em; font-size: clamp(16px, 1.6vw, 26px); line-height: 1.35; letter-spacing: -0.01em; }
/* The cue: plain text at the bottom centre, so it doesn't read as a button. Centred: a declared exception to the
   left-aligned rule, as are the mission and intro B's slogan */
.hero__cue { display: none; position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%); margin: 0; font: 500 13px/1.2 "Hack", ui-monospace, monospace; letter-spacing: var(--tracking-accent); text-transform: uppercase; white-space: nowrap; } /* tracked as the other Hack capitals */
/* Three slow breaths with the arrow nudging down, once the intro is over, then still: anything that
   pulses on its own for more than 5 s would need a pause button (WCAG 2.2.2). The cue's own opacity is hero.js's, so the
   pulse runs on the span inside it. Reduced motion: no .motion, no pulse */
.motion:not(.intro) .hero__cue-in { display: inline-block; animation: cue-breathe 1.6s ease-in-out 3; }
.motion:not(.intro) .hero__cue-arrow { display: inline-block; animation: cue-nudge 1.6s ease-in-out 3; }
@keyframes cue-breathe { 50% { opacity: 0.25; } }
@keyframes cue-nudge { 50% { transform: translateY(5px); } }
.hero__buttons { display: flex; flex-wrap: wrap; gap: 12px; margin: 1.6em 0 0; }

/* The speaker's box is the still's crop of the camera frame; hero.js places the drawing and the canvas relative to it.
   It shrinks only where the right-hand labels would otherwise reach the screen's edge: the labels start 0.7 × the box's
   height right of its left edge (56vw), and need 180px, the widest box (156px) plus a 24px margin, so the height is at
   most (44vw - 180px) / 0.7 (without it they ran past the edge from ~720 to 1280px wide). */
.hero { --h: min(67svh, calc((44vw - 180px) * 1.429)); }
.hero__speaker, .hero__callouts, .hero__grid { position: absolute; left: 56vw; top: calc(var(--toolbar-height) + 6svh); height: var(--h); aspect-ratio: 379.5 / 471.1; }
/* The copy stops 16px short of Made to fit (in narrow or short desktop windows the label sat on the statement). The label's left edge is 56vw + 4.93% of the box's width (0.0397 × --h) - 116px, its box (13 Hack
   capitals at 11px and 0.1em, plus 16px padding); the copy starts at 5vw. Only bites below ~1440px wide */
.hero__copy { max-width: calc(51vw + var(--h) * 0.0397 - 132px); }
.hero__callouts { pointer-events: none; } /* only the labels take the pointer: never block the button where the boxes meet */
.note { pointer-events: auto; }
.hero__still { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero__drawing, .hero__sketch, .hero__reveal { position: absolute; display: none; }
.hero__drawing svg { display: block; width: 100%; height: 100%; overflow: visible; color: var(--ink); }

/* Motion allowed: the drawing (and later the frames) take over from the still */
.motion .hero__still { opacity: 0; z-index: 1; } /* above the layers: they look the same by the end, and the still takes over (Act 2) */
.motion .hero__drawing, .motion .hero__cue { display: block; }
.motion.frames :is(.hero__sketch, .hero__reveal) { display: block; } /* only once hero.js has placed them, so nothing shifts */
.motion .hero__drawing :is(.outline, .detail) path { stroke-dasharray: 1 2; } /* gap > 1: no zero-length dash at the end for a round cap to dot */
/* Hidden, not just transparent, while Act 1 plays: no Tab stops or screen-reader links you can't see. Shown when
   Act 1 ends and kept through the scroll (a phone flick used to skip the pin and the button). */
.motion .hero__buttons { transition: opacity var(--duration-base) var(--ease-standard), visibility var(--duration-base); }
.intro .hero__buttons { opacity: 0; visibility: hidden; }

/* The callouts, drawn as the design system's notes: an open circle on the feature, a thin leader out to
   a label, the right-hand labels in one column, Made to fit on the left. The line underneath on hover or focus.
   Shown as they are; with motion, hero.js draws them on once the cover is on (timeline.js notes()). Each leader comes in
   two shapes: .wide, and .phone with its elbow tight to the array so the labels fit beside it. */
.hero__marks, .hero__notes { position: absolute; z-index: 2; }
.hero__marks { inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; } /* never in the way of the button */
.hero__marks path { fill: none; vector-effect: non-scaling-stroke; }
.hero__marks .line { stroke: var(--ink); stroke-width: 1.2; }
.hero__marks circle { fill: var(--paper); stroke: var(--ink); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.hero__marks .phone { display: none; }
.hero__notes { inset: 0; margin: 0; padding: 0; list-style: none; }
/* --x, --y: where the leader ends (% of the box). Each label is a black box the leader runs into, square like the
   highlight; hover, focus or a tap opens it to show its line in sentence-case Hack, a declared exception to Hack's
   capitals */
.note { position: absolute; left: var(--x); top: var(--y); margin-top: -11px; padding: 4px 8px 5px; width: max-content; max-width: 140px;
  background: var(--ink); color: var(--paper); cursor: pointer; }
.note--left { left: auto; right: calc(100% - var(--x)); }
.note__name { display: block; font: 400 11px/14px "Hack", ui-monospace, monospace; letter-spacing: 0.1em; text-transform: uppercase; }
/* A + says there's more, a – when open; a no-break space keeps it on the last word's line, and the
   empty alt text keeps screen readers from reading "plus" */
.note__name::after { content: "\00a0+" / ""; }
.note:is(:hover, :focus, .is-open) .note__name::after { content: "\00a0\2013" / ""; }
.note:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
/* The line underneath: always there for a screen reader, seen when the box opens */
.note__detail { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* Open: hover, focus or a tap, or hero.js's one-time demo (.is-open). It grows downward at its closed width, so it never
   reaches further right than the closed box */
.note:is(:hover, :focus, .is-open) { z-index: 3; }
.note:is(:hover, :focus, .is-open) .note__detail { position: static; display: block; width: auto; height: auto; margin-top: 6px; overflow: visible; clip-path: none;
  white-space: normal; text-align: left; font: 400 12px/1.45 "Hack", ui-monospace, monospace; letter-spacing: 0; text-transform: none; }
.motion .hero__marks .mark { opacity: 0; }
/* As each label finishes drawing, a ring leaves its point three times, like a map's hotspot: 4.8 s,
   inside WCAG 2.2.2's 5. Off-white, since an ink ring was lost on the print. hero.js adds the rings and .is-pinging */
.hero__marks .ping { fill: none; stroke: var(--paper); stroke-width: 2.5; opacity: 0; transform-box: fill-box; transform-origin: center; }
.hero__marks .is-pinging .ping { animation: ping 1.6s ease-out 3; }
@keyframes ping { from { transform: scale(1); opacity: 1; } 65% { opacity: 0.8; } to { transform: scale(4.5); opacity: 0; } }
.motion .note { opacity: 0; visibility: hidden; } /* no Tab stops you can't see, as with the buttons */

/* Act 1 is the "spec sheet" intro (intro B): on black, a drawing's title block (corner ticks, four Hack labels), the slogan rising out of its masks a row at a time,
   SOUND's highlight, then a line cut across the middle and the screen splitting open along it. The black is two halves,
   each holding the whole sheet and showing its own half (hero.js builds it), so they can part. */
.slogan { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; margin: 0; } /* for screen readers; the sheet is aria-hidden */
.sheet { display: none; position: absolute; z-index: 3; left: 0; width: 100%; height: 50%; overflow: hidden; background: var(--ink); color: var(--paper); --inset: 28px; }
.sheet--top { top: 0; }
.sheet--bottom { top: 50%; }
.intro .sheet, .skipping .sheet { display: block; }
.skipping .sheet { transition: opacity var(--duration-base) var(--ease-standard); } /* a skip before the split fades the black out */
.sheet__in { position: absolute; left: 0; top: 0; width: 100%; height: 200%; display: grid; place-items: center; }
.sheet--bottom .sheet__in { top: -100%; }
.sheet__slogan { margin: 0; font-size: min(9.6vw, 18svh); line-height: 0.95; font-weight: 700; font-stretch: 75%; letter-spacing: -0.03em; white-space: nowrap; text-align: center; }
.sheet__row { display: block; }
.sheet__mask { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.1em; margin-bottom: -0.1em; }
.sheet__rise { display: inline-block; transform: translateY(105%); }
/* SOUND's highlight fills from its underline, as the buyer cards do; on black it's inverted: an off-white block, black letters */
.sheet__snd { font-weight: 800; font-stretch: 112%; letter-spacing: -0.02em; text-transform: uppercase; padding-inline: 0.06em; margin-inline: -0.06em;
  background: linear-gradient(var(--paper), var(--paper)) 0 100% / 0 2px no-repeat; }
.sheet__snd.is-inked { color: var(--ink); }
.sheet__label { position: absolute; white-space: nowrap; font: 400 11px/1 "Hack", ui-monospace, monospace; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.75; }
.sheet__rest { visibility: hidden; }
.sheet__label--nw { left: calc(var(--inset) + 22px); top: calc(var(--inset) + 1px); }
.sheet__label--ne { right: calc(var(--inset) + 22px); top: calc(var(--inset) + 1px); }
.sheet__label--sw { left: calc(var(--inset) + 22px); bottom: calc(var(--inset) + 1px); }
.sheet__label--se { right: calc(var(--inset) + 22px); bottom: calc(var(--inset) + 1px); }
.sheet__tick { position: absolute; width: 0; height: 0; border: 0 solid var(--paper); opacity: 0.75; }
.sheet__tick--nw { left: var(--inset); top: var(--inset); border-width: 1px 0 0 1px; }
.sheet__tick--ne { right: var(--inset); top: var(--inset); border-width: 1px 1px 0 0; }
.sheet__tick--sw { left: var(--inset); bottom: var(--inset); border-width: 0 0 1px 1px; }
.sheet__tick--se { right: var(--inset); bottom: var(--inset); border-width: 0 1px 1px 0; }
/* The cut: a 2px line led by a nib, the pen's point or the blade's tip (1px read too faint) */
.sheet__rule { position: absolute; left: var(--inset); right: var(--inset); top: calc(50% - 1px); height: 2px; background: var(--paper); transform: scaleX(0); transform-origin: 0 50%; }
.sheet__nib { position: absolute; left: var(--inset); top: calc(50% - 4px); width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; background: var(--paper); opacity: 0; }
.intro .toolbar { opacity: 0; pointer-events: none; }
/* The heading, statement and cue arrive in one soft wipe, top to bottom: hero.js sets --y, how far
   the wipe's front is into each element (px); 80 px of soft edge trails it. Hidden until then. */
.intro :is(.hero__copy, .hero__cue) { --y: -1;
  -webkit-mask-image: linear-gradient(#000 calc(var(--y) * 1px - 80px), transparent calc(var(--y) * 1px));
  mask-image: linear-gradient(#000 calc(var(--y) * 1px - 80px), transparent calc(var(--y) * 1px)); }
.intro .hero__drawing :is(.outline, .detail) { stroke-dashoffset: 1; }
.intro .hero__drawing .construction { opacity: 0; }

/* Phones, and tablets held upright (701-1100px wide, portrait): there the side-by-side layout left a
   260-320px speaker whose labels overlapped the copy. Copy above, the speaker below. */
@media (max-width: 700px), (max-width: 1100px) and (orientation: portrait) {
  .hero__copy { left: 6vw; top: calc(var(--toolbar-height) + 28px); width: 88vw; max-width: none; } /* stacked: nothing beside it */
  /* Smaller and off centre where it must be, so Made to fit fits on the left and the others on the right: 100vw - 198px is the room the array has, 1.812 turns it into the box's height; left centres the
     labels' span on the screen. It starts at least 16px below the button, however the copy wraps (a script beside it in
     index.html measures it into --copy-h; 240px, its height at 320px wide, without JS), and ends 56px above the bottom, clear of the scroll cue */
  .hero__speaker, .hero__callouts, .hero__grid { --top: max(42svh, calc(var(--toolbar-height) + 28px + var(--copy-h, 240px) + 16px));
    --h: min(46svh, calc((100vw - 198px) * 1.812), calc(100svh - var(--top) - 56px));
    top: var(--top); height: var(--h); left: calc(50vw - 21px - var(--h) * 0.408); }
  .hero__marks .wide { display: none; }
  .hero__marks .phone { display: inline; }
  /* Two lines at most, not one word a line ("MADE TO / FIT +") */
  .note { left: var(--px); width: max-content; max-width: 108px; margin-top: -10px; padding: 3px 6px 4px; }
  .note--left { left: auto; right: calc(100% - var(--px)); max-width: 64px; }
  .note__name { text-wrap: balance; }
  /* No room beside the array for an open box: it opens from the screen's edge, 10px in, over the speaker. The box's left
     edge sits at 50vw - 21px - 0.408 × --h and its width is 0.8056 × --h (379.5 / 471.1), as set above */
  .note:is(:hover, :focus, .is-open) { width: 200px; max-width: 200px; left: auto; right: calc(10px - (50vw + 21px - var(--h) * 0.3976)); }
  .note--left:is(:hover, :focus, .is-open) { right: auto; left: calc(10px - (50vw - 21px - var(--h) * 0.408)); }
}
@media (max-width: 700px) {
  .motion:not(.no-frames) .hero { height: 275vh; } /* 57vh of turn, 62 of photo, then the callouts and the hold */
  .note__name { font-size: 10px; line-height: 13px; letter-spacing: 0.08em; }
  .sheet { --inset: 16px; }
  .sheet__slogan { font-size: min(14.6vw, 12svh); } /* three rows (hero.js) */
  .sheet__label { font-size: 10px; }
}

/* Phones held sideways: wide enough for the side-by-side layout but only
   ~300-430px tall, so the pinned, screen-high stage cut the title off and hid the statement and the button for the whole
   scroll. Here the stage stops pinning and grows to fit the copy, and the page scrolls normally. index.html also skips
   the motion here, so the finished still shows (as for reduced motion); turned sideways after load, this still applies */
@media (orientation: landscape) and (max-height: 500px) {
  .hero, .motion:not(.no-frames) .hero { height: auto; }
  .hero__stage { position: relative; height: auto; min-height: 100svh; overflow: clip visible; padding-top: calc(var(--toolbar-height) + 24px); box-sizing: border-box; }
  .hero__copy { position: relative; top: auto; padding-bottom: 40px; } /* the space above is the stage's padding: a margin here escaped the hero */
}
/* The smallest phones sideways (under 700px wide, e.g. an iPhone SE): the stacked layout leaves the speaker no height, only a
   stray label, so it goes; the copy has the screen */
@media (orientation: landscape) and (max-height: 500px) and (max-width: 700px) {
  .hero__speaker, .hero__callouts, .hero__grid { display: none; }
}

/* A faint drafting grid behind the speaker, the paper the sketch is drawn on, so it's there from the
   start. It shares the speaker's box (and, on phones, its --top and --h), then grows past it: 45% of the speaker's width
   each side, 8% of its height above and below (its width is 0.8056 × --h). 32px squares in grey-300, fading out from
   the middle. After the phone rule, so its size wins there too */
.hero__grid {
  aspect-ratio: auto; height: calc(var(--h) * 1.16); width: calc(var(--h) * 0.8056 * 1.9);
  margin-top: calc(var(--h) * -0.08); margin-left: calc(var(--h) * 0.8056 * -0.45);
  pointer-events: none;
  background-image: linear-gradient(to right, var(--brand-grey-300) 1px, transparent 1px), linear-gradient(to bottom, var(--brand-grey-300) 1px, transparent 1px);
  background-size: 32px 32px; background-position: center;
  -webkit-mask-image: radial-gradient(farthest-side, #000 55%, transparent); mask-image: radial-gradient(farthest-side, #000 55%, transparent);
}

/* The grid's hover (90%, an 80px circle, a 140ms glide): the grid darkens under the cursor. A darker copy of the grid shows only
   in a soft circle at --mx/--my, which home.js sets from the pointer; registered, so the circle glides after it */
@property --mx { syntax: "<length>"; inherits: true; initial-value: -999px; }
@property --my { syntax: "<length>"; inherits: true; initial-value: -999px; }
.hero__grid::after {
  content: ""; position: absolute; inset: 0; opacity: 0;
  background-image: linear-gradient(to right, var(--brand-grey-500) 1px, transparent 1px), linear-gradient(to bottom, var(--brand-grey-500) 1px, transparent 1px);
  background-size: 32px 32px; background-position: center;
  -webkit-mask-image: radial-gradient(circle 80px at var(--mx) var(--my), #000 20%, transparent);
  mask-image: radial-gradient(circle 80px at var(--mx) var(--my), #000 20%, transparent);
  transition: opacity var(--duration-base) ease, --mx 140ms ease-out, --my 140ms ease-out;
}
.hero__grid.is-lit::after { opacity: 0.9; }
@media (prefers-reduced-motion: reduce) { .hero__grid::after { transition: opacity var(--duration-base) ease; } } /* follows exactly, no glide */
