/* OPFA · Bengaluru
   Dark, dense, terminal-influenced. See .claude/skills/event-ui/SKILL.md.
   No framework, no build step, no webfonts. */

:root {
  /* Surfaces — four steps, near-black. Never #000: it smears on OLED while
     scrolling and leaves no headroom for elevation. */
  --bg:       #07090d;
  --surface:  #0e1117;
  --raised:   #151b24;
  --line:     #1e2633;
  --line-hi:  #2b3646;

  /* Ink — three steps. A fourth is always indistinguishable from its neighbour. */
  --ink:      #e8eef7;
  --ink-2:    #97a4b8;
  --ink-3:    #5c6779;

  /* Signal colours. Each means exactly one thing. The two track colours are
     the backbone: category strip, cover gradient and accent all derive from
     whether an event is career or going-out. */
  --career:   #00e08a;
  --going:    #ff3d9a;
  --gold:     #ffb020;
  --live:     #ff4d4d;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto,
          "Helvetica Neue", Arial, sans-serif;
  /* Monospace does the entire "techy" job on its own, which is what lets the
     rest of the design stay calm. Used for anything a machine produced. */
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  --r:    12px;
  --r-sm:  8px;
  --rail: 236px;
  --shadow: 0 10px 34px rgba(0,0,0,.55);
}

* { box-sizing: border-box; }

html {
  /* Tells the browser to render scrollbars, native selects and form controls
     in the matching scheme. Without it they stay light against a dark page. */
  color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }

html, body {
  margin: 0; padding: 0; max-width: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* `clip`, not `hidden`, and on body only. `overflow-x: hidden` on <html>
   turns it into a scroll container, which on iOS Safari breaks vertical
   scrolling outright. This shipped once. */
body {
  overflow-x: clip;
  /* Faint engineering grid. Fixed so it does not travel with the content. */
  background-image:
    linear-gradient(rgba(255,255,255,.014) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.014) 1px, transparent 1px);
  background-size: 56px 56px;
  background-attachment: fixed;
}

a { color: inherit; text-decoration: none; }

/* Keyboard focus must be visible, and only for keyboard users - :focus alone
   puts a ring on every mouse click too. */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--career);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

/* Removes the 300ms double-tap-zoom wait on touch devices. */
button, a, .chip, .pill, .ev, select, input { touch-action: manipulation; }

/* Stops a heading breaking with one word stranded on the last line. */
h1, h2, h3, .ev-title, .ev-cover-title { text-wrap: balance; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.02em; }

/* Anything a machine produced. */
.mono, .ev-when, .ev-date, .ev-cat, .src, .price, .tag, .pill,
.count, .chip, .n { font-family: var(--mono); }

/* ------------------------------------------------------------------ shell */
.shell { display: flex; min-height: 100vh; min-height: 100dvh; }

.rail {
  width: var(--rail); flex: 0 0 var(--rail);
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 16px 10px 12px;
  display: flex; flex-direction: column; gap: 16px;
  position: sticky; top: 0; overflow-y: auto;
  height: 100vh; height: 100dvh;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 2px 6px 6px; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px;
  display: grid; place-items: center;
  font-family: var(--mono); font-weight: 700; font-size: 13px;
  color: #04150e; background: linear-gradient(140deg, var(--career), #7ef7c6);
  box-shadow: 0 0 18px rgba(0,224,138,.28);
}
.brand-word { font-size: 17px; font-weight: 800; line-height: 1.05; }
.brand-word em { font-style: normal; color: var(--career); }
.brand-word small {
  display: block; font-family: var(--mono); font-size: 9.5px; font-weight: 500;
  color: var(--ink-3); letter-spacing: .18em; text-transform: uppercase;
  margin-top: 2px;
}

.rail-nav { display: flex; flex-direction: column; gap: 1px; }
.rail-link, .cat-link {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: var(--r-sm);
  color: var(--ink-2); font-size: 13.5px; font-weight: 600;
  border-left: 2px solid transparent;
  transition: background .13s, color .13s, border-color .13s;
}
.rail-link:hover, .cat-link:hover { background: var(--raised); color: var(--ink); }
.rail-link.active {
  background: var(--raised); color: var(--ink); border-left-color: var(--career);
}

