/* ============================================================
   mileo / work page
   Storefront, exploded: a pinned scroll cutaway on capable desktop
   viewports and a complete static system plate everywhere else.
   ============================================================ */

.work-lead {
  max-width: 62ch;
  color: var(--ink-soft);
  font-size: clamp(1.02rem, 1.5vw, 1.16rem);
  line-height: 1.55;
  text-wrap: pretty;
}

/* ---------- selected-work index ---------- */

.work-index {
  margin: 0 0 clamp(62px, 9vw, 104px);
  padding-block: clamp(22px, 3.5vw, 34px);
  border-block: 1px solid var(--line);
}

.work-index-head {
  display: grid;
  grid-template-columns: .7fr 1.3fr;
  gap: 18px clamp(24px, 5vw, 58px);
  align-items: start;
  margin-bottom: 22px;
}

.work-index-head p {
  margin: 0;
  color: var(--ink-soft);
  font-size: .94rem;
  line-height: 1.55;
  text-wrap: pretty;
}

.work-index-head .work-index-kicker {
  color: var(--ink);
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.work-index-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--line);
  border-radius: var(--radius-ui);
  background: var(--line);
  overflow: hidden;
}

.work-index-card {
  min-height: 218px;
  display: flex;
  flex-direction: column;
  padding: clamp(22px, 3.2vw, 32px);
  background: var(--paper);
  color: var(--ink);
}

.work-index-card > span {
  display: flex;
  gap: 10px;
  color: var(--ink-faint);
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.work-index-card > span b { font-weight: 400; }

.work-index-card > strong,
.work-index-card > .work-index-title {
  margin: auto 0 12px;
  font-family: var(--f-serif);
  font-size: clamp(1.55rem, 3vw, 2.2rem);
  font-weight: 560;
  line-height: 1.02;
  letter-spacing: -.015em;
}

.work-index-card > .work-index-title { font-weight: 400; }
.work-index-card > .work-index-title > strong { font-weight: 700; }

.work-index-card > small {
  max-width: 34ch;
  color: var(--ink-soft);
  font-size: .88rem;
  line-height: 1.48;
}

.case-opening {
  scroll-margin-top: 96px;
  padding: 0 0 clamp(26px, 4vw, 42px);
}

.case-opening-label,
.portfolio-case-label {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 18px;
  margin: 0 0 18px;
  color: var(--ink-faint);
  font-family: var(--f-mono);
  font-size: 10.5px;
  line-height: 1.4;
  letter-spacing: .075em;
  text-transform: uppercase;
}

.case-opening-label b,
.portfolio-case-label b { color: var(--ink); font-weight: 500; }

.case-opening h2 {
  max-width: 13ch;
  margin: 0 0 18px;
  font-family: var(--f-serif);
  font-size: clamp(2.2rem, 6vw, 4.2rem);
  font-weight: 560;
  line-height: .98;
  letter-spacing: -.025em;
  text-wrap: balance;
}

.case-opening > p:last-child {
  max-width: 62ch;
  margin: 0;
  color: var(--ink-soft);
  font-size: 1.05rem;
  line-height: 1.6;
}

@media (max-width: 640px) {
  .work-index-head { grid-template-columns: 1fr; gap: 7px; }
  .work-index-grid { grid-template-columns: 1fr; }
  .work-index-card { min-height: 170px; }
}

/* ---------- current mobile storefront journey ---------- */

.mobile-journey {
  margin: clamp(32px, 5vw, 54px) 0 clamp(42px, 6vw, 70px);
  padding-block: clamp(18px, 2.6vw, 26px);
  border-block: 1px solid var(--line);
}

.mobile-journey-head {
  display: grid;
  grid-template-columns: .75fr 1.25fr;
  gap: 18px 36px;
  align-items: start;
  margin-bottom: 22px;
}

.teardown-section .mobile-journey-kicker,
.mobile-journey figcaption {
  max-width: none;
  margin: 0;
  font-family: var(--f-mono);
  font-size: 11px;
  line-height: 1.55;
  letter-spacing: .045em;
}

.mobile-journey-kicker {
  color: var(--ink);
  text-transform: uppercase;
}

.mobile-journey figcaption { color: var(--ink-faint); }

.mobile-journey-track {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 260px));
  justify-content: space-between;
  gap: clamp(14px, 2.4vw, 26px);
}

