/* Shared foundations for every page: tokens, fonts, cursors, pills, the sidebar
   and the case-study top nav. Spec: design-handoff/DESIGN-HANDOFF.md §1. */

@font-face {
  font-family: "Fig Grotesk";
  src: url("/fonts/FigGrotesk-Regular.woff2") format("woff2"),
       url("/fonts/FigGrotesk-Regular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Iteration 1 Pen";
  src: url("/fonts/Iteration1Pen-Regular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #FFFFFE;
  --ink: #070128;
  --muted: #666376;
  --hairline: #D9D8E0;
  --dim: #B9B7C4;
  --sticky: #FFE294;
  --aura-pink: #FFA8D6;
  --aura-yellow: #FFE294;
  --aura-blue: #A8DEFF;
  --sign-blue: #4048F6;
  --font: "Fig Grotesk", "Hanken Grotesk", Arial, sans-serif;
  --pen: "Iteration 1 Pen", cursive;

  --cur-arrow: url("/assets/cursors/arrow.svg") 4 2, default;
  --cur-pointer: url("/assets/cursors/pointer.svg?v=2") 13 2, pointer;
  --cur-text: url("/assets/cursors/text.svg") 12 12, text;
  --cur-grab: url("/assets/cursors/grab.svg?v=6") 16 16, grab;
  --cur-grabbing: url("/assets/cursors/grabbing.svg?v=7") 16 16, grabbing;
  --cur-zin: url("/assets/cursors/zoomin.svg") 10 10, zoom-in;
  --cur-zout: url("/assets/cursors/zoomout.svg") 10 10, zoom-out;
}

/* Preload the hand cursors so the fist never flashes the browser's black fallback
   the first time you drag (a hidden 1px element that already uses both). */
body::after {
  content: "";
  position: fixed;
  left: -10px;
  top: -10px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  background-image: url("/assets/cursors/grab.svg?v=6"), url("/assets/cursors/grabbing.svg?v=7"), url("/assets/cursors/pointer.svg?v=2");
}

/* Blue cursor set */
html { cursor: var(--cur-arrow); }
a, button, [role="button"], label[for], summary, select { cursor: var(--cur-pointer); }
input, textarea, [contenteditable="true"] { cursor: var(--cur-text); }

/* One weight, never italic */
em, i, cite, dfn, var, address { font-style: normal; }
b, strong { font-weight: 400; }

:focus-visible { outline: 1.5px solid #1F8FD6; outline-offset: 3px; }

/* ---------- Pills: 1px ink border, paper fill, soft aura inside on hover ---------- */
.pill-btn {
  position: relative;
  z-index: 0;
  overflow: hidden;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 18px;
  box-sizing: border-box;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font: 400 15px/1 var(--font);
  font-style: normal;
  text-decoration: none;
  white-space: nowrap;
  -webkit-appearance: none;
  appearance: none;
}
.pill-btn--sm { height: 32px; padding: 0 16px; font-size: 14px; }
.aura {
  position: absolute;
  inset: 3px;
  border-radius: 999px;
  filter: blur(6px);
  z-index: -1;
  opacity: 0;
  transition: opacity 180ms ease;
  pointer-events: none;
  background: var(--aura-blue);
}
.hv:hover .aura, .hv:focus-visible .aura { opacity: 1; }
.aura--pink { background: var(--aura-pink); }
.aura--yellow { background: var(--aura-yellow); }
.aura--blue { background: var(--aura-blue); }
.pill-btn[aria-disabled="true"] { color: var(--muted); border-color: var(--dim); cursor: var(--cur-arrow); }
.pill-btn[aria-disabled="true"] .aura { display: none; }

/* ---------- Word glows (nav items, filters, index rows) ---------- */
.word {
  position: relative;
  z-index: 0;
  padding: 3px 0;
  border: 0;
  background: none;
  font: 400 16px/22px var(--font);
  color: var(--ink);
  text-decoration: none;
}
.word .gl {
  position: absolute;
  left: -8px; right: -8px; top: -3px; bottom: -3px;
  border-radius: 999px;
  filter: blur(5px);
  z-index: -1;
  opacity: 0;
  transition: opacity 200ms ease;
  pointer-events: none;
}
.word:hover .gl, .word:focus-visible .gl, .word.is-on .gl { opacity: 1; }
.gl--pink { background: #FFA8D688; }
.gl--blue { background: #A8DEFF99; }
.gl--yellow { background: #FFE29499; }

/* ---------- Sidebar (home + about) ---------- */
.sidebar {
  position: absolute;
  left: 24px;
  top: 24px;
  width: 296px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 20;
  font-family: var(--font);
  color: var(--ink);
}
.panel {
  box-sizing: border-box;
  border: 1px solid var(--ink);
  border-radius: 6px;
  background: var(--paper);
}
.panel--id { padding: 14px 16px; font-size: 16px; line-height: 22px; }
.panel--id p { margin: 8px 0 0; }
.panel--id .name { color: var(--ink); text-decoration: none; }
.panel--nav { padding: 5px 16px; display: flex; justify-content: space-between; align-items: center; }

/* ---------- Case-study top bar: the home sidebar's two panels, floating ---------- */
.cs-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;  /* name on the left, menu on the right */
  gap: 24px;
  padding: 24px 24px 0;
  pointer-events: none;            /* only the panels catch clicks */
  font: 400 16px/22px var(--font);
}
.cs-nav > * { pointer-events: auto; }
.cs-nav__name { padding: 9px 0; color: var(--ink); text-decoration: none; }
.cs-nav__links {
  box-sizing: border-box;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  position: relative;
  overflow: hidden;
  isolation: isolate;
  width: 296px;
  padding: 5px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
@media (max-width: 640px) {
  .cs-nav { padding: 12px 16px 0; }
  .cs-nav__name { display: none; }
  .cs-nav__links { width: 100%; }
}

/* ---------- Case-study footer: back to the brain · next project ---------- */
.cs-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  width: min(1056px, 100% - 48px);
  margin: 112px auto 0;
  padding: 0 0 72px;
  background: none;
}
.cs-foot__btn { height: 56px; padding: 0 32px; font-size: 18px; }
@media (max-width: 640px) {
  .cs-foot { flex-direction: column; align-items: stretch; margin-top: 72px; }
  .cs-foot__btn { width: 100%; }
}
