/*
  Backhand Exhibition landing page
  - Branding is placeholder-driven via CSS variables
  - Motion respects prefers-reduced-motion
*/

:root {
  /* Branding: text #252627; backgrounds c2efeb, ffc98a, ffdde2; optional 985f6f, eac435 */
  --fg: #252627;
  --bg: #f0f9f8;
  --accent: #985f6f;

  /* Background palette — change these; gradient uses them by name */
  --bg-mint: #c2efeb;
  --bg-peach: #ffc98a;
  --bg-blush: #ffdde2;
  --bg-mauve: #985f6f;
  --accent-gold: #eac435;
  --fg-rgb: 37, 38, 39;
  --accent-rgb: 152, 95, 111;
  /* RGB versions for gradients (keep in sync with --bg-mint, --bg-peach, --bg-blush if not using color-mix) */
  --mint-rgb: 194, 239, 235;
  --peach-rgb: 255, 201, 138;
  --blush-rgb: 255, 221, 226;

  /* Legacy names for config/theme.js (map to new palette) */
  --yellow: #eac435;
  --blue: #c2efeb;
  --purple: #ffdde2;

  /* Derived surfaces (from --fg #252627 = 37, 38, 39) */
  --surface: rgba(255, 255, 255, 0.82);
  --surface-strong: rgba(255, 255, 255, 0.96);
  --border: rgba(37, 38, 39, 0.14);
  --border-strong: rgba(37, 38, 39, 0.24);
  --muted: rgba(37, 38, 39, 0.7);

  /* Polaroid vars */
  --card-bg: var(--surface-strong);
  --shadow-light: rgba(37, 38, 39, 0.12);
  --shadow-heavy: rgba(37, 38, 39, 0.18);
  --marker-color: rgba(37, 38, 39, 0.82);
  --font-handwriting: "Segoe Print", "Segoe Script", "Bradley Hand", "Comic Sans MS", ui-rounded, system-ui, sans-serif;

  --font-display: "Barlow", ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  --font-body: "Barlow", ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  --font-h2: "Boldonse", var(--font-display);

  --wrap: 1100px;
  --gutter: 16px;
  --radius: 14px;

  --shadow: 0 14px 44px rgba(37, 38, 39, 0.14);

  --t-fast: 150ms;
  --t-med: 260ms;
  --t-slow: 400ms;

  --ease-slap: cubic-bezier(0.18, 0.9, 0.2, 1.25);
  --ease-settle: cubic-bezier(0.2, 0.9, 0.2, 1);

  /* Scroll-reactive background gradient variables (JS updates) — stronger visibility */
  --washA: 0.38;
  --yellowA: 0.58;
  --pinkA: 0.54;
  --blueA: 0.58;
  --purpleA: 0.54;

  --yellowX: 20%;
  --yellowY: 12%;
  --pinkX: 78%;
  --pinkY: 18%;
  --blueX: 72%;
  --blueY: 72%;
  --purpleX: 26%;
  --purpleY: 78%;

  --gradSat: 1.2;
  --gradCon: 1.08;

  /* Safe area for notched / rounded devices */
  --safe-top: env(safe-area-inset-top, 0);
  --safe-right: env(safe-area-inset-right, 0);
  --safe-bottom: env(safe-area-inset-bottom, 0);
  --safe-left: env(safe-area-inset-left, 0);
  --touch-min: 44px;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Still readable if a user forces dark UI */
    --shadow: 0 16px 44px rgba(0, 0, 0, 0.24);
  }
}

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

/* Mobile & touch: remove tap delay, subtle tap highlight */
@media (hover: none) {
  a,
  button {
    -webkit-tap-highlight-color: rgba(var(--accent-rgb), 0.2);
    tap-highlight-color: rgba(var(--accent-rgb), 0.2);
    touch-action: manipulation;
  }
}

html {
  scroll-behavior: smooth;
  /* Light base so dark mode (e.g. Chrome on Mac) doesn’t show a dark canvas */
  background: var(--bg);
}

body {
  margin: 0;
  background: transparent; /* gradient in body::before shows mint/peach/blush */
  color: var(--fg);
  font-family: var(--font-body);
  line-height: 1.35;
  text-rendering: optimizeLegibility;
  text-align: center;
  position: relative;
}

