/* Portfolio site styles. Colors, fonts and corner radius come from
   theme.css (generated from the editor's Style panel). */

:root {
  --ease: cubic-bezier(.2, .7, .2, 1);
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1240px;
  --space: clamp(72px, 11vw, 144px);
  /* Soft panel behind images and cards */
  --frame: color-mix(in srgb, var(--text) 6%, var(--bg));
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-heading); font-weight: 700; line-height: 1.05; letter-spacing: -0.025em; margin: 0; text-wrap: balance; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
::selection { background: var(--accent); color: var(--on-accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.container { width: 100%; max-width: calc(var(--max) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 16px; top: -60px; z-index: 100; background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 8px; }
.skip-link:focus { top: 16px; }

.i { width: 1.1em; height: 1.1em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.eyebrow {
  font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
  display: flex; align-items: center; gap: 10px;
}
.eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }

.prose { color: var(--muted); font-size: 18px; max-width: 62ch; }
.prose p + p { margin-top: 1em; }
.prose ul { list-style: disc; padding-left: 1.2em; margin-top: .6em; }
.prose li + li { margin-top: .4em; }
.prose li::marker { color: var(--accent); }
.prose a { text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.prose strong { color: var(--text); }

/* ---------- Photo peek: hover or tap a phrase to see a photo ---------- */

.peek { position: relative; display: inline; white-space: nowrap; }
.peek-trigger {
  display: inline; padding: 0; border: 0; background: none; cursor: pointer;
  font: inherit; color: var(--text); text-align: inherit;
  text-decoration: underline dotted var(--accent); text-decoration-thickness: 2px; text-underline-offset: 4px;
}
.peek-card {
  position: absolute; left: 50%; bottom: calc(100% + 14px); z-index: 20; width: 220px; white-space: normal;
  padding: 8px 8px 10px; border-radius: 6px; background: #fff; box-shadow: 0 18px 40px rgb(0 0 0 / .22);
  display: none; pointer-events: none; transform-origin: 50% 100%;
  transform: translateX(calc(-50% + var(--shift, 0px))) rotate(-3deg);
}
.peek-card img { width: 100%; height: auto; border-radius: 3px; }
.peek.is-dismissed .peek-card { display: none !important; }
.peek-card.is-wide { width: 300px; }
.peek-caption { display: block; margin-top: 8px; font: 600 13px/1.3 var(--font-body); color: #12110e; text-align: center; }
.peek.is-below .peek-card { bottom: auto; top: calc(100% + 14px); transform-origin: 50% 0; }
.peek:hover .peek-card, .peek.is-open .peek-card, .peek-trigger:focus-visible + .peek-card {
  display: block; animation: peek-pop .35s cubic-bezier(.3, 1.4, .5, 1);
}
@keyframes peek-pop {
  from { opacity: 0; transform: translateX(calc(-50% + var(--shift, 0px))) rotate(-3deg) scale(.85); }
}

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

.buttons { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px; border-radius: 999px; font-weight: 600; font-size: 16px;
  text-decoration: none; border: 1.5px solid var(--text);
  transition: background-color .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease), transform .3s var(--ease);
}
.btn .i { transition: transform .3s var(--ease); }
.btn:hover .i { transform: translateX(4px); }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--text); color: var(--bg); }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-ghost { background: transparent; color: var(--text); }
.btn-ghost:hover { background: var(--text); color: var(--bg); }
button.btn { font: inherit; font-weight: 600; cursor: pointer; }

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

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent; transition: border-color .3s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 76px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 600; }
.brand-mark {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: var(--text); color: var(--bg); font: 700 15px/1 var(--font-heading); letter-spacing: -.02em;
  transition: transform .5s var(--ease), background-color .3s;
}
.brand:hover .brand-mark { transform: rotate(-12deg) scale(1.06); background: var(--accent); color: var(--on-accent); }
.site-nav ul { display: flex; align-items: center; gap: 6px; }
.site-nav a {
  position: relative; display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; text-decoration: none; font-weight: 500; border-radius: 999px;
}
.site-nav a::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 4px; height: 2px; background: var(--accent);
  transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease);
}
.site-nav a:hover::after, .site-nav a[aria-current="page"]::after { transform: scaleX(1); }
.site-nav .nav-resume { border: 1.5px solid var(--text); margin-left: 8px; }
.site-nav .nav-resume::after { display: none; }
.site-nav .nav-resume:hover { background: var(--text); color: var(--bg); }
.nav-toggle { display: none; }

