* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #ffffff;
  --ink: #000000;
  --ink-muted: rgba(0, 0, 0, 0.72);
  --ink-subtle: rgba(0, 0, 0, 0.55);
  --ink-faint: rgba(0, 0, 0, 0.42);
  --surface: #ffffff;
  --surface-muted: #fafafa;
  --surface-subtle: #f7f7f7;
  --border: #e9e9e9;
  --border-dashed: #d9d9d9;
  --blue: #0976fe;
  --card-blue: #3474ff;
  --stack-bg: #ebf2ff;
  --stack-ink: #0643d3;
  --ring: #efefef;
  --ios: cubic-bezier(0.32, 0.72, 0, 1);
  --phone-w: 393px;
  --phone-design-h: 566.258;
  --island-top: 33.8;
  --island-h: 29.581;
  --notch-gap: 16;
  --phone-crop-h: 371px;
  --headline-size: 72px;
  --headline-tracking: -3.104px;
  --intro-cloud-ms: 700ms;
  --stroke-outer: #d9d9d9;
  --intro-draw-ms: 1800ms;
  --intro-cards-at: 0.5;
  --intro-card-ms: 400ms;
  --sheet-bg: #ffffff;
  --sheet-shadow: 0 -18px 48px rgba(0, 0, 0, 0.12);
  --backdrop: rgba(0, 0, 0, 0.58);
  --label-bg: rgba(255, 255, 255, 0.45);
  --label-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  --label-ink: rgba(0, 0, 0, 0.62);
  --focus-ring: rgba(9, 118, 254, 0.45);
  --handle-bg: rgba(0, 0, 0, 0.22);
  --chip-bg: #f7f7f7;
  --chip-ink: rgba(0, 0, 0, 0.55);
  --mount-bg: #fafafa;
  --placeholder-bg: #fafafa;
  --media-shadow:
    0 14px 5px rgba(0, 0, 0, 0.01),
    0 8px 5px rgba(0, 0, 0, 0.05),
    0 3px 3px rgba(0, 0, 0, 0.09),
    0 1px 2px rgba(0, 0, 0, 0.1);
  --cloud-filter: none;
  color-scheme: light;
}

html[data-theme='dark'] {
  --bg: #0c0c0f;
  --ink: #f4f4f6;
  --ink-muted: rgba(255, 255, 255, 0.78);
  --ink-subtle: rgba(255, 255, 255, 0.58);
  --ink-faint: rgba(255, 255, 255, 0.42);
  --surface: #16161c;
  --surface-muted: #1a1a22;
  --surface-subtle: #1e1e28;
  --border: rgba(255, 255, 255, 0.1);
  --border-dashed: rgba(255, 255, 255, 0.18);
  --blue: #3d94ff;
  --card-blue: #2f5fd4;
  --stack-bg: #1a2438;
  --stack-ink: #7eb4ff;
  --ring: #2e2e38;
  --stroke-outer: #3a3a46;
  --sheet-bg: #16161c;
  --sheet-shadow: 0 -18px 56px rgba(0, 0, 0, 0.55);
  --backdrop: rgba(0, 0, 0, 0.74);
  --label-bg: rgba(12, 12, 16, 0.78);
  --label-shadow: 0 4px 18px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --label-ink: rgba(255, 255, 255, 0.9);
  --focus-ring: rgba(61, 148, 255, 0.55);
  --handle-bg: rgba(255, 255, 255, 0.24);
  --chip-bg: #22222c;
  --chip-ink: rgba(255, 255, 255, 0.68);
  --mount-bg: #1a1a22;
  --placeholder-bg: #141418;
  --media-shadow: 0 16px 40px rgba(0, 0, 0, 0.42);
  --cloud-filter: brightness(0.55) saturate(0.82);
  color-scheme: dark;
}

html,
body {
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.35s var(--ios), color 0.35s var(--ios);
}

img {
  display: block;
  max-width: none;
}

.canvas {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 48px 24px 64px;
}

