/* The Cottage — thecottagebc.ca
   Colours come from the illustrated cottage logo: coral script, campfire amber, pine and cabin wood,
   set against a lake-at-night background. Change the brand here and it flows through the site. */
:root {
  --night: #0f1713;
  --night-2: #15201a;
  --night-3: #1c2a22;
  --pine: #2f4a39;
  --moss: #7fa77f;
  --cream: #f6ecdc;
  --cream-dim: #cfc4b2;
  --coral: #f2705e;
  --amber: #f7b24a;
  --ember: #e8563f;
  --wood: #8a5a3b;
  --line: rgba(246, 236, 220, .12);
  --glow: linear-gradient(100deg, var(--coral) 0%, #f68a52 45%, var(--amber) 100%);
  --radius: 18px;
  --shadow: 0 18px 50px -20px rgba(0, 0, 0, .7);
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --body: "Nunito Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --wrap: 1180px;
  --header-h: 68px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 8px); }
body {
  margin: 0;
  background: var(--night);
  color: var(--cream);
  font: 400 1.0625rem/1.7 var(--body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--amber); text-underline-offset: 3px; }
a:hover { color: var(--coral); }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.15; margin: 0; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
strong { color: #fff; font-weight: 800; }
.wrap { width: min(var(--wrap), 100% - 40px); margin-inline: auto; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--amber); color: var(--night); padding: 10px 16px; border-radius: 10px; font-weight: 800; }
.skip:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; border-radius: 6px; }

.glow {
  background: var(--glow);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  font-style: italic;
  /* Gradient text is painted only inside the element's box, and italic letters lean past it.
     inline-block + padding gives the slant and descenders room (Safari clips otherwise). */
  display: inline-block;
  padding: .02em .22em .12em .06em;
  margin: -.02em -.18em -.12em -.06em;
}
.eyebrow {
  font: 800 .78rem/1 var(--body);
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--moss);
  margin-bottom: 14px;
  display: flex; align-items: center; gap: 12px;
}
.eyebrow::before { content: ""; width: 28px; height: 2px; border-radius: 2px; background: var(--glow); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 24px; border-radius: 999px;
  font: 800 .95rem/1 var(--body); letter-spacing: .02em;
  text-decoration: none; cursor: pointer;
  transition: transform .2s, box-shadow .2s, background-color .2s, color .2s;
}
.btn-primary { background: var(--glow); color: #2a130c; box-shadow: 0 10px 30px -10px rgba(242, 112, 94, .8); }
.btn-primary:hover { color: #2a130c; transform: translateY(-2px); box-shadow: 0 14px 34px -10px rgba(247, 178, 74, .9); }
.btn-ghost { color: var(--cream); border: 1.5px solid rgba(246, 236, 220, .45); background: rgba(15, 23, 19, .35); backdrop-filter: blur(6px); }
.btn-ghost:hover { color: var(--night); background: var(--cream); border-color: var(--cream); transform: translateY(-2px); }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 50; height: var(--header-h);
  transition: background-color .3s, box-shadow .3s, backdrop-filter .3s;
}
.site-header.scrolled { background: rgba(15, 23, 19, .82); backdrop-filter: blur(14px) saturate(1.3); box-shadow: 0 1px 0 var(--line); }
.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--cream); text-decoration: none; font: 700 1.15rem/1 var(--display); }
.brand img { width: 44px; height: 44px; object-fit: contain; filter: drop-shadow(0 2px 6px rgba(0,0,0,.5)); transition: transform .3s; }
.brand:hover { color: var(--cream); }
.brand:hover img { transform: rotate(-6deg) scale(1.06); }
#site-nav { display: flex; align-items: center; gap: 6px; }
#site-nav a { color: var(--cream); text-decoration: none; font-weight: 700; font-size: .95rem; padding: 9px 14px; border-radius: 999px; transition: background-color .2s, color .2s; }
#site-nav a:hover { background: rgba(246, 236, 220, .1); }
#site-nav a.nav-cta { border: 1.5px solid var(--coral); color: var(--cream); margin-left: 6px; }
#site-nav a.nav-cta:hover { background: var(--coral); color: #2a130c; }
.nav-toggle { display: none; }

