/* ==========================================================================
   Pincbone — shared design tokens and base styles
   Used by index.html and login.html. Page-specific CSS lives in landing.css
   and login.css. Do not redefine these tokens in page CSS; extend them.
   Palette comes from the mascot photo: hot-pink dog, white bone, black desk.
   ========================================================================== */

:root {
  /* --- colour: raw palette ------------------------------------------------ */
  --ink: #0d0a0b;            /* the desk: warm near-black */
  --ink-2: #171214;          /* raised surface on ink */
  --ink-3: #2a2025;          /* hairlines / borders on ink */
  --bone: #fff6ee;           /* the bone: warm white */
  --bone-2: #f4e6da;         /* bone in shadow: secondary light surface */
  --bone-3: #e3d2c4;         /* hairlines / borders on bone */
  --pink: #ff4a93;           /* the dog: main brand pink */
  --pink-hi: #ff8fbd;        /* specular highlight pink */
  --pink-deep: #d81f6c;      /* shadowed pink */
  --pink-dark: #8f0f45;      /* deepest pink, for text on bone when needed */

  /* --- colour: semantic (overridden per theme below) ---------------------- */
  --bg: var(--ink);
  --fg: var(--bone);
  --muted: rgba(255, 246, 238, 0.66);
  --faint: rgba(255, 246, 238, 0.54);   /* lowest alpha that still passes AA for small text on ink */
  --line: rgba(255, 246, 238, 0.14);
  --accent: var(--pink);
  --accent-fg: var(--ink);   /* text that sits ON the accent colour */
  --surface: var(--ink-2);

  /* --- type --------------------------------------------------------------- */
  --font-display: "Bricolage Grotesque", "Arial Narrow", system-ui, sans-serif;
  --font-body: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-accent: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-mono: "Martian Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  /* display type runs condensed + heavy; body runs normal width */
  --display-settings: "wdth" 78, "opsz" 96;
  --body-settings: "wdth" 100, "opsz" 16;

  --fs-hero: clamp(3.25rem, 2.1rem + 7.2vw, 8.25rem);
  --fs-d1: clamp(2.6rem, 1.6rem + 5.2vw, 6rem);
  --fs-d2: clamp(2rem, 1.4rem + 3vw, 3.75rem);
  --fs-d3: clamp(1.5rem, 1.2rem + 1.4vw, 2.25rem);
  --fs-lead: clamp(1.125rem, 1rem + 0.55vw, 1.4rem);
  --fs-body: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  --fs-small: 0.875rem;
  --fs-label: 0.6875rem;

  --lh-tight: 0.88;
  --lh-snug: 1.05;
  --lh-body: 1.55;

  /* --- space & layout ----------------------------------------------------- */
  --gutter: clamp(1.125rem, 0.5rem + 2.6vw, 2.75rem);
  --maxw: 88rem;
  --section-y: clamp(4.5rem, 3rem + 7vw, 9.5rem);
  --radius-s: 0.625rem;
  --radius-m: 1.125rem;
  --radius-l: clamp(1.5rem, 1rem + 1.6vw, 2.5rem);
  --radius-pill: 999px;
  --nav-h: 4.5rem;

  /* --- motion ------------------------------------------------------------- */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);          /* expo-ish out: default entrance */
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-snap: cubic-bezier(0.34, 1.4, 0.64, 1);      /* small overshoot: "bone clicks into place" */
  --dur-1: 160ms;   /* hover, press */
  --dur-2: 320ms;   /* small UI state change */
  --dur-3: 620ms;   /* entrances */
  --dur-4: 900ms;   /* hero-level moves, page wipe */

  --z-nav: 50;
  --z-cursor: 80;
  --z-wipe: 100;

  color-scheme: dark;
}

