/* fold.byek.games
 *
 * Light, warm and papery, because that is what the game is. The jox site is
 * dark and the hub is dark; this one is not, and that is deliberate - FOLD is
 * a sheet of paper on a table in the afternoon, and a black page would be
 * selling a different game.
 *
 * Everything here is the game's own: the palette is scripts/core/fold_palette.gd,
 * the paper and the cherry branch are the textures the app ships, and the wide
 * tracked uppercase is how the game sets every heading it has.
 */
:root {
    --ink: #38373a;
    --ink-soft: #6b6360;
    --ink-faint: #9b908a;
    --paper: #fbf3e9;
    --card: rgba(255, 253, 249, .72);
    --card-solid: #fffdf9;
    --line: rgba(117, 92, 80, .16);
    --line-soft: rgba(117, 92, 80, .09);

    --blossom: #d77e86;
    --blossom-soft: #f5c2bc;
    --blue: #8299bc;
    --blue-soft: #c5d8e9;
    --sage: #718f75;
    --gold: #c9a66a;
    --gold-soft: #f4dcad;
    --brown: #755c50;

    --radius: 24px;
    --shadow: 0 18px 40px -24px rgba(117, 92, 80, .55);
    --wrap: 1080px;
}

* { box-sizing: border-box; }

/* An <img> carrying width and height attributes gets BOTH as presentational
 * hints, so a stylesheet that sets only the width leaves the height where the
 * attribute put it and the picture comes out stretched. That is what made the
 * screenshots a thousand pixels tall and the cherry branch big enough to push
 * the page sideways - which is also why the centred column looked off-centre:
 * the document was wider than the window and scrolled. */
img { max-width: 100%; height: auto; }

/* clip rather than hidden: hidden on the body propagates to the viewport and
 * is unreliable on iOS, where the page can still be dragged sideways. */
html, body { overflow-x: clip; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    color: var(--ink);
    background: var(--paper);
    font: 16px/1.65 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* The paper the page is printed on: the game's own surface texture, held
 * still while the content moves over it. */
.surface {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: url(paper.jpg) center / cover no-repeat;
    opacity: .92;
}
.surface::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(70% 50% at 70% 0%, rgba(255, 255, 255, .55), transparent 70%),
        radial-gradient(60% 45% at 10% 100%, rgba(245, 194, 188, .2), transparent 70%);
}
.petals { position: fixed; inset: 0; z-index: 1; pointer-events: none; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; position: relative; z-index: 2; }

/* The branch, draped over the top right corner like a ribbon rather than
 * hung from the ceiling: turned towards the corner, large enough to be the
 * page's one ornament, and anchored so its weight stays up and to the right
 * of the words. It is clipped by the page rather than fitted into it, which
 * is what makes it read as something laid over the paper. */
.branch {
    position: absolute;
    top: -150px;
    right: -170px;
    width: min(760px, 62vw);
    height: auto;
    z-index: 0;
    pointer-events: none;
    user-select: none;
    opacity: .95;
    /* The tilt is a variable so the sway can breathe around whatever angle
     * the screen calls for: a wide page can afford the ribbon lying across
     * the corner, a narrow one needs it held up out of the heading. */
    --tilt: -14deg;
    transform: rotate(var(--tilt));
    transform-origin: 78% 10%;
    animation: sway 13s ease-in-out infinite;
}
@media (max-width: 899px) {
    .branch {
        top: -150px;
        right: -70px;
        width: min(340px, 74vw);
        opacity: .78;
        --tilt: -7deg;
    }
}
@keyframes sway {
    0%, 100% { transform: rotate(var(--tilt)); }
    50% { transform: rotate(calc(var(--tilt) - 1.4deg)); }
}

/* ---- top bar ---------------------------------------------------------- */

/* The links sit beside the wordmark rather than opposite it: the top right
 * corner belongs to the cherry branch, and a nav put there was read through
 * a blossom. */
.top {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px 30px;
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 26px 24px 0;
}
.top-logo img { width: 132px; height: auto; display: block; opacity: .75; }
.top-nav { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; }
/* On a narrow screen the links fill the width and the ribbon has nowhere to
 * hang. They are a convenience, not the only way through - the footer
 * carries all three and the page is one scroll - so the corner wins. */
@media (max-width: 680px) { .top-nav { display: none; } }
.top-link {
    color: var(--ink-soft);
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
}
.top-link:hover { color: var(--ink); }

/* ---- hero ------------------------------------------------------------- */

.hero { position: relative; padding: 40px 0 10px; }
/* One column of words. The folding sheet that used to stand beside them is
 * gone; the branch and the screenshots further down carry the picture. */
.hero-words { max-width: 36em; padding-bottom: 18px; }

