/* Blockosaurus site. Colours are the game's own (Assets/Blockosaurus/UI/Game.uss).
   The home page animates with GSAP (site.js); without scripts, or with reduced motion, it is a plain page. */

@font-face {
    font-family: "Lilita One";
    src: url("LilitaOne-Regular.ttf") format("truetype");
    font-display: swap;
}

:root {
    --green: #5EC544;
    --green-dark: #3A962B;
    --yellow: #FFC83A;
    --yellow-dark: #DE9610;
    --coral: #FF7B5E;
    --cream: #FFF5E1;
    --cream-dark: #D6C39F;
    --ink: #343A6B;
    --panel: #1E2348;
    --sky-top: #7CCBF5;
    --sky-mid: #BFE7FB;
    --text: #2A2F57;
    --muted: #5B618C;
    --display: "Lilita One", "Arial Rounded MT Bold", "Trebuchet MS", system-ui, sans-serif;
    --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    font-family: var(--body);
    font-size: 17px;
    line-height: 1.6;
    color: var(--text);
    background: var(--cream);
    overflow-x: hidden;
}

img,
svg {
    display: block;
}

img {
    max-width: 100%;
    height: auto;
}

a {
    color: #2C6FCF;
}

a:hover {
    color: var(--ink);
}

h1,
h2,
h3 {
    font-family: var(--display);
    font-weight: 400;
    line-height: 1.12;
    color: var(--ink);
    margin: 0;
}

.wrap {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 22px;
}

/* ---------- Header ---------- */

.site-header {
    position: relative;
    z-index: 5;
    padding: 16px 0;
}

.site-header .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--display);
    font-size: 26px;
    color: var(--ink);
    text-decoration: none;
}

.brand img {
    width: 44px;
    height: 44px;
    border-radius: 11px;
    box-shadow: 0 3px 0 rgba(52, 58, 107, 0.25);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.brand:hover img {
    transform: rotate(-90deg);
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 22px;
    font-weight: 600;
    font-size: 16px;
}

.site-nav a {
    position: relative;
    color: var(--ink);
    text-decoration: none;
    padding: 4px 0;
}

.site-nav a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -2px;
    height: 4px;
    border-radius: 2px;
    background: var(--yellow);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s ease-out;
}

.site-nav a:hover::after,
.site-nav a[aria-current="page"]::after {
    transform: scaleX(1);
}

/* ---------- Sky, clouds, hero ---------- */

.sky {
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 55%, var(--cream) 100%);
}

.clouds {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.cloud {
    position: absolute;
    color: #fff;
}

.cloud svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.cloud--1 { left: -3%; top: 16%; width: 230px; height: 100px; opacity: 0.9; }
.cloud--2 { left: 34%; top: 7%; width: 150px; height: 66px; opacity: 0.7; }
.cloud--3 { right: -4%; top: 12%; width: 260px; height: 114px; opacity: 0.85; }
.cloud--4 { left: 8%; top: 68%; width: 320px; height: 140px; opacity: 0.95; }
.cloud--5 { right: 10%; top: 78%; width: 200px; height: 88px; opacity: 0.8; }

.hero {
    position: relative;
    padding: 30px 0 110px;
}

.hero .wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: 48px;
}

.title {
    font-family: var(--display);
    font-size: clamp(54px, 9.2vw, 112px);
    line-height: 0.98;
    letter-spacing: 2px;
    margin: 0 0 22px;
}

.title__row {
    display: block;
    white-space: nowrap;
    color: #F4F6FB;
}

.title__row--alt {
    color: var(--yellow);
}

.title__l {
    display: inline-block;
    -webkit-text-stroke: 0.035em rgba(20, 24, 52, 0.78);
    paint-order: stroke fill;
    text-shadow: 0 0.07em 0 rgba(20, 24, 52, 0.5);
    will-change: transform;
}

/* The game's title steps up and down from letter to letter. */
.title__l:nth-child(odd) {
    translate: 0 -0.035em;
}

.title__l:nth-child(even) {
    translate: 0 0.035em;
}

.tagline {
    display: inline-block;
    font-family: var(--display);
    font-size: 23px;
    color: #fff;
    background: rgba(30, 35, 72, 0.88);
    padding: 5px 22px 7px;
    border-radius: 22px;
    margin: 0 0 20px;
}

.lead {
    font-size: 20px;
    max-width: 24em;
    margin: 0 0 28px;
    color: var(--ink);
}

.badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
}