/* Soft multi-colour “paper” texture */
body::before {
  content: "";
  position: fixed;
  inset: -30% -10% -30% -10%;
  pointer-events: none;
  z-index: -1;
  background:
    /* overall wash — uses --bg-mint, --bg-peach, --bg-blush by name */
    linear-gradient(
      135deg,
      color-mix(in srgb, var(--bg-mint) calc(var(--washA) * 100%), transparent),
      color-mix(in srgb, var(--bg-blush) calc(var(--washA) * 100%), transparent) 52%,
      color-mix(in srgb, var(--bg-peach) calc(var(--washA) * 100%), transparent)
    ),
    /* stronger blobs */
    radial-gradient(
      closest-side at var(--yellowX) var(--yellowY),
      color-mix(in srgb, var(--bg-mint) calc(var(--yellowA) * 100%), transparent),
      transparent 64%
    ),
    radial-gradient(
      closest-side at var(--pinkX) var(--pinkY),
      color-mix(in srgb, var(--bg-peach) calc(var(--pinkA) * 100%), transparent),
      transparent 62%
    ),
    radial-gradient(
      closest-side at var(--blueX) var(--blueY),
      color-mix(in srgb, var(--bg-blush) calc(var(--blueA) * 100%), transparent),
      transparent 66%
    ),
    radial-gradient(
      closest-side at var(--purpleX) var(--purpleY),
      color-mix(in srgb, var(--bg-mint) calc(var(--purpleA) * 100%), transparent),
      transparent 64%
    );
  filter: saturate(var(--gradSat)) contrast(var(--gradCon));
}

img,
video {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
}

.wrap {
  width: min(var(--wrap), 100% - (var(--gutter) * 2) - var(--safe-left) - var(--safe-right));
  margin: 0 auto;
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
}

.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;
}

.skip-link {
  position: absolute;
  left: calc(8px + var(--safe-left));
  top: calc(8px + var(--safe-top));
  padding: 12px 16px;
  min-height: var(--touch-min);
  min-width: var(--touch-min);
  border-radius: 999px;
  background: var(--fg);
  color: var(--bg);
  transform: translateY(-140%);
  transition: transform var(--t-fast) var(--ease-settle);
  z-index: 9999;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.skip-link:focus {
  transform: translateY(0);
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
  padding-top: var(--safe-top);
}

.nav {
  width: min(var(--wrap), 100% - (var(--gutter) * 2));
  margin: 0 auto;
  padding: 10px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  position: relative;
}

.nav__brand {
  text-decoration: none;
  font-family: var(--font-h2);
  font-weight: 400;
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #252627;
}

.nav__brandIcon {
  width: 1.25rem;
  height: 1.25rem;
  display: block;
  object-fit: contain;
}

.nav__logo {
  height: clamp(36px, 8vw, 52px);
  width: auto;
  display: block;
}

.nav__instagram {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #252627;
  text-decoration: none;
  padding: 0.5rem;
  min-width: var(--touch-min);
  min-height: var(--touch-min);
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-strong);
  transition: background var(--t-fast), border-color var(--t-fast);
}

.nav__instagram:hover {
  background: var(--surface);
  border-color: var(--border-strong);
}

.nav__instagram svg {
  width: 1.35rem;
  height: 1.35rem;
  display: block;
}

.nav__toggle {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface-strong);
  color: var(--fg);
  border-radius: 999px;
  padding: 10px 14px;
  min-width: var(--touch-min);
  min-height: var(--touch-min);
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav__menu {
  width: 100%;
  display: none;
  padding: 10px 10px 12px;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.nav__menu.is-open {
  display: flex;
}

.nav__link {
  text-decoration: none;
  padding: 12px 16px;
  min-height: var(--touch-min);
  min-width: var(--touch-min);
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-strong);
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav__link.is-active,
.nav__link[aria-current="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.22);
}

@media (min-width: 840px) {
  .nav__toggle {
    display: none;
  }
  .nav__menu {
    display: flex;
    width: auto;
    justify-content: center;
    padding: 0;
    position: static;
    transform: none;
    border: 0;
    background: transparent;
    box-shadow: none;
  }
}

.section {
  padding: 48px 0;
}

@media (min-width: 600px) {
  .section {
    padding: 64px 0;
  }
}

@media (min-width: 840px) {
  .section {
    padding: 86px 0;
  }
}

#about.section {
  padding: 24px 0;
}

@media (min-width: 600px) {
  #about.section {
    padding: 32px 0;
  }
}

@media (min-width: 840px) {
  #about.section {
    padding: 44px 0;
  }
}

.hero {
  padding-top: 48px;
  padding-bottom: 32px;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  opacity: 0.92;
  margin: 0 0 12px;
}

