/* =========================================================
   Courtville Academy — main stylesheet
   Edit the variables below to adjust colours, spacing, timing.
   ========================================================= */

:root {
  --ink: #111111;
  --ink-soft: #444444;
  --muted: #888888;
  --line: #eeeeee;
  --paper: #ffffff;
  --nav-bg: #0a0a0a;

  --nav-width: 84px;      /* width of floating side bar */
  --nav-gap: 16px;        /* space between bar and window edge */

  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);   /* soft "settle" curve used everywhere */
}

/* --- Reset & base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.8;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  animation: pageIn 0.9s var(--ease) both;
}

/* Fade the whole page out when leaving (added by JS) */
body.is-leaving { opacity: 0; transition: opacity 0.45s ease; }

@keyframes pageIn { from { opacity: 0; } to { opacity: 1; } }

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

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 400;
  color: #000;
  letter-spacing: 0.04em;
}

p { color: var(--ink-soft); margin-bottom: 1.25rem; }

a { color: inherit; text-decoration: none; }

:focus-visible { outline: 1px solid var(--ink); outline-offset: 4px; }

/* --- Buttons --- */
.btn {
  display: inline-block;
  padding: 15px 34px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  transition: background-color 0.35s var(--ease), color 0.35s var(--ease), transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
  cursor: pointer;
}

