/* ————— The Unmarked Door ————— */

:root {
  --ink: #0d0b08;          /* near-black, warm */
  --panel: #15120d;
  --panel-2: #1c1811;
  --ivory: #ece4d3;
  --ivory-dim: #c8bda6;
  --brass: #b4924c;
  --brass-bright: #d3b26c;
  --hairline: rgba(211, 178, 108, 0.25);
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Jost', 'Segoe UI', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; overflow-x: clip; }

body {
  background: var(--ink);
  color: var(--ivory);
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 400;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--brass); color: var(--ink); }

/* ————— the night sky: starfield + faint nebula instead of pitch black ————— */
body::before,
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
body::before {
  background-image:
    radial-gradient(ellipse 60vw 45vh at 78% 12%, rgba(64, 54, 110, 0.3), transparent 70%),
    radial-gradient(ellipse 50vw 42vh at 12% 78%, rgba(97, 60, 106, 0.2), transparent 70%),
    radial-gradient(ellipse 40vw 30vh at 45% 45%, rgba(46, 52, 96, 0.16), transparent 70%),
    radial-gradient(1.2px 1.2px at 22px 34px, rgba(240, 232, 214, 0.5) 50%, transparent 51%),
    radial-gradient(1px 1px at 130px 92px, rgba(240, 232, 214, 0.36) 50%, transparent 51%),
    radial-gradient(1px 1px at 202px 158px, rgba(240, 232, 214, 0.44) 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 82px 212px, rgba(240, 232, 214, 0.3) 50%, transparent 51%),
    radial-gradient(1px 1px at 172px 42px, rgba(240, 232, 214, 0.26) 50%, transparent 51%),
    radial-gradient(1px 1px at 48px 148px, rgba(240, 232, 214, 0.34) 50%, transparent 51%);
  background-size:
    100% 100%, 100% 100%, 100% 100%,
    260px 260px, 260px 260px, 260px 260px, 260px 260px, 260px 260px, 260px 260px;
}
body::after {
  background-image:
    radial-gradient(1.8px 1.8px at 62px 118px, rgba(255, 238, 200, 0.7) 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 300px 62px, rgba(240, 232, 214, 0.55) 50%, transparent 51%),
    radial-gradient(2px 2px at 198px 278px, rgba(255, 238, 200, 0.5) 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 382px 198px, rgba(240, 232, 214, 0.48) 50%, transparent 51%);
  background-size: 440px 340px;
  animation: twinkle 6.5s ease-in-out infinite alternate;
}
@keyframes twinkle {
  from { opacity: 1; }
  to { opacity: 0.4; }
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: 0.01em;
}

a { color: var(--brass-bright); text-decoration: none; }
a:hover { color: var(--ivory); }

.muted { color: var(--ivory-dim); }

.eyebrow {
  font-family: var(--sans);
  font-weight: 300;
  font-size: 0.72rem;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 1.4rem;
}

.rule {
  width: 56px;
  height: 1px;
  background: var(--brass);
  margin: 2rem auto;
}

/* ————— nav ————— */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 2.4rem;
  transition: background 0.5s ease, box-shadow 0.5s ease;
}
.nav.scrolled {
  background: rgba(13, 11, 8, 0.88);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 var(--hairline);
}
.nav-mark {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--serif);
  font-size: 1.05rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ivory);
}
.nav-logo {
  height: 40px;
  width: auto;
  display: block;
}
.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
  font-family: var(--sans);
  font-weight: 300;
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.nav-links a { color: var(--ivory-dim); }
.nav-links a:hover { color: var(--ivory); }
.nav-cta {
  border: 1px solid var(--brass);
  padding: 0.55em 1.3em;
  color: var(--brass-bright) !important;
  transition: background 0.3s, color 0.3s;
}
.nav-cta:hover { background: var(--brass); color: var(--ink) !important; }

/* ————— hero ————— */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}
.hero-image {
  position: absolute;
  inset: -18% 0;
  background: var(--panel) url('https://images.unsplash.com/photo-1414235077428-338989a2e8c0?q=80&w=2000&auto=format&fit=crop') center / cover no-repeat;
  will-change: transform;
}
.hero-veil {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at center, rgba(13,11,8,0.45) 0%, rgba(13,11,8,0.88) 78%),
    linear-gradient(to bottom, rgba(13,11,8,0.55), rgba(13,11,8,0.4) 45%, rgba(13,11,8,0.82) 82%, var(--ink) 98%);
}
.hero-inner {
  position: relative;
  z-index: 2;
  padding: 6rem 1.5rem 10rem; /* bottom clearance keeps the scroll cue off the subtitle */
}
/* hero elements fade in place — sliding reveals can overlap each other mid-animation */
.hero .reveal { transform: none; }
.hero-title {
  font-size: clamp(3.4rem, 9vw, 7.5rem);
  font-weight: 300;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.75);
}
.hero-sub {
  font-family: var(--sans);
  font-weight: 300;
  font-size: clamp(0.92rem, 1.4vw, 1.1rem);
  letter-spacing: 0.06em;
  line-height: 1.9;
  color: #cfc5ae;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.95), 0 2px 18px rgba(0, 0, 0, 0.8);
}
.scroll-cue {
  position: absolute;
  bottom: 2.2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--sans);
  font-weight: 300;
  font-size: 0.68rem;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--ivory-dim);
}
.scroll-line {
  width: 1px;
  height: 52px;
  background: linear-gradient(var(--brass), transparent);
  animation: drip 2.4s ease-in-out infinite;
}
@keyframes drip {
  0% { transform: scaleY(0); transform-origin: top; }
  55% { transform: scaleY(1); transform-origin: top; }
  100% { transform: scaleY(1); opacity: 0; }
}