@media (max-width: 720px) {
  .nav-toggle {
    display: grid; place-items: center; width: 44px; height: 44px; border: 0; background: none; cursor: pointer; color: var(--text);
  }
  .bars, .bars::before, .bars::after { display: block; width: 22px; height: 2px; background: currentColor; border-radius: 2px; transition: transform .3s var(--ease), opacity .2s; }
  .bars { position: relative; }
  .bars::before, .bars::after { content: ""; position: absolute; left: 0; }
  .bars::before { top: -7px; }
  .bars::after { top: 7px; }
  .nav-toggle[aria-expanded="true"] .bars { background: transparent; }
  .nav-toggle[aria-expanded="true"] .bars::before { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .bars::after { transform: translateY(-7px) rotate(-45deg); }
  .site-nav {
    position: absolute; top: 76px; left: 0; right: 0; background: var(--bg); border-bottom: 1px solid var(--line);
    padding: 8px var(--gutter) 24px; display: none;
  }
  .site-nav.is-open { display: block; animation: drop .35s var(--ease); }
  .site-nav ul { flex-direction: column; align-items: stretch; gap: 0; }
  .site-nav a { padding: 14px 0; font-size: 22px; font-family: var(--font-heading); border-radius: 0; }
  .site-nav a::after { left: 0; right: auto; width: 40px; }
  .site-nav .nav-resume { border: 0; margin: 0; }
  html:not(.js) .site-nav { display: block; position: static; }
}
@keyframes drop { from { opacity: 0; transform: translateY(-8px); } }

/* ---------- Hero & page headers ---------- */

.hero { padding-block: clamp(32px, 5vw, 72px) clamp(48px, 8vw, 112px); }
.hero-title { font-size: clamp(48px, 10vw, 136px); line-height: .95; letter-spacing: -.045em; margin-top: 28px; }
.hero-line { display: inline-block; }
.hero-title .mark {
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat; background-position: 0 94%; background-size: 100% .14em;
  padding-inline: .04em; transition: background-size 1.1s var(--ease) .7s;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.js .hero-line:not(.is-in) .mark { background-size: 0 .14em; }
.hero-intro { margin-top: 40px; font-size: clamp(18px, 1.6vw, 21px); }

.page-header { padding-block: clamp(56px, 10vw, 128px) clamp(32px, 5vw, 64px); }
.page-title { font-size: clamp(44px, 8vw, 104px); letter-spacing: -.04em; margin-top: 24px; }
.page-intro { margin-top: 28px; font-size: clamp(18px, 1.6vw, 21px); }

/* ---------- Section heads ---------- */

.section-head { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 12px 24px; margin-bottom: clamp(32px, 4vw, 56px); }
.section-head .eyebrow { grid-column: 1 / -1; }
.section-title { font-size: clamp(32px, 4.6vw, 60px); letter-spacing: -.035em; }
.section-note { color: var(--muted); font-size: 15px; font-variant-numeric: tabular-nums; }
@media (max-width: 600px) { .section-head { grid-template-columns: 1fr; } }

/* ---------- Work: full-width rows and compact list ---------- */

.work { padding-bottom: var(--space); }
.work + .work { padding-top: 0; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; }
.filters button {
  font: 500 15px/1 var(--font-body); padding: 10px 16px; border-radius: 999px; cursor: pointer;
  background: transparent; color: var(--text); border: 1.5px solid var(--line);
  transition: background-color .25s, border-color .25s, color .25s;
}
.filters button:hover { border-color: var(--text); }
.filters button[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }

.card[hidden] { display: none; }

/* Selected work rows */
.work-rows { border-top: 2px solid var(--text); }
.card-row { border-bottom: 1px solid var(--line); }
.row-link {
  --row-gap: clamp(24px, 4vw, 64px);
  display: grid; grid-template-columns: 56px minmax(0, 5fr) minmax(0, 6fr); gap: var(--row-gap);
  align-items: center; padding-block: clamp(40px, 5vw, 72px); text-decoration: none;
}
/* The number hangs in the left column, on the baseline of the title's first line */
.row-body { grid-column: 2; }
.row-media { grid-column: 3; }
.row-num {
  display: inline-block; width: 0; white-space: nowrap; vertical-align: middle;
  transform: translateX(calc(-56px - var(--row-gap)));
  font: 500 14px/1 ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: 0; color: var(--muted);
}
.row-body { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.row-title { font-size: clamp(32px, 3.8vw, 52px); letter-spacing: -.035em; }
.row-role { text-wrap: balance; font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); line-height: 1.7; }
.row-role .dot { margin-inline: .45em; }
.row-summary { color: var(--muted); font-size: 18px; max-width: 46ch; }
.row-media {
  position: relative; aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden;
  background: var(--tint); display: grid; place-items: center; padding: 7%;
}
.row-media img {
  width: 100%; height: 100%; object-fit: contain;
  filter: drop-shadow(0 18px 30px rgb(0 0 0 / .14)); transition: transform .7s var(--ease);
}
/* Tag pills: slide in one after another when the row is hovered or focused */
.row-pills {
  position: absolute; top: 16px; left: 16px; right: 16px; z-index: 1;
  display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none;
}
.row-pills li {
  padding: 7px 14px; border-radius: 999px; background: var(--bg); color: var(--text);
  font-size: 13px; font-weight: 600; line-height: 1.2; box-shadow: 0 2px 8px rgb(0 0 0 / .08);
  opacity: 0; transform: translateY(-8px);
  transition: opacity .3s var(--ease), transform .45s var(--ease);
  transition-delay: calc(var(--i, 0) * 70ms);
}
a.row-link:is(:hover, :focus-visible) .row-pills li { opacity: 1; transform: none; }
/* No hover on touch screens, so the pills simply stay visible */
@media (hover: none) { .row-pills li { opacity: 1; transform: none; } }
/* Hover: the text glides toward its mockup so the row reads as one unit */
.row-body { transition: transform .55s var(--ease); }
.row-num { transition: color .3s; }
.card-row { transition: opacity .4s var(--ease); }
a.row-link:is(:hover, :focus-visible) .row-body { transform: translateX(32px); }
a.row-link:is(:hover, :focus-visible) .row-num { color: var(--text); }
/* While one row is hovered or focused, the others step back */
@media (hover: hover) {
  .work-rows:has(.row-link:hover) .card-row:not(:has(.row-link:hover)) { opacity: .45; }
}
.work-rows:has(.row-link:focus-visible) .card-row:not(:has(.row-link:focus-visible)) { opacity: .45; }
@media (max-width: 860px) { a.row-link:is(:hover, :focus-visible) .row-body { transform: none; } }
a.row-link:hover .row-media img { transform: translateY(-8px) scale(1.035); }
a.row-link:hover .row-title { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 3px; text-underline-offset: 7px; }
@media (max-width: 860px) {
  .row-link { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .row-body, .row-media { grid-column: auto; }
  .row-num { display: none; }
  .row-media { order: -1; }
}

.card-metrics { display: grid; gap: 6px; }
.card-metrics li { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
.card-metrics .i { margin-top: .25em; color: var(--on-accent); background: var(--accent); border-radius: 50%; padding: 3px; width: 1.15em; height: 1.15em; stroke-width: 3; }
.card-cta { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.card-cta .i:last-child { transition: transform .35s var(--ease); }
a:hover .card-cta .i:last-child { transform: translateX(6px); }
.badge {
  display: inline-block; padding: 6px 12px; border-radius: 999px;
  background: color-mix(in srgb, var(--text) 7%, var(--bg)); color: var(--muted); font-size: 13px; font-weight: 600;
}

/* Other work: compact list */
.work-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px clamp(24px, 3vw, 48px); }
@media (max-width: 960px) { .work-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .work-list { grid-template-columns: minmax(0, 1fr); } }
.card-list { border-top: 1px solid var(--line); }
.list-link { display: grid; grid-template-columns: minmax(0, 1fr) 88px; gap: 20px; padding-block: 24px; text-decoration: none; }
.list-body { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.list-title { font-size: 24px; letter-spacing: -.025em; }
.list-summary { color: var(--muted); font-size: 15.5px; line-height: 1.55; }
.list-body .row-role { font-size: 11.5px; }
.list-body .card-cta, .list-body .badge { margin-top: 4px; font-size: 15px; }
.list-thumb {
  width: 88px; height: 88px; border-radius: calc(var(--radius) * .7); overflow: hidden;
  background: var(--tint); display: grid; place-items: center;
}
.list-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
a.list-link:hover .list-thumb img { transform: scale(1.08); }
a.list-link:hover .list-title { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 5px; }
.list-link.is-static .list-thumb img { filter: grayscale(.3); }

.work-more { margin-top: 48px; display: flex; justify-content: center; }

/* ---------- Split (image + text) ---------- */

.split {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 6vw, 96px);
  align-items: center; padding-block: clamp(32px, 6vw, 72px) var(--space);
}
.split.is-reverse .split-media { order: 2; }
.work + .split { padding-top: 0; }
.split-media { margin: 0; border-radius: var(--radius); overflow: hidden; background: var(--frame); }
.split-media img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; transition: transform 1s var(--ease); }
.split-media:hover img { transform: scale(1.03); }
.split .section-head { grid-template-columns: 1fr; margin-bottom: 24px; }
@media (max-width: 820px) {
  .split { grid-template-columns: 1fr; }
  .split.is-reverse .split-media { order: 0; }
  .split-media { max-width: 420px; }
}

/* ---------- Gallery ---------- */

.gallery { padding-bottom: var(--space); }
.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(12px, 2vw, 24px); }
@media (max-width: 820px) { .gallery-grid { grid-template-columns: repeat(2, 1fr); } }
.gallery figure { position: relative; margin: 0; border-radius: var(--radius); overflow: hidden; background: var(--frame); }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; transition: transform .8s var(--ease); }
.gallery figcaption {
  position: absolute; left: 12px; bottom: 12px; padding: 8px 14px; border-radius: 999px;
  background: var(--bg); font-size: 14px; font-weight: 600;
  transform: translateY(6px); opacity: .92; transition: transform .4s var(--ease), background-color .3s, color .3s;
}
.gallery figure:hover img { transform: scale(1.06) rotate(.6deg); }
.gallery figure:hover figcaption { transform: none; background: var(--accent); color: var(--on-accent); }

/* ---------- Link list (contact) ---------- */

.link-list { padding-bottom: var(--space); }
.link-list ul { border-top: 1px solid var(--line); }
.link-list li { border-bottom: 1px solid var(--line); }
.link-list a {
  display: grid; grid-template-columns: minmax(120px, 1fr) 2fr auto; align-items: center; gap: 16px;
  padding: clamp(20px, 3vw, 32px) 0; text-decoration: none; transition: padding .4s var(--ease), color .3s;
}
.ll-label { font: 700 clamp(26px, 3.4vw, 44px)/1.1 var(--font-heading); letter-spacing: -.03em; }
.ll-value { color: var(--muted); }
.link-list a .i { width: 28px; height: 28px; transition: transform .4s var(--ease); }
.link-list a:hover { padding-left: 16px; }
.link-list a:hover .i { transform: rotate(-45deg); color: var(--accent); }
.link-list a[href^="mailto"]:hover .i { transform: translateX(6px); }
@media (max-width: 600px) {
  .link-list a { grid-template-columns: 1fr auto; }
  .ll-value { grid-row: 2; font-size: 15px; }
}

/* ---------- Dark panels (on the theme's surface color) ---------- */

:is(.cta-inner, .cs-statement, .case-close) {
  --muted: color-mix(in srgb, var(--on-surface) 68%, var(--surface));
  background: var(--surface); color: var(--on-surface);
}
:is(.cta-inner, .cs-statement, .case-close) .prose strong { color: var(--on-surface); }
:is(.cta-inner, .case-close) .btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
:is(.cta-inner, .case-close) .btn-primary:hover { background: var(--on-surface); border-color: var(--on-surface); color: var(--surface); }
:is(.cta-inner, .case-close) .btn-ghost { color: var(--on-surface); border-color: color-mix(in srgb, var(--on-surface) 45%, transparent); }
:is(.cta-inner, .case-close) .btn-ghost:hover { background: var(--on-surface); border-color: var(--on-surface); color: var(--surface); }

/* ---------- CTA ---------- */

.cta { padding-bottom: var(--space); }
.cta-inner { border-radius: calc(var(--radius) * 1.5); padding: clamp(32px, 6vw, 80px); }
.cta-title { font-size: clamp(32px, 5vw, 64px); letter-spacing: -.035em; max-width: 16ch; }
.cta .prose { margin-top: 20px; }

/* ---------- Case study: public teaser ---------- */

.read-progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; pointer-events: none; }
.read-progress span { display: block; height: 100%; background: var(--accent); transform-origin: 0 50%; transform: scaleX(var(--progress, 0)); }

