/* ── Reset & Font ── */
@font-face {
  font-family: 'Cherri';
  src: url('../fonts/Cherrihandwriting-Regular.ttf') format('truetype');
}

:root {
  --wall-base: #efe8df;
}

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

html {
  scroll-behavior: smooth;
  font-size: 156%;
}

body {
  font-family: 'Cherri', 'Helvetica Neue', Arial, sans-serif;
  background: #f5f0eb;
  color: #1a1a1a;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.25s ease;
}

a:hover {
  opacity: 0.6;
}

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ── Loading Overlay ── */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: var(--wall-base);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

.loading-overlay.fade-out {
  opacity: 0;
  visibility: hidden;
}

.loading-content {
  text-align: center;
  animation: overlayPulse 1.8s ease-in-out infinite;
}

.loading-title {
  font-family: 'Cherri', cursive;
  font-size: clamp(3.5rem, 10vw, 6rem);
  /* Height and mark width match what the old "CHERRI" text measured, so the layout is unchanged */
  height: 1.6em;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #1a1a1a;
  margin-bottom: 8px;
  letter-spacing: 0.02em;
  animation: overlayFadeIn 1s ease-out;
}

.loading-title .logo-mark {
  width: 2.445em;
}

.loading-cherry {
  animation: overlayFadeIn 1.2s ease-out;
}

.loading-cherry svg {
  animation: cherryBounce 1.4s ease-in-out infinite;
}

@keyframes overlayFadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes overlayPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

@keyframes cherryBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* ── Navigation ── */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: 24px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(26, 26, 26, 0.12);
  transition: transform 0.35s ease, background 0.35s ease;
}

.site-nav.scrolled {
  background: rgba(239, 232, 223, 0.95);
  backdrop-filter: blur(10px);
}

.site-nav.hidden {
  transform: translateY(-100%);
}

.nav-logo {
  display: flex;
  align-items: center;
  color: #1a1a1a;
}

/* Source PNG carries wide transparent margins; these values crop the box to the artwork. */
.logo-mark {
  display: block;
  aspect-ratio: 2.794 / 1;
  background-image: url('../img/cherri_logo.png');
  background-repeat: no-repeat;
  background-size: 127.3% auto;
  background-position: 70% 43.2%;
}

.nav-logo .logo-mark {
  height: 1.55rem;
}

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
  align-items: center;
}

.nav-links a {
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #1a1a1a;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: #1a1a1a;
  transition: width 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-links a:hover {
  opacity: 1;
}

/* Hamburger */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  z-index: 1001;
  background: none;
  border: none;
  padding: 4px;
}

.nav-hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: #1a1a1a;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-hamburger.open span:nth-child(2) {
  opacity: 0;
}
.nav-hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile nav overlay */
.mobile-nav {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--wall-base);
  z-index: 999;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 28px;
}

.mobile-nav.open {
  display: flex;
}

.mobile-nav a {
  font-size: 1.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #1a1a1a;
}

/* ── Logo Wall (Home) ── */
.logo-wall {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
  padding: 190px 24px 240px;
  text-align: center;
}

.logo-wall-title {
  width: min(66%, 640px);
  margin: 0 auto;
}

.logo-wall-title .logo-mark {
  width: 100%;
}

/* Left sits high enough for the logo to lap over it; right drops into the section gap */
.wall-photo {
  --flank-w: clamp(175px, 18vw, 265px);
  position: absolute;
  z-index: -1;
  width: var(--flank-w);
}

.wall-photo--left { left: 24px; top: 104px; }
.wall-photo--right { right: 24px; }

/* ── Flanking Photo Wall (Home) ── */
.flanked {
  position: relative;
  overflow-x: clip;
}

/* Mobile pattern: one centred photo in the flow at the end of every section,
   matching the logo wall. The right-hand photo of each pair is desktop only. */
.flank {
  order: 1;
  align-self: center;
  width: 54vw;
  max-width: 230px;
  margin: 40px auto 0;
}

.flank--right {
  display: none;
}

/* Closing photo after the last section; desktop only, so mobile keeps one photo per section */
.photo-tail {
  display: none;
}

/* .section is block-level, so it needs to be flex for the photo's order to apply */
@media (max-width: 999px) {
  .section.flanked {
    display: flex;
    flex-direction: column;
  }

  /* Logo wall follows the same one-centred-photo pattern */
  .logo-wall {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 150px 24px 70px;
  }

  .logo-wall-title {
    order: -1;
    width: 100%;
    max-width: 360px;
    margin: 0 auto;
  }

  .wall-photo {
    position: static;
    width: 54vw;
    max-width: 230px;
    margin: 40px auto 0;
  }

  .wall-photo--right {
    display: none;
  }

  /* Only the first photo of a section shows on mobile */
  .flank--left ~ .flank--left {
    display: none;
  }
}