/* --- section themes: put one of these on a <section> or wrapper ----------- */
.theme-ink {
  --bg: var(--ink);
  --fg: var(--bone);
  --muted: rgba(255, 246, 238, 0.66);
  --faint: rgba(255, 246, 238, 0.54);
  --line: rgba(255, 246, 238, 0.14);
  --accent: var(--pink);
  --accent-fg: var(--ink);
  --surface: var(--ink-2);
}
.theme-bone {
  --bg: var(--bone);
  --fg: var(--ink);
  --muted: rgba(13, 10, 11, 0.68);
  --faint: rgba(13, 10, 11, 0.58);
  --line: rgba(13, 10, 11, 0.14);
  --accent: var(--pink-deep);   /* deeper pink for contrast on light */
  --accent-fg: var(--bone);
  --surface: var(--bone-2);
}
.theme-pink {
  --bg: var(--pink);
  --fg: var(--ink);             /* body text on pink is ALWAYS ink (contrast) */
  --muted: rgba(13, 10, 11, 0.82);   /* 0.74 measured 4.44:1 on pink; this clears AA */
  --faint: rgba(13, 10, 11, 0.5);
  --line: rgba(13, 10, 11, 0.2);
  --accent: var(--ink);
  --accent-fg: var(--bone);
  --surface: var(--pink-hi);
}
.theme-ink, .theme-bone, .theme-pink {
  background: var(--bg);
  color: var(--fg);
}
.theme-ink { color-scheme: dark; }
.theme-bone, .theme-pink { color-scheme: light; }   /* native controls and scrollbars follow the surface */

/* --- reset ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--nav-h) + 1rem);
}
body {
  margin: 0;
  background: var(--ink);
  color: var(--bone);
  font-family: var(--font-body);
  font-variation-settings: var(--body-settings);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
h1, h2, h3, h4, p, figure, blockquote, dl, dd, ul, ol { margin: 0; }
ul[class], ol[class] { padding: 0; list-style: none; }
img, svg, picture { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
::selection { background: var(--pink); color: var(--ink); }

:focus-visible {
  outline: 2.5px solid var(--accent);
  outline-offset: 3px;
}
.theme-pink :focus-visible { outline-color: var(--ink); }

/* --- type primitives ------------------------------------------------------ */
.display {
  font-family: var(--font-display);
  font-variation-settings: var(--display-settings);
  font-weight: 800;
  line-height: var(--lh-tight);
  letter-spacing: -0.026em;
  text-wrap: balance;
}
.display--hero { font-size: var(--fs-hero); letter-spacing: -0.03em; }
.display--1 { font-size: var(--fs-d1); }
.display--2 { font-size: var(--fs-d2); line-height: 0.95; letter-spacing: -0.02em; }
.display--3 { font-size: var(--fs-d3); line-height: var(--lh-snug); letter-spacing: -0.012em; font-weight: 700; }

/* the italic serif accent: one or two words inside a display line, never a whole heading */
.accent-serif {
  font-family: var(--font-accent);
  font-style: italic;
  font-weight: 500;
  font-variation-settings: "SOFT" 100, "WONK" 1, "opsz" 144;
  letter-spacing: -0.03em;
  color: var(--accent);
}

.lead { font-size: var(--fs-lead); line-height: 1.42; color: var(--muted); text-wrap: pretty; max-width: 38ch; }
.muted { color: var(--muted); }

/* small mono label: eyebrows, step numbers, meta */
.label {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1.3;
  color: var(--muted);
}
.label--accent { color: var(--accent); }

/* --- layout primitives ---------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section { padding-block: var(--section-y); position: relative; }

/* --- buttons --------------------------------------------------------------
   Markup:
   <a class="btn btn--pink" href="#"><span class="btn__label" data-text="I'm a founder">I'm a founder</span>
     <span class="btn__icon" aria-hidden="true"><svg ...arrow/></span></a>
   The label rolls on hover (data-text is the duplicate); the icon nudges.
   -------------------------------------------------------------------------- */
.btn {
  --btn-bg: var(--fg);
  --btn-fg: var(--bg);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  min-height: 3.5rem;              /* >= 48px touch target */
  padding: 0.5rem 0.625rem 0.5rem 1.5rem;
  border-radius: var(--radius-pill);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--font-display);
  font-variation-settings: "wdth" 88, "opsz" 24;
  font-weight: 700;
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform var(--dur-1) var(--ease-out), background-color var(--dur-2) var(--ease-out), color var(--dur-2) var(--ease-out);
}
.btn:active { transform: scale(0.97); }
.btn--pink { --btn-bg: var(--pink); --btn-fg: var(--ink); }
.btn--bone { --btn-bg: var(--bone); --btn-fg: var(--ink); }
.btn--ink { --btn-bg: var(--ink); --btn-fg: var(--bone); }
.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--fg);
  box-shadow: inset 0 0 0 1.5px var(--line);
}
.btn--sm { min-height: 2.75rem; font-size: 0.9375rem; padding: 0.375rem 0.5rem 0.375rem 1.125rem; gap: 0.5rem; }
.btn--plain { padding-inline: 1.5rem; }       /* use when there is no .btn__icon */
.btn--block { display: flex; width: 100%; }

