/* iPhone | iPhone Duo. The page shows one device at a time; iPhone Duo is the default. */
html[data-device=duo] .only-iphone,html[data-device=iphone] .only-duo{display:none!important}

/* The switch, just below the subtitle, in the headline's ink. A white thumb slides to the chosen
   device; on a first visit it slides from iPhone to iPhone Duo (duo.js). Without JavaScript it stays
   hidden and the page shows iPhone Duo. */
.device-switch{display:none}
.js .device-switch{position:relative;display:inline-flex;gap:2px;margin-top:30px;padding:4px;border-radius:999px;background:var(--ink,#222d29)}
.device-switch-thumb{position:absolute;top:4px;bottom:4px;left:4px;width:0;border-radius:999px;background:#fff;box-shadow:0 1px 3px #0003}
.device-switch.is-ready .device-switch-thumb{transition:left .45s cubic-bezier(.3,.7,.2,1),width .45s cubic-bezier(.3,.7,.2,1)}
.device-switch button{position:relative;appearance:none;border:0;background:transparent;font:inherit;font-size:var(--type-small);color:#e9ece6;min-height:44px;padding:0 20px;border-radius:999px;cursor:pointer;transition:color .3s ease}
.device-switch button.is-under-thumb{color:var(--ink,#222d29)}
.device-switch button:focus-visible{outline:2px solid #8fb6e0;outline-offset:2px}

/* iPhone Duo frames. --duo-w is the open phone's width held sideways; the closed screen is about
   half of it and the open phone held tall is as tall as it is wide sideways. Screens are 1903 × 1339
   (open), 932 × 1357 (closed) and 1339 × 1903 (tall). */
.story-site{--duo-w:clamp(510px,60vw,810px)}
@media(max-width:650px){.story-site{--duo-w:min(88vw,420px)}}
.duo-frame{position:relative;background:#252b27;border:2px solid #8c948e;padding:5px;border-radius:38px;box-shadow:0 30px 60px -15px #1b29203d,0 65px 110px -25px #1b29202b,0 5px 12px #1b29201a}
.duo-frame img{display:block;width:100%;height:auto;border-radius:31px}
/* Closed, the hinge runs down the left edge: square there, rounded on the opening side. */
.duo-frame-closed{border-radius:12px 38px 38px 12px}
.duo-frame-closed img{border-radius:6px 31px 31px 6px}
/* The closed screen's camera, where iOS reports it: a 37pt circle centered at (418.2, 47.8) on the
   466 × 678pt screen, so 89.74% across and 7.05% down, 7.94% of the screen's width. The 5px inset is
   the frame's padding around the screen. */
.duo-frame-closed::after,.duo-main .duo-screen::after{content:"";position:absolute;width:calc((100% - 10px) * .0794);aspect-ratio:1;border-radius:50%;background:#0b0c0d;left:calc((100% - 10px) * .8974 + 5px);top:calc((100% - 10px) * .0705 + 5px);transform:translate(-50%,-50%);pointer-events:none}
/* Inside the opening phone the camera belongs to the closed screen and fades with it. */
.duo-main .duo-screen::after{width:calc(100% * .0794);left:calc(100% * .8974);top:calc(100% * .0705);opacity:clamp(0,calc(1 - var(--o) * 2.2),1)}
.duo-phone{position:relative;z-index:3;margin:0 auto;transform:translate3d(0,var(--phone-drift,0px),0);will-change:transform}
.duo-closed{width:max(230px,calc(var(--duo-w) * .49))}

/* Morning: the forecast first, then, once the scene's title comes into view below the phone, the See
   card rises over it as the title scrolls up the window. */
.duo-rise{--s:clamp(0,var(--p,1),1)}
.duo-rise .duo-screen{position:relative;overflow:hidden;border-radius:6px 31px 31px 6px}
.duo-rise .duo-card-img{position:absolute;inset:0;clip-path:inset(calc((1 - var(--s)) * 100%) 0 0 0)}

/* Noon: the closed phone opens. The other half swings out to the left from the hinge while the
   morning screen gives way to the open one. --p runs 0 to 1 as the phone scrolls up the window (duo.js). */
.duo-unfold{width:var(--duo-w);--o:clamp(0,calc((var(--p,1) - .08) / .72),1)}
/* One shadow for the whole phone, so none falls across the hinge where the halves meet. */
.duo-book{display:flex;perspective:2400px;transform:translateX(calc((var(--o) - 1) * 25%));filter:drop-shadow(0 22px 26px #1b292030) drop-shadow(0 4px 6px #1b29201a)}
.duo-half{position:relative;width:50%;background:#252b27;border:2px solid #8c948e}
.duo-screen{position:relative;overflow:hidden}
.duo-half img{display:block;height:auto;max-width:none;width:200%}
.duo-main{z-index:1;border-left-width:calc((1 - var(--o)) * 2px);padding:5px 5px 5px calc((1 - var(--o)) * 5px);border-radius:calc((1 - var(--o)) * 12px) 38px 38px calc((1 - var(--o)) * 12px)}
.duo-main .duo-screen{border-radius:calc((1 - var(--o)) * 6px) 31px 31px calc((1 - var(--o)) * 6px)}
.duo-main .duo-open-img{margin-left:-100%}
.duo-main .duo-closed-img{position:absolute;inset:0;width:100%;height:100%;margin:0;object-fit:cover;object-position:right top;opacity:clamp(0,calc(1 - var(--o) * 2.2),1)}
.duo-leaf{border-right:0;padding:5px 0 5px 5px;border-radius:38px 0 0 38px;transform-origin:right center;transform:rotateY(calc(180deg * (1 - var(--o))));backface-visibility:hidden}
.duo-leaf .duo-screen{border-radius:31px 0 0 31px}
.duo-leaf::after{content:"";position:absolute;inset:0;border-radius:inherit;background:linear-gradient(to left,#000b,#0000 75%);opacity:calc(1 - var(--o));pointer-events:none}

/* Evening: the open phone turns from sideways to tall, and the screen relays out for it. */
.duo-turn{width:calc(var(--duo-w) * .7036);--t:clamp(0,calc((var(--p,1) - .08) / .62),1)}
.duo-turn .duo-frame{transform:rotate(calc(-90deg * (1 - var(--t))))}
.duo-turn .duo-screen{border-radius:31px}
.duo-turn .duo-tall-img{opacity:clamp(0,calc((var(--t) - .55) / .3),1)}
.duo-turn .duo-side-img{position:absolute;left:50%;top:50%;max-width:none;width:calc((var(--duo-w) * .7036 - 14px) * 1.4212);height:calc(var(--duo-w) * .7036 - 14px);object-fit:cover;border-radius:31px;transform:translate(-50%,-50%) rotate(90deg);opacity:calc(1 - clamp(0,calc((var(--t) - .55) / .3),1))}

/* Meet Fairward and the gallery. Gallery cards share one height, as the device's screens nearly do.
   The gallery scrolls sideways, so it clips whatever falls outside it: on iPhone Duo it takes the
   section's bottom padding inside itself, leaving room for the larger cards' shadows. */
html[data-device=duo] .cities-section{padding-bottom:0}
html[data-device=duo] .screen-gallery{padding-bottom:160px}
@media(max-width:650px){html[data-device=duo] .screen-gallery{padding-bottom:110px}}
.about-duo{width:clamp(280px,30vw,420px);right:clamp(16px,4vw,64px)}
@media(max-width:800px){.about-duo{right:auto;margin:24px auto 0}}
.duo-card-closed{width:300px}.duo-card-side{width:605px}
@media(max-width:650px){.duo-card-closed{width:202px}.duo-card-side{width:403px}.duo-frame{border-radius:32px}.duo-frame img{border-radius:26px}.duo-frame-closed{border-radius:10px 32px 32px 10px}.duo-frame-closed img{border-radius:5px 26px 26px 5px}
 /* The screens inside the morning and evening phones follow the smaller frame corners. */
 .duo-rise .duo-screen{border-radius:5px 26px 26px 5px}.duo-turn .duo-screen,.duo-turn .duo-side-img{border-radius:26px}}