@media (min-width: 1000px) {
  /* Desktop pattern: every section carries the same pair, at the same offsets */
  .flank--left { --flank-y: 22%; }

  .photo-tail {
    display: block;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px 130px;
  }

  /* Paired with :hover so the later .polaroid--pin:hover rule can't reset it to width:100% */
  .photo-tail .polaroid--pin,
  .photo-tail .polaroid--pin:hover {
    width: clamp(175px, 18vw, 265px);
    max-width: none;
  }

  .flank,
  .flank--right {
    --flank-w: clamp(175px, 18vw, 265px);
    display: block;
    position: absolute;
    z-index: -1;
    top: var(--flank-y);
    width: var(--flank-w);
    max-width: none;
    margin: 0;
  }

  /* Card height is its width plus the frame, so half of that centres it on the
     section's bottom edge and drops it into the gap between sections. */
  .flank--right,
  .wall-photo--right {
    top: auto;
    bottom: calc((var(--flank-w) + 22px) / -2);
  }

  /* Both anchors resolve to the same x: sections are already the 1100px band,
     the full-bleed hero has to derive it, and 24px keeps photos off the window edge. */
  .section.flanked .flank--left { left: 24px; }
  .section.flanked .flank--right { right: 24px; }
  .hero.flanked .flank--left { left: max(24px, calc(50% - 526px)); }
  .hero.flanked .flank--right { right: max(24px, calc(50% - 526px)); }

  /* Wide enough that content only laps a photo where the content itself is full-width */
  .hero.flanked,
  .section.flanked {
    padding-left: clamp(150px, 15vw, 230px);
    padding-right: clamp(150px, 15vw, 230px);
  }
}

/* ── Hero (Landing Page) ── */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 120px 40px 80px;
  position: relative;
}

.hero-title {
  font-family: 'Cherri', cursive;
  font-size: clamp(3rem, 8vw, 7rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
}

.hero-artwork {
  max-width: 420px;
  width: 80%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  margin: 32px auto;
  border-radius: 4px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.1);
}

.hero-subtitle {
  font-size: 1.1rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #666;
  margin-bottom: 24px;
}

.hero-cta {
  display: inline-block;
  padding: 14px 48px;
  border: 2px solid #1a1a1a;
  font-size: 0.9rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: background 0.3s ease, color 0.3s ease;
}

.hero-cta:hover {
  background: #1a1a1a;
  color: #f5f0eb;
  opacity: 1;
}

/* ── Upcoming Show Polaroid ── */
.hero-show {
  display: none;
}

.hero-show.is-active {
  display: flex;
  animation: overlayFadeIn 0.9s ease-out;
}

.polaroid {
  display: block;
  position: relative;
  max-width: 420px;
  width: 80%;
  margin: 32px auto;
  padding: 16px 16px 0;
  background: linear-gradient(#fffdf7, #f7f2e9);
  border-radius: 3px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.18), 0 2px 4px rgba(0,0,0,0.08);
  transform: rotate(-2.5deg);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

/* Strip of masking tape holding the polaroid to the page */
.polaroid::before {
  content: '';
  position: absolute;
  z-index: 3;
  top: -14px;
  left: var(--tape-x, 50%);
  width: 110px;
  height: 30px;
  transform: translateX(-50%) rotate(var(--tape-tilt, -3.5deg));
  background:
    linear-gradient(115deg, rgba(255,255,255,0.5), rgba(255,255,255,0) 45%),
    rgba(214, 199, 165, 0.78);
  box-shadow: 0 2px 6px rgba(0,0,0,0.16);
  clip-path: polygon(4% 0, 0 30%, 3% 62%, 0 100%, 100% 100%, 97% 66%, 100% 34%, 96% 0);
}

.polaroid:hover {
  transform: rotate(0deg) translateY(-8px);
  box-shadow: 0 28px 70px rgba(0,0,0,0.24), 0 2px 4px rgba(0,0,0,0.08);
  opacity: 1;
}

/* Decorative wall photo: fills its slot and holds its tilt (no hover response) */
.polaroid--pin,
.polaroid--pin:hover {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 12px 12px 34px;
  transform: rotate(var(--tilt, -3deg));
  box-shadow: 0 12px 30px rgba(0,0,0,0.17), 0 1px 3px rgba(0,0,0,0.08);
}

.polaroid--pin::before {
  top: -11px;
  width: 74px;
  height: 23px;
}

.polaroid-photo {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #ddd7d0;
  overflow: hidden;
}

.polaroid-photo::after {
  content: '';
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 24px rgba(0,0,0,0.18);
  pointer-events: none;
}

.polaroid-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.polaroid-caption {
  font-family: 'Permanent Marker', 'Cherri', cursive;
  color: #23303d;
  text-align: center;
  line-height: 1.35;
  padding: 20px 10px 26px;
  transform: rotate(-1.2deg);
}

.polaroid-date {
  display: block;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
}

.polaroid-venue {
  display: block;
  font-size: 0.9rem;
}

.polaroid-location {
  display: block;
  font-size: 0.75rem;
  opacity: 0.7;
}

/* ── Sections ── */
.section {
  padding: 100px 40px;
  max-width: 1100px;
  margin: 0 auto;
}

.section-full {
  padding: 100px 40px;
  width: 100%;
}

.section-title {
  font-family: 'Cherri', cursive;
  font-size: clamp(2rem, 4vw, 3.2rem);
  margin-bottom: 48px;
  text-align: center;
  letter-spacing: 0.02em;
}

/* ── Latest Video Section (Home) ── */
.video-embed {
  position: relative;
  width: 100%;
  max-width: 800px;
  margin: 0 auto 24px;
  aspect-ratio: 16 / 9;
  background: #e0dbd5;
  border-radius: 4px;
  overflow: hidden;
}

.video-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ── Spotify Embed (Home) ── */
.spotify-section {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.spotify-section iframe {
  border-radius: 12px;
  width: 100%;
}

/* ── Listen Page — Platform Links ── */
.platform-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
  margin-top: 32px;
}

.platform-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 120px;
  height: 120px;
  border: 2px solid #1a1a1a;
  border-radius: 8px;
  transition: background 0.3s ease, color 0.3s ease, transform 0.2s ease;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  gap: 8px;
}

