/* Layout: one reading column. City finder up top, then the city's ten venues
   stacked as party tickets, each with its rank on a perforated stub. */
:root {
  --bg: #f5f3fa;
  --surface: #ffffff;
  --ink: #1f1a3d;
  --muted: #5f5a7d;
  --line: #e2ddf0;
  --soft: #eeeaf8;
  --berry: #c2255c;
  --berry-strong: #a11a4b;
  --on-berry: #ffffff;
  --sun: #ffc83d;
  --on-sun: #2a1e00;
  --danger: #b42318;
  --shadow: 0 1px 2px rgb(31 26 61 / 6%), 0 8px 24px -12px rgb(31 26 61 / 18%);

  --font-display: "Shrikhand", "Arial Rounded MT Bold", "Trebuchet MS", sans-serif;
  --font-body: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --step--1: 0.8125rem;
  --step-0: 1rem;
  --step-1: 1.1875rem;
  --step-2: 1.5rem;
  --step-3: clamp(1.9rem, 1.4rem + 2.2vw, 2.75rem);

  --stub: 84px;
  --radius: 14px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14121f;
    --surface: #1d1a2c;
    --ink: #f2effb;
    --muted: #aba5c6;
    --line: #332f48;
    --soft: #29253d;
    --berry: #ff6fa3;
    --berry-strong: #ff8db6;
    --on-berry: #2b0716;
    --danger: #ff8a80;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 10px 28px -14px rgb(0 0 0 / 60%);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #14121f;
  --surface: #1d1a2c;
  --ink: #f2effb;
  --muted: #aba5c6;
  --line: #332f48;
  --soft: #29253d;
  --berry: #ff6fa3;
  --berry-strong: #ff8db6;
  --on-berry: #2b0716;
  --danger: #ff8a80;
  --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 10px 28px -14px rgb(0 0 0 / 60%);
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.55;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

.wrap {
  width: 100%;
  max-width: 880px;
  margin-inline: auto;
}

a {
  color: var(--berry);
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--berry-strong);
}

:focus-visible {
  outline: 3px solid var(--berry);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Header ---------- */

.site-header {
  padding-block: 20px 4px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}

.brand:hover {
  color: var(--ink);
}

.brand svg {
  flex: none;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.35rem;
  line-height: 1;
  letter-spacing: 0.01em;
}

.brand-name span {
  color: var(--berry);
}

/* ---------- Finder ---------- */

.finder {
  padding-block: 28px 32px;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "intro" "panel" "message" "reel";
}

.finder-intro {
  grid-area: intro;
  display: grid;
  gap: 18px;
  align-content: start;
}

.finder-panel {
  grid-area: panel;
}

.message {
  grid-area: message;
}

/* Wide screens: the photo reel fills the space beside the heading. */
@media (min-width: 760px) {
  .finder {
    grid-template-columns: minmax(0, 1fr) clamp(260px, 36%, 320px);
    grid-template-areas: "intro reel" "panel panel" "message message";
    column-gap: 32px;
  }
}

.eyebrow {
  margin: 0;
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.finder h1 {
  margin: 0;
  max-width: 18ch;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--step-3);
  line-height: 1.12;
  text-wrap: balance;
}

.lede {
  margin: 0;
  max-width: 60ch;
  color: var(--muted);
  font-size: var(--step-1);
  line-height: 1.5;
}

.finder-panel {
  margin-top: 6px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: end;
  gap: 18px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.field label {
  font-weight: 700;
  font-size: 0.9375rem;
}

.field-row {
  display: flex;
  gap: 8px;
  min-width: 0;
}

input,
select,
button {
  font: inherit;
  color: inherit;
}

#zip-input,
#city-select {
  width: 100%;
  min-width: 0;
  height: 48px;
  padding: 0 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
}

#zip-input {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

#zip-input::placeholder {
  color: var(--muted);
  letter-spacing: 0;
}

#city-select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 40px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 21px, calc(100% - 15px) 21px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}

#zip-input:hover,
#city-select:hover {
  border-color: var(--muted);
}

#zip-input[aria-invalid="true"] {
  border-color: var(--danger);
}

