/* ===== Site chrome: the one header, shared by every page =====
   Loaded after styles.css by the home page and by every interior page, so
   the nav is identical everywhere. The bar is fixed and full width; pages
   that lay out in normal flow clear it with a .head-spacer, and the home
   page's absolute 1440 canvas simply passes underneath it. */

:root {
  --head-h: clamp(78px, 6.5vw, 86px);
  --shell:  1260px;   /* content column = the home canvas's 1440 minus its 90px gutters */
}

.shell { width: min(var(--shell), 100% - 44px); margin-inline: auto; }

.site-head-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  background: rgba(252, 248, 235, 0.82);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1.5px solid rgba(38, 38, 38, 0.07);
}
.site-head {
  height: var(--head-h);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.head-spacer { height: var(--head-h); }

.site-head .logo { display: block; flex: none; }
.site-head .logo img { display: block; width: clamp(104px, 9vw, 130px); height: auto; }

.site-nav { display: flex; gap: clamp(22px, 3.1vw, 45px); align-items: center; }
.nav-link {
  font-family: var(--jua); font-weight: 400; font-size: clamp(18px, 1.7vw, 24px);
  color: var(--ink); text-decoration: none; white-space: nowrap;
}
.nav-cta {
  background: #1ea858; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding: 8px clamp(18px, 2.2vw, 32px); border-radius: 360px; transition: background 0.2s;
  font-family: var(--jua); font-size: clamp(18px, 1.7vw, 24px); color: #fff; white-space: nowrap;
}
.nav-cta:hover { background: #17903f; }

/* ---- dropdowns (Projects, Let's Shape What's Next) ---- */
.drop { position: relative; display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.drop-arrow { width: 12px; height: 5px; display: inline-block; transition: transform 0.25s; }
.drop-arrow img { display: block; width: 100%; height: 100%; }
.drop[aria-expanded="true"] .drop-arrow { transform: rotate(180deg); }
.drop-menu {
  position: absolute; top: calc(100% + 14px); z-index: 100;
  /* shrink-to-fit on an absolutely positioned box is capped by its containing
     block, and .drop is only as wide as the word "Projects" — so a long pill
     like "Growing Minds in 3D" was overflowing its own background. */
  width: max-content;
  display: flex; flex-direction: column; gap: 12px;
  opacity: 0; pointer-events: none; transform: translateY(-8px);
  transition: opacity 0.22s, transform 0.22s;
}
.drop-menu.right { right: 0; align-items: flex-end; }
.drop-menu.mid   { left: 50%; transform: translateX(-50%) translateY(-8px); align-items: center; }
.drop-menu.open  { opacity: 1; pointer-events: auto; transform: translateY(0); }
.drop-menu.mid.open { transform: translateX(-50%) translateY(0); }

/* ---- burger: takes over from the nav once it stops fitting ---- */
.burger {
  display: none; width: 42px; height: 42px; border: none; background: none; cursor: pointer;
  flex-direction: column; justify-content: center; gap: 5px; padding: 9px;
}
.burger span { height: 2.5px; background: var(--ink); border-radius: 3px; transition: transform .25s, opacity .2s; }
.burger.open span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

.mob-menu {
  position: fixed; top: var(--head-h); left: 0; right: 0; z-index: 59; display: none;
  flex-direction: column; gap: 6px; padding: 12px 22px 22px;
  background: var(--cream); border-bottom: 1.5px solid rgba(38, 38, 38, 0.1);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.12);
}
.mob-menu.open { display: flex; }
.mob-menu a { font-family: var(--jua); font-size: 20px; color: var(--ink); text-decoration: none; padding: 12px 4px; }
.mob-menu .shape-opt { justify-content: center; padding: 14px 19px; font-size: 21px; }
.mob-menu .group { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }

@media (max-width: 900px) {
  .site-nav { display: none; }
  .burger   { display: flex; }
}

/* ===== Site footer: one footer for every page ==========================
   The coloured bands run the full width of the viewport; the 1440 composition
   (cutting mat, badge, columns) sits centred on top of them and is scaled to
   fit, exactly as the home canvas is. Page accent comes from --foot-accent. */
.foot-scale { position: relative; width: 100%; overflow: hidden; }

.foot-band { position: absolute; left: 0; right: 0; z-index: 0; }
.foot-band.accent { top: 0; background: var(--foot-accent, #3a89b8); }
.foot-band.accent::after {          /* the stitched rule, full-bleed with the band */
  content: ''; position: absolute; left: 0; right: 0; top: var(--rule-y, 20px);
  height: var(--rule-h, 4px);
  /* a gradient, not `border-top: dashed`, because CSS gives no control over
     dash length or gap - and these have to scale with the footer. */
  background-image: repeating-linear-gradient(to right,
      var(--foot-rule, rgba(252, 248, 235, 0.85)) 0 var(--rule-dash, 20px),
      transparent var(--rule-dash, 20px) calc(var(--rule-dash, 20px) + var(--rule-gap, 14px)));
}
.foot-band.ground { background: #0e0e0e; }

/* The board the footer is pinned to: a pale card lifted off the black ground,
   riding up into the accent band the way the cutting mat used to. Deliberately
   NOT overflow:hidden - the badge's hover tilt swings past the edge. */
.foot-panel {
  position: absolute; left: 84px; top: -44px;
  width: 1274px; height: 546px;
  border-radius: 37px;
  background: var(--foot-card, #fcf8eb);
}
/* SVG rather than `border: dashed`, so the dashes stay evenly spaced around the
   rounded corners. No vector-effect: the stroke should shrink with the footer. */
.foot-stitch { position: absolute; left: 0; top: 0; pointer-events: none; }
.foot-stitch rect {
  fill: none; stroke: rgba(38, 38, 38, 0.5);
  stroke-width: 3; stroke-dasharray: 14 12; stroke-linecap: round;
}

/* scaled from the top centre so it stays centred as it shrinks */
.foot-design {
  position: absolute; top: 0; left: 50%; margin-left: -720px;
  width: 1440px; height: 1371px;
  transform-origin: top center; overflow: hidden; z-index: 1;
}

/* phone footer: the stacked version */
.foot-phone { display: none; max-width: 520px; margin: 0 auto; }
.foot-phone .cta-wrap { padding-top: 48px; }
.foot-phone .cols { display: flex; gap: 44px; }

@media (max-width: 899px) {
  .foot-scale { display: none; }
  .foot-phone { display: block; }
}

.mh-cta{ background:var(--foot-accent, #3a89b8); padding:48px 26px; text-align:center; display:flex; flex-direction:column; align-items:center; gap:18px;
  width:100vw; position:relative; left:50%; margin-left:-50vw; }
/* the same stitched rule the desktop band carries, at phone scale */
.mh-cta::before{ content:''; position:absolute; left:0; right:0; top:13px; height:3px;
  background-image: repeating-linear-gradient(to right,
      var(--foot-rule, rgba(252,248,235,0.85)) 0 13px, transparent 13px 22px); }
.mh-cta h2{ font-family:var(--jua); font-size:44px; line-height:1.05; color:var(--foot-ink, #fcf8eb); }
.mh-cta p{ font-family:var(--futura); font-weight:500; font-size:15.5px; line-height:1.6; color:var(--foot-ink, #fcf8eb); }

/* footer */
/* the black ground stays full-bleed; the pale card is inset inside it */
.mh-footer{ position:relative; margin-top:22px; padding:14px 0;
  background:#0e0e0e; width:100vw; left:50%; margin-left:-50vw; }
.mh-footer .inner{ position:relative; margin:0 14px; padding:30px 26px;
  border-radius:22px; background:var(--foot-card, #fcf8eb);
  display:flex; flex-direction:column; gap:26px; color:#262626; }
/* at phone size the corners of a CSS dashed border are nobody's problem */
.mh-footer .inner::before{ content:''; position:absolute; inset:10px;
  border:2.5px dashed rgba(38,38,38,.45); border-radius:14px; pointer-events:none; }
.mh-footer .badge{ width:150px; height:auto; }
.mh-footer h4{ font-family:var(--jua); font-size:30px; color:#262626; margin-bottom:14px; }
.mh-footer a.link{ display:block; font-family:var(--futura); font-weight:500; font-size:18px; color:#262626; text-decoration:none; margin-bottom:12px; }
.mh-footer .icons{ display:flex; gap:24px; align-items:center; }
.mh-footer .icons img{ height:56px; width:auto; filter:drop-shadow(0 4px 4px rgba(0,0,0,0.25)); }
.mh-footer .copy{ font-family:var(--futura); font-weight:500; font-size:13px; color:#262626; opacity:.6; }

/* ===== Micro-interactions ==============================================
   One layer, site-wide. Everything is short (120–320ms), small in travel
   (≤4px / ≤3%), and driven by transform/opacity only so nothing triggers
   layout. All of it collapses under prefers-reduced-motion. */

/* --- shared easing + focus ------------------------------------------- */
:root { --ease-out: cubic-bezier(.22,1,.36,1); --ease-soft: cubic-bezier(.33,1,.68,1); }

:where(a, button, [role="button"], .drop):focus-visible {
  outline: 2.5px solid var(--foot-accent, #1ea858);
  outline-offset: 3px;
  border-radius: 6px;
}

/* --- the header condenses a little once you leave the top ------------- */
.site-head-bar {
  transition: background .3s ease, box-shadow .3s ease, backdrop-filter .3s ease;
}
.site-head-bar.scrolled {
  background: rgba(252, 248, 235, 0.92);
  box-shadow: 0 6px 26px rgba(38, 38, 38, 0.07);
}
.site-head .logo img { transition: transform .3s var(--ease-out); }
.site-head .logo:hover img { transform: scale(1.04) rotate(-1.5deg); }

/* --- nav links: an underline that wipes in from the left -------------- */
.nav-link { position: relative; }
.nav-link::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -5px; height: 2px;
  background: currentColor; border-radius: 2px;
  transform: scaleX(0); transform-origin: left;
  transition: transform .28s var(--ease-out);
}
.drop:hover .nav-link::after, a.nav-link:hover::after { transform: scaleX(1); }
.drop .drop-arrow { transition: transform .25s var(--ease-out); }
.drop:hover .drop-arrow { transform: translateY(1px); }

/* --- anything pressable gives a little under the finger --------------- */
.nav-cta, .shape-opt, .gm-btn, .burger, .mh-pill {
  transition: transform .16s var(--ease-out), background .2s ease, box-shadow .2s ease, filter .2s ease;
}
.nav-cta:active, .shape-opt:active, .gm-btn:active, .mh-pill:active { transform: scale(.96); }
.nav-cta:hover { transform: translateY(-1px); }

/* --- dropdown pills stagger in instead of arriving all at once -------- */
.drop-menu .shape-opt {
  opacity: 0; transform: translateY(-6px);
  transition: opacity .26s var(--ease-out), transform .26s var(--ease-out), background .2s ease;
}
.drop-menu.open .shape-opt { opacity: 1; transform: none; }
.drop-menu.open .shape-opt:nth-child(1) { transition-delay: .02s }
.drop-menu.open .shape-opt:nth-child(2) { transition-delay: .06s }
.drop-menu.open .shape-opt:nth-child(3) { transition-delay: .10s }
.drop-menu.open .shape-opt:nth-child(4) { transition-delay: .14s }

/* --- burger bars ease rather than snap -------------------------------- */
.burger span { transition: transform .28s var(--ease-out), opacity .2s ease; }
.burger:hover span:nth-child(2) { transform: scaleX(.72); }

/* --- footer links nudge toward you ------------------------------------ */
.foot-link, .foot-phone .link {
  display: inline-block;
  transition: transform .22s var(--ease-out), opacity .22s ease;
}
.foot-link:hover, .foot-phone .link:hover { transform: translateX(4px); opacity: 1; }
.foot-icon { display: block; transition: transform .26s var(--ease-out); }
.foot-icon:hover { transform: translateY(-4px) rotate(-3deg); }

@media (prefers-reduced-motion: reduce) {
  .site-head-bar, .site-head .logo img, .nav-link::after, .drop .drop-arrow,
  .nav-cta, .shape-opt, .gm-btn, .burger, .burger span, .mh-pill,
  .drop-menu .shape-opt, .site-foot .link, .foot-phone .link, .site-foot .icons a {
    transition: none !important;
  }
  .drop-menu .shape-opt { opacity: 1; transform: none; }
}

/* ===== …and make them satisfying ======================================
   Spring curves instead of flat ease-out: a fast leading edge, a small
   overshoot, then a settle. Plus depth — shadows grow with lift, so the
   motion reads as weight rather than a slide. */
:root {
  --spring: cubic-bezier(.34, 1.56, .64, 1);   /* overshoots, then settles */
  --spring-soft: cubic-bezier(.22, 1.4, .36, 1);
}

/* pressable things: squash on press, spring back on release */
.nav-cta, .shape-opt, .gm-btn, .mh-pill {
  transition: transform .34s var(--spring), background .2s ease, box-shadow .3s var(--spring-soft), filter .2s ease;
  will-change: transform;
}
.nav-cta:hover   { transform: translateY(-2px) scale(1.025); box-shadow: 0 10px 22px rgba(30,168,88,.28); }
.shape-opt:hover { transform: translateY(-2px) scale(1.045); box-shadow: 0 12px 24px rgba(38,38,38,.22); }
.nav-cta:active, .shape-opt:active, .gm-btn:active, .mh-pill:active {
  transform: scale(.94); transition-duration: .09s;
}

/* magnetic pull — chrome.js feeds --mx/--my from the cursor */
.magnetic { transform: translate(var(--mx, 0px), var(--my, 0px)); }
.magnetic:hover { transition-duration: .12s; }

/* the logo gets a springy little wink */
.site-head .logo img { transition: transform .5s var(--spring); }
.site-head .logo:hover img { transform: scale(1.07) rotate(-3deg); }

/* nav underline springs out from the left */
.nav-link::after { transition: transform .38s var(--spring); }

/* dropdown pills arrive with a bounce */
.drop-menu .shape-opt {
  transform: translateY(-10px) scale(.94);
  transition: opacity .3s ease, transform .44s var(--spring), background .2s ease, box-shadow .3s ease;
}
.drop-menu.open .shape-opt { transform: none; }

/* burger springs */
.burger span { transition: transform .42s var(--spring), opacity .2s ease; }

/* footer links: slide with a little overshoot, icons bob */
.foot-link, .foot-phone .link { transition: transform .36s var(--spring), opacity .22s ease; }
.foot-link:hover, .foot-phone .link:hover { transform: translateX(7px); }
.foot-icon { transition: transform .5s var(--spring); }
.foot-icon:hover { transform: translateY(-7px) rotate(-5deg) scale(1.06); }

@media (prefers-reduced-motion: reduce) {
  .magnetic { transform: none !important; }
}

/* ===== Footer micro-interactions =======================================
   The footer is a cutting mat with an embroidered patch pinned to it, so the
   motion leans into that: the patch lifts and wobbles like it is being peeled,
   links get a coloured pin-dot, and the contact icons drift as if resting on
   the surface. */

/* --- the badge: a slow idle breath, and a springy lift on hover -------- */
.foot-badge, .foot-phone .badge {
  transform-origin: 50% 88%;
  transition: transform .6s var(--spring, cubic-bezier(.34,1.56,.64,1)), filter .4s ease;
  animation: badgeBreathe 9s ease-in-out infinite;
  cursor: pointer;
}
@keyframes badgeBreathe {
  0%, 100% { transform: rotate(-0.4deg) translateY(0); }
  50%      { transform: rotate(0.5deg) translateY(-3px); }
}
.foot-badge:hover, .foot-phone .badge:hover {
  animation: none;
  transform: rotate(-2.2deg) translateY(-9px) scale(1.03);
  /* no drop-shadow: the mark is line art, a shadow just halos every stroke */
}

/* --- studio links: a brand-coloured pin slides in ---------------------- */
.foot-link, .foot-phone .link { position: relative; padding-left: 0; }
.foot-link::before, .foot-phone .link::before {
  content: ''; position: absolute; left: -16px; top: 50%;
  width: 8px; height: 8px; border-radius: 50%; background: var(--foot-accent, #1ea858);
  transform: translateY(-50%) scale(0);
  transition: transform .4s var(--spring, cubic-bezier(.34,1.56,.64,1));
}
.foot-link:hover::before, .foot-phone .link:hover::before { transform: translateY(-50%) scale(1); }
.foot-link:nth-of-type(1)::before { background: #1ea858; }
.foot-link:nth-of-type(2)::before { background: #cabb12; }
.foot-link:nth-of-type(3)::before { background: #d45d4a; }

/* --- headings underline themselves on hover --------------------------- */
.foot-h, .foot-phone h4 { position: relative; display: inline-block; }
.foot-h::after, .foot-phone h4::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -6px; height: 3px;
  border-radius: 3px; background: currentColor; opacity: .5;
  transform: scaleX(0); transform-origin: left;
  transition: transform .46s var(--spring, cubic-bezier(.34,1.56,.64,1));
}
.foot-h:hover::after, .foot-phone .cols > div:hover h4::after { transform: scaleX(1); }

/* --- contact icons drift, then lift ----------------------------------- */
.foot-icon:nth-of-type(1), .foot-phone .icons a:nth-child(1) { animation: iconDrift 6.5s ease-in-out infinite; }
.foot-icon:nth-of-type(2), .foot-phone .icons a:nth-child(2) { animation: iconDrift 7.8s ease-in-out infinite .8s; }
@keyframes iconDrift {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-5px) rotate(1.6deg); }
}
.foot-icon:hover, .foot-phone .icons a:hover {
  animation: none;
  transform: translateY(-9px) rotate(-6deg) scale(1.09);
  filter: drop-shadow(0 12px 14px rgba(0, 0, 0, .4));
}

/* --- the CTA headline rises as the band comes into view --------------- */
.foot-design .jua, .foot-phone .mh-cta h2 {
  transition: transform .9s var(--spring, cubic-bezier(.34,1.56,.64,1)), opacity .8s ease;
}
.foot-scale:not(.in) .foot-design .jua,
.foot-phone:not(.in) .mh-cta h2 { transform: translateY(26px); opacity: 0; }

/* --- copyright fades up last ------------------------------------------ */
.foot-copy, .foot-phone .copy { transition: opacity .7s ease .25s; }
.foot-scale:not(.in) .foot-copy, .foot-phone:not(.in) .copy { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  .foot-badge, .foot-phone .badge,
  .site-foot .icons a, .foot-phone .icons a { animation: none !important; transition: none !important; }
  .foot-link::before, .foot-phone .link::before,
  .foot-h::after, .foot-phone h4::after { transition: none !important; }
  .foot-design .jua, .foot-phone .mh-cta h2,
  .foot-copy, .foot-phone .copy { transform: none !important; opacity: 1 !important; transition: none !important; }
}

/* ===== Touch targets ====================================================
   Footer links were 25px tall on a phone. Padding grows the tappable box to
   the 44px minimum without moving the text or changing the visual rhythm. */
@media (max-width: 899px) {
  .foot-phone .link,
  .mh-footer a.link {
    padding: 10px 0;
    margin-bottom: 2px;
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  .foot-phone .icons a { min-width: 48px; min-height: 48px; display: grid; place-items: center; }
  .mob-menu a { min-height: 48px; display: flex; align-items: center; }
  .site-head .logo { padding: 6px 0; }
}

/* --- Contact Us: an envelope drawn in the nav pills' own stroke language,
       replacing the watercolour sticker so the footer matches the header. */
.foot-illus { display: block; width: 100%; height: auto; }
.foot-phone .icons .foot-illus { width: 84px; }
.foot-phone .icons a { color: #262626; display: block; }