/* ————— chapters ————— */
.chapter {
  padding: 9rem 2.4rem;
  max-width: 1180px;
  margin: 0 auto;
}
.chapter h2 {
  font-size: clamp(2.1rem, 4.4vw, 3.4rem);
  margin-bottom: 1.6rem;
}
.chapter p { color: var(--ivory-dim); max-width: 60ch; }
.chapter p + p { margin-top: 1.1rem; }

.chapter-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 4.5rem;
  align-items: center;
}
.chapter-figure img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  display: block;
  filter: saturate(0.82) contrast(1.04) brightness(0.92);
  border: 1px solid var(--hairline);
  padding: 0.6rem;
  background: var(--panel);
}
figcaption {
  font-family: var(--sans);
  font-weight: 300;
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ivory-dim);
  margin-top: 1rem;
  text-align: center;
}

.chapter-head { text-align: center; margin-bottom: 4rem; }
.chapter-head p, .chapter-head .chapter-lede { margin: 0 auto; }
.chapter-lede {
  font-family: var(--sans);
  font-weight: 300;
  font-style: normal;
  font-size: 1.02rem;
  letter-spacing: 0.04em;
  line-height: 1.85;
}

/* ————— full-bleed interludes ————— */
.fullbleed {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}
.fullbleed.short { min-height: 78vh; }
/* pinned-window parallax: with background-attachment fixed the photo is
   sized and pinned to the viewport, so the section scrolls over it like
   a window revealing a still scene. */
.fullbleed-image {
  position: absolute;
  inset: 0;
  background-color: var(--panel);
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  filter: saturate(0.8) brightness(0.85);
}
/* touch browsers handle fixed attachment poorly — let it scroll there */
@media (pointer: coarse) {
  .fullbleed-image { background-attachment: scroll; }
}
.fullbleed-veil {
  position: absolute;
  inset: -1px 0; /* overlap the section edge so no seam can peek through */
  background:
    radial-gradient(ellipse at center, rgba(13,11,8,0.5) 0%, rgba(13,11,8,0.9) 82%),
    linear-gradient(to bottom, var(--ink), transparent 22%, transparent 78%, var(--ink));
}
.fullbleed-inner {
  position: relative;
  z-index: 2;
  max-width: 760px;
  padding: 6rem 1.6rem;
}
.fullbleed-inner h2 { font-size: clamp(2.2rem, 4.6vw, 3.6rem); margin-bottom: 1.6rem; }
.fullbleed-inner p { color: var(--ivory-dim); }

/* ————— courses ————— */
.course-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.2rem;
}
.course img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
  filter: saturate(0.85) contrast(1.05) brightness(0.94);
  border: 1px solid var(--hairline);
  padding: 0.5rem;
  background: var(--panel);
  transition: transform 0.7s ease, filter 0.7s ease;
}
.course:hover img { transform: scale(1.015); filter: saturate(1) brightness(1); }
.course figcaption em { font-family: var(--serif); font-style: italic; color: var(--brass-bright); letter-spacing: 0.06em; }

/* ————— fullscreen course gallery: one photo at a time, zoom in & out ————— */
.gallery {
  /* full-bleed escape from the .chapter column */
  width: 100vw;
  margin-left: calc(50% - 50vw);
  height: 340vh; /* scroll track: ~1 viewport per slide + runway */
}
.gallery-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  /* transparent so the starfield glimmers through during slide fades */
}
.gallery-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  will-change: opacity;
}
.gallery-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.95) brightness(0.98);
  will-change: transform;
}
.gallery-slide::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(13, 11, 8, 0.85), transparent 42%),
    linear-gradient(to bottom, rgba(13, 11, 8, 0.55), transparent 24%);
  pointer-events: none;
}
.gallery-slide figcaption {
  position: absolute;
  z-index: 2;
  left: 1.5rem;
  right: 1.5rem;
  bottom: 9vh;
  text-align: center;
  margin: 0;
}
.gallery-slide figcaption em {
  display: block;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 400;
  color: #f2ead8;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.9);
  line-height: 1.15;
}
.gallery-slide figcaption span {
  display: block;
  margin-top: 0.9rem;
  font-family: var(--sans);
  font-weight: 300;
  font-size: clamp(0.82rem, 1.3vw, 1.05rem);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: #dcd2b8;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.95);
}