.btn-primary { background: #000; color: #fff; border: 1px solid #000; }
.btn-primary:hover { background: #2a2a2a; transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0,0,0,0.18); }

.btn-outline { position: relative; isolation: isolate; overflow: hidden; background: transparent; color: #000; border: 1px solid #000; }
.btn-outline::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: #000;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.6s var(--ease);
}
.btn-outline:hover { color: #fff; transform: translateY(-2px); }
.btn-outline:hover::before { transform: scaleX(1); transform-origin: left; }

/* --- Section headers --- */
.section-header { text-align: center; margin-bottom: 4rem; }

.section-label {
  display: block;
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.section-title {
  font-size: clamp(1.8rem, 3.2vw, 2.4rem);
  letter-spacing: 0.08em;
  font-weight: 300;
  text-transform: uppercase;
}

/* =========================================================
   1. Floating side navigation
   ========================================================= */
.side-nav {
  position: fixed;
  top: var(--nav-gap);
  left: var(--nav-gap);
  bottom: var(--nav-gap);
  width: var(--nav-width);
  background: var(--nav-bg);
  color: #fff;
  z-index: 1000;
  border-radius: 18px;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.06) inset,
    0 24px 48px -12px rgba(0,0,0,0.35),
    0 8px 16px -8px rgba(0,0,0,0.25);
  transition: transform 0.5s var(--ease);
}

.side-nav-inner {
  height: 100%;
  padding: 28px 16px 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
}

.side-monogram {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 24px;
  line-height: 1;
  color: #fff;
  transition: background-color 0.3s ease, color 0.3s ease;
}
.side-brand:hover .side-monogram { background: #fff; color: #000; }

.side-menu {
  display: flex;
  flex-direction: column;
  gap: 34px;
  align-items: center;
}

.side-menu a {
  position: relative;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #8a8a8a;
  transition: color 0.3s ease;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
}

.side-menu a .nav-num { font-size: 9px; letter-spacing: 0.1em; color: #555; transition: color 0.3s ease; }

/* active-section marker: thin line beside the label */
.side-menu a::after {
  content: "";
  position: absolute;
  right: -12px;            /* appears on the left once rotated */
  top: 0;
  width: 1px;
  height: 100%;
  background: #fff;
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.5s var(--ease);
}

.side-menu a:hover,
.side-menu a.is-active { color: #fff; }
.side-menu a.is-active .nav-num { color: #bbb; }
.side-menu a.is-active::after { transform: scaleY(1); }

.side-footer-cta { writing-mode: vertical-rl; transform: rotate(180deg); }

.side-btn {
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #fff;
  border-left: 1px solid #fff;
  padding-left: 6px;
  transition: opacity 0.25s ease;
}
.side-btn:hover { opacity: 0.6; }
.side-btn.is-current { opacity: 0.55; }

/* Page canvas sits to the right of the floating bar */
.page-canvas {
  margin-left: calc(var(--nav-width) + var(--nav-gap) * 2);
  min-width: 0;
}

/* =========================================================
   2. Hero
   ========================================================= */
.hero {
  max-width: 1280px;
  margin: 0 auto;
  padding: 90px 48px 110px;
  border-bottom: 1px solid var(--line);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: 80px;
  align-items: center;
}

/* Logo, text and button are centred in the left column */
.hero-left {
  max-width: 520px;
  width: 100%;
  justify-self: center;
  text-align: center;
}

.hero-logo-img {
  width: 100%;
  max-width: 440px;
  height: auto;
  margin: 0 auto 2.6rem;
}

.hero-blurb {
  font-size: 14px;
  line-height: 1.95;
  color: #555;
  max-width: 430px;
  margin: 0 auto 2.6rem;
}

.hero-right { display: flex; justify-content: center; }

/* Four separate tiles in a 2 × 2 grid */
.hero-tiles {
  width: 100%;
  max-width: 500px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* tiles waiting off their slots must never widen the page */
.hero { overflow-x: hidden; overflow-x: clip; }

/* Each slot is the fixed space; the tile inside slides into it */
.hero-slot {
  aspect-ratio: 272 / 376;
  background: #f5f3ef;                 /* faint "empty slot" before the tile lands */
  transition: background-color 1.2s ease 0.6s;
}
.hero-tiles.is-in .hero-slot { background-color: #fff; }

.hero-tile {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #fff;                    /* tiles fade into white */
  /* very soft outline so the edges look faded, not hard */
  box-shadow: 0 0 0 1px rgba(0,0,0,0.03), 0 14px 34px -26px rgba(0,0,0,0.22);
  transition:
    transform 1.6s var(--ease),
    opacity 1.2s ease,
    box-shadow 3.2s ease-in-out;
}

/* Slot-in: before arriving, each tile waits slightly off its slot */
.js .hero-tile { opacity: 0; }
.js .hero-slot:nth-child(1) .hero-tile { transform: translate(-34px, -26px) rotate(-3deg) scale(0.92); }
.js .hero-slot:nth-child(2) .hero-tile { transform: translate(34px, -26px) rotate(3deg) scale(0.92); }
.js .hero-slot:nth-child(3) .hero-tile { transform: translate(-34px, 26px) rotate(2deg) scale(0.92); }
.js .hero-slot:nth-child(4) .hero-tile { transform: translate(34px, 26px) rotate(-2deg) scale(0.92); }

.js .hero-tiles.is-in .hero-tile { opacity: 1; transform: none; }
.hero-tiles.is-in .hero-slot:nth-child(1) .hero-tile { transition-delay: 0.15s, 0.15s, 0s; }
.hero-tiles.is-in .hero-slot:nth-child(2) .hero-tile { transition-delay: 0.3s, 0.3s, 0s; }
.hero-tiles.is-in .hero-slot:nth-child(3) .hero-tile { transition-delay: 0.45s, 0.45s, 0s; }
.hero-tiles.is-in .hero-slot:nth-child(4) .hero-tile { transition-delay: 0.6s, 0.6s, 0s; }
.hero-tiles.is-settled .hero-slot .hero-tile { transition-delay: 0s; }

.hero-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition:
    opacity 3.2s ease-in-out,          /* must match HERO_TIMING.fade in main.js */
    transform 1.4s var(--ease);
}

/* Hover: a gentle zoom inside the frame */
@media (hover: hover) {
  .hero-tile:hover img { transform: scale(1.06); }
}

/* JS adds this to one tile at a time to fade it out to white, then removes it */
.hero-tile.is-faded { box-shadow: 0 0 0 1px rgba(0,0,0,0), 0 14px 34px -26px rgba(0,0,0,0); }
.hero-tile.is-faded img { opacity: 0; }

/* =========================================================
   3. Courses
   ========================================================= */
.courses {
  max-width: 1280px;
  margin: 0 auto;
  padding: 110px 48px;
  border-bottom: 1px solid var(--line);
}

.courses-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px 36px;
  max-width: 1160px;
  margin: 0 auto;
}

.course-card { display: flex; flex-direction: column; }

.course-link {
  position: relative;
  display: block;
  margin-bottom: 1.8rem;
  -webkit-tap-highlight-color: transparent;
}

.course-circle {
  display: block;
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  background: #000;
  box-shadow: 0 20px 40px -24px rgba(0,0,0,0.5);
  transition: transform 0.7s var(--ease), box-shadow 0.7s var(--ease);
  /* keeps the rounded clip crisp in Safari while scaling */
  -webkit-mask-image: -webkit-radial-gradient(white, black);
}

.course-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1s var(--ease);
}

.course-hint {
  position: absolute;
  left: 50%;
  bottom: 14%;
  transform: translate(-50%, 8px);
  padding: 7px 14px;
  background: rgba(255,255,255,0.92);
  color: #000;
  font-size: 9px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.8s ease, transform 0.9s var(--ease);
  pointer-events: none;
}

/* JS lights up "View course" on each circle in turn (.hint-on) */
.course-link.hint-on .course-hint { opacity: 1; transform: translate(-50%, 0); }

@media (hover: hover) {
  .course-link:hover .course-circle { transform: translateY(-6px); box-shadow: 0 30px 50px -24px rgba(0,0,0,0.55); }
  .course-link:hover .course-circle img { transform: scale(1.08); }
  .course-link:hover .course-hint { opacity: 1; transform: translate(-50%, 0); }
}

/* While one course is opening, the others step back */
.course-card { transition: opacity 0.6s ease, filter 0.6s ease; }
.courses-grid.is-opening .course-card:not(.is-chosen) { opacity: 0.18; filter: grayscale(1); }

.course-header-line {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 0.4rem;
}

.course-idx {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--ink);
}

.course-title {
  font-size: 1.25rem;
  line-height: 1.3;
  color: var(--ink);
  font-weight: 500;
}

.course-title a {
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.5s var(--ease);
}
.course-title a:hover { background-size: 100% 1px; }

.course-desc {
  font-size: 12.5px;
  line-height: 1.65;
  color: #666;
  padding-left: 27px;
}

.course-cta { text-align: center; margin-top: 4.5rem; }

/* Swirl transition (created by JS when a course is clicked):
   the circle spins inward, a fine ring swirls around it,
   then a solid black circle spreads out to fill the screen. */
.swirl-ring {
  position: fixed;
  z-index: 1500;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.7);
  border-top-color: transparent;
  border-left-color: transparent;
  pointer-events: none;
}

.swirl-iris {
  position: fixed;
  z-index: 2000;
  border-radius: 50%;
  background: var(--nav-bg);
  pointer-events: none;
  will-change: transform;
}

.swirl-mark {
  position: fixed;
  z-index: 2001;
  left: 50%;
  top: 50%;
  width: 64px;
  height: 64px;
  margin: -32px 0 0 -32px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 34px;
  line-height: 1;
  color: #fff;
  opacity: 0;
  pointer-events: none;
}

/* =========================================================
   4. About Us — short text over the Drawing Room ceiling
   ========================================================= */
.about-band {
  position: relative;
  display: grid;
  place-items: center;
  min-height: min(82vh, 760px);
  overflow: hidden;
  background: var(--nav-bg);
}
/* the photo is taller than the band so it can drift slowly while you scroll */
.about-band-bg { position: absolute; left: 0; right: 0; top: -14%; bottom: -14%; will-change: transform; }
.about-band-bg img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; }
.about-band::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10,10,10,0.42) 0%, rgba(10,10,10,0.62) 100%);
}
.about-band-inner { position: relative; z-index: 1; max-width: 640px; padding: 120px 32px; text-align: center; }
.about-band .section-label { color: rgba(255,255,255,0.7); }
.about-band .section-title { color: #fff; margin-bottom: 24px; }
.about-band-rule { display: block; width: 44px; height: 1px; background: rgba(255,255,255,0.6); margin: 0 auto 30px; }
.about-band p { color: rgba(255,255,255,0.86); font-size: 15px; line-height: 1.95; }
.about-band-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding-bottom: 6px;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(#fff, #fff) no-repeat 0 100% / 100% 1px;
  transition: background-size 0.6s var(--ease);
}
.about-band-link:hover { background-size: 0 1px; background-position: 100% 100%; }
.about-band-link .arrow { transition: transform 0.5s var(--ease); }
.about-band-link:hover .arrow { transform: translateX(6px); }

/* text link used in the footer and on the Inquire page */
.text-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 6px;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  background-image: linear-gradient(#000, #000);
  background-size: 40px 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.6s var(--ease);
}
.text-link:hover { background-size: 100% 1px; }
.text-link .arrow { transition: transform 0.5s var(--ease); }
.text-link:hover .arrow { transform: translateX(6px); }

/* =========================================================
   5. Footer
   ========================================================= */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 90px 48px 70px;
  text-align: center;
}

