/* ==========================================================================
   LUCKY YOU design tokens
   The single source of truth for colour, type, space, grid, shape and motion.

   Never hardcode a colour, font, space, grid value or duration anywhere else.
   If a value is missing, add a token here first, then use it.

   The look: a West Loop night in March. Three bottle greens stepped from
   near-black, one cream for type, one gold for the action. The green the
   page needs is already in the photographs (outfits, lights, the shamrock
   tent), so the CSS does not add more of it.
   ========================================================================== */

:root {

  /* ---------------------------------------------------------------- grounds */
  /* Three dark grounds plus one light one. Measured steps between neighbours:
       stout  / bottle  1.35:1
       bottle / moss    1.41:1
       stout  / moss    1.90:1
     Every pair clears the 1.25:1 floor, so a ground change reads as a section
     boundary. Never put two sections on the same ground back to back. */
  --stout:   #07120D;   /* deepest: hero, the day, VIP */
  --bottle:  #123122;   /* tickets, route, footer */
  --moss:    #1F4A36;   /* pickup, reel band, cards on stout */
  --foam:    #EEE5D0;   /* the one light ground: price ladder, FAQ, ticker strip */

  /* ------------------------------------------------------------------- ink */
  --cream:      #F5EDDC;   /* text on every dark ground. 16.4:1 on stout, 8.6:1 on moss */
  --cream-dim:  #B9C4B6;   /* secondary text on dark. 5.6:1 on moss, the worst case */
  --ink:        #07120D;   /* text on foam and on gold. 15.2:1 on foam */
  --ink-dim:    #3E4F45;   /* secondary text on foam. 6.9:1 */

  /* ----------------------------------------------------------------- accent */
  /* ONE accent. Gold fills the primary button and the current price tier,
     draws the focus ring, the ladder fill line and the four-leaf separator.
     Nothing decorative is gold. No hover tint: hover is a 1px lift.
     5.4:1 on moss, 10.3:1 on stout. Ink on gold is 10.3:1. */
  --gold:       #F2B33D;
  --gold-ring:  rgba(242, 179, 61, 0.55);   /* the current-tier pulse ring only */
  --shimmer:    rgba(255, 248, 230, 0.55);  /* the sweep across a gold button only */

  /* Hairlines, the only dividers allowed (inside a section, never between). */
  --line-dark:  rgba(245, 237, 220, 0.14);
  --line-light: rgba(7, 18, 13, 0.16);

  /* ----------------------------------------------- scrims and photo plates */
  --scrim-hero-side:   linear-gradient(90deg, rgba(7,18,13,0.92) 0%, rgba(7,18,13,0.74) 38%, rgba(7,18,13,0.18) 66%, rgba(7,18,13,0) 100%);
  --scrim-hero-bottom: linear-gradient(180deg, rgba(7,18,13,0) 55%, rgba(7,18,13,0.85) 100%);
  --scrim-hero-top:    linear-gradient(180deg, rgba(7,18,13,0.70) 0%, rgba(7,18,13,0) 18%);
  --scrim-phone-band:  linear-gradient(180deg, rgba(7,18,13,0.55) 0%, rgba(7,18,13,0) 22%, rgba(7,18,13,0) 62%, rgba(7,18,13,1) 100%);
  --scrim-full:        linear-gradient(180deg, rgba(7,18,13,0.78) 0%, rgba(7,18,13,0.90) 100%);

  /* Section plates: a photograph laid under a ground as a luminance layer.
       .plate { background: var(--ground); }
       .plate img { mix-blend-mode: luminosity; opacity: var(--plate-opacity); } */
  --plate-opacity:      0.26;
  --plate-opacity-loud: 0.42;   /* VIP band only, under --scrim-full */

  /* ---------------------------------------------------------------- texture */
  --tex-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .06 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  --tex-fibre: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='320'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9 .018' numOctaves='2' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)'/%3E%3C/svg%3E");
  --perf-dot:  radial-gradient(circle, var(--stout) 1.6px, transparent 2px);
  --perf-step: 9px;

  /* ------------------------------------------------------------------- type */
  /* Two families, no more. Big Shoulders Display is the Bizzy Nights display
     face; Instrument Sans is the body and logistics voice. */
  /* Each family is followed by a size-matched local fallback (the @font-face
     rules at the foot of this file), so if the webfont is slow or blocked the
     one-line wordmark keeps its measured width and cannot overflow at 360px. */
  --font-display: 'Big Shoulders Display', 'Lucky Display Fallback', 'Arial Narrow', sans-serif;
  --font-sans:    'Instrument Sans', 'Lucky Sans Fallback', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;

  /* Every display step carries an svh ceiling. svh, never vh.
     Rendered px at 1280x689 in brackets. No two rungs share a height. */
  --fs-wordmark:    min(clamp(4.5rem, 12vw, 10.5rem), 24svh);  /* [153.6] hero LUCKY YOU, one line */
  --fs-wordmark-ph: min(22vw, 13svh);                           /* phone, one line, ~86px at 390x664 */
  --fs-stat:        min(clamp(3rem, 7vw, 6.5rem), 16svh);       /* [89.6]  count-up numerals */
  --fs-h2:          min(clamp(2.4rem, 5.2vw, 4.75rem), 13svh);  /* [66.6]  section titles, bar marquee */
  --fs-price:       min(clamp(1.75rem, 3.4vw, 3rem), 8.5svh);   /* [43.5]  ladder prices */
  --fs-count:       min(clamp(2rem, 3.6vw, 3.25rem), 9svh);     /* [46.1]  countdown digits */
  --fs-h3:          min(clamp(1.6rem, 2.7vw, 2.5rem), 7svh);    /* [34.6]  bar names, ticket names, pickup days */
  --fs-h4:          clamp(1.2rem, 1.75vw, 1.5rem);              /* [22.4]  FAQ questions, card subheads */
  --fs-lead:        clamp(1.06rem, 1.35vw, 1.2rem);             /* [17.3]  hero subline, intros */
  --fs-body:        1rem;                                        /* [16]    */
  --fs-label:       0.8rem;                                      /* [12.8]  eyebrows, ticker, buttons, badge */
  --fs-micro:       0.6875rem;                                   /* [11]    unit labels, 21+ line */
  --fs-footer-mark: min(24vw, 38svh);                            /* oversized footer wordmark */

  /* Leading. Display sizes take ratios (they sit in boxes whose margins snap
     to the baseline). Text sizes take absolute line heights on the 4px
     baseline, so every paragraph, label and list row lands on the grid. */
  --lh-wordmark: 0.82;
  --lh-stat:     0.86;
  --lh-h2:       0.9;
  --lh-h3:       0.95;
  --lh-count:    1;
  --lh-h4:       calc(var(--baseline) * 7);   /* 28px */
  --lh-lead:     calc(var(--baseline) * 7);   /* 28px */
  --lh-body:     calc(var(--baseline) * 6);   /* 24px */
  --lh-label:    calc(var(--baseline) * 4);   /* 16px */

  --track-display: -0.01em;
  --track-label:    0.14em;
  --track-body:     0;

  --fw-body:    400;
  --fw-medium:  500;
  --fw-semi:    600;
  --fw-bold:    700;
  --fw-display: 800;
  --fw-black:   900;

  /* ------------------------------------------------------- baseline + space */
  /* One 4px baseline. Every vertical space token is a multiple of it, and
     no margin or padding outside this list is allowed. */
  --baseline: 4px;
  --sp-1:  calc(var(--baseline) * 1);    /*   4 */
  --sp-2:  calc(var(--baseline) * 2);    /*   8 */
  --sp-3:  calc(var(--baseline) * 3);    /*  12 */
  --sp-4:  calc(var(--baseline) * 4);    /*  16 */
  --sp-5:  calc(var(--baseline) * 6);    /*  24 */
  --sp-6:  calc(var(--baseline) * 8);    /*  32 */
  --sp-7:  calc(var(--baseline) * 12);   /*  48 */
  --sp-8:  calc(var(--baseline) * 16);   /*  64 */
  --sp-9:  calc(var(--baseline) * 24);   /*  96 */

  /* Section padding: 64px phone, 96px desktop. Never over 120 (house rule).
     Stepped, not fluid, so it always lands on the baseline. */
  --sp-section:       var(--sp-8);
  --sp-section-short: var(--sp-7);   /* under the height-only query */

  /* ------------------------------------------------------------------- grid */
  /* ONE grid for the whole page. Every section's content sits in .wrap and
     every text block starts on a column line. Only photographs, the ticker,
     the bar marquee and the reel may break out to the viewport edge.
       .wrap  { width: min(100% - 2 * var(--grid-margin), var(--grid-max));
                margin-inline: auto; display: grid;
                grid-template-columns: repeat(var(--grid-cols), minmax(0, 1fr));
                column-gap: var(--grid-gap); }
     At 1280: 1200px content, 12 columns of 78px, 24px gaps, 40px margins.
     At 1440 and up the 1200px block centres; edges never drift.          */
  --grid-max:    1200px;
  --grid-cols:   4;                                   /* phone, under 700px */
  --grid-gap:    var(--sp-4);                         /* 16 on phone */
  --grid-margin: var(--sp-4);                         /* 16 on phone */
  --grid-row-gap: var(--sp-4);

  /* Spans, so a component never invents its own width. Values are for the
     12-column desktop grid and are remapped per breakpoint below. */
  --span-full:   1 / -1;
  --span-half:   span 6;      /* ticket options */
  --span-third:  span 4;      /* pickup cards, route cards */
  --span-quarter: span 3;     /* the day stats */
  --span-text:   span 7;      /* headings and intros: about 62ch */
  --span-aside:  span 5;

  --max-text:   62ch;

  /* ------------------------------------------------------------------ shape */
  --r-inner: 8px;
  --r-media: 10px;
  --r-card:  12px;
  --r-pill:  999px;

  --hairline: 1px solid var(--line-dark);
  --hairline-light: 1px solid var(--line-light);
  --card-inset: calc(var(--baseline) * 7);   /* 28px, one inset for every card */

  /* No box-shadow tokens. Separation is a ground step, a hairline or occlusion. */

  /* ---------------------------------------------------------------- chrome */
  --nav-h:       64px;
  --nav-h-ph:    56px;
  --ticker-h:    48px;
  --ticker-h-ph: 40px;
  --btn-h:       56px;
  --btn-h-ph:    52px;
  --laylo-embed-h: 420px;  /* the Laylo embed's frame height, when config.js sets one */
  --btn-pad-x:   1.75rem;
  --badge-h:     32px;
  --focus-ring:  2px solid var(--gold);
  --focus-offset: 2px;
  --veil-nav: rgba(7, 18, 13, 0.88);

  /* Cursor. Hotspot is the lead coin at 5,5. Desktop fine pointers only. */
  --cursor-pot: url("../img/brand/cursor-pot.svg") 5 5, url("../img/brand/cursor-pot.png") 5 5, auto;

  /* ----------------------------------------------------------------- motion */
  --dur-press:    90ms;
  --dur-fast:     160ms;
  --dur-base:     240ms;
  --dur-digit:    320ms;     /* countdown and badge digit roll */
  --dur-sparkle:  600ms;     /* one cursor sparkle, birth to gone */
  --dur-reveal:   640ms;     /* section and heading word reveal */
  --dur-hero:     900ms;     /* each wordmark letter */
  --dur-ladder:   1200ms;    /* price ladder fill */
  --dur-shimmer:  1100ms;    /* one sweep across the gold button */
  --dur-count:    1600ms;    /* count-up numbers */
  --dur-pulse:    2400ms;    /* current-tier ring, one cycle */
  --dur-shimmer-cycle: 7s;   /* one sweep, then rest, then again */
  --dur-kenburns: 26s;       /* hero slow zoom, one direction */

  --stagger:        70ms;    /* sibling blocks */
  --stagger-word:   45ms;    /* heading words */
  --stagger-letter: 40ms;    /* wordmark letters */
  --stagger-step:   90ms;    /* price ladder steps */
  --delay-shimmer:  1600ms;  /* first sweep waits for the hero to land */
  --delay-wordmark: 120ms;   /* first wordmark letter starts rising */
  --delay-hero-lines: 300ms; /* eyebrow, lead, countdown and buttons follow */

  /* Speeds, not durations. motion.js sets each loop's duration from its width. */
  --speed-ticker:   90;      /* px per second */
  --speed-reel:     100;     /* px per second, house carousel rate */
  --speed-marquee:  60;      /* px per second, bar names stay readable */

  /* Moving pictures */
  --kenburns-scale: 1.08;    /* hero zooms 1 to 1.08 */
  --kenburns-shift: -1.5%;   /* and drifts this far left */
  --parallax-range: 8%;      /* section plates travel +/- this through the viewport */

  --ease-entrance: cubic-bezier(0.16, 1, 0.30, 1);
  --ease-exit:     cubic-bezier(0.70, 0, 0.84, 0);
  --ease-standard: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-count:    cubic-bezier(0.22, 1, 0.36, 1);
  --ease-drift:    cubic-bezier(0.45, 0, 0.55, 1);   /* Ken Burns, symmetric */
  --ease-pulse:    cubic-bezier(0, 0, 0.2, 1);
  --ease-linear:   linear;                           /* ticker, reel, marquee, parallax */

  --reel-h: clamp(220px, 30vw, 420px);
  --reel-gap: var(--sp-4);

  /* Component values the motion spec names. Kept here so no other file
     carries a raw size or time. */
  --delay-resume:   2s;      /* reel resumes this long after a swipe ends */
  --dur-march:      600ms;   /* map arc: one 24px dash cycle at 40px/s */
  --dash-on:        14px;
  --dash-off:       10px;
  --lift:           1px;     /* hover lift on buttons */
  --press-scale:    0.98;
  --reveal-rise:    var(--sp-4);   /* 16px: never animate the hero buttons from further */
  --ladder-rise:    var(--sp-3);   /* 12px */
  --ladder-track:   4px;
  --ladder-row-ph:  56px;
  --tier-step:      var(--sp-4);   /* staircase rise per tier */
  --pulse-scale:    1.06;
  --blink-dim:      0.35;
  --dot:            8px;           /* tier badge dot */
  --sparkle-size:   8px;
  --sparkle-fall:   10px;
  --sparkle-spin:   45deg;
  --sparkle-end:    0.2;
  --sparkle-gap-ms: 50;            /* at most one sparkle per 50ms */
  --sparkle-gap-px: 12;            /* and only after 12px of travel */
  --sparkle-pool:   10;
  --grid-tint:      rgba(242, 179, 61, 0.12);   /* ?grid overlay columns */
  --plate-pos:      50% 30%;       /* faces sit in the top third of every portrait */
  --plate-pos-land: 50% 40%;
  --hero-pos:       50% 38%;       /* hero-crowd-tent, from the manifest */
  --hero-pos-ph:    50% 35%;       /* hero-tall-green-room, from the manifest */
  --hero-band-ph:   52svh;
  /* Hero video. Desktop and tablet: a 9:16 story card at the right of the
     grid, as wide as N columns but never taller than the ceiling, so it
     cannot push Get tickets down. Phones: full-bleed behind the text. */
  --video-ratio:        9 / 16;
  --hero-panel-cols:    4;          /* columns 9 to 12 on desktop */
  --hero-panel-hmax:    60svh;      /* 413px at 1280x689 */
  --hairline-panel:     1px solid rgba(245, 237, 220, 0.55);   /* cream, not gold: gold means act */
  --scrim-phone-video:  linear-gradient(180deg, rgba(7,18,13,0.60) 0%, rgba(7,18,13,0.30) 20%, rgba(7,18,13,0.62) 40%, rgba(7,18,13,0.90) 58%, rgba(7,18,13,0.97) 100%);
  --input-h:        52px;
  --form-max:       span 6;

  /* ---------------------------------------------------------------- z-index */
  --z-ticker:  5;
  --z-nav:     100;
  --z-modal:   300;
  --z-sparkle: 900;   /* cursor sparkles, pointer-events none */
}

