/* ==========================================================================
   TPCC — The Peter's Children Choir · single-page site
   Implements: website/specs/visual-spec.md (styling values)
             + website/specs/ux-structure.md (structure & behavior)
   Plain CSS, no frameworks. Works from file:// with no JavaScript.
   ========================================================================== */

/* ---- 1. Design tokens (visual-spec §1, §3, §4) ---- */
:root {
  /* Dark bases */
  --c-black:        #000000;
  --c-ink-dark:     #0B0D10;
  --c-band:         #101820;

  /* Brand accents — sampled from the logo */
  --c-blue:         #387EC0;
  --c-teal:         #49A0A3;
  --c-yellow:       #EFB63F;
  --c-coral:        #E85D6B;

  /* Deep variants — the only accent colors allowed as text on light backgrounds */
  --c-blue-deep:    #1D5E96;
  --c-teal-deep:    #17706B;
  --c-coral-deep:   #B93A4C;

  /* Text */
  --c-text-dark-bg:   #FFFFFF;
  --c-text-dark-mut:  #C7CDD6;
  --c-text-light-bg:  #23272E;
  --c-text-light-mut: #52585F;
  --c-btn-text:       #141414;

  /* Light surfaces */
  --c-cream:        #FDFBF7;
  --c-white:        #FFFFFF;
  --c-border-light: #E7E2D9;

  /* Typography */
  --font-display: "Baloo 2", "Trebuchet MS", Verdana, sans-serif;
  --font-body:    "Nunito Sans", "Segoe UI", Arial, sans-serif;

  /* Spacing scale (4px base) */
  --space-1: 0.25rem;  --space-2: 0.5rem;  --space-3: 0.75rem;  --space-4: 1rem;
  --space-5: 1.5rem;   --space-6: 2rem;    --space-7: 3rem;     --space-8: 4rem;
  --space-9: 5rem;     --space-10: 6rem;

  /* Layout */
  --content-max: 72rem;   /* 1152px */
  --prose-max:   42rem;   /* 672px  */

  /* Border radius */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  /* Nav */
  --nav-height: 72px;
  --nav-height-mobile: 60px;
}

/* ---- 2. Reset / base ---- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-padding-top: 80px; /* fixed nav clearance for anchor jumps */
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  font: 400 1.0625rem/1.65 var(--font-body);
  color: var(--c-text-light-bg);
  background: var(--c-white);
  overflow-x: hidden;
}

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

h1, h2, h3 { font-family: var(--font-display); margin: 0; }
p { margin: 0 0 var(--space-4); }
p:last-child { margin-bottom: 0; }
ul { margin: 0; padding: 0; list-style: none; }
a { color: var(--c-blue-deep); }

section { scroll-margin-top: 80px; }

/* Focus (visual-spec §6) — every interactive element */
:focus-visible {
  outline: 3px solid var(--c-blue);
  outline-offset: 3px;
}

.container {
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--space-5);
}

.prose { max-width: var(--prose-max); }
.prose h3 {
  font-size: 1.375rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--c-text-light-bg);
  margin: var(--space-7) 0 var(--space-5);
}

/* ---- 3. Skip link ---- */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-4);
  z-index: 200;
  padding: var(--space-3) var(--space-5);
  background: var(--c-yellow);
  color: var(--c-btn-text);
  font: 700 1rem/1 var(--font-body);
  border-radius: var(--radius-pill);
  text-decoration: none;
  transition: top 150ms ease;
}
.skip-link:focus { top: var(--space-3); }

/* ---- 4. Logo treatment (visual-spec §2) ---- */
.logo { mix-blend-mode: screen; } /* pure-black logo background contributes nothing on dark */

/* ---- 5. Sticky nav (visual-spec §5.1; structure §3) ----
   Default background is the dark "scrolled" surface rather than transparent:
   with no JS there is no scroll listener, and links must stay legible while the
   nav passes over the light sections. Over the pure-black hero the dark bar
   reads as part of the hero. developer-2's js/main.js may add .nav--scrolled
   (scrollY > 24) for the height/hairline change per spec. */