.mobile-view {
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 10px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-ui);
  background: var(--paper-2);
  color: var(--ink);
  text-decoration: none;
  box-shadow: 10px 10px 0 rgba(26, 46, 34, .035);
  transition: border-color .25s ease, transform .3s var(--ease-out);
}

.mobile-view:hover,
.mobile-view:focus-visible {
  border-color: var(--ink-faint);
  transform: translateY(-3px);
}

.mobile-view-label,
.mobile-view-note {
  font-family: var(--f-mono);
  letter-spacing: .04em;
}

.mobile-view-label {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 2px 5px 0;
  font-size: 10px;
  text-transform: uppercase;
}

.mobile-view-label b { color: var(--ink-faint); font-weight: 400; }

.mobile-view-screen {
  display: block;
  overflow: hidden;
  aspect-ratio: 390 / 760;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-ui);
  background: #fff;
}

.mobile-view-screen img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mobile-view-note {
  padding: 1px 5px 5px;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.5;
}

@media (max-width: 760px) {
  .mobile-journey-head { grid-template-columns: 1fr; gap: 7px; }
  .mobile-journey-track {
    display: flex;
    justify-content: initial;
    gap: 14px;
    overflow-x: auto;
    padding: 2px 12vw 18px 1px;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
  }
  .mobile-view {
    flex: 0 0 min(76vw, 280px);
    scroll-snap-align: start;
  }
}

.teardown-sr {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* ---------- outer shell ---------- */

.work-teardown {
  --td-bg: #0b1c12;
  --td-panel: #12281b;
  --td-panel-2: #173121;
  --td-line: #6b7f71;
  --td-line-soft: rgba(244, 240, 230, 0.16);
  --td-text: #f4f0e6;
  --td-muted: #b9c4bb;
  --td-signal: #acd879;
  --td-event: #ef5b50;
  width: 100%;
  margin-top: clamp(28px, 4vw, 44px);
}

.teardown-intro {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 18px;
  margin-bottom: 14px;
}

.teardown-section .teardown-kicker,
.teardown-section .teardown-cue {
  max-width: none;
  margin: 0;
  font-family: var(--f-mono);
  font-size: 11.5px;
  letter-spacing: 0.045em;
}

.teardown-kicker {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink-faint);
}

.teardown-kicker > span {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--td-signal);
  box-shadow: 0 0 0 3px rgba(172, 216, 121, 0.16);
}

.teardown-cue {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-faint);
  text-transform: uppercase;
}

.teardown-cue i {
  position: relative;
  width: 28px;
  height: 1px;
  background: var(--ink-faint-line);
}

.teardown-cue i::after {
  content: "";
  position: absolute;
  right: 0;
  top: -3px;
  width: 6px;
  height: 6px;
  border-right: 1px solid var(--ink-faint);
  border-bottom: 1px solid var(--ink-faint);
  transform: rotate(-45deg);
}

.teardown-stage {
  position: relative;
  display: grid;
  grid-template-rows: auto auto auto;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--td-line);
  border-radius: var(--radius-ui);
  background: var(--td-bg);
  color: var(--td-text);
  box-shadow: 0 28px 70px -46px rgba(11, 28, 18, 0.82);
}

/* ---------- instrument chrome ---------- */

.teardown-topbar {
  min-height: 42px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 13px;
  padding: 0 14px;
  border-bottom: 1px solid var(--td-line);
  background: #102419;
  color: var(--td-muted);
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.teardown-dots {
  display: flex;
  gap: 5px;
}

.teardown-dots i,
.teardown-state > i {
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--td-line);
}

.teardown-dots i:first-child { background: var(--td-event); }
.teardown-dots i:nth-child(2) { background: #d3aa5a; }
.teardown-dots i:nth-child(3),
.teardown-state > i { background: var(--td-signal); }

.teardown-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--td-signal);
}

/* ---------- static scene: the fallback is the complete cutaway ---------- */

.teardown-scene {
  position: relative;
  isolation: isolate;
  min-width: 0;
  padding: 14px;
  background: var(--td-bg);
}

.teardown-grid {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(172, 216, 121, 0.065) 1px, transparent 1px),
    linear-gradient(90deg, rgba(172, 216, 121, 0.065) 1px, transparent 1px),
    radial-gradient(circle at 58% 48%, rgba(172, 216, 121, 0.08), transparent 34%);
  background-size: 32px 32px, 32px 32px, 100% 100%;
}

