/* The app's screens on the devices that show them: two device bands with real app clips (a phone's See it solved, a
   laptop's coach naming a slip and its calculator; owner 1 Dec 2026, "Shorten focus hour landing page": the tablets and
   the calculator slider went), from
   the old personal home page (us2/public/index.html, served unchanged at /story/; its script /home/page.js plays the
   clips here too). On their own since 1 Dec 2026 (owner: "remove my sketch too ... figure out how to use those sequences
   without my sketch"): no sketch, no zoom out of a drawing (the landing's <body data-no-zoom>); each band is its words
   beside its device on a laptop, above it on a phone, and the device grows into place as it scrolls in. The rules are the
   story page's own (us2/public/home/style.css, "DEMO BANDS" to the calculator) in the landing's look: its tokens mapped
   onto the names those rules use, its fonts. */
.story{
  --paper:var(--bg); --paper-alt:var(--surface); --card:var(--surface); --ink-soft:var(--dim); --ink-muted:var(--dim);
  --fh-surface:var(--surface); --fh-sunk:var(--bg); --fh-line:var(--rule); --fh-ink:var(--ink); --fh-soft:var(--dim);
  --fh-emerald:var(--em); --fh-emerald-dark:var(--em); --fh-emerald-tint:var(--emsoft); --fh-coral:var(--flag);
  --fh-coral-tint:color-mix(in srgb,var(--flag) 12%,transparent); --fh-indigo:var(--pen); --header-h:0px;
  margin-left:calc(-1 * max(16px,env(safe-area-inset-left,0px))); margin-right:calc(-1 * max(16px,env(safe-area-inset-right,0px)));
}
.story .demo-title{font-family:var(--sans);font-weight:600;letter-spacing:-.03em}
.story .demo-title em{font-family:var(--serif);font-weight:400;font-style:italic;color:var(--em)}
/* Demo bands: words and device; two columns from 900 px, the words on the side the band names (.flip: the right) */
.demo-band {
  position: relative;
  padding: clamp(28px, 4vh, 76px) 0;
  border-top: 1px solid var(--rule);
  scroll-margin-top: var(--header-h);
  overflow-anchor: none;
}

.demo-band-alt {
  background: var(--paper-alt);
}

.zoom-viewport {
  position: relative;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  overflow-anchor: none;
}

@media (min-width: 720px) {
  .zoom-viewport {
    padding: 0 28px;
  }
}

.band-grid {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.band-grid .demo-intro {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  max-width: 520px;
}
@media (min-width: 900px) {
  .band-grid {
    display: grid;
    grid-template-columns: minmax(240px, 340px) minmax(0, 1fr);
    align-items: center;
    gap: clamp(28px, 4vw, 64px);
  }
  .band-grid.flip { grid-template-columns: minmax(0, 1fr) minmax(240px, 340px); }
  .band-grid.flip .demo-intro { order: 2; }
}
/* the device grows into place as its band scrolls in (where the browser ties animation to scroll; elsewhere it simply shows) */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .story .device { animation: grow-in linear both; animation-timeline: view(); animation-range: entry 5% cover 38%; }
    @keyframes grow-in { from { transform: scale(.84) translateY(32px); } to { transform: none; } }
  }
}

.demo-kicker {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fh-emerald-dark);
  background: var(--fh-emerald-tint);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}

.demo-title {
  font-family: var(--serif);
  font-size: clamp(25px, 5.2vw, 36px);
  line-height: 1.16;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-wrap: balance;
}

.demo-desc {
  margin-top: 10px;
  font-size: clamp(15.5px, 3vw, 17px);
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 44ch;
}

/* The device and its switch/pan buttons */
.demo-stage {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.demo-stage-wide {
  max-width: 840px;
  margin: 0 auto;
}

/* =========================================================================
   CLEAN CLIP SWITCHER (PHONE & LAPTOP)
   ========================================================================= */
.clip-switcher {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--rule);
  padding: 4px;
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(24, 32, 29, 0.05);
}

