/* =========================================================
   UNIQLO Street Festival San Francisco
   styles.css — tokens, utilities, components
   ========================================================= */

/* ---------- 1. Tokens ---------- */
:root {
  --red: #ff0000;
  --red-dark: #d40000;
  --black: #000000;
  --white: #ffffff;
  --grey-bg: #f5f5f5;
  --grey-line: #dcdcdc;
  --grey-text: #6b6b6b;

  --font: "Helvetica Neue", Helvetica, Arial, "Hiragino Kaku Gothic ProN", sans-serif;

  --step--1: 0.75rem;
  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: 1.75rem;
  --step-3: 2.5rem;
  --step-4: clamp(2.5rem, 6vw, 4.5rem);

  --gutter: 20px;
  --max: 1280px;
  --header-h: 64px;
  --bar-h: 34px;
  --tabbar-h: 62px;
}

/* ---------- 2. Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.55;
  color: var(--black);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; }
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul { padding: 0; list-style: none; }

:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- 3. Utilities ---------- */
.container { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.container-narrow { max-width: 760px; }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-8 { grid-template-columns: repeat(4, 1fr); }

.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }

.section { padding-block: 50px; }
.section-tight { padding-block: 44px; }
.bg-grey { background: var(--grey-bg); }
.bg-black { background: var(--black); color: var(--white); }
.bg-red { background: var(--red); color: var(--white); padding-block: 4px; }

.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; } .mt-48 { margin-top: 48px; }
.mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }

