/* ux.css (2026-11-12): the TikTok feature spec, section H, plus the cross-site rules. Loaded LAST on every page.
   1 menus and popovers open out of what you clicked (ux.js, WAAPI spring) and close back into it
   2 cards grow into the page they open (cross-document View Transitions, ux.js names the pair)
   3 the download letter on the app pages (ux.js builds it; it never blocks the download)
   4 the slop list: no negative tracking, no full stops on headings (done in the HTML), no ALL CAPS, no divider
     under every row, no script fonts, no code-style breadcrumbs, balanced headings
   5 44 px touch targets on phones, tabular numbers, sizes on every image, interruptible toggles
   6 one saturated accent per hero, on what the headline promises
   plus the footer in the house look: black ground, flat white cards, black text, the Frostyh E mark. */

:root {
  --ux-spring: linear(0, .009, .035 2.1%, .141 4.4%, .723 12.9%, .938 16.7%, 1.017 19.8%, 1.051 22.8%, 1.058 26.2%, 1.034 32.2%, 1.006 39.8%, .996 48.4%, 1);
  --ux-out: cubic-bezier(.22, 1, .36, 1);
  --ux-coastal: #6b92aa;
}

/* ---------- 4. type: headings balanced, no tracking games, no ALL CAPS, no script ---------- */
h1, h2, h3, h4, h5, h6 { text-wrap: balance; text-transform: none !important; }
:is(h1, h2, h3, h4, h5, h6), :is(h1, h2, h3, h4, h5, h6) * { letter-spacing: 0 !important; }
.hand, .hand * { font-family: var(--ff-body, "Satoshi", system-ui, sans-serif) !important; font-weight: 600 !important; font-style: normal !important; }

/* app film: the little labels were mono capitals, now plain words in the body face */
.st-txt .k, .st-cap, .fm-scroll { font-family: var(--ff-body, "Satoshi", system-ui, sans-serif) !important; letter-spacing: 0 !important; text-transform: none !important; }
.st-txt .k { font-size: 15px !important; font-weight: 500 !important; }
.st-cap { font-size: 14px !important; font-weight: 500 !important; }

/* plugin docs: the breadcrumb reads as words, not a file path */
.dp-crumb { font-family: var(--ff-body, "Satoshi", system-ui, sans-serif) !important; letter-spacing: 0 !important; font-size: 14px !important; }
.dp-crumb > span[aria-hidden] { font-size: 0; }
.dp-crumb > span[aria-hidden]::before { content: "\203A"; font-size: 15px; opacity: .6; }

/* ---------- 4. no divider under every row: rows are separated by space ---------- */
:is(.shp-rows, .goal-spec, .wl-spec, .wl-rows, .wp-facts, .wk-list, .wk-nums, .wf-list, .wq-qa, .dp-why, .dp-facts, .dp-steps, .dp-faq) > * {
  border-top-color: transparent !important; border-bottom-color: transparent !important;
}
:is(.wl-rows, .wk-list, .wf-list, .dp-why, .dp-steps) > * + * { margin-top: 6px; }

/* ---------- 5. numbers line up ---------- */
body { font-variant-numeric: tabular-nums; }

/* ---------- 5. 44 px touch targets on touch screens ---------- */
@media (pointer: coarse) {
  :is(.nav, .kf-cols nav, .foot nav, .lbar nav, .lg-toc, .dp-crumb, .fx-nav) a,
  :is(.sc-link, .cbtn, .gbtn, .vbtn, .kf-btn, .pfl-go, .wsx-go, .stc-go, .stc-more, .lbar-dl, .mark, .mk, .by, .kf-logo, .wk-mail, .dp-chip, .skip),
  :is(.seg button, .gal-th, .stc-x, .vw-x, .vw-nav, .dp-copy-code, .lucky-copy, .kf-tile) {
    min-height: 44px; min-width: 44px; box-sizing: border-box;
  }
  :is(.nav, .kf-cols nav, .foot nav, .lbar nav, .lg-toc, .dp-crumb) a, .sc-link, .pfl-go, .wsx-go, .stc-go, .stc-more, .mark, .mk, .by, .wk-mail {
    display: inline-flex; align-items: center;
  }
  .seg button { height: 44px !important; }
  :is(.wh-nav, .dp-toc) a, .rbtn, .btn.sm, .su-go, .st-seg button, .wk-small a { min-height: 44px; min-width: 44px; box-sizing: border-box; }
  :is(.wh-nav, .dp-toc) a, .su-go, .wk-small a { display: inline-flex; align-items: center; }
}

