/* ===== Jonathan Keyek — shared site styles ===== */
:root {
  color-scheme: light;
  --bg: #f3f3f3;
  --ink: #000000;
  --ink-soft: #333333;
  --section-gap: 3.25rem;
  --muted: #616161;
  --rule: #d8d8d8;
  --link-ul: #d8d8d8;
  --card: #ffffff;
  --green: #1f7a4d;  /* revenue generated — 4.79:1 on --bg */
  --blue:  #2563a8;  /* capability built / 0→1 — 5.52:1 on --bg */
  --red:   #b5482f;  /* money saved by killing early — 4.81:1 on --bg */
  --agents: #9837F6; /* case accent — 4.5:1 on --bg */
  --admin:  #0362FF; /* case accent — 4.5:1 on --bg */
  --design: #008212; /* case accent — 4.51:1 on --bg */
  --maxw: 1120px;
  --maxw-wide: 1120px;

  /* Type scale — every font-size in the site resolves to one of these */
  --text-2xs: .6875rem;  /* 11px — eyebrow labels, tags */
  --text-xs:  .8125rem;  /* 13px — small supporting text */
  --text-sm:  .875rem;   /* 14px — secondary body */
  --text-base: .9375rem; /* 15px — running body copy */
  --text-md:  1rem;      /* 16px — titles, emphasized labels */
  --text-lg:  1.0625rem; /* 17px — card titles */
  --text-xl:  1.1875rem; /* 19px — pull quotes */
  --text-display: clamp(1.7rem, 6vw, 2.1rem); /* h1 / page title */
  --text-hero: clamp(2.2rem, 9vw, 3rem);      /* anchor metric numbers */
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; background: var(--bg); color: var(--ink); }
body {
  background: transparent !important;
  color: var(--ink) !important;
  font-family: -apple-system, "SF Pro Text", "SF Pro Display", BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: var(--text-base);
  line-height: 1.55;
  padding: 0;
}
.wrap, .wrap-wide {
  padding: clamp(2.5rem, 8vw, 6rem) clamp(20px, 4vw, 40px) 5rem;
  display: flex;
  flex-direction: column;
}
.wrap { max-width: 1120px; margin: 0 auto; }
.wrap-wide { max-width: 1120px; margin: 0 auto; }

a {
  color: var(--ink) !important;
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor), linear-gradient(var(--link-ul), var(--link-ul));
  background-size: 0% 1px, 100% 1px;
  background-position: left bottom, left bottom;
  background-repeat: no-repeat, no-repeat;
  padding-bottom: 1px;
  transition: background-size .35s cubic-bezier(0.4, 0, 0.2, 1);
}
a:hover { background-size: 100% 1px, 100% 1px; }
a.plain { background: none; padding-bottom: 0; transition: opacity .15s; }
a.plain:hover { opacity: .5; }

h1 { font-size: clamp(2.8rem, 10vw, 3.4rem); font-weight: 700; letter-spacing: -0.025em; line-height: 1.1; }
.role { color: var(--muted) !important; font-size: var(--text-xs); font-weight: 500; letter-spacing: .01em; line-height: 1.4; margin-top: .2rem; }

section { margin-top: var(--section-gap); }
h2 {
  font-size: var(--text-xs); font-weight: 500; letter-spacing: .01em; line-height: 1.4;
  color: var(--muted) !important; padding-bottom: .6rem; margin-bottom: 0; border-bottom: 1px solid var(--rule);
}