.composition {
  position: relative;
  width: min(961px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ── Decorative blobs flanking the phone — Figma 1043:845 ── */
.blob {
  position: absolute;
  z-index: 3;
  width: clamp(68px, 9vw, 114px);
  height: auto;
  pointer-events: none;
  /* Cursor-reaction state, written by JS (smoothly eased). */
  --rx: 0px;   /* lean x */
  --ry: 0px;   /* lean y */
  --rs: 1;     /* shrink/scale */
  --exL: 0px; --eyL: 0px;  /* left eye look offset */
  --exR: 0px; --eyR: 0px;  /* right eye look offset */
  --syL: 1;  --syR: 1;     /* eye openness (squint<1, widen>1) */
  opacity: 0;
  transform: translateY(12px) scale(0.94);
  transition: opacity 0.7s var(--ios), transform 0.7s var(--ios);
}

.blob--blue {
  left: -80px;
  top: -20px;
  width: 128px;
  --blink-sy: 0.08;
}

.blob--pink {
  right: clamp(-44px, -1.6vw, 0px);
  top: clamp(22px, 5.4vw, 76px);
  --blink-sy: 0.08;
}

.composition.stage-clouds .blob,
.composition.is-ready .blob {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Cursor-reaction layer (JS): lean away + recoil-shrink, eased like a spring. */
.blob__react {
  transform: translate(var(--rx), var(--ry)) scale(var(--rs));
  transition: transform 0.14s cubic-bezier(0.33, 1.56, 0.64, 1);
  will-change: transform;
}

/* Inner SVG carries the "alive" idle motion (separate from reveal + reaction). */
.blob__svg {
  display: block;
  width: 100%;
  height: auto;
  transform-origin: center bottom;
  --idle-hop14: 2%;
  --idle-hop34: -15%;
  --idle-hop66: -6%;
  --idle-sx14: 1.08; --idle-sy14: 0.9;
  --idle-sx34: 0.93; --idle-sy34: 1.08;
  --idle-sx52: 1.07; --idle-sy52: 0.93;
  --idle-sx66: 0.98; --idle-sy66: 1.03;
  --idle-sx80: 1.03; --idle-sy80: 0.98;
  --idle-rot14: -1.5deg;
  --idle-rot34: 1.5deg;
  --idle-rot66: 0.6deg;
  --idle-rot80: -0.4deg;
  animation: blobIdle 2.9s ease-in-out infinite;
  will-change: transform;
}

.blob--pink .blob__svg {
  animation-duration: 3.4s;
  animation-delay: -1.2s;
}

.blob__eye {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 0.01s linear;
}
.blob__eye:nth-child(1) { transform: translate(var(--exL), var(--eyL)) scaleY(var(--syL)); }
.blob__eye:nth-child(2) { transform: translate(var(--exR), var(--eyR)) scaleY(var(--syR)); }

/* Quick blink, JS-toggled (keeps the look offset, flattens vertically). */
.blob.is-blinking .blob__eye:nth-child(1) {
  transform: translate(var(--exL), var(--eyL)) scaleY(var(--blink-sy, 0.08)) !important;
  transition: transform 0.09s ease-in !important;
}
.blob.is-blinking .blob__eye:nth-child(2) {
  transform: translate(var(--exR), var(--eyR)) scaleY(var(--blink-sy, 0.08)) !important;
  transition: transform 0.09s ease-in !important;
}

@keyframes blobIdle {
  0%   { transform: translateY(0) scale(1, 1) rotate(0deg); }
  14%  { transform: translateY(var(--idle-hop14)) scale(var(--idle-sx14), var(--idle-sy14)) rotate(var(--idle-rot14)); }
  34%  { transform: translateY(var(--idle-hop34)) scale(var(--idle-sx34), var(--idle-sy34)) rotate(var(--idle-rot34)); }
  52%  { transform: translateY(0) scale(var(--idle-sx52), var(--idle-sy52)) rotate(0deg); }
  66%  { transform: translateY(var(--idle-hop66)) scale(var(--idle-sx66), var(--idle-sy66)) rotate(var(--idle-rot66)); }
  80%  { transform: translateY(0) scale(var(--idle-sx80), var(--idle-sy80)) rotate(var(--idle-rot80)); }
  100% { transform: translateY(0) scale(1, 1) rotate(0deg); }
}

@media (max-width: 720px) {
  .blob { width: clamp(50px, 13vw, 78px); }
  .blob--blue { left: 0; top: 0; }
  .blob--pink { right: 0; top: 12px; }
}

/* ── Phone mockup — Figma 1037:720 ── */
.phone {
  position: relative;
  width: min(var(--phone-w), calc(100vw - 48px));
  height: calc(min(var(--phone-w), calc(100vw - 48px)) * (371 / 393));
  max-height: var(--phone-crop-h);
  overflow: hidden;
  flex-shrink: 0;
  z-index: 1;
  background: var(--bg);
}

.phone__device {
  position: relative;
  width: 100%;
  aspect-ratio: 393 / 566.258;
  min-width: 100%;
}

/* SVG strokes — outer dashed + inner rings */
.phone__strokes {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 4;
  overflow: visible;
}

.stroke-path {
  fill: none;
  transition: none;
}

.composition.stage-draw .stroke-path {
  stroke-dashoffset: 0 !important;
  transition: stroke-dashoffset var(--intro-draw-ms) var(--ios);
}

.composition.is-ready .stroke-path {
  stroke-dashoffset: 0 !important;
}

/* Dynamic Island — Figma 1037:763 */
.phone__island {
  position: absolute;
  top: calc(var(--island-top) / var(--phone-design-h) * 100%);
  left: 36.92%;
  width: 25.78%;
  height: calc(var(--island-h) / var(--phone-design-h) * 100%);
  border-radius: 31.553px;
  background: var(--stroke-outer);
  z-index: 5;
}

/* Card row — 16px below island */
.phone__content {
  position: absolute;
  top: calc((var(--island-top) + var(--island-h) + var(--notch-gap)) / var(--phone-design-h) * 100%);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: flex-start;
  gap: 13px;
  z-index: 3;
}

.mock-card {
  border-radius: 10px;
  height: 162px;
  flex-shrink: 0;
}

/* Bezier curve card — Figma 1037:729 (now an interactive easing editor) */
.mock-card--curve {
  width: 146px;
  padding: 0;
  background: var(--card-blue);
  border: none;
  overflow: hidden;
}

.curve-art {
  display: block;
  width: 146px;
  height: 162px;
  touch-action: none;
}

.curve-frame {
  fill: none;
  stroke: #81a9ff;
  stroke-width: 1.2;
  stroke-linejoin: miter;
  stroke-linecap: butt;
}

.curve-frame--dashed {
  stroke-dasharray: 4 4;
}

.curve-diag {
  fill: none;
  stroke: #81a9ff;
  stroke-width: 1.2;
}

.curve-handle-line {
  fill: none;
  stroke: rgba(255, 255, 255, 0.8);
  stroke-width: 1.4;
}

.curve-path {
  fill: none;
  stroke: #ffffff;
  stroke-width: 3;
  stroke-linecap: round;
}

.curve-anchor {
  fill: #ffffff;
}

.curve-ctrl {
  fill: #ffffff;
  cursor: grab;
  transition: transform 0.12s var(--ios);
  transform-box: fill-box;
  transform-origin: center;
}

.curve-ctrl:hover {
  transform: scale(1.15);
}

.curve-ctrl:active {
  cursor: grabbing;
  transform: scale(1.15);
}

/* Tool stack card — Figma 1037:740 */
.mock-card--stack {
  width: 148px;
  background: var(--stack-bg);
  padding: 12px;
  overflow: hidden;
}

.stack__title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 800;
  font-size: 16px;
  line-height: 1;
  color: var(--stack-ink);
  font-variation-settings: 'opsz' 14, 'wdth' 100;
}

.stack__list {
  list-style: none;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stack__list li {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 500;
  font-size: 12px;
  line-height: 1;
  color: var(--stack-ink);
  white-space: nowrap;
  font-variation-settings: 'opsz' 14, 'wdth' 100;
  will-change: opacity, transform;
}

.stack__check {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

/* ── Intro reveal: island + cards ── */
.intro-reveal {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity var(--intro-card-ms) var(--ios), transform var(--intro-card-ms) var(--ios);
}

/* Cards reveal during stroke draw — no dead pause after outline */
.composition.stage-draw .intro-reveal[data-reveal="0"] {
  opacity: 1;
  transform: translateY(0);
  transition-delay: calc(var(--intro-draw-ms) * var(--intro-cards-at));
}

.composition.stage-draw .intro-reveal[data-reveal="1"] {
  opacity: 1;
  transform: translateY(0);
  transition-delay: calc(var(--intro-draw-ms) * var(--intro-cards-at) + 100ms);
}

.composition.stage-draw .intro-reveal[data-reveal="2"] {
  opacity: 1;
  transform: translateY(0);
  transition-delay: calc(var(--intro-draw-ms) * var(--intro-cards-at) + 200ms);
}

.composition.stage-cards .intro-reveal[data-reveal="0"],
.composition.stage-cards .intro-reveal[data-reveal="1"],
.composition.stage-cards .intro-reveal[data-reveal="2"] {
  opacity: 1;
  transform: translateY(0);
}

.composition.is-ready .intro-reveal {
  opacity: 1;
  transform: translateY(0);
}

/* ── Clouds — Figma 1037:764 ── */
.clouds {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: min(780px, 100%);
  height: 193px;
  margin-top: -111px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--intro-cloud-ms) var(--ios), transform var(--intro-cloud-ms) var(--ios);
}

.composition.stage-clouds .clouds {
  opacity: 1;
  transform: translateY(0);
}

.composition.is-ready .clouds {
  opacity: 1;
  transform: translateY(0);
}

.clouds__left,
.clouds__right {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--intro-cloud-ms) var(--ios), opacity var(--intro-cloud-ms) var(--ios);
}

.composition:not(.stage-clouds):not(.is-ready) .clouds__left {
  transform: rotate(-11deg) translateX(-20px);
}

.composition:not(.stage-clouds):not(.is-ready) .clouds__right {
  transform: rotate(8.28deg) translateX(20px);
}

.clouds__left {
  position: relative;
  z-index: 2;
  width: 51.6%;
  transform: rotate(-11deg);
}

.clouds__right {
  position: relative;
  z-index: 1;
  width: 50%;
  margin-left: -2.5%;
  transform: rotate(8.28deg);
}

.composition.stage-clouds .clouds__left,
.composition.is-ready .clouds__left {
  transform: rotate(-11deg) translateX(0);
}

.composition.stage-clouds .clouds__right,
.composition.is-ready .clouds__right {
  transform: rotate(8.28deg) translateX(0);
}

.clouds__img {
  width: 100%;
  height: auto;
  filter: var(--cloud-filter);
  transition: filter 0.35s var(--ios);
}

/* ── Headline — Figma 1037:769 ── */
.headline {
  position: relative;
  z-index: 5;
  margin-top: -125px;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 800;
  font-size: clamp(40px, 5vw, var(--headline-size));
  line-height: 1;
  letter-spacing: var(--headline-tracking);
  text-align: center;
  white-space: nowrap;
  font-variation-settings: 'opsz' 14, 'wdth' 100;
}

.headline__line {
  display: block;
}

.headline__line--dark {
  color: var(--ink);
}

.headline__line--blue {
  color: var(--blue);
}

.headline__char {
  display: inline-block;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.35s var(--ios), transform 0.35s var(--ios);
}

.headline__char.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.composition.is-ready .headline__char {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 720px) {
  .clouds {
    margin-top: -72px;
    height: clamp(110px, 28vw, 160px);
  }

  .headline {
    margin-top: -20px;
    white-space: normal;
  }

  .mock-card--curve {
    width: 42%;
  }

  .mock-card--stack {
    width: 43%;
  }

  .stack__title {
    font-size: 14px;
  }

  .stack__list li {
    font-size: 10px;
  }
}

@media (max-width: 480px) {
  .phone__content {
    gap: 8px;
  }

  .mock-card {
    height: 140px;
  }

  .clouds {
    margin-top: -52px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .phone {
    transition: none;
  }

  .clouds,
  .clouds__left,
  .clouds__right,
  .intro-reveal,
  .headline__char,
  .stroke-path,
  .blob {
    transition: none !important;
  }

  .blob__svg {
    animation: none !important;
  }
  .blob__react,
  .blob__eye {
    transition: none !important;
  }
}

/* ════════════════════════════════════════════════
   Selected work — Figma 1041:810 (portfolio bento)
   ════════════════════════════════════════════════ */
#showcase {
  --wide-col-start: 1;
  --wide-col-span: 2;
  --wide-grid-row: 3;
  --wide-aspect-w: 2;
  --wide-aspect-h: 0.75;
  --wide-min-h: 0px;
  --slot-col: 3;
  --slot-row: 3;
  /* Slot mount ≈ 1 grid col wide × Sphere Bounce row height (at 1200px grid: ~363 × 284px) */
  --work-col-w: calc((min(var(--work-max-w), 100%) - var(--work-pad-x) * 2 - var(--work-gap) * 2) / 3);
  --work-wide-w: calc(var(--work-col-w) * var(--wide-col-span) + var(--work-gap) * (var(--wide-col-span) - 1));
  --work-wide-h: calc(var(--work-wide-w) * var(--wide-aspect-h) / var(--wide-aspect-w));
  --work-slot-w: var(--work-col-w);
  --work-slot-h: var(--work-wide-h);
  --work-max-w: 1200px;
  --work-pad-x: 24px;
  --work-pad-top: 100px;
  --work-pad-bottom: 0;
  --work-gap: 32px;
  --work-card-pad: 26px;
  --work-card-radius: 40px;
  --fill-hover-scale: 1.05;
  --phone-pad-top: 8%;
  --phone-frame-h: 82%;
  --phone-aspect-w: 338;
  --phone-aspect-h: 718;
  --phone-screen-pos-y: 0%;
  --phone-screen-hover-scale: 1.04;
  --icons-width: 88%;
  --icons-hover-scale: 1.06;
  --label-bottom: 18px;
  --fill-recharge-pos-x: 50%;
  --fill-recharge-pos-y: 63%;
  --fill-recharge-scale-w: 108%;
  --fill-recharge-scale-h: 108%;
  --fill-recharge-top: -7%;
  --fill-recharge-left: -4%;
  --fill-recharge-right: -4%;
  --fill-recharge-bottom: -1%;
  --fill-recharge-bleed: 1px;
  --fill-dragorb-pos-x: 50%;
  --fill-dragorb-pos-y: 50%;
  --fill-dragorb-scale-w: 100%;
  --fill-dragorb-scale-h: 100%;
  --fill-dragorb-top: -1px;
  --fill-dragorb-left: -1px;
  --fill-dragorb-right: -1px;
  --fill-dragorb-bottom: -1px;
  --fill-dragorb-bleed: 1px;
  --fill-scroller-pos-x: 50%;
  --fill-scroller-pos-y: 50%;
  --fill-scroller-scale-w: 100%;
  --fill-scroller-scale-h: 100%;
  --fill-scroller-top: -1px;
  --fill-scroller-left: -1px;
  --fill-scroller-right: -1px;
  --fill-scroller-bottom: -1px;
  --fill-scroller-bleed: 1px;
  --fill-calendar-pos-x: 50%;
  --fill-calendar-pos-y: 50%;
  --fill-calendar-scale-w: 100%;
  --fill-calendar-scale-h: 100%;
  --fill-calendar-top: -1px;
  --fill-calendar-left: -1px;
  --fill-calendar-right: -1px;
  --fill-calendar-bottom: -1px;
  --fill-calendar-bleed: 1px;
}

.work {
  max-width: var(--work-max-w);
  margin: 0 auto;
  padding: var(--work-pad-top) var(--work-pad-x) var(--work-pad-bottom);
}

.work__grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--work-gap);
  align-items: stretch;
}

