/* =========================================================================
   NIBIZA — Sunday afternoon Ibiza vibes
   Vanilla CSS. No framework. Two system font stacks for hierarchy.
   Edit the custom properties below to re-skin the whole site.
   ========================================================================= */

:root {
  /* --- Sunset palette --- */
  --sand:        #fff6ec;
  --sand-deep:   #ffe9d4;
  --ink:         #2a1a22;
  --ink-soft:    #6b5560;
  --coral:       #ff784f;
  --coral-deep:  #ff5a8a;
  --coral-text:  #bd3b1f;  /* darker coral for small text on light bg — passes AA (~5.4:1) */
  --amber:       #ffb24d;
  --dusk:        #3a2d52;
  --dusk-deep:   #221836;

  /* --- Typography: distinct display vs body, both dependency-free --- */
  --font-display: "Young Serif", "Hoefler Text", "Iowan Old Style", Palatino,
                  Georgia, "Times New Roman", serif;
  --font-body:    ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
                  "Helvetica Neue", Arial, sans-serif;

  /* --- Scale & misc --- */
  --maxw: 1120px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --radius: 18px;
  --shadow: 0 24px 60px -28px rgba(58, 24, 12, 0.45);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* Self-hosted display face — single 27KB woff2, no external request.
   Young Serif ships one weight (400); display elements use it at 400. */
@font-face {
  font-family: "Young Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/young-serif-latin.woff2") format("woff2");
}

/* --------------------------------------------------------- Reset-ish */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--sand);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