.btn__label {
  position: relative;
  display: inline-block;
  overflow: hidden;
  padding-block: 0.2em;            /* room so descenders are not clipped */
}
.btn__label::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 100%;
  padding-block: 0.2em;
}
.btn__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--btn-fg);
  color: var(--btn-bg);
  transition: transform var(--dur-2) var(--ease-snap);
}
.btn--ghost .btn__icon { background: var(--fg); color: var(--bg); }
.btn--sm .btn__icon { width: 2rem; height: 2rem; }
.btn__icon svg { width: 1.05rem; height: 1.05rem; }

@media (hover: hover) and (pointer: fine) {
  .btn__label { transition: transform var(--dur-2) var(--ease-out); }
  .btn:hover .btn__label { transform: translateY(-100%); }
  /* the roll needs the duplicate to travel with the label */
  .btn__label { overflow: visible; clip-path: inset(0); }
  .btn:hover .btn__label { clip-path: inset(100% 0 -100% 0); }
  .btn:hover .btn__icon { transform: rotate(-45deg) scale(1.06); }
  .btn--ghost:hover { --btn-bg: var(--fg); --btn-fg: var(--bg); }
}

/* text link with a drawn underline */
.link {
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1.5px no-repeat;
  padding-bottom: 2px;
  transition: background-size var(--dur-2) var(--ease-out);
}
@media (hover: hover) {
  .link:hover { background-size: 0% 1.5px; background-position: 100% 100%; }
}

/* --- utilities ------------------------------------------------------------ */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: fixed;
  left: 1rem; top: 1rem;
  z-index: 200;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-s);
  background: var(--bone);
  color: var(--ink);
  font-weight: 700;
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

/* film grain: one fixed layer per page, purely decorative */
.grain {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  opacity: 0.06;
  mix-blend-mode: overlay;
  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.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.9 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* --- page wipe (index <-> login). shared.js drives it. ---------------------
   Markup, once per page, last in <body>:
   <div class="wipe" aria-hidden="true"><span class="wipe__panel wipe__panel--pink"></span><span class="wipe__panel wipe__panel--bone"></span></div>
   -------------------------------------------------------------------------- */
.wipe {
  position: fixed;
  inset: 0;
  z-index: var(--z-wipe);
  pointer-events: none;
  visibility: hidden;
}
.wipe__panel {
  position: absolute;
  inset: 0;
  transform: translateY(101%);
  will-change: transform;
}
.wipe__panel--pink { background: var(--pink); }
.wipe__panel--bone { background: var(--bone); }

/* arriving from the other page: first paint is already covered (class set by
   the inline head script), then shared.js lifts the curtain. If shared.js never
   runs, the failsafe animation clears the curtain on its own. */
.is-entering .wipe { visibility: visible; }
.is-entering .wipe__panel { transform: none; }
.is-entering .wipe:not([data-js]) .wipe__panel { animation: pb-wipe-failsafe 0.5s 1.4s var(--ease-in-out) forwards; }
@keyframes pb-wipe-failsafe { to { transform: translateY(-101%); } }

/* --- reduced motion: kill CSS-driven motion; JS checks the same query ------ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* --- live 3D mascot host ----------------------------------------------------
   js/mascot3d.js mounts a canvas into [data-mascot3d]; the poster image is what
   shows instantly, and what stays if WebGL or motion is unavailable. Page CSS
   gives the host its size (an aspect-ratio box: 5/7 for the full figure, 1/1 for
   the head). */
.mascot3d { position: relative; display: block; }
.mascot3d picture,
.mascot3d__poster { display: block; width: 100%; height: 100%; }
.mascot3d__poster { object-fit: contain; object-position: 50% 100%; -webkit-user-drag: none; user-select: none; }
.mascot3d[data-pose="head"] .mascot3d__poster { object-position: 50% 50%; }

/* --- global pause switch (WCAG 2.2.2) ---------------------------------------
   html.is-paused is set by the pause buttons on both pages: every CSS animation
   stops; scripted loops listen for the "pb:pause" event. */
html.is-paused *, html.is-paused *::before, html.is-paused *::after { animation-play-state: paused !important; }

/* --- phones: drop the effects that cost the most to draw ----------------------
   A full-screen blended grain layer forces the whole viewport to be re-blended on
   every scrolled frame, which phone GPUs handle badly. It is decoration only. */
@media (pointer: coarse), (max-width: 899.98px) {
  .grain { display: none; }
}