/* List rows */
.row { display: flex; justify-content: space-between; align-items: baseline; gap: 1.5rem; padding: .7rem 0; border-bottom: 1px solid var(--rule); }
.row:not(.linked):last-child { border-bottom: none; }
.more-inner .rowlink:last-child .row { border-bottom: none; }
.rowlink:has(+ .more-wrap:not(.open)) .row { border-bottom: none; }
.row-left { flex: 1; min-width: 0; }
.contact-label { display: inline-flex; align-items: center; gap: 8px; }
.row.contact-row { align-items: center; }
.row.contact-row .row-left { display: flex; align-items: center; }
.contact-icon { color: var(--ink); flex-shrink: 0; }
.contact-rowlink { display: block; background: none; padding-bottom: 0; border-bottom: 1px solid var(--rule); }
.contact-rowlink:last-child { border-bottom: none; }
.contact-rowlink .row.contact-row { border-bottom: none !important; }
.contact-rowlink .row-right {
  color: var(--ink) !important;
  display: inline-flex; align-items: center;
  background-image: linear-gradient(currentColor, currentColor), linear-gradient(var(--link-ul), var(--link-ul));
  background-size: 0% 1px, 100% 1px;
  background-position: left bottom, left bottom;
  background-repeat: no-repeat, no-repeat;
  padding-bottom: 1px;
  transition: background-size .35s cubic-bezier(0.4, 0, 0.2, 1);
}
.contact-rowlink:hover .row-right { background-size: 100% 1px, 100% 1px; }
.contact-icon-dark { display: none; }
html.dark .contact-icon-light { display: none; }
html.dark .contact-icon-dark { display: block; }
.row-right { flex-shrink: 0; color: var(--muted) !important; font-size: var(--text-xs); white-space: nowrap; }
.title-line { display: inline-flex; align-items: center; gap: 6px; }
.company-logo { width: 20px; height: 20px; border-radius: 5px; object-fit: cover; flex-shrink: 0; opacity: .8; }
.item-title { font-weight: 500; font-size: var(--text-md); color: var(--ink) !important; }
.item-sub { color: var(--muted) !important; font-size: var(--text-sm); display: block; margin-top: .1rem; }
.row.linked .row-left .item-title {
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1.5px;
  background-position: left bottom;
  background-repeat: no-repeat;
  padding-bottom: 1px;
  transition: background-size .35s cubic-bezier(0.4, 0, 0.2, 1);
}
.row.linked:hover .row-left .item-title { background-size: 100% 1.5px; }
.row.linked .row-left .item-title::after {
  content: ""; margin-left: 8px;
  display: inline-block; width: 14px; height: 14px; vertical-align: middle;
  background-color: currentColor;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cline%20x1='5'%20y1='12'%20x2='19'%20y2='12'%3E%3C/line%3E%3Cpolyline%20points='12%205%2019%2012%2012%2019'%3E%3C/polyline%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cline%20x1='5'%20y1='12'%20x2='19'%20y2='12'%3E%3C/line%3E%3Cpolyline%20points='12%205%2019%2012%2012%2019'%3E%3C/polyline%3E%3C/svg%3E");
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-size: contain; mask-size: contain;
  -webkit-mask-position: center; mask-position: center;
  opacity: 0; transform: translateX(-5px);
  transition: opacity .2s cubic-bezier(0.4, 0, 0.2, 1), transform .2s cubic-bezier(0.4, 0, 0.2, 1);
}
.row.linked:hover .row-left .item-title::after { opacity: 1; transform: translateX(0); }
a.rowlink { display: block; background: none; padding-bottom: 0; }

/* Stack chips */
.stack { display: flex; flex-wrap: wrap; gap: .4rem; padding-top: .85rem; }
.chip { font-size: var(--text-xs); padding: .2rem .6rem; border: 1px solid var(--rule); border-radius: 100px; color: var(--ink) !important; background: #f3f3f3; }

/* Stack logos with real images */
.logos { display: flex; flex-wrap: wrap; gap: 1rem; padding-top: 1rem; align-items: center; }
.logo { display: inline-flex; background: none; padding-bottom: 0; }
.logo:hover { opacity: 1; }
.logo-img {
  width: 44px; height: 44px; border: 1px solid var(--rule); border-radius: 12px;
  background: #fff; padding: 0; object-fit: contain; transition: transform .15s, border-color .15s;
}
.logo:hover .logo-img { transform: translateY(-2px); border-color: #bbb; }

.intro p { font-size: var(--text-base); line-height: 1.6; margin-bottom: 1rem; max-width: none; color: var(--ink) !important; }
.intro p:last-child { margin-bottom: 0; }
.intro-em { color: var(--ink) !important; font-weight: 600; }
html.dark .intro-em { color: #fff !important; }

footer { margin-top: 3.5rem; color: var(--muted) !important; font-size: var(--text-xs); font-weight: 500; letter-spacing: .01em; line-height: 1.4; }

/* Avatar */
.avatar-wrap { position: relative; display: inline-block; }
.identity { display: flex; flex-direction: column; align-items: flex-start; gap: var(--section-gap); margin-bottom: 2rem; }
.identity-text { min-width: 0; }
.avatar { position: relative; z-index: 1; width: 80px; height: 80px; display: block; }
.avatar-flyout { position: absolute; top: 0; left: 0; width: 80px; height: 80px; z-index: 0; pointer-events: none; }
.flyout-dot {
  position: absolute; top: 50%; left: 50%;
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; line-height: 1; overflow: hidden;
  opacity: 0; transform: translate(-50%, -50%) scale(.3);
  transition: transform .35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity .25s ease;
}
.flyout-dot.emoji-lg { font-size: 23px; }
.flyout-dot img { width: 76%; height: 76%; object-fit: contain; }
.flyout-dot img.logo-family { width: 62%; height: 62%; }
@media (hover: hover) and (pointer: fine) {
  .avatar-wrap:hover .flyout-dot { opacity: 1; }
  .avatar-wrap:hover .flyout-dot:nth-child(1) { transform: translate(calc(-50% + 76px), -50%) scale(1); transition-delay: 0ms; }
  .avatar-wrap:hover .flyout-dot:nth-child(2) { transform: translate(calc(-50% + 122px), -50%) scale(1); transition-delay: 35ms; }
  .avatar-wrap:hover .flyout-dot:nth-child(3) { transform: translate(calc(-50% + 168px), -50%) scale(1); transition-delay: 70ms; }
  .avatar-wrap:hover .flyout-dot:nth-child(4) { transform: translate(calc(-50% + 214px), -50%) scale(1); transition-delay: 105ms; }
  .avatar-wrap:hover .flyout-dot:nth-child(5) { transform: translate(calc(-50% + 260px), -50%) scale(1); transition-delay: 140ms; }
  .avatar-wrap:hover .flyout-dot:nth-child(6) { transform: translate(calc(-50% + 306px), -50%) scale(1); transition-delay: 175ms; }
}

/* ===== Case study page — same restrained type as home ===== */
.cs-back {
  font-size: var(--text-xs); color: var(--muted) !important; display: inline-block; align-self: flex-start; margin-bottom: 3rem;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px;
  background-position: left bottom;
  background-repeat: no-repeat;
  padding-bottom: 1px;
  transition: background-size .35s cubic-bezier(0.4, 0, 0.2, 1), color .35s cubic-bezier(0.4, 0, 0.2, 1);
}
.cs-back:hover { background-size: 100% 1px; color: var(--ink) !important; }
footer .cs-back { margin-bottom: 0; }
footer:has(.footer-logo) { display: flex; align-items: center; gap: 8px; }
.footer-logo { width: 20px; height: 20px; margin: 0 4px 0 2px; border-radius: 5px; flex-shrink: 0; } /* centered in a 24px slot, like the contact icons */
html.dark .footer-logo { filter: invert(1); }
.cs-tag { font-size: var(--text-xs); font-weight: 500; letter-spacing: .01em; line-height: 1.4; color: var(--muted); margin-bottom: .9rem; }
.cs-title { font-size: var(--text-display); font-weight: 600; letter-spacing: -0.025em; line-height: 1.1; }
.cs-specs { display: flex; flex-wrap: wrap; gap: 1.6rem 2.5rem; margin-top: 1.6rem; padding-bottom: 1.6rem; }
/* Case study hero — 80vw blob container, always in static hover state */
.cs-hero-wrap {
  position: relative;
  width: 100vw;
  aspect-ratio: 16 / 10;
  margin-left: calc(50% - 50vw);
  margin-top: 1.5rem;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.04);
}

/* Blob always fully visible — no transitions, no rotation animation */
.cs-hero-wrap .case-thumb-blob-wrap {
  opacity: 1;
  transform: scale(1) rotate(0deg);
  transition: none;
}

.cs-hero-wrap .case-thumb-blob {
  animation: none;
}

/* Image with 40px breathing room top and bottom */
.cs-hero-wrap .case-thumb-img {
  max-height: calc(100% - 80px);
  max-width: min(80vw, 1920px);
  transform: none !important;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.12))
          drop-shadow(0 20px 48px rgba(0, 0, 0, 0.24));
}
.cs-spec-label { font-size: var(--text-xs); font-weight: 500; letter-spacing: .01em; line-height: 1.4; color: var(--muted); }
.cs-spec-val { font-size: var(--text-sm); margin-top: .15rem; }

