/* The Blubs landing page (/blubs and /sv/blubs). Colours are the game's own palette (co-up/palette.gd):
   each band of the page is one zone of the mountain, in the order you climb them. */
@font-face {
    font-family: 'Fredoka';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url(fredoka-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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Fredoka';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url(fredoka-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: #16282b;
    --cream: #fff4dc;
    --paper: #f6ebd0;
    --mint: #b9d9cf;
    --sky-high: #86b9c2;
    --pine: #1d3a3b;
    --pine-light: #2b5653;
    --pine-deep: #142a2c;
    --moss: #e2b33c;
    --moss-light: #f3cf6b;
    --coral: #ee6352;
    --blue: #3f7fd9;
    --wood: #e9cf9c;
    --wood-dark: #c4a064;
    --u: 2.2px;          /* one Blub unit: a Blub is 40 wide and 60 tall */
    --ground: 104px;
    --pad: clamp(20px, 5vw, 72px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--pine-deep);
    color: var(--ink);
    font-family: 'Fredoka', 'Avenir Next', 'Trebuchet MS', sans-serif;
    font-size: 19px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
a { color: inherit; }
img, video { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 var(--pad); }

/* ---------- top bar ---------- */
.top {
    position: absolute; z-index: 5; top: 0; left: 0; right: 0;
    display: flex; align-items: center; justify-content: space-between;
    padding: 22px var(--pad);
}
.mark { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 700; font-size: 22px; letter-spacing: .2em; color: var(--pine); }
.mark img { width: 44px; height: 44px; border-radius: 11px; box-shadow: 0 3px 0 rgba(22, 40, 43, .18); }
.lang {
    text-decoration: none; font-weight: 600; font-size: 16px; color: var(--pine);
    padding: 8px 16px; border-radius: 999px; background: rgba(255, 244, 220, .6);
}
.lang:hover { background: var(--cream); }

/* ---------- hero: the Chasm ---------- */
.hero {
    position: relative; overflow: hidden;
    min-height: max(100svh, 840px);
    display: flex; align-items: center;
    padding: 110px 0 calc(var(--ground) + 120px);
    background: linear-gradient(180deg, var(--sky-high) 0%, var(--mint) 46%, var(--paper) 100%);
}
.sun {
    position: absolute; left: 52%; top: 21%; width: 210px; height: 210px; border-radius: 50%;
    background: #fff8e6; box-shadow: 0 0 0 54px rgba(255, 248, 230, .22), 0 0 0 57px rgba(255, 248, 230, .5);
}
.cloud { position: absolute; width: 300px; height: 150px; opacity: .5; animation: drift 80s linear infinite alternate; }
.cloud::before, .cloud::after, .cloud i { content: ""; position: absolute; background: #eef4e6; border-radius: 40px; }
.cloud::before { left: 0; bottom: 0; width: 100%; height: 56%; }
.cloud::after { left: 24%; bottom: 34%; width: 52%; height: 50%; }
.cloud i { left: 46%; bottom: 60%; width: 34%; height: 40%; }
.cloud.c1 { left: 4%; top: 13%; }
.cloud.c2 { right: -3%; top: 9%; transform: scale(1.3); animation-duration: 110s; animation-direction: alternate-reverse; }
.cloud.c3 { left: 30%; top: 56%; transform: scale(.8); opacity: .35; animation-duration: 95s; }
@keyframes drift { from { margin-left: -40px; } to { margin-left: 60px; } }
.ridges { position: absolute; left: 0; right: 0; bottom: var(--ground); width: 100%; height: 44%; }

.hero-grid {
    position: relative; z-index: 2;
    display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); align-items: center; gap: 40px;
}
h1 {
    font-size: clamp(60px, 9.4vw, 132px); font-weight: 700; line-height: .9; letter-spacing: -.02em; color: var(--ink);
}
h1 em, h2 em { font-style: normal; color: var(--accent, var(--coral)); }
h1 em { display: block; }
html[lang="sv"] h1 { font-size: clamp(52px, 7.2vw, 104px); }   /* "tillsammans" is a long word */
.lead { margin-top: 26px; max-width: 26em; font-size: clamp(20px, 2vw, 25px); font-weight: 500; color: var(--pine-light); }
.stores { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }
.store {
    display: inline-flex; align-items: center; gap: 13px; text-decoration: none;
    padding: 12px 26px 12px 20px; border-radius: 20px;
    background: var(--ink); color: var(--cream);
    box-shadow: 0 6px 0 rgba(22, 40, 43, .28);
    transition: transform .12s ease, box-shadow .12s ease;
}
.store:hover { transform: translateY(-3px); box-shadow: 0 9px 0 rgba(22, 40, 43, .28); }
.store:active { transform: translateY(3px); box-shadow: 0 3px 0 rgba(22, 40, 43, .28); }
.store:focus-visible, .lang:focus-visible, .mark:focus-visible { outline: 3px solid var(--coral); outline-offset: 3px; }
.store svg { width: 30px; height: 30px; flex: none; }
.store span { display: flex; flex-direction: column; line-height: 1.1; font-weight: 600; font-size: 22px; }
.store small { font-size: 13px; font-weight: 500; opacity: .75; }
.fine { margin-top: 20px; font-size: 16px; font-weight: 500; color: var(--pine-light); }

/* ---------- phones ---------- */
.phone {
    position: relative; margin: 0 auto;
    border: 11px solid var(--ink); border-radius: 46px; background: var(--ink);
    box-shadow: 0 26px 0 -8px rgba(22, 40, 43, .16), 0 30px 60px rgba(22, 40, 43, .28);
}
.phone > img, .phone > video { width: 100%; height: 100%; object-fit: cover; border-radius: 35px; }
.phone::after { /* camera island */
    content: ""; position: absolute; left: 50%; top: 12px; width: 26%; height: 20px; margin-left: -13%;
    background: var(--ink); border-radius: 12px;
}
.phone.play { height: min(540px, 56svh); min-height: 400px; aspect-ratio: 9 / 16; }
.phone.shot { width: min(300px, 70vw); aspect-ratio: 1320 / 2868; }
.hero-phone { position: relative; justify-self: center; }
.hero-phone .blub { position: absolute; left: 50%; bottom: calc(100% - 2 * var(--u) - 3px); margin-left: calc(-56 * var(--u)); --u: 1.9px; }

/* ---------- the ground and the Blubs on it ---------- */
.ground {
    position: absolute; z-index: 3; left: 0; right: 0; bottom: 0; height: var(--ground);
    background: var(--pine); border-top: 9px solid var(--moss);
}
.ground::before { /* the lighter rim of moss, as on the platforms in the game */
    content: ""; position: absolute; left: 0; right: 0; top: -9px; height: 3px; background: var(--moss-light);
}
.blub { display: inline-block; width: calc(112 * var(--u)); height: calc(76 * var(--u)); vertical-align: bottom; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.blub svg { display: block; width: 100%; height: 100%; overflow: visible; transform-origin: 50% 97%; }
.blub.hop svg { animation: hop .62s cubic-bezier(.3, 0, .4, 1); }
@keyframes hop {
    0% { transform: scale(1.12, .86); }
    18% { transform: translateY(-8%) scale(.92, 1.1); }
    48% { transform: translateY(-46%) scale(1, 1); }
    82% { transform: translateY(0) scale(.94, 1.06); }
    90% { transform: scale(1.14, .84); }
    100% { transform: none; }
}
.on-ground { position: absolute; bottom: calc(100% - 2 * var(--u) + 2px); }
.tower { display: flex; flex-direction: column-reverse; align-items: center; }
.tower .blub + .blub { margin-bottom: calc(-16 * var(--u)); }
.hero .solo { left: max(-40px, calc(50% - 700px)); }
.hero .tower { right: max(2%, calc(50% - 640px)); }

/* ---------- feature bands, one per zone ---------- */
.feat { position: relative; overflow: hidden; padding: clamp(72px, 10vw, 130px) 0; color: var(--text, var(--ink)); background: var(--sky); }
.feat-grid { position: relative; z-index: 2; display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: clamp(32px, 6vw, 90px); }
.feat.flip .feat-copy { order: -1; }
.feat-copy { max-width: 470px; }
.feat.flip .feat-copy { justify-self: end; }
h2 { font-size: clamp(40px, 5.4vw, 70px); font-weight: 700; line-height: .98; letter-spacing: -.015em; }
.feat-copy p { margin-top: 20px; font-size: clamp(19px, 1.8vw, 23px); font-weight: 500; color: var(--sub, var(--pine-light)); }
.perch { position: relative; margin-top: 46px; width: calc(112 * var(--u)); }
.perch .blub { margin-bottom: calc(-2 * var(--u) - 1px); }
.perch::after { /* a plank to stand on */
    content: ""; display: block; height: 16px; margin: 0 -22px; border-radius: 8px;
    background: var(--plank, var(--wood)); box-shadow: inset 0 -6px 0 var(--plank-dark, var(--wood-dark));
}

.z-chasm { --sky: linear-gradient(180deg, var(--paper), #d9e6d2 60%, var(--mint)); --accent: var(--coral); }
.z-machine { --sky: linear-gradient(180deg, #eddcbc, #cdbda4 55%, #a6998a); --accent: #8d4a30; --sub: #4d3834; --plank: #e2b33c; --plank-dark: #a87c22; }
.z-clouds { --sky: linear-gradient(180deg, #fbe9e3, #cbd5f0 55%, #9fbfe8); --accent: var(--blue); --sub: #424c72; --plank: #f3e4c6; --plank-dark: #cbb18a; }
.z-night { --sky: linear-gradient(180deg, #9fbfe8 0, var(--pine-light) 16%, var(--pine) 55%, var(--pine-deep)); --text: var(--cream); --accent: var(--moss-light); --sub: rgba(255, 244, 220, .8); }
.z-own { --sky: linear-gradient(180deg, var(--pine-deep) 0, #f3c9a8 14%, #fbe4c8 60%, var(--paper)); --accent: var(--coral); }
.z-night .phone, .z-own .phone { box-shadow: 0 30px 60px rgba(0, 0, 0, .3); }

.gear { position: absolute; z-index: 1; color: #8c7a66; opacity: .38; animation: spin 90s linear infinite; }
.gear svg { display: block; width: 100%; height: 100%; }
.gear.g1 { width: 520px; height: 520px; left: -170px; bottom: -190px; }
.gear.g2 { width: 300px; height: 300px; right: 6%; top: -90px; animation-duration: 52s; animation-direction: reverse; color: #6a5a4c; opacity: .26; }
@keyframes spin { to { transform: rotate(360deg); } }

.puff { position: absolute; z-index: 1; bottom: -70px; width: 460px; height: 190px; background: #fffaf3; border-radius: 100px; opacity: .85; }
.puff::before { content: ""; position: absolute; left: 22%; bottom: 55%; width: 46%; height: 70%; background: inherit; border-radius: 80px; }
.puff.p1 { left: -120px; }
.puff.p2 { right: -90px; bottom: -100px; transform: scale(1.25); }
.puff.p3 { left: 38%; bottom: -130px; opacity: .6; }

.stars { position: absolute; inset: 0; z-index: 1; opacity: .7;
    background-image:
        radial-gradient(circle, var(--cream) 0 1.6px, transparent 2px),
        radial-gradient(circle, var(--cream) 0 1.1px, transparent 1.6px),
        radial-gradient(circle, var(--moss-light) 0 1.8px, transparent 2.3px);
    background-size: 230px 190px, 150px 130px, 410px 330px;
    background-position: 20px 30px, 90px 80px, 170px 120px;
    -webkit-mask-image: linear-gradient(180deg, transparent 12%, #000 34%, #000 80%, transparent);
    mask-image: linear-gradient(180deg, transparent 12%, #000 34%, #000 80%, transparent);
}

/* ---------- the last band: facts, download, footer ---------- */
.end { position: relative; background: linear-gradient(180deg, var(--paper), var(--mint)); padding: clamp(70px, 9vw, 120px) 0 0; text-align: center; overflow: hidden; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; text-align: left; }
.fact { background: var(--cream); border-radius: 26px; padding: 28px 28px 30px; border-bottom: 8px solid var(--moss); box-shadow: 0 14px 30px rgba(22, 40, 43, .1); }
.fact h3 { font-size: 26px; font-weight: 700; line-height: 1.1; }
.fact p { margin-top: 10px; font-size: 18px; font-weight: 500; color: var(--pine-light); }
.end h2 { margin-top: clamp(70px, 9vw, 120px); }
.end .lead { margin: 18px auto 0; }
.get { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 30px 44px; margin-top: 38px; }
.get .stores { margin: 0; flex-direction: column; }
.qr { display: flex; align-items: center; gap: 18px; text-align: left; background: var(--cream); border-radius: 26px; padding: 16px 24px 16px 16px; box-shadow: 0 14px 30px rgba(22, 40, 43, .1); }
.qr img { width: 124px; height: 124px; }
.qr p { max-width: 9em; font-weight: 600; font-size: 19px; line-height: 1.2; }
.end-ground { position: relative; margin-top: calc(196 * var(--u) + 56px); background: var(--pine); border-top: 9px solid var(--moss); padding: 44px var(--pad) 40px; color: rgba(255, 244, 220, .8); font-size: 16px; font-weight: 500; }
.end-ground::before { content: ""; position: absolute; left: 0; right: 0; top: -9px; height: 3px; background: var(--moss-light); }
.end-ground .tower { left: 50%; transform: translateX(-50%); }
.end-ground nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 28px; }
.end-ground a { text-decoration: none; }
.end-ground a:hover { color: var(--cream); text-decoration: underline; }
.end-ground p { margin-top: 14px; opacity: .7; }

/* ---------- narrower windows ---------- */
@media (max-width: 1260px) {
    .hero .tower { display: none; }
}
@media (max-width: 860px) {
    :root { --u: 1.8px; --ground: 84px; }
    .hero { padding-top: 96px; }
    .hero-grid { grid-template-columns: 1fr; text-align: center; gap: calc(76 * 1.9px + 26px); }
    .lead { margin-left: auto; margin-right: auto; }
    .stores { justify-content: center; }
    .hero .solo { left: -30px; }
    .hero { padding-bottom: calc(var(--ground) + 150px); }
    .sun { left: 58%; top: 12%; width: 150px; height: 150px; }
    .feat-grid { grid-template-columns: 1fr; text-align: center; }
    .feat.flip .feat-copy { order: 0; }
    .feat-copy, .feat.flip .feat-copy { justify-self: center; }
    .perch { margin-left: auto; margin-right: auto; }
    .facts { grid-template-columns: 1fr; }
    .qr { display: none; }
    .get .stores { flex-direction: row; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .cloud, .gear, .blub.hop svg { animation: none; }
}