.site-nav {
  position: fixed;
  top: 0;
  inset-inline: 0;
  z-index: 100;
  height: var(--nav-height);
  background: rgba(11, 13, 16, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 200ms ease, height 200ms ease;
}
.nav--scrolled {
  height: 60px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
}
.nav-logo { width: 42px; height: auto; flex: none; }
.nav-wordmark {
  font: 700 1.25rem/1 var(--font-display);
  color: var(--c-yellow);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}
.nav-links a {
  font: 700 1rem/1 var(--font-body);
  letter-spacing: 0.01em;
  color: var(--c-text-dark-bg);
  text-decoration: none;
}
.nav-links a:hover {
  color: var(--c-yellow);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}
.nav-links a.nav-cta { color: var(--c-btn-text); padding: 0.5rem 1.25rem; }
.nav-links a.nav-cta:hover { color: var(--c-btn-text); text-decoration: none; }

/* Mobile menu toggle — CSS-only checkbox pattern (structure §3 no-JS fallback) */
.nav-toggle {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.nav-toggle-label { display: none; }
@media (min-width: 768px) {
  .nav-toggle { display: none; } /* out of the tab order when the full menu shows */
}

@media (max-width: 767.98px) {
  .site-nav { height: var(--nav-height-mobile); }

  .nav-toggle-label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    cursor: pointer;
  }
  /* hamburger icon (3 bars) */
  .nav-toggle-icon,
  .nav-toggle-icon::before,
  .nav-toggle-icon::after {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--c-text-dark-bg);
    transition: transform 150ms ease, opacity 150ms ease;
  }
  .nav-toggle-icon { position: relative; }
  .nav-toggle-icon::before,
  .nav-toggle-icon::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
  }
  .nav-toggle-icon::before { transform: translateY(-7px); }
  .nav-toggle-icon::after  { transform: translateY(7px); }
  .nav-toggle:checked ~ .nav-toggle-label .nav-toggle-icon { background: transparent; }
  .nav-toggle:checked ~ .nav-toggle-label .nav-toggle-icon::before { transform: rotate(45deg); }
  .nav-toggle:checked ~ .nav-toggle-label .nav-toggle-icon::after  { transform: rotate(-45deg); }

  /* keyboard focus on the visually-hidden checkbox highlights the icon */
  .nav-toggle:focus-visible ~ .nav-toggle-label {
    outline: 3px solid var(--c-blue);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
  }

  /* full-width dropdown panel under the bar */
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    inset-inline: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: rgba(11, 13, 16, 0.97);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: var(--space-4) var(--space-5) var(--space-5);
  }
  .nav-toggle:checked ~ .nav-links { display: flex; }
  .nav-links li { width: 100%; }
  .nav-links a {
    display: block;
    padding: var(--space-4) var(--space-2);
    text-align: center;
  }
  .nav-links a.nav-cta { margin-top: var(--space-3); }
}

/* ---- 6. Buttons (visual-spec §5.2) ---- */
.btn-primary {
  display: inline-block;
  font: 700 1rem/1 var(--font-body);
  letter-spacing: 0.01em;
  text-decoration: none;
  color: var(--c-btn-text);
  background: var(--c-yellow);
  padding: 0.875rem 2rem;
  border: none;
  border-radius: var(--radius-pill);
  box-shadow: 0 2px 8px rgba(239, 182, 63, 0.35);
  transition: transform 150ms ease, background 150ms ease, box-shadow 150ms ease;
}
.btn-primary:hover {
  background: #F7C45D;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(239, 182, 63, 0.45);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary:focus-visible { outline: 3px solid var(--c-blue); outline-offset: 3px; }

/* Ghost variant on dark (hero secondary "Our Story").
   The spec's ghost variant is scoped to light sections; on the black hero the
   same shape is used with white border/text for AA contrast. */
.btn-ghost-dark {
  display: inline-block;
  font: 700 1rem/1 var(--font-body);
  letter-spacing: 0.01em;
  text-decoration: none;
  color: var(--c-text-dark-bg);
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.7);
  padding: calc(0.875rem - 2px) 2rem;
  border-radius: var(--radius-pill);
  transition: background 150ms ease, color 150ms ease, transform 150ms ease;
}
.btn-ghost-dark:hover {
  background: var(--c-text-dark-bg);
  color: var(--c-btn-text);
  transform: translateY(-2px);
}
.btn-ghost-dark:active { transform: translateY(0); }

.btn-lg { padding: 1rem 2.5rem; }