.footer-logo { max-height: 56px; width: auto; margin: 0 auto 1.8rem; opacity: 0.9; }

.footer-address {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #777;
  margin-bottom: 0.5rem;
}

.footer-copy { font-size: 10.5px; letter-spacing: 0.12em; color: #aaa; }

/* =========================================================
   Animations (only when JS is running)
   ========================================================= */

/* Standard reveal: rise and fade in, staggered */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1.1s var(--ease), transform 1.3s var(--ease);
  transition-delay: var(--reveal-delay, 0s);
}
.js [data-reveal].is-visible { opacity: 1; transform: none; }

/* Titles slide up from behind an invisible edge */
.js [data-reveal="mask"] { opacity: 1; transform: none; }
.reveal-mask { display: block; overflow: hidden; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.reveal-mask-in { display: block; transform: translateY(105%); transition: transform 1.3s var(--ease); transition-delay: var(--reveal-delay, 0s); }
.is-visible > .reveal-mask > .reveal-mask-in { transform: none; }

/* Small labels draw in from wide letter spacing */
.js .section-label[data-reveal] {
  letter-spacing: 0.7em;
  transition: opacity 1.1s var(--ease), transform 1.3s var(--ease), letter-spacing 1.8s var(--ease);
  transition-delay: var(--reveal-delay, 0s);
}
.js .section-label[data-reveal].is-visible { letter-spacing: 0.3em; }

/* Thin rules draw outwards from the centre */
.js .about-band-rule[data-reveal] { opacity: 1; transform: scaleX(0); transition: transform 1.4s var(--ease); transition-delay: var(--reveal-delay, 0s); }
.js .about-band-rule[data-reveal].is-visible { transform: scaleX(1); }

/* Course photos open up like an iris inside their dark circle */
.js .course-card .course-circle img {
  clip-path: circle(0% at 50% 50%);
  transform: scale(1.25);
  transition: clip-path 1.6s cubic-bezier(0.65, 0, 0.35, 1) calc(var(--reveal-delay, 0s) + 0.15s), transform 1.8s var(--ease);
}
.js .course-card.is-visible .course-circle img { clip-path: circle(75% at 50% 50%); transform: none; }
@media (hover: hover) {
  .js .course-card.is-visible .course-link:hover .course-circle img { transform: scale(1.08); }
}

/* Page curtain: a dark panel rises over the page when you leave... */
.page-curtain {
  position: fixed;
  inset: 0;
  z-index: 4000;
  background: var(--nav-bg);
  transform: translateY(100%);
  pointer-events: none;
}
.page-curtain.is-on { transform: translateY(0); transition: transform 0.6s cubic-bezier(0.7, 0, 0.3, 1); }
/* ...and lifts away when the next page opens */
html.from-curtain body { animation: none; }
html.from-curtain body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 4000;
  background: var(--nav-bg);
  pointer-events: none;
  animation: curtainUp 0.9s cubic-bezier(0.7, 0, 0.3, 1) 0.15s forwards;
}
@keyframes curtainUp { to { transform: translateY(-100%); } }

