/* ─────────────────────────────────────────────────────────────────────────
   VIGNELLI MOTION KIT (added 2026-11-20, learned from nathankimportfolio.netlify.app)
   Eight reusable patterns. Drop this file and motion-kit.js into any static
   site. Everything is switched on by data-mk-* attributes, and everything
   reads the host site's brand through these variables (set them per world):

     --mk-ink      text colour            --mk-paper   page colour
     --mk-accent   the one press colour   --mk-rule    hairline colour
     --mk-muted    quiet text             --mk-display display font stack
     --mk-bar-top  where the section bar sticks (height of a sticky header, or 0)

   Rules baked in: only transform and opacity move; content is readable before
   any script runs; reduced motion shows the final state; nothing depends on hover.
   ───────────────────────────────────────────────────────────────────────── */
:root {
  --mk-ink: #111; --mk-paper: #fff; --mk-accent: #e4002b; --mk-rule: rgba(0,0,0,.14); --mk-muted: #6b6b6b;
  --mk-display: inherit; --mk-bar-top: 0px;
  --mk-ease: cubic-bezier(.22, 1, .36, 1);
  --mk-ease-io: cubic-bezier(.65, 0, .35, 1);
}

/* ── 5. WORDS RISE INTO PLACE  (data-mk-rise) ───────────────────────────── */
.mk-w { display: inline-block; overflow: hidden; vertical-align: top; padding: .1em .05em .24em; margin: -.1em -.05em -.24em; }
.mk-w > span { display: inline-block; }
.mk-rise .mk-w > span { transform: translateY(115%); }
.mk-rise.mk-in .mk-w > span { transform: none; transition: transform 1s var(--mk-ease); transition-delay: calc(var(--mk-i, 0) * 32ms); }

/* plain rise for blocks (data-mk-rv) */
.mk-rv { opacity: 0; transform: translateY(18px); }
.mk-rv.mk-in { opacity: 1; transform: none; transition: opacity .7s var(--mk-ease), transform .9s var(--mk-ease); }

/* ── 3. SECTION BAR THAT FOLLOWS YOU  (nav[data-mk-bar] + [data-mk-section]) ─
   Solid background on purpose: a see-through bar collides with big type. */
.mk-bar {
  position: sticky; top: var(--mk-bar-top); z-index: 20;
  background: var(--mk-paper); color: var(--mk-ink);
  border-bottom: 1px solid var(--mk-rule);
}
.mk-bar-in {
  display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  max-width: var(--mk-bar-max, none); margin: 0 auto; padding: 0 var(--mk-bar-pad, 16px);
  mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 28px), transparent 100%);
}
.mk-bar-in::-webkit-scrollbar { display: none; }
.mk-bar a {
  flex: none; display: inline-flex; align-items: center; min-height: 48px; padding: 0 12px;
  font-family: var(--mk-display); font-weight: 800; font-size: 15px; letter-spacing: -.005em; white-space: nowrap;
  text-decoration: none; color: var(--mk-muted); position: relative; transition: color .3s;
}
.mk-bar a::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 0; height: 3px; background: var(--mk-accent);
  transform: scaleX(0); transform-origin: left; transition: transform .45s var(--mk-ease);
}
.mk-bar a[aria-current="true"] { color: var(--mk-ink); }
.mk-bar a[aria-current="true"]::after { transform: scaleX(1); }
.mk-bar a:focus-visible { outline: 2px solid var(--mk-accent); outline-offset: -4px; }
[data-mk-section] { scroll-margin-top: calc(var(--mk-bar-top) + 60px); }

/* ── 4. THE PICTURE TRAVELS  ([data-mk-fly]) ─────────────────────────────
   A thumbnail grows into a panel instead of the panel snapping open. */