.hero__logo {
  display: block;
  width: auto;
  height: clamp(80px, 18vw, 160px);
  margin: 0 auto 1rem;
}

.hero__theme-intro {
  margin: 0 0 0.05em;
  font-size: clamp(0.95rem, 2.5vw, 1.1rem);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.hero__title {
  font-family: var(--font-h2);
  font-weight: 400;
  letter-spacing: -0.03em;
  margin: 0;
  padding: 0.15em 0.1em;
  min-height: var(--touch-min);
  font-size: clamp(2.5rem, 14vw, 8.2rem);
  position: relative;
  display: inline-block;
  cursor: pointer;
}

/* Cap H1 on narrow viewports (e.g. DuckDuckGo in-app browser reports larger viewport) */
@media (max-width: 480px) {
  .hero__title {
    font-size: min(3.25rem, clamp(2rem, 12vw, 8.2rem));
  }
}

/* Cracking effect: shake + crack overlay on hover / when .hero__title--crack is set (e.g. on click) */
.hero__title::after {
  content: "";
  position: absolute;
  inset: -8%;
  left: -5%;
  right: -5%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 120'%3E%3Cpath d='M60 5 L58 25 L65 40 L52 58 L62 75 L55 95 L60 115' stroke='rgba(43,16,64,0.5)' stroke-width='1.2' fill='none' stroke-linecap='round'/%3E%3Cpath d='M60 42 L35 55 L70 68 L45 88 L65 100' stroke='rgba(43,16,64,0.35)' stroke-width='0.9' fill='none' stroke-linecap='round'/%3E%3Cpath d='M60 75 L80 85 L55 98' stroke='rgba(43,16,64,0.25)' stroke-width='0.7' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease-out;
}

.hero__title:hover::after,
.hero__title.hero__title--crack::after {
  opacity: 1;
}

.hero__title:hover,
.hero__title.hero__title--crack {
  animation: heroCrackShake 0.5s ease-out;
}

@keyframes heroCrackShake {
  0%, 100% { transform: translateX(0); }
  15% { transform: translateX(-4px); }
  30% { transform: translateX(4px); }
  45% { transform: translateX(-3px); }
  60% { transform: translateX(3px); }
  75% { transform: translateX(-1px); }
}

@media (prefers-reduced-motion: reduce) {
  .hero__title:hover,
  .hero__title.hero__title--crack {
    animation: none;
  }
  .hero__title::after {
    transition: none;
  }
}

.hero__meta {
  margin: 12px 0 2px;
  font-size: clamp(1.75rem, 4.5vw, 2.4rem);
  line-height: 1.25;
  opacity: 0.92;
}

.hero__date {
  margin: 0;
  font-size: clamp(1.75rem, 4.5vw, 2.4rem);
  line-height: 1.25;
}

.hero__status {
  margin: 18px 0 14px;
}

.hero__now {
  margin: 0;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: rgba(var(--accent-rgb), 0.12);
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  display: inline-block;
}

.hero__hint {
  margin: 18px 0 0;
  opacity: 0.75;
}

.countdown {
  display: inline-flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  justify-content: center;
}

.countdown__unit {
  min-width: 86px;
}

.countdown__num {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.6rem;
  letter-spacing: -0.02em;
}

.countdown__label {
  opacity: 0.75;
  font-size: 0.9rem;
}

.h2 {
  font-family: var(--font-h2);
  font-weight: 400;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
  font-size: clamp(1.6rem, 4.5vw, 2.3rem);
}

.h3 {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 10px;
  font-size: 1.25rem;
}

.prose {
  max-width: 68ch;
  margin: 0 auto;
}

/* About, video caption, gallery caption, raffle body, artist market, collaborators intro: full width, larger and bolder */
.prose--about,
.prose--about p,
.prose--video,
.prose--caption,
.raffle.prose p,
.artist-market.prose p,
.credits__intro {
  max-width: none;
  width: 100%;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.5;
}

.prose--about,
.prose--video,
.prose--caption,
.raffle.prose,
.artist-market.prose {
  max-width: none;
  width: 100%;
}

.prose p {
  margin: 0 0 14px;
  opacity: 0.92;
}

.prose--about p:last-child,
.prose--video,
.prose--caption {
  margin-bottom: 0;
}

/* Space between video and caption */
.prose--video {
  margin-top: 1.5rem;
  padding-top: 0;
}

.note {
  opacity: 0.72;
  font-size: 0.95rem;
  margin: 14px 0 0;
}

.prose--caption {
  margin-top: 1.5rem;
}

.footer-before-intro {
  margin: 0 auto 1rem;
  max-width: 36em;
  line-height: 1.5;
  opacity: 0.92;
}

.video {
  margin-top: 10px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.video__poster {
  position: relative;
  border: 0;
  padding: 0;
  width: 100%;
  min-height: var(--touch-min);
  background: transparent;
  cursor: pointer;
}

.video__posterImg {
  width: 100%;
  height: auto;
}

.video__posterLabel {
  position: absolute;
  inset: auto 12px 12px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
  padding: 12px 16px;
  min-height: var(--touch-min);
  border-radius: 12px;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

.video__play {
  width: var(--touch-min);
  height: var(--touch-min);
  min-width: var(--touch-min);
  min-height: var(--touch-min);
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--accent);
  color: var(--bg);
  font-weight: 900;
}

.video__text {
  font-weight: 700;
}

.video__frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  display: block;
}

.gallery__img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  background: rgba(var(--fg-rgb), 0.03);
  border-radius: 8px;
  box-shadow: 0 2px 0 rgba(var(--fg-rgb), 0.06);
}

