/* ============================================================
   Margherita Zapf — shared base
   Reset · fonts · grain · cursor · a11y
   Per-version themes live in each page's own <style>.
   ============================================================ */

@import url("https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300..900;1,9..144,300..900&family=Cormorant+Garamond:ital,wght@0,300..700;1,300..600&family=Inter+Tight:ital,wght@0,300..600;1,400&family=Pirata+One&display=swap");

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

:root {
  /* shared easing curves — the soul of the motion */
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-out:  cubic-bezier(0.22, 1, 0.36, 1);
}

html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

body {
  font-family: "Inter Tight", system-ui, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  cursor: default;
  animation: bodyFade 0.85s var(--ease-out) both;
}
@keyframes bodyFade { from { opacity: 0; } to { opacity: 1; } }

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

/* ---- Film grain overlay (shared) ---- */
.grain {
  position: fixed;
  inset: -50%;
  width: 200%;
  height: 200%;
  pointer-events: none;
  z-index: 9000;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
  animation: grainShift 0.6s steps(2) infinite;
}
@keyframes grainShift {
  0%   { transform: translate(0, 0); }
  50%  { transform: translate(-1.5%, 1%); }
  100% { transform: translate(1%, -1.5%); }
}

/* ---- selection ---- */
::selection { background: #ff8fcf; color: #fff; }

/* ---- minimal scrollbar ---- */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.18); border-radius: 99px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---- shared utility: tracked label ---- */
.label {
  font-family: "Inter Tight", sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* ---- inter-version switcher (tiny, bottom corner) ---- */
.switcher {
  position: fixed;
  z-index: 9500;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 2px;
  padding: 5px 6px;
  border-radius: 99px;
  background: rgba(20,18,16,0.55);
  backdrop-filter: blur(10px) saturate(1.2);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
  opacity: 0;
  animation: switcherIn 0.9s var(--ease-out) 1.4s forwards;
}
@keyframes switcherIn { to { opacity: 0.5; } }
.switcher:hover { opacity: 1; }
.switcher a {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 99px;
  font-size: 11px; font-weight: 500;
  color: rgba(255,255,255,0.75);
  letter-spacing: 0;
  transition: background 0.4s var(--ease-out), color 0.4s var(--ease-out);
}
.switcher a:hover { color: #fff; background: rgba(255,255,255,0.14); }
.switcher a[aria-current="true"] { background: #ff8fcf; color: #1a1208; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .grain { animation: none; }
}