.rail-section h4 {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--ink-3);
  margin: 0 0 8px 10px; font-weight: 500;
}
.rail-group {
  font-family: var(--mono); font-size: 9.5px; font-weight: 500;
  color: var(--ink-3); letter-spacing: .12em; text-transform: uppercase;
  margin: 14px 0 5px 10px;
}
.rail-group::before { content: "// "; opacity: .5; }
.rail-group:first-of-type { margin-top: 2px; }

.cat-link { padding: 6px 10px; font-size: 13px; font-weight: 500; }
.cat-link.active { background: var(--raised); color: var(--ink); font-weight: 600; }
.cat-link .n {
  margin-left: auto; font-size: 10.5px; color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.cat-link.active .n { color: var(--career); }

/* ------------------------------------------------------------------- main */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 18px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.icon-btn {
  background: var(--surface); border: 1px solid var(--line);
  width: 36px; height: 36px; border-radius: var(--r-sm);
  cursor: pointer; font-size: 15px;
}
.only-mobile { display: none; }

.search-wrap { position: relative; flex: 1; max-width: 540px; min-width: 0; }
#search {
  width: 100%; padding: 9px 13px 9px 32px; border-radius: var(--r-sm);
  border: 1px solid var(--line-hi); background: var(--surface);
  color: var(--ink); font-size: 14px; outline: none;
  transition: border-color .13s, background .13s;
}
#search::placeholder { color: var(--ink-3); }
#search:focus {
  border-color: var(--career); background: var(--raised);
  box-shadow: 0 0 0 3px rgba(0,224,138,.10);
}
/* A prompt caret rather than a magnifying glass — same job, on theme. */
.search-wrap::before {
  content: "›"; position: absolute; left: 13px; top: 50%;
  transform: translateY(-52%); font-family: var(--mono); font-size: 15px;
  color: var(--career); pointer-events: none; opacity: .8;
}

.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 50;
  background: var(--surface); border: 1px solid var(--line-hi);
  border-radius: var(--r); box-shadow: var(--shadow);
  max-height: 70vh; overflow-y: auto; padding: 5px;
}
.sr-group {
  font-family: var(--mono); font-size: 9.5px; text-transform: uppercase;
  letter-spacing: .14em; color: var(--ink-3); padding: 8px 10px 5px;
}
.sr-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--r-sm); cursor: pointer; font-size: 13.5px;
}
.sr-item:hover { background: var(--raised); }
.sr-item small { margin-left: auto; color: var(--ink-3); font-size: 11px; }

.src-pill {
  font-family: var(--mono); font-size: 10.5px; padding: 4px 9px;
  border-radius: 20px; background: var(--surface);
  border: 1px solid var(--line-hi); color: var(--ink-2); white-space: nowrap;
}
.src-pill.real { border-color: rgba(0,224,138,.35); color: var(--career); }

.view { padding: 18px 18px 84px; max-width: 1320px; width: 100%; }

/* ------------------------------------------------------------------ heads */
.page-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head h1 { font-size: 25px; }
.page-head .sub { font-family: var(--mono); color: var(--ink-3); font-size: 12px; }

.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(1100px 300px at 8% -40%, rgba(0,224,138,.11), transparent 60%),
    radial-gradient(800px 260px at 92% -30%, rgba(255,61,154,.09), transparent 60%),
    var(--surface);
  border: 1px solid var(--line-hi); border-radius: var(--r);
  padding: 22px 24px; margin-bottom: 20px;
}
.hero h1 { font-size: 27px; margin-bottom: 8px; letter-spacing: -.03em; }
.hero p { margin: 0; color: var(--ink-2); font-size: 13.5px; max-width: 64ch; }
/* Terminal prompt, the one overt nod to the theme. */
.hero h1::before {
  content: "▸ "; color: var(--career); font-family: var(--mono);
  font-size: 20px; vertical-align: 2px;
}

/* ----------------------------------------------------------------- chips */
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.chip {
  padding: 6px 12px; border-radius: 20px; cursor: pointer;
  border: 1px solid var(--line-hi); background: var(--surface);
  color: var(--ink-2); font-size: 12px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 6px;
  transition: background .13s, border-color .13s, color .13s;
}
.chip:hover:not(:disabled) { background: var(--raised); color: var(--ink); border-color: var(--ink-3); }
.chip.active {
  background: rgba(0,224,138,.13); border-color: var(--career);
  color: var(--career); font-weight: 600;
}
.chip.active.alt {
  background: rgba(255,61,154,.13); border-color: var(--going); color: var(--going);
}
.chip:disabled { opacity: .4; cursor: default; }
.chip .n { font-size: 10px; opacity: .7; }