.case-hero { padding-block: clamp(32px, 6vw, 72px) clamp(40px, 5vw, 64px); }
.back {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 500; color: var(--muted);
  margin-bottom: clamp(32px, 5vw, 56px); transition: color .25s;
}
.back .i { transition: transform .3s var(--ease); }
.back:hover { color: var(--text); }
.back:hover .i { transform: translateX(-4px); }
.case-title { font-size: clamp(40px, 6.4vw, 88px); line-height: 1.02; letter-spacing: -.042em; margin-top: 20px; max-width: 17ch; }
.case-intro {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); align-items: start;
  gap: 32px clamp(32px, 6vw, 96px); margin-top: clamp(28px, 4vw, 48px);
}
.case-lede { font-size: clamp(19px, 1.7vw, 22px); max-width: 50ch; }
.case-meta { display: grid; gap: 12px; margin: 0; padding-left: 24px; border-left: 1px solid var(--line); }
.case-meta div { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 12px; align-items: baseline; }
.case-meta dt { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.case-meta dd { margin: 0; font-weight: 500; }
@media (max-width: 820px) {
  .case-intro { grid-template-columns: minmax(0, 1fr); }
  .case-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; padding: 20px 0 0; border-left: 0; border-top: 1px solid var(--line); }
  .case-meta div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}

