/* ==========================================================================
   Penn Pals — pennpalsmusic.com
   Design tokens, then layout roughly in page order. No build step: this file
   ships as-is to the browser.
   ========================================================================== */

@font-face {
  font-family: "Fraunces";
  src: url("/assets/fonts/fraunces-variable.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Karla";
  src: url("/assets/fonts/karla-variable.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  /* --- Color: sampled from Penn Pals' own printed material, not invented ---
     Usage rule (verified against WCAG AA):
     - Light (cream) sections: text in --ink / --body; accents in --red or --rust.
     - Dark (espresso) sections: text in --cream-text / --muted; accents in --blue.
     - --blue and --rust are NOT used as text color on the opposite background —
       both fail contrast there. See README "Design tokens" if you touch this. */
  --cream: #FAF6E4;
  --espresso: #2B2116;
  --ink: #241C15;
  --body-text: #3D3226;
  --cream-text: #FAF6E4;
  --muted-on-dark: #D8CBB0;
  --blue: #B6E6FE;
  --rust: #8B4030;
  --red: #BD1C1B;
  --red-hover: #971714;

  --font-display: "Fraunces", ui-serif, Georgia, serif;
  --font-body: "Karla", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  --measure: 62ch;
  --wrap: 1160px;

  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --space-6: 6rem;

  --radius: 6px;
  --shadow-soft: 0 12px 32px rgba(20, 12, 8, 0.18);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* --- Reset --------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body { min-height: 100svh; }
img, picture, video { display: block; max-width: 100%; height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
ul { list-style: none; padding: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* --- Base ------------------------------------------------------------------ */
body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--body-text);
  background: var(--cream);
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.12;
  color: var(--ink);
  text-wrap: balance;
}
.section--dark h1, .section--dark h2, .section--dark h3 { color: var(--cream-text); }

h1 { font-size: clamp(2.1rem, 4.5vw + 1rem, 3.6rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 2.4vw + 1rem, 2.4rem); margin-bottom: var(--space-3); }
h3 { font-size: clamp(1.15rem, 1vw + 1rem, 1.4rem); margin-bottom: var(--space-1); }

p { max-width: var(--measure); }
.section__intro { color: inherit; opacity: 0.85; max-width: 68ch; margin-bottom: var(--space-4); }

a { text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.section--light a:not(.btn) { color: var(--red); }
.section--dark a:not(.btn) { color: var(--blue); }

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
  border-radius: 2px;
}
.section--light :focus-visible { outline-color: var(--red); }

.wrap {
  width: min(100% - 2.5rem, var(--wrap));
  margin-inline: auto;
}

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

.skip-link {
  position: absolute;
  left: 1rem; top: -3rem;
  background: var(--espresso);
  color: var(--cream-text);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  transition: top 0.2s var(--ease);
  z-index: 100;
}
.skip-link:focus { top: 1rem; }

/* --- Buttons --------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  font-weight: 700;
  font-family: var(--font-body);
  border: 2px solid transparent;
  transition: transform 0.15s var(--ease), background-color 0.15s var(--ease), border-color 0.15s var(--ease);
  text-decoration: none;
}
.btn--primary {
  background: var(--red);
  color: var(--cream-text);
}
.btn--primary:hover { background: var(--red-hover); }
.btn--primary:active { transform: translateY(1px); }
.btn--ghost {
  background: transparent;
  border-color: currentColor;
}
.section--dark .btn--ghost { color: var(--cream-text); }
.section--light .btn--ghost { color: var(--ink); }
.btn--ghost:hover { background: rgba(0,0,0,0.06); }
.section--dark .btn--ghost:hover { background: rgba(255,255,255,0.08); }

@media (prefers-reduced-motion: no-preference) {
  .btn { will-change: transform; }
}

/* ==========================================================================
   HEADER / NAV
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(43, 33, 22, 0.92);
  backdrop-filter: blur(6px);
  color: var(--cream-text);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 0.85rem;
  gap: 1rem;
}
.brand { text-decoration: none; display: inline-flex; }
.brand__mark {
  display: block;
  width: auto;
  height: auto;
}
.brand__mark--nav { width: 132px; }
.brand__mark--hero { width: clamp(180px, 26vw, 300px); margin-bottom: var(--space-2); }
.brand__mark--footer { width: 156px; }

.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px; height: 42px;
  background: transparent;
  border: 0;
  padding: 0;
}
.nav-toggle__bar {
  width: 24px; height: 2px;
  background: var(--cream-text);
  border-radius: 2px;
  margin-inline: auto;
}

.nav__list {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.nav__list a {
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}
.nav__list a:not(.nav__cta):hover { color: var(--blue); }
.nav__cta {
  background: var(--red);
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
}
.nav__cta:hover { background: var(--red-hover); }

@media (max-width: 780px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    position: absolute;
    inset-inline: 0;
    top: 100%;
    background: var(--espresso);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s var(--ease);
  }
  .nav[data-open="true"] { max-height: 24rem; }
  .nav__list {
    flex-direction: column;
    align-items: flex-start;
    padding: var(--space-2) var(--space-3) var(--space-4);
  }
}
@media (min-width: 781px) {
  .nav-toggle { display: none; }
}

/* ==========================================================================
   HERO
   ========================================================================== */
.hero {
  position: relative;
  min-height: 92svh;
  display: flex;
  align-items: flex-end;
  color: var(--cream-text);
  overflow: hidden;
}
.hero__media { position: absolute; inset: 0; z-index: 0; }
.hero__media img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; }
.hero__scrim {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(20,13,9,0.35) 0%, rgba(20,13,9,0.35) 40%, rgba(20,13,9,0.88) 100%);
  z-index: 1;
}
.hero__content {
  position: relative;
  z-index: 2;
  padding-block: var(--space-5) var(--space-6);
}
.hero__headline { color: var(--cream-text); max-width: 46ch; margin-bottom: var(--space-2); }
.hero__sub { max-width: 52ch; font-size: 1.1rem; color: var(--muted-on-dark); margin-bottom: var(--space-3); }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }

