/* ==========================================================================
   Muhammad Hunzla | portfolio (local employers)
   Direction: "quiet ledger". Ink-green canvas, status colour carries meaning:
   amber = pending, mint = verified. One loud moment: the hero animation.
   ========================================================================== */

:root {
  --ink: #0d1311;
  --ink-2: #111915;
  --ink-3: #17211c;
  --line: #24302a;
  --line-2: #334139;
  --text: #e9e6dc;
  --muted: #9aa59e;
  --verified: #8fd3b0;
  --pending: #d9b26a;

  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Hanken Grotesk", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --wrap: 72rem;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --radius: 4px;
  --header-h: 4.25rem;
}

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

html {
  color-scheme: dark;
  background: var(--ink);
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.62;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
button { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--verified);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection { background: var(--verified); color: var(--ink); }

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  z-index: 100;
  padding: .6rem 1rem;
  background: var(--text);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}
.skip:focus { top: .75rem; }

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: var(--ink);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.brand {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 450;
  letter-spacing: -.01em;
  text-decoration: none;
}
.site-nav { display: flex; align-items: center; gap: clamp(1rem, 3vw, 2rem); }
.site-nav a:not(.btn) {
  text-decoration: none;
  color: var(--muted);
  font-size: .975rem;
  padding-block: .4rem;
  transition: color .2s ease;
}
.site-nav a:not(.btn):hover { color: var(--text); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 2.75rem;
  padding: .55rem 1.2rem;
  border: 1px solid var(--text);
  border-radius: var(--radius);
  background: var(--text);
  color: var(--ink);
  font-weight: 600;
  font-size: .975rem;
  text-decoration: none;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, color .2s ease;
}
.btn:hover { background: var(--verified); border-color: var(--verified); }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--line-2); }
.btn--ghost:hover { background: transparent; border-color: var(--text); color: var(--text); }

/* ---------- Hero ---------- */

.hero { padding-block: clamp(2.25rem, 4.5vw, 3.5rem) clamp(2.5rem, 6vw, 4rem); }
.hero-copy {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr);
  gap: 2rem clamp(2.5rem, 5vw, 4rem);
  align-items: end;
}
.hero h1 {
  font-family: var(--serif);
  font-weight: 350;
  font-size: clamp(2.5rem, 5.2vw, 4.5rem);
  line-height: 1.04;
  letter-spacing: -.025em;
  text-wrap: balance;
  max-width: 16ch;
}
.hero .lede {
  margin-top: clamp(1.5rem, 3vw, 2.25rem);
  max-width: 38rem;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.5vw, 1.2rem);
  line-height: 1.6;
}
.hero .lede strong { color: var(--text); font-weight: 500; }
.hero-actions { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: .75rem; }

/* ---------- Sections ---------- */

.section { padding-block: clamp(3.5rem, 8vw, 6.5rem); border-top: 1px solid var(--line); }
.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem 4rem;
  align-items: end;
  margin-bottom: clamp(2rem, 4vw, 3.25rem);
}
h2 {
  font-family: var(--serif);
  font-weight: 380;
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 1.08;
  letter-spacing: -.02em;
  text-wrap: balance;
}
.section-head p { color: var(--muted); max-width: 32rem; }

/* ---------- Work index: image-led projects ---------- */

.projects { list-style: none; margin: 0 auto; padding: 0 var(--gutter); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(2.5rem, 5vw, 4rem) clamp(1.25rem, 3vw, 2.5rem); }
.project { padding: 0; }
.project::before { display: none; }
.card { display: flex; flex-direction: column; height: 100%; text-decoration: none; color: inherit; }
.card-media { display: block; position: relative; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 16px; background: var(--ink-2, #101815); border: 1px solid var(--line-2); }
.card-media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .8s cubic-bezier(.2, .7, .2, 1); }
.card:hover .card-media img, .card:focus-visible .card-media img { transform: scale(1.045); }
.card:focus-visible { outline: 2px solid var(--verified); outline-offset: 6px; border-radius: 16px; }
.card-body { display: flex; flex-direction: column; gap: .75rem; padding-top: 1.35rem; flex: 1; }
.card .work-title { transition: color .2s ease; }
.card:hover .work-title { color: var(--verified); }
.card .work-desc { display: block; }
.card-foot { margin-top: auto; padding-top: .75rem; display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; }
.card .work-meta { display: block; }
.card-cta { font-weight: 500; white-space: nowrap; }
.card-cta i { display: inline-block; font-style: normal; transition: transform .25s ease; }
.card:hover .card-cta i { transform: translateX(.3rem); }
[hidden] { display: none !important; }
/* two columns on tablets and up; one card at a time on phones */
@media (max-width: 40rem) {
  .projects { grid-template-columns: minmax(0, 1fr); gap: 2.75rem; }
}
.project-head {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.5fr) minmax(0, .8fr) auto;
  gap: 1rem clamp(1.25rem, 3vw, 2.5rem);
  align-items: center;
  margin-bottom: clamp(1.5rem, 3vw, 2.25rem);
}
.work-title {
  font-family: var(--serif);
  font-weight: 380;
  font-size: clamp(1.8rem, 3.2vw, 2.7rem);
  line-height: 1.05;
  letter-spacing: -.02em;
}
.work-title a { text-decoration: none; transition: color .2s ease; }
.work-title a:hover { color: var(--verified); }
.work-desc { color: var(--muted); max-width: 34rem; }
.work-meta { font-size: .95rem; color: var(--muted); }
.work-meta span { display: block; color: var(--text); }

/* ---------- Approach (a real sequence) ---------- */

.approach { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; counter-reset: s; }
.approach li {
  position: relative;
  padding: 1.75rem 1.25rem 0 0;
  border-top: 1px solid var(--line-2);
}
.approach li::before {
  content: "";
  position: absolute;
  top: -.4rem;
  left: 0;
  width: .75rem;
  height: .75rem;
  border-radius: 50%;
  background: var(--ink);
  border: 1.5px solid var(--verified);
}
.approach h3 { font-size: 1.05rem; font-weight: 600; margin-bottom: .5rem; }
.approach p { color: var(--muted); font-size: .98rem; line-height: 1.55; }

/* ---------- More work ---------- */

.more-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem 4rem; }
.more-cols h3 { font-size: 1rem; font-weight: 600; margin-bottom: .75rem; }
.more-cols li { padding-block: .8rem; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 1rem; }
.more-cols li:last-child { border-bottom: 1px solid var(--line); }
.more-cols li span:last-child { color: var(--muted); text-align: right; font-size: .95rem; }

/* ---------- About ---------- */

.about { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem 4rem; align-items: start; }
.about-photo { max-width: 22rem; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line-2); margin-bottom: 1.75rem; }
.about-photo img { width: 100%; height: auto; }
.about-copy p { color: var(--muted); max-width: 36rem; }
.about-copy p + p { margin-top: 1rem; }
.about-copy p:first-of-type { color: var(--text); font-size: 1.2rem; line-height: 1.55; }
.facts { display: grid; gap: 0; }
.facts div { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: 1rem; padding-block: .8rem; border-top: 1px solid var(--line); }
.facts div:last-child { border-bottom: 1px solid var(--line); }
.facts dt { font-weight: 600; font-size: 1rem; }
.facts dd { color: var(--muted); font-size: .95rem; margin: 0; }

/* ---------- Closing call ---------- */

.closing { padding-block: clamp(4rem, 9vw, 7.5rem); border-top: 1px solid var(--line); }
.closing h2 { font-size: clamp(2.2rem, 5.4vw, 4.4rem); max-width: 16ch; line-height: 1.03; }
.closing p { margin-top: 1.25rem; color: var(--muted); max-width: 30rem; }
.closing .hero-actions { margin-top: 2rem; }

