/* Archivo (SIL Open Font License, see fonts/OFL.txt), served with the site so the page and the shared
   strip look the same on networks that block Google Fonts. One variable file per set of characters. */
@font-face {
    font-family: "Archivo";
    font-style: normal;
    font-weight: 400 800;
    font-stretch: 62% 125%;
    font-display: swap;
    src: url(fonts/archivo-vietnamese.woff2) format("woff2");
    unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB
}

@font-face {
    font-family: "Archivo";
    font-style: normal;
    font-weight: 400 800;
    font-stretch: 62% 125%;
    font-display: swap;
    src: url(fonts/archivo-latin-ext.woff2) format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF
}

@font-face {
    font-family: "Archivo";
    font-style: normal;
    font-weight: 400 800;
    font-stretch: 62% 125%;
    font-display: swap;
    src: url(fonts/archivo-latin.woff2) format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD
}

:root {
    --ink: #161412;
    --graphite: #3A3734;
    --cream: #EDE8E0;
    --paper: #FBF9F4;
    --sans: "Archivo",system-ui,-apple-system,sans-serif
}

* {
    box-sizing: border-box
}

html,body {
    margin: 0;
    height: 100%
}

body {
    overflow: hidden;
    font-family: var(--sans);
    color: var(--ink);
    -webkit-user-select: none;
    user-select: none;
    background: var(--cream)
}

button {
    font: inherit;
    color: inherit;
    cursor: pointer
}

button:focus-visible,canvas:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 4px
}

#page {
    position: relative;
    z-index: 1;
    height: 100vh;
    height: 100dvh;
    display: grid;
    grid-template-columns: minmax(0,1fr) auto minmax(0,1fr);
    justify-content: center;
    align-items: center;
    gap: clamp(24px,4vw,70px);
    padding: 20px clamp(20px,4vw,64px);
    transition: opacity .5s
}

.intro {
    display: flex;
    flex-direction: column;
    gap: 18px;
    align-self: center;
    justify-self: end;
    width: min(100%,330px);
    padding-bottom: 4vh
}

.brand {
    font-size: 13px;
    letter-spacing: .02em;
    color: #5a534c
}

h1 {
    margin: 0;
    font-stretch: 72%;
    font-weight: 800;
    font-size: clamp(38px,4.3vw,68px);
    line-height: .88;
    letter-spacing: -.01em;
    text-transform: uppercase
}

h1 .star {
    display: block;
    font-size: .95em;
    line-height: 1;
    margin-bottom: .12em
}

h1 .l {
    display: block;
    white-space: nowrap
}

h1.long {
    font-size: clamp(32px,3.5vw,54px)
}

.hg {
    display: inline-block;
    height: .8em;
    width: auto;
    vertical-align: -.08em;
    fill: currentColor
}

.sub {
    margin: 0;
    font-size: 15px;
    line-height: 1.5;
    color: #4a443e;
    max-width: 30ch
}

.sub:empty {
    display: none
}

.controls {
    display: flex;
    align-items: center;
    gap: 10px 12px;
    flex-wrap: wrap
}

.btn {
    border: 0;
    border-radius: 999px;
    padding: 13px 26px 12px;
    font-stretch: 80%;
    font-weight: 800;
    font-size: 17px;
    letter-spacing: .04em;
    text-transform: uppercase;
    background: var(--ink);
    color: #F6F2EA
}

.btn:active {
    transform: translateY(2px)
}

.btn[disabled] {
    opacity: .35;
    cursor: default
}

.btn.ghost {
    background: transparent;
    color: var(--ink);
    box-shadow: inset 0 0 0 1.5px var(--ink)
}

.btn.link {
    background: transparent;
    color: var(--ink);
    text-decoration: underline;
    text-underline-offset: 4px;
    padding-left: 6px;
    padding-right: 6px
}

.btn[hidden],#linkTxt[hidden] {
    display: none
}

#start .hg {
    height: .95em;
    margin-left: .2em;
    vertical-align: -.14em
}

#hint {
    font-size: 13px;
    color: #5a534c;
    min-height: 18px
}

#linkTxt {
    margin: 0;
    font-size: 13px;
    line-height: 1.4;
    color: #4a443e;
    word-break: break-all;
    -webkit-user-select: text;
    user-select: text;
    max-width: 36ch
}

/* the camera: one photo split down the middle, a city on each side */
.booth {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    height: 100%;
    justify-content: center;
    min-height: 0
}