.eyebrow {
    margin: 0 0 18px;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: .26em;
    text-transform: uppercase;
    color: var(--ink-faint);
}
.hero-mark { display: flex; align-items: center; gap: 18px; margin-bottom: 24px; }
.hero-mark img.app-icon {
    width: 68px; height: 68px;
    border-radius: 17px;
    box-shadow: var(--shadow);
}
.hero-mark .word {
    font-size: 25px;
    font-weight: 800;
    letter-spacing: .34em;
    text-indent: .34em;
    margin: 0;
    line-height: 1;
    color: var(--ink);
}
h1 {
    margin: 0;
    font-size: clamp(32px, 5.1vw, 52px);
    line-height: 1.08;
    letter-spacing: -.025em;
    font-weight: 750;
    max-width: 13em;
}
.lede { margin: 20px 0 0; font-size: 18.5px; color: var(--ink-soft); max-width: 30em; }
.story { margin: 14px 0 0; font-size: 16px; color: var(--ink-faint); max-width: 30em; }

/* ---- store badges ------------------------------------------------------ */

.store { margin-top: 34px; }
.soon-label {
    margin: 0 0 12px;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--blossom);
}
.badges { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.badge {
    display: inline-flex;
    text-decoration: none;
    border-radius: 10px;
    transition: transform .18s ease, filter .18s ease;
}
.badge:hover { transform: translateY(-2px); }
.badge .badge-bg { fill: var(--card-solid); stroke: var(--line); }
.badge .badge-ink { fill: var(--ink); }
.badge .badge-small { fill: var(--ink-soft); font-size: 9px; letter-spacing: .06em; font-family: inherit; }
.badge .badge-big { fill: var(--ink); font-size: 16px; font-weight: 700; font-family: inherit; }
.badge.is-soon { opacity: .62; cursor: default; }
.badge.is-soon:hover { transform: none; }
.testflight { display: inline-block; margin-top: 14px; color: var(--blue); font-size: 14px; }

/* ---- sections ---------------------------------------------------------- */

.section { position: relative; z-index: 2; padding: 96px 0 0; }
.kicker {
    margin: 0 0 12px;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: .24em;
    text-transform: uppercase;
    color: var(--ink-faint);
}
h2 {
    margin: 0;
    font-size: clamp(26px, 3.6vw, 38px);
    line-height: 1.14;
    letter-spacing: -.02em;
    font-weight: 750;
    max-width: 16em;
}
.section-lede { margin: 16px 0 0; color: var(--ink-soft); font-size: 17px; max-width: 34em; }
.note { margin: 22px 0 0; color: var(--ink-faint); font-size: 15px; max-width: 34em; }

.cards { display: grid; gap: 18px; margin-top: 34px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .cards.three { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 560px) { .cards.four { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .cards.four { grid-template-columns: repeat(4, 1fr); } }

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 26px 24px;
    backdrop-filter: blur(8px);
    box-shadow: var(--shadow);
}
.card h3 {
    margin: 18px 0 8px;
    font-size: 17px;
    font-weight: 750;
    letter-spacing: -.01em;
}
.card p { margin: 0; color: var(--ink-soft); font-size: 15px; }
.card .glyph { display: block; width: 72px; height: 72px; }

/* The four figures out of the pack itself. */
.figures { display: grid; gap: 18px; margin-top: 36px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 820px) { .figures { grid-template-columns: repeat(4, 1fr); } }
.figure {
    text-align: center;
    padding: 28px 16px;
    border-radius: var(--radius);
    background: var(--card);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}
.figure b {
    display: block;
    font-size: clamp(32px, 4.6vw, 46px);
    font-weight: 800;
    letter-spacing: -.03em;
    line-height: 1;
    color: var(--brown);
}
.figure span {
    display: block;
    margin-top: 10px;
    font-size: 12.5px;
    color: var(--ink-faint);
    letter-spacing: .04em;
}

/* ---- the list of things it does not do --------------------------------- */

.nots { margin: 30px 0 0; padding: 0; list-style: none; max-width: 36em; }
.nots li {
    position: relative;
    padding: 13px 0 13px 40px;
    border-bottom: 1px solid var(--line-soft);
    color: var(--ink-soft);
    font-size: 16.5px;
}
.nots li:last-child { border-bottom: 0; }
.nots li::before {
    content: "";
    position: absolute;
    left: 6px;
    top: 50%;
    width: 15px;
    height: 15px;
    margin-top: -7px;
    border-radius: 50%;
    border: 1.5px solid var(--blossom-soft);
    background: radial-gradient(circle at 50% 50%, rgba(215, 126, 134, .18), transparent 70%);
}

/* ---- screens ------------------------------------------------------------ */

.screens {
    display: flex;
    gap: 22px;
    margin-top: 38px;
    padding: 6px 24px 28px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}
.screens::-webkit-scrollbar { height: 6px; }
.screens::-webkit-scrollbar-thumb { background: var(--line); border-radius: 99px; }
.shot { flex: none; width: 232px; scroll-snap-align: center; text-align: center; }
.shot img {
    width: 100%;
    height: auto;
    border-radius: 26px;
    border: 1px solid var(--line);
    box-shadow: 0 26px 50px -28px rgba(117, 92, 80, .7);
    display: block;
}
.shot figcaption {
    margin-top: 12px;
    font-size: 12px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--ink-faint);
    font-weight: 700;
}

/* ---- the four gardens --------------------------------------------------- */

.beds { display: grid; gap: 14px; margin-top: 34px; }
.bed {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 20px 24px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--card);
    box-shadow: var(--shadow);
}
.bed .no {
    font-size: 30px;
    font-weight: 800;
    color: var(--gold);
    letter-spacing: -.03em;
    min-width: 54px;
}
.bed .name { font-weight: 750; letter-spacing: .1em; text-transform: uppercase; font-size: 14px; }
.bed .what { color: var(--ink-faint); font-size: 14.5px; margin-top: 2px; }
.bed .state {
    margin-left: auto;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(117, 92, 80, .08);
    color: var(--ink-faint);
    white-space: nowrap;
}
.bed.is-open .state { background: rgba(113, 143, 117, .16); color: var(--sage); }
.bed.is-soon { opacity: .72; }