.site-footer { border-top: 1px solid var(--line); padding-block: 1.75rem; color: var(--muted); font-size: .92rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem 2rem; }
[hidden] { display: none !important; }

/* ==========================================================================
   Case study pages
   ========================================================================== */

.progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  z-index: 60;
  background: transparent;
  pointer-events: none;
}
.progress i {
  display: block;
  height: 100%;
  background: var(--verified);
  transform-origin: left;
  transform: scaleX(0);
}

.case-hero { padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(2rem, 4vw, 3rem); }
.crumb { display: inline-flex; margin-bottom: 2rem; color: var(--muted); font-size: .95rem; text-decoration: none; }
.crumb:hover { color: var(--text); }
.case-hero h1 {
  font-family: var(--serif);
  font-weight: 350;
  font-size: clamp(2.5rem, 6vw, 4.8rem);
  line-height: 1.03;
  letter-spacing: -.025em;
  text-wrap: balance;
  max-width: 18ch;
}
.case-hero .standfirst { margin-top: 1.4rem; max-width: 40rem; color: var(--muted); font-size: clamp(1.08rem, 1.6vw, 1.25rem); line-height: 1.55; }
.meta { margin-top: 2.5rem; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.25rem 2rem; padding-top: 1.5rem; border-top: 1px solid var(--line-2); }
.meta dt { font-size: .88rem; color: var(--muted); margin-bottom: .2rem; }
.meta dd { font-weight: 500; }

.tabs { display: flex; gap: .5rem; margin-top: 2.5rem; padding: .3rem; width: fit-content; border: 1px solid var(--line-2); border-radius: 99px; }
.tab {
  background: transparent;
  border: 0;
  padding: .5rem 1.25rem;
  border-radius: 99px;
  color: var(--muted);
  font-weight: 500;
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { background: var(--text); color: var(--ink); }
.tabs.has-pill { position: relative; isolation: isolate; }
.tabs.has-pill .tab { position: relative; z-index: 1; background: transparent; }
.tabs.has-pill .tab[aria-selected="true"] { background: transparent; }
.tab-pill { position: absolute; z-index: 0; left: 0; top: .3rem; bottom: .3rem; border-radius: 99px; background: var(--text); transition: transform .5s cubic-bezier(.22, 1, .36, 1), width .5s cubic-bezier(.22, 1, .36, 1); will-change: transform; }

.case-layout { display: grid; grid-template-columns: 13rem minmax(0, 1fr); gap: clamp(2rem, 5vw, 4.5rem); padding-bottom: clamp(3rem, 6vw, 5rem); }

/* the status tracker */
.tracker { position: sticky; top: calc(var(--header-h) + 2rem); align-self: start; font-size: .95rem; }
.tracker p { color: var(--muted); font-size: .88rem; margin-bottom: 1rem; }
.tracker ol { display: grid; }
.tracker li { position: relative; padding: 0 0 1.35rem 1.9rem; }
.tracker li:last-child { padding-bottom: 0; }
.tracker li::before {
  content: "";
  position: absolute;
  left: .45rem; top: 1.15rem; bottom: -.15rem;
  width: 1px;
  background: var(--line-2);
}
.tracker li:last-child::before { display: none; }
.tracker li::after {
  content: "";
  position: absolute;
  left: 0; top: .28rem;
  width: .95rem; height: .95rem;
  border-radius: 50%;
  border: 1.5px solid var(--line-2);
  background: var(--ink);
  transition: background .25s ease, border-color .25s ease;
}
.tracker a { text-decoration: none; color: var(--muted); transition: color .2s ease; }
.tracker li[data-s="done"]::before { background: var(--verified); }
.tracker li[data-s="done"]::after { background: var(--verified); border-color: var(--verified); }
.tracker li[data-s="done"] a { color: var(--text); }
.tracker li[data-s="active"]::after { border-color: var(--pending); background: var(--ink); box-shadow: 0 0 0 4px rgba(217,178,106,.18); }
.tracker li[data-s="active"] a { color: var(--text); font-weight: 600; }

.case-main { min-width: 0; }
.case-main section { padding-block: 0 clamp(2.5rem, 5vw, 3.75rem); }
.case-main h2 { font-size: clamp(1.6rem, 2.8vw, 2.2rem); margin-bottom: 1.25rem; }
.case-main h3 { font-size: 1.05rem; font-weight: 600; }
.case-main section > :not(h2) + :not(h2) { margin-top: 1.5rem; }
.case-main section > p { max-width: 40rem; color: var(--muted); }
.case-main section > p strong { color: var(--text); font-weight: 600; }
.case-main section > p.strong { color: var(--text); }
.case-main section > h3 { margin-top: 2rem; }
.case-main section > h3:first-of-type { margin-top: 0; }
.case-main section > p + p { margin-top: .75rem; }
.case-main section > h3 + p { margin-top: .5rem; }
.case-main section > .list { margin-top: .9rem; }
.case-main section > p + .list, .case-main section > .list + p { margin-top: .9rem; }
ol.list { list-style: decimal; padding-left: 1.4rem; }
ol.list li { padding-left: .35rem; }
ol.list li::before { display: none; }
.prose { max-width: 40rem; }
.prose p + p { margin-top: 1rem; }
.prose p { color: var(--muted); }
.prose p.strong, .prose .strong { color: var(--text); }

.persona { border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); padding-block: 1.5rem; display: grid; gap: .4rem; max-width: 40rem; }
.persona h3 { font-family: var(--serif); font-weight: 420; font-size: 1.5rem; letter-spacing: -.01em; }
.persona .who { color: var(--text); font-size: .98rem; }
.persona p:last-child { color: var(--muted); margin-top: .35rem; }

.defs { display: grid; max-width: 44rem; }
.defs > div { padding-block: 1.1rem; border-top: 1px solid var(--line); display: grid; grid-template-columns: 11.5rem minmax(0, 1fr); gap: .5rem 1.5rem; }
.defs > div:last-child { border-bottom: 1px solid var(--line); }
.defs dt { font-weight: 600; }
.defs dd { color: var(--muted); }
.list { display: grid; gap: .7rem; max-width: 40rem; }
.list li { position: relative; padding-left: 1.4rem; color: var(--muted); }
.list li::before { content: ""; position: absolute; left: 0; top: .72em; width: .6rem; height: 1px; background: var(--verified); }

.flows { display: grid; gap: 1.75rem; }
.flow h3 { margin-bottom: .75rem; }
.flow ol { display: flex; flex-wrap: wrap; gap: .5rem 0; }
.flow li {
  position: relative;
  padding: .4rem .9rem;
  border: 1px solid var(--line-2);
  border-radius: 99px;
  font-size: .94rem;
  margin-right: 1.25rem;
  background: var(--ink-2);
}
.flow li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 100%;
  top: 50%;
  width: 1.25rem;
  height: 1px;
  background: var(--line-2);
}

.test { max-width: 44rem; }
.test > div { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: .35rem 1.5rem; padding-block: 1.1rem; border-top: 1px solid var(--line-2); }
.test > div:last-child { border-bottom: 1px solid var(--line-2); }
.test dt { font-weight: 600; display: flex; align-items: center; gap: .6rem; }
.test dt i { width: .6rem; height: .6rem; border-radius: 50%; background: var(--pending); flex: none; }
.test > div:last-child dt i { background: var(--verified); }
.test dd { color: var(--muted); }
.test dd strong { color: var(--text); font-weight: 600; }
.test-tasks { max-width: 44rem; margin-bottom: 1.5rem; }