.registration,
.teardown-copy,
.teardown-wires,
.teardown-callouts { display: none; }

.teardown-rig {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

/* ---------- build planes ---------- */

.build-layer {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--td-line);
  border-radius: var(--radius-ui);
  background: var(--td-panel);
  color: var(--td-text);
  box-shadow: 0 18px 40px -28px rgba(0, 0, 0, 0.92);
}

.build-layer-head {
  min-height: 37px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--td-line);
  background: var(--td-panel);
  color: var(--td-muted);
  font-family: var(--f-mono);
  font-size: 9.5px;
  font-style: normal;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.build-layer-head strong {
  color: var(--td-text);
  font: inherit;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: none;
}

.build-layer-media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 2.05 / 1;
  background: var(--paper);
}

.build-layer-media > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 44%;
}

.build-layer--surface .build-layer-media > img {
  object-position: center;
  filter: saturate(0.9) contrast(1.02);
}

.build-layer--liquid .build-layer-media > img { object-position: center 8%; }
.build-layer--make .build-layer-media > img { object-position: center 46%; }
.build-layer--klaviyo .build-layer-media > img { object-position: center 38%; }

.teardown-section .build-layer-foot {
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 10px;
  margin: 0;
  border-top: 1px solid var(--td-line);
  background: var(--td-panel);
  color: var(--td-muted);
  font-family: var(--f-mono);
  font-size: 9px;
  line-height: 1.35;
  letter-spacing: 0.035em;
}

.build-layer-foot code {
  color: var(--td-signal);
  font: inherit;
  white-space: nowrap;
}

/* the visible storefront is rebuilt from these strips only while armed */
.surface-slices { display: none; }

.surface-stock {
  position: absolute;
  left: 4%;
  bottom: 7%;
  width: 74px;
  height: 44px;
  display: grid;
  grid-template-columns: 1fr 24px;
  align-items: center;
  padding: 6px 8px;
  border: 1px solid rgba(244, 240, 230, 0.62);
  border-radius: var(--radius-ui);
  background: rgba(11, 28, 18, 0.92);
  color: var(--td-text);
  font-family: var(--f-mono);
}

.surface-stock small {
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.surface-stock b {
  grid-area: 1 / 2;
  font-size: 17px;
  font-weight: 500;
  text-align: right;
}

[data-stock-new] { color: var(--td-signal); }

/* ---------- readout ---------- */

.teardown-readout {
  border-top: 1px solid var(--td-line);
  background: #102419;
  font-family: var(--f-mono);
}

.teardown-progress {
  height: 2px;
  overflow: hidden;
  background: var(--td-line-soft);
}

.teardown-progress i {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--td-signal);
  transform-origin: 0 50%;
}

.teardown-readout ol {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 0;
  margin: 0;
  list-style: none;
}

.teardown-readout li {
  min-width: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1px 8px;
  padding: 10px 12px;
  border-right: 1px solid var(--td-line-soft);
  border-bottom: 1px solid var(--td-line-soft);
  color: var(--td-muted);
  font-size: 9.5px;
  line-height: 1.25;
}

.teardown-readout li:nth-child(2n) { border-right: 0; }
.teardown-readout li span { grid-row: 1 / 3; color: var(--td-signal); }
.teardown-readout li b { color: var(--td-text); font-weight: 500; }
.teardown-readout li small { color: var(--td-muted); font: inherit; }

.teardown-section .teardown-result {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 12px;
  align-items: center;
  max-width: none;
  padding: 10px 12px;
  margin: 0;
  background: var(--td-signal);
  color: var(--td-bg);
  font-family: var(--f-mono);
  font-size: 9.5px;
  line-height: 1.25;
  letter-spacing: 0.04em;
}