/* ---- 7. Hero (visual-spec §7.1; structure §4) ---- */
.hero {
  /* Vienna concert photo under a dark overlay: keeps white text at AA contrast
     and stays dark enough that the logo's screen-blend hides its black box.
     background-color is the fallback while the photo loads. */
  background-color: var(--c-black);
  background-image:
    radial-gradient(circle at 0% 0%, rgba(56, 126, 192, 0.12), transparent 60%),
    radial-gradient(circle at 100% 100%, rgba(232, 93, 107, 0.10), transparent 60%),
    linear-gradient(rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.62) 45%, rgba(0, 0, 0, 0.84)),
    url("../assets/tpcc-concert-vienna.jpg");
  background-size: auto, auto, auto, cover;
  background-position: center;
  background-repeat: no-repeat;
  color: var(--c-text-dark-bg);
  min-height: 85vh;
  padding-block: 7rem 5rem;
  display: flex;
  align-items: center;
}
.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-5);
  width: 100%;
}
.hero-logo {
  width: 300px;
  max-width: min(451px, 100%);
  height: auto;
}
.hero-title {
  font-size: clamp(2.25rem, 5vw + 1rem, 3.5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--c-text-dark-bg);
}
.accent-yellow { color: var(--c-yellow); }
.hero-tagline {
  font-size: 1.25rem;
  line-height: 1.5;
  color: var(--c-text-dark-mut);
  margin: 0;
}

.fact-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-3);
}
.fact-strip li {
  font: 600 0.875rem/1.5 var(--font-body);
  letter-spacing: 0.02em;
  color: var(--c-text-dark-mut);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius-pill);
  padding: var(--space-2) var(--space-4);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-4);
}

.scroll-cue {
  font-size: 2rem;
  line-height: 1;
  color: var(--c-text-dark-mut);
  text-decoration: none;
}
.scroll-cue:hover { color: var(--c-yellow); }

/* ---- 8. Sections shared ---- */
.section { padding-block: var(--space-9); }

.section h2 {
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--c-text-light-bg);
}
.accent-bar {
  width: 48px;
  height: 4px;
  border-radius: var(--radius-pill);
  margin-block: var(--space-3) var(--space-5);
}
.accent-bar-blue { background: var(--c-blue); }
.accent-bar-teal { background: var(--c-teal); }

/* ---- 9. Choir History (visual-spec §7.2; structure §5) ---- */
.section-history { background: var(--c-cream); }

.callout {
  margin-top: var(--space-5);
  background: var(--c-white);
  border: 1px solid var(--c-border-light);
  border-left: 4px solid var(--c-blue);
  border-radius: var(--radius-sm);
  padding: var(--space-4) var(--space-5);
  font-weight: 600;
}
.callout a { color: var(--c-blue-deep); }

.pull-quote {
  margin: var(--space-7) auto 0;
  max-width: var(--prose-max);
  text-align: center;
}
.pull-quote p {
  font: 600 1.375rem/1.5 var(--font-display);
  color: var(--c-blue-deep);
  margin: 0;
}

/* Stat highlight cards (visual-spec §5.3) */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
  margin-top: var(--space-7);
}
.stat-card {
  background: var(--c-white);
  border: 1px solid var(--c-border-light);
  border-radius: var(--radius-md);
  padding: var(--space-6) var(--space-5);
  text-align: center;
  box-shadow: 0 1px 3px rgba(35, 39, 46, 0.06);
  transition: transform 200ms ease, box-shadow 200ms ease;
  overflow: hidden;
  position: relative;
}
.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}
.stat-card-blue::before  { background: var(--c-blue); }
.stat-card-coral::before { background: var(--c-coral); }
.stat-card-teal::before  { background: var(--c-teal); }
.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(35, 39, 46, 0.10);
}
.stat-number {
  display: block;
  font: 700 2.75rem/1 var(--font-display);
  color: var(--c-text-light-bg);
}
.stat-label {
  display: block;
  font: 600 0.875rem/1.5 var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-text-light-mut);
  margin-top: var(--space-2);
}

/* ---- 10. Our Conductor (visual-spec §5.5, §7.3; structure §6) ---- */
.section-conductor { background: var(--c-white); }

.conductor-subtitle {
  font: 600 1.375rem/1.3 var(--font-display);
  color: var(--c-teal-deep);
  margin: 0 0 var(--space-5);
}

.conductor-layout {
  display: flex;
  align-items: flex-start;
  gap: var(--space-7);
  margin-top: var(--space-5);
}
.conductor-photo {
  flex: 0 0 360px;
  margin: 0;
}
.conductor-photo img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 24px rgba(35, 39, 46, 0.14);
}