/* =========================================================
   Course detail pages
   ========================================================= */
.course-page {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 120px 32px;
  text-align: center;
}

.course-page-inner { max-width: 760px; }

.course-page .section-label { margin-bottom: 1.6rem; }

.course-page-title {
  font-size: clamp(2.6rem, 7vw, 5rem);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: 0.04em;
  margin-bottom: 1.4rem;
}

.course-page-sub {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.15rem, 2.2vw, 1.45rem);
  color: #555;
  margin-bottom: 2.6rem;
}

.course-page-rule { width: 48px; height: 1px; background: #000; margin: 0 auto 2.4rem; border: 0; }

.course-page-note {
  font-size: 11px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 3.4rem;
}

.course-page-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
}

.footer-link { margin: 1.4rem 0 1.6rem; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #000;
}
.back-link .arrow { transition: transform 0.4s var(--ease); }
.back-link:hover .arrow { transform: translateX(-6px); }

/* Black screen that continues the swirl from the home page, then lifts away */
.course-intro { display: none; }
.from-zoom body { animation: none; }
.from-zoom .course-intro {
  display: grid;
  place-items: center;
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: var(--nav-bg);
  pointer-events: none;
  animation: introOut 1.1s var(--ease) 0.35s forwards;
}
.course-intro span {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 34px;
  line-height: 1;
  color: #fff;
}
@keyframes introOut {
  to { opacity: 0; visibility: hidden; }
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr; gap: 56px; }
  .hero-right { justify-content: center; }
  .courses-grid { grid-template-columns: 1fr 1fr; gap: 56px 32px; max-width: 640px; }

}

