/* ─── Tokens ─────────────────────────────────────────────
   Placeholder palette until the Makers Matters brand kit arrives:
   swap the values here and the whole page follows. */
/* Hayy Makers brand colours (from Branding/02_Brand Colors):
   Industrial #2c252d · Earth Calm #f1ede3 · Clean Slate #ffffff · Transparent #e3f3fb
   Signal Flame #f16622 · Warm Mahogany #5b2912 · Mustard Clay #eaaa00 · Hot Steel #cf373b · Kiln Fern #9d9335 */
@font-face { font-family: "Graphik Arabic"; src: url("assets/graphik-regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Graphik Arabic"; src: url("assets/graphik-medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Graphik Arabic"; src: url("assets/graphik-semibold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Graphik Arabic"; src: url("assets/graphik-bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --bg: #F1EDE3;
  --surface: #FFFFFF;
  --surface-2: #E6E0D2;
  --ink: #2C252D;
  --ink-2: #5A525A;
  --ink-3: #887F86;
  --line: rgba(44, 37, 45, 0.1);
  --accent: #F16622;
  --accent-text: #5B2912;
  --accent-soft: rgba(241, 102, 34, 0.14);
  --on-accent: #2C252D;
  --live: #7A7224;
  --live-dot: #9D9335;
  --live-soft: rgba(157, 147, 53, 0.2);
  --hero: #2C252D;
  --on-hero: #F1EDE3;

  /* Category colours = the table headings in the content doc */
  --t-showcase: #F2A91E;
  --t-workshop: #F26623;
  --t-family: #E12433;
  --t-talk: #D9EAD3;
  --t-performance: #E3F4FD;
  --t-market: #9D9435;
  --t-ongoing: #9D9435;
  --t-panel: #D9EAD3;
  --on-showcase: #2C252D; --on-workshop: #2C252D; --on-family: #FFFFFF; --on-talk: #2C252D; --on-performance: #2C252D; --on-market: #2C252D; --on-ongoing: #2C252D; --on-panel: #2C252D;

  --chrome: rgba(241, 237, 227, 0.74);
  --chrome-edge: rgba(255, 255, 255, 0.55);
  --sheet: rgba(255, 255, 255, 0.95);
  --scrim: rgba(28, 22, 28, 0.4);
  --shadow-card: 0 1px 2px rgba(44, 37, 45, 0.05), 0 4px 14px rgba(44, 37, 45, 0.04);
  --shadow-sheet: 0 -12px 48px rgba(28, 22, 28, 0.22);

  --map-ground: #E6E0D2;
  --map-block: #FBF9F4;
  --plan-wall: #2C252D;
  --plan-soft: #B9AE9A;

  --r-card: 18px;
  --r-pill: 999px;
  --gutter: 1.125rem;
  --tabbar-h: 3.5rem;
  --top-h: 3.5rem;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1E191F;
    --surface: #2C252D;
    --surface-2: #3A323B;
    --ink: #F1EDE3;
    --ink-2: #C3BBB1;
    --ink-3: #8F868B;
    --line: rgba(241, 237, 227, 0.09);
    --accent: #F16622;
    --accent-text: #F68A55;
    --accent-soft: rgba(241, 102, 34, 0.18);
    --on-accent: #2C252D;
    --live: #C9BF5A;
    --live-dot: #B8AD45;
    --live-soft: rgba(157, 147, 53, 0.24);
    --hero: #120E12;
    --on-hero: #F1EDE3;
    --chrome: rgba(30, 25, 31, 0.74);
    --chrome-edge: rgba(255, 255, 255, 0.06);
    --sheet: rgba(44, 37, 45, 0.95);
    --scrim: rgba(0, 0, 0, 0.55);
    --shadow-card: none;
    --map-ground: #241E25;
    --map-block: #322A33;
    --plan-wall: #D9D2C6;
    --plan-soft: #5A505B;
    color-scheme: dark;
  }
}

/* ─── Base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.47 "Graphik Arabic", system-ui, -apple-system, "SF Pro Text", "Segoe UI", Roboto, "Noto Sans Arabic", "Geeza Pro", sans-serif;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  min-height: 100dvh;
  padding: calc(var(--top-h) + var(--safe-t)) 0 calc(var(--tabbar-h) + var(--safe-b) + 1.5rem);
}
/* Arabic letters join; any tracking breaks them */
[dir="rtl"] body, [dir="rtl"] * { letter-spacing: 0 !important; }
[dir="rtl"] body { line-height: 1.6; }

button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
svg { width: 1.375rem; height: 1.375rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; border-radius: 10px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Press feedback lives on pointer-down */
.press { transition: transform 120ms ease-out, background-color 120ms ease-out; }
.press:active { transform: scale(0.97); transition-duration: 60ms; }

/* ─── Top chrome (translucent, content scrolls under) ─── */
.chrome-top {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  height: calc(var(--top-h) + var(--safe-t));
  padding: var(--safe-t) var(--gutter) 0;
  display: flex; align-items: center; gap: 0.75rem;
  background: var(--chrome);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  backdrop-filter: blur(22px) saturate(180%);
}
/* Scroll-edge effect instead of a hard divider: appears only once content is underneath */
.chrome-top::after {
  content: ""; position: absolute; inset: auto 0 -1px 0; height: 1px;
  background: var(--line); opacity: 0; transition: opacity 200ms ease;
}
.scrolled .chrome-top::after { opacity: 1; }
.brand { cursor: pointer; text-align: start; display: flex; align-items: center; gap: 0.625rem; min-width: 0; transition: opacity 180ms ease; }
.brand .logo { height: 1.75rem; width: auto; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; padding-inline-start: 0.625rem; border-inline-start: 1px solid var(--line); }
.brand-name { font-weight: 700; font-size: 0.9375rem; letter-spacing: -0.015em; }
.brand-strap { font-size: 0.75rem; color: var(--ink-2); letter-spacing: 0.01em; }
.top-title {
  position: absolute; left: 50%; top: calc(var(--safe-t) + var(--top-h) / 2);
  transform: translate(-50%, -40%); opacity: 0;
  font-weight: 600; font-size: 1.0625rem; pointer-events: none;
  transition: opacity 180ms ease, transform 220ms ease;
}
.show-top-title .top-title { opacity: 1; transform: translate(-50%, -50%); }
.show-top-title .brand { opacity: 0; pointer-events: none; }
.pill {
  margin-inline-start: auto;
  min-width: 2.75rem; height: 2.25rem; padding: 0 0.875rem;
  border-radius: var(--r-pill);
  background: var(--surface-2); color: var(--ink);
  font-weight: 600; font-size: 0.9375rem;
  transition: transform 120ms ease-out;
}
.pill:active { transform: scale(0.94); }
.lang { font-family: "Graphik Arabic", system-ui, "Noto Sans Arabic", "Geeza Pro", sans-serif; }

/* ─── Bottom tab bar ─────────────────────────────────── */
.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 20;
  height: calc(var(--tabbar-h) + var(--safe-b));
  padding: 0 0.5rem var(--safe-b);
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--chrome);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  backdrop-filter: blur(22px) saturate(180%);
  border-top: 1px solid var(--chrome-edge);
  box-shadow: 0 -1px 0 var(--line);
}
.tabbar button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.125rem;
  color: var(--ink-3); font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.01em;
  transition: transform 120ms ease-out, color 120ms ease-out;
}
.tabbar button svg { width: 1.5rem; height: 1.5rem; }
.tabbar button:active { transform: scale(0.92); transition-duration: 60ms; }
.tabbar button[aria-current="page"] { color: var(--ink); }
.tabbar button[aria-current="page"] svg { color: var(--accent); }

/* ─── Views ──────────────────────────────────────────── */
.view { padding: 0 var(--gutter); max-width: 40rem; margin: 0 auto; }
.view.entering { animation: view-in 260ms cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.large-title {
  font-size: 2.125rem; line-height: 1.1; font-weight: 700; letter-spacing: -0.025em;
  margin: 0.5rem 0 0.25rem;
}
.lede { color: var(--ink-2); margin: 0 0 1.25rem; font-size: 1rem; }
.section-h {
  display: flex; align-items: baseline; gap: 0.5rem;
  font-size: 1.375rem; line-height: 1.2; font-weight: 700; letter-spacing: -0.02em;
  margin: 2rem 0 0.75rem;
}
.section-h small { font-size: 0.875rem; font-weight: 500; color: var(--ink-3); letter-spacing: 0; }
.eyebrow { font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.02em; color: var(--ink-3); text-transform: uppercase; }
[dir="rtl"] .eyebrow { text-transform: none; }

.mm-banner { display: block; margin-top: 0.75rem; border-radius: 26px; overflow: hidden; background: var(--hero); }
.mm-banner img { display: block; width: 100%; height: auto; }
@media (min-width: 64rem) { .mm-banner img { aspect-ratio: 5 / 2; object-fit: cover; } } /* laptop: crop the 3:2 art to 5:2 so the banner is much taller than the old 9:1 strip */

/* ─── Now: hero ──────────────────────────────────────── */
.hero {
  margin-top: 0.75rem; padding: 1.5rem 1.25rem 1.375rem;
  border-radius: 26px; background: var(--hero); color: var(--on-hero);
  position: relative; overflow: hidden;
}
.hero::before { /* Signal Flame bar, as in the brand art direction */
  content: ""; position: absolute; inset: 0 0 auto 0; height: 0.375rem; background: var(--accent); pointer-events: none;
}
.hero > * { position: relative; }
.hero .eyebrow { color: var(--accent); }
.hero-title { font-size: 2.5rem; line-height: 1.02; font-weight: 700; letter-spacing: -0.035em; margin: 0.5rem 0 0.5rem; }
.hero-sub { margin: 0; font-size: 1rem; color: color-mix(in srgb, var(--on-hero) 78%, transparent); }
.countdown { display: grid; grid-template-columns: minmax(0, 8rem); gap: 0.5rem; margin-top: 1.25rem; }
.countdown div {
  padding: 0.75rem 0.5rem 0.625rem; border-radius: 16px; text-align: center;
  background: color-mix(in srgb, var(--on-hero) 10%, transparent);
}
.countdown b { display: block; font-size: 2rem; line-height: 1; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.countdown span { font-size: 0.75rem; color: color-mix(in srgb, var(--on-hero) 65%, transparent); letter-spacing: 0.02em; }

.live-dot { display: inline-block; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--live-dot); flex: none; box-shadow: 0 0 0 0.2rem var(--live-soft); }
.status-line { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; font-size: 0.9375rem; color: var(--live); margin: 1rem 0 0; }

/* ─── Event cards ────────────────────────────────────── */
.list { display: grid; gap: 0.625rem; }
.ev {
  position: relative; display: flex; align-items: stretch;
  background: var(--surface); border-radius: var(--r-card); box-shadow: var(--shadow-card);
  transition: transform 120ms ease-out;
}
.ev:has(.ev-main:active) { transform: scale(0.975); transition-duration: 60ms; }
.ev-main {
  flex: 1; min-width: 0; text-align: start;
  display: grid; grid-template-columns: 0.25rem 1fr; gap: 0 0.875rem;
  padding: 0.875rem 0 0.875rem 0.875rem;
}
[dir="rtl"] .ev-main { padding: 0.875rem 0.875rem 0.875rem 0; }
.ev-main::before { content: ""; grid-row: 1 / span 4; border-radius: 2px; background: var(--tone, var(--t-ongoing)); }
.ev-meta { font-size: 0.8125rem; color: var(--ink-2); font-weight: 500; display: flex; gap: 0.375rem; flex-wrap: wrap; align-items: center; font-variant-numeric: tabular-nums; }
.ev-meta .tag { color: var(--ink-2); font-weight: 600; display: inline-flex; align-items: center; gap: 0.3125rem; }
.ev-meta .tag::before { content: ""; width: 0.4375rem; height: 0.4375rem; border-radius: 2px; background: var(--tone); }
.ev-title { font-size: 1.0625rem; font-weight: 600; line-height: 1.28; letter-spacing: -0.015em; margin: 0.125rem 0 0; }
.ev-by { font-size: 0.875rem; color: var(--ink-2); margin-top: 0.125rem; }
.ev-days { font-weight: 600; margin-top: 0.125rem; }
.ev-where { font-size: 0.8125rem; color: var(--ink-3); margin-top: 0.25rem; }
.ev-progress { grid-column: 2; height: 4px; border-radius: 2px; background: var(--live-soft); margin-top: 0.625rem; overflow: hidden; }
.ev-progress i { display: block; height: 100%; width: calc(var(--p) * 100%); background: var(--live-dot); border-radius: inherit; }
.ev.is-live .ev-meta .when { color: var(--live); font-weight: 600; }
.ev.is-past { opacity: 0.5; }

.save {
  flex: none; width: 3rem; display: grid; place-items: center; color: var(--ink-3);
  border-radius: 0 var(--r-card) var(--r-card) 0;
}
[dir="rtl"] .save { border-radius: var(--r-card) 0 0 var(--r-card); }
.save svg { width: 1.375rem; height: 1.375rem; transition: transform 200ms cubic-bezier(0.3, 1.6, 0.5, 1); }
.save:active svg { transform: scale(0.82); transition-duration: 60ms; }
.save[aria-pressed="true"] { color: var(--accent); }
.ev .save[aria-pressed="true"] svg { stroke: var(--accent); }
.save[aria-pressed="true"] svg { fill: currentColor; }

.tone-workshop { --tone: var(--t-workshop); }
.tone-talk { --tone: var(--t-talk); }
.tone-performance { --tone: var(--t-performance); }
.tone-family { --tone: var(--t-family); }
.tone-ongoing { --tone: var(--t-ongoing); }
.tone-panel { --tone: var(--t-panel); }

/* ─── Session rows: "7:30 – 8:00 PM" above each card ─── */
.rows { margin-top: 1rem; gap: 0.75rem; }
.row { display: flex; flex-direction: column; gap: 0.375rem; }
.row-time { display: flex; align-items: center; gap: 0.5rem; padding-inline-start: 0.25rem; }
.row-time::before { content: ""; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--tone, var(--line)); }
.row-time b { font-size: 0.875rem; font-weight: 700; line-height: 1.2; white-space: nowrap; font-variant-numeric: tabular-nums; }
.row.is-live .row-time b { color: var(--live); }
.row.is-past { opacity: 0.5; }

.ev { flex-direction: column; overflow: hidden; }
.ev-main { display: flex; gap: 0.75rem; align-items: flex-start; padding: 0.875rem 0.875rem 0.5rem; text-align: start; }
[dir="rtl"] .ev-main { padding: 0.875rem 0.875rem 0.5rem; }
.ev-main::before { display: none; }
.ev-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ev-tags { display: flex; flex-wrap: wrap; gap: 0.375rem; align-items: center; margin-bottom: 0.375rem; }
.tag {
  display: inline-flex; align-items: center; height: 1.375rem; padding: 0 0.625rem; border-radius: var(--r-pill);
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.01em;
  background: var(--tone); color: var(--on-tone, #fff);
}
.tone-workshop { --on-tone: var(--on-workshop); }
.tone-panel { --on-tone: var(--on-panel); }
.tone-talk { --on-tone: var(--on-talk); }
.tone-performance { --on-tone: var(--on-performance); }
.tone-showcase { --tone: var(--t-showcase); --on-tone: var(--on-showcase); }
.tone-market { --tone: var(--t-market); --on-tone: var(--on-market); }
.tone-family { --on-tone: var(--on-family); }
.tone-ongoing { --on-tone: var(--on-ongoing); }
.ev-tags .price { margin: 0; height: 1.375rem; }
.ev-status { display: flex; align-items: center; gap: 0.375rem; font-size: 0.8125rem; font-weight: 600; color: var(--live); margin-bottom: 0.125rem; }
.ev-title { display: block; font-size: 1.0625rem; font-weight: 600; line-height: 1.3; letter-spacing: -0.015em; }
.ev-by, .ev-where { display: block; }
.ev-progress { margin-top: 0.5rem; }
.ev-thumb { flex: none; width: 4.75rem; height: 4.75rem; border-radius: 12px; object-fit: cover; background: var(--surface-2); }
.ev-thumb-ph { display: grid; place-items: center; font-size: 1.75rem; background: color-mix(in srgb, var(--tone) 16%, var(--surface)); }
.ev-foot {
  display: flex; align-items: center; gap: 0.5rem; padding: 0.25rem 0.5rem 0.5rem 0.875rem;
  min-height: 2.75rem;
}
[dir="rtl"] .ev-foot { padding: 0.25rem 0.875rem 0.5rem 0.5rem; }
.foot-note { font-size: 0.8125rem; color: var(--ink-3); font-weight: 500; }
.foot-note.warn { color: var(--accent-text); font-weight: 600; }
.foot-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 0.25rem; }
.ev .save { width: 2.5rem; height: 2.5rem; border-radius: 50%; }
.reg {
  height: 2.25rem; padding: 0 1.125rem; border-radius: var(--r-pill); display: inline-flex; align-items: center;
  background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 0.9375rem; text-decoration: none;
  transition: transform 120ms ease-out;
}
.reg:active { transform: scale(0.95); transition-duration: 60ms; }
.reg:disabled { background: var(--surface-2); color: var(--ink-3); }
.sheet-photo { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 16px; margin: 0.25rem 0 0.75rem; }
.sheet-headline .ev-tags { margin-bottom: 0.25rem; }

/* Compact "open all evening" rows */
.allday { background: var(--surface); border-radius: var(--r-card); box-shadow: var(--shadow-card); overflow: hidden; }
.allday button {
  width: 100%; text-align: start; display: flex; align-items: center; gap: 0.75rem;
  padding: 0.8125rem 1rem; transition: background-color 100ms ease;
}
.allday button + button { border-top: 1px solid var(--line); }
.allday button:active { background: var(--surface-2); transition-duration: 0ms; }
.allday .t { font-weight: 600; font-size: 0.9875rem; line-height: 1.3; }
.allday .w { font-size: 0.8125rem; color: var(--ink-3); }
.allday .chev { margin-inline-start: auto; color: var(--ink-3); width: 1.1rem; height: 1.1rem; }
[dir="rtl"] .allday .chev { transform: scaleX(-1); }
.glyph {
  flex: none; width: 2.25rem; height: 2.25rem; border-radius: 11px; display: grid; place-items: center;
  background: var(--surface-2); color: var(--ink-2); font-weight: 700; font-size: 0.9375rem;
}

.empty {
  text-align: center; color: var(--ink-2); padding: 2rem 1.25rem; border-radius: var(--r-card);
  border: 1.5px dashed var(--line); font-size: 0.9375rem;
}
.empty b { display: block; color: var(--ink); font-size: 1.0625rem; margin-bottom: 0.25rem; }

.disclosure { margin-top: 1rem; }
.disclosure summary {
  list-style: none; display: flex; align-items: center; gap: 0.75rem; padding: 0.8125rem 1rem;
  background: var(--surface); border-radius: var(--r-card); box-shadow: var(--shadow-card); cursor: pointer;
}
.disclosure summary::-webkit-details-marker { display: none; }
.disclosure summary .t { font-weight: 600; font-size: 0.9875rem; }
.disclosure summary .w { font-size: 0.8125rem; color: var(--ink-3); display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.disclosure summary > span:nth-child(2) { min-width: 0; }
.disclosure summary .glyph { background: var(--accent-soft); color: var(--accent-text); }
.disclosure summary .chev { transition: transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1); transform: rotate(90deg); }
.disclosure[open] summary .chev { transform: rotate(-90deg); }
.disclosure[open] summary { border-radius: var(--r-card) var(--r-card) 0 0; box-shadow: none; }
.disclosure[open] .allday { border-radius: 0 0 var(--r-card) var(--r-card); border-top: 1px solid var(--line); }

/* ─── Schedule controls ──────────────────────────────── */
.sticky-controls {
  position: sticky; top: calc(var(--top-h) + var(--safe-t)); z-index: 5;
  margin: 0 calc(var(--gutter) * -1); padding: 0.5rem var(--gutter) 0.625rem;
  background: var(--chrome);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  backdrop-filter: blur(22px) saturate(180%);
}
.segmented {
  position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  padding: 3px; border-radius: 12px; background: var(--surface-2);
}
.segmented .thumb {
  position: absolute; top: 3px; bottom: 3px; left: 0; border-radius: 9px;
  background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 3px 8px rgba(0, 0, 0, 0.06);
  will-change: transform;
}
.segmented button {
  position: relative; z-index: 1; height: 2.25rem; font-size: 0.9375rem; font-weight: 600; color: var(--ink-2);
  font-variant-numeric: tabular-nums; transition: color 150ms ease;
}
.segmented button[aria-pressed="true"] { color: var(--ink); }
.segmented button .today { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--live); margin-inline-start: 0.375rem; vertical-align: 2px; }

