/* Palette (locked) */
:root {
  --white: #FFFFFF;
  --black: #000000;
  --oxblood: #5A1E1B;
  --olive: #3F4A26;
  --gold: #C8A24A;
  --bone: #F2EEE8;

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --max-width: 1100px;
  --gutter: 16px;
  --section-space: 4.5rem;
}

/* Light theme (default) */
:root,
[data-theme="light"] {
  --bg: var(--white);
  --text: var(--black);
  --btn-bg: var(--oxblood);
  --btn-text: var(--bone);
  --btn-hover-bg: var(--olive);
  --btn-hover-text: var(--bone);
  --link: var(--oxblood);
  --link-hover: var(--olive);
  --accent-line: var(--oxblood);
  --rule: var(--gold);
  --focus: var(--gold);
  /* Gold alone is only ~2.4:1 on white, so a thin black ring sits outside it */
  --focus-halo: var(--black);
  --tile-bg: rgba(0, 0, 0, 0.05);
  --line: rgba(0, 0, 0, 0.18);
  color-scheme: light;
}

/* Dark theme */
[data-theme="dark"] {
  --bg: var(--black);
  --text: var(--bone);
  --btn-bg: var(--bone);
  --btn-text: var(--oxblood);
  --btn-hover-bg: var(--olive);
  --btn-hover-text: var(--bone);
  --link: var(--gold);
  --link-hover: var(--bone);
  /* Oxblood disappears on black, so dark mode's accent line uses gold like its links */
  --accent-line: var(--gold);
  --rule: var(--gold);
  --focus: var(--gold);
  --focus-halo: transparent;
  --tile-bg: rgba(242, 238, 232, 0.07);
  --line: rgba(242, 238, 232, 0.25);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  position: relative;
  /* Only the carousels scroll sideways; clip keeps the page itself from doing so */
  overflow-x: clip;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

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

[hidden] {
  display: none !important;
}

a {
  color: inherit;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  margin: 0;
}

p {
  margin: 0;
}

figure {
  margin: 0;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px var(--focus-halo);
}

.section-title {
  font-size: clamp(1.75rem, 4vw, 2.4rem);
  line-height: 1.15;
}

/* Top bar */
.topbar {
  display: flex;
  justify-content: flex-end;
  padding: 1rem var(--gutter) 0;
  max-width: var(--max-width);
  margin: 0 auto;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: none;
  border: 1px solid var(--text);
  border-radius: 2px;
  color: var(--text);
  cursor: pointer;
  transition: color 200ms, border-color 200ms;
}

.theme-toggle:hover {
  color: var(--link-hover);
  border-color: var(--link-hover);
}

.theme-toggle .icon-sun,
[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.9rem 1.6rem;
  min-height: 44px;
  border-radius: 2px;
  cursor: pointer;
  background: var(--btn-bg);
  color: var(--btn-text);
  transition: background-color 200ms, color 200ms;
}

.btn:hover {
  background: var(--btn-hover-bg);
  color: var(--btn-hover-text);
}

/* Contact + email fallback (revealed inline after the button is tapped) */
.contact-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
}

.email-reveal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}

.email-text {
  font-weight: 500;
  overflow-wrap: anywhere;
}

.copy-btn {
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  min-height: 44px;
  padding: 0.35rem 0.9rem;
  background: none;
  color: inherit;
  border: 1px solid currentColor;
  border-radius: 2px;
  cursor: pointer;
}

.copy-btn:hover {
  background: var(--olive);
  border-color: var(--olive);
  color: var(--bone);
}

/* 1. Hero */
.hero {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem var(--gutter) var(--section-space);
  display: flex;
  flex-direction: column;
  gap: 2.75rem;
}

.hero-name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--link);
  margin-bottom: 1rem;
}

.hero-headline {
  font-size: clamp(2.1rem, 8vw, 3.4rem);
  line-height: 1.08;
  max-width: 16ch;
  margin-bottom: 1rem;
}

.hero-subline {
  font-size: 1.05rem;
  max-width: 34ch;
  margin-bottom: 2.25rem;
}

.hero-story {
  font-family: var(--font-display);
  font-weight: 340;
  font-size: clamp(1.2rem, 4.6vw, 1.45rem);
  line-height: 1.55;
  max-width: 34em;
  margin-bottom: 1.25rem;
}

.hero-closing {
  font-size: 1.05rem;
  max-width: 34em;
  margin-bottom: 2rem;
}

.hero-photo img {
  width: 100%;
  height: auto;
  background: var(--tile-bg);
}

/* Carousel sections */
.band {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter) var(--section-space);
}

.band-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

/* Swipe on phones; arrow buttons appear on desktop */
.carousel-nav {
  display: none;
  gap: 0.5rem;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: none;
  border: 1px solid var(--text);
  border-radius: 2px;
  color: var(--text);
  cursor: pointer;
  transition: color 200ms, border-color 200ms, opacity 200ms;
}