.pull { max-width: 40rem; font-family: var(--serif); font-size: clamp(1.4rem, 2.4vw, 1.85rem); line-height: 1.3; letter-spacing: -.01em; color: var(--text); padding-left: 1.25rem; border-left: 2px solid var(--verified); }

.pager { border-top: 1px solid var(--line); }
.pager .wrap { display: grid; grid-template-columns: 1fr 1fr; }
.pager a { display: block; padding-block: 2.25rem; text-decoration: none; }
.pager a:last-child { text-align: right; }
.pager small { display: block; color: var(--muted); font-size: .92rem; margin-bottom: .35rem; }
.pager strong { font-family: var(--serif); font-weight: 380; font-size: clamp(1.4rem, 2.6vw, 2rem); letter-spacing: -.015em; transition: color .2s ease; }
.pager a:hover strong { color: var(--verified); }

/* ---------- 404 ---------- */
.lost { min-height: 62vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2.5rem clamp(2rem, 6vw, 5rem); align-items: center; padding-block: clamp(2.5rem, 6vw, 5rem); }
.lost-copy { min-width: 0; }
.lost h1 { font-family: var(--serif); font-weight: 350; font-size: clamp(2rem, 4.6vw, 3.6rem); line-height: 1.08; letter-spacing: -.02em; }
.lost p { color: var(--muted); margin: 1rem 0 2rem; max-width: 30rem; }
.lost-actions { display: flex; flex-wrap: wrap; gap: .75rem; }

/* the missing screen: a dashed Figma-style frame with skeleton blocks and a wandering cursor */
.lost-frame { position: relative; min-width: 0; border: 1.5px dashed var(--line-2); border-radius: 14px; padding: 1.25rem; background: var(--ink-2); }
.lost-tag { position: absolute; left: 0; top: -1.7rem; font-family: var(--mono, "IBM Plex Mono", monospace); font-size: .75rem; color: var(--verified); white-space: nowrap; }
.lost-body { position: relative; display: grid; gap: .8rem; }
.sk { display: block; border-radius: 8px; background: linear-gradient(100deg, var(--ink-3) 30%, #22302a 50%, var(--ink-3) 70%); background-size: 250% 100%; animation: sk-shimmer 2.4s ease-in-out infinite; }
.sk-bar { height: 1.6rem; width: 55%; }
.sk-title { height: 2.6rem; width: 80%; }
.sk-line { height: .8rem; }
.sk-short { width: 60%; }
.lost-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; margin-top: .4rem; }
.sk-card { aspect-ratio: 1; }
.sk-card:nth-child(2) { animation-delay: .25s; } .sk-card:nth-child(3) { animation-delay: .5s; }
.lost-num { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--serif); font-weight: 300; font-size: clamp(4.5rem, 13vw, 8rem); letter-spacing: -.04em; color: var(--text); text-shadow: 0 0 .6em var(--ink-2), 0 0 .3em var(--ink-2); }
.lost-cursor { position: absolute; left: 12%; top: 38%; display: flex; align-items: flex-start; gap: .1rem; pointer-events: none; animation: lost-wander 9s ease-in-out infinite; }
.lost-cursor b { margin: 1rem 0 0 -.1rem; font: 600 .72rem/1 var(--sans); color: var(--ink); background: var(--verified); padding: .3rem .5rem; border-radius: 999px; }
@keyframes sk-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@keyframes lost-wander { 0%, 100% { translate: 0 0; } 25% { translate: 55% 40%; } 50% { translate: 20% 110%; } 75% { translate: 85% 15%; } }
@media (prefers-reduced-motion: reduce) { .sk, .lost-cursor { animation: none; } }
@media (max-width: 52rem) {
  .lost { grid-template-columns: minmax(0, 1fr); padding-top: 3rem; }
  .lost-frame { order: -1; }
}

/* ---------- Responsive ---------- */

@media (max-width: 64rem) {
  .case-layout { grid-template-columns: minmax(0, 1fr); }
  .tracker { display: none; }
  .approach { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem 1.5rem; }
}