.teardown-result span { font-weight: 500; }
.teardown-result strong {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.teardown-result small { grid-column: 1 / -1; font: inherit; }

/* ---------- desktop animated cutaway ---------- */

@media (min-width: 901px) {
  .work-teardown {
    position: relative;
    width: min(1240px, calc(100vw - 42px));
    margin-left: calc((100% - min(1240px, calc(100vw - 42px))) / 2);
  }

  .teardown-stage {
    grid-template-rows: 42px minmax(0, 1fr) auto;
  }

  .work-teardown.is-armed .teardown-stage {
    height: clamp(540px, calc(100svh - 96px), 820px);
  }

  .work-teardown.is-armed .teardown-scene {
    min-height: 0;
    padding: 0;
    overflow: hidden;
    perspective: 1600px;
    perspective-origin: 58% 50%;
  }

  .work-teardown.is-armed .teardown-rig {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: block;
    transform-style: preserve-3d;
    will-change: transform;
  }

  .work-teardown.is-armed .build-layer {
    position: absolute;
    top: 50%;
    left: 60%;
    width: min(64%, 790px);
    transform-origin: 50% 50%;
    backface-visibility: hidden;
    will-change: transform, opacity, filter;
  }

  .work-teardown.is-armed .surface-slices {
    position: absolute;
    inset: 0;
    display: block;
    overflow: visible;
    pointer-events: none;
  }

  .surface-slices i {
    position: absolute;
    left: 0;
    width: 100%;
    height: 20.08%;
    background-image: url("/images/lionhead-storefront.webp");
    background-repeat: no-repeat;
    background-size: 100% 500%;
    will-change: transform, opacity, filter;
  }

  .surface-slices i:nth-child(1) { top: 0; background-position: 0 0; }
  .surface-slices i:nth-child(2) { top: 20%; background-position: 0 25%; }
  .surface-slices i:nth-child(3) { top: 40%; background-position: 0 50%; }
  .surface-slices i:nth-child(4) { top: 60%; background-position: 0 75%; }
  .surface-slices i:nth-child(5) { top: 80%; background-position: 0 100%; }

  .work-teardown.is-armed .registration {
    position: absolute;
    z-index: 1;
    display: block;
    width: 22px;
    height: 22px;
    opacity: 0;
    color: var(--td-line);
  }

  .registration::before,
  .registration::after {
    content: "";
    position: absolute;
    background: currentColor;
  }
  .registration::before { width: 22px; height: 1px; }
  .registration::after { width: 1px; height: 22px; }
  .registration--tl { top: 20px; left: 20px; }
  .registration--tr { top: 20px; right: 20px; transform: rotate(90deg); }
  .registration--bl { bottom: 20px; left: 20px; transform: rotate(-90deg); }
  .registration--br { right: 20px; bottom: 20px; transform: rotate(180deg); }

  .work-teardown.is-armed .teardown-copy {
    position: absolute;
    z-index: 7;
    top: 28%;
    left: 3%;
    width: min(15.5%, 180px);
    display: block;
    pointer-events: none;
  }

  .work-teardown.is-armed .teardown-copy::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: -22px -38px -26px -14px;
    background: linear-gradient(90deg, rgba(11, 28, 18, 0.98) 0 68%, rgba(11, 28, 18, 0) 100%);
    pointer-events: none;
  }

  .teardown-copy p {
    position: absolute;
    inset: 0 auto auto 0;
    display: grid;
    gap: 8px;
    max-width: 14ch;
    margin: 0;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 280ms cubic-bezier(.2, 0, 0, 1),
                transform 360ms cubic-bezier(.2, 0, 0, 1);
  }

  .teardown-copy p.is-active { opacity: 1; transform: none; }

  .teardown-copy span {
    color: var(--td-signal);
    font-family: var(--f-mono);
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .teardown-copy strong {
    color: var(--td-text);
    font-family: var(--f-serif);
    font-size: clamp(1.2rem, 1.85vw, 1.78rem);
    font-weight: 540;
    line-height: 1.02;
    text-wrap: balance;
  }

  .work-teardown.is-armed .teardown-wires {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
  }

  .teardown-wires [data-teardown-wire] {
    fill: none;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
  }

  .teardown-route--render [data-teardown-wire] {
    stroke: var(--td-muted);
    stroke-width: 1.25;
  }
  .teardown-route--inventory [data-teardown-wire] {
    stroke: var(--td-event);
    filter: drop-shadow(0 0 3px rgba(239, 91, 80, 0.38));
  }
  .teardown-route--success [data-teardown-wire] {
    stroke: var(--td-signal);
    filter: drop-shadow(0 0 4px rgba(172, 216, 121, 0.4));
  }
  .teardown-route--lifecycle [data-teardown-wire] {
    stroke: #d3aa5a;
    stroke-width: 1.55;
    filter: drop-shadow(0 0 3px rgba(211, 170, 90, 0.34));
  }

  .teardown-route [data-route-label] {
    fill: var(--td-muted);
    background: var(--td-bg);
    font-family: var(--f-mono);
    font-size: 8px;
    letter-spacing: 0.055em;
    text-transform: uppercase;
  }

  .teardown-route--inventory [data-route-label] { fill: var(--td-event); }
  .teardown-route--success [data-route-label] { fill: var(--td-signal); }
  .teardown-route--lifecycle [data-route-label] { fill: #d3aa5a; }

  .work-teardown.is-armed .teardown-callouts {
    position: absolute;
    inset: 0;
    z-index: 7;
    display: block;
    pointer-events: none;
  }

  .teardown-callout {
    position: absolute;
    padding: 4px 7px;
    border: 1px solid var(--td-line);
    border-radius: var(--radius-ui);
    background: rgba(11, 28, 18, 0.92);
    color: var(--td-muted);
    font-family: var(--f-mono);
    font-size: 8.5px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
    will-change: transform, opacity;
  }

  .teardown-callout--surface {
    top: 3%;
    left: 24%;
    border-color: rgba(239, 91, 80, 0.8);
    color: var(--td-text);
  }
  .teardown-callout--liquid { top: 3%; right: 4.5%; }
  .teardown-callout--make {
    bottom: 3%;
    left: 24%;
    border-color: rgba(172, 216, 121, 0.85);
    color: var(--td-signal);
  }
  .teardown-callout--klaviyo {
    right: 4.5%;
    bottom: 3%;
    border-color: rgba(211, 170, 90, 0.8);
    color: #e8c77e;
  }

  .teardown-readout ol { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .teardown-readout li { border-bottom: 0; }
  .teardown-readout li:nth-child(2n) { border-right: 1px solid var(--td-line-soft); }
  .teardown-readout li:last-child { border-right: 0; }

  .work-teardown.is-armed .teardown-readout li {
    opacity: 0.46;
    transition: opacity 220ms ease, background 220ms ease;
  }

  .work-teardown.is-armed .teardown-readout li.is-active {
    opacity: 1;
    background: rgba(172, 216, 121, 0.08);
  }

  .teardown-section .teardown-result {
    grid-template-columns: auto 1fr auto;
  }

  .teardown-result small { grid-column: auto; text-align: right; }
}

/* ---------- tablet / mobile static cutaway ---------- */

@media (min-width: 560px) and (max-width: 900px) {
  .teardown-rig { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .teardown-cue { display: none; }
  .teardown-progress i { transform: none !important; }
}

@media (max-width: 520px) {
  .teardown-topbar {
    grid-template-columns: auto 1fr;
    font-size: 10px;
  }
  .teardown-state { display: none; }
  .build-layer-head,
  .teardown-section .build-layer-foot {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
    font-size: 10.5px;
  }
  .build-layer-foot code { white-space: normal; }
  .teardown-readout li,
  .teardown-section .teardown-result { font-size: 10.5px; }
  .teardown-section .teardown-result { grid-template-columns: auto 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .teardown-cue { display: none; }
  .teardown-rig,
  .build-layer,
  .surface-slices i,
  .teardown-callout { will-change: auto !important; }
}

@media (forced-colors: active) {
  .teardown-stage,
  .teardown-topbar,
  .build-layer,
  .teardown-readout,
  .teardown-result,
  .teardown-callout {
    border-color: CanvasText;
    background: Canvas;
    color: CanvasText;
    forced-color-adjust: auto;
  }
  .teardown-wires [data-teardown-wire] { stroke: CanvasText; stroke-width: 2; }
  .teardown-wires [data-route-label] { fill: CanvasText; }
}

/* ---------- what was built ---------- */

.built-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(18px, 2.6vw, 30px) clamp(24px, 3.4vw, 44px);
  margin-top: 6px;
}

.built {
  border-top: 1px solid var(--ink);
  padding-top: 16px;
}

.built .num { display: block; margin-bottom: 10px; }

.built h3 {
  margin: 0 0 6px;
  font-family: var(--f-sans);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.built p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.55;
  text-wrap: pretty;
}

/* ---------- additional project showcases ---------- */

.portfolio-case {
  scroll-margin-top: 82px;
  padding: clamp(70px, 10vw, 116px) 0;
  border-top: 1px solid var(--ink);
}

.portfolio-case-head > h2 {
  max-width: 15ch;
  margin: 0 0 clamp(18px, 3vw, 28px);
  font-family: var(--f-serif);
  font-size: clamp(2.35rem, 6.5vw, 4.7rem);
  font-weight: 560;
  line-height: .96;
  letter-spacing: -.03em;
  text-wrap: balance;
}

.portfolio-case-head > p:not(.portfolio-case-label):not(.partnership-note) {
  max-width: 66ch;
  margin: 0;
  color: var(--ink-soft);
  font-size: clamp(1.02rem, 1.6vw, 1.16rem);
  line-height: 1.62;
  text-wrap: pretty;
}

.portfolio-scope,
.capability-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 0;
  margin: 28px 0 0;
  list-style: none;
}

.portfolio-scope li,
.capability-row li {
  padding: 7px 9px;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-family: var(--f-mono);
  font-size: 9.5px;
  line-height: 1.2;
  letter-spacing: .055em;
  text-transform: uppercase;
}

.wm-stage,
.sody-stage,
.email-stage {
  position: relative;
  isolation: isolate;
  margin: clamp(38px, 6vw, 62px) 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-ui);
}

.wm-stage {
  min-height: 520px;
  padding: clamp(22px, 4vw, 42px) clamp(22px, 4vw, 42px) 56px;
  background:
    linear-gradient(rgba(0, 102, 174, .06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 102, 174, .06) 1px, transparent 1px),
    #e8f4fc;
  background-size: 30px 30px, 30px 30px, auto;
}

.browser-frame {
  overflow: hidden;
  border: 1px solid #18354a;
  border-radius: var(--radius-ui);
  background: #fff;
  box-shadow: 0 28px 60px -38px rgba(1, 30, 49, .72);
}

.browser-frame-bar,
.email-frame-bar {
  min-height: 35px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  border-bottom: 1px solid rgba(24, 53, 74, .3);
  background: #f6f9fb;
  color: #445c6c;
  font-family: var(--f-mono);
  font-size: 9.5px;
  letter-spacing: .04em;
}

.browser-frame-bar > span { display: flex; gap: 5px; }
.browser-frame-bar i {
  width: 7px;
  height: 7px;
  display: block;
  border-radius: 50%;
  background: #c5d3dc;
}
.browser-frame-bar i:first-child { background: #f17068; }
.browser-frame-bar i:nth-child(2) { background: #e1b859; }
.browser-frame-bar i:last-child { background: #5db67b; }
.browser-frame-bar b,
.email-frame-bar b { overflow: hidden; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }

.browser-frame > img {
  display: block;
  width: 100%;
  height: auto;
}

.phone-frame {
  overflow: hidden;
  border: 7px solid #0b1c2a;
  border-radius: 28px;
  background: #0b1c2a;
  box-shadow: 0 24px 48px -24px rgba(1, 30, 49, .8);
}

.phone-frame--wm {
  position: absolute;
  z-index: 2;
  right: clamp(28px, 6vw, 60px);
  bottom: 32px;
  width: min(24%, 180px);
}

.phone-frame-speaker {
  position: absolute;
  z-index: 3;
  top: 4px;
  left: 50%;
  width: 34%;
  height: 9px;
  border-radius: 0 0 8px 8px;
  background: #0b1c2a;
  transform: translateX(-50%);
}

.phone-frame img { display: block; width: 100%; height: auto; border-radius: 19px; }

.wm-stage figcaption,
.sody-stage figcaption,
.email-stage figcaption {
  position: absolute;
  z-index: 4;
  left: clamp(22px, 4vw, 42px);
  bottom: 18px;
  max-width: calc(100% - 44px);
  margin: 0;
  color: #445c6c;
  font-family: var(--f-mono);
  font-size: 9.5px;
  line-height: 1.45;
  letter-spacing: .045em;
}

.portfolio-proof-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 0 0 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius-ui);
  background: var(--line);
  overflow: hidden;
}

.portfolio-proof-grid section {
  padding: clamp(20px, 3vw, 28px);
  background: var(--paper);
}

.portfolio-proof-grid section > span {
  color: var(--ink-faint);
  font-family: var(--f-mono);
  font-size: 10px;
}

.portfolio-proof-grid h3 {
  margin: 28px 0 8px;
  font-family: var(--f-sans);
  font-size: 1rem;
  font-weight: 600;
}

.portfolio-proof-grid p {
  margin: 0;
  color: var(--ink-soft);
  font-size: .9rem;
  line-height: 1.52;
  text-wrap: pretty;
}

.partnership-note {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 12px;
  max-width: 66ch;
  margin: 28px 0 0;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-ui);
  background: var(--paper-2);
  color: var(--ink-soft);
  font-size: .94rem;
  line-height: 1.52;
}

.partnership-note i {
  grid-row: 1 / 3;
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 0 4px var(--signal-soft);
}

.partnership-note strong { display: block; color: var(--ink); font-weight: 600; }

.sody-stage {
  padding: 0 0 52px;
  border-color: var(--line);
  background:
    radial-gradient(circle at 20% 6%, rgba(255,255,255,.76), transparent 32%),
    linear-gradient(135deg, var(--paper-2), #e3ddcf 56%, #eee9dd);
}

.sody-stage-top {
  min-height: 42px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  font-family: var(--f-mono);
  font-size: 9.5px;
  letter-spacing: .055em;
  text-transform: uppercase;
}

.sody-stage-top b { color: var(--ink); font-weight: 500; }

.sody-reel {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(8px, 1.6vw, 14px);
  align-items: end;
  padding: clamp(26px, 5vw, 46px) clamp(16px, 3vw, 30px) 22px;
}

.sody-screen {
  min-width: 0;
  display: grid;
  gap: 9px;
  color: var(--ink-soft);
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: .055em;
  text-transform: uppercase;
  transition: transform .36s var(--ease-out);
}

.sody-screen:nth-child(1) { transform: translateY(11px) rotate(-1.4deg); }
.sody-screen:nth-child(2) { transform: translateY(-5px) rotate(.8deg); }
.sody-screen:nth-child(3) { transform: translateY(6px) rotate(-.7deg); }
.sody-screen:nth-child(4) { transform: translateY(-10px) rotate(1.2deg); }
.sody-screen:hover { transform: translateY(-9px) rotate(0); }

.sody-screen img {
  display: block;
  width: 100%;
  height: auto;
  border: 5px solid #111;
  border-radius: 23px;
  background: #fff;
  box-shadow: 0 22px 40px -28px rgba(24, 36, 88, .7);
}

.sody-stage figcaption { color: var(--ink-soft); }

.capability-row { margin: -1px 0 30px; }
.capability-row li { border-color: var(--line); color: var(--ink-soft); }

.text-cta {
  align-self: center;
  padding: 12px 2px;
  color: var(--ink);
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: .045em;
  text-underline-offset: 4px;
  border-radius: var(--radius-ui);
  transition: background-color .2s, box-shadow .2s, transform .2s;
}
.text-cta:hover,
.text-cta:focus-visible {
  background: var(--line-soft);
  box-shadow: 0 0 0 4px var(--line-soft);
  transform: translateY(-1px);
}

.email-stage {
  min-height: 660px;
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(250px, 320px) minmax(150px, 1fr);
  gap: clamp(20px, 4vw, 42px);
  align-items: center;
  padding: clamp(34px, 5vw, 54px) clamp(22px, 4vw, 42px) 56px;
  background:
    linear-gradient(rgba(20, 20, 20, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 20, 20, .045) 1px, transparent 1px),
    #eeeae3;
  background-size: 32px 32px, 32px 32px, auto;
}

.email-stage-notes {
  display: grid;
  gap: 18px;
  align-self: center;
}

.email-stage-notes span {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(20, 20, 20, .18);
  color: #333;
  font-family: var(--f-mono);
  font-size: 9.5px;
  line-height: 1.4;
  letter-spacing: .045em;
  text-transform: uppercase;
}

.email-stage-notes b { font-weight: 400; color: #888; }

.email-frame {
  position: relative;
  overflow: hidden;
  border: 1px solid #222;
  border-radius: var(--radius-ui);
  background: #fff;
  box-shadow: 0 28px 50px -34px rgba(0,0,0,.65);
}

.email-frame-bar {
  grid-template-columns: auto 1fr;
  border-color: #d8d8d8;
  background: #f7f7f7;
  color: #555;
}

.email-frame-bar span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #222;
}

.email-frame img { display: block; width: 100%; height: auto; }

.email-stage-stamp {
  width: min(100%, 180px);
  display: grid;
  gap: 5px;
  justify-self: end;
  padding: 16px;
  border: 1px solid #222;
  border-radius: var(--radius-ui);
  background: rgba(255,255,255,.58);
  font-family: var(--f-mono);
  line-height: 1.35;
  text-transform: uppercase;
  transform: rotate(2deg);
}

.email-stage-stamp span { color: #777; font-size: 8.5px; letter-spacing: .07em; }
.email-stage-stamp b { color: #111; font-size: 12px; font-weight: 500; letter-spacing: .05em; }
.email-stage-stamp small { color: #777; font-size: 8px; letter-spacing: .035em; }
.email-stage figcaption { color: #555; }

@media (max-width: 760px) {
  .portfolio-proof-grid { grid-template-columns: 1fr; }
  .wm-stage { min-height: 430px; padding: 16px 16px 52px; }
  .browser-frame--wm > img {
    aspect-ratio: 4 / 3;
    object-fit: cover;
    object-position: 28% top;
  }
  .phone-frame--wm { right: 26px; bottom: 38px; width: min(34%, 150px); }
  .sody-reel {
    display: flex;
    align-items: flex-end;
    gap: 13px;
    overflow-x: auto;
    padding: 28px 16vw 26px 18px;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
  }
  .sody-screen,
  .sody-screen:nth-child(n) {
    flex: 0 0 min(58vw, 210px);
    scroll-snap-align: center;
    transform: none;
  }
  .sody-screen:hover { transform: translateY(-4px); }
  .email-stage {
    min-height: 0;
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 28px 20px 58px;
  }
  .email-stage-notes {
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
  .email-stage-notes span { grid-template-columns: 1fr; gap: 4px; }
  .email-frame { width: min(100%, 310px); }
  .email-stage-stamp { justify-self: center; transform: rotate(-1deg); }
}

@media (max-width: 460px) {
  .portfolio-case-head > h2 { font-size: clamp(2.2rem, 12vw, 3.35rem); }
  .wm-stage { min-height: 350px; }
  .phone-frame--wm { width: 33%; right: 21px; }
  .browser-frame-bar { grid-template-columns: auto 1fr; }
  .browser-frame-bar::after { display: none; }
  .email-stage-notes span { font-size: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .sody-screen { transition: none; }
  .sody-screen:nth-child(n) { transform: none; }
}

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

.work-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 4px;
}

.systems-cta {
  --cta-signal: #acd879;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.9fr);
  gap: clamp(32px, 5vw, 64px);
  align-items: end;
  padding: clamp(28px, 4.5vw, 48px);
  border: 1px solid rgba(244, 240, 230, 0.16);
  border-radius: var(--radius-ui);
  background: #0b1c12;
  color: var(--cream);
  box-shadow: 0 24px 60px -42px rgba(11, 28, 18, 0.9);
}

.systems-cta::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.32;
  background-image:
    linear-gradient(rgba(172, 216, 121, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(172, 216, 121, 0.12) 1px, transparent 1px);
  background-size: 42px 42px;
  -webkit-mask-image: linear-gradient(115deg, transparent 0 30%, #000 85%);
  mask-image: linear-gradient(115deg, transparent 0 30%, #000 85%);
  pointer-events: none;
}

.systems-cta-label {
  display: block;
  color: var(--cta-signal);
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.systems-cta h2 {
  margin: 14px 0 18px;
  color: var(--cream);
  font-size: clamp(1.85rem, 4vw, 3.1rem);
}

.systems-cta h2 .n { color: var(--cta-signal); }
.legal-section .systems-cta p {
  max-width: 56ch;
  margin: 0;
  color: var(--cream-faint);
}

.systems-cta-actions {
  display: grid;
  gap: 18px;
  justify-items: start;
}

.legal-section .systems-cta-status {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--cream);
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.systems-cta-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cta-signal);
  box-shadow: 0 0 0 4px rgba(172, 216, 121, 0.12);
}

.systems-cta .work-ctas { margin-top: 0; }
.systems-cta-ghost {
  border-color: rgba(244, 240, 230, 0.38);
  background: transparent;
  color: var(--cream);
}
.systems-cta-ghost:hover {
  border-color: var(--cream);
  background: rgba(244, 240, 230, 0.08);
}

@media (max-width: 760px) {
  .systems-cta { grid-template-columns: 1fr; }
  .systems-cta-actions { justify-items: stretch; }
  .systems-cta .work-ctas { width: 100%; }
}

@media (max-width: 560px) {
  .built-grid { grid-template-columns: 1fr; }
  .systems-cta .work-ctas { align-items: stretch; flex-direction: column; }
  .systems-cta .btn { width: 100%; }
}