/* ---------- 6. one saturated accent per hero ---------- */
.app-sculk { --app-acc: #9ccbc2; }
.app-calcite { --app-acc: #e9b48a; }
.app-lapis { --app-acc: #6b92aa; }
.app-sandstone { --app-acc: #d38c6b; }
.app-garnet { --app-acc: #b0625d; }
.st-txt h2 .acc { color: var(--app-acc, currentColor); }
html:not(.film-on) .st-txt h2 .acc { color: color-mix(in oklch, var(--app-acc) 70%, black); }
/* home: the headline promises the portfolio, so the accent sits on the one link that opens it */
.hx-intro .sc-link:not(#_) { color: var(--ux-coastal); text-decoration-color: color-mix(in srgb, var(--ux-coastal) 55%, transparent); }

/* ---------- 2. cards grow into the page they open ---------- */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
}
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .32s; }
::view-transition-group(vt-card), ::view-transition-group(vt-title) { animation-duration: .62s; animation-timing-function: var(--ux-out); }
::view-transition-old(vt-card), ::view-transition-new(vt-card) { height: 100%; width: 100%; object-fit: cover; object-position: 50% 0; }
::view-transition-old(vt-card) { animation-duration: .36s; }
::view-transition-new(vt-card) { animation-duration: .5s; animation-delay: .08s; animation-fill-mode: both; }
::view-transition-old(vt-title), ::view-transition-new(vt-title) { height: 100%; width: auto; object-fit: contain; }
html[data-lite] ::view-transition-group(*), html.perf ::view-transition-group(*) { animation-duration: .01s !important; }

/* ---------- footer: black around it, flat white cards, black text ---------- */
body:has(> .kf) { background: #0c0c0c; }
main > .contact.lg-amb:last-child { background: #0c0c0c; }
:is(.cbtn, .gbtn, .vbtn, .kf-btn) { letter-spacing: 0 !important; }
.kf:not(#_) {
  background: #0c0c0c; color: #0c0c0c; box-shadow: none; border-radius: 0; isolation: auto;
  padding: 0 16px max(24px, env(safe-area-inset-bottom, 0px));
}
.kf .lg-rim, .kf .lg-glare, .kf .lg-shadow { display: none !important; }
.kf :is(.kf-l, .kf-r):not(#_) {
  background: #fff; color: #0c0c0c; box-shadow: none; border-radius: 24px; transform: none !important;
  -webkit-backdrop-filter: none; backdrop-filter: none;
}
/* the photo card: the desk photo sits inside the white card (inner radius = outer minus padding) */
.kf .kf-l:not(#_) { min-height: 0; padding: 12px 12px 22px; gap: 0; }
.kf .kf-l::after { content: none !important; }
.kf .kf-v:not(#_) { position: relative; inset: auto; z-index: 0; width: 100%; height: auto; aspect-ratio: 16 / 10; border-radius: 12px; object-position: 50% 30%; order: -1; }
.kf .kf-logo:not(#_) { margin: 18px 10px 0; color: #0c0c0c; font: 600 20px/1 var(--ff-display, "Clash Display", sans-serif); }
.kf .kf-logo img { width: 32px; height: 32px; border-radius: 8px; }
.kf .kf-tag:not(#_) { margin: 10px 10px 0; padding: 0; font-size: 17px; line-height: 1.45; color: #2a2d33; }
.kf .kf-tag span { color: #5b6068; }
.kf .kf-social:not(#_) { margin: auto 10px 0; padding-top: 20px; display: block; }
.kf-h:not(#_) { display: block; margin: 0 0 10px; font: 600 13px/1.3 var(--ff-body, "Satoshi", sans-serif); color: #5b6068; letter-spacing: 0; text-transform: none; }
.kf .kf-tiles:not(#_) { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.kf .kf-tile:not(#_) {
  width: auto; height: auto; padding: 4px 0; border-radius: 0; background: none; box-shadow: none; color: #0c0c0c;
  display: inline-flex; align-items: center; gap: 7px; font-weight: 500; font-size: 14.5px; -webkit-backdrop-filter: none; backdrop-filter: none;
}
.kf .kf-tile svg { width: 17px; height: 17px; }
.kf .kf-tile:hover:not(#_) { background: none; transform: none; text-decoration: underline; text-underline-offset: 3px; }
.kf .kf-r:not(#_) { padding: 28px 24px 24px; gap: 28px; }
.kf .lucky:not(#_) { position: static; display: block; transform: none; }
.lucky-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin: 0; }
.lucky-ip { font: 500 15px/1.3 ui-monospace, "Cascadia Mono", Consolas, monospace; color: #0c0c0c; }
.lucky-copy { height: 36px; padding: 0 14px; border: 0; border-radius: 10px; background: #0c0c0c; color: #fff; font: 600 13.5px/1 var(--ff-body, "Satoshi", sans-serif); cursor: pointer; transition: background-color .2s; }
.lucky-copy:hover { background: #2a2d33; }
.lucky-copy:focus-visible { outline: 2px solid var(--ux-coastal); outline-offset: 2px; }
.lucky-note { margin: 8px 0 0; font-size: 13.5px; line-height: 1.45; color: #5b6068; }
.kf .kf-cols a:not(#_) { color: #0c0c0c; font-size: 15px; }
.kf .kf-cols a:hover:not(#_) { color: var(--coastal-600, #2d5b75); }
.kf .kf-bot:not(#_) { border-top: 1px solid #e6e7ea; }
.kf :is(.kf-copy, .j-credit):not(#_) { color: #5b6068; opacity: 1; }
.kf .kf-cta p:not(#_) { color: #2a2d33; }
.kf .kf-cta b:not(#_) { color: #0c0c0c; }
.kf .kf-btn:not(#_) { border-radius: 12px; background: #0c0c0c; color: #fff; box-shadow: none; font-size: 14.5px; font-weight: 600; }
.kf .kf-btn:hover:not(#_) { background: #2a2d33; transform: none; }
/* the wordmark: solid white on black reads; the grey-on-grey one did not */
.kf .kf-wm:not(#_) { margin-top: 36px; }
.kf .kf-wm text:not(#_) { font-family: var(--ff-display, "Clash Display", sans-serif); font-weight: 600; fill: #fff; letter-spacing: 0; }
@media (min-width: 560px) { .kf .kf-r:not(#_) { padding: 32px; } .kf .kf-l:not(#_) { padding: 14px 14px 26px; } }
@media (min-width: 860px) {
  .kf:not(#_) { padding: 0 40px 32px; }
  .kf .kf-r:not(#_) { padding: 40px; }
}
/* me sitting on the footer: he sits on the white link card, at its right end, clear of the links */
@media (min-width: 860px) { .kf-sit .sit:not(#_) { left: auto; right: 64px; } }
@media (pointer: coarse) { .kf .kf-cols nav:not(#_) { gap: 0; } }

/* ---------- 1. origin-aware popovers ---------- */
.ux-pop { will-change: transform, opacity; }

/* ---------- 3. the download letter ---------- */
.dlx {
  --acc: var(--app-acc, #6b92aa);
  --env: color-mix(in oklch, var(--acc) 82%, white);
  --env-in: color-mix(in oklch, var(--acc) 62%, black);
  --env-flap: color-mix(in oklch, var(--acc) 92%, black);
  --env-ink: color-mix(in oklch, var(--acc) 22%, #0d0f12);
  --paper: color-mix(in oklch, var(--acc) 3%, #fbf9f5);
  --ink: color-mix(in oklch, var(--acc) 14%, #141518);
  --ink-2: color-mix(in oklch, var(--acc) 26%, #5a5d64);
  --hair: color-mix(in oklch, var(--acc) 26%, #e4e2dc);
  position: fixed; z-index: 90; right: max(16px, env(safe-area-inset-right, 0px)); bottom: 0;
  width: min(380px, calc(100vw - 32px)); height: min(560px, calc(100dvh - 72px));
  overflow: hidden; pointer-events: none; perspective: 1100px;
}
@media (max-width: 600px) { .dlx { right: 16px; left: 16px; width: auto; margin: 0 auto; max-width: 380px; } }
.dlx-box { position: absolute; left: 50%; bottom: 18px; width: 300px; height: 168px; margin-left: -150px; pointer-events: none; }
.dlx-env { transform-style: preserve-3d; z-index: 4; }
.dlx-face { position: absolute; inset: 0; border-radius: 10px; backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden; }
.dlx-face--back { background: var(--env); display: grid; place-items: center; }
.dlx-face--back span { font: 600 22px/1 var(--ff-display, "Clash Display", sans-serif); color: var(--env-ink); }
.dlx-face--back small { position: absolute; left: 18px; bottom: 14px; font: 500 12.5px/1 var(--ff-body, "Satoshi", sans-serif); color: color-mix(in oklch, var(--env-ink) 72%, var(--env)); }
.dlx-face--front { transform: rotateY(180deg); background: var(--env); }
/* the V seams of the pocket and the flap with its seal (the front face and the flat layers share these) */
.dlx-v { position: absolute; inset: 0; opacity: .5;
  background: linear-gradient(to top right, transparent 49.5%, var(--env-in) 50%, transparent 50.8%) 0 100% / 50% 62% no-repeat,
              linear-gradient(to top left, transparent 49.5%, var(--env-in) 50%, transparent 50.8%) 100% 100% / 50% 62% no-repeat; }
.dlx-flapart { position: absolute; left: 0; right: 0; top: 0; height: 98px; }
.dlx-flapart i { position: absolute; inset: 0; background: var(--env-flap); clip-path: polygon(0 0, 100% 0, 50% 100%); }
.dlx-flapart.open i { background: color-mix(in oklch, var(--env) 70%, white); }
.dlx-seal { position: absolute; left: 50%; top: 98px; width: 30px; height: 30px; margin: -25px 0 0 -15px; border-radius: 50%; background: var(--env-ink); display: grid; place-items: center; }
.dlx-seal img { width: 18px; height: 18px; border-radius: 4px; }
/* the flat open envelope (swapped in after the flip; looks exactly like the front face) */
.dlx-back { z-index: 1; border-radius: 10px; background: var(--env-in); }
.dlx-front { z-index: 3; }
.dlx-front .dlx-pocket { position: absolute; inset: 0; border-radius: 10px; background: var(--env); clip-path: polygon(0 0, 50% 58%, 100% 0, 100% 100%, 0 100%); }
.dlx-flap { z-index: 4; height: 98px; bottom: 88px; transform-origin: 50% 0; }
.dlx-flap.behind .dlx-seal { display: none; }
.dlx-flap .dlx-flapart { height: 98px; }
.dlx-flap.behind { z-index: 1; }
.dlx:not([data-step="env"]) .dlx-env, .dlx:not([data-step="flat"]) :is(.dlx-back, .dlx-front, .dlx-flap) { visibility: hidden; }
.dlx[hidden] { display: none; }
html.anim .st-card.in:not(#_) { animation: none; }
/* the slot: clips the letter while it is still inside the envelope */
.dlx-slot { position: absolute; z-index: 2; left: 0; right: 0; top: 0; bottom: 18px; overflow: hidden; }
.dlx-letter {
  position: absolute; left: 50%; bottom: 0; width: min(348px, 100%); margin-left: max(-174px, -50%);
  background: var(--paper); color: var(--ink); border-radius: 14px; padding: 18px 20px 16px;
  box-shadow: 0 1px 0 color-mix(in oklch, var(--acc) 14%, #e9e6df), 0 22px 50px -26px color-mix(in oklch, var(--acc) 40%, rgba(0, 0, 0, .7));
  pointer-events: auto; transform-origin: 50% 100%; font: 400 15px/1.55 var(--ff-body, "Satoshi", sans-serif);
}
.dlx-hd { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-right: 30px; border-bottom: 1px solid var(--hair); padding-bottom: 10px; margin-bottom: 12px; }
.dlx-hd b { font: 600 19px/1.1 var(--ff-display, "Clash Display", sans-serif); color: var(--ink); }
.dlx-hd small { font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.dlx-letter p { margin: 0 0 10px; color: var(--ink); text-wrap: pretty; }
.dlx-letter a { color: inherit; text-decoration: underline; text-decoration-color: color-mix(in oklch, var(--acc) 60%, var(--ink)); text-underline-offset: 3px; }
.dlx-sign { display: flex; align-items: flex-end; gap: 10px; margin-top: 2px; }
.dlx-sign p { margin: 0 0 4px; }
.dlx-sign svg { width: 120px; height: 44px; overflow: visible; }
.dlx-sign path { fill: none; stroke: color-mix(in oklch, var(--acc) 45%, #1b2733); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.dlx-x {
  position: absolute; top: 6px; right: 6px; width: 44px; height: 44px; border: 0; border-radius: 12px; background: transparent;
  color: var(--ink-2); display: grid; place-items: center; cursor: pointer;
}
.dlx-x:hover { background: color-mix(in oklch, var(--acc) 12%, var(--paper)); color: var(--ink); }
.dlx-x:focus-visible { outline: 2px solid color-mix(in oklch, var(--acc) 70%, black); outline-offset: -2px; }
.dlx-x svg { width: 16px; height: 16px; }
.dlx-again { font-size: 13px; color: var(--ink-2) !important; margin-top: 8px !important; }

/* the bold words in the white download notes were white on white */
:is(.dl-card, .pane) :is(.note, .sum) b { color: #000 !important; }