.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar select, .toolbar input {
  padding: 7px 11px; border-radius: var(--r-sm); background: var(--surface);
  border: 1px solid var(--line-hi); color: var(--ink); font-size: 13px;
  outline: none; min-width: 0; flex: 1 1 150px; max-width: 100%;
}
.toolbar select:focus, .toolbar input:focus { border-color: var(--career); }
.count { color: var(--ink-3); font-size: 11.5px; margin-left: auto; }

/* ----------------------------------------------------------------- cards */
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(286px, 1fr)); }

.ev {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); overflow: hidden; cursor: pointer;
  transition: border-color .15s, background .15s;
  /* Skip layout and paint for cards outside the viewport. A browse page holds
     60 of them; contain-intrinsic-size keeps the scrollbar honest so nothing
     jumps as they come into view. Cheaper than virtualising, and it degrades
     to nothing on browsers without support. */
  content-visibility: auto;
  contain-intrinsic-size: auto 320px;
}
/* Border brightens, nothing moves. A grid that jumps under the cursor is
   tiring to scan. */
.ev:hover { border-color: var(--line-hi); background: var(--raised); }

.ev-img { position: relative; aspect-ratio: 16/9; background: #0a0d13; overflow: hidden; }
.ev-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ev-img .ph { width: 100%; height: 100%; display: grid; place-items: center; font-size: 34px; }

.ev-date {
  position: absolute; top: 8px; left: 8px; z-index: 2;
  background: rgba(7,9,13,.82); backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: var(--r-sm); padding: 4px 8px; text-align: center; line-height: 1.15;
}
.ev-date b { display: block; font-size: 14px; font-weight: 700; }
.ev-date span { font-size: 9px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3); }

.ev-badge {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  font-family: var(--mono); font-size: 9.5px; font-weight: 600;
  padding: 4px 8px; border-radius: 20px;
  text-transform: uppercase; letter-spacing: .06em;
  background: rgba(0,224,138,.16); color: var(--career);
  border: 1px solid rgba(0,224,138,.35);
}
.ev-badge.alt { background: rgba(255,61,154,.16); color: var(--going); border-color: rgba(255,61,154,.35); }
.ev-badge.free { background: rgba(255,176,32,.15); color: var(--gold); border-color: rgba(255,176,32,.35); }

/* Generated cover for events with no artwork. */
/* A generated cover holds a title, not a photograph, so it does not need a
   photo's aspect ratio - at 16:9 the top half was empty gradient. */
.ev-cover { display: grid; align-items: end; aspect-ratio: 2 / 1; }
.ev-glyph {
  position: absolute; right: -8px; bottom: -16px; font-size: 82px; line-height: 1;
  opacity: .15; transform: rotate(-8deg); pointer-events: none; filter: grayscale(.3);
}
.ev-cover-title {
  margin: 0; padding: 44px 13px 12px; position: relative; z-index: 1;
  font-size: 16px; font-weight: 700; line-height: 1.25; letter-spacing: -.02em;
  color: #fff; text-shadow: 0 1px 10px rgba(0,0,0,.5);
  /* Three lines, not four. The cover is 2:1 now, and a fourth line grew
     upward into the date chip. */
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  background: linear-gradient(transparent, rgba(7,9,13,.5) 55%);
}