/* Stat strip: big numbers in a row (teaser and the metrics block) */
.case-stats { margin-top: clamp(40px, 5vw, 64px); }
:is(.case-stats, .cs-stats) { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); border-top: 2px solid var(--text); }
:is(.case-stats, .cs-stats) li { display: flex; flex-direction: column; gap: 8px; padding: 24px 24px 0 0; }
:is(.case-stats, .cs-stats) li + li { padding-left: 24px; border-left: 1px solid var(--line); }
:is(.case-stats, .cs-stats) strong { font: 700 clamp(44px, 5.4vw, 72px)/1 var(--font-heading); letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
:is(.case-stats, .cs-stats) span { color: var(--muted); font-size: 16px; max-width: 24ch; text-wrap: balance; }
@media (max-width: 640px) {
  :is(.case-stats, .cs-stats) { grid-auto-flow: row; }
  :is(.case-stats, .cs-stats) li, :is(.case-stats, .cs-stats) li + li { padding: 20px 0; border-left: 0; }
  :is(.case-stats, .cs-stats) li + li { border-top: 1px solid var(--line); }
}

.cs-stats-note { margin-top: clamp(32px, 4vw, 48px); max-width: 62ch; }
.case-cover { margin: 0 auto; }
.case-cover > div { background: var(--tint); border-radius: calc(var(--radius) * 1.5); padding: clamp(24px, 6vw, 88px); }
.case-cover img { margin-inline: auto; max-height: 72vh; width: auto; filter: drop-shadow(0 30px 50px rgb(0 0 0 / .16)); }

/* ---------- Case study: body ---------- */

/* Blocks sit in one of three columns: narrow (reading width), wide, or bleed (edge to edge). */
.case-body { padding-block: var(--space); }
.locked { padding-inline: var(--gutter); }
.cs-flow {
  --narrow: 720px; --wide: 1120px; --side: calc((var(--wide) - var(--narrow)) / 2);
  display: grid; row-gap: clamp(72px, 10vw, 136px);
  grid-template-columns:
    [bleed-start] minmax(var(--gutter), 1fr)
    [wide-start] minmax(0, var(--side))
    [narrow-start] min(var(--narrow), 100% - var(--gutter) * 2) [narrow-end]
    minmax(0, var(--side)) [wide-end]
    minmax(var(--gutter), 1fr) [bleed-end];
}
.cs-flow > * { grid-column: narrow; min-width: 0; margin: 0; }
.cs-flow > :is(.cs-section, .cs-story, .cs-cards, .cs-compare, .cs-reflection, .cs-metrics, .cs-pullquote, .is-wide) { grid-column: wide; }
.cs-flow > :is(.cs-statement, .is-full) { grid-column: bleed; }
.preview-note {
  display: flex; align-items: center; gap: 8px; width: fit-content; max-width: calc(100% - var(--gutter) * 2); margin: 0 auto 56px; padding: 8px 16px; border-radius: 999px;
  background: var(--text); color: var(--bg); font-size: 14px; font-weight: 600;
}

.cs-h2 { font-size: clamp(30px, 3.8vw, 48px); letter-spacing: -.035em; }
.cs-h3 { font-size: clamp(26px, 3vw, 38px); letter-spacing: -.03em; }
.eyebrow + :is(.cs-h2, .cs-h3) { margin-top: 16px; }
:is(.cs-h2, .cs-h3) + .prose { margin-top: 20px; }
.cs-flow .prose { font-size: 18.5px; }
.cs-head { margin-bottom: clamp(28px, 4vw, 48px); }
.cs-head .prose { margin-top: 16px; }

/* Labeled section: the label hangs to the left of the reading column */
.cs-section { display: grid; grid-template-columns: subgrid; }
.cs-label { grid-column: 1; padding: 10px 24px 0 0; }
.cs-section-body { grid-column: 2; }
@media (max-width: 1080px) {
  .cs-flow > .cs-section { grid-column: narrow; display: block; }
  .cs-label { padding: 0; }
  .cs-label:not(:empty) + .cs-section-body { margin-top: 16px; }
}

/* Statement band: dark, straight edges, edge to edge */
.cs-statement { padding-block: clamp(72px, 10vw, 144px); }
.cs-statement-inner { max-width: calc(var(--wide) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.cs-statement-text { font: 600 clamp(30px, 4.4vw, 60px)/1.1 var(--font-heading); letter-spacing: -.032em; max-width: 24ch; text-wrap: balance; }
.eyebrow + .cs-statement-text { margin-top: 24px; }
.cs-statement-text em { font-style: normal; color: var(--accent); }
.cs-statement .prose { margin-top: 28px; max-width: 56ch; }

/* Text + image, alternating sides */
.cs-story { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 32px clamp(32px, 6vw, 88px); align-items: center; }
.cs-story.is-reverse .cs-story-media { order: -1; }
@media (max-width: 860px) {
  .cs-story { grid-template-columns: minmax(0, 1fr); }
  .cs-story.is-reverse .cs-story-media { order: 0; }
}

/* Image panels */
.cs-frame { position: relative; background: var(--tint); border-radius: var(--radius); padding: clamp(16px, 4vw, 48px); overflow: hidden; }
.cs-frame.is-flush { padding: 0; }
.cs-frame img, .cs-frame video { margin-inline: auto; border-radius: calc(var(--radius) * .5); }
.cs-frame.is-flush :is(img, video) { border-radius: 0; width: 100%; }
.cs-flow > .is-full .cs-frame { border-radius: 0; }
.cs-flow figcaption { margin-top: 12px; color: var(--muted); font-size: 15px; }
.cs-placeholder {
  display: grid; place-items: center; aspect-ratio: 4 / 3; padding: 16px; text-align: center;
  border: 1.5px dashed color-mix(in srgb, var(--text) 25%, transparent); border-radius: calc(var(--radius) * .5);
  color: var(--muted); font-size: 14px; font-weight: 600;
}
.is-wide > .cs-frame .cs-placeholder, .is-full > .cs-frame .cs-placeholder { aspect-ratio: 16 / 7; }

/* Card trio */
.cs-card-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; counter-reset: none; }
.cs-card-list li {
  display: flex; flex-direction: column; gap: 12px; padding: clamp(24px, 3vw, 32px);
  background: var(--frame); border-radius: var(--radius);
}
/* Optional screen at the top of a card; opens full size */
.cs-card-media {
  display: grid; place-items: center; aspect-ratio: 4 / 3; margin-bottom: 8px; padding: 10px; cursor: zoom-in;
  background: var(--bg); border-radius: calc(var(--radius) * .6); transition: transform .4s var(--ease), box-shadow .4s var(--ease);
}
.cs-card-media img { width: 100%; height: 100%; object-fit: contain; border-radius: 3px; }
.cs-card-media:hover { transform: translateY(-3px); box-shadow: 0 12px 26px rgb(0 0 0 / .1); }
.cs-card-num { font: 500 13px/1 ui-monospace, "Cascadia Mono", Consolas, monospace; color: var(--muted); }
.cs-card-list h3 { font-size: 23px; letter-spacing: -.02em; line-height: 1.15; margin-top: 12px; }
.cs-flow .cs-card-list .prose { font-size: 16px; }

/* Pull quote */
.cs-pullquote { text-align: center; }
.cs-pullquote::before { content: ""; display: block; width: 56px; height: 4px; margin: 0 auto 36px; border-radius: 2px; background: var(--accent); }
.cs-pullquote blockquote { margin: 0 auto; max-width: 24ch; font: 600 clamp(30px, 4.2vw, 56px)/1.12 var(--font-heading); letter-spacing: -.032em; text-wrap: balance; }
.cs-pullquote figcaption { margin-top: 24px; }

/* Research quote */
.cs-quote { padding-left: 28px; border-left: 4px solid var(--accent); }
.cs-quote blockquote { margin: 0; font: 600 clamp(22px, 2.6vw, 30px)/1.3 var(--font-heading); letter-spacing: -.02em; }
.cs-quote figcaption { margin-top: 14px; }

/* Before → after table */
.cs-compare-table { width: 100%; border-collapse: collapse; text-align: left; }
.cs-compare-table th, .cs-compare-table td { padding: 22px 24px 22px 0; vertical-align: top; }
.cs-compare-table thead th { padding-block: 0 14px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.cs-compare-table thead th:first-child { width: 24%; }
.cs-compare-table thead th:nth-child(2) { width: 36%; }
.cs-compare-table thead { border-bottom: 2px solid var(--text); }
.cs-compare-table tbody tr + tr { border-top: 1px solid var(--line); }
.cs-compare-table tbody th { font: 600 19px/1.3 var(--font-heading); letter-spacing: -.01em; }
.cs-compare-table td { color: var(--muted); }
.cs-compare-table td:last-child { color: var(--text); font-weight: 500; }
.cs-after { display: flex; gap: 12px; align-items: flex-start; }
.cs-after .i { margin-top: .2em; color: var(--on-accent); background: var(--accent); border-radius: 50%; padding: 3px; width: 1.25em; height: 1.25em; stroke-width: 3; }
.cs-compare-table td p + p { margin-top: .6em; }
@media (max-width: 720px) {
  .cs-compare-table, .cs-compare-table tbody, .cs-compare-table tr, .cs-compare-table th, .cs-compare-table td { display: block; }
  .cs-compare-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .cs-compare-table { border-top: 2px solid var(--text); }
  .cs-compare-table tbody tr { padding-block: 20px; }
  .cs-compare-table th, .cs-compare-table td { padding: 0; }
  .cs-compare-table td { margin-top: 14px; }
  .cs-compare-table td::before {
    content: attr(data-label); display: block; margin-bottom: 4px;
    font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
  }
}

/* Image row: a few screens side by side, each opens full size */
.cs-image-row ul { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: 16px; }
.cs-image-row figure { margin: 0; }
.cs-image-row .cs-frame {
  display: grid; place-items: center; aspect-ratio: 4 / 3; padding: clamp(10px, 1.6vw, 20px); cursor: zoom-in;
  transition: transform .4s var(--ease), box-shadow .4s var(--ease);
}
.cs-image-row .cs-frame img { width: 100%; height: 100%; object-fit: contain; border-radius: 4px; }
.cs-image-row a.cs-frame:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgb(0 0 0 / .1); }
.cs-image-row-caption { margin-top: 16px; color: var(--muted); font-size: 15px; }
@media (max-width: 720px) {
  .cs-image-row ul { grid-template-columns: minmax(0, 1fr); }
  .cs-image-row .cs-frame { aspect-ratio: auto; }
}

/* Before/after slider: the before image is clipped to the left of the handle */
.cs-slider-box { position: relative; overflow: hidden; border-radius: calc(var(--radius) * .5); user-select: none; }
.cs-slider-box img { width: 100%; border-radius: 0; }
.cs-slider-before {
  position: absolute; inset: 0; height: 100%; object-fit: cover; object-position: top center;
  clip-path: inset(0 calc(100% - var(--pos)) 0 0);
}
.cs-slider-label {
  position: absolute; top: 14px; padding: 6px 12px; border-radius: 999px; pointer-events: none;
  background: rgb(0 0 0 / .66); color: #fff; font-size: 13px; font-weight: 600; transition: opacity .25s;
}
.cs-slider-label.is-before { left: 14px; }
.cs-slider-label.is-after { right: 14px; }
@media (max-width: 600px) {
  .cs-slider-label { top: 8px; padding: 4px 9px; font-size: 11px; }
  .cs-slider-label.is-before { left: 8px; }
  .cs-slider-label.is-after { right: 8px; }
  .cs-slider-knob { width: 38px; height: 38px; }
}
.cs-slider-box[data-near="start"] .is-before, .cs-slider-box[data-near="end"] .is-after { opacity: 0; }
.cs-slider-input {
  position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; margin: 0;
  opacity: 0; cursor: ew-resize; -webkit-appearance: none; appearance: none;
}
.cs-slider-handle {
  position: absolute; top: 0; bottom: 0; left: var(--pos); z-index: 1; width: 2px; margin-left: -1px;
  background: #fff; box-shadow: 0 0 0 1px rgb(0 0 0 / .15); pointer-events: none;
}
.cs-slider-knob {
  position: absolute; top: 50%; left: 50%; width: 44px; height: 44px; transform: translate(-50%, -50%);
  display: grid; place-items: center; border-radius: 50%; background: #fff; color: #12110e;
  box-shadow: 0 6px 18px rgb(0 0 0 / .25); transition: transform .25s var(--ease);
}
.cs-slider-knob svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.cs-slider-box:hover .cs-slider-knob { transform: translate(-50%, -50%) scale(1.08); }
.cs-slider-input:focus-visible ~ .cs-slider-handle .cs-slider-knob { outline: 3px solid var(--accent); outline-offset: 3px; }

/* Inline video */
.cs-frame video { display: block; width: 100%; height: auto; }
.cs-video-toggle {
  position: absolute; right: 16px; bottom: 16px; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  background: rgb(0 0 0 / .62); color: #fff; display: grid; place-items: center; opacity: .85; transition: opacity .2s, transform .2s var(--ease);
}
.cs-video-toggle:hover { opacity: 1; transform: scale(1.06); }
/* Pause bars, or a play triangle while paused */
.cs-video-toggle::before { content: ""; width: 12px; height: 14px; background: linear-gradient(90deg, currentColor 0 4px, transparent 4px 8px, currentColor 8px); }
.cs-video-toggle[aria-pressed="true"]::before { width: 0; height: 0; margin-left: 4px; background: none; border-style: solid; border-width: 8px 0 8px 13px; border-color: transparent transparent transparent currentColor; }

/* Reflection */
.cs-reflection {
  display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: 32px clamp(32px, 6vw, 96px);
  padding: clamp(32px, 5vw, 64px); background: var(--frame); border-radius: calc(var(--radius) * 1.5);
}
.cs-reflection dl { margin: 0; }
.cs-reflection dl div { padding-block: 20px; border-top: 1px solid color-mix(in srgb, var(--text) 14%, transparent); }
.cs-reflection dl div:first-child { padding-top: 0; border-top: 0; }
.cs-reflection .prose + dl { margin-top: 28px; }
.cs-reflection dt { font: 600 20px/1.25 var(--font-heading); letter-spacing: -.015em; }
.cs-reflection dd { margin: 8px 0 0; }
@media (max-width: 860px) { .cs-reflection { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Case study: close and next ---------- */

.case-close { padding-block: clamp(72px, 10vw, 136px); }
.case-close-inner { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: 32px clamp(32px, 6vw, 96px); align-items: end; }
.case-close-title { font-size: clamp(40px, 6vw, 84px); letter-spacing: -.045em; line-height: 1; }
.case-close-title span { display: block; color: var(--accent); }
.case-close .buttons { margin-top: 28px; }
@media (max-width: 820px) { .case-close-inner { grid-template-columns: minmax(0, 1fr); } }

.case-next { padding-block: clamp(48px, 7vw, 96px) var(--space); }
.case-next a {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px 24px;
  padding-top: clamp(24px, 3vw, 36px); border-top: 2px solid var(--text); text-decoration: none;
}
.case-next .eyebrow, .case-next-summary { grid-column: 1; }
.case-next-title { grid-column: 1; font: 700 clamp(34px, 5.4vw, 72px)/1 var(--font-heading); letter-spacing: -.045em; }
.case-next-summary { color: var(--muted); max-width: 56ch; }
.case-next .i { grid-column: 2; grid-row: 1 / span 3; width: clamp(36px, 4.5vw, 60px); height: clamp(36px, 4.5vw, 60px); transition: transform .4s var(--ease); }
.case-next a:hover .case-next-title { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 4px; text-underline-offset: 8px; }
.case-next a:hover .i { transform: translateX(10px); }

/* ---------- Password form ---------- */

.unlock {
  max-width: 560px; margin-inline: auto; text-align: center;
  background: var(--frame); border: 1px solid var(--line); border-radius: calc(var(--radius) * 1.5); padding: clamp(28px, 5vw, 56px);
}
.unlock-icon { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--accent); color: var(--on-accent); }
.unlock-icon .i { width: 26px; height: 26px; }
.unlock h2 { font-size: clamp(24px, 3vw, 32px); margin: 20px 0 12px; }
.unlock p { color: var(--muted); }
.unlock p a { color: var(--text); text-decoration-color: var(--accent); text-decoration-thickness: 2px; }
.unlock-row { display: flex; gap: 8px; margin-top: 28px; }
.unlock input {
  flex: 1; min-width: 0; font: inherit; padding: 13px 20px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--bg); color: var(--text);
}
.unlock input:focus { outline: none; border-color: var(--text); }
.unlock-error { margin-top: 14px; color: var(--text) !important; font-weight: 600; }
.unlock.is-shaking { animation: shake .45s var(--ease); }
.unlock.is-busy button { opacity: .6; pointer-events: none; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
@media (max-width: 480px) { .unlock-row { flex-direction: column; } .unlock-row .btn { justify-content: center; } }
.unlocked-in { animation: fade-up .7s var(--ease); }
@keyframes fade-up { from { opacity: 0; transform: translateY(16px); } }

/* ---------- Footer & wordmark ---------- */

.site-footer { border-top: 1px solid var(--line); padding-top: clamp(48px, 7vw, 88px); overflow: hidden; }
.footer-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 32px; }
.footer-email {
  display: inline-block; margin-top: 16px; font: 700 clamp(28px, 4.6vw, 60px)/1.05 var(--font-heading);
  letter-spacing: -.035em; text-decoration: none; word-break: break-word;
  background-image: linear-gradient(var(--accent), var(--accent)); background-repeat: no-repeat;
  background-position: 0 92%; background-size: 0 .14em; transition: background-size .5s var(--ease);
}
.footer-email:hover { background-size: 100% .14em; }
.footer-links { display: flex; gap: 8px; }
.footer-links a {
  display: inline-flex; align-items: center; gap: 6px; padding: 10px 16px; border-radius: 999px;
  border: 1.5px solid var(--line); text-decoration: none; font-weight: 500; transition: border-color .25s, background-color .25s, color .25s;
}
.footer-links a:hover { border-color: var(--text); background: var(--text); color: var(--bg); }

.wordmark {
  font: 800 11vw/.9 var(--font-heading); letter-spacing: -.055em; white-space: nowrap; text-align: center;
  overflow: hidden; padding-block: .1em .04em;
  margin-top: clamp(48px, 8vw, 104px); padding-inline: var(--gutter); user-select: none;
}
.wordmark .ch { display: inline-block; transition: transform .9s var(--ease), color .3s; transition-delay: calc(var(--i) * 35ms); }
.js .wordmark:not(.is-in) .ch { transform: translateY(105%); }
.wordmark .ch:hover { color: var(--accent); transform: translateY(-8%); transition-delay: 0s; transition-duration: .3s; }
.footer-bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px;
  padding-block: 24px; color: var(--muted); font-size: 14px;
}

/* ---------- Hero playground: "me, as a dashboard" ---------- */

.hero.has-playground {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 500px);
  gap: clamp(40px, 6vw, 96px); align-items: center;
}
.has-playground .hero-title { font-size: clamp(44px, 6.4vw, 96px); }
@media (min-width: 1041px) { .has-playground .playground { align-self: start; padding-top: 8px; } }
@media (max-width: 1040px) {
  .hero.has-playground { grid-template-columns: minmax(0, 1fr); }
  .playground { width: 100%; max-width: 500px; justify-self: center; margin-bottom: 96px; }
  .is-tray.playground { margin-bottom: 0; }
}