/* Anchor metric — quiet, inline, no card or oversized color number */
.anchor { padding: 2.2rem 0 1rem; border-top: 1px solid var(--rule); margin-top: .4rem; }
.cs-hero-wrap + .anchor { border-top: none; margin-top: 3rem; }
.anchor-num { font-size: var(--text-hero); font-weight: 600; letter-spacing: -0.03em; line-height: 1; }
.anchor-num.green { color: var(--green); }
.anchor-num.blue { color: var(--blue); }
.anchor-num.red { color: var(--red); }
.anchor-num.agents { color: var(--agents); }
.anchor-num.admin  { color: var(--admin); }
.anchor-num.design { color: var(--design); }
.anchor-label { font-size: var(--text-md); font-weight: 500; margin-top: .5rem; }
.anchor-sub { color: var(--muted) !important; font-size: var(--text-sm); margin-top: .3rem; max-width: none; }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--rule); }
.metric-item { padding: 2.2rem 1.5rem 1.5rem 0; }
.metric-item + .metric-item { padding-left: 1.5rem; border-left: 1px solid var(--rule); }

/* TL;DR — same row rhythm as home, no cards */
.tldr { margin-top: .4rem; }
.tldr-row { padding: 1.1rem 0; border-bottom: 1px solid var(--rule); }
.tldr-label { font-size: var(--text-2xs); letter-spacing: .035em; color: var(--muted); }
.tldr-title { font-size: var(--text-md); font-weight: 600; margin: .25rem 0 .4rem; }
.tldr-body { font-size: var(--text-sm); color: var(--ink-soft) !important; line-height: 1.55; max-width: none; }
.tldr-body p + p { margin-top: .7rem; }
.metric-note { font-size: var(--text-xs); color: var(--muted); line-height: 1.5; margin-top: .8rem; }

/* Image slot — hairline frame, not a striped placeholder block */
.imgph {
  border: 1px solid var(--rule); border-radius: 4px; aspect-ratio: 16/9;
  display: flex; align-items: center; justify-content: center; text-align: center;
  color: var(--muted); font-size: var(--text-xs); padding: 1rem; margin: 1rem 0 0; background: #fff;
}
.feature { padding: 1.4rem 0; border-bottom: 1px solid var(--rule); }
.feature h3 { font-size: var(--text-md); font-weight: 600; margin-bottom: .3rem; }
.feature p { font-size: var(--text-sm); color: var(--ink-soft) !important; line-height: 1.55; max-width: none; }