.work-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  min-height: 0;
  padding: var(--work-card-pad);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--work-card-radius);
  overflow: hidden;
  opacity: 0;
  transform: translateY(22px) scale(0.98);
  filter: blur(7px);
  transition:
    opacity 1s cubic-bezier(0.16, 1, 0.3, 1),
    transform 1.1s cubic-bezier(0.16, 1, 0.3, 1),
    filter 0.9s cubic-bezier(0.16, 1, 0.3, 1),
    background-color 0.35s var(--ios),
    border-color 0.35s var(--ios);
  will-change: opacity, transform, filter;
}

.work-card.is-in {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
}

.work-card--tall {
  grid-column: 1;
  grid-row: 1 / span 2;
  aspect-ratio: auto;
  padding: 0;
}

.work-card--fill {
  padding: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  align-self: stretch;
  aspect-ratio: 1 / 1;
  /* Safari: no filter/transform on any ancestor of <video> — opacity reveal only. */
  filter: none !important;
  transform: none !important;
  will-change: opacity;
  transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.work-card--fill.is-in {
  transform: none !important;
  filter: none !important;
}

.work-card__fill-stage {
  flex: 1 1 auto;
  position: relative;
  width: 100%;
  min-height: 0;
  overflow: hidden;
  background: var(--surface);
  transform-origin: center center;
  transition: transform 0.6s var(--ios);
}

.work-card--fill:hover .work-card__fill-stage {
  transform: scale(var(--fill-hover-scale));
}

.work-card__fill-video {
  position: absolute;
  max-width: none;
  object-fit: cover;
  pointer-events: none;
  vertical-align: top;
}

.work-card--recharge .work-card__fill-video {
  object-position: var(--fill-recharge-pos-x) var(--fill-recharge-pos-y);
  top: var(--fill-recharge-top);
  right: var(--fill-recharge-right);
  bottom: var(--fill-recharge-bottom);
  left: var(--fill-recharge-left);
  width: calc(var(--fill-recharge-scale-w) + var(--fill-recharge-bleed) * 2);
  height: calc(var(--fill-recharge-scale-h) + var(--fill-recharge-bleed) * 2);
}

.work-card--dragorb .work-card__fill-video {
  object-position: var(--fill-dragorb-pos-x) var(--fill-dragorb-pos-y);
  top: var(--fill-dragorb-top);
  right: var(--fill-dragorb-right);
  bottom: var(--fill-dragorb-bottom);
  left: var(--fill-dragorb-left);
  width: calc(var(--fill-dragorb-scale-w) + var(--fill-dragorb-bleed) * 2);
  height: calc(var(--fill-dragorb-scale-h) + var(--fill-dragorb-bleed) * 2);
}

.work-card--scroller .work-card__fill-video {
  object-position: var(--fill-scroller-pos-x) var(--fill-scroller-pos-y);
  top: var(--fill-scroller-top);
  right: var(--fill-scroller-right);
  bottom: var(--fill-scroller-bottom);
  left: var(--fill-scroller-left);
  width: calc(var(--fill-scroller-scale-w) + var(--fill-scroller-bleed) * 2);
  height: calc(var(--fill-scroller-scale-h) + var(--fill-scroller-bleed) * 2);
}

.work-card--calendar .work-card__fill-video {
  object-position: var(--fill-calendar-pos-x) var(--fill-calendar-pos-y);
  top: var(--fill-calendar-top);
  right: var(--fill-calendar-right);
  bottom: var(--fill-calendar-bottom);
  left: var(--fill-calendar-left);
  width: calc(var(--fill-calendar-scale-w) + var(--fill-calendar-bleed) * 2);
  height: calc(var(--fill-calendar-scale-h) + var(--fill-calendar-bleed) * 2);
}

/* Row 3 wide slot — spans Scroller + Calendar columns */
.work-card--wide {
  grid-column: var(--wide-col-start) / span var(--wide-col-span);
  grid-row: var(--wide-grid-row);
  aspect-ratio: var(--wide-aspect-w) / var(--wide-aspect-h);
  min-height: var(--wide-min-h);
}

/* Col 3, row 3 — Calendar width, Sphere Bounce height */
.work-card--slot {
  grid-column: var(--slot-col);
  grid-row: var(--slot-row);
  aspect-ratio: auto;
  align-self: stretch;
  min-width: 0;
  min-height: 0;
}

.work-card--slot .work-card__fill-stage {
  min-height: 0;
}

.work-card--slot .work-card__voice-mount {
  min-height: 0;
}

.work-card--slot .work-card__fill-stage--empty {
  margin: 0;
  border: none;
  border-radius: 0;
  background: transparent;
}

.work-card__interaction-mount {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  height: 100%;
}

.work-card--slot.work-card--placeholder .work-card__interaction-mount {
  inset: var(--work-card-pad);
  border: 1.4px dashed var(--border-dashed);
  border-radius: calc(var(--work-card-radius) - 12px);
  background: var(--placeholder-bg);
}

.work-card__slot-size {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-faint);
  letter-spacing: 0.02em;
  user-select: none;
  pointer-events: none;
}