@media (max-width: 960px) {
  .hero { display: block; min-height: 0; background: var(--espresso); overflow: visible; }
  .hero__media { position: static; display: block; }
  .hero__media img {
    position: static;
    width: 100%;
    height: auto;
    aspect-ratio: 1.398;
    object-fit: cover;
    object-position: 50% 30%;
  }
  .hero__scrim { display: none; }
  .hero__content { position: static; padding-block: var(--space-4); }
}

/* ==========================================================================
   SECTIONS
   ========================================================================== */
.section { padding-block: var(--space-6); }
.section--light { background: var(--cream); color: var(--body-text); }
.section--dark { background: var(--espresso); color: var(--muted-on-dark); }

@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
  }
  .reveal.is-visible { opacity: 1; transform: none; }
}

/* --- Book Us For ------------------------------------------------------------ */
.book-grid {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: 1fr;
}
@media (min-width: 620px) { .book-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .book-grid { grid-template-columns: repeat(4, 1fr); } }

.book-card {
  background: #fff;
  border-top: 4px solid var(--rust);
  border-radius: var(--radius);
  padding: var(--space-3);
  box-shadow: var(--shadow-soft);
}
.book-card p { font-size: 0.96rem; }

/* --- About ------------------------------------------------------------------ */
.about__grid {
  display: grid;
  gap: var(--space-4);
  align-items: center;
}
@media (min-width: 800px) {
  .about__grid { grid-template-columns: 0.85fr 1.15fr; gap: var(--space-5); }
}
.about__media img { border-radius: var(--radius); box-shadow: var(--shadow-soft); }
.about__copy p { margin-bottom: var(--space-2); }
.about__copy p:last-child { margin-bottom: 0; }

/* --- Listen / Watch ----------------------------------------------------------- */
.video-wrap {
  position: relative;
  max-width: 700px;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  background: #000;
}
.video-grid { display: grid; gap: var(--space-3); }
@media (min-width: 800px) {
  .video-grid { grid-template-columns: 1fr 1fr; gap: var(--space-4); }
}
.video-grid .video-wrap { max-width: none; }
.video-wrap--wide { aspect-ratio: 16 / 9; }
.video-wrap--short { aspect-ratio: 9 / 16; }
.video-grid--shorts { grid-template-columns: repeat(2, 1fr); gap: var(--space-2); margin-top: var(--space-3); }
@media (min-width: 800px) {
  .video-grid--shorts { grid-template-columns: repeat(3, minmax(0, 220px)); gap: var(--space-3); }
}
.video-wrap__poster-media, .video-wrap__poster-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.video-wrap__play {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: transparent;
  border: 0;
}
.video-wrap__play svg { width: 4.5rem; height: 4.5rem; transition: transform 0.15s var(--ease); }
.video-wrap__play:hover svg { transform: scale(1.06); }
.video-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* --- Recently played ---------------------------------------------------------- */
.venues {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-2);
}
@media (min-width: 900px) {
  .venues { grid-template-columns: repeat(4, 1fr); gap: var(--space-3); }
}
.venues li {
  display: flex; flex-direction: column; justify-content: flex-start; align-items: center; text-align: center; gap: 0.25rem;
  padding: var(--space-2) var(--space-3);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius);
}
.venues__logo { width: 100%; height: 110px; object-fit: contain; border-radius: 10px; margin-bottom: var(--space-1); }
.venues__name { font-family: var(--font-display); font-size: 1.1rem; color: var(--cream-text); }
.venues__city { font-size: 0.95rem; color: var(--muted-on-dark); }