.platform-link i {
  font-size: 2rem;
}

.platform-link:hover {
  background: #1a1a1a;
  color: #f5f0eb;
  opacity: 1;
  transform: translateY(-4px);
}

/* ── Watch Now Page — Video Grid ── */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 32px;
  margin-top: 32px;
}

.video-card {
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  border-radius: 4px;
  overflow: hidden;
}

.video-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.08);
}

.video-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.video-card-title {
  padding: 12px 0;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
}

/* Featured video player */
.featured-video {
  max-width: 900px;
  margin: 0 auto 48px;
  aspect-ratio: 16 / 9;
  border-radius: 4px;
  overflow: hidden;
}

.featured-video iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* ── Shows Page ── */
.shows-list {
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.show-item {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 24px 0;
  border-bottom: 1px solid #ddd;
}

.show-date {
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #666;
}

.show-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.show-venue {
  font-size: 1rem;
  font-weight: 600;
}

.show-location {
  font-size: 0.85rem;
  color: #888;
}

.show-tickets {
  display: inline-block;
  padding: 8px 24px;
  border: 1.5px solid #1a1a1a;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: background 0.3s ease, color 0.3s ease;
  white-space: nowrap;
}

.show-tickets:hover {
  background: #1a1a1a;
  color: #f5f0eb;
  opacity: 1;
}

.no-shows {
  /* Injected into .shows-grid, so it has to span the tracks to centre on the page */
  grid-column: 1 / -1;
  text-align: center;
  color: #554b43;
  font-size: 1.1rem;
  padding: 60px 0;
  letter-spacing: 0.06em;
}

/* ── Wall Spackle Texture ── */
/* Photo isn't seamless, so it covers the viewport once rather than tiling.
   The cream wash tints the cool grey concrete back to the original wall tone. */
body.wall-texture {
  background-color: var(--wall-base);
  background-image:
    linear-gradient(rgba(253, 240, 224, 0.55), rgba(253, 240, 224, 0.55)),
    url('../img/wall-texture.jpg');
  background-size: auto, cover;
  background-position: center, center;
  background-repeat: repeat, no-repeat;
  background-attachment: fixed, fixed;
}

/* ── Shows Grid ── */
.shows-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 48px 32px;
  max-width: 900px;
  margin: 0 auto;
}