/* --- Polaroid-Design (adapted from your example) --- */
#gallery .gallery-container {
  /* Break out of .wrap so the strip is full viewport width */
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding-left: max(1rem, var(--safe-left));
  padding-right: max(1rem, var(--safe-right));
  box-sizing: border-box;
}

.gallery-container {
  margin-top: 12px;
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 0;
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;

  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -ms-overflow-style: none;
  cursor: grab;
  user-select: none;
  /* No touch-action: pan-x — allow vertical scroll to reach the page */
}
.gallery-container::-webkit-scrollbar {
  display: none;
}
.gallery-container.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
}

.polaroid {
  --rot: -2deg;

  background-color: var(--card-bg);
  padding: 1rem 1rem 4.5rem 1rem;
  border-radius: 2px;
  box-shadow: 0 0.25rem 0.5rem var(--shadow-light), 0 0.625rem 1.25rem var(--shadow-light);
  position: relative;
  width: clamp(288px, 62.4vw, 408px);
  transition: transform 0.3s ease-in-out;
  transform: rotate(var(--rot));
  transform-origin: 50% 30%;
  flex: 0 0 auto;
  scroll-snap-align: start;

  /* “realistische” Papier-Textur */
  background-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><filter id="n" x="0" y="0"><feTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="6" stitchTiles="stitch"/></filter><rect width="100" height="100" filter="url(%23n)" opacity="0.12"/></svg>');
  background-size: cover;

  /* Overlap pile */
  margin: 0.625rem 0 0 -2.1rem;
  cursor: pointer;
}

.polaroid:hover {
  transform: scale(1.05) rotate(0deg) !important;
  z-index: 10;
  box-shadow: 0 0.5rem 1rem var(--shadow-heavy), 0 1rem 2rem var(--shadow-heavy);
}

.polaroid:focus-visible {
  transform: scale(1.05) rotate(0deg) !important;
  z-index: 10;
  box-shadow: 0 0.5rem 1rem var(--shadow-heavy), 0 1rem 2rem var(--shadow-heavy);
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.polaroid:active {
  transform: translateY(2px) scale(1.02) rotate(0deg) !important;
}

/* --- Bild-Stil (portrait, no distortion) --- */
.polaroid img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  min-height: 384px;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

/* --- Beschriftung --- */
.polaroid__caption {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  right: 1rem;
  text-align: center;
  font-family: var(--font-handwriting);
  font-size: 1.1rem;
  color: var(--marker-color);
  line-height: 1;
}

@media (max-width: 420px) {
  .polaroid {
    width: clamp(264px, 84vw, 384px);
    margin: 0.5rem 0 0 -1.4rem;
  }
}

.artists-list {
  margin-top: 1.75rem;
  opacity: 1;
}

/* Keep artists list always visible (no scroll-reveal) */
#artists .artists-list,
#artists .artists-list__ul,
#artists .artists-list__ul li,
#artists .artists-list__ul a {
  opacity: 1 !important;
}

.artists-list__ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px 16px;
}

@media (min-width: 768px) {
  .artists-list__ul {
    grid-template-columns: repeat(5, 1fr);
    gap: 8px 24px;
  }
}

.artists-list__ul li {
  margin: 0;
}

.artists-list__ul a {
  color: var(--fg);
  font-size: 1.25rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-transform: uppercase;
}