.mk-sheet {
  border: 0; padding: 0; margin: auto; width: min(680px, calc(100vw - 24px)); max-height: calc(100dvh - 24px);
  background: var(--mk-paper); color: var(--mk-ink); overflow: auto;
}
.mk-sheet::backdrop { background: rgba(0, 0, 0, .62); }
.mk-sheet[open] { animation: mk-fade .3s ease both; }
.mk-sheet[open]::backdrop { animation: mk-fade .3s ease both; }
.mk-sheet-top { display: flex; justify-content: flex-end; position: sticky; top: 0; z-index: 2; }
.mk-sheet-x {
  min-width: 48px; min-height: 48px; padding: 0 16px; border: 0; cursor: pointer;
  background: var(--mk-ink); color: var(--mk-paper); font: inherit; font-weight: 800; font-size: 13px; letter-spacing: .12em; text-transform: uppercase;
}
.mk-sheet-pic { display: grid; place-items: center; padding: 8px 24px 0; }
.mk-sheet-pic img { width: min(260px, 60vw); height: auto; aspect-ratio: 1; object-fit: cover; display: block; }
.mk-sheet-body { padding: 22px 24px 28px; }
.mk-sheet-body > * { opacity: 0; transform: translateY(14px); }
.mk-sheet.mk-landed .mk-sheet-body > * { opacity: 1; transform: none; transition: opacity .5s var(--mk-ease), transform .7s var(--mk-ease); }
.mk-sheet.mk-landed .mk-sheet-body > :nth-child(2) { transition-delay: 60ms; }
.mk-sheet.mk-landed .mk-sheet-body > :nth-child(3) { transition-delay: 120ms; }
.mk-sheet.mk-landed .mk-sheet-body > :nth-child(4) { transition-delay: 180ms; }
.mk-sheet-kind { margin: 0 0 8px; font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--mk-accent); }
.mk-sheet-title { margin: 0; font-family: var(--mk-display); font-weight: 900; font-size: clamp(28px, 6vw, 44px); line-height: 1; letter-spacing: -.02em; }
.mk-sheet-text { margin: 14px 0 0; font-size: 17px; line-height: 1.55; color: var(--mk-muted); max-width: 52ch; }
.mk-sheet-go {
  display: inline-flex; align-items: center; justify-content: center; min-height: 52px; margin-top: 22px; padding: 0 26px;
  background: var(--mk-accent); color: #fff; font-weight: 800; text-decoration: none; letter-spacing: .02em;
}
.mk-flying { position: fixed; z-index: 2147483000; margin: 0; pointer-events: none; overflow: hidden; }
.mk-flying img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mk-hide { visibility: hidden; }
@keyframes mk-fade { from { opacity: 0; } }

/* ── 6. HANDMADE TOUCHES ───────────────────────────────────────────────── */
/* tap the address to copy it  (button[data-mk-copy])
   Justin, 11-21: the address NEVER breaks across lines and no word sits alone on a line.
   So the script shrinks the type until the whole address fits on one line, and the
   "Copied" note is a small chip that shows only after a tap (no lone COPY word). */
