/* ============================================================
   Movendi — shared shell (persistent chrome)
   ------------------------------------------------------------
   The parts that are identical on every Movendi site and never
   move while the router swaps page content: the live attractor
   background, the sticky header + nav, the footer, and the
   brand-level type primitives. Depends on tokens from theme.css.
   ============================================================ */

/* ---- Page scaffold ---------------------------------------- */
/* Height is 100vh (the LARGE, stable viewport) rather than 100% / inset:0 on
   purpose: on phones the address bar shows/hides as you scroll, changing the
   live viewport height. A 100%/inset background box would resize with it and
   stretch; 100vh is fixed to the large viewport, so the background stays put
   and just drifts. */
.bg-fixed{
  position:fixed; top:0; left:0; width:100%; height:100vh; z-index:0; pointer-events:none;
  /* Seed attractor image — crisp instant first paint, and the fallback for
     no-JS / reduced-motion. The <canvas> (app.js) draws the same shape on top
     and slowly rotates + warps it. Path is relative to this file (/shared/). */
  background:var(--bg) url("assets/bg-clifford.png") center / cover no-repeat;
}
#bg-canvas{ position:fixed; top:0; left:0; width:100%; height:100vh; z-index:0; pointer-events:none; }
.page-shell{
  position:relative; z-index:1;
  min-height:100vh;
  display:flex; flex-direction:column;
}

.wrap-wide{
  max-width:var(--wide); margin:0 auto;
  padding-inline:clamp(28px,5vw,44px);
}

/* ---- Header / nav ----------------------------------------- */
.site-header{
  position:sticky; top:0; z-index:20;
  background:rgba(255,255,255,.82);
  backdrop-filter:saturate(1.2) blur(10px);
  -webkit-backdrop-filter:saturate(1.2) blur(10px);
  border-bottom:1px solid var(--line);
}
.site-header .wrap-wide,
.site-footer .wrap-wide{ max-width:none; }   /* chrome spans full page width */

.header-inner{
  display:flex; align-items:baseline; justify-content:space-between;
  flex-wrap:wrap; gap:12px;
  padding-block:22px;
}
.brand{
  display:flex; align-items:center; gap:13px; text-decoration:none; color:inherit;
  transform-origin:left center;
  transition:transform .2s cubic-bezier(.34,1.56,.64,1);
}
.brand:hover{ transform:scale(1.05); }
.brand__glyph{ font-family:var(--serif); font-size:30px; line-height:1; }
.brand__word{ font-family:var(--mono); font-size:15px; letter-spacing:.34em; color:var(--ink); }

.nav{ position:relative; display:flex; gap:clamp(18px,2.6vw,30px); }
.nav a{
  font-family:var(--mono); font-size:13px; letter-spacing:.16em; text-transform:uppercase;
  color:var(--ink); text-decoration:none; opacity:.4;
  padding-bottom:3px; border-bottom:1px solid transparent;
  transition:opacity .2s;
}
.nav a:hover{ opacity:1; }
.nav a.is-active{ opacity:1; border-bottom-color:var(--ink); }
.nav.has-slider a.is-active{ border-bottom-color:transparent; }

/* Sliding underline — shoots from one word to the next (ease-out-expo).
   Anchored to the nav's TOP and positioned on both axes by app.js: when the
   nav wraps to two rows (narrow screens, many items) a bottom-anchored bar
   would sit under the last row while the active word is on the first. */
.nav__underline{
  position:absolute; left:0; top:0; height:1.5px; width:0;
  background:var(--ink); opacity:0; transform:translate(0,0);
  pointer-events:none;
  transition:transform .55s cubic-bezier(.16,1,.3,1),
             width     .55s cubic-bezier(.16,1,.3,1),
             opacity   .3s  ease;
}

/* ---- Main column ------------------------------------------ */
.site-main{
  flex:1; width:100%; max-width:var(--wide); margin:0 auto;
  padding:clamp(48px,7vw,84px) clamp(28px,5vw,44px) 100px;
}
.site-main:focus{ outline:none; }   /* programmatic focus on content swap */

/* ---- Shared type primitives (brand-level, cross-site) ----- */
.kicker{ font-family:var(--mono); font-size:13px; letter-spacing:.22em; text-transform:uppercase; color:var(--muted-2); margin:0; }
.display{ font-family:var(--serif); font-weight:600; font-size:clamp(42px,8vw,62px); line-height:1.04; letter-spacing:-.02em; margin:20px 0 0; }
.page-title{ font-family:var(--serif); font-weight:600; font-size:clamp(36px,7vw,48px); line-height:1.05; letter-spacing:-.02em; margin:18px 0 0; }
.lede{ font-family:var(--serif); font-style:italic; font-size:clamp(20px,4vw,25px); line-height:1.4; color:var(--text-soft-2); margin:18px 0 0; }
.rule{ height:1px; background:var(--line-2); border:0; margin:56px 0 0; }
.section-label{ font-family:var(--mono); font-size:13px; letter-spacing:.22em; text-transform:uppercase; color:var(--muted-2); margin:36px 0 26px; }

/* Underlined mono call-to-action / external link (e.g. "See the platform →") */
.read-link{
  display:inline-block; margin-top:16px;
  font-family:var(--mono); font-size:13px; letter-spacing:.06em; color:var(--accent);
  text-decoration:none; padding-bottom:3px;
  background-image:linear-gradient(currentColor,currentColor);
  background-repeat:no-repeat; background-position:0 100%; background-size:100% 1px;
}

/* ---- Footer (base; sites may extend in site.css) ---------- */
.footer-inner{
  display:flex; align-items:center; justify-content:space-between;
  flex-wrap:wrap; gap:12px;
  padding-block:28px 44px;
}
.brand--footer{ gap:11px; }
.brand--footer .brand__glyph{ font-size:18px; animation:none; }
.brand--footer .brand__word{ font-size:12px; letter-spacing:.24em; color:var(--muted); }
.footer-meta{ font-family:var(--mono); font-size:12px; letter-spacing:.06em; color:var(--faint); }
.footer-meta a{ color:var(--muted); text-decoration:none; }
.footer-meta a:hover{ color:var(--ink); }

/* ---- Responsive ------------------------------------------- */
@media (max-width:600px){
  .header-inner{ align-items:center; }  /* wrap allowed: a wide nav drops below the glyph */
  .brand__word{ display:none; }         /* brand collapses to the 𝕄 glyph */
  .brand__glyph{ font-size:26px; }
  .nav{ flex-wrap:wrap; gap:10px 16px; }
  .nav a{ font-size:12px; letter-spacing:.1em; }
}
/* Very narrow: give the nav its own full-width row under the glyph. */
@media (max-width:420px){
  .header-inner{ flex-direction:column; align-items:flex-start; gap:14px; padding-block:18px; }
  .nav{ width:100%; }
}
@media (prefers-reduced-motion: reduce){
  .brand, .nav__underline{ transition:none; }
}