.work-card--placeholder {
  cursor: default;
}

.work-card--placeholder:hover .work-card__fill-stage {
  transform: none;
}

.work-card__fill-stage--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: var(--work-card-pad);
  border: 1.4px dashed var(--border-dashed);
  border-radius: calc(var(--work-card-radius) - 12px);
  background: var(--placeholder-bg);
}

.work-card__placeholder-text {
  font-family: 'Bricolage Grotesque', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  font-variation-settings: 'opsz' 14, 'wdth' 100;
  color: var(--ink-faint);
  letter-spacing: -0.01em;
  user-select: none;
  pointer-events: none;
}

.work-card--fill .work-label {
  z-index: 2;
}

/* ── Phone (Clocks for iOS) — video replaces device chrome ── */
.work-phone {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding-top: var(--phone-pad-top);
}

.work-phone__video {
  display: block;
  height: var(--phone-frame-h);
  width: auto;
  max-width: 100%;
  aspect-ratio: var(--phone-aspect-w) / var(--phone-aspect-h);
  object-fit: cover;
  object-position: center var(--phone-screen-pos-y);
  border-radius: 0;
  transition: transform 0.6s var(--ios);
}

.work-card:hover .work-phone__video {
  transform: scale(var(--phone-screen-hover-scale));
}