.playground { position: relative; padding-block: 24px; --pg-r: calc(var(--radius) * .7); }
.pg-board {
  position: relative; background: color-mix(in srgb, var(--text) 5%, var(--bg)); border: 1px solid var(--line);
  border-radius: calc(var(--radius) * 1.1); transition: background-color .5s var(--ease), border-color .5s, box-shadow .3s;
}
.pg-board.is-target { box-shadow: 0 0 0 3px var(--accent); }
.pg-bar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 600; transition: border-color .5s; }
.pg-lights { display: flex; gap: 6px; }
.pg-lights i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.pg-lights i:first-child { background: var(--accent); }
.pg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px; }
.pg-slot { position: relative; display: flex; min-height: 78px; border-radius: var(--pg-r); }
.pg-slot-metric, .pg-slot-dog { min-height: 100px; }
.pg-slot-work { grid-column: 1 / -1; min-height: 168px; }
.pg-ready .pg-slot:not(.is-filled) { border: 1.5px dashed color-mix(in srgb, var(--text) 22%, transparent); }
.pg-ready .pg-slot:not(.is-filled)::after {
  content: "+"; position: absolute; inset: 0; display: grid; place-items: center;
  font: 300 28px/1 var(--font-body); color: color-mix(in srgb, var(--text) 25%, transparent);
}