.mk-copy {
  position: relative; display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: 6px 14px; max-width: 100%; text-align: left;
  background: none; border: 0; padding: 6px 0; margin: 0; cursor: pointer; color: inherit; min-height: 48px;
  font-family: var(--mk-display); font-weight: 900; letter-spacing: -.02em; line-height: 1.02;
  font-size: clamp(22px, 5.6vw, 58px);
}
.mk-copy.mk-fit { display: flex; width: 100%; flex-wrap: nowrap; white-space: nowrap; contain: inline-size; }
.mk-copy-t { overflow-wrap: anywhere; background: linear-gradient(currentColor, currentColor) 0 100% / 0 3px no-repeat; transition: background-size .6s var(--mk-ease); }
.mk-copy.mk-fit .mk-copy-t { overflow-wrap: normal; white-space: nowrap; }
.mk-copy:hover .mk-copy-t, .mk-copy:focus-visible .mk-copy-t { background-size: 100% 3px; }
.mk-copy-tag { font-family: inherit; font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--mk-accent); }
.mk-copy.mk-fit .mk-copy-tag {
  position: absolute; left: 0; top: 100%; margin-top: 2px; padding: 5px 9px 4px; line-height: 1; white-space: nowrap;
  background: var(--mk-accent); color: #fff; opacity: 0; transform: translateY(-4px); pointer-events: none;
  transition: opacity .25s, transform .35s var(--mk-ease);
}
.mk-copy.mk-fit.mk-copied .mk-copy-tag { opacity: 1; transform: none; }
.mk-copy:focus-visible { outline: 2px solid var(--mk-accent); outline-offset: 4px; }
/* helper lines beside it: never leave one word alone on the last line */
.mk-balance { text-wrap: balance; }
/* the name, fitted edge to edge  ([data-mk-giant]) */
.mk-giant { display: block; overflow: hidden; white-space: nowrap; line-height: .82; user-select: none; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
.mk-giant > span { display: inline-block; font-family: var(--mk-display); font-weight: 900; letter-spacing: -.03em; font-size: 16vw; padding: .06em 0 .1em; /* lower-case names: add `.mk-giant > span { padding-bottom: .26em }` so g, p and y tails are not cut */ transform-origin: 0 50%; }
.mk-giant.mk-rv { opacity: 1; transform: none; }
.mk-giant.mk-rv > span { transform: translateY(105%); }
.mk-giant.mk-rv.mk-in > span { transform: none; transition: transform 1.2s var(--mk-ease); }
/* a strip of tape over a photo's top edge  (.mk-tape on the wrapper) */
.mk-tape { position: relative; }
.mk-tape::before {
  content: ""; position: absolute; left: 50%; top: -12px; width: 92px; height: 26px; z-index: 1;
  background: rgba(240, 226, 170, .82); box-shadow: 0 1px 2px rgba(0, 0, 0, .18);
  transform: translateX(-50%) rotate(-3deg);
}

/* ── 7. AN INTRO THAT PLAYS ONCE  ([data-mk-intro]) ───────────────────── */
.mk-intro {
  position: fixed; inset: 0; z-index: 2147483001; display: none; place-items: center;
  background: var(--mk-intro-bg, var(--mk-paper)); color: var(--mk-intro-ink, var(--mk-ink));
  clip-path: inset(0 0 0 0); transition: clip-path .9s var(--mk-ease-io);
}
.mk-intro.mk-on, html.mk-intro-pre .mk-intro { display: grid; }   /* mk-intro-pre is set by a one-line script in the head, so the page never flashes first */
.mk-intro.mk-out { clip-path: inset(0 0 100% 0); }
.mk-intro-in { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 0 20px; text-align: center; }
.mk-intro-w { font-family: var(--mk-display); font-weight: 900; font-size: clamp(40px, 9vw, 110px); line-height: .95; letter-spacing: -.03em; }
.mk-intro-bar { width: min(240px, 50vw); height: 3px; background: var(--mk-rule); position: relative; overflow: hidden; }
.mk-intro-bar i { position: absolute; inset: 0; background: var(--mk-accent); transform-origin: 0 50%; transform: scaleX(var(--mk-p, 0)); }
.mk-intro-n { font-size: 12px; font-weight: 700; letter-spacing: .18em; font-variant-numeric: tabular-nums; opacity: .7; }
html.mk-intro-lock { overflow: hidden; }

/* ── 1. THE HERO FILM, TWO CUTS  (video[data-mk-film]) ─────────────────── */
.mk-film { position: relative; overflow: hidden; background: #000; }
.mk-film video { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ── 8. GOOD MANNERS ───────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .mk-rise .mk-w > span, .mk-rv, .mk-giant.mk-rv > span, .mk-sheet-body > * { transform: none !important; opacity: 1 !important; transition: none !important; }
  .mk-sheet[open], .mk-sheet[open]::backdrop { animation: none; }
  .mk-bar a::after, .mk-copy-t { transition: none; }
  .mk-intro { display: none !important; }
}

/* ── Bullhorn Text brand settings for the kit (11-20): tap-to-copy email and the name edge to edge ── */
:root { --mk-ink: #111733; --mk-paper: #f5f6fa; --mk-accent: #1d77ff; --mk-rule: #e1e4ee; --mk-muted: #596080;
  --mk-display: "Bricolage Grotesque", "Public Sans", system-ui, sans-serif; }
footer .wrap.foot-reach { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; margin-bottom: 26px; }
.foot-reach .mk-copy { color: var(--mk-ink); font-weight: 800; font-size: clamp(22px, 5.4vw, 56px); }
footer .wrap.foot-giant-wrap { display: block; margin-top: 30px; }
.foot-giant-wrap p { margin: 0; color: var(--mk-ink); }
.foot-giant-wrap .mk-giant > span { font-weight: 800; letter-spacing: -.04em; padding-bottom: .26em; }
.foot-giant-wrap .mk-giant { line-height: .9; }

/* Justin, 11-21: no single word alone on a line. Headlines balance; running text avoids a lone last word. */
h1, h2, h3, h4 { text-wrap: balance; }
li, dd, summary, figcaption { text-wrap: balance; }
p, blockquote { text-wrap: pretty; }