@media (max-width: 820px) {
  :root { --nav-gap: 10px; }

  /* Side bar becomes a floating rounded bar at the top */
  .side-nav {
    top: var(--nav-gap);
    left: var(--nav-gap);
    right: var(--nav-gap);
    bottom: auto;
    width: auto;
    border-radius: 14px;
    background: rgba(10,10,10,0.92);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
  }
  .side-nav.is-hidden { transform: translateY(calc(-100% - 20px)); }

  .side-nav-inner { flex-direction: row; padding: 10px 14px 10px 10px; gap: 12px; }

  .side-monogram { width: 36px; height: 36px; font-size: 20px; }

  .side-menu { flex-direction: row; gap: 22px; }
  .side-menu a { writing-mode: horizontal-tb; transform: none; font-size: 10px; letter-spacing: 0.2em; }
  .side-menu a .nav-num { display: none; }
  .side-menu a::after { right: 0; left: 0; top: auto; bottom: -6px; width: auto; height: 1px; transform: scaleX(0); transform-origin: left; }
  .side-menu a.is-active::after { transform: scaleX(1); }

  /* Inquire becomes a small pill at the right of the bar */
  .side-footer-cta { writing-mode: horizontal-tb; transform: none; }
  .side-btn {
    display: inline-block;
    border: 1px solid rgba(255,255,255,0.45);
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 9.5px;
    letter-spacing: 0.18em;
  }

  section[id], footer[id] { scroll-margin-top: 84px; }

  .page-canvas { margin-left: 0; padding-top: 72px; }

  .hero { padding: 48px 22px 72px; }
  .courses { padding: 80px 22px; }
  .about-band-inner { padding: 96px 22px; }
  .site-footer { padding: 70px 22px 56px; }

  .hero-logo-img { max-width: 320px; margin-bottom: 2rem; }
  .hero-tiles { gap: 10px; max-width: none; }

  .section-header { margin-bottom: 3rem; }

  .about-facts div + div { padding-left: 12px; }
}

@media (max-width: 520px) {
  .side-menu { gap: 16px; }
  .side-menu a { font-size: 9.5px; letter-spacing: 0.16em; }
  .side-menu a[href$="#voucher"] { display: none; }   /* room for the Inquire pill */

  .courses-grid { grid-template-columns: 1fr; gap: 56px; max-width: 320px; }
  .course-link { margin-bottom: 1.4rem; }
  .btn { width: 100%; text-align: center; }
}

/* =========================================================
   Inquire page
   ========================================================= */
.inquire {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  min-height: 100vh;
  min-height: 100svh;
  padding: var(--nav-gap) var(--nav-gap) var(--nav-gap) 0;
}

/* --- Left: dark visual panel --- */
.inquire-visual {
  position: sticky;
  top: var(--nav-gap);
  height: calc(100vh - var(--nav-gap) * 2);
  height: calc(100svh - var(--nav-gap) * 2);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  border-radius: 18px;
  background: var(--nav-bg);
  color: #fff;
  box-shadow: 0 30px 60px -36px rgba(0,0,0,0.5);
}

.inquire-visual-img { position: absolute; inset: 0; }
.inquire-visual-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.55;
  animation: slowPan 26s ease-in-out infinite alternate;
}
.inquire-visual-img::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10,10,10,0.15) 0%, rgba(10,10,10,0.55) 45%, rgba(10,10,10,0.92) 100%);
}
@keyframes slowPan {
  from { transform: scale(1.06) translate(0, 0); }
  to   { transform: scale(1.16) translate(-2%, -1.5%); }
}

.inquire-visual-content {
  position: relative;
  z-index: 1;
  padding: 56px 56px 52px;
  width: 100%;
}

.inquire-kicker {
  display: block;
  font-size: 10px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: #c9c0b2;
}

.inquire-title {
  font-size: clamp(4rem, 8.5vw, 8rem);
  font-weight: 300;
  line-height: 0.95;
  letter-spacing: 0.02em;
  color: #fff;
  margin: 0.25em 0 0.3em;
}

.inquire-lede {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.15rem, 1.6vw, 1.4rem);
  line-height: 1.5;
  color: #ddd6cb;
  max-width: 400px;
  margin-bottom: 0;
}