/* Sticky note variant */
.sticky-note {
  --curl: 30px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 3px;
  aspect-ratio: 1 / 1;
  /* Bottom padding clears the peeled corner so long venue names never run under it */
  padding: 20px 16px calc(var(--curl) + 6px);
  background: var(--note-color, #ffe14d);
  color: #23303d;
  font-family: 'Permanent Marker', 'Cherri', cursive;
  text-align: center;
  line-height: 1.25;
  transform: rotate(var(--tilt, -2deg));
  box-shadow: 0 10px 22px rgba(0,0,0,0.16);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Shading that sells the lifted corner */
.sticky-note::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(closest-side at 100% 100%, rgba(0,0,0,0.22), rgba(0,0,0,0)) 100% 100% / 74px 74px no-repeat,
    linear-gradient(to top, rgba(0,0,0,0.06), rgba(0,0,0,0) 28%);
  pointer-events: none;
}

/* Underside of the paper peeling up at the bottom-right corner */
.sticky-note::after {
  content: '';
  position: absolute;
  z-index: 1;
  right: 0;
  bottom: 0;
  width: var(--curl);
  height: var(--curl);
  clip-path: polygon(100% 0, 100% 100%, 0 100%);
  background: linear-gradient(to top left,
    color-mix(in srgb, var(--note-color, #ffe14d) 12%, #ffffff) 0%,
    color-mix(in srgb, var(--note-color, #ffe14d) 48%, #ffffff) 48%,
    color-mix(in srgb, var(--note-color, #ffe14d) 80%, #000000) 100%);
  filter: drop-shadow(-2px -2px 3px rgba(0,0,0,0.28));
  pointer-events: none;
}

.sticky-note:hover {
  transform: rotate(0deg) translateY(-6px);
  box-shadow: 0 18px 34px rgba(0,0,0,0.22);
  opacity: 1;
}

.sticky-date {
  font-size: 0.95rem;
}

.sticky-venue {
  font-size: 0.72rem;
}

.sticky-location {
  font-size: 0.62rem;
  opacity: 0.7;
}

.sticky-cta {
  margin-top: 8px;
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  border-bottom: 1.5px solid currentColor;
}

/* Hero-scale sticky note, sized to match the polaroid it is an alternative to */
.sticky-note--lg {
  --curl: 52px;
  max-width: 420px;
  width: 80%;
  margin: 32px auto;
  padding: 34px 30px calc(var(--curl) + 12px);
  gap: 8px;
  box-shadow: 0 18px 44px rgba(0,0,0,0.18);
}

.sticky-note--lg::before {
  background:
    radial-gradient(closest-side at 100% 100%, rgba(0,0,0,0.24), rgba(0,0,0,0)) 100% 100% / 140px 140px no-repeat,
    linear-gradient(to top, rgba(0,0,0,0.06), rgba(0,0,0,0) 28%);
}

.sticky-note--lg .sticky-date { font-size: 1.75rem; }
.sticky-note--lg .sticky-venue { font-size: 1.05rem; }
.sticky-note--lg .sticky-location { font-size: 0.8rem; }

/* ── Footer ── */
.site-footer {
  padding: 60px 40px;
  text-align: center;
  border-top: 1px solid rgba(74, 63, 54, 0.28);
}

.footer-social {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 20px;
}

.footer-social a {
  font-size: 1.3rem;
  color: #1a1a1a;
}

.footer-text {
  font-size: 0.8rem;
  color: #554b43;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.footer-email {
  margin-top: 8px;
}

.footer-email a {
  font-size: 0.85rem;
  color: #4e453d;
  text-decoration: underline;
}

/* ── Loading Spinner ── */
.loader {
  display: flex;
  justify-content: center;
  padding: 60px 0;
}

.loader-dot {
  width: 8px;
  height: 8px;
  background: #aaa;
  border-radius: 50%;
  margin: 0 4px;
  animation: pulse 1.2s ease-in-out infinite;
}

.loader-dot:nth-child(2) { animation-delay: 0.2s; }
.loader-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes pulse {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .site-nav {
    padding: 18px 24px;
  }

  .nav-links {
    display: none;
  }

  .nav-hamburger {
    display: flex;
  }

  .hero {
    padding: 100px 24px 60px;
  }

  .hero-artwork {
    max-width: 300px;
    width: 85%;
  }

  .hero .sticky-note--lg {
    max-width: 300px;
    width: 85%;
    --curl: 40px;
    padding: 26px 20px calc(var(--curl) + 8px);
  }

  .sticky-note--lg .sticky-date { font-size: 1.3rem; }
  .sticky-note--lg .sticky-venue { font-size: 0.85rem; }
  .sticky-note--lg .sticky-location { font-size: 0.7rem; }

  .section,
  .section-full {
    padding: 60px 24px;
  }

  .show-item {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 20px 0;
  }

  .show-tickets {
    justify-self: start;
    margin-top: 8px;
  }

  .video-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .platform-link {
    width: 100px;
    height: 100px;
    font-size: 0.65rem;
  }

  .platform-link i {
    font-size: 1.6rem;
  }

  .section-title {
    font-size: 2rem;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 2.5rem;
  }

  .hero-cta {
    padding: 12px 36px;
    font-size: 0.8rem;
  }

  .mobile-nav a {
    font-size: 1.4rem;
  }

  .site-nav {
    padding: 14px 18px;
  }

  .nav-logo .logo-mark {
    height: 1.25rem;
  }
}