.ev-body { padding: 11px 13px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.ev-cat {
  font-size: 9.5px; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; color: var(--career);
}
.ev-cat.alt { color: var(--going); }
/* Card only - the detail view reuses .ev-cat for its back link, which
   already has its own arrow. */
.ev .ev-cat::before { content: "▸ "; opacity: .7; }
.ev-title { font-size: 15px; font-weight: 700; line-height: 1.3; letter-spacing: -.01em; }

.ev-meta { font-size: 11.5px; color: var(--ink-3); display: flex; flex-direction: column; gap: 3px; margin-top: auto; }
.ev-meta div { display: flex; align-items: center; gap: 6px; }
.ev-meta .i { width: 12px; text-align: center; opacity: .65; font-style: normal; }
.ev-meta .dist {
  font-family: var(--mono); color: var(--career); font-weight: 600;
  font-size: 10.5px; margin-left: 2px;
}

.ev-foot {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding-top: 8px; margin-top: 2px; border-top: 1px solid var(--line);
  font-size: 11px;
}
.price { font-weight: 700; color: var(--gold); font-variant-numeric: tabular-nums; }
.price.free { color: var(--career); }
.src { margin-left: auto; color: var(--ink-3); font-size: 10px; }
.tagline { display: flex; gap: 4px; flex-wrap: wrap; }
.tag {
  font-size: 9.5px; padding: 2px 7px; border-radius: 4px;
  background: var(--bg); border: 1px solid var(--line); color: var(--ink-2);
}

/* --------------------------------------------------------------- shelves */
.shelf { margin-bottom: 24px; }
.shelf-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.shelf-head h2 { font-size: 16px; letter-spacing: -.02em; }
.shelf-head .n { font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.shelf-head a { margin-left: auto; font-family: var(--mono); font-size: 11.5px; color: var(--career); }
.shelf-head a:hover { text-decoration: underline; }
.rowscroll {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(264px, 264px);
  gap: 12px; overflow-x: auto; padding-bottom: 4px;
  scroll-snap-type: x proximity; scrollbar-width: thin;
}
.rowscroll > * { scroll-snap-align: start; }
.rowscroll::-webkit-scrollbar { height: 6px; }
.rowscroll::-webkit-scrollbar-thumb { background: var(--line-hi); border-radius: 20px; }

/* ---------------------------------------------------------------- detail */
.detail { max-width: 860px; }
.detail-hero { border-radius: var(--r); overflow: hidden; margin-bottom: 16px; border: 1px solid var(--line); }
.detail-hero img { width: 100%; display: block; max-height: 330px; object-fit: cover; }
.detail h1 { font-size: 26px; margin-bottom: 10px; letter-spacing: -.03em; }
.detail-meta { display: grid; gap: 9px; grid-template-columns: repeat(auto-fit, minmax(196px, 1fr)); margin: 16px 0; }
.dm { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; }
.dm span {
  font-family: var(--mono); font-size: 9.5px; text-transform: uppercase;
  letter-spacing: .12em; color: var(--ink-3);
}
.dm b { display: block; margin-top: 3px; font-size: 13.5px; font-weight: 600; }
.detail p.desc { color: var(--ink-2); font-size: 14px; white-space: pre-wrap; }
.cta {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--career); color: #04150e; font-weight: 700;
  padding: 11px 22px; border-radius: var(--r-sm); margin: 6px 0 18px; font-size: 14px;
  box-shadow: 0 0 24px rgba(0,224,138,.22);
  transition: filter .13s;
}
.cta:hover { filter: brightness(1.1); }
.cta.alt { background: var(--going); color: #1c0311; box-shadow: 0 0 24px rgba(255,61,154,.22); }

/* --------------------------------------------------------------- generic */
.empty { text-align: center; padding: 56px 20px; color: var(--ink-3); }
.empty .big { font-size: 38px; margin-bottom: 12px; opacity: .5; }

.skeleton {
  height: 200px; border-radius: var(--r); margin-bottom: 12px;
  background: linear-gradient(100deg, var(--surface) 30%, var(--raised) 50%, var(--surface) 70%);
  background-size: 220% 100%; animation: sk 1.3s infinite;
}
@keyframes sk { to { background-position: -220% 0; } }

.notice {
  display: flex; gap: 10px; padding: 10px 13px; border-radius: var(--r-sm);
  background: rgba(255,176,32,.07); border: 1px solid rgba(255,176,32,.22);
  color: var(--gold); font-size: 12.5px; margin-bottom: 12px;
}
.notice.info { background: rgba(0,224,138,.07); border-color: rgba(0,224,138,.22); color: var(--career); }

.more {
  display: block; width: 100%; margin-top: 14px; padding: 12px;
  border-radius: var(--r-sm); border: 1px solid var(--line-hi);
  background: var(--surface); cursor: pointer; font-family: var(--mono);
  font-size: 12.5px; color: var(--ink-2);
}
.more:hover { background: var(--raised); color: var(--ink); border-color: var(--career); }

.tabbar { display: none; }
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.66); z-index: 45; }

