/* =========================================================
   Curious Campers Nature School — static rebuild
   Layout mirrors the original Squarespace Fluid Engine grid,
   so block sizes and positions match the live site.
   ========================================================= */

/* ---------- Fonts (self-hosted) ---------- */
@font-face { font-family: "Garet"; src: url("../fonts/Garet-Book.woff") format("woff"); font-weight: 300 400; font-display: swap; }
@font-face { font-family: "Souvenir"; src: url("../fonts/Souvenir-Medium.woff") format("woff"); font-weight: 400 500; font-display: swap; }
@font-face { font-family: "Glacial Indifference"; src: url("../fonts/GlacialIndifference-Regular.woff") format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Glacial Indifference"; src: url("../fonts/GlacialIndifference-Bold.woff") format("woff"); font-weight: 700; font-display: swap; }

/* ---------- Tokens ---------- */
:root {
  --cream: #FFFBF5;
  --brown: #57311C;
  --orange: #D47221;
  --olive: #D7CC63;
  --mint: #E3F2F0;
  --sky: #A6DAFF;
  --sky-pale: #ECF7FF;
  --teal: #007D6B;
  --banner: #824B2E; /* hero card */

  --f-head: "Garet", "Avenir Next", "Futura", system-ui, sans-serif;
  --f-sub: "Souvenir", "ITC Souvenir", Georgia, serif;
  --f-body: "Glacial Indifference", "Century Gothic", "Avenir Next", system-ui, sans-serif;
  --f-btn: "Helvetica Neue", Helvetica, Arial, sans-serif;

  /* Type scale (mobile first) — same formulas Squarespace uses */
  --fs-h1: calc(5.454vw + 1rem);
  --fs-h2: calc(7.01vw + 1rem);
  --fs-h3: calc(2.077vw + 1rem);
  --fs-p:  calc(0.264vw + 1rem);
}
@media (min-width: 768px) {
  :root {
    --fs-h1: calc(2.52vw + 1rem);
    --fs-h2: calc(3.24vw + 1rem);
    --fs-h3: calc(0.96vw + 1rem);
    --fs-p:  calc(0.12vw + 1rem);
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--brown);
  font-family: var(--f-body);
  font-size: var(--fs-p);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
.sr-only, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link:focus { position: fixed; top: 1rem; left: 1rem; z-index: 100; background: var(--cream); padding: .5rem 1rem; }

/* ---------- Typography ---------- */
.t > * { margin: 0; }
.t h1, .t h2 { font-family: var(--f-head); font-weight: 300; letter-spacing: -0.05em; }
.t h1 { font-size: var(--fs-h1); line-height: .916; }
.t h2 { font-size: var(--fs-h2); line-height: .892; }
.t h3 { font-family: var(--f-sub); font-weight: 400; font-size: var(--fs-h3); line-height: .968; }
.t h4 { font-family: var(--f-head); font-weight: 400; font-size: var(--fs-h3); line-height: .968; letter-spacing: -0.05em; }
.t p { font-size: var(--fs-p); line-height: calc(var(--fs-p) * 1.8); } /* fixed length, so bold inline titles don't grow the line */
.t p + p { margin-top: 1rem; }
.t h3 + p { margin-top: 2rem; }
.t p.small { font-size: 1rem; line-height: 28.8px; }
.t strong { font-family: var(--f-sub); font-weight: 400; font-size: 1.5rem; }
.t em, .tag em { font-style: normal; font-size: .9rem; text-transform: uppercase; }
.t .h-scaled { font-size: 37.5px; line-height: 1; letter-spacing: -0.05em; white-space: nowrap; }
.t a { text-decoration: none; }
.t a:hover { text-decoration: underline; }
.t--center { text-align: center; }
.c-light { color: var(--cream); }
@media (max-width: 767px) { .t--m-center, .btn-wrap { text-align: center !important; } }

/* ---------- Buttons ---------- */
.btn-wrap--right { text-align: right; }
.btn-wrap--left { text-align: left; }
.btn {
  display: inline-block;
  font-family: var(--f-btn); font-weight: 500;
  font-size: 14.987px; letter-spacing: .02em; text-transform: uppercase; text-decoration: none; line-height: 1.2;
  padding: 17.98px 30.03px;
  border: 1px solid currentColor; border-radius: 300px;
  transition: background-color .25s, color .25s;
}
@media (min-width: 768px) { .btn { font-size: 14.272px; padding: 17.13px 28.6px; } }
.btn--light { color: var(--cream); }
.btn--light:hover { background: var(--cream); color: var(--banner); }
.btn--dark { color: var(--brown); }
/* Hover effect from the original: nudge right + grow, springy */
.btn--nudge { transition: translate .5s cubic-bezier(.34, 1.56, .64, 1), scale .5s cubic-bezier(.34, 1.56, .64, 1), background-color .25s, color .25s; }
.btn--nudge:hover { translate: 15px 0; scale: 1.1; }

/* ---------- Header ---------- */
.site-header {
  position: absolute; inset: 0 0 auto 0; z-index: 50;
  height: 103px; padding: 0 6vw;
  display: flex; align-items: center; justify-content: space-between;
}
.site-header__logo img { width: 145px; height: auto; margin-top: -2px; }
.site-nav {
  position: absolute; left: 50%; top: 50%; translate: -50% -50%;
  display: flex; flex-wrap: nowrap; white-space: nowrap; justify-content: center; column-gap: 28px;
}
.site-nav a {
  color: var(--cream); text-decoration: none;
  font-family: var(--f-body); font-size: 14.4px; line-height: 29px; text-transform: uppercase;
  background-image: linear-gradient(currentColor, currentColor); background-size: 0 1px; background-repeat: no-repeat; background-position: 0 85%;
  transition: background-size .3s;
}
.site-nav a:hover, .site-nav a[aria-current] { background-size: 100% 1px; }
.nav-toggle { display: none; }

@media (max-width: 767px) {
  .site-header { height: 102px; padding: 0 6vw; }
  .site-header__logo img { width: 121px; }
  .nav-toggle {
    display: grid; gap: 6px; width: 50px; height: 37px; place-content: center;
    background: none; border: 0; cursor: pointer; position: relative; z-index: 60;
  }
  .nav-toggle span:not(.sr-only) { width: 26px; height: 1.5px; background: var(--cream); transition: transform .3s, background .3s; }
  .nav-toggle[aria-expanded="true"] span:nth-of-type(2) { transform: translateY(3.75px) rotate(45deg); background: var(--brown); }
  .nav-toggle[aria-expanded="true"] span:nth-of-type(3) { transform: translateY(-3.75px) rotate(-45deg); background: var(--brown); }
  .site-nav {
    position: fixed; inset: 0; translate: none; width: auto; top: 0;
    flex-direction: column; flex-wrap: nowrap; justify-content: center; align-items: center; gap: 1.2rem;
    background: var(--cream); opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s; z-index: 55;
  }
  .site-nav.is-open { opacity: 1; visibility: visible; }
  .site-nav a { color: var(--brown); font-family: var(--f-head); font-size: 2.2rem; line-height: 1.3; text-transform: none; letter-spacing: -0.04em; }
}

/* ---------- Sections ---------- */
main { position: relative; z-index: 1; }
.sec { position: relative; }
/* the first section leaves room for the header, as on Squarespace */
.sec--hero { padding-top: 102px; }
@media (min-width: 768px) { .sec--hero { padding-top: 103.4px; } }
.sec__bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.sec--hero .sec__bg { background: var(--brown) url("../images/cc-bg-creek-wide.webp") center / cover no-repeat; }
.sec--hero .sec__bg::after { content: ""; position: absolute; inset: 0; background: var(--brown); opacity: .2; }
.sec--cream { background: var(--cream); }
.sec--sky { background: var(--sky-pale); }
.sec--footer { padding: 3.3vmax 0; color: var(--cream); }
.sec--footer .sec__bg { background: var(--orange) url("../images/cc-bg-creek-wide.webp") center / cover no-repeat; }
.sec--footer .sec__bg::after { content: ""; position: absolute; inset: 0; background: var(--orange); opacity: .6; }

/* Footer reveal: the footer sits behind the page and stays pinned to the
   bottom of the screen, so the content scrolls away to uncover it. */
.site-footer { position: sticky; bottom: 0; z-index: 0; }

/* ---------- Fluid grid (Squarespace Fluid Engine) ---------- */
.fe {
  --gutter: calc(6vw - 11px);
  --cell: calc((1500px - 77px) / 8);
  --dir: initial; --gap: initial; --jc: initial; --ai: initial; --pad: initial; --bg: initial; --rad: initial;
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: minmax(var(--gutter), 1fr) repeat(8, minmax(0, var(--cell))) minmax(var(--gutter), 1fr);
  grid-template-rows: repeat(var(--rm), minmax(24px, auto));
  gap: 11px;
  overflow-x: clip;
}
@media (min-width: 768px) {
  .fe {
    --gutter: calc(6vw - 11px);
    --cell: calc((1500px - 253px) / 24);
    --cw: min(1500px, 88vw);
    grid-template-columns: minmax(var(--gutter), 1fr) repeat(24, minmax(0, var(--cell))) minmax(var(--gutter), 1fr);
    grid-template-rows: repeat(var(--rd), minmax(calc(var(--cw) * .0215), auto));
  }
}

/* Blocks */
.b { position: relative; grid-area: var(--m); z-index: var(--mz, auto); display: flex; flex-direction: column; min-width: 0; }
@media (min-width: 768px) { .b { grid-area: var(--d); z-index: var(--dz, auto); } }
.b > .st, .b > .fill { flex: 1; }
/* image blocks fill their grid area without stretching the rows */
.b > .img { position: absolute; inset: 0; }
.fill { width: 100%; height: 100%; }
.fill--cream { background: var(--cream); }

/* Images: fill their box; cut-outs keep their whole shape */
.img { width: 100%; height: 100%; object-fit: contain; }
.img--cover { object-fit: cover; }

/* Visibility per breakpoint */
@media (max-width: 767px) { .only-desktop { display: none !important; } }
@media (min-width: 768px) { .only-mobile { display: none !important; } }

/* ---------- Stacks (Squarespace flex "stacks") ---------- */
.st {
  /* reset: custom properties inherit, so every stack starts from defaults */
  --dir: column; --gap: 20px; --jc: flex-start; --ai: flex-start; --pad: 0px; --bg: transparent; --rad: 0px;
  --m-dir: initial; --m-gap: initial; --m-jc: initial; --m-ai: initial; --m-pad: initial;
  display: flex; box-sizing: border-box; width: 100%;
  flex-direction: var(--m-dir, var(--dir, column));
  gap: var(--m-gap, var(--gap, 20px));
  justify-content: var(--m-jc, var(--jc, flex-start));
  align-items: var(--m-ai, var(--ai, flex-start));
  padding: var(--m-pad, var(--pad, 0));
  background: var(--bg, transparent);
  border-radius: var(--rad, 0);
}
.st--paper { background: url("../images/cc-paper.webp") center / 100% 100% no-repeat; }
.c {
  /* reset: custom properties inherit, so every child starts from defaults */
  --w: auto; --h: auto; --as: auto; --fl: 0 0 auto; --mb: 0px; --va: flex-start;
  --m-w: initial; --m-h: initial; --m-as: initial; --m-fl: initial; --m-mb: initial; --m-va: initial; --m-minh: initial; --m-minw: initial;
  display: flex; flex-direction: column; position: relative;
  justify-content: var(--m-va, var(--va, flex-start));
  width: var(--m-w, var(--w, auto));
  height: var(--m-h, var(--h, auto));
  align-self: var(--m-as, var(--as, auto));
  flex: var(--m-fl, var(--fl, 0 0 auto));
  min-width: var(--m-minw, 20px); min-height: var(--m-minh, 20px);
  margin-bottom: var(--m-mb, var(--mb, 0));
}
@media (min-width: 768px) {
  .st {
    flex-direction: var(--dir, column); gap: var(--gap, 20px);
    justify-content: var(--jc, flex-start); align-items: var(--ai, flex-start);
    padding: var(--pad, 0);
  }
  .c {
    justify-content: var(--va, flex-start);
    width: var(--w, auto); height: var(--h, auto);
    align-self: var(--as, auto); flex: var(--fl, 0 0 auto);
    min-width: 20px; min-height: 20px; margin-bottom: var(--mb, 0);
  }
}
.c > .st { flex: 1; }
.c > .img { flex: 1; min-height: 0; }

/* Beliefs card on mobile: the four titles sit at equal distances from each other */
@media (max-width: 767px) {
  .beliefs-grid { --belief-gap: 48px; }
  .beliefs-grid .t p.title:not(:first-child) { margin-top: 48px; }
  .beliefs-grid .spacer { display: none; }
}

/* Age tags */
.tag { text-align: center; }
.tag p { margin: 0; font-size: var(--fs-p); line-height: calc(var(--fs-p) * 1.8); }
.tag--orange { background: var(--orange); color: var(--cream); }
.tag--blue   { background: var(--sky); }
.tag--olive  { background: var(--olive); }
.tag--teal   { background: var(--teal); color: var(--cream); }

/* ---------- Motion (settings copied from the original's block animations) ---------- */
/* Loop: "hop" — 1.5s, Squarespace custom curve (0.1, 40, 0.8, 30) */
@keyframes cc-loop-1   { from { translate: 0 0; } to { translate: 0 -1%; } }
@keyframes cc-loop-02  { from { translate: 0 0; } to { translate: 0 -0.2%; } }
.loop-hop   { animation: cc-loop-1 1.5s cubic-bezier(.1, 40, .8, 30) infinite; }
.loop-float { animation: cc-loop-02 1.5s cubic-bezier(.1, 40, .8, 30) infinite; }

/* Appear: slide in once when the section scrolls into view (0.8s, ease) */
[data-appear] { transition: translate .8s ease; }
.js [data-appear="left"]:not(.is-in)  { translate: -200px 0; }
.js [data-appear="right"]:not(.is-in) { translate: 200px 0; }
.js [data-appear="up"]:not(.is-in)    { translate: 0 100%; }

/* Inquire button sits inside a block that slides; keep the section edges clean */
#about .fe, #inquire .fe { overflow: clip; }

@media (prefers-reduced-motion: reduce) {
  .loop-hop, .loop-float { animation: none; }
  [data-appear], [data-scroll], [data-follow] { translate: none !important; scale: none !important; rotate: none !important; opacity: 1 !important; transition: none !important; }
  .btn--nudge:hover { translate: none; scale: none; }
}