@media (max-width: 760px) {
  .nav-toggle {
    display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 12px;
    background: rgba(15, 23, 19, .5); cursor: pointer;
  }
  .nav-toggle i, .nav-toggle i::before, .nav-toggle i::after {
    display: block; width: 20px; height: 2px; border-radius: 2px; background: var(--cream); position: relative; transition: transform .25s, background-color .25s;
  }
  .nav-toggle i::before, .nav-toggle i::after { content: ""; position: absolute; left: 0; }
  .nav-toggle i::before { top: -6px; } .nav-toggle i::after { top: 6px; }
  .nav-toggle[aria-expanded="true"] i { background: transparent; }
  .nav-toggle[aria-expanded="true"] i::before { transform: translateY(6px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] i::after { transform: translateY(-6px) rotate(-45deg); }
  #site-nav {
    position: absolute; top: var(--header-h); left: 12px; right: 12px; flex-direction: column; align-items: stretch;
    background: rgba(21, 32, 26, .97); backdrop-filter: blur(14px); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 10px; box-shadow: var(--shadow);
    opacity: 0; transform: translateY(-8px); pointer-events: none; transition: opacity .2s, transform .2s;
  }
  #site-nav.open { opacity: 1; transform: none; pointer-events: auto; }
  #site-nav a { padding: 14px 16px; font-size: 1.05rem; }
  #site-nav a.nav-cta { margin: 6px 0 0; text-align: center; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: min(92svh, 820px); display: grid; place-items: center; overflow: hidden;
  padding: calc(var(--header-h) + 24px) 0 64px; isolation: isolate;
}
.hero-bg, .hero-bg img { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; }
.hero-bg img { object-fit: cover; object-position: center 40%; transform: scale(1.06); animation: drift 30s ease-in-out infinite alternate; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(ellipse 60% 45% at 50% 48%, rgba(15, 23, 19, .15), rgba(15, 23, 19, .55) 70%),
    linear-gradient(180deg, rgba(15, 23, 19, .55) 0%, rgba(15, 23, 19, .1) 35%, rgba(15, 23, 19, .35) 70%, var(--night) 100%);
}
@keyframes drift { from { transform: scale(1.06) translate(0, 0); } to { transform: scale(1.12) translate(-1.5%, -1%); } }
.hero-inner { text-align: center; display: flex; flex-direction: column; align-items: center; }
.hero-logo { width: min(620px, 86vw); margin: 0 auto; }
.hero-logo img {
  width: 100%;
  filter: drop-shadow(0 0 18px rgba(247, 178, 74, .45)) drop-shadow(0 6px 30px rgba(0, 0, 0, .55));
  animation: rise 1.2s cubic-bezier(.2, .7, .2, 1) both;
}
.hero-eyebrow {
  margin: 10px 0 34px; font: 800 clamp(.8rem, 1.6vw, 1rem)/1 var(--body); letter-spacing: .42em; text-transform: uppercase;
  padding-left: .42em; color: var(--cream); text-shadow: 0 2px 14px rgba(0,0,0,.7);
  animation: rise 1.2s .25s cubic-bezier(.2, .7, .2, 1) both;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; animation: rise 1.2s .4s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
.next-up {
  margin: 26px 0 0; display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 4px 12px;
  padding: 10px 18px; border-radius: 999px; background: rgba(15, 23, 19, .6); border: 1px solid var(--line); backdrop-filter: blur(8px);
  font-size: .92rem;
}
.next-up[hidden] { display: none; }
.next-up b { color: var(--amber); }

/* fireflies over the night photo */
.fireflies { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.fireflies i {
  position: absolute; width: 5px; height: 5px; border-radius: 50%;
  background: #ffd98a; box-shadow: 0 0 10px 3px rgba(255, 196, 92, .7);
  opacity: 0; animation: firefly 9s ease-in-out infinite;
}
.fireflies i:nth-child(1)  { left: 8%;  top: 62%; animation-delay: 0s; }
.fireflies i:nth-child(2)  { left: 18%; top: 38%; animation-delay: 2.1s; animation-duration: 11s; }
.fireflies i:nth-child(3)  { left: 27%; top: 74%; animation-delay: 4.3s; }
.fireflies i:nth-child(4)  { left: 36%; top: 22%; animation-delay: 1.2s; animation-duration: 12s; }
.fireflies i:nth-child(5)  { left: 46%; top: 82%; animation-delay: 6s; }
.fireflies i:nth-child(6)  { left: 57%; top: 30%; animation-delay: 3.3s; animation-duration: 10s; }
.fireflies i:nth-child(7)  { left: 66%; top: 68%; animation-delay: .6s; }
.fireflies i:nth-child(8)  { left: 74%; top: 18%; animation-delay: 5.1s; animation-duration: 13s; }
.fireflies i:nth-child(9)  { left: 82%; top: 56%; animation-delay: 2.7s; }
.fireflies i:nth-child(10) { left: 91%; top: 34%; animation-delay: 7.2s; animation-duration: 11s; }
.fireflies i:nth-child(11) { left: 13%; top: 86%; animation-delay: 8s; }
.fireflies i:nth-child(12) { left: 88%; top: 80%; animation-delay: 4.8s; animation-duration: 12s; }
@keyframes firefly {
  0%, 100% { opacity: 0; transform: translate(0, 0) scale(.6); }
  20% { opacity: .95; }
  50% { opacity: .35; transform: translate(26px, -34px) scale(1); }
  75% { opacity: .9; transform: translate(-14px, -60px) scale(.8); }
}
.hero.paused *, .hero.paused { animation-play-state: paused !important; }

/* ---------- Sections ---------- */
.section { padding: clamp(32px, 4.5vw, 54px) 0; position: relative; }
.welcome { padding-top: clamp(36px, 5vw, 60px); }
.past { padding-bottom: clamp(44px, 6vw, 70px); }
.section-head { margin-bottom: clamp(18px, 2.8vw, 28px); }
.section h2 { font-size: clamp(2.2rem, 5vw, 3.6rem); }

/* Welcome */
.welcome { background: radial-gradient(ellipse 70% 60% at 85% 40%, rgba(242, 112, 94, .1), transparent 70%), var(--night); }
.welcome-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(24px, 5vw, 64px); align-items: center; }
.welcome-text h2 { margin-bottom: 16px; }
.welcome-text p { color: var(--cream-dim); font-size: 1.1rem; max-width: 60ch; }
.welcome-text p:first-of-type { color: var(--cream); font-size: 1.22rem; }
.welcome-art { margin: 0; position: relative; }
.welcome-art::before {
  content: ""; position: absolute; inset: 12% 8% 4%; z-index: -1; border-radius: 50%;
  background: radial-gradient(circle, rgba(247, 178, 74, .35), rgba(242, 112, 94, .12) 50%, transparent 70%);
  filter: blur(20px); animation: hearth 4s ease-in-out infinite alternate;
}
@keyframes hearth { from { opacity: .7; transform: scale(.96); } to { opacity: 1; transform: scale(1.04); } }
.welcome-art img { width: 100%; max-width: 460px; margin-inline: auto; filter: drop-shadow(0 24px 40px rgba(0,0,0,.55)); animation: bob 6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-10px) rotate(-1deg); } }

