:root {
  --navy: #16304f;        /* page ground, pulled from the banner */
  --navy-deep: #10243c;   /* footer, input wells */
  --navy-line: #2d4a70;   /* rules and borders */
  --mist: #edf1f6;        /* primary text */
  --haze: #a8b8cd;        /* secondary text */
  --gold: #efc15c;        /* nav, links, buttons — the banner's yellow */
  --gold-bright: #f7d98f;

  --serif: "Cormorant", "Cormorant Garamond", Georgia, serif;
  --sans: "Instrument Sans", system-ui, -apple-system, sans-serif;

  --gutter: clamp(1rem, 4vw, 3rem);
  --max: 72rem;
  --section-space: clamp(4.5rem, 10vw, 8rem);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem; /* keep anchored sections clear of the fixed nav */
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--navy);
  color: var(--mist);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Film grain over the whole page so everything shares the banner's texture */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: 0.09;
  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.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

a {
  color: inherit;
}

p,
h1,
h2,
h3,
h4 {
  margin: 0;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

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

/* ---------- Hero ---------- */

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: min(92vh, 52rem);
  background: var(--navy) url("/assets/sideseries_banner.jpg") center / cover no-repeat;
}

/* Let the banner dissolve into the page instead of ending in a hard edge */
.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 45%;
  background: linear-gradient(to bottom, rgba(22, 48, 79, 0), var(--navy));
  pointer-events: none;
}

/* Fixed so the logo and links stay put; gains a backing once the page scrolls */
.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem var(--gutter);
  font-weight: 500;
  transition: background-color 0.3s, padding 0.3s;
}

.nav.is-scrolled {
  padding-block: 0.85rem;
  background: rgba(22, 48, 79, 0.82);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--navy-line);
}

.nav__brand {
  color: var(--gold);
  text-decoration: none;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
}

.nav__links {
  display: flex;
  gap: clamp(1.25rem, 4vw, 3rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav__links a {
  color: var(--gold);
  text-decoration: none;
  text-underline-offset: 0.3em;
}

.nav__links a:hover {
  text-decoration: underline;
}

.hero__inner {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 6rem var(--gutter) 6rem;
  text-align: center;
}

.hero__title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(4.5rem, 17vw, 12rem);
  line-height: 0.9;
  letter-spacing: -0.03em;
  text-shadow: 0 0.04em 0.4em rgba(16, 36, 60, 0.35);
  animation: focus-in 1.6s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.hero__tagline {
  max-width: 34rem;
  margin-top: 1.5rem;
  font-family: var(--serif);
  font-size: clamp(1.2rem, 2.4vw, 1.55rem);
  line-height: 1.35;
  animation: focus-in 1.6s 0.35s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

/* The page's one motion moment: the wordmark pulls into focus out of the blur */
@keyframes focus-in {
  from {
    opacity: 0;
    filter: blur(14px);
  }
  to {
    opacity: 1;
    filter: blur(0);
  }
}

/* ---------- Shared section layout ---------- */

main > section {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem 3rem;
  max-width: var(--max);
  margin: 0 auto;
  padding: var(--section-space) var(--gutter) 0;
}

.section-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.5rem, 6vw, 3.75rem);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--mist);
}

@media (min-width: 52rem) {
  main > section {
    grid-template-columns: 14rem minmax(0, 1fr);
  }

  main > section > .section-title {
    grid-column: 1;
  }

  main > section > :not(.section-title) {
    grid-column: 2;
  }
}

/* ---------- Events ---------- */

.events {
  padding-top: clamp(2rem, 5vw, 3rem);
}

.event {
  display: grid;
  gap: 1.25rem 2.5rem;
  align-items: center;
}

.event__image {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 14px;
}

.event__date {
  color: var(--gold);
  font-weight: 500;
}