/* --- Song list ---------------------------------------------------------------- */
.song-list {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: 1fr;
}
@media (min-width: 640px) { .song-list { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .song-list { grid-template-columns: repeat(3, 1fr); } }

.song-category h3 { color: var(--blue); font-style: italic; }
.song-category ul { border-top: 1px solid rgba(255,255,255,0.15); }
.song-category li {
  padding-block: 0.55rem;
  border-bottom: 1px solid rgba(255,255,255,0.15);
  font-size: 0.96rem;
}
.song-title { color: var(--cream-text); font-weight: 600; }
.song-artist { display: block; font-size: 0.85rem; opacity: 0.75; }

/* --- Gallery -------------------------------------------------------------------- */
.gallery {
  display: grid;
  gap: var(--space-2);
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 700px) { .gallery { grid-template-columns: repeat(4, 1fr); } }
.gallery__item { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-soft); }
.gallery__item img {
  width: 100%; height: 100%; object-fit: cover; aspect-ratio: 1 / 1;
  transition: transform 0.3s var(--ease);
}
@media (prefers-reduced-motion: no-preference) {
  .gallery__item:hover img { transform: scale(1.04); }
}

/* --- Upcoming Shows: the postcard signature element ------------------------------ */
.shows-list { display: grid; gap: var(--space-3); }
.show-postcard {
  --stamp-size: 3.4rem;
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-2);
  background: #fff;
  border: 1px solid rgba(36,21,18,0.12);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4) var(--space-3) var(--space-3);
  box-shadow: var(--shadow-soft);
  text-decoration: none;
  color: inherit;
}
.show-postcard::before {
  /* the dividing rule from a real postcard, between "message" and "address" halves */
  content: "";
  position: absolute;
  left: calc(100% - 8.5rem);
  top: var(--space-3);
  bottom: var(--space-3);
  width: 1px;
  background: rgba(36,21,18,0.15);
}
.show-postcard__venue { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; color: var(--ink); }
.show-postcard__meta { display: block; margin-top: 0.25rem; color: var(--body-text); }
.show-postcard__stamp {
  width: var(--stamp-size); height: var(--stamp-size);
  border: 2px dashed rgba(36,21,18,0.35);
  border-radius: 3px;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.75rem;
  line-height: 1.15;
  color: var(--red);
  align-self: start;
  transform: rotate(3deg);
}
.shows-empty {
  background: #fff;
  border: 1px dashed rgba(36,21,18,0.25);
  border-radius: var(--radius);
  padding: var(--space-4);
  text-align: center;
  color: var(--body-text);
}
.shows-empty a { color: var(--red); }

/* --- Contact / booking form --------------------------------------------------------- */
.contact__grid {
  display: grid;
  gap: var(--space-4);
}
@media (min-width: 900px) {
  .contact__grid { grid-template-columns: 0.8fr 1.2fr; align-items: start; }
}
.contact__intro p a { color: var(--blue); }

.contact-form { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.12); border-radius: var(--radius); padding: var(--space-3); }
.contact-form__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-row { display: grid; gap: var(--space-2); margin-bottom: var(--space-2); }
@media (min-width: 560px) { .form-row { grid-template-columns: 1fr 1fr; } }

.form-field { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: var(--space-2); }
.form-row .form-field { margin-bottom: 0; }
.form-field label { font-size: 0.9rem; font-weight: 600; color: var(--cream-text); }
.form-field input, .form-field select, .form-field textarea {
  background: var(--cream);
  color: var(--ink);
  border: 1.5px solid transparent;
  border-radius: 4px;
  padding: 0.65rem 0.75rem;
  font-size: 1rem;
}
.form-field input:invalid[data-touched="true"],
.form-field select:invalid[data-touched="true"] { border-color: var(--red); }
.form-field__error {
  font-size: 0.85rem;
  color: #FFB4A8;
  min-height: 1.1em;
}

.contact-form__submit { margin-top: var(--space-1); }
.contact-form__status {
  margin-top: var(--space-2);
  font-weight: 600;
  min-height: 1.4em;
}
.contact-form__status[data-state="success"] { color: #9FE0A8; }
.contact-form__status[data-state="error"] { color: #FFB4A8; }

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
  background: var(--ink);
  color: var(--muted-on-dark);
  padding-block: var(--space-4);
}
.site-footer__inner { display: grid; gap: var(--space-2); }
.site-footer__brand .brand__mark--footer { margin-bottom: 0.35rem; }
.site-footer__brand p { font-size: 0.9rem; opacity: 0.85; }
.footer-social { display: flex; gap: var(--space-3); }
.footer-social a { text-decoration: none; font-weight: 600; }
.footer-social a:hover { color: var(--blue); }
.site-footer__meta { font-size: 0.9rem; }
.site-footer__meta a { color: var(--blue); }
.footer-signoff { display: inline-flex; align-items: center; gap: 0.4rem; }
.footer-ladybug { display: inline-block; }
.site-footer__copyright { font-size: 0.8rem; opacity: 0.7; }

@media (min-width: 700px) {
  .site-footer__inner {
    grid-template-columns: 1fr auto;
    align-items: start;
  }
  .site-footer__copyright { grid-column: 1 / -1; }
}
