@view-transition { navigation: auto; }

body { margin: 0; font-family: "Host Grotesk", sans-serif; color: #000; -webkit-font-smoothing: antialiased; }

/* Standalone page gets its own bg; overlay mode supplies its own white container */
body:not(.to-overlay-mode) .to-page { background: #ffffff; min-height: 100vh; }

/* overflow-x: clip (not hidden) clips the full-bleed band WITHOUT becoming a
   scroll container, which would otherwise break the position:sticky pin below */
.to-page { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 10px 10px 120px; min-height: 100vh; box-sizing: border-box; overflow-x: clip; }

/* the close button stays put as the page scrolls: the header row sticks where it sits at the top,
   and only the button itself takes clicks */
.to-header { position: sticky; top: 10px; z-index: 50; pointer-events: none; max-width: 1280px; width: 100%; height: 100px; display: flex; justify-content: flex-end; align-items: center; padding-right: 30px; box-sizing: border-box; }
.to-header > * { pointer-events: auto; }

.to-close { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; background: #ffffff; border: 1.838px solid rgba(0,0,0,0.1); border-radius: 16px; box-shadow: 0 14.703px 58.811px -4px rgba(0,0,0,0.1); overflow: hidden; text-decoration: none; flex-shrink: 0; transition: opacity 0.15s ease; }
.to-close:hover { opacity: 0.7; }

.to-content { width: 100%; max-width: 800px; display: flex; flex-direction: column; gap: 90px; }

/* ── type ramp ───────────────────────────────────────────────────────── */
.to-title    { font-size: 50px; font-weight: 500; line-height: 1.2; margin: 0; }
.to-bigtitle { font-size: 70px; font-weight: 500; line-height: 1.0; margin: 0; text-align: center; }
.to-title--center { text-align: center; }
.to-lead     { font-size: 30px; font-weight: 400; line-height: 1.4; margin: 0; }
.to-body-lg  { font-size: 35px; font-weight: 400; line-height: 1.4; margin: 0; }
.to-body-sm  { font-size: 22px; font-weight: 300; line-height: 1.4; margin: 0; }
.to-cap      { font-size: 20px; font-weight: 300; line-height: 1.4; margin: 0; }   /* eyebrow size */
.to-cap--center { text-align: center; max-width: none; }
.to-b        { font-weight: 700; }

/* ── section rhythm ──────────────────────────────────────────────────── */
.to-sec { display: flex; flex-direction: column; gap: 40px; align-items: stretch; }
.to-sec--nux { margin-top: 90px; }   /* ~180px before the final section */

/* ── intro (lead + meta sidebar) ─────────────────────────────────────── */
.to-intro { display: flex; justify-content: space-between; align-items: flex-start; gap: 48px; }
.to-intro > :first-child { flex: 0 1 468px; }
.to-lead-stack { display: flex; flex-direction: column; gap: 40px; }
.to-meta { flex: 0 0 220px; display: flex; flex-direction: column; gap: 20px; }
.to-meta__group p { font-size: 22px; font-weight: 300; line-height: 1.4; margin: 0 0 10px; }
.to-meta__group p:last-child { margin-bottom: 0; }

/* ── figures / images ────────────────────────────────────────────────── */
.to-fig { margin: 0; display: flex; justify-content: center; }
.to-fig img { display: block; width: 100%; height: auto; }

/* wide image breaks beyond the 800 text column, centered on the viewport */
.to-fig--zar { position: relative; left: 50%; transform: translateX(-50%); width: min(880px, calc(100vw - 32px)); }
/* grey #ebeeed card wrapping the settings/account phones (matches install-screen
   cards). align-self:center reliably centres the wider-than-column card. */
.to-fig--settings { align-self: center; width: min(920px, calc(100vw - 32px)); background: #ebeeed; border-radius: 30px; overflow: hidden; padding: 36px 48px 0; box-sizing: border-box; margin: 0; }
.to-fig--beforeafter { width: min(653px, 100%); margin: 0 auto; }

/* ── FB-TH flow: scroll-pinned horizontal pan ────────────────────────────
   Base (no-JS / fallback) is a normal swipeable scroller. JS adds .to-pin--active
   to upgrade it to a centered sticky window that pans horizontally as you scroll. */
.to-pin { position: relative; }
.to-pin__window {
  width: min(640px, calc(100vw - 32px)); height: 600px; margin: 0 auto;
  background: #ebeeed; border-radius: 30px;
  display: flex; align-items: center;
  overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch;
}
.to-pin__img { height: 460px; width: auto; max-width: none; flex: 0 0 auto; will-change: transform; }
.to-pin--active .to-pin__window { position: sticky; top: calc(50svh - 300px); overflow: clip; }
@media (prefers-reduced-motion: reduce) {
  .to-pin--active .to-pin__window { position: static; top: auto; overflow-x: auto; overflow-y: hidden; }
  .to-pin--active .to-pin__img { transform: none !important; }
}

/* ── "See before & after" button + image lightbox ───────────────────── */
.to-ba { display: flex; justify-content: center; }

/* Reuse the /portfolio .pill (cursor-following radial gradient + press spring) so
   this button matches every other button on the site. */
.pill { display: inline-block; background: #f38d3a; color: #000; text-decoration: none; font-weight: 700; font-size: 22px; line-height: 1.4; padding: 5px 20px; border-radius: 999px; position: relative; isolation: isolate; -webkit-tap-highlight-color: transparent; user-select: none; }
.pill::after { content: ''; position: absolute; inset: 0; border-radius: inherit; background: radial-gradient(circle at var(--px,50%) var(--py,50%), #ebeeed 0%, #f38d3a 80%); opacity: 0; transition: opacity .18s ease; pointer-events: none; z-index: -1; }
@media (hover: hover) { .pill:hover::after { opacity: 1; } }
@keyframes pill-spring { 0% { transform: scale(.94); } 55% { transform: scale(1.04); } 100% { transform: scale(1); } }
.pill--pressed { transform: scale(.94); transition: transform .08s ease-out; }
.pill--releasing { animation: pill-spring .3s cubic-bezier(.34,1.56,.64,1) forwards; }

/* button-specific tweaks on top of .pill: flex layout for the trailing arrow */
.to-ba-btn { display: inline-flex; align-items: center; gap: 10px; border: none; cursor: pointer; font-family: inherit; }
.to-ba-arrow { display: block; }

.zar-lightbox { position: fixed; inset: 0; z-index: 1000; background: #fff; display: none; }
.zar-lightbox.is-open { display: block; }
.zar-lightbox__close {
  position: fixed; top: 20px; right: 20px; z-index: 2;
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; padding: 0;
  background: #fff; border: 1.5px solid rgba(0,0,0,0.12); border-radius: 14px;
  box-shadow: 0 10px 40px -6px rgba(0,0,0,0.18); cursor: pointer; transition: opacity .15s ease;
}
.zar-lightbox__close:hover { opacity: 0.7; }
/* flex + margin:auto on the image centres it AND keeps it fully scrollable when it
   overflows (no clipped top), in both the fit and zoomed states */
/* flex + margin:auto on the image centres it AND keeps it fully scrollable when it
   overflows (no clipped top), in both the fit and zoomed states */
.zar-lightbox__stage { position: absolute; inset: 0; overflow: auto; -webkit-overflow-scrolling: touch; display: flex; padding: 24px; box-sizing: border-box; }
/* default: fit the whole before/after within the viewport (both rows visible) */
.zar-lightbox__img { margin: auto; max-width: 100%; max-height: 100%; display: block; cursor: zoom-in; }
/* zoomed: grow past the viewport so the mouse can pan vertically + horizontally */
.zar-lightbox__stage.is-zoomed { cursor: zoom-out; }
.zar-lightbox__stage.is-zoomed .zar-lightbox__img { max-width: none; max-height: none; width: 150%; height: auto; cursor: zoom-out; }

.to-block { max-width: 800px; }
.to-twopara { display: flex; flex-direction: column; gap: 30px; }

/* ── dark Case Study band (full-bleed) ───────────────────────────────── */
.to-sec--dark {
  background: #181818; color: #ffffff;
  width: 100vw; left: 50%; position: relative; transform: translateX(-50%);
  padding: 90px 0; gap: 0;
}
.to-sec__inner { width: 100%; max-width: 756px; margin: 0 auto; padding: 0 24px; box-sizing: border-box; display: flex; flex-direction: column; gap: 40px; }
.to-cs-head { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.to-eyebrow { font-size: 20px; font-weight: 700; line-height: 1.4; text-align: center; margin: 0; }
.to-cs-title { font-size: 45px; font-weight: 700; line-height: 1.2; text-align: center; margin: 0; }

.to-breakdown { display: flex; flex-direction: column; gap: 40px; }
.to-bd-item { border-left: 2px solid #ffffff; padding-left: 30px; }
.to-bd-item p { font-size: 22px; font-weight: 300; line-height: 1.4; margin: 0; }

/* ── Instants card ───────────────────────────────────────────────────── */
/* Instants.webp has its top edge flush (0px transparent at top) with the device's
   drop shadow intact below/sides. The phone is a plain fixed-height block that
   DRIVES the card height — no stretch / object-fit that renders differently
   across browsers. Card has no vertical padding, so the phone's top sits flush
   to the card's top edge; the drop shadow fills the bottom. Text centred. */
.to-instants {
  position: relative; left: 50%; transform: translateX(-50%);
  width: min(920px, calc(100vw - 32px));
  background: #ebeeed; border-radius: 30px; overflow: hidden;
  display: flex; align-items: center; gap: 40px;
  padding: 0 40px 0 89px; box-sizing: border-box;
}
.to-instants .to-body-lg { flex: 1 1 auto; padding: 44px 0; }
.to-instants__phone { margin: 0; flex: 0 0 auto; display: flex; }
.to-instants__phone img { display: block; height: 470px; width: auto; }

/* ── project impact + orange quote ───────────────────────────────────── */
.to-impact { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.to-impact__head { font-size: 30px; font-weight: 700; line-height: 1.2; text-align: center; margin: 0; padding: 40px 0; max-width: 800px; }
.to-quote-wrap { display: flex; justify-content: center; padding: 10px 0; }
.to-quote { transform: rotate(-3deg); background: #f38d3a; border-radius: 60px; max-width: 640px; padding: 40px 50px; margin: 0; box-sizing: border-box; will-change: transform; }
.to-quote__text { font-size: 25px; font-weight: 700; line-height: 1.2; color: #ffffff; text-align: center; margin: 0 0 15px; }
.to-quote__by { font-size: 18px; font-weight: 700; line-height: 1.1; color: #ffffff; text-align: center; margin: 0; }

/* ── NUX split blocks (phone + copy) ─────────────────────────────────── */
.to-nux-head { display: flex; flex-direction: column; align-items: center; gap: 50px; }
.to-nux-intro { text-align: center; max-width: 600px; }
.to-split { display: flex; align-items: center; justify-content: space-between; gap: 50px; }
.to-split__phone { margin: 0; flex: 0 0 auto; }
.to-split__phone img { display: block; width: 340px; height: auto; }
.to-split__text { flex: 1 1 auto; }

/* ── responsive ──────────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .to-page { padding: 0 0 64px; gap: 0; }
  .to-header { top: 0; height: 64px; padding-right: 16px; }
  .to-content { gap: 64px; padding: 0 16px; box-sizing: border-box; }

  .to-title    { font-size: 30px; }
  .to-bigtitle { font-size: 40px; }
  .to-lead     { font-size: 24px; }
  .to-body-lg  { font-size: 24px; }
  .to-cs-title { font-size: 30px; }
  .to-impact__head { font-size: 24px; padding: 20px 0; }
  .to-quote__text { font-size: 20px; }

  .to-sec { gap: 28px; }
  .to-sec--nux { margin-top: 64px; }

  .to-intro { flex-direction: column; gap: 24px; }
  .to-intro > :first-child { flex: 1 1 auto; }
  .to-lead-stack { gap: 24px; }
  .to-meta { flex: 1 1 auto; }

  /* images fill the column on small screens */
  .to-fig--zar, .to-instants { left: auto; transform: none; width: 100%; }
  .to-fig--zar { position: static; }
  .to-fig--settings { width: 100%; padding: 0 24px; }
  .to-pin__window { height: 460px; }
  .to-pin__img { height: 360px; }

  /* column-reverse so the phone (last in DOM) stacks ABOVE the copy on mobile */
  .to-instants { position: static; display: flex; flex-direction: column-reverse; align-items: flex-start; gap: 24px; padding: 24px; }
  .to-instants .to-body-lg { padding: 0; }
  .to-instants__phone { align-self: center; width: 240px; min-height: 0; position: static; }
  .to-instants__phone img { position: static; width: 100%; height: auto; object-fit: initial; margin: 0 auto; }

  .to-quote { padding: 28px 30px; border-radius: 36px; }

  .to-nux-head { gap: 24px; }
  /* image always stacks above text on mobile, regardless of desktop side, so
     alternating rows read image-text-image-text (not image-text-text-image) */
  .to-split { flex-direction: column; align-items: center; gap: 24px; }
  .to-split--reverse { flex-direction: column-reverse; align-items: center; gap: 24px; }
  .to-split__text { text-align: center; }
  .to-split__phone img { width: 260px; }
}
