/* Grayswood Village Club – home page */

@font-face { font-family: "Sweet Pea"; src: url("../fonts/sweet-pea.woff2") format("woff2"); font-style: normal; font-weight: 400; font-display: swap; }
@font-face { font-family: "DIN Next W01"; src: url("../fonts/din-next-regular.woff2") format("woff2"); font-style: normal; font-weight: 400; font-display: swap; }
@font-face { font-family: "DIN Next W01"; src: url("../fonts/din-next-bold.woff2") format("woff2"); font-style: normal; font-weight: 700; font-display: swap; }

/* Additional supplied fonts, available for future use. */
@font-face { font-family: "Times Bold Italic"; src: url("../fonts/times-bold-italic.woff2") format("woff2"), url("../fonts/times-bold-italic.woff") format("woff"); font-style: italic; font-weight: 700; font-display: swap; }
@font-face { font-family: "DIN Alternate"; src: url("../fonts/din-alternate-bold.woff2") format("woff2"), url("../fonts/din-alternate-bold.woff") format("woff"); font-style: normal; font-weight: 700; font-display: swap; }

.font-times-bold-italic { font-family: "Times Bold Italic", Times, serif; font-weight: 700; font-style: italic; }
.font-din-alternate-bold { font-family: "DIN Alternate", Arial, sans-serif; font-weight: 700; font-style: normal; }

