/* ==========================================================================
   Queen's Gambit Zürich · Atmosphere refinement (approved mockup, Option 2)
   Loaded after css/glass.css. Visual layer only: luminous background light,
   translucent glass shapes, stronger frosted surfaces. No content, typography,
   structure or behaviour changes.
   ========================================================================== */

:root {
  --glow-blue: rgba(64, 140, 255, .32);
  --glow-ice: rgba(170, 205, 255, .45);
  --glow-indigo: rgba(57, 73, 171, .20);

  --glass-bg: rgba(255, 255, 255, .52);
  --glass-bg-strong: rgba(255, 255, 255, .66);
  --glass-border: rgba(255, 255, 255, .78);
  --glass-shadow: 0 18px 48px rgba(30, 64, 175, .09), 0 2px 8px rgba(32, 35, 52, .04), inset 0 1px 0 rgba(255, 255, 255, .9);
  --glass-blur: 18px;
  --g-radius: 20px;
}

/* ---------- Page light: luminous, layered, never flat ---------- */
body { background: linear-gradient(180deg, #EEF5FF 0%, #F6F9FF 30%, #EDF2FF 62%, #E8EEFF 100%); }
body::before {
  background:
    radial-gradient(42rem 34rem at 96% 2%, rgba(64, 140, 255, .26), transparent 68%),
    radial-gradient(34rem 30rem at 0% 30%, rgba(120, 170, 255, .22), transparent 70%),
    radial-gradient(40rem 32rem at 100% 62%, rgba(57, 73, 171, .12), transparent 70%),
    radial-gradient(36rem 30rem at 10% 100%, rgba(64, 140, 255, .18), transparent 70%);
}

/* Sections flow into one another; each adds its own soft light */
.section, .hero { position: relative; isolation: isolate; }
.section--sand { background: transparent; }
.section::before, .hero::before {
  /* lights extend beyond each section so sections blend without visible seams */
  content: ""; position: absolute; inset: -16rem 0; z-index: -1; pointer-events: none;
}
.hero::before {
  background:
    radial-gradient(34rem 28rem at 78% 42%, var(--glow-blue), transparent 70%),
    radial-gradient(22rem 18rem at 62% 88%, var(--glow-ice), transparent 70%),
    radial-gradient(26rem 20rem at 8% 10%, rgba(170, 205, 255, .30), transparent 70%);
}
#upcoming::before { background: radial-gradient(30rem 24rem at 12% 30%, rgba(170, 205, 255, .35), transparent 70%), radial-gradient(28rem 22rem at 92% 85%, rgba(64, 140, 255, .14), transparent 70%); }
#community::before { background: radial-gradient(32rem 26rem at 88% 35%, rgba(64, 140, 255, .18), transparent 70%), radial-gradient(26rem 22rem at 6% 90%, var(--glow-ice), transparent 70%); }
#kids::before { background: radial-gradient(30rem 26rem at 90% 30%, var(--glow-blue), transparent 70%), radial-gradient(28rem 22rem at 5% 75%, rgba(170, 205, 255, .35), transparent 70%); }
#impact::before { background: radial-gradient(30rem 24rem at 15% 40%, rgba(64, 140, 255, .14), transparent 70%), radial-gradient(24rem 20rem at 90% 70%, var(--glow-ice), transparent 70%); }
#collaborations::before { background: radial-gradient(32rem 26rem at 85% 20%, rgba(170, 205, 255, .4), transparent 70%), radial-gradient(28rem 22rem at 10% 85%, var(--glow-indigo), transparent 70%); }
#about::before { background: radial-gradient(30rem 24rem at 10% 25%, rgba(64, 140, 255, .16), transparent 70%), radial-gradient(26rem 22rem at 92% 80%, var(--glow-ice), transparent 70%); }
#join::before { background: radial-gradient(34rem 26rem at 50% 50%, rgba(64, 140, 255, .18), transparent 72%); }

/* Translucent glass spheres (decorative) */
.hero__media, .kids__side, #collaborations > .container { position: relative; }
.hero__media::before, .hero__media::after, .kids__side::before, #collaborations > .container::before {
  content: ""; position: absolute; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, .85), rgba(214, 230, 255, .35) 45%, rgba(120, 165, 255, .18) 75%, rgba(80, 130, 245, .12));
  border: 1px solid rgba(255, 255, 255, .7);
  box-shadow: inset 0 -10px 30px rgba(64, 140, 255, .18), 0 20px 50px rgba(64, 140, 255, .14);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
