/* Recovery House — recoveryhouse.ca
   Palette pulled from the original neon logo artwork:
   deep indigo grid, pink-to-violet glow. */

:root {
  --bg: #120a2e;
  --bg-2: #1b0f3d;
  --panel: rgba(255, 255, 255, 0.045);
  --panel-line: rgba(214, 182, 255, 0.16);
  --text: #f4effd;
  --muted: #bfb3e3;
  --pink: #f08ad6;
  --violet: #9d7bf2;
  --glow: linear-gradient(120deg, var(--pink) 0%, #c584ea 45%, var(--violet) 100%);
  --alert: #ffcf6e;
  --radius: 18px;
  --max: 1120px;
  --gutter: clamp(16px, 4vw, 40px);
  font-synthesis: none;
  color-scheme: dark;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 84px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background-color: var(--bg);
  /* the grid from the 4K wallpaper, rebuilt in CSS so it stays crisp */
  background-image:
    radial-gradient(1200px 700px at 85% -10%, rgba(240, 138, 214, 0.18), transparent 60%),
    radial-gradient(900px 600px at -10% 30%, rgba(157, 123, 242, 0.16), transparent 60%),
    linear-gradient(rgba(214, 182, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(214, 182, 255, 0.05) 1px, transparent 1px);
  background-size: auto, auto, 48px 48px, 48px 48px;
  color: var(--text);
  font-family: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--pink); text-underline-offset: 3px; }
a:hover { color: #ffb6ea; }
:focus-visible { outline: 2px solid var(--pink); outline-offset: 3px; border-radius: 6px; }

.wrap { width: min(var(--max), 100% - 2 * var(--gutter)); margin-inline: auto; }

.skip {
  position: absolute; left: -999px; top: 8px; z-index: 100;
  background: var(--text); color: var(--bg); padding: 8px 14px; border-radius: 8px;
}
.skip:focus { left: 8px; }

/* ---------- logo mark: the original white PNG used as a mask over the glow ---------- */
.mark {
  display: inline-block;
  aspect-ratio: 900 / 762;
  background: var(--glow);
  -webkit-mask: url("../assets/brand/logo-white.png") center / contain no-repeat;
          mask: url("../assets/brand/logo-white.png") center / contain no-repeat;
}

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(18, 10, 46, 0.78);
  border-bottom: 1px solid var(--panel-line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 800; font-size: 1.15rem; letter-spacing: 0.01em; }
.brand .mark { width: 40px; }
.nav { display: flex; gap: 4px; align-items: center; }
.nav a {
  color: var(--muted); text-decoration: none; font-weight: 700; font-size: 0.95rem;
  padding: 8px 12px; border-radius: 999px;
}
.nav a:hover { color: var(--text); background: var(--panel); }
.nav a.help { color: var(--bg); background: var(--alert); }
.nav a.help:hover { background: #ffe0a0; }
.nav-toggle { display: none; }

@media (max-width: 980px) {
  .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--panel-line);
    background: var(--panel); color: var(--text); font: inherit; cursor: pointer;
  }
  .nav {
    position: absolute; inset: 68px 0 auto 0; flex-direction: column; align-items: stretch;
    padding: 10px var(--gutter) 18px; background: var(--bg-2); border-bottom: 1px solid var(--panel-line);
    display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px 14px; }
}

/* ---------- hero ---------- */
.hero { padding: clamp(56px, 10vw, 120px) 0 clamp(48px, 8vw, 96px); }
.hero .wrap { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.16em; font-size: 0.8rem; font-weight: 800; color: var(--pink); margin: 0 0 14px; }
h1, h2, h3 { line-height: 1.12; margin: 0; font-weight: 900; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.4rem, 6vw, 4.4rem); }
h1 .glow, h2 .glow {
  background: var(--glow); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .lede { font-size: clamp(1.1rem, 1.8vw, 1.3rem); color: var(--muted); max-width: 34ch; margin: 20px 0 30px; }
.hero-art { position: relative; display: grid; place-items: center; }
.hero-art .mark {
  width: min(100%, 420px);
  filter: drop-shadow(0 0 18px rgba(240, 138, 214, 0.55)) drop-shadow(0 0 48px rgba(157, 123, 242, 0.45));
  animation: pulse 3.2s ease-in-out infinite;
}
@keyframes pulse { 50% { transform: scale(1.025); filter: drop-shadow(0 0 26px rgba(240, 138, 214, 0.7)) drop-shadow(0 0 64px rgba(157, 123, 242, 0.55)); } }
@media (prefers-reduced-motion: reduce) { .hero-art .mark { animation: none; } }

.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 800;
  padding: 13px 22px; border-radius: 999px; font-size: 1rem; border: 1px solid transparent; cursor: pointer;
  font-family: inherit;
}
.btn-primary { background: var(--glow); color: #1a0b33; box-shadow: 0 8px 30px -10px rgba(240, 138, 214, 0.7); }
.btn-primary:hover { color: #1a0b33; filter: brightness(1.08); }
.btn-ghost { color: var(--text); border-color: var(--panel-line); background: var(--panel); }
.btn-ghost:hover { color: var(--text); border-color: rgba(240, 138, 214, 0.5); }

.definitions { margin-top: 38px; display: grid; gap: 14px; max-width: 46ch; }
.definitions p { margin: 0; color: var(--muted); font-size: 0.98rem; }
.definitions b { color: var(--text); font-weight: 800; }

@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-art { order: -1; }
  .hero-art .mark { width: min(62vw, 300px); }
}

/* ---------- sections ---------- */
section { padding: clamp(56px, 9vw, 104px) 0; }
.section-head { max-width: 62ch; margin-bottom: 36px; }
h2 { font-size: clamp(1.9rem, 4vw, 2.8rem); }
.section-head p { color: var(--muted); margin: 14px 0 0; }

.panel {
  background: var(--panel); border: 1px solid var(--panel-line); border-radius: var(--radius);
  padding: clamp(20px, 3vw, 30px);
}

/* about */
.about-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: clamp(24px, 4vw, 48px); align-items: start; }
.about-copy p { margin: 0 0 1.1em; }
.about-copy p:last-child { margin-bottom: 0; }
.photo {
  position: sticky; top: 96px;
  border-radius: var(--radius); overflow: hidden; border: 1px solid var(--panel-line);
  background: var(--bg-2); margin: 0;
}
.photo img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; object-position: center 78%; }
.photo figcaption { font-size: 0.85rem; color: var(--muted); padding: 10px 14px; }
.facts { display: flex; flex-wrap: wrap; gap: 10px; margin: 26px 0 0; padding: 0; list-style: none; }
.facts li {
  border: 1px solid var(--panel-line); border-radius: 999px; padding: 6px 14px;
  font-size: 0.9rem; font-weight: 700; color: var(--muted); background: rgba(18, 10, 46, 0.6);
}
.facts strong { color: var(--text); }
@media (max-width: 860px) { .about-grid { grid-template-columns: 1fr; } .photo { position: static; } }