h1, h2 { font-family: var(--font-display); font-weight: 400; line-height: 1.05; letter-spacing: -0.01em; margin: 0; }
em { font-style: italic; }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.muted { color: var(--ink-soft); }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--ink); color: #fff; padding: 0.6rem 1rem; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* --------------------------------------------------------- Buttons */
.btn {
  --b: var(--ink);
  display: inline-flex; align-items: center; gap: 0.5ch;
  font-weight: 600; font-size: 0.98rem; text-decoration: none;
  padding: 0.85rem 1.5rem; border-radius: 999px; border: 1.5px solid transparent;
  cursor: pointer; transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn--solid {
  background: linear-gradient(120deg, var(--coral), var(--coral-deep));
  color: #fff; box-shadow: 0 14px 30px -12px rgba(255, 90, 95, 0.7);
}
.btn--solid:hover { box-shadow: 0 18px 38px -12px rgba(255, 90, 95, 0.85); }
.btn--ghost { background: rgba(255,255,255,0.5); border-color: rgba(42,26,34,0.18); color: var(--ink); }
.btn--ghost:hover { background: #fff; }
.btn[disabled] { opacity: 0.6; cursor: progress; transform: none; box-shadow: none; }

:focus-visible { outline: 3px solid var(--coral-deep); outline-offset: 3px; border-radius: 4px; }

/* --------------------------------------------------------- Nav */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  transition: background 0.3s var(--ease), box-shadow 0.3s var(--ease);
  padding-block: 0.85rem;
}
/* Scrim so the white wordmark/links stay legible over any part of the hero photo.
   Fades out once the bar gets its own solid background on scroll. */
.nav::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(to bottom, rgba(20, 10, 18, 0.5), rgba(20, 10, 18, 0));
  transition: opacity 0.3s var(--ease);
}
.nav.is-stuck {
  background: var(--sand);
  border-bottom: 1px solid rgba(42, 26, 34, 0.12);
  box-shadow: 0 6px 24px -16px rgba(42, 26, 34, 0.5);
}
.nav.is-stuck::before { opacity: 0; }
.nav__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.nav__brand {
  font-family: var(--font-display); font-weight: 400; font-size: 1.4rem;
  letter-spacing: 0.04em; text-decoration: none; color: #fff;
  display: inline-flex; align-items: center; gap: 0.5ch;
}
.nav__mark { color: var(--coral); }
.nav__menu { display: flex; align-items: center; gap: clamp(1rem, 2.4vw, 2rem); }
.nav__menu a { text-decoration: none; font-weight: 500; color: #fff; position: relative; }
/* Over the dark hero the bar is transparent (light text); once stuck on sand, flip to ink. */
.nav.is-stuck .nav__brand, .nav.is-stuck .nav__menu a:not(.nav__cta) { color: var(--ink); }
.nav__menu a:not(.nav__cta)::after {
  content: ""; position: absolute; left: 0; bottom: -4px; height: 2px; width: 100%;
  background: var(--coral); transform: scaleX(0); transform-origin: left;
  transition: transform 0.25s var(--ease);
}
.nav__menu a:not(.nav__cta):hover::after,
.nav__menu a:not(.nav__cta).is-current::after { transform: scaleX(1); }
.nav.is-stuck .nav__menu a:not(.nav__cta).is-current { color: var(--coral-text); }
.nav__cta.is-current { background: var(--coral); }
.nav__cta {
  background: var(--ink); color: var(--sand) !important; padding: 0.55rem 1.1rem;
  border-radius: 999px; transition: background 0.25s;
}
.nav__cta:hover { background: var(--coral); }

.nav__toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 6px; }
.nav__toggle span { width: 26px; height: 2px; background: #fff; border-radius: 2px; transition: transform 0.3s var(--ease), opacity 0.2s, background 0.2s; }
.nav.is-stuck .nav__toggle span { background: var(--ink); }
/* When the panel is open it sits behind the toggle (a light surface) → dark bars. */
.nav__toggle[aria-expanded="true"] span { background: var(--ink); }
.nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* --------------------------------------------------------- Hero */
.hero {
  position: relative; min-height: 100svh; display: flex; align-items: center;
  color: #fff; overflow: hidden; background: var(--dusk-deep);
}
/* Real golden-hour photo carries the warmth; the veil keeps the sunset tint
   AND a left-side scrim so white headline copy stays legible (AA). */
.hero__photo {
  position: absolute; inset: 0; z-index: 0;
  width: 100%; height: 100%; object-fit: cover; object-position: center 40%;
}
.hero__veil {
  position: absolute; inset: 0; z-index: 1;
  background:
    linear-gradient(90deg, rgba(20,10,18,0.68) 0%, rgba(20,10,18,0.32) 48%, rgba(20,10,18,0) 88%),
    radial-gradient(120% 95% at 50% 122%, rgba(255,178,77,0.48) 0%, rgba(255,120,79,0.42) 34%, rgba(58,45,82,0.60) 82%, rgba(34,24,54,0.85) 100%);
}
.hero__sun {
  position: absolute; left: 50%; bottom: -38vmin; transform: translateX(-50%); z-index: 1;
  width: 78vmin; height: 78vmin; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,243,214,0.9) 0%, rgba(255,217,138,0.6) 38%, rgba(255,178,77,0) 70%);
  filter: blur(2px); opacity: 0.85; animation: rise 14s var(--ease) infinite alternate;
}
@keyframes rise { from { transform: translate(-50%, 4vmin); } to { transform: translate(-50%, -4vmin); } }
.hero__inner { position: relative; z-index: 2; padding-block: 8rem 6rem; max-width: 760px; }
.hero__eyebrow {
  text-transform: uppercase; letter-spacing: 0.28em; font-size: 0.78rem; font-weight: 600;
  margin: 0 0 1rem; opacity: 0.9;
}
.hero__title { font-size: clamp(2.8rem, 8vw, 5.5rem); text-shadow: 0 8px 40px rgba(42,16,8,0.25); }
.hero__title em { color: #fff; font-style: italic; }
.hero__lead { font-size: clamp(1.05rem, 1.8vw, 1.3rem); max-width: 48ch; margin: 1.5rem 0 2.2rem; opacity: 0.95; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.9rem; }
.hero__scroll {
  position: absolute; left: 50%; bottom: 1.6rem; transform: translateX(-50%); z-index: 2;
  color: #fff; text-decoration: none; font-size: 1.4rem; opacity: 0.85;
  animation: bob 2s ease-in-out infinite;
}
@keyframes bob { 0%,100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 8px); } }

/* --------------------------------------------------------- Sections */
.section { padding-block: clamp(4rem, 9vw, 7rem); }
.section--tint { background: var(--sand-deep); }
.section__title { font-size: clamp(1.9rem, 4.4vw, 3rem); text-wrap: balance; }
.section__head { max-width: 40ch; margin-bottom: 3rem; }
.section__grid { display: grid; gap: clamp(1.5rem, 5vw, 4rem); grid-template-columns: 1fr; }
@media (min-width: 820px) { .section__grid { grid-template-columns: 0.9fr 1.1fr; align-items: start; } }

.about__copy p { margin: 0 0 1.1rem; font-size: 1.08rem; }
.about__facts { list-style: none; margin: 1.8rem 0 0; padding: 0; display: grid; gap: 0.4rem; }
.about__facts li { padding: 0.7rem 0; border-top: 1px solid rgba(42,26,34,0.12); }
.about__facts strong { display: inline-block; min-width: 5.5ch; color: var(--coral-text); margin-right: 0.5rem; }