/* --------------------------------------------------------- grid breakpoints */
@media (min-width: 700px) {
  :root {
    --grid-cols:   8;
    --grid-gap:    var(--sp-5);      /* 24 */
    --grid-margin: var(--sp-6);      /* 32 */
    --grid-row-gap: var(--sp-5);
    --span-half:   span 4;
    --span-third:  span 4;           /* two per row on tablet */
    --span-quarter: span 4;
    --span-text:   span 6;
    --span-aside:  span 8;
    --hero-panel-cols: 3;
  }
}
@media (min-width: 1024px) {
  :root {
    --grid-cols:   12;
    --grid-margin: calc(var(--baseline) * 10);   /* 40 */
    --span-half:   span 6;
    --span-third:  span 4;
    --span-quarter: span 3;
    --span-text:   span 7;
    --span-aside:  span 5;
    --hero-panel-cols: 4;
    --sp-section:  var(--sp-9);                  /* 96 */
  }
}
/* Under 700px every span is the full width. */
@media (max-width: 699.98px) {
  :root {
    --span-half:  1 / -1;
    --span-third: 1 / -1;
    --span-quarter: span 2;
    --span-text:  1 / -1;
    --span-aside: 1 / -1;
  }
}

/* Section scopes. Components read these and never name a green. */
[data-ground="stout"]  { --ground: var(--stout);  --on-ground: var(--cream); --on-ground-dim: var(--cream-dim); --rule: var(--line-dark); }
[data-ground="bottle"] { --ground: var(--bottle); --on-ground: var(--cream); --on-ground-dim: var(--cream-dim); --rule: var(--line-dark); }
[data-ground="moss"]   { --ground: var(--moss);   --on-ground: var(--cream); --on-ground-dim: var(--cream-dim); --rule: var(--line-dark); }
[data-ground="foam"]   { --ground: var(--foam);   --on-ground: var(--ink);   --on-ground-dim: var(--ink-dim);   --rule: var(--line-light); }