/* ── Media cards ── */
.work-media {
  position: relative;
  transition: transform 0.5s var(--ios);
}

.work-media img,
.work-media__video {
  display: block;
  transition: transform 0.6s var(--ios);
}

/* Code Layers / Figma Make — framed clip with layered shadow */
.work-media--clip {
  width: 100%;
  aspect-ratio: 388 / 218;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: var(--media-shadow);
}

.work-media--clip img,
.work-media--clip .work-media__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Recent Work carousel — full-bleed cover */
.work-media--full {
  position: absolute;
  inset: 0;
}

.work-media--full img,
.work-media--full .work-media__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Tool Icons / Photo Gradient — floating transparent art */
.work-media--icons {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.work-media--icons img {
  width: var(--icons-width);
  height: auto;
  object-fit: contain;
}

/* Hover liveliness */
.work-card:hover .work-media--clip img,
.work-card:hover .work-media--clip .work-media__video { transform: scale(1.12); }
.work-card:hover .work-media--full img,
.work-card:hover .work-media--full .work-media__video { transform: scale(1.05); }
.work-card:hover .work-media--icons img { transform: scale(var(--icons-hover-scale)); }

/* ── Glassy hover label ── */
.work-label {
  position: absolute;
  bottom: var(--label-bottom);
  left: 50%;
  padding: 13px 28px;
  border-radius: 100px;
  background: var(--label-bg);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: var(--label-shadow);
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 500;
  font-size: 16px;
  letter-spacing: 0.16px;
  color: var(--label-ink);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateX(-50%) translateY(8px);
  transition: opacity 0.35s var(--ios), transform 0.35s var(--ios);
}

.work-card:hover .work-label,
.work-card:focus-within .work-label {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.work-card--interactive {
  cursor: pointer;
}

.work-card--interactive:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
}

/* ── Interaction bottom sheet ── */
.interaction-sheet {
  position: fixed;
  inset: 0;
  z-index: 10000;
  pointer-events: none;
}

.interaction-sheet.is-open {
  pointer-events: auto;
}

.interaction-sheet__backdrop {
  position: absolute;
  inset: 0;
  background: var(--backdrop);
  opacity: 0;
  cursor: none;
  transition: opacity 0.42s var(--ios);
}

.interaction-sheet.is-open .interaction-sheet__backdrop {
  opacity: 1;
}

.interaction-sheet__panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: var(--sheet-height, 78vh);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  padding: 8px 0 calc(20px + env(safe-area-inset-bottom, 0px));
  border-radius: 28px 28px 0 0;
  background: var(--sheet-bg);
  box-shadow: var(--sheet-shadow);
  transform: translateY(calc(105% + var(--sheet-drag-y, 0px)));
  transition: transform 0.52s var(--ios), height 0.38s var(--ios);
  will-change: transform, height;
  cursor: auto;
}