@media (max-width: 56rem) {
  .hero-copy { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .hero h1 { max-width: 16ch; }
  .section-head { grid-template-columns: minmax(0, 1fr); }
  .about { grid-template-columns: minmax(0, 1fr); }
  .meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 40rem) {
  :root { --header-h: 3.75rem; }
  body { font-size: 1.025rem; }
  .site-nav a:not(.btn) { display: none; }
  .approach { grid-template-columns: minmax(0, 1fr); }
  .more-cols { grid-template-columns: minmax(0, 1fr); }
  .defs > div, .test > div { grid-template-columns: minmax(0, 1fr); }
  .facts div { grid-template-columns: minmax(0, 1fr); gap: .2rem; }
  .pager .wrap { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
  .pager a { padding-block: 1.25rem; min-height: 2.75rem; }
  .pager small { font-size: .78rem; margin-bottom: .2rem; }
  .pager strong { font-size: 1.05rem; line-height: 1.2; display: block; }
  .site-footer { font-size: .78rem; padding-block: 1.25rem; }
  .tabs { width: 100%; }
  .tab { flex: 1; }
  .flow ol { flex-direction: column; align-items: flex-start; gap: 0; }
  .flow li { margin-right: 0; margin-bottom: 1.1rem; }
  .flow li:not(:last-child)::after { left: 1.2rem; top: 100%; width: 1px; height: 1.1rem; }
  .flow li:last-child { margin-bottom: 0; }
}

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

/* ==========================================================================
   Page-level helpers and the cursor
   ========================================================================== */

main { overflow-x: clip; }

/* Cursor: a precise dot plus a soft trailing ring (fine pointers only; see main.js) */
.cur { position: fixed; inset: 0; z-index: 300; pointer-events: none; opacity: 0; transition: opacity .25s ease; }
.cur.is-on { opacity: 1; }
.cur-ring, .cur-dot { position: absolute; left: 0; top: 0; will-change: transform; }
.cur-ring { width: 0; height: 0; }
.cur-blob, .cur-lbl {
  position: absolute; left: 0; top: 0; translate: -50% -50%;
  display: grid; place-items: center; border-radius: 999px;
  width: 2rem; height: 2rem;
  transition: width .35s cubic-bezier(.22, 1, .36, 1), height .35s cubic-bezier(.22, 1, .36, 1), background-color .25s ease, border-color .25s ease, opacity .2s ease, scale .2s ease;
}
.cur-blob { border: 1px solid rgba(255, 255, 255, .85); background: transparent; mix-blend-mode: difference; }
.cur-lbl { opacity: 0; font-family: var(--sans); font-weight: 600; font-size: .74rem; letter-spacing: .02em; color: var(--ink); white-space: nowrap; }
.cur-lbl b { grid-area: 1 / 1; font-weight: 600; opacity: 0; transition: opacity .2s ease; }
.cur-dot { width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: #fff; mix-blend-mode: difference; transition: opacity .2s ease, scale .2s ease; }

/* links and buttons: the ring grows and tints, it never goes solid */
.cur.is-link .cur-blob { width: 2.8rem; height: 2.8rem; mix-blend-mode: normal; background: rgba(143, 211, 176, .14); border: 1.5px solid var(--verified); }
.cur.is-link .cur-dot { scale: 0; }

/* project cards: a small mint disc reading "View"; image frames: a "Drag" pill */
.cur.is-view .cur-blob, .cur.is-drag .cur-blob { background: var(--verified); border-color: var(--verified); mix-blend-mode: normal; }
.cur.is-view .cur-blob, .cur.is-view .cur-lbl { width: 3.9rem; height: 3.9rem; }
.cur.is-drag .cur-blob, .cur.is-drag .cur-lbl { width: 5.2rem; height: 2.4rem; }
.cur.is-view .cur-lbl, .cur.is-drag .cur-lbl { opacity: 1; }
.cur.is-view .l-view, .cur.is-drag .l-drag { opacity: 1; }
.cur.is-view .cur-dot, .cur.is-drag .cur-dot { scale: 0; }

/* pressed */
.cur.is-down .cur-blob, .cur.is-down .cur-lbl { scale: .9; }
.cur.is-down .cur-dot { scale: 1.6; }

.has-cursor, .has-cursor * { cursor: none !important; }
@media (hover: none), (pointer: coarse) { .cur { display: none; } }
@media (prefers-reduced-motion: reduce) { .cur-blob, .cur-lbl, .cur-dot { transition-duration: .01ms; } }

/* magnetic buttons lean toward the pointer (translate is set from main.js) */
.btn, .ledger-act, .tab { transition-property: background, border-color, color, translate; transition-duration: .2s, .2s, .2s, .35s; transition-timing-function: ease, ease, ease, cubic-bezier(.2, .8, .2, 1); }

/* contact: a ruled ledger of ways to reach me */
.closing-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 3rem clamp(2rem, 6vw, 5rem);
  align-items: end;
}
.status { display: inline-flex; align-items: center; gap: .6rem; margin: 0 0 1.5rem; font-family: var(--mono); font-size: .8rem; letter-spacing: .02em; color: var(--verified); }
.closing .status { margin-top: 0; color: var(--verified); max-width: none; }
.status-dot { width: .55rem; height: .55rem; border-radius: 50%; background: var(--verified); box-shadow: 0 0 0 0 rgba(143,211,176,.5); }
@media (prefers-reduced-motion: no-preference) { .status-dot { animation: status 2.4s ease-out infinite; } }
@keyframes status { 0% { box-shadow: 0 0 0 0 rgba(143,211,176,.5); } 70%, 100% { box-shadow: 0 0 0 .6rem rgba(143,211,176,0); } }
.ledger { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-2); }
.ledger-row { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr) auto; align-items: baseline; gap: .25rem 1rem; padding: 1.15rem 0; border-bottom: 1px solid var(--line-2); }
.ledger-row[hidden] { display: none; }
.ledger-k { font-family: var(--mono); font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.ledger-v { font-family: var(--serif); font-size: clamp(1.1rem, 2vw, 1.45rem); color: var(--text); text-decoration: none; overflow-wrap: anywhere; line-height: 1.25; }
.ledger-v:hover { text-decoration: underline; text-decoration-color: var(--verified); text-underline-offset: 5px; }
.ledger-act { font: inherit; font-family: var(--sans); font-size: .88rem; color: var(--muted); background: none; border: 1px solid var(--line-2); border-radius: 99px; padding: .3rem .85rem; cursor: pointer; text-decoration: none; white-space: nowrap; transition: color .2s, border-color .2s, background .2s; }
.ledger-act:hover, .ledger-act:focus-visible { color: var(--ink); background: var(--verified); border-color: var(--verified); }
.ledger-act.is-done { color: var(--ink); background: var(--verified); border-color: var(--verified); }
.hero-side .lede { margin-top: 0; }

@media (max-width: 56rem) {
  .project-head { grid-template-columns: minmax(0, 1fr); }
  .project-head .btn { justify-self: start; }
  .closing-grid { grid-template-columns: minmax(0, 1fr); }
  .ledger-row { grid-template-columns: minmax(0, 1fr) auto; }
  .ledger-k { grid-column: 1 / -1; }
}


/* ---------- Case-study screens: one frame per case study ---------- */
.board { position: relative; }
.board-frame {
  position: relative;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;          /* the frame never scrolls vertically; it simply grows with the image */
  background: #050807;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
  overscroll-behavior-x: contain;
}
.board-frame:focus-visible { outline: 2px solid var(--verified); outline-offset: 3px; }
.board-frame.is-dragging { -webkit-user-select: none; user-select: none; }
.board-empty strong { color: var(--text); font-weight: 600; font-size: 1.05rem; }
.board-empty code { font-family: var(--mono); font-size: .82rem; color: var(--verified); overflow-wrap: anywhere; }
/* a sideways scroller that stays on screen while the tall image scrolls past */
.board-rail {
  position: sticky; bottom: max(.9rem, env(safe-area-inset-bottom)); z-index: 5;
  display: flex; align-items: center; gap: .8rem; width: fit-content; max-width: calc(100% - 1.5rem);
  margin: -3.4rem auto 0; padding: .55rem 1rem; border-radius: 999px;
  background: rgba(13, 19, 17, .82); border: 1px solid var(--line-2);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  font-size: .82rem; color: var(--muted);
}
.board-rail[hidden] { display: none; }
.board-rail input { width: min(14rem, 44vw); height: 1.5rem; accent-color: var(--verified); background: transparent; }
.board-hint { margin-top: .6rem; font-size: .88rem; color: var(--muted); }

/* ---------- Comfortable touch targets (44px) on every screen that is touched or narrow ---------- */
.brand { display: inline-flex; align-items: center; min-height: 2.75rem; white-space: nowrap; }
.site-nav .btn { white-space: nowrap; min-height: 2.5rem; padding-block: .4rem; }
@media (min-width: 40.01rem) { .site-nav a:not(.btn) { display: inline-flex; align-items: center; min-height: 2.75rem; padding-block: 0; } }
.crumb { align-items: center; min-height: 2.75rem; margin-bottom: 1rem; }
.ledger-act { display: inline-flex; align-items: center; justify-content: center; min-height: 2.75rem; padding-inline: 1.1rem; }
.stage-toggle { display: inline-flex; align-items: center; min-height: 2.75rem; padding-inline: .25rem; }
.tab { min-height: 2.75rem; }
.skip { min-height: 2.75rem; display: inline-flex; align-items: center; }
@media (max-width: 23rem) {
  .site-header .wrap { gap: .75rem; }
  .brand { font-size: 1.12rem; }
  .site-nav .btn { padding-inline: .85rem; font-size: .92rem; }
}

/* Spacing before sub-headings that follow a paragraph or list */
.case-main :is(p,ul,ol) + h3 { margin-top: 1.5rem; }

/* Large screens: scale the whole layout up so it never looks small or left-heavy */
@media (min-width:1920px){ html{font-size:112.5%} :root{--wrap:80rem} }
@media (min-width:2400px){ html{font-size:125%} :root{--wrap:84rem} }

/* Keep the email on one line down to 320px */
.ledger-v { overflow-wrap: normal; word-break: normal; }
@media (max-width:30rem){ .ledger-v { font-size: clamp(.95rem, 4.6vw, 1.1rem); } }


/* ---- Reading strip: shows the current section where the side tracker is hidden ---- */
.stage-now { position: fixed; z-index: 45; left: 0; right: 0; top: var(--header-h); display: none; align-items: center; justify-content: space-between; gap: 1rem; padding: .35rem var(--gutter); font: 500 .72rem/1.2 var(--mono, "IBM Plex Mono", monospace); letter-spacing: .04em; text-transform: uppercase; color: var(--verified); background: rgba(13, 19, 17, .88); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); transform: translateY(-100%); opacity: 0; pointer-events: none; transition: transform .35s cubic-bezier(.22, 1, .36, 1), opacity .25s ease; }
.stage-now.is-on { transform: none; opacity: 1; }
.sn-count { color: var(--muted); }
@media (max-width: 64rem) { .stage-now { display: flex; } }
@media (prefers-reduced-motion: reduce) { .stage-now { transition: none; } }