.text-red { color: var(--red); }
.text-muted { color: var(--grey-text); }
.text-center { text-align: center; }
.measure { max-width: 62ch; }
.uppercase { text-transform: uppercase; }
.nowrap { white-space: nowrap; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
/* the skip link shows itself when a keyboard user reaches it */
.sr-only:focus-visible {
  position: fixed; left: 16px; top: 16px; z-index: 1000;
  width: auto; height: auto; margin: 0; padding: 10px 14px;
  clip: auto; clip-path: none; overflow: visible; white-space: normal;
  background: var(--black); color: var(--white); font-weight: 700;
}
.hide-desktop { display: none !important; }

/* ---------- 4. Type ---------- */
.h1 { font-size: var(--step-4); line-height: 1.02; font-weight: 700; letter-spacing: -0.02em; }
.h2 { font-size: var(--step-3); line-height: 1.08; font-weight: 700; letter-spacing: -0.015em; }
.h3 { font-size: var(--step-2); line-height: 1.15; font-weight: 700; letter-spacing: -0.01em; }
.h4 { font-size: var(--step-1); line-height: 1.25; font-weight: 700; }
.lead { font-size: var(--step-1); line-height: 1.5; }
.small { font-size: var(--step--1); line-height: 1.45; }

.kicker {
  display: inline-block;
  background: var(--red);
  color: var(--white);
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 10px;
}
.rule { border: 0; border-top: 2px solid var(--black); margin: 0; }
.rule-thin { border: 0; border-top: 1px solid var(--grey-line); margin: 0; }

/* ---------- 5. Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 28px;
  font-weight: 700; font-size: var(--step-0); letter-spacing: 0.02em;
  text-decoration: none; border: 2px solid transparent; cursor: pointer;
  background: var(--red); color: var(--white);
  transition: background 0.15s ease, color 0.15s ease;
}
.btn:hover { background: var(--red-dark); }
.btn-white { background: var(--white); color: var(--black); }
.btn-white:hover { background: var(--black); color: var(--white); }
.btn-outline { background: transparent; color: var(--black); border-color: var(--black); }
.btn-outline:hover { background: var(--black); color: var(--white); }
.btn-block { width: 100%; }
.btn-sm { min-height: 38px; padding: 0 16px; font-size: var(--step--1); }

/* ---------- 6. Announcement bar + header ---------- */
.announce {
  background: var(--black); color: var(--white);
  font-size: var(--step--1); font-weight: 700;
  min-height: var(--bar-h);
  overflow: hidden;
}
.announce-track {
  display: flex;
  transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}
.announce-track.is-instant { transition: none; }
.announce-item {
  flex: 0 0 100%;
  min-width: 100%;
  text-align: center;
  padding: 8px 16px;
  line-height: 1.35;
}
.header {
  position: sticky; top: 0; z-index: 50;
  background: var(--white);
  border-bottom: 1px solid var(--grey-line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; min-height: var(--header-h);
}
/* the lockup keeps its shape: capped at 34px tall, and shrinks as a whole
   (never squeezed) when the header is narrow */
.logo { flex: 0 1 auto; min-width: 0; }
.logo img { width: auto; height: auto; max-height: 34px; max-width: 100%; }
.nav { display: flex; gap: 26px; align-items: center; }
.nav a {
  text-decoration: none; font-size: 0.8125rem; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase; padding: 6px 0;
  border-bottom: 3px solid transparent;
}
.nav a:hover, .nav a.is-active { border-bottom-color: var(--red); }
.nav .btn-sm { border-bottom: 0; color: var(--white); }
.nav .btn-sm:hover { border-bottom: 0; }

/* ---------- 7. Hero ---------- */
.hero { position: relative; background: var(--black); }
.hero-media { position: relative; min-height: 62vh; display: grid; }
.hero-media img {
  grid-area: 1 / 1; width: 100%; height: 100%; min-height: 62vh; object-fit: cover;
}
.hero-scrim {
  grid-area: 1 / 1;
  background: linear-gradient(180deg, rgba(0,0,0,.15) 0%, rgba(0,0,0,.5) 60%, rgba(0,0,0,.6) 100%);
}
.hero-content {
  grid-area: 1 / 1; position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; color: var(--white); padding: 64px var(--gutter);
}
.hero-meta {
  font-size: var(--step--1); font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; margin-bottom: 14px;
}
.hero h1 { max-width: 21ch; text-shadow: 0 2px 24px rgba(0,0,0,.35); }
.hero-title { max-width: none !important; }
.hero-title span { display: block; }

.facts { border-top: 2px solid var(--black); }
.facts li { padding: 12px 0; border-bottom: 1px solid var(--grey-line); }
.hero .btn { margin-top: 28px; }

/* ---------- 8. Stat band ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); }
.stat { padding: 26px 20px; border-left: 1px solid rgba(255,255,255,.35); }
.stat:first-child { border-left: 0; }
.stat-num { font-size: var(--step-3); font-weight: 700; line-height: 1; }
.stat-label { font-size: var(--step--1); margin-top: 6px; }

/* ---------- 9. Cards / generic blocks ---------- */
.card { background: var(--white); border: 1px solid var(--grey-line); padding: 24px; height: 100%; }
.card-red-top { border-top: 6px solid var(--red); }
.card h3 { margin-bottom: 8px; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }

/* ---------- 10. Lineup (music) ---------- */
.lineup { border-top: 2px solid var(--black); }
.act {
  display: grid; grid-template-columns: 145px 1fr auto; gap: 20px; align-items: baseline;
  padding: 20px 0; border-bottom: 1px solid var(--grey-line);
}
.act-time { font-weight: 700; font-variant-numeric: tabular-nums; }
.act-name { font-size: var(--step-1); font-weight: 700; }
.act-tag { font-size: var(--step--1); color: var(--grey-text); }

/* ---------- 11. Art cubes ---------- */
.cube {
  border: 1px solid var(--grey-line); background: var(--white);
  padding: 18px; text-align: center;
}
.cube svg { margin: 0 auto 10px; width: 84px; height: 84px; }
.cube-name { font-weight: 700; font-size: var(--step-0); }
.artist-name { font-weight: 500; font-size: var(--step-0); }
.cube-loc { font-size: var(--step--1); color: var(--grey-text); }

/* ---------- 12. Passport ---------- */
.passport-figure { border: 1px solid var(--grey-line); background: var(--white); padding: 12px; }
.passport-figure figcaption { font-size: var(--step--1); color: var(--grey-text); margin-top: 10px; }

.stamp-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.stamp {
  aspect-ratio: 1 / 1; border: 2px solid var(--grey-line); background: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: var(--step--1); color: var(--grey-text);
  cursor: pointer; padding: 4px; text-align: center; line-height: 1.15;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.stamp:hover { border-color: var(--black); }
.stamp[aria-pressed="true"] {
  background: var(--red); border-color: var(--red); color: var(--white);
}
.progress-track { height: 14px; background: var(--grey-line); }
.progress-fill { height: 100%; width: 0%; background: var(--red); transition: width 0.25s ease; }

/* ---------- 13. Map ---------- */
.map-wrap { display: grid; grid-template-columns: 1.6fr 1fr; gap: 32px; align-items: start; }
.map-frame { border: 1px solid var(--grey-line); background: var(--white); padding: 8px; }
.map-svg { width: 100%; height: auto; }
.map-pin { cursor: pointer; }
.map-pin:hover .pin-hit, .map-pin.is-active .pin-hit { opacity: 0.18; }
.pin-hit { fill: var(--red); opacity: 0; }
.legend li {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 0; border-bottom: 1px solid var(--grey-line); cursor: pointer;
}
.legend li:hover, .legend li.is-active { background: var(--grey-bg); }
.legend-swatch { width: 18px; height: 18px; flex: 0 0 18px; margin-top: 3px; background: var(--red); }
.legend-swatch.is-outline { background: var(--white); border: 3px solid var(--red); }
/* the closure wash on the map is red at 13%, so its swatch matches rather than
   reading as another solid-red marker */
.legend-swatch.is-closure { background: rgba(255, 0, 0, 0.13); border: 2px solid var(--red); }
.legend-swatch.is-black { background: var(--black); }
.legend-swatch.is-green { background: #00cc66; }
.legend-swatch.is-blue { background: #0099ff; }
.legend-name { font-weight: 700; }
.legend-desc { font-size: var(--step--1); color: var(--grey-text); }

/* ---------- 14. Schedule ---------- */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--black); flex-wrap: wrap; }
.tab {
  background: transparent; border: 0; border-bottom: 4px solid transparent;
  padding: 12px 20px; font-weight: 700; cursor: pointer; margin-bottom: -2px;
  text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.8125rem;
}
.tab[aria-selected="true"] { border-bottom-color: var(--red); color: var(--red); }
.slot {
  display: grid; grid-template-columns: 150px 1fr 180px; gap: 20px;
  padding: 18px 0; border-bottom: 1px solid var(--grey-line); align-items: baseline;
}
.slot-time { font-weight: 700; font-variant-numeric: tabular-nums; }
.slot-title { font-weight: 700; }
.slot-where { font-size: var(--step--1); color: var(--grey-text); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
/* color and appearance are set outright: iOS Safari's own button style
   colours unset button text system blue and rounds the corners */
.chip {
  -webkit-appearance: none; appearance: none; border-radius: 0;
  border: 2px solid var(--black); background: var(--white); color: var(--black); padding: 6px 14px;
  font-size: var(--step--1); font-weight: 700; cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--black); color: var(--white); }

/* ---------- 15. Partners ---------- */
.partner-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--grey-line); border: 1px solid var(--grey-line); }
.partner {
  background: var(--white); min-height: 92px; padding: 16px;
  display: flex; align-items: center; justify-content: center; text-align: center;
  font-weight: 700; font-size: 0.9375rem;
}
.partner:hover { background: var(--red); color: var(--white); }

/* ---------- 16. FAQ ---------- */
.faq { border-top: 2px solid var(--black); }
.faq details { border-bottom: 1px solid var(--grey-line); }
.faq summary {
  cursor: pointer; list-style: none; padding: 18px 40px 18px 0;
  font-weight: 700; font-size: var(--step-1); position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 6px; top: 14px;
  font-size: 1.6rem; line-height: 1; color: var(--red);
}
.faq details[open] summary::after { content: "\2013"; }
.faq .faq-body { padding: 0 0 20px; max-width: 68ch; color: #333; }

/* ---------- 17. RSVP form ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 700; font-size: var(--step--1); letter-spacing: 0.04em; text-transform: uppercase; }
.field input, .field select, .field textarea {
  font: inherit; padding: 12px 14px; border: 2px solid var(--black); background: var(--white);
  border-radius: 0; width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 3px solid var(--red); outline-offset: 1px; }
.span-2 { grid-column: 1 / -1; }
.checks { display: flex; flex-wrap: wrap; gap: 10px; }
.check { display: flex; align-items: center; gap: 8px; border: 2px solid var(--grey-line); padding: 10px 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--red); }
.form-note { font-size: var(--step--1); color: var(--grey-text); }
.form-status { padding: 14px 16px; border: 2px solid var(--red); font-weight: 700; display: none; }
.form-status.is-visible { display: block; }

/* ---------- 18. Footer ---------- */
.footer { background: var(--black); color: var(--white); padding-block: 56px; }
.footer a { color: var(--white); }
.footer-logo { background: var(--white); display: inline-block; padding: 10px 12px; }
.footer-logo img { height: 30px; }

/* ---------- 19. Mobile tab bar ---------- */
.tabbar {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
  background: var(--white); border-top: 1px solid var(--grey-line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar ul { display: grid; grid-template-columns: repeat(5, 1fr); }
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; padding: 8px 2px; text-decoration: none;
  font-size: 0.6875rem; font-weight: 700; min-height: var(--tabbar-h);
}
.tabbar svg { width: 22px; height: 22px; }
.tabbar a:hover, .tabbar a.is-active { color: var(--red); }

/* ---------- 20. Responsive ---------- */
@media (max-width: 1024px) {
  .map-wrap { grid-template-columns: 1fr; }
  .split { gap: 32px; }
  .partner-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 860px) {
  .nav { display: none; }
  .hide-desktop { display: inline-flex !important; }
  .tabbar { display: block; }
  body { padding-bottom: var(--tabbar-h); }

  .section { padding-block: 48px; }
  .section-tight { padding-block: 32px; }

  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .grid-8 { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid rgba(255,255,255,.35); }
  .partner-grid { grid-template-columns: repeat(2, 1fr); }
  .stamp-grid { grid-template-columns: repeat(4, 1fr); }

  .hero-media, .hero-media img { min-height: 78vh; }
  .hero-content { justify-content: flex-start; padding-top: 22vh; }
  .hero h1 { font-size: clamp(2.25rem, 11vw, 3.25rem); max-width: 12ch; }
  .hero .hero-title { font-size: clamp(1.75rem, 8vw, 2.75rem); }

  .act { grid-template-columns: 1fr; gap: 4px; }
  .slot { grid-template-columns: 1fr; gap: 4px; }
}

@media (max-width: 420px) {
  .stamp-grid { grid-template-columns: repeat(3, 1fr); }
  .tabbar a { font-size: 0.625rem; }
}

/* ---------- 21. Print ---------- */
@media print {
  .header, .tabbar, .announce, .hero-scrim, .btn { display: none !important; }
  body { color: #000; }
}

/* ---------- 22. Map focus state ---------- */
.map-svg .marker-group { transition: opacity 0.15s ease; }
.map-svg.has-focus .marker-group { opacity: 0.15; }
.map-svg.has-focus .marker-group.is-active { opacity: 1; }
.legend li:focus-visible { outline: 3px solid var(--red); outline-offset: -3px; }

/* ---------- 23. Fixes ---------- */
section[id], #top { scroll-margin-top: calc(var(--header-h) + 12px); }
.stamp-grid { max-width: 720px; }

@media (max-width: 860px) {
  .hero-media, .hero-media img { min-height: 72vh; }
  .hero-media img { object-position: 50% 62%; }
  .hero-content { padding-top: 16vh; }
  .hero-meta { letter-spacing: 0.05em; font-size: 0.6875rem; }
  .stamp-grid { max-width: none; }
}

/* ---------- 24. Flower stage ---------- */
/* Intro split: copy left, WebGL sculpture right (js/flower.js). */
.split.split-flower { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.split:has(> .flower-stage[hidden]) { grid-template-columns: 1fr; }
.flower-stage {
  position: relative; overflow: hidden;
  height: clamp(480px, 78vh, 720px);
  background: var(--grey-bg);
}
.flower-stage canvas { display: block; width: 100%; height: 100%; }

@media (max-width: 860px) {
  .split.split-flower { grid-template-columns: 1fr; }
  /* sized by width (taller on tablets), but never taller than the space
     between the sticky header and the tab bar (landscape phones) */
  .flower-stage {
    height: 440px; /* browsers without svh */
    height: min(clamp(440px, 70vw, 620px),
      max(220px, calc(100svh - var(--header-h) - var(--tabbar-h) - 24px)));
  }
}