.event__name {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.event__place {
  color: var(--haze);
}

.event--upcoming {
  grid-template-columns: minmax(0, 1fr);
  margin-bottom: clamp(3rem, 7vw, 5rem);
}

.event--upcoming .event__image {
  max-width: 22rem;
}

.event--upcoming .event__name {
  margin: 0.35rem 0 0.25rem;
  font-size: clamp(2rem, 4.5vw, 2.9rem);
}

.event--upcoming .button {
  margin-top: 1.75rem;
}

@media (min-width: 40rem) {
  .event--upcoming {
    grid-template-columns: minmax(12rem, 22rem) minmax(0, 1fr);
  }
}

.past {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--navy-line);
}

.past > li {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--navy-line);
}

.event--past {
  grid-template-columns: 5.5rem minmax(0, 1fr);
  gap: 1.5rem;
}

.event--past .event__image {
  border-radius: 10px;
  opacity: 0.85;
}

.event--past .event__name {
  font-size: 1.6rem;
}

.event--past .event__date {
  font-size: 0.9rem;
}

.event--past .event__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 1.5rem;
  align-items: baseline;
}

.event--past .event__body > * {
  grid-column: 1;
}

.event--past .text-link {
  grid-column: 2;
  grid-row: 1 / span 3;
  align-self: center;
}

@media (max-width: 30rem) {
  .event--past .event__body {
    grid-template-columns: minmax(0, 1fr);
  }

  .event--past .text-link {
    grid-column: 1;
    grid-row: auto;
    margin-top: 0.5rem;
  }
}

/* ---------- Buttons & links ---------- */

.button {
  display: inline-block;
  padding: 0.8rem 1.6rem;
  border: 0;
  border-radius: 999px;
  background: var(--gold);
  color: var(--navy-deep);
  font: 600 1rem/1.2 var(--sans);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s;
}

.button:hover {
  background: var(--gold-bright);
}

.button:disabled {
  opacity: 0.6;
  cursor: progress;
}

.text-link {
  color: var(--gold);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
}

.text-link:hover {
  color: var(--gold-bright);
}

/* ---------- About ---------- */

.about__text {
  max-width: 40rem;
  font-family: var(--serif);
  font-size: clamp(1.3rem, 2.2vw, 1.5rem);
  line-height: 1.5;
  color: var(--haze);
}

.about__text > p + p {
  margin-top: 1.4em;
}

.about__lede {
  color: var(--mist);
}

.about__statement {
  font-size: clamp(1.75rem, 3.6vw, 2.35rem);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--mist);
}

/* ---------- Contact ---------- */

.contact__intro {
  max-width: 34rem;
  color: var(--haze);
  font-size: 1.1rem;
}

.form {
  display: grid;
  gap: 1.25rem;
  max-width: 40rem;
}

.form__row {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 36rem) {
  .form__row {
    grid-template-columns: 1fr 1fr;
  }
}

.field {
  display: grid;
  gap: 0.4rem;
}

.field__label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--haze);
}

.field input,
.field textarea {
  width: 100%;
  padding: 0.8rem 0.95rem;
  border: 1px solid var(--navy-line);
  border-radius: 6px;
  background: var(--navy-deep);
  color: var(--mist);
  font: inherit;
  transition: border-color 0.2s;
}

.field textarea {
  resize: vertical;
  min-height: 8rem;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--gold);
}

.field input[aria-invalid="true"],
.field textarea[aria-invalid="true"] {
  border-color: #f2917a;
}

.form__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  margin-top: 0.25rem;
}

.form__status {
  color: var(--haze);
}

.form__status[data-state="success"] {
  color: var(--gold);
}

.form__status[data-state="error"] {
  color: #f2917a;
}

/* ---------- Footer ---------- */

.footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--max);
  margin: var(--section-space) auto 0;
  padding: 2rem var(--gutter) 2.5rem;
  border-top: 1px solid var(--navy-line);
  color: var(--haze);
  font-size: 0.9rem;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