.nav-btn:hover:not(:disabled) {
  color: var(--link-hover);
  border-color: var(--link-hover);
}

.nav-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.track {
  list-style: none;
  margin: 0 calc(-1 * var(--gutter));
  padding: 0.5rem var(--gutter);
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  scrollbar-width: none;
}

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

.track > li {
  flex: 0 0 auto;
  scroll-snap-align: start;
}

/* Reels: grid of 9:16 cards. 2 columns on phones and tablets, 3 on desktop */
.reel-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.75rem 0.75rem;
}

.reel-frame {
  position: relative;
  aspect-ratio: 9 / 16;
  background: var(--tile-bg);
  overflow: hidden;
}

.reel-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* The play button covers the whole frame, so tapping the video toggles it */
.reel-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0;
  background: none;
  border: 0;
  color: var(--white);
  cursor: pointer;
}

.reel-play:focus-visible {
  outline-offset: -4px;
}

.play-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.6);
  transition: opacity 200ms;
}

.reel-play .icon-pause,
.reel-card.is-playing .reel-play .icon-play {
  display: none;
}

.reel-card.is-playing .reel-play .icon-pause {
  display: block;
}

/* While playing, the icon fades away until hover or keyboard focus */
.reel-card.is-playing .play-icon {
  opacity: 0;
}

.reel-card.is-playing .reel-play:hover .play-icon,
.reel-card.is-playing .reel-play:focus-visible .play-icon {
  opacity: 1;
}

.reel-mute {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  border: 0;
  color: var(--white);
  cursor: pointer;
}

.reel-mute .icon-sound,
.reel-card.is-unmuted .reel-mute .icon-muted {
  display: none;
}

.reel-card.is-unmuted .reel-mute .icon-sound {
  display: block;
}

.reel-caption {
  margin-top: 0.85rem;
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Photos: every image in the same 4:5 frame */
.photo-card {
  width: min(78vw, 320px);
}

.photo-btn {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: var(--tile-bg);
  cursor: zoom-in;
}

.photo-btn img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

/* Lightbox */
.lightbox {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.94);
  color: var(--bone);
  cursor: zoom-out;
}

.lightbox[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox::backdrop {
  background: rgba(0, 0, 0, 0.94);
}

.lightbox-img {
  max-width: calc(100vw - 2 * var(--gutter));
  max-height: calc(100dvh - 9rem);
  width: auto;
  height: auto;
  object-fit: contain;
}

.lightbox-count {
  position: absolute;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%);
  font-size: 0.9rem;
}

.lb-btn {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(242, 238, 232, 0.5);
  border-radius: 2px;
  color: var(--bone);
  cursor: pointer;
}

.lb-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.lb-close {
  top: var(--gutter);
  right: var(--gutter);
}

.lb-prev,
.lb-next {
  bottom: 0.75rem;
}

.lb-prev {
  left: var(--gutter);
}

.lb-next {
  right: var(--gutter);
}

/* 4. Footer: same background as the page, thin accent rule on top */
.site-footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter) 2rem;
}

.site-footer::before {
  content: "";
  display: block;
  height: 2px;
  background: var(--accent-line);
  margin-bottom: 3rem;
}

.signoff {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  line-height: 1.2;
  margin-bottom: 1.5rem;
}

.socials {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  margin: 2rem 0 0 -10px;
}

.socials a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--text);
  transition: color 200ms;
}

.socials a:hover {
  color: var(--link);
}

.copyright {
  margin-top: 1.5rem;
  font-size: 0.8rem;
  opacity: 0.7;
}

/* Gentle fade-in on scroll (only with JS on, and never with reduced motion) */
.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 700ms ease, transform 700ms ease;
}

.js .reveal.is-in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .track {
    scroll-behavior: auto;
  }
}

/* Very narrow phones: one column so the cards stay easy to tap */
@media (max-width: 339px) {
  .reel-grid {
    grid-template-columns: 1fr;
  }
}

/* Desktop */
@media (min-width: 860px) {
  :root {
    --gutter: 2.5rem;
    --section-space: 7rem;
  }

  .topbar {
    padding-top: 1.5rem;
  }

  .hero {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    align-items: center;
    gap: 4rem;
    padding-top: 3rem;
  }

  .hero-subline {
    max-width: 44ch;
  }

  .hero-story {
    font-size: 1.4rem;
  }

  .carousel-nav {
    display: flex;
  }

  /* Cards line up with the page edge on desktop instead of running to the screen edge */
  .track {
    margin: 0 -0.5rem;
    padding: 0.5rem;
    scroll-padding-inline: 0.5rem;
    gap: 1.25rem;
  }

  .reel-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2.5rem 1.25rem;
  }

  .photo-card {
    width: 312px;
  }

  .lb-prev,
  .lb-next {
    bottom: auto;
    top: 50%;
    transform: translateY(-50%);
  }

  .lightbox-img {
    max-width: calc(100vw - 10rem);
    max-height: calc(100dvh - 6rem);
  }
}