/* --------------------------------------------------------- Crew */
.crew {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 1.4rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.crew__card {
  position: relative; background: #fff; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.crew__card:hover { transform: translateY(-6px); box-shadow: 0 34px 70px -30px rgba(58,24,12,0.55); }
.crew__art {
  position: relative; overflow: hidden;
  aspect-ratio: 4 / 3; display: grid; place-items: center;
  font-family: var(--font-display); font-size: 2.6rem; color: rgba(255,255,255,0.92);
  background-image: linear-gradient(135deg, var(--c1, var(--coral)), var(--c2, var(--dusk)));
}
/* Drop a real portrait in via the `photo` field in main.js; the gradient +
   initial below it is the graceful fallback until you have one. */
.crew__photo {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; filter: grayscale(0.35) saturate(1.05) contrast(1.02);
  transition: filter 0.4s var(--ease), transform 0.5s var(--ease);
}
.crew__card:hover .crew__photo { filter: none; transform: scale(1.03); }
.crew__body { padding: 1.2rem 1.3rem 1.4rem; }
.crew__name { font-family: var(--font-display); font-size: 1.4rem; margin: 0; }
.crew__role { color: var(--coral-text); font-weight: 600; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; margin: 0.2rem 0 0.7rem; }
.crew__bio { margin: 0 0 1rem; color: var(--ink-soft); font-size: 0.98rem; }
.crew__links { display: flex; gap: 0.8rem; font-size: 0.9rem; font-weight: 600; }
.crew__links a { text-decoration: none; color: var(--ink); border-bottom: 2px solid var(--amber); padding-bottom: 1px; }
.crew__links a:hover { color: var(--coral); border-color: var(--coral); }

/* --------------------------------------------------------- Events */
.events { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.event {
  display: grid; gap: 0.4rem 1.6rem; align-items: center;
  grid-template-columns: 1fr; padding: 1.4rem 1.6rem;
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  transition: transform 0.3s var(--ease);
}
.event:hover { transform: translateX(6px); }
@media (min-width: 720px) { .event { grid-template-columns: 8.5rem 1fr auto; } }
.event__date { font-family: var(--font-display); font-size: 1.1rem; font-weight: 400; }
.event__date span { display: block; font-family: var(--font-body); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--coral-text); }
.event__name { font-weight: 600; font-size: 1.1rem; }
.event__where { color: var(--ink-soft); font-size: 0.95rem; }
.event__cta { justify-self: start; }
.event--tbc { opacity: 0.72; }
.event--tbc .event__cta { font-style: italic; color: var(--ink-soft); }
/* Mobile: single column → center everything. MUST sit after the base rules above,
   because `.event__cta { justify-self: start }` would otherwise win on source order
   (media queries add no specificity). */
@media (max-width: 719px) {
  .event { justify-items: center; text-align: center; gap: 0.55rem; }
  .event__date { justify-self: center; }
  .event__cta { justify-self: center; }
}

/* --------------------------------------------------------- Listen */
.listen__placeholder {
  border: 2px dashed rgba(42,26,34,0.22); border-radius: var(--radius);
  padding: clamp(2.5rem, 8vw, 5rem); text-align: center; background: rgba(255,255,255,0.5);
}
.listen__placeholder span { font-size: 2.4rem; display: block; margin-bottom: 0.6rem; color: var(--coral); }
.listen__placeholder p { margin: 0.3rem 0; }
.listen iframe { border-radius: var(--radius); border: 0; width: 100%; box-shadow: var(--shadow); }
code { background: rgba(42,26,34,0.08); padding: 0.1rem 0.4rem; border-radius: 6px; font-size: 0.9em; }

/* --------------------------------------------------------- Contact */
.contact { display: grid; gap: clamp(1.8rem, 5vw, 3.5rem); grid-template-columns: 1fr; align-items: start; }
@media (min-width: 820px) { .contact { grid-template-columns: 1fr 1fr; } }
.contact__lead { font-size: 1.08rem; max-width: 42ch; }
.contact__social { display: flex; flex-wrap: wrap; gap: 1.2rem; margin-top: 1.4rem; font-weight: 600; }
.contact__social a { text-decoration: none; border-bottom: 2px solid var(--amber); }
.contact__social a:hover { color: var(--coral); border-color: var(--coral); }

.signup { background: #fff; border-radius: var(--radius); padding: clamp(1.5rem, 4vw, 2.2rem); box-shadow: var(--shadow); }
.signup__label { display: block; font-weight: 600; font-size: 0.95rem; }
.signup__hint { margin: 0.25rem 0 0; font-size: 0.85rem; color: var(--ink-soft); }
.signup__trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.signup__row { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 0.8rem; }
.signup__input {
  flex: 1 1 14rem; min-width: 0; padding: 0.85rem 1.1rem; font-size: 1rem; font-family: inherit;
  border: 1.5px solid rgba(42,26,34,0.2); border-radius: 999px; background: var(--sand);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.signup__input:focus { outline: 0; border-color: var(--coral); box-shadow: 0 0 0 4px rgba(255,120,79,0.18); }
.signup__note { margin: 0.9rem 0 0; min-height: 1.2em; font-size: 0.92rem; color: var(--coral-text); }
.signup__note.is-ok { color: #1c7d4d; }

/* --------------------------------------------------------- Footer */
.footer { background: var(--dusk-deep); color: rgba(255,255,255,0.8); padding-block: 2.2rem; }
.footer .muted { color: rgba(255,255,255,0.55); }
.footer__inner { display: flex; flex-wrap: wrap; gap: 0.6rem 1.5rem; align-items: center; justify-content: space-between; }
.footer__brand { font-family: var(--font-display); font-size: 1.15rem; letter-spacing: 0.04em; color: #fff; }

/* --------------------------------------------------------- Work-in-progress bar */
.wip {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 0.35rem 1rem;
  padding: 0.7rem 2.6rem; text-align: center;
  background: var(--dusk-deep); color: var(--sand); font-size: 0.9rem;
  box-shadow: 0 -10px 30px -18px rgba(0, 0, 0, 0.65);
  transition: transform 0.4s var(--ease);
}
.wip.is-hidden { transform: translateY(110%); }
.wip__text { margin: 0; }
.wip__link { color: #fff; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.wip__link:hover { color: var(--amber); }
.wip__close {
  position: absolute; right: 0.5rem; top: 50%; transform: translateY(-50%);
  background: none; border: 0; color: var(--sand); font-size: 1.5rem; line-height: 1;
  cursor: pointer; padding: 0.1rem 0.55rem; opacity: 0.7; transition: opacity 0.2s;
}
.wip__close:hover { opacity: 1; }
/* Keep the footer clear of the fixed bar while it's showing. */
body:has(.wip:not(.is-hidden)) .footer { padding-bottom: 4.5rem; }

/* --------------------------------------------------------- Reveal on scroll */
/* Reveal = progressive enhancement. Content is visible by DEFAULT; JS "arms"
   the hidden state (.is-armed) only when it can also remove it (.is-in). So if
   JS or IntersectionObserver ever fails, no section ships blank. */
.reveal { transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); transition-delay: calc(var(--i, 0) * 70ms); }
.reveal.is-armed { opacity: 0; transform: translateY(22px); }
.reveal.is-in { opacity: 1; transform: none; }
/* Differentiated entrances — not one uniform fade for everything:
   hero sequences top-to-bottom, events slide in from the side, crew staggers (--i from JS). */
.hero__inner .reveal.is-armed { transform: translateY(28px) scale(0.99); }
.hero__inner .reveal:nth-child(1) { transition-delay: 0.05s; }
.hero__inner .reveal:nth-child(2) { transition-delay: 0.16s; }
.hero__inner .reveal:nth-child(3) { transition-delay: 0.30s; }
.hero__inner .reveal:nth-child(4) { transition-delay: 0.44s; }
@media (min-width: 720px) { .event.reveal.is-armed { transform: translateX(-20px); } }

/* --------------------------------------------------------- Mobile nav */
@media (max-width: 760px) {
  /* Toggle must sit ABOVE the panel so the X stays tappable to close. */
  .nav__toggle { display: flex; position: relative; z-index: 60; }
  .nav__menu {
    position: fixed; inset: 0 0 0 auto; width: min(78vw, 320px); z-index: 55;
    flex-direction: column; align-items: flex-start; justify-content: center; gap: 1.6rem;
    padding: 5rem var(--gutter) 2rem;
    background: rgba(255, 246, 236, 0.98); backdrop-filter: blur(14px);
    transform: translateX(100%); transition: transform 0.35s var(--ease);
    box-shadow: -20px 0 60px -30px rgba(0,0,0,0.5);
  }
  .nav__menu.is-open { transform: translateX(0); }
  /* The slide-in panel is a light surface — links read as ink here, not the over-hero white. */
  .nav__menu a:not(.nav__cta) { font-size: 1.25rem; color: var(--ink); }
}