/* The two ticket options. Same shape, different finish, so they read as a
   pair. Lucky You is the hairline card with the gold button; Citywide Pass is
   the filled foam card with an ink button. One gold object per screen. */
[data-ticket="lucky-you"]  { --ticket-fill: transparent; --ticket-stroke: var(--cream); --ticket-text: var(--cream); }
[data-ticket="citywide"] { --ticket-fill: var(--foam);  --ticket-stroke: var(--foam);  --ticket-text: var(--ink); }

/* Price ladder tier states, set from config, never by hand. */
[data-tier-state="sold"]     { --tier-fill: transparent; --tier-text: var(--ink-dim); --tier-stroke: var(--line-light); }
[data-tier-state="current"]  { --tier-fill: var(--gold);  --tier-text: var(--ink);     --tier-stroke: var(--gold); }
[data-tier-state="upcoming"] { --tier-fill: transparent; --tier-text: var(--ink);     --tier-stroke: var(--line-light); }

/* Short laptop screens: compress rhythm, never the type alone. */
@media (max-height: 760px) and (min-width: 820px) {
  :root {
    --sp-section: var(--sp-section-short);
    --btn-h: 52px;
  }
}

/* Phones: no parallax, slower Ken Burns. */
@media (max-width: 699.98px) {
  :root {
    --parallax-range: 0%;
    --dur-kenburns:   34s;
    --kenburns-scale: 1.06;
    --kenburns-shift: 0%;
  }
}