.inquire-address {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 46px;
  padding-top: 22px;
  border-top: 1px solid rgba(255,255,255,0.18);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #a39b8f;
}

/* --- Right: form --- */
.inquire-form-wrap {
  position: relative;
  display: flex;
  align-items: center;
  padding: 90px clamp(24px, 7vw, 110px) 80px;
}

.inquire-form {
  width: 100%;
  max-width: 560px;
  transition: opacity 0.6s ease, transform 0.8s var(--ease), visibility 0s;
}

.hp-field { position: absolute; left: -9999px; }

.form-head .section-label { margin-bottom: 0.9rem; }
.form-title {
  font-size: clamp(2.2rem, 3.6vw, 3.2rem);
  font-weight: 300;
  line-height: 1.1;
  margin-bottom: 2.6rem;
}

/* Choice chips */
.chips { border: 0; }
.chips legend {
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}
.chip-row { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-block;
  padding: 11px 20px;
  border: 1px solid #d9d4cc;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #444;
  transition: background-color 0.45s var(--ease), color 0.45s var(--ease), border-color 0.45s var(--ease), transform 0.45s var(--ease);
}
.chip:hover span { border-color: #000; color: #000; }
.chip input:checked + span { background: #000; border-color: #000; color: #fff; }
.chip input:focus-visible + span { outline: 1px solid #000; outline-offset: 3px; }
.chip:active span { transform: scale(0.97); }

/* Course picker slides open */
.field-reveal {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.7s var(--ease), opacity 0.5s ease;
}
.field-reveal.is-open { grid-template-rows: 1fr; opacity: 1; }
.field-reveal-inner { min-height: 0; overflow: hidden; }
.field-reveal .field { margin-top: 34px; }

/* Fields with floating labels */
.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 32px;
}
.field-wide { grid-column: 1 / -1; }

.field { position: relative; margin-top: 34px; }

.field input,
.field textarea,
.field select {
  display: block;
  width: 100%;
  padding: 22px 0 10px;
  border: 0;
  border-bottom: 1px solid #d6d1c9;
  border-radius: 0;
  background: transparent linear-gradient(#000, #000) no-repeat 0 100% / 0 1px;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 400;
  color: var(--ink);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: background-size 0.7s var(--ease), border-color 0.3s ease;
}
.field textarea { resize: vertical; min-height: 130px; line-height: 1.7; }
.field select { padding-right: 30px; cursor: pointer; }

.field input:focus,
.field textarea:focus,
.field select:focus { background-size: 100% 1px; }

.field label {
  position: absolute;
  left: 0;
  top: 22px;
  font-size: 13.5px;
  color: #8a8a8a;
  pointer-events: none;
  transform-origin: left top;
  transition: transform 0.45s var(--ease), color 0.3s ease;
}
.field label em { font-style: normal; color: #b3b3b3; }

.field input:focus + label,
.field input:not(:placeholder-shown) + label,
.field textarea:focus + label,
.field textarea:not(:placeholder-shown) + label,
.field-select label {
  transform: translateY(-22px) scale(0.8);
  color: #111;
}

.select-arrow {
  position: absolute;
  right: 6px;
  top: 28px;
  width: 7px;
  height: 7px;
  border-right: 1px solid #111;
  border-bottom: 1px solid #111;
  transform: rotate(45deg);
  pointer-events: none;
}

.field-msg {
  display: block;
  min-height: 0;
  margin-top: 6px;
  font-size: 11px;
  color: #9b3b2f;
}
.field.is-invalid input,
.field.is-invalid textarea { border-bottom-color: #9b3b2f; }
.field.is-invalid label { color: #9b3b2f; }

.field-count {
  position: absolute;
  right: 0;
  bottom: -4px;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: #b0b0b0;
}

/* Submit */
.form-foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px 28px;
  margin-top: 50px;
}

.inquire-submit {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 18px;
  padding: 19px 36px;
  border: 0;
  background: #000;
  color: #fff;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease), background-color 0.3s ease;
}
/* light sweep across the button on hover */
.inquire-submit::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -60%;
  width: 40%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.22), transparent);
  transform: skewX(-20deg);
  transition: left 0.9s var(--ease);
}
.inquire-submit:hover { transform: translateY(-2px); box-shadow: 0 16px 30px -16px rgba(0,0,0,0.5); }
.inquire-submit:hover::before { left: 130%; }
.inquire-submit .arrow { transition: transform 0.5s var(--ease); }
.inquire-submit:hover .arrow { transform: translateX(6px); }
.inquire-submit .label,
.inquire-submit .arrow { transition: opacity 0.3s ease, transform 0.5s var(--ease); }

.inquire-submit .spinner {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 18px;
  height: 18px;
  border: 1px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  opacity: 0;
  animation: spin 0.8s linear infinite;
  transition: opacity 0.3s ease;
}
.inquire-submit.is-sending { cursor: progress; }
.inquire-submit.is-sending .label,
.inquire-submit.is-sending .arrow { opacity: 0; }
.inquire-submit.is-sending .spinner { opacity: 1; }
@keyframes spin { to { transform: rotate(360deg); } }

.form-note { font-size: 11.5px; color: #9a9a9a; margin: 0; }
.form-error { font-size: 12px; color: #9b3b2f; margin: 18px 0 0; }

/* Thank-you state */
.thanks {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 90px clamp(24px, 7vw, 110px) 80px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(24px);
  transition: opacity 0.8s ease, transform 1s var(--ease), visibility 0s 1s;
}

.inquire.is-sent .inquire-form {
  opacity: 0;
  transform: translateY(-24px);
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.5s ease, transform 0.7s var(--ease), visibility 0s 0.7s;
}
.inquire.is-sent .thanks {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 0.9s ease 0.45s, transform 1.1s var(--ease) 0.45s, visibility 0s;
}

.thanks-mark { width: 78px; height: 78px; }
.thanks-mark circle,
.thanks-mark path {
  fill: none;
  stroke: #000;
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.thanks-mark circle { stroke-dasharray: 233; stroke-dashoffset: 233; transform: rotate(-90deg); transform-origin: center; }
.thanks-mark path { stroke-dasharray: 50; stroke-dashoffset: 50; }
.inquire.is-sent .thanks-mark circle { stroke-dashoffset: 0; transition: stroke-dashoffset 1.3s var(--ease) 0.7s; }
.inquire.is-sent .thanks-mark path { stroke-dashoffset: 0; transition: stroke-dashoffset 0.7s var(--ease) 1.6s; }

.thanks-title {
  font-size: clamp(2.4rem, 4vw, 3.4rem);
  font-weight: 300;
  line-height: 1.1;
  margin: 30px 0 14px;
}
.thanks-text { max-width: 430px; font-size: 14px; line-height: 1.9; margin-bottom: 26px; }
.thanks-preview {
  max-width: 430px;
  font-size: 11px;
  line-height: 1.7;
  color: #7d7265;
  background: #f6f3ee;
  padding: 10px 14px;
  margin-bottom: 30px;
}

/* --- Inquire page on tablets and phones --- */
@media (max-width: 1024px) {
  .inquire { grid-template-columns: 1fr; padding: var(--nav-gap) var(--nav-gap) 0 0; }
  .inquire-visual { position: relative; top: 0; height: auto; min-height: 460px; }
  .inquire-form-wrap { padding: 72px clamp(22px, 6vw, 60px) 80px; }
  .thanks { padding: 72px clamp(22px, 6vw, 60px) 80px; }
}

@media (max-width: 820px) {
  .inquire { padding: 0 var(--nav-gap); }
  .inquire-visual { min-height: 400px; border-radius: 14px; }
  .inquire-visual-content { padding: 36px 26px 30px; }
  .inquire-address { margin-top: 30px; }
  .inquire-form-wrap { padding: 56px 12px 64px; min-height: 560px; }
  .thanks { padding: 56px 12px 64px; }
  .field-grid { grid-template-columns: 1fr; }
  .chip span { padding: 10px 16px; font-size: 10px; }
  .inquire-submit { width: 100%; justify-content: center; }
}

/* =========================================================
   Smooth scrolling (Lenis) support
   ========================================================= */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

/* Respect users who prefer less motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .js [data-reveal] { opacity: 1; transform: none; }
  .reveal-mask-in { transform: none; }
  .js .course-card .course-circle img { clip-path: none; transform: none; }
  .js .about-band-rule[data-reveal] { transform: none; }
  html.from-curtain body::before { display: none; }
}

/* --- Hide Netlify badge --- */
netlify-badge, netlify-drawer, #netlify-badge, #netlify-drawer,
.netlify-badge, .netlify-drawer, [id^="netlify"] {
  display: none !important;
}