/* the strip is the booth: 4 empty frames, the camera lives in the one you're on */
.stripwrap {
    filter: drop-shadow(0 12px 16px rgba(40,30,20,.2)) drop-shadow(0 1px 1px rgba(40,30,20,.24))
}

.bstrip {
    --sw: min(calc((100vh - 40px) / 1.995), 46vw);
    --sw: min(calc((100dvh - 40px) / 1.995), 46vw);
    width: var(--sw);
    padding: calc(var(--sw) * .055);
    display: flex;
    flex-direction: column;
    gap: calc(var(--sw) * .035);
    background: #F6F4EF;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .45 0 0 0 0 .4 0 0 0 .12 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E")
}

.slot {
    position: relative;
    aspect-ratio: 2/1;
    background: #141210;
    box-shadow: 0 0 0 1px rgba(20,18,16,.35);
    overflow: hidden
}

.slot>canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transition: filter 1.6s ease-out
}

.slot>canvas.fresh {
    filter: brightness(2.4) contrast(.25)
}

.frame {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: #1B1917;
    overflow: hidden
}

.frame[hidden] {
    display: none
}

.half {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 50%;
    overflow: hidden
}

.half.l {
    left: 0
}

.half.r {
    right: 0
}

.half video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
    filter: grayscale(1) contrast(1.2) brightness(.9);
    opacity: 0;
    transition: opacity .6s
}

.half.live video {
    opacity: 1
}

.half .still {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: none
}

.half.has-still .still {
    display: block
}

.half.has-still video {
    opacity: 0
}

.empty {
    position: absolute;
    inset: calc(var(--sw) * .03);
    border: 1.5px dashed rgba(244,239,230,.38);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0 4px calc(var(--sw) * .04);
    text-align: center;
    color: rgba(244,239,230,.82);
    font-size: clamp(10px,calc(var(--sw) * .045),13px);
    letter-spacing: .02em
}

.half.live .empty,.half.has-still .empty {
    display: none
}

.waiting .half.r .empty {
    animation: breathe 2.4s ease-in-out infinite
}

@keyframes breathe {
    50% {
        opacity: .4
    }
}

.seam {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    margin-left: -1px;
    background: rgba(246,242,234,.5);
    z-index: 2;
    pointer-events: none
}

#grain {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: .12;
    mix-blend-mode: overlay;
    pointer-events: none;
    z-index: 3
}

.vig {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 3;
    background: radial-gradient(80% 75% at 50% 45%,rgba(0,0,0,0) 62%,rgba(30,15,5,.28) 100%)
}

#idle {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 30px;
    color: #F4EFE6;
    font-stretch: 72%;
    font-weight: 800;
    font-size: calc(var(--sw) * .09);
    line-height: .92;
    text-transform: uppercase;
    text-shadow: 0 2px 14px rgba(0,0,0,.45);
    pointer-events: none;
    transition: opacity .5s
}

#idle:empty,.live #idle {
    opacity: 0
}

#count {
    position: absolute;
    right: 8px;
    top: 6px;
    z-index: 5;
    font-stretch: 72%;
    font-weight: 800;
    font-size: clamp(12px,calc(var(--sw) * .07),20px);
    color: rgba(255,255,255,.85);
    opacity: 0;
    transition: opacity .3s
}

.live #count {
    opacity: 1
}

#bar {
    position: absolute;
    left: 0;
    bottom: 0;
    z-index: 5;
    height: 3px;
    width: 0;
    background: #F6F2EA;
    opacity: 0
}

.live #bar {
    opacity: .9
}

#big {
    position: absolute;
    inset: 0;
    z-index: 6;
    display: grid;
    place-items: center;
    font-stretch: 72%;
    font-weight: 800;
    font-size: calc(var(--sw) * .42);
    color: #fff;
    opacity: 0;
    pointer-events: none;
    text-shadow: 0 6px 30px rgba(0,0,0,.5)
}

#big.pop {
    animation: pop .78s ease-out
}

@keyframes pop {
    0% {
        opacity: 0;
        transform: scale(1.25)
    }

    22% {
        opacity: 1;
        transform: scale(1)
    }

    78% {
        opacity: 1
    }

    100% {
        opacity: 0
    }
}

#sflash {
    position: absolute;
    inset: 0;
    z-index: 7;
    background: #fff;
    opacity: 0;
    pointer-events: none
}

#sflash.go {
    animation: fl .45s ease-out
}