/* -------------------------------------------------------------- MOBILE */
/* Below 900px this stops being a website with a sidebar and becomes an app. */
@media (max-width: 900px) {
  .only-mobile { display: grid; place-items: center; }

  /* Deliberately no overscroll-behavior or overflow here — both have a habit
     of interfering with scrolling on real iOS. */
  html, body { -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%; }
  .rail-link, .cat-link, .pill, .chip, .tabbar a, .ev { user-select: none; -webkit-touch-callout: none; }
  .ev:active { transform: scale(.985); }
  .ev:hover { background: var(--surface); }   /* no hover state on touch */

  .rail {
    position: fixed; left: 0; top: 0; z-index: 60;
    width: 82vw; max-width: 320px; flex-basis: auto;
    transform: translateX(-100%);
    transition: transform .24s cubic-bezier(.32,.72,0,1);
    box-shadow: var(--shadow);
    padding-top: calc(16px + env(safe-area-inset-top));
  }
  .rail.open { transform: none; }

  .topbar { gap: 8px; padding: 8px 12px; padding-top: calc(8px + env(safe-area-inset-top)); }
  .icon-btn { width: 38px; height: 38px; flex: 0 0 38px; }
  .search-wrap { max-width: none; }
  #search { font-size: 16px; padding: 10px 12px 10px 30px; }   /* 16px: iOS won't zoom */
  .topbar-right { display: none; }

  /* Category rail — browsing must be one thumb tap, not a drawer. */
  .pillbar {
    display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
    padding: 8px 12px; position: sticky; top: 55px; z-index: 39;
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
    -webkit-overflow-scrolling: touch;
  }
  .pillbar::-webkit-scrollbar { display: none; }
  .pill {
    flex: 0 0 auto; padding: 7px 13px; border-radius: 20px;
    background: var(--surface); border: 1px solid var(--line-hi);
    font-size: 12px; color: var(--ink-2); white-space: nowrap;
  }
  .pill.active {
    background: rgba(0,224,138,.14); border-color: var(--career);
    color: var(--career); font-weight: 600;
  }

  .view { padding: 13px 12px 92px; }
  .page-head { gap: 4px; margin-bottom: 10px; }
  .page-head h1 { font-size: 20px; }
  /* The hero is read once. On a 844px screen it was taking 150px of the
     first viewport away from the listings people came for. */
  .hero { padding: 13px 14px; margin-bottom: 14px; border-radius: var(--r-sm); }
  .hero h1 { font-size: 17px; margin-bottom: 4px; }
  .hero h1::before { font-size: 14px; }
  .hero p {
    font-size: 12px; line-height: 1.45; color: var(--ink-3);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .shelf { margin-bottom: 20px; }
  .shelf-head h2 { font-size: 15px; }
  /* Peek the next card so the carousel invites a swipe. */
  .rowscroll {
    grid-auto-columns: 78%; gap: 10px; scroll-snap-type: x mandatory;
    padding-inline: 12px; margin-inline: -12px;
  }
  .rowscroll::-webkit-scrollbar { display: none; }

  .tabbar {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
    background: color-mix(in srgb, var(--bg) 94%, transparent);
    backdrop-filter: saturate(160%) blur(18px);
    border-top: 1px solid var(--line);
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
  }
  /* Text-only tabs, so the label has to carry the whole target on its own -
     9px was fine under an icon and is not fine without one. */
  .tabbar a {
    position: relative; flex: 1;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--mono); font-size: 11px; font-weight: 500;
    letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3);
    padding: 13px 2px 11px; transition: color .15s;
  }
  .tabbar a.active { color: var(--career); font-weight: 700; }
  .tabbar a.active::before {
    content: ''; position: absolute; top: 0; width: 24px; height: 2px;
    border-radius: 0 0 3px 3px; background: var(--career);
    box-shadow: 0 0 10px var(--career);
  }

  .grid { grid-template-columns: repeat(auto-fill, minmax(236px, 1fr)); }
}