.btn {
  flex: none;
  height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: 10px;
  background: var(--berry);
  color: var(--on-berry);
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.btn:hover {
  background: var(--berry-strong);
}

.btn[aria-busy="true"] {
  opacity: 0.75;
  cursor: progress;
}

.or {
  align-self: end;
  height: 48px;
  display: grid;
  place-items: center;
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.message {
  margin: 0;
  min-height: 1.55em;
  font-weight: 600;
  color: var(--danger);
}

.message:empty {
  min-height: 0;
}

/* ---------- Photo reel ---------- */

.reel {
  grid-area: reel;
  align-self: center;
  display: grid;
  gap: 10px;
  min-width: 0;
}

.reel-track {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: var(--soft);
}

.reel-track::-webkit-scrollbar {
  display: none;
}

.reel-tile {
  position: relative;
  flex: 0 0 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  aspect-ratio: 4 / 3;
}

.reel-tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reel-label {
  position: absolute;
  left: 12px;
  bottom: 12px;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgb(255 255 255 / 92%);
  color: #1f1a3d;
  font-size: var(--step--1);
  font-weight: 800;
  box-shadow: 0 2px 8px rgb(0 0 0 / 18%);
}

.reel-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.reel-toggle {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1.5px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.reel-toggle:hover {
  border-color: var(--muted);
}

.reel-toggle svg {
  fill: currentColor;
}

.reel-toggle .icon-play,
.reel.is-paused .reel-toggle .icon-pause {
  display: none;
}

.reel.is-paused .reel-toggle .icon-play {
  display: block;
}

.reel-dots {
  display: flex;
  gap: 2px;
}

/* Each dot is a 24px hit area around a small visible pip. */
.reel-dot {
  width: 20px;
  height: 24px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.reel-dot::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line);
  transition: background-color 200ms, transform 200ms;
}

.reel-dot:hover::before {
  background: var(--muted);
}

.reel-dot[aria-current="true"]::before {
  background: var(--berry);
  transform: scale(1.3);
}

/* ---------- Results ---------- */

.results {
  padding-block: 8px 48px;
  scroll-margin-top: 16px;
}

.results-head {
  display: grid;
  gap: 6px;
  padding-bottom: 22px;
  border-top: 1px solid var(--line);
  padding-top: 28px;
}

.context {
  margin: 0;
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
  max-width: 65ch;
  font-weight: 600;
  color: var(--ink);
}

.context::before {
  content: "";
  flex: none;
  width: 10px;
  height: 10px;
  margin-top: 0.45em;
  border-radius: 50%;
  background: var(--sun);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--sun) 30%, transparent);
}

.context:empty {
  display: none;
}

.results-title {
  margin: 0;
  font-size: var(--step-1);
  font-weight: 600;
  color: var(--muted);
  line-height: 1.3;
  text-wrap: balance;
}

.results-title strong {
  display: block;
  margin-top: 4px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--step-3);
  line-height: 1.1;
  color: var(--ink);
}

.city-facts {
  margin: 0;
  font-size: var(--step--1);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ---------- Ticket stack ---------- */

.stack {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 16px;
}

.ticket {
  position: relative;
  display: grid;
  grid-template-columns: var(--stub) minmax(0, 1fr);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  animation: ticket-in 360ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
  animation-delay: calc(var(--i, 0) * 40ms);
}

/* Perforation notches where the stub tears off. */
.ticket::before,
.ticket::after {
  content: "";
  position: absolute;
  left: calc(var(--stub) - 10px);
  width: 20px;
  height: 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  z-index: 1;
}

.ticket::before {
  top: -1px;
  border-top: 0;
  border-radius: 0 0 10px 10px;
}

.ticket::after {
  bottom: -1px;
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
}

.stub {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 22px;
  gap: 2px;
  background: var(--sun);
  color: var(--on-sun);
  border-radius: calc(var(--radius) - 1px) 0 0 calc(var(--radius) - 1px);
  border-right: 2px dashed color-mix(in srgb, var(--on-sun) 35%, transparent);
}

.stub-label {
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.stub-num {
  font-family: var(--font-display);
  font-size: 2.6rem;
  line-height: 1;
}

.ticket-body {
  min-width: 0;
  display: grid;
  gap: 12px;
  padding: 20px 22px 22px;
}

.ticket h3 {
  margin: 0;
  font-size: var(--step-2);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.meta {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  font-size: var(--step--1);
  color: var(--muted);
}

.chip {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--ink);
  font-weight: 700;
}

.where {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.where svg {
  flex: none;
}

.blurb {
  margin: 0;
  max-width: 65ch;
}

.contact {
  margin: 4px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 24px;
}

.contact div {
  min-width: 0;
}

.contact dt {
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.contact dd {
  margin: 2px 0 0;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

.contact .missing {
  color: var(--muted);
}

.contact a {
  font-weight: 600;
}

.map-link {
  white-space: nowrap;
}

/* Loading and error states */

.ticket.is-loading {
  min-height: 190px;
  animation: none;
}

.ticket.is-loading .stub {
  background: var(--soft);
  border-right-color: var(--line);
}

.ticket.is-loading .ticket-body {
  align-content: start;
}

.skeleton {
  height: 14px;
  border-radius: 7px;
  background: var(--soft);
}

.skeleton.title {
  height: 24px;
  width: 55%;
}

.skeleton.short {
  width: 35%;
}

.load-error {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

/* ---------- Footer ---------- */

.site-footer {
  padding-block: 28px 40px;
  border-top: 1px solid var(--line);
  font-size: var(--step--1);
  color: var(--muted);
  display: grid;
  gap: 8px;
}

.site-footer p {
  margin: 0;
  max-width: 70ch;
}

@keyframes ticket-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ticket {
    animation: none;
  }
  html {
    scroll-behavior: auto;
  }
}

/* ---------- Narrow screens ---------- */

@media (max-width: 680px) {
  .finder-panel {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    padding: 16px;
  }

  .or {
    height: auto;
    justify-items: start;
  }
}

@media (max-width: 560px) {
  :root {
    --stub: 58px;
  }

  .stub {
    padding-top: 18px;
  }

  .stub-num {
    font-size: 1.9rem;
  }

  .ticket-body {
    padding: 16px 16px 18px;
  }

  .ticket h3 {
    font-size: var(--step-1);
  }

  .contact {
    grid-template-columns: minmax(0, 1fr);
  }

  .btn {
    padding: 0 14px;
  }
}