/* hero: one sphere behind the photo, one overlapping its lower-left corner */
.hero__media::before { width: clamp(9rem, 22vw, 17rem); aspect-ratio: 1; right: -2.5rem; top: -2rem; z-index: -1; }
.hero__media::after {
  width: clamp(5.5rem, 11vw, 8.5rem); aspect-ratio: 1; left: -1.75rem; bottom: 2.25rem; z-index: 3;
  background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, .92), rgba(236, 244, 255, .7) 45%, rgba(190, 215, 255, .55) 75%, rgba(150, 190, 255, .45));
  -webkit-backdrop-filter: blur(10px) saturate(130%); backdrop-filter: blur(10px) saturate(130%);
}
.kids__side::before { width: clamp(6rem, 12vw, 10rem); aspect-ratio: 1; right: -1.5rem; bottom: -2rem; z-index: -1; }
#collaborations > .container::before { width: clamp(7rem, 14vw, 12rem); aspect-ratio: 1; left: -3rem; top: 30%; z-index: -1; opacity: .8; }

/* ---------- Hero photograph: glass frame with soft light ---------- */
.hero__frame {
  padding: 8px;
  background: rgba(255, 255, 255, .38);
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: 26px;
  box-shadow: 0 30px 70px rgba(30, 64, 175, .16), inset 0 1px 0 rgba(255, 255, 255, .9);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.hero__frame::before {          /* replaces the offset block: diffused light behind the photo */
  inset: -14% -12% -12% -14%;
  background: radial-gradient(closest-side, rgba(64, 140, 255, .38), rgba(120, 170, 255, .18) 55%, transparent 100%);
  border: 0; border-radius: 50%;
  z-index: -1; filter: blur(18px);
}
.hero__frame::after { display: none; }
.hero__frame img { border-radius: 19px; box-shadow: none; }
.hero__media .caption { padding-top: 1rem; }

/* ---------- Buttons and badges (mockup proportions) ---------- */
.btn { border-radius: 12px; }
.btn--sm { border-radius: 10px; }
.btn--ghost { background: rgba(255, 255, 255, .6); border-color: rgba(57, 73, 171, .22); }
.status, .event__programme { border-radius: 6px; }

/* ---------- Glass surfaces ---------- */
.event-list { border-top: 0; gap: .85rem; }
.event, .event--featured {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--g-radius);
  box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(140%);
  backdrop-filter: blur(var(--glass-blur)) saturate(140%);
  padding-inline: clamp(1rem, 2.5vw, 1.75rem);
  margin-block: 0;
}
.event--featured { background: var(--glass-bg-strong); border-color: rgba(255, 255, 255, .9); box-shadow: 0 22px 56px rgba(30, 64, 175, .13), inset 0 1px 0 #fff; }

.feature-grid, .pilot, .kids__media, .card--ivory.impact__project, .collab-grid, .about__values {
  box-shadow: var(--glass-shadow);
  border-color: var(--glass-border);
}
.pilot { background: var(--glass-bg-strong); }
.card--ivory.impact__project { border-top: 4px solid var(--g-electric); }

.community__media img {
  border: 6px solid rgba(255, 255, 255, .55);
  border-radius: 20px;
  box-shadow: 0 20px 48px rgba(30, 64, 175, .14);
}
.kids__media { padding: 8px; border-radius: 24px; }
.kids__media img { border-radius: 17px; }

.values li { background: rgba(255, 255, 255, .6); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }

/* ---------- Join: a luminous glass panel instead of a full-width flat band ---------- */
.section--charcoal { background: transparent; }
.section--charcoal > .join {
  width: calc(100% - 2 * var(--gutter));
  max-width: calc(var(--max) - 2 * var(--gutter));
  padding: clamp(1.75rem, 5vw, 3.5rem);
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, .35);
  background:
    radial-gradient(28rem 20rem at 88% 8%, rgba(120, 185, 255, .55), transparent 70%),
    radial-gradient(22rem 18rem at 4% 100%, rgba(234, 243, 255, .16), transparent 70%),
    linear-gradient(135deg, #2D3A9A 0%, var(--g-indigo) 42%, var(--g-blue) 100%);
  box-shadow: 0 30px 80px rgba(30, 64, 175, .28), inset 0 1px 0 rgba(255, 255, 255, .35);
  color: var(--g-white);
}
.join-card { background: rgba(255, 255, 255, .12); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }

/* ---------- Footer blends into the page ---------- */
.site-footer { background: rgba(255, 255, 255, .42); }

/* ---------- Mobile: same look, lighter effects ---------- */
@media (max-width: 719px) {
  :root { --glass-blur: 12px; --glass-bg: rgba(255, 255, 255, .64); --glass-bg-strong: rgba(255, 255, 255, .78); }
  .hero__media::before { right: -1rem; top: -1.25rem; }
  .hero__media::after { left: -.5rem; }
  .kids__side::before { right: -.5rem; }
  #collaborations > .container::before { left: -2.5rem; }
  .section--charcoal > .join { border-radius: 22px; }
}
@media (prefers-reduced-transparency: reduce) {
  :root { --glass-bg: rgba(255, 255, 255, .92); --glass-bg-strong: rgba(255, 255, 255, .96); }
}

/* ---------- Community: four feature blocks in the two-column layouts ---------- */
@media (min-width: 720px) and (max-width: 1023px), (min-width: 1200px) {
  .feature-grid > .feature:nth-last-child(2):nth-child(odd) { border-bottom-color: transparent; }
}

/* ---------- Footer on phones: email gets a full-width row ---------- */
@media (max-width: 599px) {
  .site-footer__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .site-footer__grid > .site-footer__brand { order: 0; }
  .site-footer__grid > :nth-child(2) { order: 1; }                         /* Explore */
  .site-footer__grid > :nth-child(4) { order: 2; grid-column: auto; }      /* Legal, beside Explore */
  .site-footer__grid > :nth-child(3) { order: 3; grid-column: 1 / -1; }    /* Contact, full width */
  .site-footer__col [data-contact-email] { overflow-wrap: normal; word-break: normal; }
}

/* ---------- Floating back-to-top button ---------- */
.to-top {
  position: fixed; z-index: 40;
  right: max(16px, env(safe-area-inset-right, 0px));
  bottom: calc(env(safe-area-inset-bottom, 0px) + 20px);
  width: 48px; height: 48px; padding: 0;
  display: grid; place-items: center;
  color: var(--g-indigo);
  background: rgba(255, 255, 255, .62);
  border: 1px solid rgba(255, 255, 255, .85);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(30, 64, 175, .18), inset 0 1px 0 #fff;
  -webkit-backdrop-filter: blur(14px) saturate(140%); backdrop-filter: blur(14px) saturate(140%);
  cursor: pointer;
  opacity: 0; visibility: hidden; transform: translateY(12px);
  transition: opacity .25s ease, transform .25s ease, visibility .25s ease, background-color .2s ease, color .2s ease;
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { color: var(--g-white); background: linear-gradient(135deg, var(--g-blue), var(--g-indigo)); }
.to-top:focus-visible { outline: 2px solid var(--g-blue); outline-offset: 3px; }
@media (max-width: 599px) { .to-top { width: 44px; height: 44px; bottom: calc(env(safe-area-inset-bottom, 0px) + 16px); } }
@media (prefers-reduced-motion: reduce) { .to-top { transition: none; transform: none; } }
/* Keep the floating button clear of the footer's own links at the very bottom */
@media (max-width: 899px) { .site-footer { padding-bottom: calc(2rem + 68px + env(safe-area-inset-bottom, 0px)); } }

/* ---------- Events: Special event badge and partner links (reusable) ---------- */
.event__programme--special { background: var(--g-indigo); color: var(--g-white); }
.event--featured .event__programme--special { background: var(--g-indigo); }
.event__partner {
  color: inherit; text-decoration: underline; text-decoration-thickness: 2px;
  text-decoration-color: rgba(0, 112, 180, .45); text-underline-offset: .18em;
  transition: color .2s ease, text-decoration-color .2s ease;
}
.event__partner:hover, .event__partner:focus-visible { color: var(--g-blue); text-decoration-color: var(--g-blue); }