/* ---- Press-and-hold peek on home cards (touch / pen) ---- */
.card { -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
@media (hover: none), (pointer: coarse) { .card { -webkit-user-select: none; user-select: none; } }
.card { transition: transform .45s cubic-bezier(.22, 1, .36, 1), filter .3s ease; }
.card.is-peek { transform: translateY(-6px) scale(1.025); z-index: 2; position: relative; }
.card.is-peek .card-media { box-shadow: 0 1.4rem 2.6rem rgba(0, 0, 0, .55); border-color: var(--verified); }
.card.is-peek .card-media img { transform: scale(1.06); }
.card-peek { position: absolute; inset: auto 0 0 0; display: grid; gap: .25rem; padding: 2.2rem 1rem .9rem; background: linear-gradient(to top, rgba(13, 19, 17, .96) 40%, rgba(13, 19, 17, 0)); opacity: 0; transform: translateY(14px); transition: opacity .25s ease, transform .4s cubic-bezier(.22, 1, .36, 1); pointer-events: none; }
.card-peek small { font: 500 .75rem/1 var(--mono, "IBM Plex Mono", monospace); letter-spacing: .06em; text-transform: uppercase; color: var(--verified); }
.card-peek b { font: 380 1.15rem/1.2 var(--serif); color: var(--text); letter-spacing: -.01em; }
.card-peek em { font: 500 .78rem/1.2 var(--sans); font-style: normal; color: var(--muted); }
.card.is-peek .card-peek { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .card, .card-peek, .tab-pill { transition-duration: .01ms !important; } }


/* ---- Board zoom: starts fitted, zoom toward real size ---- */
.board-zoom { display: flex; align-items: center; justify-content: flex-end; gap: .4rem; margin-bottom: .6rem; }
.board-zoom[hidden], .board-zoom [hidden] { display: none; }
.board-zoom button { display: inline-grid; place-items: center; height: 2.5rem; min-width: 2.5rem; padding: 0; border: 1px solid var(--line-2); border-radius: 99px; background: transparent; color: var(--text); font: 500 .88rem/1 var(--sans); cursor: pointer; transition: background .2s ease, border-color .2s ease, color .2s ease, opacity .2s ease; }
.board-zoom .bz-fit { padding: 0 1rem; }
.board-zoom svg { display: block; width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.board-zoom button:hover:not(:disabled) { border-color: var(--text); }
.board-zoom button:disabled { opacity: .35; cursor: default; }
.bz-pct { min-width: 3.2rem; text-align: center; font: 500 .78rem/1 var(--mono, "IBM Plex Mono", monospace); letter-spacing: .03em; color: var(--verified); }
@media (max-width: 40rem) {
  .board-zoom { gap: .3rem; margin-bottom: .5rem; }
  .board-zoom button { height: 2.3rem; min-width: 2.3rem; font-size: .8rem; }
  .board-zoom .bz-fit { padding: 0 .8rem; }
  .board-zoom svg { width: .9rem; height: .9rem; }
  .bz-pct { min-width: 2.6rem; font-size: .72rem; }
}
.board-frame.has-image { cursor: auto; }
.board-frame { overscroll-behavior-x: contain; touch-action: pan-x pan-y; }


/* ---- Board stage: instant preview + visible tiles ---- */
.board-frame { background: #050807 var(--lqip, none) 0 0 / 100% 100% no-repeat; }
.board-frame:not(.has-stage) { aspect-ratio: var(--ar, auto); min-height: 14rem; }
.board-stage { position: relative; overflow: hidden; max-width: none; background: var(--lqip, none) 0 0 / 100% 100% no-repeat; }
.bs-prev, .bs-img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; max-width: none; opacity: 0; transition: opacity .4s ease; -webkit-user-drag: none; -webkit-user-select: none; user-select: none; }
.bs-prev.is-in, .bs-img.is-in { opacity: 1; }
.bs-tile { position: absolute; display: block; max-width: none; opacity: 0; transition: opacity .25s ease; pointer-events: none; -webkit-user-drag: none; -webkit-user-select: none; user-select: none; }
.bs-tile.is-in { opacity: 1; }

/* status note over the board: loading, slow, missing, too large, network */
.board-empty { position: absolute; inset: 0; z-index: 3; display: grid; place-content: center; justify-items: center; gap: .55rem; margin: 0; padding: 1.5rem 1.25rem; text-align: center; color: var(--muted); font-size: .95rem; background: rgba(5, 8, 7, .5); }
.board-empty[hidden] { display: none; }
.board-empty.is-missing, .board-empty.is-toolarge, .board-empty.is-network { background: rgba(5, 8, 7, .86); }
.board-empty span { max-width: 32rem; }
.spin { width: 1.5rem; height: 1.5rem; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--verified); animation: board-spin .8s linear infinite; }
@keyframes board-spin { to { transform: rotate(360deg); } }
.board-retry { min-height: 2.5rem; padding: 0 1.2rem; border: 1px solid var(--line-2); border-radius: 99px; background: transparent; color: var(--text); font: 500 .9rem/1 var(--sans); cursor: pointer; transition: border-color .2s ease; }
.board-retry:hover { border-color: var(--text); }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 2.6s; } .bs-prev, .bs-img, .bs-tile { transition-duration: .01ms; } }

/* keep the sideways slider clear of the back-to-top button on phones */
@media (max-width: 40rem) { .board-rail { margin-left: .75rem; margin-right: auto; max-width: calc(100% - 4.4rem); } .board-rail input { width: min(9rem, 30vw); } }