.sw-btn {
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.sw-btn:hover {
  color: var(--ink);
}

.sw-btn.is-active {
  background: var(--fh-ink);
  color: #FFFFFF;
}

/* =========================================================================
   CLEAN DEVICE FRAMES (SEPARATE SHELL LAYER FOR SEAMLESS SKETCH HANDOFF)
   ========================================================================= */
.device {
  position: relative;
  width: 100%;
  margin: 0 auto;
}

.device-shell-bg {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: #141B29;
  box-shadow: 0 22px 54px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(255, 255, 255, 0.08) inset;
  pointer-events: none;
  z-index: 0;
}

.device-phone {
  max-width: 312px;
  border-radius: 34px;
  padding: 10px;
}

.phone-speaker {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  padding: 1px 0 8px;
}

.phone-speaker span {
  width: 62px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
}

.device-laptop {
  max-width: 820px;
}

.laptop-lid {
  position: relative;
  border-radius: 18px 18px 8px 8px;
  padding: 9px 9px 10px;
}

.laptop-cam {
  position: relative;
  z-index: 2;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #3B4960;
  margin: 0 auto 6px;
}

.laptop-base {
  position: relative;
  z-index: 2;
  height: 12px;
  width: 103%;
  margin-left: -1.5%;
  background: linear-gradient(180deg, #D1D9E4 0%, #94A3B8 100%);
  border-radius: 2px 2px 12px 12px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

.laptop-base span {
  width: 72px;
  height: 4px;
  background: #64748B;
  border-radius: 0 0 5px 5px;
}

@media (max-width: 679px) {
  .device-phone { border-radius: 22px; padding: 6px; max-width: 240px; }
  .device-phone .phone-speaker { padding: 1px 0 6px; }
  .device-phone .device-screen { border-radius: 20px; }
  .laptop-lid { border-radius: 12px 12px 5px 5px; padding: 5px; }
  .laptop-cam { width: 5px; height: 5px; margin: 0 auto 4px; }
  .device-laptop .device-screen { border-radius: 8px; }
  .laptop-base { width: 100%; margin-left: 0; height: 8px; }
}

/* =========================================================================
   SCREEN & REAL APP CLIPS
   Desktop & tablet (>= 680px): 100% full, crisp, uncropped screen, ZERO zoom.
   Mobile (< 680px): wide landscape clips smoothly frame the active column
   using pure translate3d + scale (fixed origin 0 0).
   ========================================================================= */
.device-screen {
  position: relative;
  z-index: 2;
  width: 100%;
  background: #FFFFFF;
  border-radius: 22px;
  overflow: hidden;
  overflow: clip;
  touch-action: pan-y pinch-zoom;
}

.device-laptop .device-screen {
  border-radius: 10px;
}

.ratio-phone { aspect-ratio: 390 / 844; }
.ratio-laptop { aspect-ratio: 1200 / 750; }

.device-screen video.clip {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: top center;
  background: #FFFFFF;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.device-screen video.clip.is-active {
  opacity: 1;
  pointer-events: auto;
}

/* Mobile-only column focus for the laptop's wide 2-column screen */
.mobile-pan-bar {
  display: none;
}

@media (max-width: 679px) {
  .ratio-laptop {
    aspect-ratio: 10 / 13;
  }

  .ratio-laptop video.clip {
    object-fit: contain;
    object-position: center center;
    transform-origin: 0 0;
    will-change: transform;
    transition: transform 0.85s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
  }

  .mobile-pan-bar {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--rule);
    padding: 3px;
    border-radius: 999px;
    box-shadow: 0 6px 18px rgba(24, 32, 29, 0.05);
  }

  .pan-btn {
    border: 0;
    background: transparent;
    color: var(--ink-soft);
    font-family: var(--sans);
    font-size: 12.5px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.16s ease, color 0.16s ease;
  }

  .pan-btn.is-active {
    background: var(--fh-emerald-tint);
    color: var(--fh-emerald-dark);
  }
}

/* (the story page's short-landscape, reduced-motion and dark rules for these bands, in the landing's dark palette) */
@media (max-height: 460px) and (min-width: 680px) {
  .demo-band { padding: 28px 0; }
  .device-phone { max-width: 240px; }
}
@media (prefers-reduced-motion: reduce) {
  .device-screen video.clip { transition: none !important; }
}
@media (prefers-color-scheme: dark) {
  .clip-switcher, .mobile-pan-bar { background: rgba(20, 28, 25, 0.92); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35); }
  .sw-btn.is-active { color: var(--bg); }
  .device-shell-bg { box-shadow: 0 22px 54px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.16) inset, 0 0 0 1px #2f3d37; }
  .laptop-base { background: linear-gradient(180deg, #2f3d37 0%, #141c19 100%); box-shadow: 0 8px 18px rgba(0, 0, 0, 0.5); }
  .laptop-base span { background: var(--bg); }
  .device-screen, .device-screen video.clip { background: var(--bg); }
}

.mobile-pan-bar[hidden] { display: none !important; }