@media (max-width: 520px) {
  .grid { grid-template-columns: 1fr; gap: 10px; }
  .rowscroll { grid-auto-columns: 80%; }
  /* One column, so let the artwork breathe rather than sit in a letterbox. */
  .ev-img { aspect-ratio: 3/2; }
  .ev-cover { aspect-ratio: 16 / 9; }   /* text-only, keep it shallow */
  .ev-title { font-size: 15.5px; }
  .toolbar { gap: 7px; }
  .toolbar select, .toolbar input { flex: 1 1 100%; }
  .toolbar .count { margin-left: 0; width: 100%; }
  .detail-meta { grid-template-columns: 1fr; }
  .detail h1 { font-size: 21px; }
  .detail-hero img { max-height: 210px; }
  .cta { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .rowscroll { scroll-behavior: auto; }
}

/* ---------------------------------------------------------------- LIGHT
   Not an inversion of the dark palette. Mint that glows on near-black is
   nearly invisible on white, so the signal colours are darkened until they
   pass against a light surface, and the glows are removed rather than
   recoloured. */
:root[data-theme="light"] {
  /* GitHub's light canvas: white boxes on a faintly grey page, separated by a
     crisp hairline rather than by shadow. Reads as a tool, not a brochure. */
  --bg:       #f6f8fa;
  --surface:  #ffffff;
  --raised:   #eaeef2;
  --line:     #d1d9e0;
  --line-hi:  #afb8c1;

  --ink:      #1f2328;
  --ink-2:    #59636e;
  --ink-3:    #818b98;

  /* The dark palette's mint and magenta are unreadable on white, so these are
     their light-mode equivalents rather than the same hues dimmed. */
  --career:   #1a7f37;
  --going:    #bf3989;
  --gold:     #9a6700;
  --live:     #d1242f;

  --shadow: 0 8px 24px rgba(31,35,40,.10);
}
:root[data-theme="light"] body {
  background-image:
    linear-gradient(rgba(16,21,28,.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16,21,28,.028) 1px, transparent 1px);
}
:root[data-theme="light"] .brand-mark,
:root[data-theme="light"] .cta { box-shadow: none; }
:root[data-theme="light"] .brand-mark { color: #fff; }
:root[data-theme="light"] .cta { color: #fff; }
:root[data-theme="light"] .cta.alt { color: #fff; }
:root[data-theme="light"] .tabbar a.active::before { box-shadow: none; }
:root[data-theme="light"] .ev-date {
  background: rgba(255,255,255,.9); border-color: rgba(16,21,28,.12);
}
:root[data-theme="light"] .ev-date span { color: var(--ink-3); }
/* Generated covers stay dark in both themes: they carry white text and are
   built from a fixed gradient, so lightening them would break legibility. */
:root[data-theme="light"] .ev-cover-title { color: #fff; }
/* A 13% tint of the accent is legible on near-black and washes out on white.
   Light mode fills the chip instead. */
:root[data-theme="light"] .chip.active,
:root[data-theme="light"] .pill.active {
  background: var(--career); border-color: var(--career); color: #fff;
}
:root[data-theme="light"] .chip.active.alt {
  background: var(--going); border-color: var(--going); color: #fff;
}
:root[data-theme="light"] .ev-badge {
  background: #dafbe1; color: #1a7f37; border-color: #aceebb;
}
:root[data-theme="light"] .ev-badge.alt {
  background: #ffeff7; color: #bf3989; border-color: #ffd0e4;
}
:root[data-theme="light"] .ev-badge.free {
  background: #fff8c5; color: #7d4e00; border-color: #f7e3a1;
}
:root[data-theme="light"] .cat-link.active .n { color: var(--career); }
:root[data-theme="light"] .ev:hover { background: var(--raised); }
:root[data-theme="light"] #search:focus {
  box-shadow: 0 0 0 3px rgba(26,127,55,.14);
}

.theme-btn {
  background: var(--surface); border: 1px solid var(--line);
  width: 36px; height: 36px; border-radius: var(--r-sm);
  cursor: pointer; font-size: 14px; flex: 0 0 36px;
  display: grid; place-items: center; color: var(--ink-2);
  transition: color .13s, border-color .13s;
}
.theme-btn:hover { color: var(--career); border-color: var(--line-hi); }

.rail-foot {
  margin-top: auto; padding: 12px 10px 4px; border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: 10.5px; color: var(--ink-3);
  line-height: 1.7;
}
.rail-foot a { color: var(--ink-2); }
.rail-foot a:hover { color: var(--career); }
.rail-foot .rf-label { display: block; letter-spacing: .1em; opacity: .7; }
/* The acronym, stated once, quietly. */
.rail-foot .rf-expand {
  display: block; margin-bottom: 9px; color: var(--ink-2); letter-spacing: .02em;
}
.rail-foot .rf-expand b { color: var(--career); font-weight: 700; }