.deepdive { margin-top: .4rem; }
details { border-bottom: 1px solid var(--rule); }
details summary {
  cursor: pointer; list-style: none; padding: 1rem 0; font-weight: 600; font-size: var(--text-md);
  display: grid; grid-template-columns: 1fr auto auto; align-items: baseline; gap: 1rem;
  transition: color .2s cubic-bezier(0.4, 0, 0.2, 1);
}
details summary:hover { color: var(--ink); }
details summary::-webkit-details-marker { display: none; }
details summary::after {
  content: "+"; color: var(--muted); font-weight: 400; font-size: 1.2rem; line-height: 1; flex-shrink: 0;
  display: inline-block;
  transition: transform .35s cubic-bezier(0.4, 0, 0.2, 1), color .2s cubic-bezier(0.4, 0, 0.2, 1);
}
details summary:hover::after { color: var(--ink); }
details[open] summary::after { transform: rotate(45deg); }
details[data-closing] summary::after { transform: rotate(0deg); }
.dd-sub { font-size: var(--text-xs); color: var(--muted); font-weight: 400; transition: opacity .2s; }
details[open] .dd-sub { opacity: 0; }
details[data-closing] .dd-sub { opacity: 1; }
.dd-body {
  display: grid;
  grid-template-rows: 0fr;
  overflow: hidden;
  transition: grid-template-rows .4s cubic-bezier(0.4, 0, 0.2, 1);
}
details[open] .dd-body { grid-template-rows: 1fr; }
details[data-closing] .dd-body { grid-template-rows: 0fr; }
.dd-body > div { min-height: 0; padding: 0 0 1.4rem; font-size: var(--text-sm); color: var(--ink-soft) !important; line-height: 1.6; }
.dd-body h4 { font-size: var(--text-sm); margin: 1rem 0 .3rem; color: var(--ink); font-weight: 600; }
.dd-body p { margin-bottom: .8rem; max-width: none; }

/* Quote — restrained, no green block; a simple ruled pull-quote */
.quote { border-top: 1px solid var(--rule); padding: 1.6rem 0 1.6rem; margin-top: .4rem; }
.quote p { font-size: var(--text-xl); line-height: 1.4; color: var(--ink) !important; font-weight: 500; max-width: none; }
.quote .attr { font-size: var(--text-xs); color: var(--muted) !important; margin-top: .8rem; }

.credits { margin-top: .4rem; }
.credit-row { display: flex; justify-content: space-between; align-items: baseline; gap: 1.5rem; padding: .7rem 0; border-bottom: 1px solid var(--rule); }
.credit-label { font-size: var(--text-xs); color: var(--muted) !important; }
.credit-name { font-size: var(--text-sm); text-align: right; }

@media (max-width: 480px) {
  .row { flex-direction: column; gap: .1rem; }
  .row.contact-row { flex-direction: row; align-items: center; }
  .row-right { font-size: var(--text-xs); padding-top: 8px; }
  .row.contact-row .row-right { padding-top: 0; }
  .cs-specs { gap: 1.1rem 1.6rem; }
}

/* Cascade reveal */
/* Movement and refraction run as two animations so the glass effect can
   outlast the (front-loaded) rise: the blur clears and a red/blue split
   collapses gradually while the text is still settling. Native filter
   functions only, so it stays on the GPU. */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes refractIn {
  0%   { filter: blur(8px) drop-shadow(-8px 0 0 rgb(255 40 90 / .55)) drop-shadow(8px 0 0 rgb(40 120 255 / .55)); }
  45%  { filter: blur(3px) drop-shadow(-4px 0 0 rgb(255 40 90 / .32)) drop-shadow(4px 0 0 rgb(40 120 255 / .32)); }
  100% { filter: none; }
}
/* Same refraction for the avatar during the theme switch. It's lifted out of
   the ripple so its morph keeps running, which means it's visible before the
   ripple arrives: start sharp and ramp into the blur over the first ~10%
   instead of holding it blurred. Keep the tail in step with refractIn. */
@keyframes refractInAvatar {
  0%   { filter: none; }
  10%  { filter: blur(8px) drop-shadow(-8px 0 0 rgb(255 40 90 / .55)) drop-shadow(8px 0 0 rgb(40 120 255 / .55)); }
  45%  { filter: blur(3px) drop-shadow(-4px 0 0 rgb(255 40 90 / .32)) drop-shadow(4px 0 0 rgb(40 120 255 / .32)); }
  100% { filter: none; }
}
.reveal {
  opacity: 0;
  /* "both": the first keyframe (transparent, blurred, split) holds through the
     stagger delay, so text can never show plain before its animation starts */
  animation: fadeUp 560ms cubic-bezier(0.22,1,0.36,1) both,
             refractIn 800ms cubic-bezier(0.3,0,0.3,1) both;
}
.reveal.reveal-lite { animation: fadeUp 400ms cubic-bezier(0.22,1,0.36,1) both; }
/* Contact dividers sit on the wrapping link: hidden until their row reveals */
html.js .contact-rowlink:not(.reveal-border) { border-bottom-color: transparent; }
.contact-rowlink.reveal-border { animation: borderIn 500ms ease-out both; }
@keyframes borderIn { from { border-bottom-color: transparent; } }
html.js [data-reveal] { opacity: 0; }