.chips {
  display: flex; gap: 0.5rem; overflow-x: auto; margin: 0.625rem calc(var(--gutter) * -1) 0;
  padding: 0 var(--gutter); scrollbar-width: none; overscroll-behavior-x: contain;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; height: 2rem; padding: 0 0.875rem; border-radius: var(--r-pill);
  background: var(--surface); color: var(--ink-2); font-size: 0.875rem; font-weight: 600;
  box-shadow: inset 0 0 0 1px var(--line);
  display: inline-flex; align-items: center; gap: 0.375rem;
  transition: transform 120ms ease-out, background-color 150ms ease, color 150ms ease;
}
.chip:active { transform: scale(0.95); transition-duration: 60ms; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); box-shadow: none; }
.chip .dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--tone); }
.chip svg { width: 1rem; height: 1rem; }

.slot { display: grid; grid-template-columns: 3.75rem 1fr; gap: 0.75rem; margin-top: 1.125rem; }
.slot-time {
  position: sticky; top: calc(var(--top-h) + var(--safe-t) + 6.5rem); align-self: start;
  padding-top: 0.875rem; font-weight: 700; font-size: 0.9375rem; letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.slot-time small { display: block; font-size: 0.75rem; font-weight: 600; color: var(--ink-3); }
.day-note { margin: 1.125rem 0 0; color: var(--ink-2); font-size: 0.9375rem; }
.footnote { margin: 2rem 0 0; font-size: 0.8125rem; color: var(--ink-3); text-align: center; }

/* ─── Map ────────────────────────────────────────────── */
.map-wrap {
  position: relative; margin: 0.75rem calc(var(--gutter) * -1) 0; height: min(62dvh, 34rem);
  overflow: hidden; background: var(--map-ground); touch-action: none; user-select: none; -webkit-user-select: none;
}
.map-canvas { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.map-canvas svg, .map-canvas img { display: block; width: 100%; height: 100%; }
.map-canvas text { font: 600 26px "Graphik Arabic", system-ui, "Noto Sans Arabic", sans-serif; fill: var(--ink-2); }
.map-block { fill: var(--map-block); stroke: none; transition: fill 200ms ease; }
.map-block.is-active { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 2; }
.plan-wall { fill: none; stroke: var(--plan-wall); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.plan-soft { fill: none; stroke: var(--plan-soft); stroke-width: 0.6; }
.segmented.floors { margin-top: 0.75rem; }
.segmented.floors button { border-radius: 9px; transition: color 150ms ease, background-color 150ms ease, box-shadow 150ms ease; }
.segmented.floors button[aria-pressed="true"] { background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 3px 8px rgba(0, 0, 0, 0.06); }
.pin {
  position: absolute; transform: translate(-50%, -100%) scale(var(--inv, 1)); transform-origin: 50% 100%;
  display: flex; flex-direction: column; align-items: center;
}
.pin span {
  background: var(--surface); color: var(--ink); border-radius: var(--r-pill);
  padding: 0.3125rem 0.625rem; font-size: 0.75rem; font-weight: 600; white-space: nowrap;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.16); display: flex; align-items: center; gap: 0.375rem;
  transition: transform 120ms ease-out;
}
.pin:active span { transform: scale(0.94); transition-duration: 60ms; }
.pin::after { content: ""; width: 2px; height: 0.625rem; background: var(--surface); }
.pin.is-live span::before { content: ""; width: 0.4375rem; height: 0.4375rem; border-radius: 50%; background: var(--live-dot); }
.pin.is-active span { background: var(--ink); color: var(--bg); }
.pin.is-active::after { background: var(--ink); }
.map-tools {
  position: absolute; inset-inline-end: 0.75rem; bottom: 0.75rem; display: grid; border-radius: 14px; overflow: hidden;
  background: var(--chrome); -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}
.map-tools button { width: 2.75rem; height: 2.75rem; display: grid; place-items: center; transition: background-color 100ms ease; }
.map-tools button + button { border-top: 1px solid var(--line); }
.map-tools button:active { background: var(--surface-2); transition-duration: 0ms; }
/* ─── Makers ─────────────────────────────────────────── */
.grid-makers { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.625rem; }
.maker {
  text-align: start; background: var(--surface); border-radius: var(--r-card); box-shadow: var(--shadow-card);
  padding: 0.875rem; display: flex; flex-direction: column; gap: 0.625rem; min-height: 8.5rem;
  transition: transform 120ms ease-out;
}
.maker:active { transform: scale(0.97); transition-duration: 60ms; }
.avatar {
  width: 2.75rem; height: 2.75rem; border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; font-size: 1rem; color: #fff; background: var(--hue);
}
.maker b { font-size: 0.9375rem; line-height: 1.25; font-weight: 600; }
.maker small { font-size: 0.8125rem; color: var(--ink-3); margin-top: auto; }
.about-card { background: var(--surface); border-radius: var(--r-card); padding: 1.125rem; box-shadow: var(--shadow-card); color: var(--ink-2); font-size: 1rem; }
.about-card p { margin: 0; }
.market-card {
  margin-top: 0.625rem; padding: 1.125rem; border-radius: var(--r-card);
  background: var(--accent-soft); color: var(--ink);
}
.market-card b { display: block; font-size: 1.0625rem; margin-bottom: 0.25rem; }
.market-card p { margin: 0; color: var(--ink-2); font-size: 0.9375rem; }

/* ─── Sheet ──────────────────────────────────────────── */
.sheet { position: fixed; inset: 0; z-index: 40; }
.sheet-scrim { position: absolute; inset: 0; background: var(--scrim); opacity: 0; touch-action: none; }
.sheet-panel {
  position: absolute; inset: auto 0 0 0; margin: 0 auto; max-width: 40rem;
  max-height: calc(100dvh - var(--safe-t) - 2.5rem);
  display: flex; flex-direction: column;
  background: var(--sheet);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  backdrop-filter: blur(30px) saturate(180%);
  border-radius: 28px 28px 0 0; box-shadow: var(--shadow-sheet);
  transform: translate3d(0, 100%, 0); will-change: transform; outline: none;
}
.sheet-head { position: relative; padding: 0.5rem 1.25rem 0.75rem; touch-action: none; cursor: grab; flex: none; }
.grabber { display: block; width: 2.25rem; height: 0.3125rem; border-radius: 3px; background: var(--ink-3); opacity: 0.45; margin: 0 auto 0.75rem; }
.sheet-close {
  position: absolute; top: 0.875rem; inset-inline-end: 1rem; width: 1.875rem; height: 1.875rem; border-radius: 50%;
  display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2);
  transition: transform 120ms ease-out;
}
.sheet-close:active { transform: scale(0.9); transition-duration: 60ms; }
.sheet-close svg { width: 1rem; height: 1rem; stroke-width: 2.4; }
.sheet-headline { padding-inline-end: 2.25rem; }
.sheet-headline h2 { margin: 0.25rem 0 0; font-size: 1.625rem; line-height: 1.15; font-weight: 700; letter-spacing: -0.022em; }
.sheet-headline .sub { margin: 0.25rem 0 0; color: var(--ink-2); font-size: 1rem; }
.sheet-body {
  overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  padding: 0.25rem 1.25rem calc(1.5rem + var(--safe-b));
}
.facts { background: var(--surface); border-radius: 16px; overflow: hidden; margin: 0.5rem 0 0; }
.fact { display: flex; align-items: center; gap: 0.875rem; padding: 0.8125rem 1rem; }
.fact + .fact { border-top: 1px solid var(--line); }
.fact svg { color: var(--ink-3); }
.fact .k { font-size: 0.75rem; color: var(--ink-3); font-weight: 600; letter-spacing: 0.01em; }
.fact .v { font-weight: 600; font-size: 0.9875rem; line-height: 1.3; }
.fact .act { margin-inline-start: auto; color: var(--accent-text); font-weight: 600; font-size: 0.9375rem; padding: 0.375rem 0; }
.sheet-about { margin: 1rem 0 0; color: var(--ink-2); }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0.625rem; margin-top: 1.25rem; }
.btn {
  height: 3.125rem; border-radius: 14px; display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  font-weight: 600; font-size: 1rem; background: var(--surface-2); color: var(--ink);
  transition: transform 120ms ease-out, background-color 150ms ease;
}
.btn:active { transform: scale(0.97); transition-duration: 60ms; }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.primary[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.btn.primary[aria-pressed="true"] svg { fill: currentColor; }
.sheet-list { margin-top: 1rem; }
.sheet-list h3 { font-size: 0.8125rem; font-weight: 600; color: var(--ink-3); margin: 1.25rem 0 0.5rem; letter-spacing: 0.01em; }
.sheet-list .ev { background: var(--surface); }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-b) + 0.75rem); z-index: 60;
  transform: translate(-50%, 1rem); opacity: 0; pointer-events: none;
  padding: 0.625rem 1rem; border-radius: var(--r-pill); font-weight: 600; font-size: 0.9375rem;
  background: var(--ink); color: var(--bg); box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
  transition: opacity 200ms ease, transform 300ms cubic-bezier(0.2, 0.9, 0.3, 1);
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.sheet-open .toast { bottom: calc(var(--safe-b) + 1rem); }