@keyframes fl {
    0% {
        opacity: 0
    }

    10% {
        opacity: 1
    }

    100% {
        opacity: 0
    }
}

#flash {
    position: fixed;
    inset: 0;
    z-index: 30;
    background: #FFFCF6;
    opacity: 0;
    pointer-events: none
}

#flash.go {
    animation: fl2 .5s ease-out
}

@keyframes fl2 {
    0% {
        opacity: 0
    }

    10% {
        opacity: .55
    }

    100% {
        opacity: 0
    }
}

/* the paper heart that folds across the middle */
#heartWrap,#heartGuide {
    position: absolute;
    left: 50%;
    top: calc(var(--hy,.6) * 100%);
    height: calc(var(--hs,.3) * 100%);
    aspect-ratio: 1;
    translate: -50% -50%;
    pointer-events: none
}

#heartGuide {
    top: calc(var(--gy,.6) * 100%);
    height: calc(var(--gs,.3) * 100%)
}

#heartWrap {
    translate: -50% -50%;
    z-index: 6;
    pointer-events: none;
    opacity: 0;
    transition: opacity .3s
}

#heartWrap.on {
    opacity: 1
}

#heartGuide {
    z-index: 5;
    opacity: 0;
    transition: opacity .25s;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,.5))
}

#heartGuide.on {
    opacity: 1
}

#heartGuide svg {
    width: 100%;
    height: 100%;
    overflow: visible
}

#heartC {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: none;
    filter: drop-shadow(0 6px 8px rgba(0,0,0,.3))
}

#heartWrap.vid #heartC {
    display: block
}

#heartWrap.vid .ph {
    display: none
}

.ph {
    position: absolute;
    inset: 0;
    perspective: 700px;
    filter: drop-shadow(0 6px 8px rgba(0,0,0,.35))
}

.ph svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible
}

.ph .hr {
    transform-origin: 50% 50%
}

#heartWrap.on .ph .hr {
    animation: fold 1.25s cubic-bezier(.65,0,.3,1) .3s forwards
}

@keyframes fold {
    0% {
        transform: rotateY(0);
        filter: brightness(1)
    }

    50% {
        filter: brightness(.7)
    }

    100% {
        transform: rotateY(-180deg);
        filter: brightness(1.1)
    }
}

.side {
    justify-self: start;
    align-self: center;
    width: min(100%,320px)
}

.track {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    width: 100%
}

.track.hide {
    display: none
}

.tl {
    font-stretch: 72%;
    font-weight: 800;
    font-size: clamp(26px,2.8vw,44px);
    line-height: 1;
    text-transform: uppercase;
    text-align: left;
    max-width: 100%
}

.segs {
    display: flex;
    gap: 6px;
    width: min(100%,260px)
}

.segs i {
    flex: 1;
    height: 9px;
    border-radius: 5px;
    background: rgba(22,20,18,.13);
    overflow: hidden
}

.segs i b {
    display: block;
    height: 100%;
    width: 0;
    background: var(--ink)
}

/* results */
#results {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: minmax(220px,1fr) auto minmax(220px,1fr);
    align-items: center;
    gap: clamp(24px,4vw,70px);
    padding: 28px clamp(20px,4vw,64px);
    opacity: 0;
    transition: opacity .6s;
    background: #EDE8E0;
    color: var(--ink)
}

body.done #page {
    opacity: 0;
    pointer-events: none
}

#results.show {
    opacity: 1
}

#results[hidden] {
    display: none
}

.rl {
    display: flex;
    flex-direction: column;
    gap: 20px
}

.rl h2 .l {
    display: block
}

.rl h2 {
    margin: 0;
    font-stretch: 72%;
    font-weight: 800;
    font-size: clamp(46px,5.4vw,84px);
    line-height: .88;
    text-transform: uppercase
}

.acts {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    transition: opacity .6s
}

.acts button {
    border: 0;
    border-radius: 999px;
    padding: 12px 22px 11px;
    font-stretch: 80%;
    font-weight: 800;
    font-size: 15px;
    letter-spacing: .04em;
    text-transform: uppercase
}

#shareBtn {
    background: var(--ink);
    color: #F6F2EA
}

#saveBtn,#resendBtn {
    background: transparent;
    box-shadow: inset 0 0 0 1.5px var(--ink)
}

#againBtn {
    background: transparent;
    text-decoration: underline;
    text-underline-offset: 4px;
    padding-left: 8px;
    padding-right: 8px
}

#resendBtn[hidden] {
    display: none
}

