/* V1 brand intro (Mat approved, BUR-976), ported from the approved intro.css (ef4d99b6): pure CSS, no inline styles (CSP style-src 'self').
   Base styles ARE the final frame, so prefers-reduced-motion shows the logo lockup only. Colours come from tokens.css (light and dark).
   Geometry: stage 100cqw x 56.25cqw; SVG user unit = 0.625cqw (viewBox 160x90); hub = stage centre (50cqw, --hy).
   Under 600px the stage is 4:5 with stacked tiles and the 100x125 link layer; every text there is at least 14px.
   Beats: tiles 0.1s, lines 1.0s, data 1.3s, pulled in 2.2s, hub becomes the icon 3.05s, f 3.5s, slide + wordmark 4.55s, line 6s, hold to 8s. */
@font-face { font-family: "Manrope"; src: url("fonts/manrope-latin-wght.938c6e8019b6.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
.brand-intro { width: 100%; }
.fi-stage { --ease: cubic-bezier(.16, 1, .3, 1); --io: cubic-bezier(.55, 0, .45, 1);
  /* lockup: icon S + gap G + wordmark (3.155em = Manrope 750 "foodie" 2.855em measured + gap .1em + dot .2em); --cy lockup centre, --hy hub start */
  --S: 7.4cqw; --G: 1.6cqw; --F: 7.2cqw; --L: calc(var(--S) + var(--G) + var(--F) * 3.155); --cy: 24.75cqw; --hy: 28.125cqw;
  container-type: inline-size; position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden;
  background: radial-gradient(70% 80% at 50% 45%, var(--surface) 0%, var(--paper) 72%); color: var(--ink);
  font-family: "Manrope", system-ui, sans-serif; }
.fi-stage * { box-sizing: border-box; }
.fi-stage p { margin: 0; max-width: none; color: var(--ink); } /* host pages style p (muted, 70ch): the stage keeps its own */

/* Ambient: drifting dot grid, glow behind the lockup. fi-drift is the 8 s timeline; brand-welcome.js continues when it ends. */
.fi-grid { position: absolute; inset: -4cqw; background: radial-gradient(circle, color-mix(in srgb, var(--ink) 11%, transparent) .1cqw, transparent .14cqw) 0 0 / 2.4cqw 2.4cqw;
  mask-image: radial-gradient(55% 60% at 50% 50%, #000 15%, transparent 100%); animation: fi-drift 8s linear both; }
@keyframes fi-drift { from { transform: translate(1.2cqw, .6cqw); } to { transform: translate(-1.2cqw, -.6cqw); } }
.fi-glow { position: absolute; left: 50%; top: 47%; width: 52cqw; aspect-ratio: 1; border-radius: 50%; translate: -50% -50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--tomato) 12%, transparent) 0%, transparent 60%); animation: fi-glow 1.4s var(--ease) 3s both; }
@keyframes fi-glow { from { opacity: 0; scale: .4; } }

/* Connections: from a port on each tile's inner edge to the hub; they draw, carry data, then retract into the hub with the tiles */
.fi-links { position: absolute; inset: 0; width: 100%; height: 100%; }
.fi-links--m { display: none; }
.fi-links .k1 { --ld: 1s; --o: 2.2s; --lx: 28.4px; --ly: 20.7px; } .fi-links .k2 { --ld: 1.06s; --o: 2.25s; --lx: -28.4px; --ly: 20.7px; }
.fi-links .k3 { --ld: 1.12s; --o: 2.3s; --lx: 28.4px; --ly: -20.7px; } .fi-links .k4 { --ld: 1.18s; --o: 2.35s; --lx: -28.4px; --ly: -20.7px; }
.fi-links line { stroke: var(--intro-link); stroke-width: .3; stroke-linecap: round; stroke-dasharray: 1; opacity: 0;
  animation: fi-draw .6s var(--ease) var(--ld) both, fi-retract .8s var(--io) var(--o) forwards; }
@keyframes fi-draw { from { opacity: 1; stroke-dashoffset: 1; } to { opacity: 1; stroke-dashoffset: 0; } }
@keyframes fi-retract { from { opacity: 1; stroke-dashoffset: 0; } to { opacity: 1; stroke-dashoffset: -1; } }
.fi-links .port { fill: var(--surface); stroke: var(--tomato); stroke-width: .3; opacity: 0; transform-box: fill-box; transform-origin: center;
  animation: fi-pop .4s var(--ease) var(--ld) both, fi-out .2s linear var(--o) forwards; }
@keyframes fi-out { from { opacity: 1; } to { opacity: 0; } }
.fi-links .dot { fill: var(--tomato); opacity: 0; animation: fi-travel .7s var(--io) var(--dd) both; }
.fi-links .w1 { --dd: calc(var(--ld) + .3s); } .fi-links .w2 { --dd: calc(var(--ld) + .75s); }
@keyframes fi-travel { 0% { opacity: 0; transform: translate(0, 0); } 12%, 85% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--lx), var(--ly)); } }