.btn {
    display: inline-block;
    font-family: var(--display);
    font-size: 24px;
    color: #fff;
    text-decoration: none;
    background: var(--green);
    padding: 12px 28px 14px;
    border-radius: 24px;
    border-top: 3px solid rgba(255, 255, 255, 0.3);
    border-bottom: 9px solid var(--green-dark);
    text-shadow: 0 2px 0 rgba(20, 24, 52, 0.4);
}

/* Only links move on hover and press. The entrance animation moves the buttons by their transform too, and a CSS
   transition on it would leave them where the animation started. */
a.btn {
    transition: translate 0.15s ease-out, border-bottom-width 0.08s ease-out, margin-top 0.08s ease-out;
}

.btn--quiet {
    color: var(--ink);
    background: var(--cream);
    border-top-color: rgba(255, 255, 255, 0.8);
    border-bottom-color: var(--cream-dark);
    text-shadow: none;
}

a.btn:hover {
    color: #fff;
    translate: 0 -2px;
}

/* Pressed like the game's buttons: the face sinks into its edge. */
a.btn:active {
    translate: none;
    margin-top: 6px;
    border-bottom-width: 3px;
}

.soon {
    font-weight: 600;
    color: var(--ink);
}

/* Three phones, the middle one in front. The slots place them; the scripts move what is inside. */
.phones {
    position: relative;
    height: 560px;
}

.phones__inner {
    position: absolute;
    inset: 0;
}

.phone-slot {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 230px;
}

.phone-slot--left {
    transform: translate(-118%, -50%) rotate(-9deg);
}

.phone-slot--right {
    transform: translate(18%, -50%) rotate(9deg);
}

.phone-slot--mid {
    width: 256px;
    transform: translate(-50%, -52%);
    z-index: 2;
}

.phone__frame {
    border-radius: 34px;
    border: 8px solid var(--panel);
    background: var(--panel);
    box-shadow: 0 26px 44px rgba(30, 35, 72, 0.32), inset 0 0 0 1px rgba(255, 255, 255, 0.12);
    overflow: hidden;
}

.phone__frame img {
    width: 100%;
    aspect-ratio: 6 / 13;
    object-fit: cover;
}

/* ---------- Sections ---------- */

section {
    position: relative;
    padding: 64px 0;
}

.section-title {
    font-size: clamp(32px, 5vw, 52px);
    text-align: center;
    margin-bottom: 14px;
}

.section-lead {
    max-width: 34em;
    margin: 0 auto 30px;
    text-align: center;
    font-size: 19px;
    color: var(--muted);
}

.cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 30px;
}

.card {
    background: #fff;
    border-radius: 28px;
    padding: 26px 26px 28px;
    border-bottom: 8px solid var(--cream-dark);
    transition: translate 0.25s ease-out, box-shadow 0.25s ease-out;
}

.card:hover {
    translate: 0 -6px;
    box-shadow: 0 18px 30px rgba(52, 58, 107, 0.14);
}

.card h3 {
    font-size: 26px;
    margin-bottom: 8px;
}

.card p {
    margin: 0;
    color: var(--muted);
}

.card__icon {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    margin-bottom: 18px;
    display: grid;
    place-items: center;
    border-bottom: 6px solid var(--green-dark);
    background: var(--green);
}

.card__icon span {
    display: block;
    width: 30px;
    height: 30px;
    background: #fff;
}

/* An arrow, like the swipe hint on the first level. */
.card__icon--swipe span {
    clip-path: polygon(0 36%, 52% 36%, 52% 8%, 100% 50%, 52% 92%, 52% 64%, 0 64%);
}

.card__icon--undo {
    background: var(--yellow);
    border-bottom-color: var(--yellow-dark);
}

.card__icon--undo span {
    border-radius: 50%;
    background: none;
    border: 6px solid #fff;
    border-left-color: transparent;
    rotate: -30deg;
}

.card__stars {
    display: flex;
    gap: 6px;
    height: 64px;
    align-items: center;
    margin-bottom: 18px;
}

.mini-star {
    width: 50px;
    height: 50px;
    fill: var(--yellow);
    stroke: var(--yellow-dark);
    stroke-width: 6;
}

/* ---------- The roll: Blocko tumbles along a row of tiles as the page scrolls ---------- */

.roll {
    padding: 70px 0 60px;
}

.roll__hint {
    white-space: nowrap;
    color: var(--ink);
    font-weight: 600;
}