.pg-piece { display: flex; width: 100%; }
.pg-card {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  background: var(--bg); color: var(--text); border-radius: var(--pg-r);
  box-shadow: 0 1px 2px rgb(0 0 0 / .06); transition: background-color .5s var(--ease), color .5s;
}
.pg-card small { display: block; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.pg-card b { display: block; font-size: 15px; font-weight: 600; line-height: 1.3; }

/* Loose pieces, scattered around the board like parts on a desk */
.playground > .pg-piece {
  position: absolute; z-index: 3; cursor: grab; touch-action: none; user-select: none;
  transform: rotate(var(--rot, 0deg));
  filter: drop-shadow(0 16px 24px rgb(0 0 0 / .14));
  transition: transform .3s var(--ease), filter .3s;
}
.playground > .pg-piece:hover { transform: rotate(var(--rot, 0deg)) translateY(-4px); }
.playground > .pg-piece.is-dragging { z-index: 6; cursor: grabbing; transform: scale(1.04); filter: drop-shadow(0 24px 36px rgb(0 0 0 / .2)); transition: none; }
.pg-piece.is-placed .pg-place { display: none; }
.playground > .pg-piece .pg-place {
  position: absolute; top: -10px; right: -10px; z-index: 1; width: 28px; height: 28px; padding: 0;
  display: grid; place-items: center; border: 0; border-radius: 50%; cursor: pointer;
  --plus: var(--bg);
  background:
    linear-gradient(var(--plus), var(--plus)) center / 12px 2px no-repeat,
    linear-gradient(var(--plus), var(--plus)) center / 2px 12px no-repeat,
    var(--text);
  font-size: 0;
}
.playground > .pg-piece .pg-place:hover {
  --plus: var(--on-accent);
  background:
    linear-gradient(var(--plus), var(--plus)) center / 12px 2px no-repeat,
    linear-gradient(var(--plus), var(--plus)) center / 2px 12px no-repeat,
    var(--accent);
}

/* Phone: loose pieces become chips in a tray */
.pg-tray { display: none; }
.is-tray .pg-tray { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 14px; }
.pg-tray .pg-card { display: none; }
.pg-tray .pg-piece { width: auto; }
.pg-tray .pg-place {
  display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px; cursor: pointer;
  border: 1.5px solid var(--line); border-radius: 999px; background: var(--bg); color: var(--text);
  font: 600 14px/1 var(--font-body); box-shadow: 0 4px 12px rgb(0 0 0 / .06);
}

.pg-foot { margin: 0; padding: 0 16px 14px; min-height: 34px; font-size: 13px; color: var(--muted); }
.pg-foot > span { display: none; }
.pg-ready.is-tray:not(.is-complete) .pg-hint-tap,
.pg-ready.is-complete .pg-done { display: inline; }
.pg-drag-hint {
  display: none; position: absolute; left: 50%; top: calc(100% + 64px); z-index: 2; transform: translateX(-50%);
  margin: 0; padding: 10px 16px; border-radius: 999px; white-space: nowrap; pointer-events: none;
  background: var(--text); color: var(--bg); font-size: 14px; font-weight: 600;
  box-shadow: 0 8px 20px rgb(0 0 0 / .15); animation: fade-up .6s var(--ease) .4s backwards;
}
.pg-ready:not(.has-progress):not(.is-tray) .pg-drag-hint { display: block; }
.pg-done { font-weight: 600; color: var(--text); animation: fade-up .6s var(--ease); }
.pg-reset {
  margin-left: 6px; padding: 0; border: 0; background: none; cursor: pointer; font: inherit; font-weight: 600; color: inherit;
  text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px;
}

/* Status */
.pg-pulse { width: 10px; height: 10px; flex: none; border-radius: 50%; background: #22c55e; animation: pulse 2.2s ease-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgb(34 197 94 / .5); } 80%, 100% { box-shadow: 0 0 0 10px rgb(34 197 94 / 0); } }

/* Mode switch */
.pg-mode { display: grid; grid-template-columns: 1fr auto; column-gap: 8px; }
.pg-mode .pg-switch { grid-row: 1 / 3; grid-column: 2; }
.pg-switch {
  position: relative; width: 52px; height: 30px; padding: 0; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--line); transition: background-color .3s var(--ease);
}
.pg-knob {
  position: absolute; top: 4px; left: 4px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--text); transition: transform .4s cubic-bezier(.3, 1.5, .5, 1), background-color .3s;
}
.pg-switch[aria-checked="true"] { background: var(--accent); }
.pg-switch[aria-checked="true"] .pg-knob { transform: translateX(22px); background: var(--on-accent); }