/* ===== Thumbnail GIF animations ===== */
@keyframes th-node-pulse { 0%,100%{opacity:.85} 50%{opacity:.3} }
@keyframes th-line-draw  { 0%,10%{stroke-dashoffset:1;opacity:0} 35%,65%{stroke-dashoffset:0;opacity:.6} 90%,100%{stroke-dashoffset:1;opacity:0} }
@keyframes th-tile-glow  { 0%,100%{opacity:.15} 50%{opacity:.85} }
@keyframes th-line-trace { 0%{stroke-dashoffset:1} 65%{stroke-dashoffset:0} 85%,100%{stroke-dashoffset:1} }
@keyframes th-spike-blink{ 0%,45%{opacity:0} 65%,80%{opacity:1} 90%,100%{opacity:0} }

.th-nd   { animation: th-node-pulse 2.5s ease-in-out infinite; }
.th-nd.c { animation-duration: 2s; }
.th-nd.d1{ animation-delay:.3s }  .th-nd.d2{ animation-delay:.6s }
.th-nd.d3{ animation-delay:.9s }  .th-nd.d4{ animation-delay:1.2s }
.th-ln   { stroke-dasharray:1; animation: th-line-draw 3s ease-in-out infinite; }
.th-ln.d1{ animation-delay:0s }   .th-ln.d2{ animation-delay:.55s }
.th-ln.d3{ animation-delay:1.1s } .th-ln.d4{ animation-delay:1.65s }
.th-chart{ stroke-dasharray:1; animation: th-line-trace 3.8s ease-in-out infinite; }
.th-spike{ animation: th-spike-blink 3.8s ease-in-out infinite; }
.th-tile { animation: th-tile-glow 3.6s ease-in-out infinite; }
.th-tile.d1{animation-delay:0s}   .th-tile.d2{animation-delay:.6s}  .th-tile.d3{animation-delay:1.2s}
.th-tile.d4{animation-delay:.3s}  .th-tile.d5{animation-delay:.9s}  .th-tile.d6{animation-delay:1.5s}

/* Pause all CSS animations + SMIL handled by JS */
html.paused *, html.paused *::before, html.paused *::after {
  animation-play-state: paused !important;
}

/* ===== Tooltips ===== */
[data-tooltip] { position: relative; }
[data-tooltip]::before {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  padding: .28rem .55rem;
  background: rgba(0,0,0,.82);
  color: #fff !important;
  font-size: var(--text-2xs);
  letter-spacing: .035em;
  font-family: -apple-system, "SF Pro Text", Helvetica, sans-serif;
  font-weight: 400;
  line-height: 1.4;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity .12s;
  z-index: 200;
}
[data-tooltip]:hover::before { opacity: 1; }
@media (hover: none) {
  [data-tooltip]::before { content: none; }
}

/* ===== Pause toggle button ===== */
#pause-toggle {
  position: fixed;
  top: clamp(1rem, 4vw, 1.8rem);
  right: calc(clamp(1rem, 4vw, 1.8rem) + 46px);
  width: 20px; height: 20px;
  background: none; border: none; cursor: pointer; padding: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
  transition: color .15s;
  z-index: 100;
}
#pause-toggle:hover { color: var(--ink-soft); }
#pause-toggle .icon-play  { display: none; }
html.paused #pause-toggle .icon-pause { display: none; }
html.paused #pause-toggle .icon-play  { display: block; }

