*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    --bg: #ffffff;
    --ink: #111111;
}

html,
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    overflow-x: hidden;
}

.scroll-space {
    height: 1000vh;
}

.stage {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* a wordless "scroll" hint: a dot sliding down a short line */
.scroll-hint {
    position: fixed;
    left: 50%;
    bottom: 6vh;
    width: 1px;
    height: 2.6rem;
    margin-left: -0.5px;
    background: rgba(17, 17, 17, 0.18);
    pointer-events: none;
}

.scroll-hint::after {
    content: "";
    position: absolute;
    left: -2px;
    top: 0;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--ink);
    animation: hint 2s ease-in-out infinite;
}

@keyframes hint {
    0% { transform: translateY(0); opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { transform: translateY(2.3rem); opacity: 0; }
}

/* ---- the line ---- */

.ground {
    fill: var(--bg);
}

.thread-ghost {
    fill: none;
    stroke: var(--ink);
    stroke-opacity: 0.14;
}

.thread {
    fill: none;
    stroke: var(--ink);
    stroke-linecap: round;
}

/* ---- the two of us ---- */

.fig polyline,
.fig line {
    fill: none;
    stroke: var(--ink);
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.fig circle {
    fill: var(--ink);
}

.fig .far {
    stroke-opacity: 0.4;
}

.fig .hair {
    stroke-width: 2.6;
}

/* ---- scenery ---- */

.prop {
    fill: none;
    stroke: var(--ink);
    stroke-width: 1.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.prop-soft {
    stroke-opacity: 0.35;
}

.halo {
    fill: none;
    stroke: var(--ink);
    stroke-width: 1;
    stroke-dasharray: 1 5;
    stroke-linecap: round;
    stroke-opacity: 0.35;
}

.flame {
    fill: var(--ink);
    animation: flicker 0.9s ease-in-out infinite alternate;
    transform-box: fill-box;
    transform-origin: 50% 100%;
}

@keyframes flicker {
    0% { opacity: 0.7; transform: scale(0.9, 1); }
    100% { opacity: 1; transform: scale(1.05, 1.15); }
}

.steam {
    fill: none;
    stroke: var(--ink);
    stroke-width: 1;
    stroke-linecap: round;
    opacity: 0;
    animation: steam 2.6s ease-in-out infinite;
}

.steam:nth-of-type(2) { animation-delay: 1.3s; }

@keyframes steam {
    0% { opacity: 0; transform: translateY(4px); }
    40% { opacity: 0.5; }
    100% { opacity: 0; transform: translateY(-10px); }
}

.flag {
    fill: var(--ink);
    transform-box: fill-box;
    transform-origin: 0 50%;
    animation: wave 1.6s ease-in-out infinite alternate;
}

@keyframes wave {
    0% { transform: skewY(-6deg) scaleX(0.92); }
    100% { transform: skewY(6deg) scaleX(1); }
}

.sun circle {
    fill: var(--bg);
    stroke: var(--ink);
    stroke-width: 1.4;
}

.sun line {
    stroke: var(--ink);
    stroke-width: 1.4;
    stroke-linecap: round;
}

.ball {
    fill: var(--ink);
}

.pin {
    fill: var(--ink);
}

.burst line {
    stroke: var(--ink);
    stroke-width: 1.4;
    stroke-linecap: round;
}

@media (prefers-reduced-motion: reduce) {
    .flame,
    .steam,
    .flag,
    .scroll-hint::after {
        animation: none;
    }
}

/* ---- everyone else: faint, so the two of us stand out ---- */

.fig--other polyline,
.fig--other line {
    stroke-width: 1.8;
}

.fig--me polyline,
.fig--me line,
.fig--her polyline,
.fig--her line {
    stroke-width: 2.5;
}

.prop {
    stroke-opacity: 0.7;
}

.fill {
    fill: var(--ink);
    stroke: none;
}

.paper {
    fill: var(--bg);
}

.faint {
    opacity: 0.3;
}

.tile-us {
    stroke-width: 1.6;
}

.speaking {
    stroke-width: 2.6;
    stroke-opacity: 1;
}

.wave {
    fill: none;
    stroke: var(--ink);
    stroke-width: 1.2;
    stroke-linecap: round;
    stroke-opacity: 0.6;
}

.draw {
    fill: none;
    stroke: var(--ink);
    stroke-width: 1.3;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 1 1;
}

.snow {
    fill: var(--ink);
    opacity: 0.45;
    animation: snow var(--d, 4s) linear var(--delay, 0s) infinite;
}

@keyframes snow {
    0% { transform: translate(0, -20px); }
    50% { transform: translate(6px, 20px); }
    100% { transform: translate(0, 60px); }
}

.rain {
    stroke: var(--ink);
    stroke-width: 1;
    stroke-linecap: round;
    stroke-opacity: 0.35;
    animation: rain 0.7s linear var(--delay, 0s) infinite;
}

@keyframes rain {
    0% { transform: translate(0, -10px); opacity: 0; }
    30% { opacity: 1; }
    100% { transform: translate(-4px, 40px); opacity: 0; }
}

.bob {
    transform-box: fill-box;
    animation: bob 2.4s ease-in-out var(--delay, 0s) infinite alternate;
}

@keyframes bob {
    0% { transform: translateY(-3px) rotate(-3deg); }
    100% { transform: translateY(3px) rotate(3deg); }
}

@media (prefers-reduced-motion: reduce) {
    .snow,
    .rain,
    .bob {
        animation: none;
    }
}

/* the thread between us */
.tether {
    fill: none;
    stroke: var(--ink);
    stroke-linecap: round;
}

/* place names, on their signs */
.sign {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 9.5px;
    letter-spacing: 2.2px;
    fill: var(--ink);
}

/* ---- the ending ---- */

.strand {
    fill: none;
    stroke: var(--ink);
    stroke-width: 0.9;
    stroke-linecap: round;
}

.beckon {
    fill: none;
    stroke: var(--ink);
    stroke-width: 1;
    transform-box: fill-box;
    transform-origin: center;
    animation: beckon 1.8s ease-out infinite;
}

@keyframes beckon {
    0% { transform: scale(0.4); opacity: 0.7; }
    100% { transform: scale(1.6); opacity: 0; }
}

body.can-tap {
    cursor: pointer;
}

html.locked,
html.locked body {
    overflow: hidden;
}

.fade-white {
    position: fixed;
    inset: 0;
    background: var(--bg);
    opacity: 0;
    pointer-events: none;
}

.letter-overlay {
    position: fixed;
    inset: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    opacity: 0;
    pointer-events: none;
    transition: opacity 2.4s ease;
}

.letter-overlay.on {
    opacity: 1;
    pointer-events: auto;
}

.letter-overlay.on.over-scene {
    background: rgba(255, 255, 255, 0.94);
}

.letter {
    display: none;
    width: min(34rem, calc(100% - 3rem));
    margin: 0 auto;
    padding: 18vh 0 22vh;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.05rem, 2.4vw, 1.25rem);
    line-height: 1.85;
    color: var(--ink);
}

.letter.on {
    display: block;
}

.letter p {
    margin: 0 0 1.4em;
    opacity: 0;
    filter: blur(6px);
    transform: translateY(8px);
    transition: opacity 1.6s ease, filter 1.6s ease, transform 1.6s ease;
}

.letter.reveal p {
    opacity: 1;
    filter: blur(0);
    transform: none;
}

.letter .sign-off {
    margin-top: 2.4em;
    font-style: italic;
    font-size: 1.35em;
    text-align: right;
}

@media (prefers-reduced-motion: reduce) {
    .beckon {
        animation: none;
    }
}

/* the only instruction on the page, at the choice */
.choice-hint {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 9vh;
    margin: 0;
    text-align: center;
    font-family: Georgia, "Times New Roman", serif;
    font-style: italic;
    font-size: clamp(0.95rem, 2.2vw, 1.1rem);
    letter-spacing: 0.04em;
    color: var(--ink);
    opacity: 0;
    transition: opacity 1.4s ease;
    pointer-events: none;
}

.choice-hint.show {
    opacity: 0.62;
}

/* the one touch of colour: blushing */
.blush {
    fill: none;
    stroke: #d2504a;
    stroke-width: 1.3;
    stroke-linecap: round;
}