.artists-list__ul a:hover {
  color: var(--accent, #985f6f);
  text-decoration-thickness: 2px;
}

.programme {
  margin-top: 10px;
  display: grid;
  gap: 14px;
}

.day {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 16px;
}

.day__head {
  display: flex;
  gap: 10px;
  align-items: baseline;
  justify-content: center;
  flex-wrap: wrap;
}

.day__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: -0.02em;
}

.day__date {
  opacity: 0.75;
  font-size: 0.95rem;
}

.day__items {
  margin: 12px 0 0;
  padding: 0;
  list-style-position: inside;
}

.day__items li {
  margin: 8px 0;
  opacity: 0.92;
}

.day__items a {
  color: var(--accent, #985f6f);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.day__items a:hover {
  text-decoration-thickness: 2px;
}

/* Raffle: text above image, same caption styling */
.raffle.prose {
  margin-bottom: 1rem;
}

/* Raffle: widescreen image placeholder (16:9) */
.raffle__image-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  margin: 0;
}

.raffle__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.raffle {
  margin-top: 10px;
}

.raffle.prose p {
  margin: 0;
  opacity: 0.92;
}

/* Artist Market: same layout and styling as Raffle */
.artist-market.prose {
  margin-bottom: 1rem;
}

.artist-market.prose p {
  margin: 0;
  opacity: 0.92;
}

.artist-market__image-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  margin: 0;
}

.artist-market__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.location__grid {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

@media (min-width: 860px) {
  .location__grid {
    flex-direction: row;
    align-items: stretch;
    gap: 2rem;
  }
  .location__content {
    flex: 0 1 42%;
    min-width: 0;
    justify-content: center;
  }
  .location__map-wrap {
    flex: 1 1 52%;
    min-width: 0;
    min-height: 320px;
    height: 320px;
  }
}

.location__content {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  text-align: left;
}

.location__text {
  margin: 0;
  opacity: 0.92;
  line-height: 1.5;
  font-size: 1rem;
}

/* Mobile: make section intro paragraphs (subheading Ps) match .location__content text size */
@media (max-width: 600px) {
  .prose--about p,
  .prose--about,
  .prose--video,
  .prose--caption,
  .raffle.prose p,
  .artist-market.prose p,
  .credits__intro {
    font-size: 1rem;
  }
}

.location__address {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  opacity: 0.92;
  line-height: 1.5;
}

.location__map {
  display: block;
  width: 100%;
  height: 280px;
  min-height: 280px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
}

@media (min-width: 860px) {
  .location__map {
    height: 320px;
    min-height: 320px;
  }
}

/* Credits: logo row across width, scales with device */
.credits-mount {
  margin-top: 1rem;
}

.credits__intro {
  margin: 0 0 1.25rem;
  opacity: 0.92;
}

.credits__logos {
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
  align-items: center;
  gap: clamp(0.5rem, 3vw, 2rem);
  width: 100%;
  max-width: 100%;
}

.credits__logo {
  flex: 1 1 0;
  min-width: 0;
  min-height: 48px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.credits__logo-link {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-width: 0;
  text-decoration: none;
  color: inherit;
  transition: opacity var(--t-fast) ease;
}

.credits__logo-link:hover {
  opacity: 0.85;
}

.credits__logo img {
  width: 100%;
  max-width: 120px;
  height: auto;
  min-height: 36px;
  aspect-ratio: auto;
  object-fit: contain;
  display: block;
  filter: contrast(0.9);
}

@media (max-width: 520px) {
  .credits__logos {
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
  }
  .credits__logo {
    flex: 0 1 auto;
    min-width: 80px;
  }
  .credits__logo img {
    max-width: 100px;
  }
}

/* Center lists by default (site-wide request) */
ul,
ol {
  padding-left: 0;
  list-style-position: inside;
}

.social-intro {
  margin: 0 auto 1.25rem;
  max-width: 36em;
  line-height: 1.5;
  opacity: 0.92;
}

.social {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  align-items: center;
}

.social a {
  text-decoration: none;
  color: var(--fg);
  padding: 0.75rem;
  min-width: var(--touch-min);
  min-height: var(--touch-min);
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s;
}

.social a:hover {
  background: var(--surface);
  border-color: var(--border-strong);
}

.social a svg {
  width: clamp(28px, 6vw, 36px);
  height: clamp(28px, 6vw, 36px);
  display: block;
}

.site-footer {
  padding: 46px 0 calc(60px + var(--safe-bottom));
  border-top: 1px solid var(--border);
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);
  box-sizing: border-box;
}

.lightbox[hidden] {
  display: none;
}

.lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.76);
}