:root {
  --plum: #b93a85;
  --magenta: #d3499f;
  --pink: #ea6e8f;
  --red: #f4432d;
  --coral: #f77366;
  --salmon: #ec645e;
  --orange: #ff9c4a;
  --gold: #f8b347;
  --sky: #48c6e2;
  --ink: #36013f;
  --white: #fff;
  --circle-fill: rgba(255,255,255,.07);

  --script: "Sweet Pea", "Dancing Script", cursive;
  --sans: "DIN Next W01", "Segoe UI", Arial, sans-serif;

  --body: clamp(1.0625rem, 0.95rem + 0.45vw, 1.3rem);
  --gutter: clamp(1rem, 4vw, 2.5rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  font-weight: 400;
  font-size: var(--body);
  line-height: 1.55;
  color: var(--ink);
  background: var(--white);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

.container { width: min(100% - 2 * var(--gutter), 1200px); margin-inline: auto; text-align: center; }

/* Type */
h1, h2, h3, h4, h5, h6 { font-family: var(--script); font-weight: 400; }
strong, b { font-weight: 700; }
.script { font-family: var(--script); font-weight: 400; line-height: 1.05; margin: 0; }
.display { font-size: clamp(4rem, 2.5rem + 7vw, 8.5rem); color: var(--red); }
.h1 { font-size: clamp(2.6rem, 1.6rem + 4.6vw, 5.5rem); }
.h2 { font-size: clamp(2.4rem, 1.7rem + 3vw, 4.4rem); }
.h3 { font-size: clamp(1.9rem, 1.5rem + 1.6vw, 2.8rem); }
.subtitle { font-family: var(--sans); font-size: clamp(1.25rem, 1rem + 1vw, 1.8rem); font-weight: 700; margin: 0 0 1.2rem; line-height: 1.25; }
.copy { max-width: 46rem; margin-inline: auto; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  height: clamp(320px, 56vw, 92vh);
  overflow: hidden;
  background: #000;
  isolation: isolate;
}
.hero__bg { position: absolute; inset: -6% 0 -18%; will-change: transform; }
.hero__bg img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 35%; }
.hero__sparks { position: absolute; inset: 0; pointer-events: none; will-change: transform; }
.hero__sparks i {
  position: absolute;
  width: var(--s); height: var(--s);
  border-radius: 50%;
  background: radial-gradient(circle, #ffe2a8 0%, #f3b25a 45%, transparent 70%);
  opacity: 0;
  animation: twinkle var(--d) ease-in-out var(--delay) infinite;
}
@keyframes twinkle { 0%, 100% { opacity: 0; transform: translateY(0) scale(.6); } 50% { opacity: .9; transform: translateY(-14px) scale(1); } }

.pill {
  position: absolute; top: clamp(.75rem, 2vw, 1.5rem); right: clamp(.75rem, 3vw, 2.75rem); z-index: 2;
  padding: .25rem .8rem;
  font-size: clamp(.85rem, .75rem + .4vw, 1.05rem);
  color: var(--white); text-decoration: none;
  background: var(--ink);
  border: 2px solid var(--white);
  transition: background .2s, color .2s;
}
.pill:hover, .pill:focus-visible { background: var(--white); color: var(--ink); }

.hero__scroll {
  position: absolute; left: 50%; bottom: 1.25rem; z-index: 2; translate: -50% 0;
  width: 26px; height: 42px; border: 2px solid rgba(255,255,255,.7); border-radius: 14px;
}
.hero__scroll span { position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: #fff; animation: scrolldot 1.8s ease-in-out infinite; }
@keyframes scrolldot { 0% { opacity: 0; transform: translateY(0); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

/* ---------- Welcome ---------- */
.welcome {
  position: relative; overflow: hidden;
  background: var(--plum); color: var(--white);
  padding: clamp(3rem, 7vw, 6rem) 0 clamp(10rem, 20vw, 16rem);
}
.welcome .container { position: relative; z-index: 1; }
.welcome .h1 { font-size: clamp(2.6rem, 9.5vw, 4.75rem); line-height: 1.02; margin-bottom: 1.5rem; }
.welcome .copy { max-width: 48rem; font-size: clamp(1.125rem, 3vw, 1.5rem); line-height: 1.52; }
.welcome .copy p { margin: 0; }
.welcome .copy p + p { margin-top: 2.25rem; }
.welcome-line { display: block; }
@media (min-width: 700px) {
  .welcome-line { white-space: nowrap; }
}
@media (max-width: 699px) {
  .welcome .copy .welcome-line { display: inline; }
  .welcome .h1 { font-size: clamp(2.2rem, 9.5vw, 4.75rem); }
}

.float { position: absolute; border: 0; border-radius: 50%; background: var(--circle-fill); pointer-events: none; will-change: transform; }
.float--1 { width: 26vw; height: 26vw; max-width: 340px; max-height: 340px; left: -8vw; top: 12%; }
.float--2 { width: 18vw; height: 18vw; max-width: 240px; max-height: 240px; right: -5vw; top: 48%; }
.float--3 { width: 10vw; height: 10vw; max-width: 130px; max-height: 130px; left: 12%; bottom: 6%; }

.times {
  width: min(100%, 18rem);
  margin: clamp(2rem, 4vw, 3rem) auto 0;
  padding: 1rem 1.25rem 1.5rem;
  background: var(--salmon);
  border: 5px solid var(--white);
}
.times h2 { margin: 0 0 .6rem; font-family: var(--script); font-size: clamp(1.9rem, 1.5rem + 1.6vw, 2.8rem); font-weight: 400; line-height: 1.1; }
.times ul { list-style: none; margin: 0; padding: 0; font-size: 1.08em; line-height: 1.45; }

.btn {
  display: inline-block;
  margin-top: clamp(2rem, 4vw, 3rem);
  width: min(100%, 18rem);
  padding: .3rem 2rem .45rem;
  font-size: clamp(2rem, 1.5rem + 2vw, 3.1rem);
  color: var(--white); text-decoration: none;
  background: var(--gold);
  border: 5px solid var(--white);
  transition: transform .25s ease, background .25s;
}
.btn:hover, .btn:focus-visible { background: var(--red); transform: scale(1.04); }

/* ---------- Tiles ---------- */
.tiles { position: relative; overflow: clip; padding: clamp(1rem, 2vw, 1.5rem) clamp(1rem, 8vw, 2.5rem) clamp(2rem, 4vw, 3.5rem); }
.tiles__grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1rem, 2vw, 2rem);
  width: min(100%, 800px); margin-inline: auto;
}
.tiles__col { display: grid; gap: clamp(1rem, 2vw, 2rem); padding-top: 0; align-self: start; }
.tiles-stage { position: relative; z-index: 1; }
@media (prefers-reduced-motion: no-preference) {
  .js .tiles-stage.closing-panel { height: var(--tiles-stage-height, auto); top: var(--tiles-stage-top, 0px); }
  .js .tiles-stage > .tiles { position: absolute; top: 0; left: 0; width: 100%; translate: 0 var(--tiles-panel-offset, 0px); background: white; }
  .js .tiles__grid { translate: 0 var(--tiles-entry-y, 0px); }
  .js .tiles__grid:focus-within { translate: none; }
}
.tile {
  aspect-ratio: 412 / 422;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .25rem;
  padding: 1rem;
  color: var(--white); text-decoration: none; text-align: center;
  container-type: inline-size;
  transform-origin: center center;
  transform: scale(var(--tile-hover-scale, 1));
  transition: transform 1.2s ease, background-color .4s ease;
}
.tile .script { font-size: 21cqi; line-height: 1.05; }
.tile:hover, .tile:focus-visible { --tile-hover-scale: .94; background: var(--tile-hover); }
.tiles .tile, .tiles .tile:visited, .tiles .tile .script { color: #fff; -webkit-text-fill-color: #fff; }
.tile--pink { --tile-base: var(--pink); --tile-hover: #be4263; }
.tile--magenta { --tile-base: var(--magenta); --tile-hover: #a71d73; }
.tile--pink, .tile--magenta { padding: 0; }
.tile--pink .script, .tile--magenta .script {
  position: absolute; top: 19%; left: 0; width: 100%;
  font-size: 21cqi; line-height: 1.18;
}
.tile--red { --tile-base: var(--red); --tile-hover: #c81701; }
.tile--orange { --tile-base: var(--orange); --tile-hover: #d3701e; }
.tile--orange { padding: 0; }
.tile--orange .script {
  position: absolute; top: 7%; left: 0; width: 100%;
  font-size: 21cqi; line-height: 1.2;
}
.tile {
  background: var(--tile-base);
}
.tile--red { padding: 0; }
.tile__crest { position: absolute; top: 2%; left: 0; width: 100%; height: 53%; object-fit: contain; margin: 0; }
.tile--red .script {
  position: absolute; top: 55%; left: 0; width: 100%;
  font-size: 22cqi; line-height: 1.08;
}

/* ---------- Bands ---------- */
.band { position: relative; overflow: hidden; color: var(--white); padding: clamp(2rem, 4vw, 2.75rem) 0 clamp(2.5rem, 5vw, 3.5rem); }
.band--coral { background: var(--coral); }
.band--magenta { background: var(--magenta); padding-block: clamp(2.5rem, 5vw, 3.75rem); }
.band .container { position: relative; z-index: 1; }
.band p { max-width: 44rem; margin-inline: auto; }
.band a { text-underline-offset: 3px; }
.band__stripes {
  position: absolute; inset: -100vh 0; pointer-events: none; will-change: transform;
  background: repeating-linear-gradient(-45deg, rgba(255,255,255,.06) 0 22px, transparent 22px 64px);
}

.members { padding: clamp(2rem, 4vw, 2.75rem) 0 clamp(2.5rem, 5vw, 3.5rem); }
.members .h2 { color: var(--red); margin-bottom: .5rem; }
.band .h2 { margin-bottom: .75rem; }

/* Each following section slides over the pinned panel, closing it on scroll.
   Keep the natural section heights so reversing the scroll opens them again. */
main { position: relative; isolation: isolate; z-index: 1; background: var(--white); }
.members { background: var(--white); }
@media (prefers-reduced-motion: no-preference) {
  .js .welcome { z-index: 1; }
  .js .closing-panel {
    position: sticky;
    top: var(--closing-top, 0px);
  }
  .js .closing-panel:focus-within { z-index: 5; }
}
.closing-panel { z-index: 1; }
.tiles.closing-panel { z-index: 1; background: var(--white); }
.members.closing-panel { z-index: 2; }
.band--magenta.closing-panel { z-index: 3; }
.whats-on { position: relative; z-index: 4; background: var(--white); }

/* ---------- What's On ---------- */
.whats-on { padding: clamp(2.5rem, 5vw, 4rem) 0 clamp(5rem, 11vw, 10rem); }
.whats-on .display { margin-bottom: .75rem; }
.whats-on .subtitle { font-family: var(--sans); font-weight: 700; }
.whats-on .copy { font-family: var(--sans); font-weight: 400; white-space: pre-line; }
.document-page { max-width: 52rem; padding-block: 3rem; text-align: left; }
.document-page h1 { margin: 2rem 0; }
.document-page h1 { font-size: clamp(2.5rem, 6vw, 4rem); }
.document-page :is(h2, h3, h4, h5, h6) { font-family: var(--sans); font-weight: 700; }
.calendar-entries { white-space: pre-wrap; margin-bottom: 2rem; overflow-wrap: anywhere; }
/* Opaque backgrounds cover each preceding sticky section as the next opens. */
@media (prefers-reduced-motion: no-preference) {
  .js .scroll-panel .container { translate: 0 calc(var(--box-y, 0px) + var(--box-text-y, 0px)); transition: translate 1s ease-out; }
  .js .scroll-panel .reveal { transition-delay: calc(var(--reveal-delay, 0ms) + 180ms); }
  .js .scroll-panel .reveal + .reveal { transition-delay: calc(var(--reveal-delay, 0ms) + 330ms); }
  .js .scroll-panel:focus-within, .js .scroll-panel:focus-within .container { translate: none; }
}
.posters {
  display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center;
  gap: clamp(1rem, 2.5vw, 1.5rem);
  width: min(100% - 2 * var(--gutter), 1200px);
  margin: clamp(2rem, 4vw, 3rem) auto 0;
  padding-inline: 0;
}
.poster { margin: 0; will-change: transform; }
.poster img { width: 100%; height: auto; box-shadow: 0 24px 45px -20px rgba(54,1,63,.45); }
.poster--portrait { width: min(100%, 22rem); }
.poster--wide { width: min(100%, 60rem); }

/* ---------- Footer ---------- */
.footer {
  background: var(--sky); color: var(--white); text-align: center;
  padding: clamp(1.75rem, 3vw, 2.5rem) var(--gutter) clamp(2rem, 4vw, 3rem);
  overflow: hidden;
}
.footer__logo { width: min(70%, 15rem); margin: 0 auto 1.5rem; }
.footer address { font-style: normal; line-height: 1.5; margin-bottom: 1.75rem; }
.footer a { text-decoration: none; }
.footer a:hover, .footer a:focus-visible { text-decoration: underline; }
.footer__links { display: grid; gap: .1rem; }

/* The page lifts away to uncover the footer, which keeps its layout space. */
@media (prefers-reduced-motion: no-preference) {
  .js .hero { z-index: 1; }
  .js .footer--reveal { position: sticky; bottom: 0; z-index: 0; }
  .js .footer--reveal .reveal { opacity: 1; translate: none; transition: none; }
  .js .footer--reveal .footer__logo { transform: none; }
}

/* ---------- Reveal on scroll ---------- */
.js .reveal { opacity: 0; translate: 0 36px; transition: opacity .8s ease, translate .8s cubic-bezier(.2,.7,.2,1); }
.js .reveal.is-in { opacity: 1; translate: 0 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; translate: none; transition: none; }
  .hero__sparks i, .hero__scroll span { animation: none; }
}

@media (max-width: 560px) {

  .welcome .h1 br { display: none; }
}

/* Independent depth offsets preserve reveal and hover transforms. */
[data-speed], .band__stripes {
  transform: translate3d(var(--parallax-x, 0px), var(--parallax-y, 0px), 0);
}
.hero__bg { inset: -3% 0; }
.hero__sparks { background: radial-gradient(ellipse at 70% 20%, rgba(248,179,71,.09), transparent 55%); }
.band__stripes { inset: -100px; }
.tiles__col { align-content: start; }
.tile { position: relative; overflow: hidden; }
.poster picture { display: block; }
.js .reveal { transition-delay: var(--reveal-delay, 0ms); }
@media (prefers-reduced-motion: reduce) {
  [data-speed], .band__stripes, .hero__bg, .hero__sparks { transform: none !important; will-change: auto; }
  .js .reveal { transition: none; }
  .hero__sparks { display: none; }
  .tile, .tile::after, .btn { transition: none; }
}

/* Hero video: plays over the still image inside the same parallax layer. */
.hero__bg picture { display: block; width: 100%; height: 100%; }
.hero__video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 35%;
  opacity: 0; transition: opacity .6s ease;
}
.hero__video.is-playing { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .hero__video { display: none; }
}

/* Animate each complete box; its contents stay fixed inside it.
   Independent translate leaves hover transforms intact. */
.js .reveal.reveal--box {
  translate: 0 calc(110px + var(--box-y, 0px));
  transition: opacity 1.1s ease, translate 1.6s cubic-bezier(.16,.84,.28,1), transform .3s ease, box-shadow .3s ease, background .25s ease;
  transition-delay: var(--reveal-delay, 0ms), var(--reveal-delay, 0ms), 0s, 0s, 0s;
}
.js .reveal.reveal--box.is-in { translate: 0 var(--box-y, 0px); }
.js .reveal--box > *, .js .tile > * {
  opacity: 1;
  translate: none;
  transform: none;
  transition: none;
}
.btn > span { display: inline-block; }
.js .reveal--box:focus-visible, .js .reveal--box:focus-within { opacity: 1; translate: none; }
.js .reveal--box:focus-visible > *, .js .reveal--box:focus-within > * { opacity: 1; translate: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal.reveal--box, .js .reveal.reveal--box > * { opacity: 1; translate: none; transition: none; }
}

/* Membership information popup, matching the supplied Illustrator artwork. */
body.membership-open { overflow: hidden; }
.membership-dialog {
  width: min(320px, calc(100% - 2rem)); max-height: calc(100dvh - 2rem);
  margin: auto; padding: .8em .7em 1.2em; border: 1px solid rgba(54,1,63,.3);
  background: #f7a295; color: var(--ink); text-align: center;
  font-family: var(--sans); font-size: min(18px, 4.8vw, 3.6dvh); line-height: 1.2;
  overflow-y: auto; box-shadow: 0 20px 70px rgba(0,0,0,.3);
}
.membership-dialog::backdrop { background: rgba(0,0,0,.6); }
.membership-dialog h2 { color: #fff; font-size: 2.9em; line-height: 1.05; margin: 0 0 .24em; }
.membership-dialog__intro { color: #fff; font-size: 1.3em; line-height: 1.08; margin: 0 0 .8em; }
.membership-dialog__fees { font-family: var(--sans); font-weight: 700; font-size: 1em; line-height: 1.2; margin: 0 0 .9em; }
.membership-dialog__price { margin: 0 0 1.1em; }
.membership-dialog__payment { margin: 0; line-height: 1.35; }
.membership-dialog__payment-name { font-size: 1.08em; }
.membership-dialog__stripe { font-size: 1.3em; font-weight: 700; }
.membership-dialog__close { position: absolute; top: 3px; right: 4px; width: 30px; height: 30px; border: 0; padding: 0; background: transparent; color: var(--ink); font: 26px/1 Arial, sans-serif; cursor: pointer; }
.membership-dialog__close:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }


/* Club Calendar page: Google Calendar embed scales with the page (800x600 on desktop). */
.document-page--wide { max-width: 60rem; }
.calendar-embed { position: relative; width: 100%; max-width: 800px; aspect-ratio: 4 / 3; margin: 0 0 1rem; background: #fff; }
.calendar-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.calendar-open { margin-bottom: 2rem; }
@media (max-width: 560px) {
  /* Taller on phones so the agenda stays readable. */
  .calendar-embed { aspect-ratio: auto; height: 75vh; min-height: 420px; }
}