#shareNote {
    font-size: 13px;
    color: #4a443e;
    min-height: 18px
}

.pnote {
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
    color: #4a443e;
    min-height: 20px
}

#results:not(.printed) .acts {
    opacity: 0;
    pointer-events: none
}

/* the print slot and tray */
.pair {
    position: relative;
    height: min(84vh,calc(100vh - 60px));
    display: flex;
    align-items: center;
    justify-content: center
}

.stage {
    position: relative;
    height: 100%;
    aspect-ratio: .52;
    container-type: size
}

.plate {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 12.5cqh;
    border-radius: 1.4cqh;
    z-index: 1;
    background: repeating-linear-gradient(90deg,rgba(255,255,255,.08) 0 .12cqh,rgba(0,0,0,.035) .12cqh .26cqh,transparent .26cqh .52cqh), linear-gradient(180deg,#F7F8F9 0%,#DCDFE2 34%,#C3C7CB 60%,#E2E4E6 80%,#B4B9BE 100%);
    box-shadow: inset 0 .15cqh 0 rgba(255,255,255,.95),inset 0 -.2cqh 0 rgba(0,0,0,.2),0 .25cqh .4cqh rgba(40,30,20,.16),0 1.6cqh 3cqh rgba(40,30,20,.13)
}

.slit {
    position: absolute;
    left: 50%;
    top: 6.4cqh;
    width: 36cqh;
    height: 1.5cqh;
    translate: -50% 0;
    border-radius: .75cqh;
    background: linear-gradient(180deg,#09090a,#222426 70%,#3a3d40);
    box-shadow: inset 0 .25cqh .4cqh rgba(0,0,0,.85),0 .14cqh 0 rgba(255,255,255,.9),0 -.1cqh 0 rgba(0,0,0,.22)
}

.mark {
    position: absolute;
    left: 4.4cqh;
    top: 6.05cqh;
    font-size: 1.6cqh;
    font-weight: 500;
    letter-spacing: .03em;
    color: #868B91;
    text-shadow: 0 .1cqh 0 rgba(255,255,255,.9)
}

.led {
    position: absolute;
    right: 4.6cqh;
    top: 6.6cqh;
    width: 1.1cqh;
    height: 1.1cqh;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 35%,#d9dcde,#8d9297);
    box-shadow: inset 0 .1cqh .2cqh rgba(0,0,0,.4)
}

.printing .led {
    background: radial-gradient(circle at 40% 35%,#fff,#dcf6e5 45%,#86d6a0);
    box-shadow: 0 0 .9cqh .25cqh rgba(140,230,170,.55);
    animation: led 1.1s ease-in-out infinite
}

@keyframes led {
    50% {
        opacity: .45
    }
}

.screw {
    position: absolute;
    top: 50%;
    width: 1.3cqh;
    height: 1.3cqh;
    margin-top: -.65cqh;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%,#fff,#b8bdc2 55%,#858b91);
    box-shadow: inset 0 0 0 .08cqh rgba(0,0,0,.22)
}

.screw::after {
    content: "";
    position: absolute;
    left: 18%;
    right: 18%;
    top: 50%;
    height: .16cqh;
    margin-top: -.08cqh;
    background: rgba(0,0,0,.35);
    rotate: 35deg
}

.feed {
    position: absolute;
    left: 0;
    right: 0;
    top: 7.15cqh;
    bottom: 0;
    overflow: hidden;
    z-index: 2
}

.feed canvas {
    position: absolute;
    top: 0;
    height: 63cqh;
    width: auto;
    transform: translate(0,-63cqh);
    transform-origin: 50% 100%;
    visibility: hidden;
    cursor: wait;
    filter: brightness(1) contrast(1) drop-shadow(0 .6cqh .9cqh rgba(30,30,30,.2));
    transition: translate .3s cubic-bezier(.2,.7,.3,1)
}

.feed canvas.landed {
    cursor: zoom-in
}

.feed canvas.landed:hover,.feed canvas.landed:focus-visible {
    translate: 0 -3cqh;
    z-index: 2
}

.rod {
    position: absolute;
    top: 5cqh;
    bottom: 6cqh;
    width: 1.5cqh;
    z-index: 0;
    border-radius: .75cqh;
    background: linear-gradient(90deg,#7b8187,#F7F8F9 34%,#C6CACE 56%,#868C92 100%);
    box-shadow: .6cqh 1.2cqh 1.6cqh rgba(40,30,20,.14)
}

.rod.l {
    left: 3.6cqh
}

.rod.r {
    right: 3.6cqh
}

.base {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2.6cqh;
    border-radius: 1.3cqh;
    z-index: 3;
    background: repeating-linear-gradient(90deg,rgba(255,255,255,.07) 0 .12cqh,rgba(0,0,0,.032) .12cqh .26cqh,transparent .26cqh .52cqh),linear-gradient(90deg,rgba(255,255,255,0) 8%,rgba(255,255,255,.42) 24%,rgba(255,255,255,0) 38%,rgba(0,0,0,.05) 82%),linear-gradient(180deg,#F4F5F6 0%,#D7DADD 38%,#C7CBCF 74%,#B4B9BE 100%);
    box-shadow: inset 0 .18cqh 0 #fff,0 .3cqh .4cqh rgba(40,30,20,.18),0 1.4cqh 2.4cqh rgba(40,30,20,.2)
}

.tray-back {
    position: absolute;
    left: 3cqh;
    right: 3cqh;
    top: 84cqh;
    height: 9cqh;
    z-index: 1;
    border-radius: 1.2cqh 1.2cqh .6cqh .6cqh;
    background: linear-gradient(180deg,#A5AAAF 0,#62666A 16%,#3A3D40 100%);
    box-shadow: inset 0 .16cqh 0 rgba(255,255,255,.8)
}

.tray-front {
    position: absolute;
    left: 2cqh;
    right: 2cqh;
    bottom: 2cqh;
    height: 11cqh;
    z-index: 3;
    border-radius: .5cqh .5cqh 2.2cqh 2.2cqh;
    background: repeating-linear-gradient(90deg,rgba(255,255,255,.07) 0 .12cqh,rgba(0,0,0,.03) .12cqh .26cqh,transparent .26cqh .52cqh), linear-gradient(90deg,rgba(255,255,255,0) 8%,rgba(255,255,255,.5) 30%,rgba(255,255,255,0) 44%), linear-gradient(180deg,#F5F6F7 0,#D6D9DC 12%,#C0C4C8 58%,#A6ABB0 100%);
    box-shadow: inset 0 .22cqh 0 #fff,inset 0 .55cqh 0 rgba(0,0,0,.06),inset 0 -.3cqh .35cqh rgba(0,0,0,.18),0 .3cqh .4cqh rgba(40,30,20,.12)
}

#light {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 28px;
    padding: 24px;
    background: rgba(237,232,224,.97);
    color: var(--ink);
    opacity: 0;
    transition: opacity .3s
}

#light.show {
    opacity: 1
}

#light[hidden] {
    display: none
}

#lightC {
    height: calc(100vh - 48px);
    height: calc(100dvh - 48px);
    width: auto;
    max-width: 80vw;
    filter: drop-shadow(0 20px 26px rgba(40,30,20,.28));
    cursor: zoom-out
}

.lacts {
    display: flex;
    flex-direction: column;
    gap: 10px
}

.lacts button {
    border: 0;
    border-radius: 999px;
    padding: 12px 22px 11px;
    font-stretch: 80%;
    font-weight: 800;
    font-size: 15px;
    letter-spacing: .04em;
    text-transform: uppercase;
    white-space: nowrap
}

#lightSave {
    background: var(--ink);
    color: #F6F2EA
}

#lightClose {
    background: transparent;
    box-shadow: inset 0 0 0 1.5px var(--ink)
}

/* connection lost: shown until the booth server answers again */
#net {
    position: fixed;
    left: 12px;
    bottom: max(10px, env(safe-area-inset-bottom));
    z-index: 50;
    font-size: 12px;
    color: #5a534c;
    background: rgba(251,249,244,.85);
    padding: 6px 10px;
    border-radius: 999px;
    box-shadow: inset 0 0 0 1px rgba(22,20,18,.15)
}