/* ===== Case study cards — full-width thumb, text below ===== */
/* What I'm Working On */
.wip-list { display: flex; flex-direction: column; gap: 1.5rem; margin-top: 1.5rem; }
.wip-item { display: flex; gap: 1.5rem; align-items: stretch; }
.wip-thumb {
  flex-shrink: 0;
  border-radius: 14px; background: rgba(0,0,0,0.04); padding: 12px; box-sizing: border-box;
  display: inline-flex;
}
.wip-thumb img {
  display: block; height: 200px; width: auto; max-width: 100%;
  border-radius: 4px;
}
.wip-content {
  flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; gap: 1.5rem;
  padding-top: 16px; padding-bottom: 16px;
  color: inherit; text-decoration: none; background-image: none;
}
.wip-title-row { display: flex; flex-direction: column; align-items: flex-start; }
.wip-title { font-weight: 500; font-size: var(--text-md); color: var(--ink) !important; line-height: 1; }
.wip-title-link {
  display: inline-flex; align-items: center; line-height: 1;
  color: var(--ink) !important; text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1.5px;
  background-position: left bottom;
  background-repeat: no-repeat;
  padding-bottom: 1px;
  transition: background-size .35s cubic-bezier(0.4, 0, 0.2, 1);
}
.wip-content:hover .wip-title-link { background-size: 100% 1.5px; }
.ext-link-icon {
  display: inline-block; margin-left: 8px;
  opacity: 0; transform: translateX(-5px);
  transition: opacity .2s cubic-bezier(0.4, 0, 0.2, 1), transform .2s cubic-bezier(0.4, 0, 0.2, 1);
}
.wip-content:hover .ext-link-icon { opacity: 1; transform: translateX(0); }
.wip-body { color: var(--muted) !important; font-size: var(--text-sm); margin-top: 12px; }
.wip-meta { color: var(--muted) !important; font-size: var(--text-xs); }
.btn-primary { display: inline-flex; align-items: center; background: var(--ink); color: #fff !important; border: none; border-radius: 100px; padding: .65rem 1.5rem; font-size: var(--text-sm); font-weight: 500; font-family: inherit; cursor: pointer; margin-top: 2rem; transition: background .2s, transform .1s; text-decoration: none; background-image: none; }
.btn-primary:hover { background: var(--ink-soft) !important; background-image: none !important; }
.btn-primary:active { transform: scale(0.97); }
.btn-tertiary { background: none; border: none; color: var(--ink); font-family: inherit; font-size: var(--text-md); font-weight: 500; cursor: pointer; padding: 0 0 1px; display: inline-block; margin-top: 1.25rem; align-self: flex-start; background-image: linear-gradient(currentColor, currentColor); background-size: 0% 1.5px; background-position: left bottom; background-repeat: no-repeat; transition: background-size .35s cubic-bezier(0.4, 0, 0.2, 1); }
.btn-tertiary::after { content: "→"; margin-left: 8px; display: inline-block; opacity: 0; transform: translateX(-5px); transition: opacity .2s cubic-bezier(0.4, 0, 0.2, 1), transform .2s cubic-bezier(0.4, 0, 0.2, 1); }
.btn-tertiary:hover { background-size: 100% 1.5px; }
.btn-tertiary:hover::after { opacity: 1; transform: translateX(0); }

.cases { display: flex; flex-direction: column; gap: 2rem; padding-top: 1.5rem; }
a.case-link { background: none; padding-bottom: 0; display: block; }
a.case-link:hover { opacity: 1; }
.case-card {
  display: flex;
  flex-direction: column;
  border-radius: 16px;
}
/* 16:10 thumbnail container */
.case-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Blob wrapper — rotation baked into the entrance/exit transition: spins in, stays still, spins out */
.case-thumb-blob-wrap {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(0.2) rotate(-40deg);
  transform-origin: center;
  transition: opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
  z-index: 0;
}

a.case-link:hover .case-thumb-blob-wrap {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

/* Blob shape — unique organic shape per case; flex-rotates while hovered */
.case-thumb-blob {
  position: absolute;
  inset: -32%;
  filter: blur(52px);
  animation: blob-flex 18s linear infinite;
  animation-play-state: paused;
}

a.case-link:hover .case-thumb-blob {
  animation-play-state: running;
}

@keyframes blob-flex {
  0%   { transform: rotate(0deg)   scale(1);    }
  25%  { transform: rotate(90deg)  scale(1.04); }
  50%  { transform: rotate(180deg) scale(0.97); }
  75%  { transform: rotate(270deg) scale(1.04); }
  100% { transform: rotate(360deg) scale(1);    }
}

/* Agents — purple, elongated and lopsided, heavy top-left + deep violet bottom-right */
.case-thumb-agents .case-thumb-blob {
  border-radius: 72% 28% 44% 56% / 30% 58% 42% 70%;
  background:
    radial-gradient(ellipse at 20% 32%, rgba(216, 180, 254, 0.98) 0%, transparent 50%),
    radial-gradient(ellipse at 78% 72%, rgba(109, 40, 217, 0.92) 0%, transparent 48%),
    radial-gradient(ellipse at 52% 50%, rgba(192, 132, 252, 0.6) 0%, transparent 72%);
}

/* Admin — blue, wide and flat, cool highlight top-right + deep navy bottom-left */
.case-thumb-admin .case-thumb-blob {
  border-radius: 44% 56% 68% 32% / 64% 36% 58% 42%;
  background:
    radial-gradient(ellipse at 78% 28%, rgba(147, 197, 253, 0.98) 0%, transparent 50%),
    radial-gradient(ellipse at 22% 74%, rgba(29, 78, 216, 0.92) 0%, transparent 50%),
    radial-gradient(ellipse at 52% 50%, rgba(59, 130, 246, 0.58) 0%, transparent 68%);
}

/* Design System — green, chunky bottom-right + deep forest top-left */
.case-thumb-design .case-thumb-blob {
  border-radius: 30% 70% 36% 64% / 56% 44% 68% 32%;
  background:
    radial-gradient(ellipse at 68% 74%, rgba(187, 247, 208, 0.98) 0%, transparent 50%),
    radial-gradient(ellipse at 26% 26%, rgba(21, 128, 61, 0.94) 0%, transparent 48%),
    radial-gradient(ellipse at 50% 52%, rgba(74, 222, 128, 0.65) 0%, transparent 70%);
}

/* Mock image — centered, 32px padding all sides, scales up on hover */
.case-thumb-img {
  position: relative;
  z-index: 1;
  max-width: calc(100% - 64px);
  max-height: calc(100% - 64px);
  width: auto;
  height: auto;
  display: block;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.06))
          drop-shadow(0 8px 24px rgba(0, 0, 0, 0.09));
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
              filter 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

a.case-link:hover .case-thumb-img {
  transform: scale(1.02);
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.12))
          drop-shadow(0 20px 48px rgba(0, 0, 0, 0.24));
}
.case-content { min-width: 0; padding: .85rem .25rem .25rem; text-align: left; }
.case-title {
  font-weight: 600; font-size: var(--text-lg); letter-spacing: -.01em;
  color: var(--ink) !important; line-height: 1.25; display: block;
}
.case-title-inner {
  display: inline;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1.5px;
  background-position: left bottom;
  background-repeat: no-repeat;
  padding-bottom: 2px;
  transition: background-size .35s cubic-bezier(0.4, 0, 0.2, 1);
}
a.case-link:hover .case-title-inner { background-size: 100% 1.5px; }
.case-arrow {
  display: inline-block; margin-left: 8px;
  opacity: 0; transform: translateX(-5px);
  transition: opacity .2s cubic-bezier(0.4, 0, 0.2, 1), transform .2s cubic-bezier(0.4, 0, 0.2, 1);
}
a.case-link:hover .case-arrow { opacity: 1; transform: translateX(0); }
.case-sub { color: var(--muted) !important; font-size: var(--text-sm); margin-top: .4rem; transition: color .2s; }
.case-meta { display: flex; align-items: center; gap: .5rem; margin-top: .9rem; font-size: var(--text-xs); color: var(--muted) !important; transition: color .2s; }
a.case-link:hover .case-sub { color: var(--ink) !important; }
a.case-link:hover .case-meta { color: var(--ink) !important; }