/* The four things a kitchen juggles: pop in, then get pulled into the hub. Text never drops below 14px; a longer
   label (ES) widens its tile from the centre instead of overflowing. */
.fi-tile { position: absolute; width: max-content; min-width: 20.5cqw; padding: 1.6cqw 1.8cqw; border-radius: 1.5cqw; background: var(--surface); translate: -50% -50%; opacity: 0;
  box-shadow: 0 1.4cqw 3cqw -1.6cqw rgb(var(--shade) / 30%), 0 .1cqw .4cqw rgb(var(--shade) / 8%), inset 0 0 0 .06cqw var(--intro-edge);
  display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 1.2cqw; row-gap: .55cqw;
  animation: fi-tile-in .8s var(--ease) var(--d) both, fi-tile-out .8s var(--io) var(--o) forwards; }
@keyframes fi-tile-in { from { opacity: 0; transform: translate(var(--fx), var(--fy)) scale(.8); } to { opacity: 1; transform: none; } }
@keyframes fi-tile-out { 0% { opacity: 1; transform: none; } 75% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--cx), var(--cy)) scale(.35); } }
.fi-t1 { left: 22%; top: 27%; --fx: -5cqw; --fy: -3cqw; --cx: 28cqw; --cy: 12.94cqw; --d: .1s; --o: 2.2s; }
.fi-t2 { left: 78%; top: 27%; --fx: 5cqw; --fy: -3cqw; --cx: -28cqw; --cy: 12.94cqw; --d: .2s; --o: 2.25s; }
.fi-t3 { left: 22%; top: 73%; --fx: -5cqw; --fy: 3cqw; --cx: 28cqw; --cy: -12.94cqw; --d: .3s; --o: 2.3s; }
.fi-t4 { left: 78%; top: 73%; --fx: 5cqw; --fy: 3cqw; --cx: -28cqw; --cy: -12.94cqw; --d: .4s; --o: 2.35s; }
.fi-tile svg { width: 4.1cqw; height: 4.1cqw; grid-row: span 2; }
.fi-tile svg * { fill: none; stroke: var(--ink); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.fi-tile svg .tf { fill: var(--tomato); stroke: none; }
.fi-tile b { font-size: max(14px, 1.6cqw); font-weight: 750; letter-spacing: -.01em; line-height: 1.2; white-space: nowrap; }
.fi-tile i { justify-self: start; font-style: normal; font-size: max(14px, 1.12cqw); font-weight: 700; line-height: 1.2; padding: .25em .7em; border-radius: 99px;
  background: var(--tomato-soft); color: var(--tomato-deep); white-space: nowrap; animation: fi-pop .5s var(--ease) calc(var(--d) + .45s) both; }
@keyframes fi-pop { 0% { opacity: 0; transform: scale(0); } 60% { opacity: 1; transform: scale(1.12); } 100% { opacity: 1; transform: scale(1); } }
.fi-tile .bar { transform-box: fill-box; transform-origin: 50% 100%; animation: fi-bar 1.8s ease-in-out .5s both; }
.fi-tile .b2 { animation-delay: .65s; } .fi-tile .b3 { animation-delay: .8s; }
@keyframes fi-bar { 0% { transform: scaleY(.35); } 35% { transform: scaleY(1); } 65% { transform: scaleY(.55); } 100% { transform: scaleY(.85); } }

/* Lockup, centred by construction from --S/--G/--F; word baseline set so its ascender block (.71em) is centred on the icon */
.fi-word { position: absolute; left: calc(50cqw - var(--L) / 2 + var(--S) + var(--G)); top: calc(var(--cy) - var(--F) * .515);
  font-size: var(--F); font-weight: 750; letter-spacing: -.045em; line-height: 1; white-space: nowrap; animation: fi-word .8s var(--ease) 5.1s both; }
.fi-word i { display: inline-block; width: .2em; height: .2em; margin-left: .1em; border-radius: 50%; background: var(--tomato);
  animation: fi-pop .45s var(--ease) 5.75s both; }
@keyframes fi-word { from { opacity: 0; transform: translateX(-2.5cqw); clip-path: inset(-10% 100% -10% 0); } to { opacity: 1; transform: none; clip-path: inset(-10% 0 -10% 0); } }

/* Hub -> app icon (favicon geometry, --brand-tile: charcoal in both themes): a dot at the centre, grows into the rounded square as the tiles land,
   the f draws, the dot drops in, then it slides left */
.fi-mark { position: absolute; left: calc(50cqw - var(--L) / 2 + var(--S) / 2); top: var(--cy); width: var(--S); aspect-ratio: 1; translate: -50% -50%;
  animation: fi-move .85s cubic-bezier(.65, 0, .35, 1) 4.55s both; }
@keyframes fi-move { from { transform: translate(calc(var(--L) / 2 - var(--S) / 2), calc(var(--hy) - var(--cy))); } to { transform: none; } }
.fi-hub { position: absolute; inset: 0; border-radius: 21.875%; background: var(--brand-tile);
  box-shadow: 0 1cqw 2cqw -.8cqw rgb(var(--shade) / 45%), 0 .15cqw .4cqw rgb(var(--shade) / 15%), 0 0 0 .2cqw var(--intro-edge); animation: fi-hub 2.9s var(--ease) .7s both; }
@keyframes fi-hub {
  0% { opacity: 0; transform: scale(.12); border-radius: 50%; }
  12% { opacity: 1; transform: scale(.36); border-radius: 50%; }
  19%, 81% { opacity: 1; transform: scale(.3); border-radius: 50%; }
  95% { transform: scale(1.06); border-radius: 21.875%; }
  100% { opacity: 1; transform: scale(1); border-radius: 21.875%; } }
.fi-hub svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.fi-hub :is(.f, .fx) { fill: none; stroke: var(--on-brand-tile); stroke-width: 3.2; stroke-linecap: round; stroke-dasharray: 1; }
.fi-hub .f { animation: fi-f .5s var(--ease) 3.5s both; } .fi-hub .fx { animation: fi-f .3s var(--ease) 3.9s both; }
/* opacity hides the round-cap speck a zero-length dash leaves before drawing starts */
@keyframes fi-f { from { stroke-dashoffset: 1; opacity: 0; } 8% { opacity: 1; } to { stroke-dashoffset: 0; opacity: 1; } }
.fi-hub .dot { fill: var(--tomato); transform-box: fill-box; transform-origin: center; animation: fi-pop .45s var(--ease) 4.1s both; }

.fi-stage .fi-line { position: absolute; left: 50%; top: calc(var(--cy) + var(--S) / 2 + 1.84cqw); translate: -50% 0; font-size: max(14px, 1.55cqw); font-weight: 550;
  letter-spacing: .01em; line-height: 1.2; color: var(--muted); white-space: nowrap; animation: fi-fade .7s var(--ease) 6s both; }
@keyframes fi-fade { from { opacity: 0; transform: translateY(.8cqw); } }

/* Under 600px: 4:5 stage (height 125cqw), tiles stacked above and below the hub (50cqw, 62.5cqw), bigger lockup. */
@media (max-width: 599.98px) {
  .fi-stage { aspect-ratio: 4 / 5; --S: 16cqw; --G: 3.4cqw; --F: 15.5cqw; --cy: 59cqw; --hy: 62.5cqw; }
  .fi-links--w { display: none; }
  .fi-links--m { display: block; }
  .fi-links--m line { stroke-width: .5; }
  .fi-links--m .port { stroke-width: .5; }
  .fi-links--m .k1 { --lx: 19px; --ly: 24.5px; } .fi-links--m .k2 { --lx: -19px; --ly: 24.5px; }
  .fi-links--m .k3 { --lx: 19px; --ly: -24.5px; } .fi-links--m .k4 { --lx: -19px; --ly: -24.5px; }
  .fi-glow { top: 47.2%; width: 95cqw; }
  .fi-tile { width: 44cqw; min-width: 0; padding: 3cqw; border-radius: 3.5cqw; grid-template-columns: minmax(0, 1fr); row-gap: 1.6cqw; }
  .fi-tile svg { width: 9cqw; height: 9cqw; grid-row: auto; }
  .fi-tile b { font-size: max(14px, 4.4cqw); white-space: normal; }
  .fi-tile i { font-size: max(14px, 3.9cqw); border-radius: 1em; white-space: normal; }
  .fi-t1 { left: 25%; top: 17.6%; --fx: -4cqw; --fy: -4cqw; --cx: 25cqw; --cy: 40.5cqw; }
  .fi-t2 { left: 75%; top: 17.6%; --fx: 4cqw; --fy: -4cqw; --cx: -25cqw; --cy: 40.5cqw; }
  .fi-t3 { left: 25%; top: 82.4%; --fx: -4cqw; --fy: 4cqw; --cx: 25cqw; --cy: -40.5cqw; }
  .fi-t4 { left: 75%; top: 82.4%; --fx: 4cqw; --fy: 4cqw; --cx: -25cqw; --cy: -40.5cqw; }
  .fi-stage .fi-line { top: calc(var(--cy) + var(--S) / 2 + 5cqw); font-size: max(14px, 4.4cqw); }
}

/* Once-after-sign-up welcome: full-screen modal dialog over Get started (brand-welcome.js opens it; without script it never shows). */
.brand-welcome { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 24px;
  border: 0; background: var(--paper); color: var(--ink); overflow: auto; font: 16px/1.5 "Manrope", system-ui, sans-serif; }
.brand-welcome[open] { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; }
.brand-welcome::backdrop { background: var(--paper); }
.brand-welcome .brand-intro { width: min(100%, 1280px, calc((100dvh - 136px) * 16 / 9)); }
.brand-welcome .fi-stage { border-radius: 16px; }
.brand-welcome__title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.brand-welcome .brand-welcome__skip { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 20px; border: 1px solid var(--field);
  border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; font-weight: 650; cursor: pointer; }
.brand-welcome .brand-welcome__skip:hover { background: var(--tomato-light); }
.brand-welcome .brand-welcome__skip:focus-visible { outline: 3px solid var(--tomato); outline-offset: 3px; }
.brand-welcome__still { display: none; } /* two-class selectors above outrank the host pages' button and focus rules */
@media (max-width: 599.98px) { .brand-welcome { padding: 16px; } .brand-welcome .brand-intro { width: min(100%, calc((100dvh - 120px) * 4 / 5)); } }

/* Landing control (WCAG 2.2.2): the story holds at its start until brand-intro.js sets data-intro-state="playing", so it never
   runs without a working button. Paused holds every animation where it is, delays included. Once the story ends nothing moves, so there is
   no replay and the button is hidden. Its row stays reserved (hidden, not removed, before the script and after the end), so nothing below it moves. */
.brand-intro--controlled:not([data-intro-state="playing"]) .fi-stage *, .brand-intro--controlled:not([data-intro-state="playing"]) .fi-stage *::before,
.brand-intro--controlled:not([data-intro-state="playing"]) .fi-stage *::after { animation-play-state: paused !important; }
.brand-intro .brand-intro__toggle { display: inline-grid; margin-top: 12px; font: inherit; font-weight: 650; cursor: pointer; }
.brand-intro__toggle > span { grid-area: 1 / 1; visibility: hidden; } /* both labels share one cell, so the width never changes */
[data-intro-state="playing"] .brand-intro__pause, [data-intro-state="paused"] .brand-intro__play { visibility: visible; }
[data-intro-state="ready"] .brand-intro__toggle, [data-intro-state="ended"] .brand-intro__toggle { visibility: hidden; }

/* Nothing moves without scripting (no control) or with reduced motion (nothing to pause): static lockup, no motion control. */
@media (prefers-reduced-motion: reduce), (scripting: none) {
  .fi-stage *, .fi-stage *::before, .fi-stage *::after { animation: none !important; }
  .brand-intro .brand-intro__toggle { display: none; }
  /* No intro plays, so the one action reads Get started instead of Skip intro. */
  .brand-welcome__motion { display: none; }
  .brand-welcome__still { display: inline; }
}
/* The hub keeps its own colours so the white f stays visible in a light high-contrast theme. */
@media (forced-colors: active) { .fi-tile, .brand-welcome__skip { border: 1px solid CanvasText; } .fi-hub { forced-color-adjust: none; } }