.follow {
  margin-top: clamp(26px, 3.5vw, 36px); padding: clamp(20px, 3vw, 28px);
  border: 1px solid var(--line); border-radius: calc(var(--radius) + 6px);
  background: linear-gradient(135deg, rgba(47, 74, 57, .45), rgba(28, 42, 34, .3));
  text-align: center;
}
.follow h3 { font-size: clamp(1.15rem, 2.2vw, 1.4rem); font-weight: 500; font-style: italic; margin-bottom: 16px; }
.socials { display: flex; flex-wrap: wrap; gap: 10px; }
.follow .socials { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.social {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 12px 14px; border-radius: 999px;
  background: rgba(246, 236, 220, .07); border: 1px solid var(--line); color: var(--cream); text-decoration: none;
  font-weight: 700; font-size: .92rem; white-space: nowrap; transition: transform .2s, background-color .2s, border-color .2s, color .2s;
}
.social svg { width: 22px; height: 22px; fill: currentColor; flex: none; }
.social:hover { transform: translateY(-2px); color: #fff; border-color: transparent; }
.social-facebook:hover, .social-group:hover { background: #1877f2; }
.social-instagram:hover { background: linear-gradient(45deg, #f09433, #dc2743 50%, #bc1888); }
.social-eventbrite:hover { background: #f05537; }
.social-soundcloud:hover { background: #ff5500; }

/* Events */
.events { background: linear-gradient(180deg, var(--night), var(--night-2)); }
.event-list { display: grid; gap: 18px; }
.event {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 0; overflow: hidden;
  background: var(--night-3); border: 1px solid var(--line); border-radius: calc(var(--radius) + 4px); box-shadow: var(--shadow);
}
.event-flyer { display: flex; align-items: center; background: #090d0b; }
.event-flyer img { width: 100%; height: auto; cursor: zoom-in; }
.event-body { padding: clamp(22px, 3.5vw, 36px); display: flex; flex-direction: column; }
.event-date { color: var(--amber); font-weight: 800; font-size: .9rem; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 10px; }
.event h3 { font-size: clamp(1.5rem, 3vw, 2.1rem); margin-bottom: 12px; }
.event .meta { color: var(--cream-dim); margin-bottom: 8px; }
.event .desc { margin-bottom: 14px; }
.event-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; padding-top: 12px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.tag { font-size: .75rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--moss); border: 1px solid rgba(127, 167, 127, .4); padding: 4px 10px; border-radius: 999px; }
.events-empty {
  margin: 0; padding: 34px clamp(22px, 4vw, 40px); border-radius: var(--radius);
  border: 1.5px dashed rgba(246, 236, 220, .22); color: var(--cream-dim); font-size: 1.1rem; text-align: center;
}

/* Tribute over the summer camp photo */
.tribute { position: relative; padding: clamp(64px, 9vw, 112px) 0; overflow: hidden; isolation: isolate; }
.tribute-bg { position: absolute; inset: -12% 0; z-index: -2; }
.tribute-bg img { width: 100%; height: 100%; object-fit: cover; transform: translateY(var(--para, 0)); will-change: transform; }
.tribute::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, var(--night-2) 0%, rgba(15, 23, 19, .25) 22%, rgba(15, 23, 19, .2) 78%, var(--night) 100%);
}
.tribute-card {
  margin: 0 auto; max-width: 940px; padding: clamp(26px, 4vw, 48px);
  background: rgba(15, 23, 19, .72); backdrop-filter: blur(10px) saturate(1.2);
  border: 1px solid rgba(246, 236, 220, .16); border-radius: calc(var(--radius) + 8px); box-shadow: var(--shadow);
  text-align: center;
}
.tribute-lead { font: 500 clamp(1.45rem, 3.2vw, 2.25rem)/1.25 var(--display); color: var(--cream); margin-bottom: 18px; text-wrap: balance; }
.tribute-card p:last-child { color: var(--cream-dim); font-size: 1.1rem; margin: 0 auto; max-width: 64ch; }

/* Past events: poster wall */
.past { background: var(--night); }
.poster-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 18px; }
.poster { margin: 0; border-radius: var(--radius); overflow: hidden; background: var(--night-3); border: 1px solid var(--line); transition: transform .3s, box-shadow .3s, border-color .3s; }
.poster:hover { transform: translateY(-4px) rotate(-.4deg); box-shadow: 0 24px 50px -22px rgba(0, 0, 0, .9), 0 0 0 1px rgba(247, 178, 74, .35); border-color: transparent; }
.poster img { width: 100%; aspect-ratio: 1.91 / 1; object-fit: cover; cursor: zoom-in; transition: transform .5s; }
.poster:hover img { transform: scale(1.035); }
.poster picture { display: block; overflow: hidden; }
.poster figcaption { padding: 14px 18px 16px; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.poster figcaption b { font: 700 1.08rem/1.2 var(--display); }
.poster figcaption span { color: var(--cream-dim); font-size: .85rem; white-space: nowrap; }

/* ---------- Footer ---------- */
.site-footer { padding: 36px 0 30px; border-top: 1px solid var(--line); background: radial-gradient(ellipse 50% 70% at 50% 100%, rgba(242,112,94,.12), transparent 70%), var(--night); }
.footer-inner { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.footer-logo { width: 120px; filter: drop-shadow(0 12px 24px rgba(0,0,0,.5)); }
.socials-small { justify-content: center; }
.socials-small .social { padding: 10px; }
.socials-small .social span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.footer-line { margin: 0; color: var(--cream-dim); font-size: .9rem; letter-spacing: .06em; }

.to-top {
  position: fixed; right: 18px; bottom: 18px; z-index: 40; width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center; background: var(--night-3); border: 1px solid var(--line); box-shadow: var(--shadow);
  opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity .3s, transform .3s, background-color .2s;
}
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top svg { width: 22px; fill: var(--cream); }
.to-top:hover { background: var(--coral); }

/* ---------- Lightbox ---------- */
.lightbox { border: 0; padding: 0; background: transparent; max-width: min(1400px, 94vw); max-height: 92vh; overflow: visible; }
.lightbox::backdrop { background: rgba(8, 12, 10, .88); backdrop-filter: blur(6px); }
.lightbox img { max-width: 100%; max-height: 88vh; border-radius: 12px; box-shadow: var(--shadow); }
.lightbox-close { position: absolute; top: -18px; right: -14px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--cream); color: var(--night); font-size: 1.6rem; line-height: 1; cursor: pointer; }

/* ---------- Scroll reveal (added by main.js) ---------- */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s cubic-bezier(.2,.7,.2,1), transform .8s cubic-bezier(.2,.7,.2,1); transition-delay: calc(var(--i, 0) * 70ms); }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- Small screens ---------- */
@media (max-width: 860px) {
  .welcome-grid { grid-template-columns: 1fr; }
  .welcome-art { order: -1; }
  .event { grid-template-columns: 1fr; }
  .follow .socials { display: flex; flex-wrap: wrap; justify-content: center; }
  .follow .socials .social { flex: 0 1 calc(33.333% - 7px); }
  .hero { min-height: 74svh; padding-bottom: 48px; }
  .welcome-art img { max-width: 240px; }
}
@media (max-width: 480px) {
  .hero-eyebrow { letter-spacing: .28em; padding-left: .28em; }
  .follow .socials { gap: 8px; }
  .follow .socials .social { flex-basis: calc(50% - 4px); padding: 11px 8px; gap: 7px; font-size: .84rem; }
  .follow .socials .social:last-child { flex-basis: 100%; }
  .social svg { width: 18px; height: 18px; }
  .hero { min-height: 68svh; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .fireflies { display: none; }
}