/* ---- Back to top ---- */
.to-top { position: fixed; z-index: 44; right: max(var(--gutter), env(safe-area-inset-right)); bottom: max(1rem, calc(env(safe-area-inset-bottom) + .75rem)); display: grid; place-items: center; width: 2.75rem; height: 2.75rem; padding: 0; border: 1px solid var(--line-2); border-radius: 50%; background: rgba(13, 19, 17, .88); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); color: var(--text); cursor: pointer; opacity: 0; visibility: hidden; transform: translateY(10px) scale(.92); transition: opacity .3s ease, transform .4s cubic-bezier(.22, 1, .36, 1), visibility 0s linear .4s, border-color .2s ease, background .2s ease; }
.to-top.is-on { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.to-top svg { width: 1.1rem; height: 1.1rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.to-top:hover { border-color: var(--text); background: var(--ink-3); }
.to-top:active { transform: scale(.94); }
@media (max-width: 40rem) { .to-top { width: 2.5rem; height: 2.5rem; } .to-top svg { width: 1rem; height: 1rem; } }
@media (prefers-reduced-motion: reduce) { .to-top { transition-duration: .01ms; } }

/* No browser tap-flash on our own controls (focus rings for keyboard users stay) */
a, button, summary, [role="button"], .card, .board-frame, .board-zoom *, .to-top, .tab, [role="tab"] { -webkit-tap-highlight-color: transparent; }
.board-frame.is-pinching { -webkit-user-select: none; user-select: none; }
.board-frame:focus:not(:focus-visible), a:focus:not(:focus-visible), button:focus:not(:focus-visible) { outline: none; }

/* Live on Google Play */
.apps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.app { display: flex; align-items: center; gap: 1rem; padding: .9rem 1.1rem .9rem .9rem; border: 1px solid var(--line-2); border-radius: 18px; background: var(--ink-2); color: inherit; text-decoration: none; transition: border-color .2s ease, background .2s ease; }
.app:hover { border-color: var(--verified); background: var(--ink-3); }
.app:focus-visible { outline: 2px solid var(--verified); outline-offset: 4px; }
.app-icon { width: 4.25rem; height: 4.25rem; flex: none; border-radius: 22%; object-fit: cover; background: var(--ink-3); border: 1px solid var(--line-2); }
.app-name { flex: 1; min-width: 0; font-weight: 600; font-size: 1.05rem; line-height: 1.3; overflow-wrap: anywhere; }
.app-go { flex: none; display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 50%; border: 1px solid var(--line-2); color: var(--text); transition: color .2s ease, background .2s ease, border-color .2s ease; }
.app-go svg { width: 1.4rem; height: 1.4rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.app:hover .app-go { background: var(--verified); border-color: var(--verified); color: var(--ink); }
@media (max-width: 40rem) { .app-go { width: 2.5rem; height: 2.5rem; } .app-go svg { width: 1.3rem; height: 1.3rem; } }
/* Live on Google Play: scale the cards to each screen */
@media (max-width: 64rem) { .apps { gap: .85rem; } .app { gap: .9rem; padding: .8rem 1rem .8rem .8rem; border-radius: 16px; } .app-icon { width: 3.75rem; height: 3.75rem; } .app-name { font-size: 1rem; } }
@media (max-width: 40rem) { .apps { gap: .6rem; } .app { gap: .7rem; padding: .55rem .75rem .55rem .55rem; border-radius: 14px; } .app-icon { width: 2.9rem; height: 2.9rem; border-radius: 24%; } .app-name { font-size: .92rem; line-height: 1.25; } .app-go { width: 2.25rem; height: 2.25rem; } .app-go svg { width: 1.15rem; height: 1.15rem; } }
@media (max-width: 23rem) { .app { gap: .6rem; padding-right: .6rem; } .app-icon { width: 2.6rem; height: 2.6rem; } .app-name { font-size: .88rem; } .app-go { width: 2.1rem; height: 2.1rem; } }

/* Phones: keep two columns, with each card stacked (icon and arrow on top, name below) */
@media (max-width: 34rem) {
  .apps { gap: .7rem; }
  .app { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "icon go" "name name"; align-items: start; gap: .7rem .4rem; padding: .8rem; border-radius: 16px; height: 100%; }
  .app-icon { grid-area: icon; width: 3.5rem; height: 3.5rem; border-radius: 24%; }
  .app-go { grid-area: go; width: 2.25rem; height: 2.25rem; }
  .app-go svg { width: 1.15rem; height: 1.15rem; }
  .app-name { grid-area: name; font-size: .92rem; line-height: 1.3; }
}
@media (max-width: 23rem) {
  .apps { gap: .55rem; }
  .app { padding: .65rem; }
  .app-icon { width: 3rem; height: 3rem; }
  .app-go { width: 2.1rem; height: 2.1rem; }
  .app-name { font-size: .85rem; }
}

/* ---- Mascots: Pip (host) and Frame (helper) ---- */
.pip { position: relative; display: block; width: var(--pip, 5rem); aspect-ratio: 190 / 192; flex: none; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
.pip svg { display: block; width: 100%; height: 100%; overflow: visible; }
.pip-look { transform: translate(calc(var(--ex, 0) * 1px), calc(var(--ey, 0) * 1px)); transition: transform .18s ease-out; }
.pip-eye { transform-box: fill-box; transform-origin: center; animation: pip-blink 5.2s infinite; }
.pip-body { animation: pip-bob 3.6s ease-in-out infinite; }
.pip-arm { transform-box: fill-box; transform-origin: 8% 50%; }
.pip-zz, .pip-q { opacity: 0; }
.pip-q { opacity: 1; transform-box: fill-box; transform-origin: 50% 90%; animation: pip-wobble 2.4s ease-in-out infinite; }
.pip.is-wave .pip-arm { animation: pip-wave 1.8s ease-in-out; }
.pip.is-hop .pip-all { animation: pip-hop .6s cubic-bezier(.3, .7, .4, 1); }
.pip.is-hop .pip-shadow { transform-box: fill-box; transform-origin: center; animation: pip-shade .6s ease-out; }
.pip.is-sleep .pip-eye { animation: none; transform: scaleY(.1); }
.pip.is-sleep .pip-shine { opacity: 0; }
.pip.is-sleep .pip-zz { animation: pip-z 2.6s ease-in-out infinite; }
.pip[data-pip="lost"] .pip-look { animation: pip-around 5.5s ease-in-out infinite; transition: none; }
.pip.is-off *, .pip.is-off { animation-play-state: paused !important; }
@keyframes pip-blink { 0%, 92%, 100% { transform: scaleY(1); } 95.5% { transform: scaleY(.08); } }
@keyframes pip-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes pip-wave { 0%, 100% { transform: rotate(0); } 14% { transform: rotate(-72deg); } 30% { transform: rotate(-42deg); } 46% { transform: rotate(-76deg); } 62% { transform: rotate(-42deg); } 78% { transform: rotate(-72deg); } }
@keyframes pip-hop { 0% { transform: translateY(0); } 40% { transform: translateY(-26px); } 70% { transform: translateY(0); } 82% { transform: translateY(-5px); } 100% { transform: translateY(0); } }
@keyframes pip-shade { 40% { transform: scale(.78); opacity: .2; } }
@keyframes pip-z { 0% { opacity: 0; transform: translate(0, 6px); } 40% { opacity: 1; } 100% { opacity: 0; transform: translate(10px, -16px); } }
@keyframes pip-wobble { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(8deg); } }
@keyframes pip-around { 0%, 12% { transform: translate(-5px, 1px); } 30%, 46% { transform: translate(5px, -1px); } 62%, 78% { transform: translate(3px, -4px); } 100% { transform: translate(-5px, 1px); } }

.pip--hero { position: absolute; right: clamp(.9rem, 5vw, 3.5rem); bottom: calc(100% - .35rem); --pip: clamp(4.2rem, 9vw, 6.25rem); z-index: 4; cursor: pointer; pointer-events: auto; touch-action: manipulation; }
.pip--lost { --pip: clamp(4rem, 9vw, 5.5rem); margin: 0 0 1rem -.3rem; }
.hero-stage { position: relative; }

.fr-svg { display: block; width: 100%; height: 100%; overflow: visible; }
.fr-load { display: block; width: 5rem; height: 4.7rem; }
.fr-load .fr-l1 { animation: fr-step .7s ease-in-out infinite alternate; }
.fr-load .fr-l2 { animation: fr-step .7s ease-in-out infinite alternate-reverse; }
@keyframes fr-step { to { transform: translateY(-4px); } }
.board-zoom .bz-frame { display: block; margin-right: auto; width: 2.6rem; height: 2.4rem; flex: none; }
.board-zoom .bz-frame .fr-svg { width: 100%; height: 100%; stroke: none; }
.bz-frame.is-pop { animation: fr-pop .45s ease-out; }
@keyframes fr-pop { 40% { transform: translateY(-3px) scale(1.06); } }
@media (max-width: 40rem) { .board-zoom .bz-frame { width: 2.2rem; height: 2.05rem; } .fr-load { width: 4.2rem; height: 3.95rem; } }
@media (prefers-reduced-motion: reduce) { .pip *, .pip, .fr-load *, .bz-frame { animation: none !important; transition: none !important; } }

.pip--hero-d { display: none; }
@media (max-width: 63.99rem) { .hero .hero-stage { margin-top: 5.25rem; } }
@media (min-width: 64rem) { .pip--hero { display: none; } .pip--hero-d { display: block; --pip: 5.25rem; margin-left: .75rem; cursor: pointer; pointer-events: auto; } .hero-actions { align-items: center; } }

/* The zoom bar (with Frame) stays in view under the header while you scroll down a board */
.board-zoom { position: sticky; top: var(--header-h, 4rem); z-index: 6; padding: .45rem .5rem; margin-bottom: .6rem; border-radius: 14px; background: rgba(13, 19, 17, .86); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
@media (max-width: 40rem) { .board-zoom { padding: .35rem .4rem; margin-bottom: .5rem; border-radius: 12px; } }
@media (max-width: 64rem) { .board-zoom { top: calc(var(--header-h, 4rem) + 1.75rem); } }

/* ---- speech bubble ---- */
.pip-say { position: absolute; top: 4%; left: calc(100% + .5rem); width: max-content; max-width: min(13rem, 56vw); padding: .5rem .8rem; border-radius: 14px; background: var(--ink-3); border: 1px solid var(--line-2); color: var(--text); font: 500 .84rem/1.3 var(--sans); text-align: left; box-shadow: 0 10px 26px -12px #000; opacity: 0; transform: scale(.86) translateX(-6px); transform-origin: left center; pointer-events: none; transition: opacity .3s ease, transform .35s cubic-bezier(.2, .9, .3, 1.2); z-index: 5; cursor: default; }
.pip-say::before { content: ""; position: absolute; left: -5px; top: 1rem; width: 9px; height: 9px; background: var(--ink-3); border-left: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); transform: rotate(45deg); }
.pip-say.is-on { opacity: 1; transform: none; pointer-events: auto; }
.pip--hero .pip-say { left: auto; right: calc(100% + .5rem); transform-origin: right center; transform: scale(.86) translateX(6px); }
.pip--hero .pip-say.is-on { transform: none; }
.pip--hero .pip-say::before { left: auto; right: -5px; transform: rotate(-135deg); }
@media (max-width: 40rem) { .pip-say { font-size: .8rem; padding: .45rem .7rem; max-width: min(11.5rem, 52vw); } }
@media (prefers-reduced-motion: reduce) { .pip-say { transition: opacity .01ms; transform: none; } }

/* ---- contact Pip and footer Pip ---- */
.pip--contact { --pip: clamp(4rem, 9vw, 5rem); margin-top: 1.5rem; cursor: pointer; }
.foot-thanks { display: inline-flex; align-items: center; gap: .5rem; }
.pip--foot { --pip: 2.9rem; cursor: pointer; }
@media (max-width: 40rem) { .pip--foot { --pip: 2.6rem; } .foot-thanks { width: 100%; } }

/* ---- Frame says thanks at the end of a case study ---- */
.thanks { display: flex; align-items: center; gap: 1.25rem 1.75rem; margin-top: clamp(2rem, 5vw, 3.5rem); padding: 1.25rem 1.5rem; border: 1px solid var(--line-2); border-radius: 18px; background: var(--ink-2); }
.thanks-frame { flex: none; display: block; width: 5.5rem; height: 5.15rem; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.thanks-frame .fr-svg { width: 100%; height: 100%; overflow: visible; }
.thanks-body { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; min-width: 0; }
.thanks-t { margin: 0; font-family: var(--serif); font-size: clamp(1.3rem, 2.6vw, 1.7rem); line-height: 1.2; color: var(--text); }
.thanks .fr-arm { transform-box: fill-box; }
.thanks .fr-arm-l { transform-origin: 90% 50%; }
.thanks .fr-arm-r { transform-origin: 10% 50%; }
.thanks.is-in .fr-arm-r { animation: fr-wave 1.6s ease-in-out .3s 2; }
.thanks.is-in .fr-legs .fr-l1 { animation: fr-step .5s ease-in-out 4 alternate; }
.thanks.is-in .fr-legs .fr-l2 { animation: fr-step .5s ease-in-out 4 alternate-reverse; }
.thanks-frame.is-five { animation: fr-five .8s cubic-bezier(.3, .7, .4, 1); }
.thanks-frame.is-five .fr-arm-r { animation: fr-wave .8s ease-in-out; }
.thanks-frame.is-five .fr-arm-l { animation: fr-wave-l .8s ease-in-out; }
@keyframes fr-wave { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-65deg); } 50% { transform: rotate(-30deg); } 75% { transform: rotate(-65deg); } }
@keyframes fr-wave-l { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(65deg); } 50% { transform: rotate(30deg); } 75% { transform: rotate(65deg); } }
@keyframes fr-five { 40% { transform: translateY(-12px) scale(1.05); } 70% { transform: translateY(0); } 82% { transform: translateY(-3px); } }
@media (max-width: 40rem) { .thanks { padding: 1rem; gap: .75rem 1rem; border-radius: 16px; } .thanks-frame { width: 4.2rem; height: 3.95rem; } }
@media (max-width: 23rem) { .thanks { flex-direction: column; align-items: flex-start; } }
@media (prefers-reduced-motion: reduce) { .thanks *, .thanks-frame { animation: none !important; } }

/* ---- warm micro-interactions ---- */
.btn, .ledger-act, .tab { transition-property: background, border-color, color, translate, scale, box-shadow; transition-duration: .2s, .2s, .2s, .35s, .15s, .25s; }
.btn:active, .ledger-act:active, .tab:active, .board-zoom button:active:not(:disabled), .to-top:active { scale: .95; }
.card-media { transition: transform .4s cubic-bezier(.2, .8, .2, 1), box-shadow .4s ease; }
.card:active .card-media { transform: scale(.985); }
.app:active { transform: scale(.98); }
.app { transition: border-color .2s ease, background .2s ease, transform .3s cubic-bezier(.2, .8, .2, 1), box-shadow .3s ease; }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { box-shadow: 0 0 0 5px rgba(143, 211, 176, .14); }
  .btn--ghost:hover { box-shadow: 0 0 0 5px rgba(232, 239, 233, .06); }
  .card:hover .card-media { transform: translateY(-5px); box-shadow: 0 22px 44px -22px rgba(143, 211, 176, .3); }
  .app:hover { transform: translateY(-3px); box-shadow: 0 16px 34px -18px rgba(143, 211, 176, .3); }
}
.rv { opacity: 0; transform: translateY(16px); }
.rv.rv-in { opacity: 1; transform: none; transition: opacity .65s ease, transform .65s cubic-bezier(.2, .8, .2, 1); }
@media (prefers-reduced-motion: reduce) { .rv { opacity: 1; transform: none; } }

.pip, .thanks-frame { touch-action: manipulation; }
.pip--hero .pip-say, .pip--hero-d .pip-say { pointer-events: none; }
.pip--hero .pip-say.is-on, .pip--hero-d .pip-say.is-on { pointer-events: auto; }

/* The zoom bar on touch screens: solid and lightweight, so pinching the image underneath stays smooth */
@media (hover: none), (pointer: coarse) {
  .board-zoom { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(13, 19, 17, .95); }
  .board-zoom .bz-frame { will-change: transform; transform: translateZ(0); }
}
.bz-frame.is-pop { animation: none; }

/* Accessibility: keep keyboard-focused boards clear of the sticky header and zoom bar; 24px minimum hit area for the side-rail links */
main:focus { outline: none; }
.board-frame, .board-rail { scroll-margin-top: calc(var(--header-h) + 4.5rem); }
@media (max-width: 64rem) { .board-frame, .board-rail { scroll-margin-top: calc(var(--header-h) + 6rem); } }
.tracker a { display: inline-block; padding: .2rem 0; margin: -.2rem 0; }

/* Email menu (computers) */
.mail-menu { position: fixed; z-index: 90; width: 15.5rem; padding: .4rem; border-radius: 14px; background: var(--ink-3); border: 1px solid var(--line-2); box-shadow: 0 18px 44px -14px #000; display: grid; gap: .15rem; animation: mail-in .16s ease-out; }
.mail-menu[hidden] { display: none; }
.mail-menu a, .mail-menu button { display: flex; align-items: center; min-height: 2.5rem; padding: 0 .8rem; border: 0; border-radius: 10px; background: none; color: var(--text); font: 500 .95rem/1 var(--sans); text-align: left; text-decoration: none; cursor: pointer; width: 100%; }
.mail-menu a:hover, .mail-menu button:hover, .mail-menu a:focus-visible, .mail-menu button:focus-visible { background: rgba(143, 211, 176, .14); outline: none; }
.mail-menu a:focus-visible, .mail-menu button:focus-visible { box-shadow: 0 0 0 2px var(--verified) inset; }
.mail-menu small { display: block; padding: .35rem .8rem .25rem; color: var(--muted); font-size: .78rem; overflow-wrap: anywhere; border-top: 1px solid var(--line-2); margin-top: .2rem; }
@keyframes mail-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
@media (prefers-reduced-motion: reduce) { .mail-menu { animation: none; } }

@media (pointer: coarse) { .mail-menu a, .mail-menu button { min-height: 2.9rem; font-size: 1rem; } .mail-menu { width: min(16.5rem, calc(100vw - 1.5rem)); } }
.mail-menu { overflow-y: auto; overscroll-behavior: contain; }

/* iOS-style motion for the email menu (look unchanged): a springy pop that grows out of the pressed button, rows settling in one after another */
.mail-menu { animation: none; opacity: 0; transform: scale(.78); transition: transform .12s ease-in, opacity .14s ease-in; will-change: transform, opacity; }
.mail-menu.is-open { opacity: 1; transform: none; transition: transform .52s cubic-bezier(.2, 1.35, .35, 1), opacity .18s ease-out; }
.mail-menu > * { opacity: 0; transform: translateY(6px); transition: opacity .12s ease, transform .12s ease; }
.mail-menu.is-open > * { opacity: 1; transform: none; transition: opacity .28s ease, transform .42s cubic-bezier(.2, 1.2, .35, 1); }
.mail-menu.is-open > *:nth-child(1) { transition-delay: .04s; }
.mail-menu.is-open > *:nth-child(2) { transition-delay: .08s; }
.mail-menu.is-open > *:nth-child(3) { transition-delay: .12s; }
.mail-menu.is-open > *:nth-child(4) { transition-delay: .16s; }
.mail-menu.is-open > *:nth-child(5) { transition-delay: .2s; }
@media (prefers-reduced-motion: reduce) {
  .mail-menu, .mail-menu.is-open, .mail-menu > *, .mail-menu.is-open > * { transition: opacity .12s linear !important; transform: none !important; transition-delay: 0s !important; }
}

/* ======== Motion pass: quiet, springy, reduced-motion aware ======== */
/* page-to-page fade (browsers with cross-document view transitions; others just navigate) */
@view-transition { navigation: auto; }
.site-header { view-transition-name: site-header; }
::view-transition-group(site-header) { animation-duration: 0s; }
::view-transition-old(root) { animation: vt-out .16s ease-in both; }
::view-transition-new(root) { animation: vt-in .38s cubic-bezier(.22, 1, .36, 1) both; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(10px); } }

/* tab pill: springier slide */
.tab-pill { transition: transform .55s cubic-bezier(.3, 1.3, .4, 1), width .5s cubic-bezier(.22, 1, .36, 1); }

/* board images sharpen in */
.bs-prev, .bs-img { filter: blur(10px); transition: opacity .4s ease, filter .8s ease; }
.bs-prev.is-in, .bs-img.is-in { filter: none; }
.bz-pct { display: inline-block; font-variant-numeric: tabular-nums; }

/* home cards: lift on hover (mouse), press-down on touch */
.card-media { transition: box-shadow .45s ease, border-color .3s ease; }
@media (hover: hover) and (pointer: fine) {
  .card:hover:not(.is-peek) { transform: translateY(-4px); }
  .card:hover .card-media { box-shadow: 0 1.3rem 2.4rem rgba(0, 0, 0, .45); }
}
.card:active:not(.is-peek) { transform: scale(.975); transition-duration: .12s; }

/* section headings: a thin line draws in as the heading arrives */
.section-head h2 { position: relative; }
.section-head h2::after { content: ""; position: absolute; left: 0; bottom: -.75rem; width: min(5rem, 30%); height: 2px; border-radius: 2px; background: var(--verified); transform-origin: left; transition: transform .9s cubic-bezier(.22, 1, .36, 1) .1s; }
.section-head.rv h2::after { transform: scaleX(0); }
.section-head.rv.rv-in h2::after { transform: none; }

/* Google Play cards: icons pop in one by one, arrow nudges, press feedback */
.apps li.rv { opacity: 0; transform: translateY(14px); }
.apps li.rv .app-icon { transform: scale(.55); }
.apps li.rv.rv-in { opacity: 1; transform: none; transition: opacity .5s ease calc(var(--i, 0) * .09s), transform .6s cubic-bezier(.22, 1, .36, 1) calc(var(--i, 0) * .09s); }
.apps li.rv.rv-in .app-icon { transform: none; transition: transform .7s cubic-bezier(.2, 1.5, .35, 1) calc(var(--i, 0) * .09s + .12s); }
.app { transition-property: border-color, background, transform; transition-duration: .2s, .2s, .15s; }
.app:active { transform: scale(.975); }
.app-go svg { transition: transform .3s cubic-bezier(.2, 1.4, .4, 1); }
.app:hover .app-go svg, .app:focus-visible .app-go svg { transform: translate(.12rem, -.12rem); }

/* copy buttons: check mark pops in */
.ledger-act.is-done::before, .mail-copy.is-done::before { content: ""; display: inline-block; width: .32em; height: .62em; margin: 0 .55em .18em 0; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg); animation: tick-pop .5s cubic-bezier(.2, 1.6, .4, 1) both; vertical-align: middle; }
@keyframes tick-pop { from { transform: rotate(45deg) scale(0); opacity: 0; } to { transform: rotate(45deg) scale(1); opacity: 1; } }