/* Reduced motion: every duration to effectively zero and every loop stopped.
   motion.js and cursor.js also read this query: ticker, reel, marquee, sparkles and
   the cursor all switch off, and count-ups render their final value. */
@media (prefers-reduced-motion: reduce) {
  :root {
    --dur-press:    0.01ms;
    --dur-fast:     0.01ms;
    --dur-base:     0.01ms;
    --dur-digit:    0.01ms;
    --dur-sparkle:  0.01ms;
    --dur-reveal:   0.01ms;
    --dur-hero:     0.01ms;
    --dur-ladder:   0.01ms;
    --dur-shimmer:  0.01ms;
    --dur-count:    0.01ms;
    --dur-pulse:    0.01ms;
    --stagger:        0ms;
    --stagger-word:   0ms;
    --stagger-letter: 0ms;
    --stagger-step:   0ms;
    --delay-shimmer:  0ms;
    --speed-ticker:   0;
    --speed-reel:     0;
    --speed-marquee:  0;
    --kenburns-scale: 1;
    --kenburns-shift: 0%;
    --parallax-range: 0%;
    --dur-march:      0.01ms;
    --reveal-rise:    0px;
    --ladder-rise:    0px;
    --cursor-pot: auto;
  }
}

/* ------------------------------------------------- size-matched fallbacks
   Calibrated in a browser with the webfont blocked: the fallback renders the
   wordmark at the same width as Big Shoulders Display Black, and button and
   body text at the same width as Instrument Sans. */
@font-face {
  font-family: 'Lucky Display Fallback';
  src: local('Arial Bold'), local('Arial-BoldMT');
  font-weight: 100 900;
  size-adjust: 67.6%;
  ascent-override: 100%;
  descent-override: 24%;
  line-gap-override: 0%;
}
@font-face {
  font-family: 'Lucky Sans Fallback';
  src: local('Arial'), local('ArialMT');
  size-adjust: 100%;
  ascent-override: 96%;
  descent-override: 25%;
  line-gap-override: 0%;
}