/* ---- closing ------------------------------------------------------------ */

.closing {
    margin-top: 110px;
    padding: 64px 24px;
    text-align: center;
    border-top: 1px solid var(--line-soft);
}
.closing h2 { margin: 0 auto; max-width: 14em; }
.closing p { color: var(--ink-faint); margin: 16px 0 0; }
.closing .badges { justify-content: center; margin-top: 28px; }

footer {
    position: relative;
    z-index: 2;
    max-width: var(--wrap);
    margin: 40px auto 0;
    padding: 26px 24px 54px;
    border-top: 1px solid var(--line-soft);
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    align-items: center;
    color: var(--ink-faint);
    font-size: 13.5px;
}
footer a { color: var(--ink-faint); text-decoration: none; }
footer a:hover { color: var(--ink); text-decoration: underline; }
footer img { width: 92px; opacity: .5; }
footer .spacer { flex: 1 1 auto; }

/* ---- the music ---------------------------------------------------------
 *
 * The game's own two pieces, behind a switch in the corner. Off by default
 * and never autoplaying with sound: a page that starts singing at you is the
 * opposite of what this game is. The choice is remembered.
 */
.music {
    position: fixed;
    right: calc(18px + env(safe-area-inset-right));
    bottom: calc(18px + env(safe-area-inset-bottom));
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px 10px 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 253, 249, .82);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    color: var(--ink);
    font: inherit;
    text-align: left;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: transform .2s ease, background .2s ease, border-color .2s ease;
}
.music:hover { transform: translateY(-2px); border-color: rgba(117, 92, 80, .3); }
.music .eq { display: flex; align-items: flex-end; gap: 2.5px; width: 18px; height: 15px; }
.music .eq i {
    flex: 1;
    height: 28%;
    background: var(--blossom);
    border-radius: 1px;
    transform-origin: bottom;
    transition: height .3s;
}
.music[aria-pressed="true"] .eq i { animation: eq 1.3s ease-in-out infinite; }
.music[aria-pressed="true"] .eq i:nth-child(2) { animation-delay: -.3s; }
.music[aria-pressed="true"] .eq i:nth-child(3) { animation-delay: -.7s; }
.music[aria-pressed="true"] .eq i:nth-child(4) { animation-delay: -1s; }
@keyframes eq { 0%, 100% { height: 28%; } 50% { height: 100%; } }
.music-text { display: flex; flex-direction: column; line-height: 1.2; }
.music-title { font-size: 13px; font-weight: 700; letter-spacing: .01em; }
.music-sub { font-size: 11px; color: var(--ink-faint); }
@media (max-width: 480px) { .music-sub { display: none; } }

/* ---- the quiet arrival of each section ---------------------------------- */

.rise { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.rise.in { opacity: 1; transform: none; }
/* ?still=1 pins everything in its arrived state, so one headless capture
 * shows the page as a reader sees it rather than mid-transition. */
body.still .rise { opacity: 1; transform: none; transition: none; }
body.still .branch { animation: none; }

@media (prefers-reduced-motion: reduce) {
    .rise { opacity: 1; transform: none; transition: none; }
    .branch { animation: none; }
    .music[aria-pressed="true"] .eq i { animation: none; height: 70%; }
    html { scroll-behavior: auto; }
}

/* ---- the plain pages (privacy, terms, support) --------------------------- */

.doc { max-width: 42em; margin: 0 auto; padding: 60px 24px 90px; position: relative; z-index: 2; }
.doc h1 { font-size: clamp(28px, 4vw, 40px); max-width: none; }
.doc h2 { font-size: 19px; margin: 40px 0 10px; max-width: none; }
.doc p, .doc li { color: var(--ink-soft); font-size: 16.5px; }
.doc ul { padding-left: 20px; }
.doc a { color: var(--blue); }
.doc .back {
    display: inline-block;
    margin-bottom: 28px;
    font-size: 12px;
    letter-spacing: .16em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--ink-faint);
    text-decoration: none;
}