/* events */
.events-list { display: grid; gap: 16px; }
.event {
  display: grid; grid-template-columns: 92px 1fr auto; gap: 20px; align-items: center;
  background: var(--panel); border: 1px solid var(--panel-line); border-radius: var(--radius); padding: 20px;
}
.event-date {
  text-align: center; border-radius: 14px; padding: 10px 0; background: rgba(18, 10, 46, 0.7);
  border: 1px solid rgba(240, 138, 214, 0.35);
}
.event-date .m { display: block; font-size: 0.8rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--pink); }
.event-date .d { display: block; font-size: 2rem; font-weight: 900; line-height: 1.05; }
.event-date .w { display: block; font-size: 0.78rem; color: var(--muted); }
.event h3 { font-size: 1.3rem; }
.event .meta { color: var(--muted); font-size: 0.95rem; margin: 4px 0 8px; }
.event .desc { margin: 0; font-size: 0.98rem; }
.event .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.event .tag { font-size: 0.78rem; font-weight: 800; padding: 3px 10px; border-radius: 999px; background: rgba(157, 123, 242, 0.18); color: #d9c9ff; }
.event-links { display: flex; flex-direction: column; gap: 8px; min-width: 150px; }
.event-links .btn { justify-content: center; padding: 10px 16px; font-size: 0.92rem; }
.event.past { grid-template-columns: 92px 1fr; opacity: 0.82; }
.events-empty { color: var(--muted); }
.events-foot { margin-top: 26px; color: var(--muted); font-size: 0.95rem; }
@media (max-width: 760px) {
  .event, .event.past { grid-template-columns: 72px 1fr; }
  .event-links { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; min-width: 0; }
  .event-links .btn { flex: 1 1 140px; }
  .event-date .d { font-size: 1.6rem; }
}

/* impact */
.impact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.impact-card h3 { font-size: 1.2rem; margin: 16px 0 8px; }
.impact-card p { margin: 0; color: var(--muted); }
.impact-icon {
  width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center;
  background: rgba(240, 138, 214, 0.12); border: 1px solid rgba(240, 138, 214, 0.35);
}
.impact-icon svg { width: 28px; height: 28px; fill: var(--pink); }
.impact-tag { margin: 36px 0 0; font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 900; }
.impact-tag span { display: block; font-size: 1rem; font-weight: 700; color: var(--muted); margin-top: 4px; }

/* team */
.team-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.person {
  display: flex; align-items: center; gap: 14px; padding: 16px 18px;
  background: var(--panel); border: 1px solid var(--panel-line); border-radius: var(--radius);
}
.person .avatar {
  width: 46px; height: 46px; flex: none; border-radius: 50%; display: grid; place-items: center;
  font-weight: 900; font-size: 1.15rem; color: #1a0b33; background: var(--glow);
  box-shadow: 0 0 18px -4px rgba(240, 138, 214, 0.7);
}
.person strong { display: block; font-size: 1.02rem; line-height: 1.25; }
.person span { display: block; color: var(--muted); font-size: 0.9rem; line-height: 1.35; margin-top: 2px; }

/* events with flyers */
.event.has-flyer { grid-template-columns: 150px 1fr auto; }
.event-flyer img {
  width: 150px; height: 150px; object-fit: cover; border-radius: 14px; cursor: zoom-in;
  border: 1px solid rgba(240, 138, 214, 0.35); background: var(--bg-2);
}
@media (max-width: 760px) {
  .event.has-flyer { grid-template-columns: 1fr; }
  .event-flyer img { width: 100%; height: auto; max-height: 360px; object-fit: contain; }
}

/* past parties */
.past-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.past-card {
  background: var(--panel); border: 1px solid var(--panel-line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
}
.past-img img, .past-img-blank { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; cursor: zoom-in; display: block; background: var(--bg-2); }
.past-img-blank { background: var(--glow); opacity: 0.25; }
.past-body { padding: 14px 16px 18px; }
.past-date { margin: 0; font-size: 0.78rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--pink); }
.past-card h3 { font-size: 1.08rem; margin: 4px 0 2px; }
.past-card h3 a { color: var(--text); text-decoration: none; }
.past-card h3 a:hover { color: var(--pink); }
.past-loc { margin: 0 0 6px; font-size: 0.85rem; color: var(--muted); }
.past-desc { margin: 0; font-size: 0.9rem; color: var(--muted); line-height: 1.5; }

/* gallery */
.gallery-grid { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 220px; gap: 14px; grid-auto-flow: dense; }
.gallery-grid figure { margin: 0; position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--panel-line); background: var(--bg-2); }
.gallery-grid img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; transition: transform 0.4s ease; }
.gallery-grid figure:hover img { transform: scale(1.04); }
.gallery-grid figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 14px 10px; font-size: 0.85rem; font-weight: 700;
  background: linear-gradient(transparent, rgba(18, 10, 46, 0.88));
}
.gallery-grid .g-wide { grid-column: span 2; }
.gallery-grid .g-tall { grid-row: span 2; }
@media (max-width: 860px) { .gallery-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 180px; } }
@media (prefers-reduced-motion: reduce) { .gallery-grid img { transition: none; } }