.menu-tease {
  max-width: 620px;
  margin: 4.5rem auto 0;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  padding: 2.4rem 0;
}
.menu-line {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.55rem 0;
  font-size: 1.08rem;
}
.menu-line span:first-child {
  font-family: var(--sans);
  font-weight: 300;
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--brass);
  min-width: 5.5rem;
}
.menu-line span:last-child { font-style: italic; color: var(--ivory-dim); }
.menu-dots { flex: 1; border-bottom: 1px dotted rgba(211, 178, 108, 0.3); }

/* ————— seatings ————— */
.seating-list {
  display: grid;
  gap: 1px;
  background: var(--hairline);
  border: 1px solid var(--hairline);
  max-width: 820px;
  margin: 0 auto;
}
.seating-row {
  display: grid;
  grid-template-columns: 150px 1fr auto;
  gap: 2rem;
  align-items: center;
  padding: 1.7rem 2.2rem;
  background: var(--panel);
  transition: background 0.35s;
}
.seating-row:hover { background: var(--panel-2); }
.seating-date {
  font-family: var(--serif);
  font-size: 1.35rem;
  color: var(--ivory);
  line-height: 1.25;
}
.seating-date small {
  display: block;
  font-family: var(--sans);
  font-weight: 300;
  font-size: 0.68rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--brass);
  margin-top: 0.3rem;
}
.seating-title { font-style: italic; color: var(--ivory-dim); font-size: 1.15rem; }
.seating-seats {
  font-family: var(--sans);
  font-weight: 300;
  font-size: 0.72rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--brass-bright);
  white-space: nowrap;
}
.seating-seats.full { color: var(--ivory-dim); text-decoration: line-through; }

/* ————— form ————— */
.invitation { padding-bottom: 10rem; }
.apply-form { max-width: 720px; margin: 0 auto; }
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.6rem;
  margin-bottom: 1.6rem;
}
.form-row.three { grid-template-columns: 1fr 1fr 1fr; }
.form-row > label { min-width: 0; } /* let selects with long option text shrink to their column */
label {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  font-family: var(--sans);
  font-weight: 300;
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--brass);
}
label.full { margin-bottom: 2rem; }
input, select, textarea {
  font-family: var(--serif);
  font-size: 1.1rem;
  color: var(--ivory);
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(211, 178, 108, 0.35);
  padding: 0.6rem 0.1rem;
  outline: none;
  transition: border-color 0.3s;
  border-radius: 0;
}
select { appearance: none; cursor: pointer; width: 100%; text-overflow: ellipsis; }
select option { background: var(--panel); color: var(--ivory); }
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: rgba(185, 174, 151, 0.5); font-style: italic; }
input:focus, select:focus, textarea:focus { border-bottom-color: var(--brass-bright); }

.btn {
  display: block;
  margin: 0 auto;
  font-family: var(--sans);
  font-weight: 300;
  font-size: 0.78rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--brass-bright);
  background: transparent;
  border: 1px solid var(--brass);
  padding: 1.1em 3.2em;
  cursor: pointer;
  transition: background 0.35s, color 0.35s;
}
.btn:hover { background: var(--brass); color: var(--ink); }
.btn:disabled { opacity: 0.45; cursor: wait; }

.form-status {
  text-align: center;
  margin-top: 1.6rem;
  font-style: italic;
  color: var(--ivory-dim);
  min-height: 1.6em;
}
.form-status.ok { color: var(--brass-bright); }
.form-status.error { color: #c98a7d; }

/* ————— footer ————— */
.footer {
  border-top: 1px solid var(--hairline);
  text-align: center;
  padding: 4rem 1.5rem 4.5rem;
  color: var(--ivory-dim);
  font-size: 1rem;
}
.footer-mark { font-size: 1.6rem; color: var(--brass); margin-bottom: 1rem; }

/* ————— reveal animation ————— */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 1.1s cubic-bezier(0.16, 1, 0.3, 1), transform 1.1s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.visible { opacity: 1; transform: none; }
/* parallax owns the transform on these — reveal them by fade alone */
.reveal[data-parallax-soft] { transform: none; transition: opacity 1.1s cubic-bezier(0.16, 1, 0.3, 1); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .scroll-line { animation: none; }
  .fullbleed-image { background-attachment: scroll; } /* unpin the parallax windows */
  body::after { animation: none; } /* still stars, no twinkle */
}

/* ————— responsive ————— */
@media (max-width: 880px) {
  .nav { padding: 1rem 1.2rem; }
  .nav-links { gap: 1.1rem; }
  .nav-links a:not(.nav-cta) { display: none; }
  .chapter { padding: 6rem 1.4rem; }
  .chapter-grid { grid-template-columns: 1fr; gap: 3rem; }
  .course-grid { grid-template-columns: 1fr; max-width: 420px; margin: 0 auto; }
  .form-row, .form-row.three { grid-template-columns: 1fr; }
  .form-row .spacer { display: none; }
  .seating-row { grid-template-columns: 1fr; gap: 0.6rem; padding: 1.4rem 1.4rem; }
}