.interaction-sheet.is-open .interaction-sheet__panel {
  transform: translateY(var(--sheet-drag-y, 0px));
}

.interaction-sheet__panel.is-dragging {
  transition: none;
}

body.is-sheet-open.is-sheet-cross-cursor,
body.is-sheet-open.is-sheet-cross-cursor * {
  cursor: none !important;
}

.sheet-close-cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10001;
  pointer-events: none;
  visibility: hidden;
}

.sheet-close-cursor.is-active {
  visibility: visible;
}

.sheet-close-cursor__icon {
  position: absolute;
  width: 31px;
  height: 31px;
  transform: translate3d(-50%, -50%, 0) scale(0);
  opacity: 0;
  backface-visibility: hidden;
}

.sheet-close-cursor__icon.is-spring-in {
  animation: sheet-cursor-spring-in 0.46s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  will-change: transform, opacity;
}

.sheet-close-cursor__icon.is-spring-out {
  animation: sheet-cursor-spring-out 0.32s cubic-bezier(0.32, 0.72, 0, 1) forwards;
  will-change: transform, opacity;
}

.sheet-close-cursor__icon.is-shown {
  transform: translate3d(-50%, -50%, 0) scale(1);
  opacity: 1;
}

.sheet-close-cursor__icon img {
  display: block;
  width: 100%;
  height: 100%;
}