#net[hidden] {
    display: none
}

@media (max-width: 860px), (max-aspect-ratio:1/1) {
    #light {
        flex-direction:column;
        gap: 14px
    }

    #lightC {
        height: calc(100dvh - 130px)
    }

    .lacts {
        flex-direction: row
    }

    #results {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
        gap: 12px;
        padding: 16px 16px 14px;
        align-items: stretch
    }

    #page {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        gap: 12px;
        padding: 16px 16px 14px;
        align-content: start;
        align-items: stretch
    }

    .intro {
        gap: 10px;
        padding: 0;
        justify-self: stretch;
        width: auto
    }

    h1,h1.long {
        font-size: 24px;
        line-height: .95
    }

    h1 .l {
        display: inline;
        margin-right: .25em;
        white-space: normal
    }

    h1 .star {
        display: inline;
        margin: 0 6px 0 0
    }

    .brand {
        display: none
    }

    .sub {
        font-size: 13px;
        max-width: none
    }

    .btn {
        padding: 11px 20px 10px;
        font-size: 15px
    }

    .bstrip {
        --sw: min(calc((100dvh - 230px) / 1.995), 86vw)
    }

    .booth {
        justify-content: flex-start
    }

    .side {
        justify-self: stretch;
        width: auto
    }

    .track {
        align-items: center
    }

    .tl {
        text-align: center;
        font-size: 22px
    }

    .tl {
        font-size: 22px
    }

    .booth {
        gap: 10px;
        justify-content: flex-start
    }

    #results {
        grid-template-rows: auto 1fr
    }

    .rl {
        flex-direction: column;
        gap: 10px
    }

    .rl h2 {
        font-size: 28px
    }

    .rl h2 .l {
        display: inline;
        margin-right: .25em
    }

    .pair {
        height: auto;
        justify-content: center;
        min-height: 0;
        align-self: stretch;
        padding-bottom: 4px
    }

    .stage {
        height: min(100%,calc((100vw - 32px) / .52))
    }
}