/* back-to-top: springs in like the email menu */
.to-top { transform: translateY(18px) scale(.9); transition: opacity .3s ease, transform .55s cubic-bezier(.2, 1.35, .35, 1), visibility 0s linear .55s, border-color .2s ease, background .2s ease; }
.to-top.is-on { transition-delay: 0s; }

/* numbers count up once */
.cu { position: relative; display: inline-block; font-variant-numeric: tabular-nums; }
.cu-final { opacity: 0; }
.cu-live { position: absolute; left: 0; top: 0; white-space: nowrap; }
.cu.cu-done .cu-final { opacity: 1; }
.cu.cu-done .cu-live { display: none; }

/* reading strip counter + tracker dots */
.sn-count { display: inline-block; font-variant-numeric: tabular-nums; }
.tracker li::after { transition: border-color .3s ease, background .3s ease, box-shadow .5s ease, transform .5s cubic-bezier(.2, 1.5, .35, 1); }
.tracker li[data-s="active"]::after { transform: scale(1.18); }

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  .bs-prev, .bs-img { filter: none !important; }
  .section-head.rv h2::after, .apps li.rv, .apps li.rv .app-icon { transform: none !important; opacity: 1 !important; transition: none !important; }
  .card:hover:not(.is-peek), .card:active:not(.is-peek), .app:active { transform: none !important; }
  .ledger-act.is-done::before, .mail-copy.is-done::before { animation: none; }
  .to-top { transform: none; }
  .tracker li[data-s="active"]::after { transform: none; }
}