@keyframes sheet-cursor-spring-in {
  0% {
    transform: translate3d(-50%, -50%, 0) scale(0);
    opacity: 0;
  }
  55% {
    transform: translate3d(-50%, -50%, 0) scale(1.14);
    opacity: 1;
  }
  78% {
    transform: translate3d(-50%, -50%, 0) scale(0.96);
    opacity: 1;
  }
  100% {
    transform: translate3d(-50%, -50%, 0) scale(1);
    opacity: 1;
  }
}

@keyframes sheet-cursor-spring-out {
  0% {
    transform: translate3d(-50%, -50%, 0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate3d(-50%, -50%, 0) scale(0);
    opacity: 0;
  }
}

.interaction-sheet__handle {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 36px;
  margin: 2px 0 8px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: grab;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}

.interaction-sheet__handle::before {
  content: '';
  display: block;
  width: 44px;
  height: 5px;
  border-radius: 100px;
  background: var(--handle-bg);
}

.interaction-sheet__handle:active,
.interaction-sheet__panel.is-dragging .interaction-sheet__handle {
  cursor: grabbing;
}

.interaction-sheet__content {
  --sheet-inset-x: clamp(24px, 8vw, 100px);
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0 var(--sheet-inset-x);
}

.interaction-sheet__title {
  flex-shrink: 0;
  margin: 0 0 12px;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 500;
  font-size: clamp(20px, 2.4vw, 24px);
  letter-spacing: 0.02em;
  color: var(--ink-muted);
  text-align: left;
}

.interaction-sheet__chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
  padding: 0;
}