/* lightbox */
.lightbox { border: 0; padding: 0; background: transparent; max-width: 94vw; max-height: 92vh; }
.lightbox::backdrop { background: rgba(10, 5, 28, 0.88); }
.lightbox img { max-width: 94vw; max-height: 92vh; display: block; border-radius: 12px; }
.lightbox-close {
  position: fixed; top: 14px; right: 18px; width: 44px; height: 44px; border-radius: 50%; border: 0;
  background: var(--panel); color: var(--text); font-size: 1.8rem; line-height: 1; cursor: pointer;
}

/* resources */
.crisis {
  border: 1px solid rgba(255, 207, 110, 0.55); background: rgba(255, 207, 110, 0.08);
  border-radius: var(--radius); padding: clamp(20px, 3vw, 28px); margin-bottom: 32px;
}
.crisis h3 { color: var(--alert); font-size: 1.25rem; margin-bottom: 14px; }
.crisis-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 14px; }
.crisis-item { background: rgba(18, 10, 46, 0.6); border-radius: 14px; padding: 14px 16px; }
.crisis-item a.num { display: block; font-size: 1.45rem; font-weight: 900; color: var(--text); text-decoration: none; letter-spacing: 0.01em; }
.crisis-item a.num:hover { color: var(--alert); }
.crisis-item span { font-size: 0.9rem; color: var(--muted); }