/* Metric */
.pg-metric { flex-direction: column; align-items: flex-start; justify-content: center; gap: 4px; }
.pg-metric strong { font: 700 44px/1 var(--font-heading); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }

/* Dog */
.pg-dog { position: relative; flex-wrap: wrap; }
.pg-dog .pg-pet { margin-left: auto; }
.pg-dog > span:nth-child(2) { flex: 1 1 96px; min-width: 0; }
.pg-dog small, .pg-mode b { white-space: nowrap; }
@media (max-width: 480px) { .pg-dog { gap: 8px; } .pg-dog-face { width: 36px; height: 36px; font-size: 20px; } .pg-dog .pg-pet { margin-left: 44px; } }
.pg-dog-face { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 50%; background: color-mix(in srgb, var(--text) 7%, var(--bg)); font-size: 24px; transition: background-color .5s; }
.pg-dog-face.is-wiggling { animation: wiggle .6s var(--ease); }
@keyframes wiggle { 20% { transform: rotate(-14deg) scale(1.1); } 45% { transform: rotate(12deg) scale(1.1); } 70% { transform: rotate(-6deg); } }
.pg-pet {
  align-self: flex-end; padding: 6px 10px; border: 1.5px solid var(--line); border-radius: 999px; cursor: pointer;
  background: transparent; color: inherit; font: 600 12px/1 var(--font-body); white-space: nowrap;
}
.pg-pet:hover { border-color: var(--accent); }
.pg-pets { display: inline-block; min-width: 1ch; font-variant-numeric: tabular-nums; }
.pg-heart { position: absolute; left: 28px; top: 8px; color: var(--accent); font-size: 18px; pointer-events: none; animation: heart .9s var(--ease) forwards; }
@keyframes heart { to { transform: translateY(-36px) scale(1.4); opacity: 0; } }