.interaction-sheet__chip {
  padding: 6px 12px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: var(--chip-bg);
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--chip-ink);
  white-space: nowrap;
}

.interaction-sheet__stage {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.interaction-sheet__mount {
  width: 100%;
  flex: 1 1 auto;
  min-height: 280px;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  border-radius: 24px;
  border: 1px solid var(--border);
  background: var(--mount-bg);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.interaction-demo {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.interaction-demo__placeholder {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink-faint);
  text-align: center;
}

body.is-sheet-open {
  overflow: hidden;
}

/* ── Responsive ── */
@media (max-width: 860px) {
  #showcase {
    --work-col-w: calc((min(var(--work-max-w), 100%) - var(--work-pad-x) * 2 - var(--work-gap)) / 2);
    --work-wide-w: calc(min(var(--work-max-w), 100%) - var(--work-pad-x) * 2);
    --work-wide-h: calc(var(--work-wide-w) * var(--wide-aspect-h) / var(--wide-aspect-w));
    --work-slot-w: var(--work-wide-w);
    --work-slot-h: var(--work-wide-h);
  }

  .work__grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .work-card--tall {
    grid-row: 1 / span 2;
  }
  .work-card--wide {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  .work-card--slot {
    grid-column: 1 / -1;
    grid-row: auto;
    align-self: auto;
    aspect-ratio: 363 / 284;
    min-height: 0;
    width: 100%;
  }
}

@media (max-width: 560px) {
  #showcase {
    --work-col-w: calc(min(var(--work-max-w), 100%) - var(--work-pad-x) * 2);
    --work-wide-w: var(--work-col-w);
    --work-wide-h: calc(var(--work-wide-w) * var(--wide-aspect-h) / var(--wide-aspect-w));
    --work-slot-w: var(--work-col-w);
    --work-slot-h: calc(var(--work-col-w) * var(--wide-aspect-h) / var(--wide-aspect-w));
  }

  .work__grid {
    grid-template-columns: 1fr;
  }
  .work-card--tall {
    grid-column: auto;
    grid-row: auto;
    aspect-ratio: 360 / 640;
  }

  .work-card--wide {
    grid-column: 1 / -1;
  }

  .work-card--slot {
    aspect-ratio: 363 / 284;
  }
}

@media (prefers-reduced-motion: reduce) {
  .work-card {
    transition: none !important;
    opacity: 1;
    transform: none;
  }
  .work-media img,
  .work-media__video,
  .work-card__fill-video,
  .work-card__fill-stage,
  .work-phone__video {
    transition: none !important;
  }
  .interaction-sheet__backdrop,
  .interaction-sheet__panel {
    transition: none !important;
  }
  .sheet-close-cursor__icon.is-spring-in,
  .sheet-close-cursor__icon.is-spring-out {
    animation: none !important;
  }
  .sheet-close-cursor__icon.is-shown,
  .sheet-close-cursor__icon.is-spring-in {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

/* ── Sheet demo stubs ── */