/* ─── Accessibility preferences ──────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .view.entering { animation: fade 160ms ease; }
  @keyframes fade { from { opacity: 0; } }
  .top-title, .toast { transition: opacity 160ms ease; }
  .press:active, .ev:has(.ev-main:active), .maker:active, .chip:active, .btn:active, .pill:active, .tabbar button:active { transform: none; }
}
@media (prefers-reduced-transparency: reduce) {
  :root { --chrome: var(--bg); --sheet: var(--surface); }
  .chrome-top, .tabbar, .sticky-controls, .sheet-panel, .map-tools { -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  :root { --line: rgba(0, 0, 0, 0.35); --ink-3: var(--ink-2); --chrome: var(--bg); }
  .ev, .maker, .allday, .facts, .chip { box-shadow: inset 0 0 0 1.5px var(--line); }
}

@media (min-width: 40rem) {
  .grid-makers { grid-template-columns: repeat(3, 1fr); }
  .large-title { font-size: 2.5rem; }
}

/* ─── Tickets: free vs paid, seats, register ─────────── */
.price {
  display: inline-flex; align-items: center; height: 1.25rem; padding: 0 0.5rem; border-radius: var(--r-pill);
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0; white-space: nowrap; margin-inline-start: 0.125rem;
}
.price.paid { background: var(--accent-soft); color: var(--accent-text); }
.price.free { background: var(--live-soft); color: var(--live); }
.price.is-full { background: var(--surface-2); color: var(--ink-3); }
.hero-entry {
  display: inline-block; margin: 0.875rem 0 0; padding: 0.375rem 0.75rem; border-radius: var(--r-pill);
  font-size: 0.875rem; font-weight: 600; background: color-mix(in srgb, var(--on-hero) 12%, transparent);
}
.fact .v.warn { color: var(--accent-text); }
.seatbar { display: block; height: 4px; border-radius: 2px; background: var(--surface-2); margin-top: 0.5rem; overflow: hidden; }
.seatbar i { display: block; height: 100%; width: calc(var(--p) * 100%); background: var(--accent); border-radius: inherit; transition: width 400ms cubic-bezier(0.2, 0.8, 0.2, 1); }
.btn.wide { grid-column: 1 / -1; text-decoration: none; }
.btn.wide svg { width: 1.125rem; height: 1.125rem; stroke-width: 2.2; }
[dir="rtl"] .btn.wide svg { transform: scaleX(-1); }
.btn:disabled { color: var(--ink-3); cursor: default; }
.btn:disabled:active { transform: none; }
.actions + .actions { margin-top: 0.625rem; }