.lightbox__panel {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 16px;
  touch-action: pan-y pinch-zoom;
}

/* Lightbox: polaroid-style card, roughly full viewport height */
.lightbox__figure {
  margin: 0 auto;
  max-height: 92vh;
  max-width: min(90vw, 80vh);
  width: max-content;
  display: flex;
  flex-direction: column;
  border-radius: 2px;
  overflow: hidden;
  background-color: var(--card-bg);
  padding: 1rem 1rem 1.25rem;
  box-shadow: 0 0.25rem 0.5rem var(--shadow-light), 0 0.625rem 1.25rem var(--shadow-light);
  background-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><filter id="n" x="0" y="0"><feTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="6" stitchTiles="stitch"/></filter><rect width="100" height="100" filter="url(%23n)" opacity="0.12"/></svg>');
  background-size: cover;
}

.lightbox__img {
  width: auto;
  height: min(calc(92vh - 5rem), 78vh);
  max-height: 78vh;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  display: block;
  background: var(--surface);
}

.lightbox__caption {
  padding: 0.75rem 0.5rem 0;
  font-family: var(--font-handwriting);
  font-size: 1.1rem;
  color: var(--marker-color);
  text-align: center;
  line-height: 1.2;
}

.lightbox__close {
  position: absolute;
  top: max(12px, var(--safe-top));
  right: max(12px, var(--safe-right));
  width: var(--touch-min);
  height: var(--touch-min);
  min-width: var(--touch-min);
  min-height: var(--touch-min);
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-strong);
  color: var(--fg);
  font-size: 28px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.lightbox__nav {
  width: var(--touch-min);
  height: var(--touch-min);
  min-width: var(--touch-min);
  min-height: var(--touch-min);
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-strong);
  color: var(--fg);
  font-size: 34px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.lightbox__nav--prev {
  justify-self: start;
}

.lightbox__nav--next {
  justify-self: end;
}

/* Lightbox: mobile layout — stacked so figure and nav have room on small screens */
@media (max-width: 520px) {
  .lightbox__panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: max(12px, var(--safe-top)) 12px max(12px, var(--safe-bottom));
    gap: 12px;
  }
  .lightbox__close {
    top: max(12px, var(--safe-top));
    right: max(12px, var(--safe-right));
  }
  .lightbox__figure {
    flex: 1 1 auto;
    min-height: 0;
    max-width: calc(100vw - var(--safe-left) - var(--safe-right) - 24px);
    max-height: min(70vh, 75svh);
  }
  .lightbox__img {
    max-height: min(calc(70vh - 4rem), calc(75svh - 4rem));
  }
  .lightbox__nav--prev {
    order: 2;
    margin-right: auto;
  }
  .lightbox__nav--next {
    order: 3;
    margin-left: auto;
  }
  .lightbox__figure {
    order: 1;
  }
}

/* Focus */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Slap / reveal motion */
.js-reveal {
  /* Default: visible even if JS fails */
  opacity: 1;
  transform: none;
}

.js .js-reveal {
  opacity: 0;
  transform: translate3d(0, 12px, 0);
  transition:
    transform var(--t-med) var(--ease-settle),
    opacity var(--t-med) linear;
  will-change: transform, opacity;
}

.js .js-reveal--slap {
  transform: translate3d(-10px, 14px, 0) rotate(-1.4deg) scale(0.985);
  transition:
    transform var(--t-med) var(--ease-slap),
    opacity var(--t-fast) linear;
}

.js .js-reveal--impact {
  transform: translate3d(0, 10px, 0) scale(0.98);
  transition:
    transform var(--t-fast) var(--ease-slap),
    opacity var(--t-fast) linear;
}

.js .js-reveal.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) rotate(0deg) scale(1);
}

/* When GSAP is present, don’t double-animate via CSS transitions */
.has-gsap.js .js-reveal {
  transition: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .js-reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* Desktop-only custom cursor — hand everywhere */
@media (pointer: fine) {
  *,
  *::before,
  *::after {
    cursor: url("../cursor/hand.svg") 12 12, auto;
  }
  .gallery-container {
    cursor: url("../cursor/hand.svg") 12 12, grab;
  }
  .gallery-container.is-dragging {
    cursor: url("../cursor/hand.svg") 12 12, grabbing;
  }
}