@media (max-width: 600px) {
  .case-thumb-wrap { aspect-ratio: 16/10; }
  .wip-item { flex-direction: column; align-items: stretch; }
  .wip-content { order: 1; padding-top: 0; }
  .wip-thumb { order: 2; width: 100%; }
  .wip-thumb img { height: auto; width: 100%; }
}

/* ===== Show more / less collapsible ===== */
.more-wrap {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .5s cubic-bezier(0.22,1,0.36,1);
}
.more-wrap.open { grid-template-rows: 1fr; }
.more-inner { overflow: hidden; min-height: 0; }
.more-btn {
  align-self: flex-start;
  margin-top: 1.3rem;
  font-family: inherit;
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--muted) !important;
  background: none;
  border: 1px solid var(--rule);
  border-radius: 100px;
  padding: .42rem 1.05rem;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.more-btn:hover { border-color: #bbb; color: var(--ink) !important; }

/* ===== Dark mode ===== */
html.dark {
  --ink: #e8e8e8;
  --ink-soft: #bbbbbb;
  --muted: #888888;
  --link-ul: #333;
  --green: #248D59;
  --blue: #317DD2;
  --red: #CC573C;
  --agents: #A44EF7;
  --admin: #2074FF;
  --design: #009014;
  background: #111 !important;
}
html.dark body {
  background: transparent !important;
  color: #e8e8e8 !important;
}
html.dark a { color: #e8e8e8 !important; }
html.dark h1, html.dark h2, html.dark .item-title { color: #e8e8e8 !important; }
html.dark .role, html.dark .muted, html.dark .item-sub,
html.dark .row-right, html.dark footer { color: #888 !important; }
html.dark .row { border-bottom-color: #222; }
html.dark .contact-rowlink { border-bottom-color: #222; }
html.dark .contact-rowlink .row-right { color: var(--ink) !important; }
html.dark h2 { border-bottom-color: #222; color: #999 !important; }
html.dark .logo-img { background: #1a1a1a; border-color: #2a2a2a; }
html.dark .logos { border-color: #222; }
html.dark .chip { background: #1a1a1a; border-color: #2a2a2a; color: #e8e8e8 !important; }
html.dark .intro p { color: #ccc !important; }
html.dark .exp-logo { filter: brightness(0.85); }
html.dark a.case-link:hover .case-sub,
html.dark a.case-link:hover .case-meta { color: #e8e8e8 !important; }
html.dark #pause-toggle { color: #888; }
html.dark #pause-toggle:hover { color: #ccc; }
html.dark [data-tooltip]::after { background: rgba(232,232,232,.92); color: #111 !important; }
html.dark .case-title { color: #e8e8e8 !important; }
html.dark .case-thumb-wrap { background: rgba(255, 255, 255, 0.04); }
html.dark .wip-thumb { background: rgba(255, 255, 255, 0.08); }
html.dark .more-btn { border-color: #3a3a3a; color: #a8a8a8 !important; }
html.dark .more-btn:hover { border-color: #4a4a4a; color: #e8e8e8 !important; }
html.dark details summary { color: #e8e8e8; }
html.dark details summary:hover { color: #fff; }
html.dark details summary::after { color: #888; }
html.dark details summary:hover::after { color: #e8e8e8; }
html.dark .dd-body > div { color: #bbb !important; }
html.dark .dd-body h4 { color: #e8e8e8; }
html.dark .anchor { border-top-color: #222; }
html.dark .tldr-row { border-bottom-color: #222; }
html.dark .feature { border-bottom-color: #222; }
html.dark details { border-bottom-color: #222; }
html.dark .credit-row { border-bottom-color: #222; }
html.dark .tldr-body, html.dark .feature p { color: #bbb !important; }
html.dark .cs-spec-label, html.dark .tldr-label, html.dark .dd-sub { color: #666; }
html.dark .cs-tag { color: #888; }

/* Theme toggle */
.theme-toggle-row {
  position: fixed;
  top: clamp(1rem, 4vw, 1.8rem);
  right: clamp(1rem, 4vw, 1.8rem);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: .55rem;
}
.toggle-icon { width: 20px; height: 20px; flex: none; color: var(--ink); }
html.dark .toggle-icon { color: #e8e8e8; }
.switch {
  width: 36px; height: 20px;
  background: #d8d8d8;
  border-radius: 100px;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background .25s;
  display: flex; align-items: center;
  flex: none;
  forced-color-adjust: none;
}
/* "On" should read as obviously on: dark/solid against light mode's pale
   track, and a bright accent against dark mode's dim track. */
.switch[aria-pressed="true"] { background: #000; }
html.dark .switch { background: #333; }
html.dark .switch[aria-pressed="true"] { background: #3b82f6; }
.switch::after {
  content: '';
  width: 14px; height: 14px;
  background: #fff;
  border-radius: 50%;
  margin-left: 3px;
  transition: transform .25s, background .25s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.switch[aria-pressed="true"]::after { transform: translateX(16px); background: #fff; }
html.dark .switch::after { background: #999; }
html.dark .switch[aria-pressed="true"]::after { background: #fff; }

/* Browser backing color — toggled by JS separately from .dark so the
   theme sweep can switch it mid-way (see shared.js). */
html.scheme-dark { color-scheme: dark; }
/* Scroll is locked for the length of the theme sweep (snapshots don't scroll). */
html.vt-lock { overflow: hidden; scrollbar-gutter: stable; }

/* Theme switch: a ripple from the toggle, eased in and out (gentle start and
   finish, a smooth, decisive middle). The new theme
   is revealed behind a feathered edge, and as the edge reaches each block of
   content it replays the load-in's refraction (refractIn, applied from
   shared.js), so the switch and the page load look the same. Native filters
   and gradient masks only, so it stays on the GPU's fast path. SWEEP_TAIL in
   shared.js is the extra travel (320px) past the far corner. */
@property --vt-r {
  syntax: '<length>';
  inherits: false;
  initial-value: 0px;
}
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}
::view-transition-new(root) {
  -webkit-mask-image: radial-gradient(circle at var(--vt-x) var(--vt-y),
    #000 max(0px, calc(var(--vt-r) - 170px)), transparent calc(var(--vt-r) - 10px));
  mask-image: radial-gradient(circle at var(--vt-x) var(--vt-y),
    #000 max(0px, calc(var(--vt-r) - 170px)), transparent calc(var(--vt-r) - 10px));
  animation: vt-sweep var(--vt-dur, 900ms) cubic-bezier(.65, 0, .35, 1) both;
}
/* The profile photo looks the same in both themes, so it's lifted out of the
   switch: only its live layer shows, in place, so its morph never freezes. */
html.vt-lock .avatar-wrap { view-transition-name: avatar; }
::view-transition-old(avatar) { display: none; }
::view-transition-group(avatar),
::view-transition-new(avatar) { animation: none; }
/* During the switch each block refracts on its own compositor layer, so the
   blur/split animates on the GPU instead of repainting the page per frame. */
html.vt-lock [data-reveal] { will-change: filter; }
/* Held for a frame or two before the ripple starts so the new theme gets
   rasterized up front (see shared.js); 1% is imperceptible. */
html.vt-prime::view-transition-new(root) {
  -webkit-mask-image: none;
  mask-image: none;
  opacity: .01;
}
@keyframes vt-sweep {
  from { --vt-r: 0px; }
  to   { --vt-r: calc(var(--vt-r-end) + 320px); }
}

/* ── A11Y: focus styles ── */
:focus-visible {
  outline: 2px solid #0057FF;
  outline-offset: 3px;
  border-radius: 3px;
}
html.dark :focus-visible {
  outline-color: #4d9fff;
}
/* Remove default outline only when :focus-visible is supported */
:focus:not(:focus-visible) { outline: none; }

/* Skip-to-content link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--ink);
  color: #fff !important;
  padding: .5rem 1rem;
  border-radius: 4px;
  font-size: var(--text-xs);
  font-weight: 600;
  text-decoration: none;
  background-image: none;
  padding-bottom: .5rem;
  z-index: 9999;
  transition: top .15s;
}
.skip-link:focus { top: 1rem; }
html.dark .skip-link { background: #e8e8e8; color: #111 !important; }

/* WIP thumbnail lightbox */
.wip-thumb { cursor: zoom-in; }
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4vw;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease;
}
.lightbox-overlay.open { opacity: 1; visibility: visible; }
.lightbox-overlay img {
  max-width: 100%;
  max-height: 92vh;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
  transform: scale(.96);
  transition: transform .2s ease;
}
.lightbox-overlay.open img { transform: scale(1); }
.lightbox-close {
  position: fixed;
  top: clamp(1rem, 4vw, 1.8rem);
  right: clamp(1rem, 4vw, 1.8rem);
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  z-index: 10001;
}
.lightbox-close:hover { background: rgba(255,255,255,.22); }

/* Respect reduced motion — disable ALL animations */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1 !important; transform: none !important; filter: none !important; }
  html.js [data-reveal] { opacity: 1 !important; }
}