/* ─── Floors and photos ──────────────────────────────── */
.floor-h { font-size: 0.8125rem; font-weight: 600; color: var(--ink-3); margin: 1.25rem 0 0.5rem; letter-spacing: 0.01em; }
.floor-h:first-of-type { margin-top: 0; }
.photos {
  display: flex; gap: 0.625rem; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
  margin: 0.75rem calc(var(--gutter) * -1) 0; padding: 0 var(--gutter); scroll-padding-inline: var(--gutter); scrollbar-width: none;
}
.photos::-webkit-scrollbar { display: none; }
.photos img {
  flex: none; width: 9.5rem; height: 9.5rem; object-fit: cover; border-radius: var(--r-card);
  scroll-snap-align: start; background: var(--surface-2);
}

/* ─── Add-to-calendar menu (computers) ───────────────── */
.cal-menu {
  position: fixed; z-index: 70; min-width: 15rem; padding: 0.375rem; border-radius: 16px;
  background: var(--sheet); -webkit-backdrop-filter: blur(30px) saturate(180%); backdrop-filter: blur(30px) saturate(180%);
  box-shadow: 0 0 0 1px var(--line), 0 12px 40px rgba(20, 16, 20, 0.22);
  opacity: 0; transform: scale(0.92);
  transition: opacity 160ms ease, transform 200ms cubic-bezier(0.2, 0.9, 0.3, 1);
}
.cal-menu.on { opacity: 1; transform: none; }
.cal-menu button {
  width: 100%; display: flex; align-items: center; gap: 0.75rem; text-align: start;
  padding: 0.625rem 0.75rem; border-radius: 10px; font-weight: 600; font-size: 0.9375rem;
}
.cal-menu button:hover, .cal-menu button:focus-visible { background: var(--surface-2); outline: none; }
.cal-menu button:active { background: var(--surface-2); transform: scale(0.98); }
.cal-menu small { display: block; font-size: 0.75rem; font-weight: 500; color: var(--ink-3); }
.cal-ico { width: 1.75rem; height: 1.75rem; border-radius: 7px; flex: none; background: var(--surface-2) center / 1.125rem no-repeat; }
.cal-apple { background-color: #FF3B30; }
.cal-google { background-color: #1A73E8; }
.cal-outlook { background-color: #0F6CBD; }
.cal-apple, .cal-google, .cal-outlook, .cal-file {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round'%3E%3Crect x='4' y='5.5' width='16' height='14' rx='2.5'/%3E%3Cpath d='M4 10h16M9 3.5v4M15 3.5v4'/%3E%3C/svg%3E");
}
.cal-file { background-color: var(--ink-3); }
@media (prefers-reduced-motion: reduce) {
  .cal-menu { transform: none; transition: opacity 120ms ease; }
}

/* ─── Logo intro (intro.js) ──────────────────────────── */
.intro { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; cursor: pointer;
  animation: intro-failsafe 0s 4s forwards; } /* never trap the page if the script doesn't run */
.intro-bg { position: absolute; inset: 0; background: var(--bg); }
/* Each letter is its own small <svg> so Safari (every iPhone browser) can move it; it won't animate shapes inside one SVG */
.intro-logo { position: relative; width: min(76vw, 26rem); aspect-ratio: 1789 / 746; transform-origin: 50% 50%; }
.intro .g { position: absolute; overflow: visible; fill: var(--ink); opacity: 0; transform-origin: 50% 50%; }
.intro .g[data-k="stroke"] { transform-origin: 100% 50%; }
.intro-on .brand .logo { visibility: hidden; }
@keyframes intro-failsafe { to { visibility: hidden; pointer-events: none; } }


/* Home description, facilitator block, makers page sub-heading */
.hero-about { max-width: 38rem; line-height: 1.55; }
.sheet-about + .sheet-about { margin-top: 0.75rem; }
.sheet-note { margin: 0.75rem 0 0; color: var(--ink-3); font-size: 0.9375rem; }
.person-block { margin-top: 1.25rem; }
.person { display: flex; gap: 0.75rem; align-items: center; }
.person b { display: block; font-size: 1rem; }
.person .bio { display: block; margin-top: 0.25rem; color: var(--ink-2); font-size: 0.9375rem; white-space: pre-line; }
.sub-h { margin: 1.25rem 0 0.5rem; font-size: 0.8125rem; font-weight: 600; color: var(--ink-3); letter-spacing: 0.02em; }
.sheet-about { white-space: pre-line; }

/* ─── Laptop and desktop (phones keep the layout above) ──────────────
   The page opens up to a 74rem frame: Home puts the intro beside the schedule, cards run in two
   columns, makers fill the row, the map gets a proper canvas, and the tab bar becomes a centred bar. */
@media (min-width: 64rem) {
  :root { --gutter: 2.5rem; }
  .view { max-width: 74rem; }
  .chrome-top { padding-inline: max(var(--gutter), calc((100vw - 74rem) / 2 + var(--gutter))); }
  .large-title { font-size: 3rem; margin-top: 1.25rem; }

  /* floating, centred tab bar */
  .tabbar {
    inset: auto auto 1.25rem 50%; transform: translateX(-50%); width: 30rem; height: var(--tabbar-h);
    padding: 0 0.5rem; border: 1px solid var(--chrome-edge); border-radius: 22px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.16);
  }
  .tabbar button { flex-direction: row; gap: 0.5rem; font-size: 0.875rem; }
  .tabbar button svg { width: 1.25rem; height: 1.25rem; }

  /* Home: one wide banner (words left, countdown right), then the schedule below it */
  .hero { display: grid; grid-template-columns: minmax(0, 1fr) 13rem; column-gap: 3rem; align-items: center; padding: 2.5rem 2.5rem 2.25rem; }
  .hero > * { grid-column: 1; }
  .hero > .hero-count { grid-column: 2; grid-row: 1 / span 3; text-align: center; }
  .hero-count .hero-sub { margin-top: 0 !important; }
  /* Cards in two columns wherever they form a list */
  .list.rows, #view-now .list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem 1.25rem; align-items: start; }
  .sticky-controls .segmented { max-width: 30rem; }
  .day-note { font-size: 1rem; }

  /* Map */
  .map-wrap { margin: 0.75rem 0 0; height: min(74dvh, 48rem); border-radius: 22px; }

  /* Makers */
  .grid-makers { grid-template-columns: repeat(auto-fill, minmax(13.5rem, 1fr)); gap: 0.875rem; }
  .allday { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .allday button:nth-child(2) { border-top: none; }
  .allday button:nth-child(even) { border-inline-start: 1px solid var(--line); }

  .sheet-panel { max-width: 44rem; margin-bottom: 1rem; border-radius: 28px; }
}
@media (min-width: 90rem) {
  .view { max-width: 80rem; }
  .chrome-top { padding-inline: max(var(--gutter), calc((100vw - 80rem) / 2 + var(--gutter))); }
}

/* ─── Mouse and keyboard polish (laptops) ─────────────── */
::selection { background: var(--accent-soft); color: var(--ink); }
html { scrollbar-color: color-mix(in srgb, var(--ink-3) 55%, transparent) transparent; }
.sheet-about, .hero-about, .market-card p { max-width: 68ch; }
@media (hover: hover) and (pointer: fine) {
  .ev, .maker { transition: transform 160ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 160ms ease; }
  .ev:hover, .maker:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.14); }
  .ev:has(.ev-main:active), .maker:active { transform: scale(0.985); }
  .allday button:hover, .disclosure summary:hover { background: var(--surface-2); }
  .chip:hover:not([aria-pressed="true"]), .pill:hover { background: var(--surface-2); }
  .tabbar button:hover:not([aria-current="page"]) { color: var(--ink-2); }
  .segmented button:hover:not([aria-pressed="true"]) { color: var(--ink); }
  .pin:hover span { box-shadow: 0 4px 14px rgba(0, 0, 0, 0.24); }
  .reg:hover, .btn.primary:hover { filter: brightness(1.06); }
  .save:hover { color: var(--accent); }
}

/* ─── Home category blocks ───────────────────────────── */
.cats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.625rem; }
.cat {
  display: flex; flex-direction: column; justify-content: space-between; gap: 1.5rem; min-height: 8.5rem; padding: 1rem;
  border-radius: var(--r-card); background: var(--tone); color: var(--on-tone); text-align: start;
  transition: transform 120ms ease-out, filter 150ms ease;
}
.cat:active { transform: scale(0.97); transition-duration: 60ms; }
.cat b { font-size: 1.25rem; line-height: 1.2; font-weight: 700; letter-spacing: -0.02em; }
.cat span { font-size: 0.875rem; font-weight: 500; opacity: 0.8; }
.cat .cat-note { margin-top: -1.25rem; font-size: 0.8125rem; font-weight: 600; opacity: 1; }
.cat .cat-meta { margin-top: auto; }
.maker { min-height: 0; padding: 1rem; justify-content: center; }
.chip.tone-talk .dot, .chip.tone-performance .dot { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25); }
@media (min-width: 40rem) { .cats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 64rem) {
  .cat { min-height: 10rem; padding: 1.25rem; }
  .cat b { font-size: 1.5rem; }
  .hero-count .countdown { grid-template-columns: minmax(0, 1fr); }
}
@media (hover: hover) and (pointer: fine) { .cat:hover { filter: brightness(1.05); transform: translateY(-2px); } }
.hero-count { text-align: center; }
.hero-count .countdown { justify-content: center; }