/* How I work / side quests */
.pg-work { flex-direction: column; align-items: stretch; justify-content: center; }
.pg-work > .pg-day { display: grid; grid-template-columns: minmax(0, 1fr) 220px; align-items: center; gap: 12px; }
.pg-work > .pg-day p { margin-top: 6px; font-size: 14px; line-height: 1.45; color: var(--muted); }
.pg-loop { display: block; width: 100%; height: 130px; overflow: visible; }
@media (max-width: 480px) { .pg-work > .pg-day { grid-template-columns: 1fr; } .pg-work > .pg-day p { display: none; } }
.pg-loop text { font: 600 11px var(--font-body); fill: var(--text); }
.pg-loop .pg-loop-center { fill: var(--muted); font-weight: 500; }
.pg-ring { fill: none; stroke: color-mix(in srgb, var(--text) 25%, transparent); stroke-width: 1.5; stroke-dasharray: 3 5; }
.pg-nodes circle { fill: var(--bg); stroke: var(--text); stroke-width: 1.5; }
.pg-orbit { transform-box: view-box; transform-origin: 110px 65px; animation: orbit 7s linear infinite; }
.pg-orbit circle { fill: var(--accent); }
@keyframes orbit { to { transform: rotate(360deg); } }
.pg-inventory { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 10px; }
.pg-inventory li {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px 8px;
  border: 2px solid color-mix(in srgb, currentColor 22%, transparent); border-radius: 8px;
  font-size: 11px; font-weight: 600; text-align: center; transition: border-color .2s, transform .2s var(--ease);
}
.pg-inventory li span { font-size: 24px; line-height: 1; }
.pg-inventory li:hover { border-color: var(--accent); transform: translateY(-3px); }

/* Day / night */
.pg-night { display: none; }
[data-mode="night"] .pg-day { display: none; }
[data-mode="night"] .pg-night { display: revert; }
[data-mode="night"] .pg-board { background: var(--text); border-color: var(--text); color: var(--bg); }
[data-mode="night"] .pg-bar { border-color: color-mix(in srgb, var(--bg) 14%, transparent); }
[data-mode="night"] .pg-lights i { background: color-mix(in srgb, var(--bg) 22%, transparent); }
[data-mode="night"] .pg-lights i:first-child { background: var(--accent); }
[data-mode="night"] .pg-card { background: color-mix(in srgb, var(--bg) 9%, var(--text)); color: var(--bg); }
[data-mode="night"] .pg-card small { color: color-mix(in srgb, var(--bg) 60%, transparent); }
[data-mode="night"] .pg-dog-face { background: color-mix(in srgb, var(--bg) 14%, var(--text)); }
[data-mode="night"] .pg-pet { border-color: color-mix(in srgb, var(--bg) 25%, transparent); }
[data-mode="night"].pg-ready .pg-slot:not(.is-filled) { border-color: color-mix(in srgb, var(--bg) 25%, transparent); }
[data-mode="night"] .pg-foot, [data-mode="night"] .pg-done { color: color-mix(in srgb, var(--bg) 75%, transparent); }

/* ---------- Scroll reveal ---------- */

.js [data-reveal] {
  opacity: 0; transform: translateY(28px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
  transition-delay: calc(var(--i, 0) * 90ms);
}
.js [data-reveal].is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-delay: 0s !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
  .wordmark .ch { transform: none !important; }
}
.no-motion *, .no-motion *::before, .no-motion *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-delay: 0s !important; }
.no-motion.js [data-reveal] { opacity: 1; transform: none; }
.no-motion .wordmark .ch { transform: none !important; }