.photo-feature { margin: var(--space-6) 0 0; }
.photo-feature img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 24px rgba(35, 39, 46, 0.14);
}

.conductor-photo figcaption,
.photo-feature figcaption {
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--c-text-light-mut);
  text-align: center;
  margin-top: var(--space-3);
}

.conductor-prose h3 { color: var(--c-text-light-bg); }

.quote-card {
  margin: var(--space-5) 0;
  background: var(--c-cream);
  border: 1px solid var(--c-border-light);
  border-left: 4px solid var(--c-coral);
  border-radius: var(--radius-md);
  padding: var(--space-5) var(--space-6);
}
.quote-card p {
  font: 600 1.25rem/1.4 var(--font-display);
  color: var(--c-coral-deep);
  margin: 0;
}

/* ---- 11. Auditions CTA band (visual-spec §7.4; structure §7) ---- */
.section-auditions {
  position: relative;
  background: var(--c-band);
  color: var(--c-text-dark-bg);
  padding-block: var(--space-8);
  text-align: center;
}
.section-auditions::before {
  content: "";
  position: absolute;
  top: 0;
  inset-inline: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--c-blue), var(--c-teal), var(--c-yellow), var(--c-coral));
}
.section-auditions h2 { color: #FFFFFF; }
.auditions-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-5);
}
.auditions-copy {
  color: var(--c-text-dark-mut);
  max-width: var(--prose-max);
  margin: 0;
}
.auditions-fallback {
  font-size: 0.875rem;
  color: var(--c-text-dark-mut);
  margin: 0;
}
.auditions-fallback a { color: var(--c-text-dark-bg); }
.auditions-fallback a:hover { color: var(--c-yellow); }

/* ---- 12. Footer (visual-spec §5.6; structure §8) ---- */
.site-footer {
  position: relative;
  background: var(--c-ink-dark);
  color: var(--c-text-dark-mut);
  font-size: 0.875rem;
  padding-block: var(--space-8);
}
.site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  inset-inline: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--c-blue), var(--c-teal), var(--c-yellow), var(--c-coral));
}
.footer-inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}
.footer-logo { width: 96px; height: auto; flex: none; }
.footer-name {
  font: 600 1.125rem/1.3 var(--font-display);
  color: #FFFFFF;
  margin: 0;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
}
.site-footer a {
  color: var(--c-text-dark-mut);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.site-footer a:hover { color: var(--c-yellow); }
.footer-contact { margin: 0; }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.footer-copyright { margin: 0; }

/* ---- 13. Responsive (breakpoints: 640px type/cards, 768px nav/columns) ---- */
@media (max-width: 767.98px) {
  .conductor-layout {
    flex-direction: column;
    align-items: center;
  }
  .conductor-photo {
    flex: none;
    width: 100%;
    max-width: 420px;
  }
  .footer-bottom { justify-content: center; text-align: center; }
}

@media (max-width: 639.98px) {
  .section { padding-block: var(--space-7); }
  .hero { padding-block: 6rem 3rem; }
  .hero-logo { width: 210px; }
  .hero-tagline { font-size: 1.125rem; }
  .section h2 { font-size: 1.75rem; }
  .prose h3 { font-size: 1.25rem; }
  .stat-grid { grid-template-columns: 1fr; }
  .stat-number { font-size: 2.25rem; }
  .fact-strip { flex-direction: column; align-items: center; }
  .hero-actions { flex-direction: column; align-items: stretch; width: 100%; max-width: 20rem; }
  .hero-actions .btn-primary, .hero-actions .btn-ghost-dark { text-align: center; }
  .conductor-layout { gap: var(--space-5); }
}

/* ---- 14. JS enhancements (js/main.js) ----
   Everything here is inert without JavaScript: .is-active and .reveal are
   only ever added by js/main.js, and the .reveal hidden start is gated on
   the html.js class the script sets — content is never hidden without JS. */

/* Scroll-spy active nav link — yellow underline, matching the hover state */
.nav-links a.is-active {
  color: var(--c-yellow);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

/* Scroll-reveal — fade/rise-in; motion-gated in addition to the JS check */
@media (prefers-reduced-motion: no-preference) {
  html.js .reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 550ms ease, transform 550ms ease;
  }
  html.js .reveal.is-revealed {
    opacity: 1;
    transform: none;
  }
}

/* ---- 15. Reduced motion (visual-spec §6) ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  /* scroll cue is static (not animated), so it may remain visible */
}
