/* Py'otr home story (v11). One pinned stage: story.js moves the camera, the frames and the words from one smoothed
   scroll value, so nothing pops. Without the script (or with reduced motion, or on a very short screen) the same
   markup reads as a plain page: that is the first block below. The shared look lives in site.css. */

.story { position: relative; }
.stage { position: relative; isolation: isolate; color: var(--ink); background: var(--bg); --paper-a: rgba(243, 243, 238, .95); }
.stage .kick { color: var(--ink); }
.after-story { position: relative; z-index: 6; background: var(--bg); }
.next-card h3 { font: 700 28px/1.08 var(--display); letter-spacing: -.018em; margin-bottom: 10px; }
.next-card p { font-size: 14.5px; color: var(--ink-2); }
.next-card .go { margin-top: auto; padding-top: 18px; font: 500 14px/1 var(--sans); }
.next-card .go::after { content: " →"; }

/* ---------- the pieces, as they look in both modes ---------- */
.title { margin: 0; color: var(--ink); font: 700 28.8vw/.8 var(--display); letter-spacing: -.04em; white-space: nowrap; }
.kicker {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 12px; padding: 7px 12px; border-radius: 999px;
  font: 400 12px/1.3 var(--mono); letter-spacing: .01em; color: var(--ink); background: rgba(243, 243, 238, .78);
}
.dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: #2f7a4b; box-shadow: 0 0 0 3px rgba(47, 122, 75, .2); }
.lede { margin: 0; font: 400 16px/1.55 var(--sans); color: var(--ink); }
.corner-links { margin: 16px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.corner .btn-line { border-color: rgba(27, 32, 29, .4); }
.skip-intro { display: inline-block; margin-top: 14px; font: 400 12px/1.2 var(--mono); letter-spacing: .04em; color: var(--ink); text-underline-offset: 4px; }

.resume { list-style: none; margin: 0; padding: 0; }
.r-when { display: block; font: 400 12px/1.4 var(--mono); letter-spacing: .02em; color: var(--ink); }
.r-what { display: block; margin: 4px 0; font: 600 17px/1.25 var(--sans); letter-spacing: -.01em; }
.r-more { display: block; font: 400 14px/1.5 var(--sans); color: var(--ink); }

.col-head h2 { font: 700 clamp(30px, 4.4vw, 56px)/1.02 var(--display); letter-spacing: -.026em; margin-top: 10px; }
.sv-cards, .wk-cards, .pk { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.sv a, .wk a { display: grid; align-content: start; gap: 6px; height: 100%; padding: 16px 18px; border-radius: 14px; text-decoration: none; background: var(--paper-a); box-shadow: 0 14px 36px rgba(20, 24, 22, .14); transition: background-color .2s; }
.sv a:hover, .wk a:hover { background: #fafaf6; }
.sv-n, .wk-k { font: 400 11.5px/1.3 var(--mono); letter-spacing: .04em; color: var(--ink-3); }
.sv-t, .wk-t { font: 700 20px/1.12 var(--display); letter-spacing: -.014em; }
.sv-d, .wk-r { font: 400 13.5px/1.45 var(--sans); color: var(--ink-2); }
.sv-p { margin-top: auto; padding-top: 4px; font: 400 12px/1.2 var(--mono); color: var(--ink-3); }
.sv-p b { font-weight: 400; color: var(--ink); }
.pk li { position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr); column-gap: 12px; align-items: center; padding: 13px 16px; border-radius: 14px; background: var(--paper-a); box-shadow: 0 14px 36px rgba(20, 24, 22, .14); transition: background-color .35s var(--ease), color .35s var(--ease); }
.pk i { grid-row: 1 / 3; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font: normal 400 12px/1 var(--mono); background: rgba(27, 32, 29, .1); transition: background-color .35s var(--ease), color .35s var(--ease); }
.pk b { font: 600 15.5px/1.25 var(--sans); letter-spacing: -.01em; }
.pk span { font: 400 13px/1.4 var(--sans); color: var(--ink-2); transition: color .35s var(--ease); }
.pk li.now { background: var(--panel); color: var(--panel-ink); }
.pk li.now i { background: var(--panel-ink); color: var(--panel); }
.pk li.now span { color: var(--panel-mute); }
.col-more { justify-self: start; align-self: start; margin-top: 14px; }

.ride-h { margin: 0; font: 700 clamp(46px, 6vw, 90px)/.95 var(--display); letter-spacing: -.03em; }
.bridge p { margin-top: 10px; font: 400 13px/1.4 var(--mono); letter-spacing: .02em; color: var(--ink); }
.stops { list-style: none; margin: 0; padding: 0; }
.stop { min-width: 0; padding: 24px 24px 16px; border-radius: 18px; background: var(--paper-a); color: var(--ink); box-shadow: 0 24px 60px rgba(20, 24, 22, .18); }
.stop-n { margin: 0 0 10px; font: 400 12px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.stop-h { margin: 0 0 10px; font: 700 30px/1.06 var(--display); letter-spacing: -.02em; }
.stop-p { margin: 0 0 14px; font-size: 14.5px; line-height: 1.5; color: var(--ink-2); }
.stop-img { margin: 0 0 12px; border-radius: 10px; overflow: hidden; aspect-ratio: 16 / 9; background: #dfe2dc; }
.stop-img img { width: 100%; height: 100%; object-fit: cover; }
.stop-rows { list-style: none; margin: 0; padding: 0; }
.stop-rows li { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.stop-rows em { font: normal 400 12px/1.5 var(--mono); color: #5f5020; white-space: nowrap; }
.stop-rows a { color: var(--ink); text-underline-offset: 3px; }
.flow { list-style: none; margin: 0 0 14px; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.flow li { display: grid; gap: 3px; padding: 10px 12px; border-radius: 10px; background: #e3e7e0; }
.flow b { font: 600 14px/1.2 var(--sans); }
.flow span { font: 400 12px/1.35 var(--sans); color: var(--ink-2); }
.stop-cta { background: var(--panel); color: var(--panel-ink); padding-bottom: 24px; }
.stop-cta .stop-n, .stop-cta .stop-p { color: var(--panel-mute); }
.stop-cta .stop-h { font-size: 38px; }
.stop-actions { margin: 18px 0 0; display: flex; flex-wrap: wrap; gap: 10px; }
.stop-cta .btn-line { border-color: var(--panel-line); color: var(--panel-ink); }
.stop-cta .btn-line:hover { border-color: var(--panel-ink); }

/* ================= plain page: no script, reduced motion, or a very short screen ================= */
html:not(.js-story) .land { position: relative; height: min(88svh, 70vw); min-height: 420px; overflow: hidden; background: #8f9486; }
html:not(.js-story) .plate, html:not(.js-story) .cut { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; }
html:not(.js-story) .title { position: absolute; left: 50%; top: 42%; transform: translate(calc(-50% + .08em), -50%); font-size: min(28.8vw, 44svh); }
html:not(.js-story) :is(.wing, .bust, .look, .film, .fog, .sheet, .rail, .hint, .skip-intro, [data-bridge-sub]) { display: none; }
html:not(.js-story) .corner { padding: 28px var(--pad) 8px; max-width: 62ch; }
html:not(.js-story) .resume { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; padding: 36px var(--pad); }
html:not(.js-story) .col { padding: 44px var(--pad) 8px; max-width: calc(var(--max) + 2 * var(--pad)); }
html:not(.js-story) .col-head { margin-bottom: 22px; }
html:not(.js-story) :is(.sv-cards, .wk-cards) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
html:not(.js-story) .pk { grid-template-columns: repeat(2, minmax(0, 1fr)); }
html:not(.js-story) .bridge { padding: 56px var(--pad) 18px; }
html:not(.js-story) .stops { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 14px; padding: 0 var(--pad) 56px; }
@media (max-width: 899px) {
  html:not(.js-story) .resume, html:not(.js-story) :is(.sv-cards, .wk-cards) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  html:not(.js-story) .land { height: 76svh; }
  html:not(.js-story) .title { font-size: 26vw; top: 19%; transform: translate(calc(-50% + .1em), -50%); }   /* clear of the top bar; the hook of the y stays behind his shoulder */
  html:not(.js-story) .resume, html:not(.js-story) :is(.sv-cards, .wk-cards, .pk) { grid-template-columns: 1fr; }
}

/* ================= the pinned story ================= */
.js-story .story { height: 1355vh; height: 1355lvh; }             /* story.js sets the exact length */
.js-story .stage {
  position: sticky; top: 0; height: 100vh; height: 100lvh; overflow: hidden; contain: layout paint; background: #8f9486;
  --vh: 1vh; --bar: 0px;                                           /* --bar: what a phone's address bar hides at the bottom */
  --u: min(1vw, calc(1.75 * var(--vh)));
}
@supports (height: 100lvh) { .js-story .stage { --vh: 1lvh; } }
@supports (height: 100dvh) { .js-story .stage { --bar: calc(100lvh - 100dvh); } }
.js-story .stage::after { /* paper grain over the pictures: one static tile, no blend modes */
  content: ""; position: absolute; inset: 0; z-index: 4; pointer-events: none;
  background: url("/assets/img/grain.png") repeat; background-size: 192px; opacity: .07;
}

/* the first screen is a box of the frame's shape, as tall as the stage, centred; the wings carry the backdrop sideways */
.js-story .land {
  position: absolute; z-index: 0; top: 0; height: 100%;
  width: calc(179.869 * var(--vh)); left: calc(50% - 89.9345 * var(--vh));
  transform-origin: 49.82% 13.63%; will-change: transform;         /* his face: the camera moves in on it */
}
.js-story .plate, .js-story .cut { position: absolute; inset: 0; width: 100%; height: 100%; }
.js-story .wing { position: absolute; top: 0; width: 70vw; height: 100%; max-width: none; }
.js-story .wing-l { right: calc(100% - 1px); }
.js-story .wing-r { left: calc(100% - 1px); }
.js-story :is(.wing-t, .wing-b) { display: none; }
.js-story .title {   /* nudged right so he stands between the y and the o, his hood over the apostrophe: the name reads Py [him] otr */
  position: absolute; left: 50%; top: 40%; transform: translate(calc(-50% + .08em + var(--px, 0px)), calc(-50% + var(--py, 0px)));
  font-size: min(calc(48 * var(--vh)), 28.8vw); will-change: transform;
}
.js-story .apo { color: transparent; }   /* it stands behind his hood; unseen, it can never peek out when the name drifts or his head turns */
.js-story .bust { position: absolute; z-index: 1; left: 0; top: 0; transform-origin: 49.26% 33.86%; will-change: transform, opacity; opacity: 0; visibility: hidden; pointer-events: none; }
.js-story .bust img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; }
.js-story .look { position: absolute; opacity: 0; visibility: hidden; pointer-events: none; }   /* his head, turned to the pointer (look.js) */
.js-story .film { position: absolute; z-index: 2; inset: 0; width: 100%; height: 100%; visibility: hidden; pointer-events: none; }
.js-story .fog {   /* a fog bank: soft ends, a solid middle, lighter and darker patches so it reads as fog. Drawn at half size and
                      doubled by story.js (it is all soft gradients), parked off-screen right until he rides into it. */
  position: absolute; z-index: 3; top: -12%; left: 0; width: 110vw; height: 62%; pointer-events: none;
  transform-origin: 0 0; transform: translate3d(112vw, 0, 0) scale(2) skewX(-8deg); will-change: transform;
  background:
    radial-gradient(17vw 44% at 30% 30%, rgba(207, 213, 205, .6), rgba(207, 213, 205, 0) 72%),
    radial-gradient(20vw 50% at 47% 74%, rgba(162, 170, 160, .42), rgba(162, 170, 160, 0) 72%),
    radial-gradient(16vw 46% at 63% 26%, rgba(210, 216, 208, .55), rgba(210, 216, 208, 0) 72%),
    radial-gradient(15vw 40% at 72% 78%, rgba(166, 174, 164, .36), rgba(166, 174, 164, 0) 72%),
    linear-gradient(90deg, rgba(182, 189, 180, 0) 0, rgba(182, 189, 180, .5) 8%, rgba(182, 189, 180, .92) 17%, rgb(182, 189, 180) 22.7%, rgb(182, 189, 180) 77.3%, rgba(182, 189, 180, .92) 83%, rgba(182, 189, 180, .5) 92%, rgba(182, 189, 180, 0) 100%);
}

/* everything that story.js fades and moves starts hidden and is never clickable while it is */
.js-story :is(.r, .col-head, .col-more, [data-card], [data-step], .bridge, .stop) { opacity: 0; will-change: transform, opacity; }
.js-story :is(.col, .stop, .corner.off, .r, .hint, .land) { pointer-events: none; }
.js-story :is(.col.on, .stop.on) { pointer-events: auto; }
.js-story .measuring :is([data-card], [data-step], .stop, .col-head, .col-more) { transform: none !important; }

.js-story .corner { position: absolute; z-index: 5; right: var(--pad); bottom: 52px; width: min(40ch, 34vw); will-change: transform, opacity; }   /* (its buttons stay clear of the helper on the chat button) */
.js-story .hint {
  position: absolute; z-index: 5; left: var(--pad); bottom: 30px; margin: 0; display: grid; justify-items: center; gap: 8px;
  font: 400 12px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink);
}
.js-story .hint i { width: 1px; height: 34px; background: linear-gradient(var(--ink), rgba(27, 32, 29, 0)); transform-origin: top; animation: drip 2.4s var(--ease) infinite; }
@keyframes drip { 0% { transform: scaleY(0); opacity: 1; } 70% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }

/* notes around the face */
.js-story .r { position: absolute; z-index: 5; width: min(300px, 25vw); padding-left: 18px; }
.js-story .r::before { content: ""; position: absolute; left: 0; top: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 4px rgba(27, 32, 29, .12); }
.js-story .r-l1 { left: var(--pad); top: 26%; }
.js-story .r-l2 { left: var(--pad); top: 58%; }
.js-story .r-r1 { right: var(--pad); top: 32%; }
.js-story .r-r2 { right: var(--pad); top: 64%; }

/* the three columns share one place on the right; he stands on the left */
.js-story .sheet { display: none; }
.js-story .col {
  position: absolute; z-index: 5; left: 60vw; right: var(--pad); max-width: 620px;
  top: calc(var(--top-h) + 3 * var(--vh)); bottom: 84px;
  display: flex; flex-direction: column; justify-content: center;
}
.js-story .col-head { margin-bottom: calc(1.6 * var(--u)); }
.js-story .col-head h2 { font-size: clamp(30px, calc(3.5 * var(--u)), 58px); }
.js-story .sv-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.js-story :is(.sv a, .wk a) { padding: clamp(11px, calc(1.15 * var(--u)), 20px) clamp(13px, calc(1.3 * var(--u)), 22px); }
.js-story :is(.sv-t, .wk-t) { font-size: clamp(16.5px, calc(1.44 * var(--u)), 24px); }
.js-story :is(.sv-d, .wk-r) { font-size: clamp(12.5px, calc(1.02 * var(--u)), 15.5px); }
.js-story .pk b { font-size: clamp(14.5px, calc(1.2 * var(--u)), 18px); }
.js-story .pk li { padding: clamp(10px, calc(1 * var(--u)), 16px) clamp(13px, calc(1.3 * var(--u)), 20px); }
.js-story .col-more { align-self: flex-start; margin-top: calc(1.4 * var(--u)); }
@media (max-height: 660px) and (min-width: 900px) { .js-story .sv-d { display: none; } }

/* out of the studio and onto the road */
.js-story .bridge { position: absolute; z-index: 5; left: var(--pad); top: calc(var(--top-h) + 18px); pointer-events: none; }
.js-story .stop { position: absolute; z-index: 5; right: var(--pad); top: 53%; width: min(440px, 36vw); margin-top: 0; }
.js-story .stop-img { aspect-ratio: auto; height: clamp(110px, calc(23 * var(--vh)), 220px); }   /* a short screen still fits the whole card */

/* jump dots */
.js-story .rail { position: absolute; z-index: 6; left: 10px; top: 50%; transform: translateY(-50%); display: grid; gap: 2px; }
.js-story .rail button { width: 22px; height: 22px; padding: 0; border: 0; background: transparent; cursor: pointer; display: grid; place-items: center; }
.js-story .rail button::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ink); opacity: .32; transition: opacity .25s, transform .3s var(--ease); }
.js-story .rail button:hover::before { opacity: .7; }
.js-story .rail button[aria-current="true"]::before { opacity: 1; transform: scale(1.7); }

/* ---------- phones and upright tablets: he stands above, the cards sit on a sheet below ---------- */
@media (max-width: 899px) and (max-aspect-ratio: 1/1) {
  /* the first screen as a poster: he stands smaller, the name sits behind his head, backdrop above and floor below */
  .js-story .land { top: 12%; height: 58%; width: calc(104.324 * var(--vh)); left: calc(50% - 52.162 * var(--vh)); }
  .js-story :is(.wing-l, .wing-r) { display: none; }
  .js-story :is(.wing-t, .wing-b) { display: block; left: 0; width: 100%; }
  .js-story .wing-t { top: auto; bottom: calc(100% - 1px); height: 30vh; }
  .js-story .wing-b { top: calc(100% - 1px); height: 60vh; }
  /* sized against his height, so the apostrophe always hides behind the hood and the hook of the y behind his shoulder */
  .js-story .title { font-size: min(30.7vw, calc(14.2 * var(--vh))); top: 18.6%; transform: translate(calc(-50% + .13em), -50%); }
  .js-story .corner { left: var(--pad); right: var(--pad); bottom: calc(80px + var(--bar)); width: auto; padding: 14px 16px 12px; border-radius: 16px; background: rgba(243, 243, 238, .92); }
  .js-story .corner .kicker { padding: 0; background: none; margin-bottom: 8px; font-size: 11px; letter-spacing: 0; }
  .js-story .lede { font-size: 14.5px; line-height: 1.5; }
  .js-story .corner-links { margin-top: 12px; }
  .js-story .corner .btn { height: 40px; padding: 0 16px; font-size: 13.5px; }
  .js-story .skip-intro { margin-top: 10px; }
  @media (max-width: 379px) { .js-story .corner .btn { height: 38px; padding: 0 12px; font-size: 13px; } .js-story .corner-links { gap: 6px; } .js-story .lede { font-size: 14px; } }
  .js-story :is(.hint, .rail) { display: none; }

  .js-story .r { width: auto; left: var(--pad); right: var(--pad); top: auto; bottom: calc(80px + var(--bar)); padding: 14px 16px 14px 36px; border-radius: 16px; background: rgba(243, 243, 238, .92); }
  .js-story .r::before { left: 17px; top: 21px; }

  .js-story .sheet {
    display: block; position: absolute; z-index: 5; left: 0; right: 0; bottom: var(--bar); height: var(--sheet-h, 300px);
    background: rgba(243, 243, 238, .97); border-radius: 22px 22px 0 0; box-shadow: 0 -18px 50px rgba(20, 24, 22, .2); will-change: transform; transform: translate3d(0, 110%, 0);
  }
  .js-story .sheet::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 160px; background: rgb(243, 243, 238); }
  .js-story .col { z-index: 6; left: 0; right: 0; top: auto; bottom: var(--bar); max-width: none; height: var(--sheet-h, auto); padding: 16px var(--pad) 16px; justify-content: flex-start; }
  .js-story .col-head { margin-bottom: 12px; padding-right: 96px; }
  .js-story .col-head .kick { font-size: 11.5px; }
  .js-story .col-head h2 { font-size: 25px; margin-top: 5px; }
  .js-story .col-more { position: absolute; right: var(--pad); top: 20px; margin: 0; font-size: 13px; }
  .js-story :is(.sv-cards, .wk-cards, .pk) { gap: 7px; }
  .js-story :is(.sv a, .wk a) { padding: 10px 12px; gap: 3px; border-radius: 12px; background: #e6e9e1; box-shadow: none; }
  .js-story .pk li { padding: 8px 12px; border-radius: 12px; background: #e6e9e1; box-shadow: none; grid-template-columns: 24px minmax(0, 1fr); column-gap: 10px; }
  .js-story .pk li.now { background: var(--panel); }
  .js-story .pk i { width: 24px; height: 24px; font-size: 11px; }
  .js-story .sv-n, .js-story .sv-d { display: none; }
  .js-story .sv-t { font: 600 14px/1.2 var(--sans); letter-spacing: -.01em; }
  .js-story .sv-p { padding-top: 0; font-size: 11.5px; }
  .js-story .wk-k { font-size: 10.5px; }
  .js-story .wk-t { font: 600 14.5px/1.2 var(--sans); letter-spacing: -.01em; }
  .js-story .wk-r { font-size: 12.5px; line-height: 1.35; }
  .js-story .pk b { font-size: 14px; }
  .js-story .pk span { font-size: 12px; line-height: 1.3; }

  .js-story .bridge { left: var(--pad); right: var(--pad); top: 34%; text-align: center; }
  .js-story .ride-h { font-size: 21vw; }
  .js-story .stop { left: var(--pad); right: var(--pad); width: auto; top: auto; bottom: calc(80px + var(--bar)); padding: 16px 16px 8px; }
  .js-story .stop-cta { padding-bottom: 16px; }
  .js-story .stop-img { display: none; }
  .js-story .stop-h { font-size: 25px; margin-bottom: 6px; }
  .js-story .stop-cta .stop-h { font-size: 30px; }
  .js-story .stop-p { font-size: 13.5px; margin-bottom: 8px; }
  .js-story .stop-rows li { padding: 7px 0; font-size: 13px; }
  .js-story .flow { margin-bottom: 8px; }
  .js-story .flow span { display: none; }
  body.fab-off .chat-fab { opacity: 0; pointer-events: none; }
  body.fab-off .buddy-corner { display: none; }
}