.stage {
    position: relative;
    max-width: 980px;
    margin: 0 auto;
    padding: 22px 26px 30px;
    border-radius: 36px;
    background: linear-gradient(180deg, #A9DDF8 0%, #DDF3FF 100%);
    border-bottom: 8px solid #9CCDE6;
    overflow: hidden;
}

.hud {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    font-family: var(--display);
    font-size: 18px;
    letter-spacing: 0.5px;
    color: #fff;
}

.hud__chip {
    background: var(--green);
    padding: 2px 14px 4px;
    border-radius: 14px;
    border-bottom: 4px solid var(--green-dark);
}

.hud__stat {
    background: rgba(30, 35, 72, 0.88);
    padding: 3px 16px 5px;
    border-radius: 16px;
    color: rgba(255, 255, 255, 0.8);
}

.hud__stat b {
    display: inline-block;
    min-width: 0.7em;
    font-weight: 400;
    font-size: 24px;
    color: #fff;
    vertical-align: -2px;
}

.hud__stat--par b {
    color: var(--yellow);
}

.win {
    position: absolute;
    left: 0;
    right: 0;
    top: 74px;
    text-align: center;
    pointer-events: none;
    visibility: hidden;
}

.win__stars {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 4px;
}

.win__star {
    width: 54px;
    height: 54px;
    fill: var(--yellow);
    stroke: var(--yellow-dark);
    stroke-width: 6;
    rotate: -14deg;
}

.win__star--mid {
    width: 70px;
    height: 70px;
    margin-bottom: 8px;
    rotate: 0deg;
}

.win__star:last-child {
    rotate: 14deg;
}

.win__label {
    font-family: var(--display);
    font-size: clamp(30px, 5vw, 46px);
    color: var(--yellow);
    -webkit-text-stroke: 0.05em rgba(20, 24, 52, 0.78);
    paint-order: stroke fill;
    text-shadow: 0 0.08em 0 rgba(20, 24, 52, 0.5);
}

/* One tile is --u wide. Blocko is one by two of them and stands on the first tile. */
.track {
    position: relative;
    container-type: inline-size;
    margin-top: 12px;
}

.tiles,
.blocko {
    --u: calc(100cqw / var(--n));
}

.tiles {
    display: flex;
    padding-top: calc(var(--u) * 2.75);
}

.tile {
    flex: 1;
    height: calc(var(--u) * 0.72);
    margin: 0 1px;
    border-radius: calc(var(--u) * 0.16);
    background: linear-gradient(180deg, #6FD352 0, #5EC544 34%, #8A5A3C 34%, #6E452C 100%);
    box-shadow: inset 0 calc(var(--u) * 0.05) 0 rgba(255, 255, 255, 0.35);
}

.tile:nth-child(even) {
    background: linear-gradient(180deg, #62C748 0, #52B63A 34%, #835437 34%, #683F28 100%);
}

.tile--nest,
.tile--nest:nth-child(even) {
    background: linear-gradient(180deg, #FFE27A 0, #FFC83A 34%, #8A5A3C 34%, #6E452C 100%);
    box-shadow: inset 0 calc(var(--u) * 0.05) 0 rgba(255, 255, 255, 0.6), 0 0 calc(var(--u) * 0.5) rgba(255, 200, 58, 0.9);
}

.blocko {
    position: absolute;
    left: 0;
    bottom: calc(var(--u) * 0.72 - 1px);
    width: var(--u);
    height: calc(var(--u) * 2);
    padding: 0 1px;
    will-change: transform;
    filter: drop-shadow(0 calc(var(--u) * 0.06) calc(var(--u) * 0.08) rgba(30, 35, 72, 0.25));
}

.blocko svg {
    width: 100%;
    height: 100%;
}

/* ---------- Numbers ---------- */

.stats {
    padding: 20px 0 40px;
}

.stats .wrap {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    text-align: center;
}

.stat b {
    display: block;
    font-family: var(--display);
    font-weight: 400;
    font-size: clamp(54px, 9vw, 96px);
    line-height: 1;
    color: var(--green-dark);
    font-variant-numeric: tabular-nums;
}

.stat:nth-child(2) b {
    color: var(--yellow-dark);
}

.stat:nth-child(3) b {
    color: var(--coral);
}

.stat span {
    font-weight: 600;
    color: var(--ink);
}

/* ---------- Worlds ---------- */

.world {
    padding: 14px 14px 26px;
    color: #fff;
    border-bottom-color: rgba(0, 0, 0, 0.22);
}

.world h3,
.world p {
    color: #fff;
    padding: 0 12px;
}

.world__shot {
    aspect-ratio: 16 / 12;
    border-radius: 18px;
    overflow: hidden;
    margin-bottom: 18px;
    background: rgba(0, 0, 0, 0.15);
}

.world__shot img {
    width: 100%;
    height: 130%;
    object-fit: cover;
    object-position: 50% 52%;
}

.world--meadows {
    background: #4FB43A;
}

.world--dunes {
    background: #E79A2C;
}

.world--magma {
    background: #D4504A;
}

/* ---------- Free to play ---------- */

.band {
    background: var(--panel);
    color: #E9ECFA;
    padding: 76px 0;
}

.band .section-title {
    color: var(--yellow);
    margin-bottom: 24px;
}

.band p {
    max-width: 42em;
    margin: 0 auto 14px;
    text-align: center;
    font-size: 18px;
}

.band a {
    color: #9FD0FF;
}

/* ---------- Text pages ---------- */

.page {
    padding: 28px 0 70px;
}

.page .wrap {
    max-width: 780px;
}

.page h1 {
    font-size: clamp(36px, 6vw, 54px);
    margin-bottom: 6px;
}

.page .updated {
    color: var(--muted);
    margin: 0 0 26px;
}

.page h2 {
    font-size: 27px;
    margin: 38px 0 10px;
}

.page h3 {
    font-family: var(--body);
    font-weight: 700;
    font-size: 18px;
    margin: 22px 0 6px;
}

.page p,
.page ul {
    margin: 0 0 14px;
}

.page ul {
    padding-left: 22px;
}

.page li {
    margin-bottom: 6px;
}

.summary {
    background: #fff;
    border-radius: 22px;
    border-bottom: 6px solid var(--cream-dark);
    padding: 20px 24px 8px;
    margin-bottom: 8px;
}

.summary h2 {
    margin-top: 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 16px;
    font-size: 16px;
}

th,
td {
    text-align: left;
    vertical-align: top;
    padding: 9px 10px;
    border-bottom: 1px solid #E5D9BF;
}

th {
    color: var(--ink);
}

.table-scroll {
    overflow-x: auto;
}

/* ---------- Footer ---------- */

.site-footer {
    background: var(--panel);
    color: #C9CEEA;
    padding: 30px 0 36px;
    font-size: 15px;
}

.home .site-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.site-footer .wrap {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px 24px;
}

.site-footer a {
    color: #fff;
    margin-right: 18px;
}

.site-footer p {
    margin: 0;
}

/* ---------- Before the entrance animation: nothing of the hero shows ---------- */

.js .site-header,
.js .hero__text,
.js .phones {
    visibility: hidden;
}

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

@media (max-width: 900px) {
    .hero {
        padding-bottom: 70px;
    }

    .hero .wrap {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 20px;
    }

    .title__row {
        display: inline;
    }

    .title {
        font-size: clamp(40px, 11.5vw, 84px);
    }

    .lead {
        margin-left: auto;
        margin-right: auto;
    }

    .badge-row {
        justify-content: center;
    }

    .phones {
        height: 470px;
    }

    .phone-slot {
        width: 186px;
    }

    .phone-slot--mid {
        width: 208px;
    }

    .cards {
        grid-template-columns: 1fr;
        max-width: 520px;
        margin-left: auto;
        margin-right: auto;
    }

    .cloud--4,
    .cloud--5 {
        top: 88%;
    }
}

@media (max-width: 560px) {
    section {
        padding: 48px 0;
    }

    .site-header .wrap {
        flex-direction: column;
        align-items: flex-start;
    }

    .phones {
        height: 390px;
    }

    .phone-slot {
        width: 150px;
    }

    .phone-slot--mid {
        width: 170px;
    }

    .phone__frame {
        border-width: 5px;
        border-radius: 24px;
    }

    .stage {
        padding: 16px 12px 22px;
        border-radius: 26px;
    }

    .hud {
        gap: 8px;
        font-size: 15px;
    }

    .win {
        top: 62px;
    }

    .win__star {
        width: 40px;
        height: 40px;
    }

    .win__star--mid {
        width: 52px;
        height: 52px;
    }

    .stats .wrap {
        gap: 10px;
    }

    .stat span {
        font-size: 14px;
        line-height: 1.3;
        display: block;
    }
}

@media (prefers-reduced-motion: reduce) {
    .brand img,
    .card,
    .btn,
    .site-nav a::after {
        transition: none;
    }
}

/* Each screenshot is cropped to its board and dino. */
.world--dunes .world__shot img,
.world--magma .world__shot img {
    object-position: 50% 64%;
}

/* Phones: a big two-line title, and smaller clouds that keep clear of it. */
@media (max-width: 900px) {
    .title {
        font-size: clamp(52px, 17vw, 120px);
    }

    .title__row {
        display: block;
    }

    .cloud {
        scale: 0.6;
    }

    .cloud--1 { top: 9%; left: -14%; }
    .cloud--2 { top: 3%; left: 46%; }
    .cloud--3 { top: 30%; right: -20%; }
}