.res-grid { columns: 2 340px; column-gap: 18px; }
.res-grid .res-group { break-inside: avoid; margin-bottom: 18px; }
.res-group h3 { font-size: 1.15rem; margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }
.res-group h3::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--glow); box-shadow: 0 0 10px var(--pink); flex: none; }
.res-group ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.res-group li { border-top: 1px solid var(--panel-line); padding-top: 12px; }
.res-group li:first-child { border-top: 0; padding-top: 0; }
.res-group a.name { font-weight: 800; color: var(--text); text-decoration: none; }
.res-group a.name:hover { color: var(--pink); text-decoration: underline; }
.res-group p { margin: 2px 0 0; font-size: 0.93rem; color: var(--muted); }
.res-group .contact { display: block; margin-top: 3px; font-size: 0.9rem; font-weight: 700; color: #e6dcff; }
.res-group .contact a { color: inherit; }
.res-note { margin-top: 26px; font-size: 0.9rem; color: var(--muted); max-width: 70ch; }

/* connect */
.connect-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.connect-card {
  display: flex; gap: 14px; align-items: flex-start; text-decoration: none; color: var(--text);
  background: var(--panel); border: 1px solid var(--panel-line); border-radius: var(--radius); padding: 20px;
  transition: border-color 0.2s, transform 0.2s;
}
.connect-card:hover { color: var(--text); border-color: rgba(240, 138, 214, 0.55); transform: translateY(-2px); }
.connect-card svg { width: 30px; height: 30px; flex: none; fill: var(--pink); }
.connect-card strong { display: block; font-size: 1.05rem; }
.connect-card span { display: block; color: var(--muted); font-size: 0.92rem; line-height: 1.4; margin-top: 2px; }

/* footer */
.site-footer { border-top: 1px solid var(--panel-line); padding: 40px 0 56px; color: var(--muted); font-size: 0.92rem; }
.site-footer .wrap { display: grid; grid-template-columns: auto 1fr; gap: 20px 32px; align-items: start; }
.site-footer .mark { width: 54px; opacity: 0.9; }
.site-footer p { margin: 0 0 10px; max-width: 72ch; }
.site-footer a { color: var(--muted); }
@media (max-width: 600px) { .site-footer .wrap { grid-template-columns: 1fr; } }