@media (max-height: 560px) and (min-aspect-ratio:1/1) {
    .sub,.brand {
        display:none
    }

    h1 {
        font-size: 40px
    }
}

@media (prefers-reduced-motion:reduce) {
    * {
        animation-duration: .01ms!important;
        transition: none!important
    }
}

/* ---------- added for the two-step booth ---------- */
/* the print plate's screws (were inline styles; moved here so the page can run under a strict CSP) */
.screw.sl {
    left: 1.6cqh
}

.screw.sr {
    right: 1.6cqh;
    left: auto
}

#start .lbl {
    pointer-events: none
}

/* "someone's in there": try again is the quiet choice next to starting over here */
#start.link .hg {
    display: none
}

/* the heart video's source: in the page so phones decode it, but never seen (the booth draws it on a canvas) */
video.heartsrc {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 2px;
    height: 2px;
    opacity: .01;
    pointer-events: none;
    z-index: -1
}

/* a rear camera isn't a mirror */
.rear .half video {
    transform: none
}

/* review: every photo on the strip is a button that retakes just that one */
.bstrip.review .slot {
    cursor: pointer
}

.bstrip.review .slot::after {
    content: "\21BA  retake";
    position: absolute;
    bottom: calc(var(--sw) * .025);
    right: calc(var(--sw) * .025);
    z-index: 2;
    padding: .4em .85em .35em;
    border-radius: 999px;
    font-size: clamp(9px,calc(var(--sw) * .032),12px);
    font-weight: 800;
    font-stretch: 80%;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: #F6F2EA;
    background: rgba(22,20,18,.74);
    box-shadow: 0 0 0 1px rgba(246,242,234,.22);
    pointer-events: none;
    opacity: .82;
    transition: opacity .2s, transform .2s
}

.bstrip.review.me-l .slot::after {
    right: auto;
    left: calc(var(--sw) * .025)
}

.bstrip.review .slot:hover::after,.bstrip.review .slot:focus-visible::after {
    opacity: 1;
    transform: translateY(-1px)
}

.bstrip.review .slot:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 3px
}

/* phones with notches and home bars (the viewport already asks for viewport-fit=cover) */
#page {
    padding-top: max(20px, env(safe-area-inset-top));
    padding-bottom: max(20px, env(safe-area-inset-bottom));
    padding-left: max(clamp(20px,4vw,64px), env(safe-area-inset-left));
    padding-right: max(clamp(20px,4vw,64px), env(safe-area-inset-right))
}

#results {
    padding-top: max(28px, env(safe-area-inset-top));
    padding-bottom: max(28px, env(safe-area-inset-bottom));
    padding-left: max(clamp(20px,4vw,64px), env(safe-area-inset-left));
    padding-right: max(clamp(20px,4vw,64px), env(safe-area-inset-right))
}

@media (max-width: 860px), (max-aspect-ratio:1/1) {
    #page,#results {
        padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left))
    }

    /* never cut anything off on a short phone: scroll instead */
    #page {
        overflow-y: auto;
        overscroll-behavior: contain
    }

    #linkTxt {
        max-width: none
    }
}
