/*
 * Knotty's website: the landing page and the privacy policy.
 *
 * Same look as the game (src/styles/base/foundation.css): the Sundown sky,
 * cream cards with a solid ledge under them, chunky buttons that squash when
 * pressed, the KNOTTY letters in the thread colours, Fredoka and Quicksand.
 * No framework, no build step: Vercel serves this folder as it is.
 */

@font-face {
    font-family: 'Fredoka';
    src: url('fonts/fredoka-latin-wght-normal.woff2') format('woff2');
    font-weight: 300 700;
    font-display: swap;
}

@font-face {
    font-family: 'Quicksand';
    src: url('fonts/quicksand-latin-wght-normal.woff2') format('woff2');
    font-weight: 300 700;
    font-display: swap;
}

:root {
    color-scheme: light;

    --cream: #fff6ea;
    --cream-deep: #ffe7cc;
    --ink: #3f3129;
    --ink-soft: #7a6759;
    --ledge: #e8d2b4;
    --hairline: #f0e2ce;

    --coral: #ff5b6e;
    --orange: #ff9f43;
    --gold: #ffc93c;
    --mint: #3fd07a;
    --mint-deep: #22a257;
    --blue: #4d9dff;

    --sky: linear-gradient(180deg, #06324a 0%, #0a5870 24%, #11898a 44%, #ffc46e 70%, #ff9a5e 86%, #ff7160 100%);
    --board: #0f4152;
    --board-cell: #174d5f;

    --display: 'Fredoka', 'Trebuchet MS', system-ui, sans-serif;
    --body: 'Quicksand', 'Segoe UI', system-ui, sans-serif;

    --radius: 20px;
    --page: 1040px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--cream);
    color: var(--ink);
    font-family: var(--body);
    font-weight: 500;
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img,
svg {
    display: block;
    max-width: 100%;
}

a {
    color: #1f6fd1;
    text-underline-offset: 3px;
}

h1,
h2,
h3 {
    font-family: var(--display);
    font-weight: 700;
    line-height: 1.15;
    margin: 0;
}

.wrap {
    width: min(var(--page), 100% - 32px);
    margin-inline: auto;
}

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

.top {
    position: absolute;
    inset: 0 0 auto;
    z-index: 2;
}

.top .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-block: 16px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-family: var(--display);
    font-weight: 600;
    font-size: 20px;
    text-decoration: none;
}

.brand img {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    box-shadow: 0 3px 0 rgba(0, 0, 0, 0.18);
}

.top nav a {
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    opacity: 0.9;
}

.top nav a:hover {
    opacity: 1;
    text-decoration: underline;
}

/* ---------- the KNOTTY letters ---------- */

.letters {
    display: flex;
    justify-content: center;
    gap: 0.04em;
    margin: 0;
    font-family: var(--display);
    font-weight: 700;
    font-size: clamp(56px, 15vw, 120px);
    line-height: 1;
    letter-spacing: 0.01em;
}

/* Face, then a solid darker ledge: the home screen's wordmark (design-tokens.json, letters). */
.letters span {
    display: inline-block;
    color: var(--face);
    text-shadow:
        0 0.06em 0 var(--deep),
        0 0.12em 0.08em rgba(0, 0, 0, 0.18);
}

.letters span:nth-child(1) {
    --face: #ff6b81;
    --deep: #e0445e;
}
.letters span:nth-child(2) {
    --face: #ffae3c;
    --deep: #e08a1e;
}
.letters span:nth-child(3) {
    --face: #ffd23c;
    --deep: #d9a900;
}
.letters span:nth-child(4) {
    --face: #4fd885;
    --deep: #22a257;
}
.letters span:nth-child(5) {
    --face: #5bb0ff;
    --deep: #2c7fe0;
}
.letters span:nth-child(6) {
    --face: #c58aff;
    --deep: #8a4fe0;
}

/* ---------- buttons ---------- */

/* Chunky soft 3D, as in the game: a gradient face, a lighter lip, a solid ledge that squashes. */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 56px;
    padding: 12px 26px;
    border-radius: 18px;
    background: linear-gradient(180deg, #5fe394, var(--mint));
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.45),
        0 6px 0 var(--mint-deep);
    color: #fff;
    font-family: var(--display);
    font-weight: 600;
    font-size: 19px;
    text-decoration: none;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.15);
    transition:
        transform 0.08s ease,
        box-shadow 0.08s ease;
}

.button:hover {
    filter: brightness(1.04);
}

.button:active {
    transform: translateY(4px);
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.45),
        0 2px 0 var(--mint-deep);
}

.button svg {
    width: 26px;
    height: 26px;
    flex: none;
}

.button small {
    display: block;
    font-family: var(--body);
    font-weight: 600;
    font-size: 12px;
    opacity: 0.9;
    line-height: 1.1;
}

.button .label {
    text-align: left;
    line-height: 1.15;
}

.button--cream {
    background: linear-gradient(180deg, #fff, var(--cream));
    box-shadow:
        inset 0 2px 0 #fff,
        0 6px 0 var(--ledge);
    color: var(--ink);
    text-shadow: none;
}

.button--cream:active {
    box-shadow:
        inset 0 2px 0 #fff,
        0 2px 0 var(--ledge);
}

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

.hero {
    position: relative;
    overflow: hidden;
    background: var(--sky);
    color: #fff;
    padding: 96px 0 0;
}

.hero .wrap {
    display: grid;
    justify-items: center;
    text-align: center;
}

.tagline {
    margin: 22px 0 8px;
    font-family: var(--display);
    font-weight: 600;
    font-size: clamp(22px, 4.6vw, 32px);
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.12);
}

.lede {
    max-width: 34em;
    margin: 0 0 28px;
    font-size: 18px;
    color: #fff8ef;
}

.cta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 18px;
    align-items: center;
    justify-content: center;
}

.note {
    margin: 14px 0 0;
    font-size: 14px;
    color: #fff3e3;
}

/* Knotty on the board floor: the home screen's scene. */
.stage {
    position: relative;
    width: 100%;
    margin-top: 28px;
    display: grid;
    justify-items: center;
}

.stage .knotty {
    position: relative;
    z-index: 1;
    width: clamp(150px, 30vw, 220px);
    margin-bottom: -18px;
}

.floor {
    width: 100%;
    height: 120px;
    background:
        linear-gradient(90deg, rgba(10, 61, 82, 0.55) 3px, transparent 3px) 0 0 / 60px 100%,
        linear-gradient(180deg, rgba(10, 61, 82, 0.55) 3px, transparent 3px) 0 0 / 100% 40px,
        #66cfc4;
    transform: perspective(300px) rotateX(38deg);
    transform-origin: top;
    margin-bottom: -40px;
}

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

section {
    padding: 72px 0;
}

.kicker {
    margin: 0 0 6px;
    color: var(--coral);
    font-family: var(--display);
    font-weight: 600;
    font-size: 15px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.section-title {
    font-size: clamp(28px, 5vw, 40px);
    margin-bottom: 12px;
}

.section-lede {
    max-width: 36em;
    margin: 0 0 36px;
    color: var(--ink-soft);
    font-size: 18px;
}

.card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: 0 5px 0 var(--ledge);
    padding: 22px;
}

/* ---------- how it plays ---------- */

.rules {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.rules .card {
    display: grid;
    gap: 14px;
    align-content: start;
}

.rules h3 {
    font-size: 22px;
}

.rules p {
    margin: 0;
    color: var(--ink-soft);
}

.step {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--cream-deep);
    color: var(--ink);
    font-family: var(--display);
    font-weight: 700;
}

.mini {
    width: 100%;
    max-width: 220px;
    justify-self: center;
}

/* ---------- what's inside ---------- */

.inside {
    background: var(--cream-deep);
}

.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.feature {
    display: grid;
    gap: 6px;
    align-content: start;
    border-top: 6px solid var(--accent);
}

.feature b {
    font-family: var(--display);
    font-weight: 700;
    font-size: 34px;
    line-height: 1;
    color: var(--accent);
}

.feature h3 {
    font-size: 20px;
}

.feature p {
    margin: 0;
    color: var(--ink-soft);
    font-size: 15px;
}

/* ---------- screenshots ---------- */

.shots {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding: 6px 4px 22px;
    scroll-snap-type: x mandatory;
}

.shots figure {
    flex: 0 0 min(220px, 62vw);
    margin: 0;
    scroll-snap-align: center;
}

.shots img {
    width: 100%;
    height: auto;
    aspect-ratio: 9 / 16;
    border-radius: 26px;
    border: 6px solid #fff;
    box-shadow: 0 6px 0 var(--ledge);
    background: #0a3d52;
}

.shots figcaption {
    margin-top: 10px;
    text-align: center;
    font-family: var(--display);
    font-weight: 600;
    color: var(--ink-soft);
}

/* ---------- fair play ---------- */

.fair {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 32px;
    align-items: center;
}

.fair ul {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.fair li {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    font-size: 17px;
}

/* A thread dot as the bullet. */
.fair li::before {
    content: '';
    flex: none;
    width: 14px;
    height: 14px;
    margin-top: 6px;
    border-radius: 50%;
    background: var(--dot, var(--mint));
    box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.15);
}

.fair li:nth-child(2) {
    --dot: var(--blue);
}
.fair li:nth-child(3) {
    --dot: var(--gold);
}
.fair li:nth-child(4) {
    --dot: var(--coral);
}
.fair li:nth-child(5) {
    --dot: var(--orange);
}

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

.closing {
    background: var(--sky);
    background-position: 0 70%;
    background-size: 100% 200%;
    color: #fff;
    text-align: center;
}

.closing .wrap {
    display: grid;
    justify-items: center;
    gap: 18px;
}

.closing img {
    width: 120px;
}

.closing h2 {
    font-size: clamp(28px, 5vw, 40px);
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.12);
}

/* ---------- footer ---------- */

footer {
    padding: 32px 0 40px;
    background: #0a3d52;
    color: #cfe4ea;
    font-size: 15px;
}

footer .wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 28px;
    align-items: center;
    justify-content: space-between;
}

footer nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 22px;
}

footer a {
    color: #fff;
    font-weight: 600;
}

/* ---------- the privacy policy ---------- */

.doc-hero {
    background: var(--sky);
    background-size: 100% 260%;
    color: #fff;
    padding: 96px 0 72px;
    text-align: center;
}

.doc-hero h1 {
    font-size: clamp(32px, 7vw, 52px);
    text-shadow: 0 3px 0 rgba(0, 0, 0, 0.14);
}

.doc-hero p {
    margin: 10px 0 0;
    color: #fff3e3;
}

.doc {
    margin-top: -40px;
    padding: 0 0 64px;
}

.doc .card {
    padding: clamp(22px, 5vw, 48px);
    max-width: 760px;
    margin-inline: auto;
}

.doc h2 {
    display: flex;
    gap: 12px;
    align-items: center;
    margin: 36px 0 10px;
    font-size: 22px;
}

.doc h2:first-of-type {
    margin-top: 8px;
}

/* The section number, in a coloured dot. */
.doc h2 .n {
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--dot, var(--coral));
    box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.15);
    color: #fff;
    font-size: 17px;
}

.doc h2:nth-of-type(5n + 2) .n {
    --dot: var(--orange);
}
.doc h2:nth-of-type(5n + 3) .n {
    --dot: #e2a800;
}
.doc h2:nth-of-type(5n + 4) .n {
    --dot: var(--mint-deep);
}
.doc h2:nth-of-type(5n + 5) .n {
    --dot: var(--blue);
}

.doc p,
.doc li {
    font-size: 16px;
}

.doc ul,
.doc ol {
    padding-left: 22px;
}

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

.doc .intro {
    font-size: 18px;
    padding-bottom: 20px;
    border-bottom: 2px dashed var(--hairline);
}

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

@media (max-width: 820px) {
    .rules,
    .features {
        grid-template-columns: 1fr 1fr;
    }

    .fair {
        grid-template-columns: 1fr;
    }
}

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

    .rules,
    .features {
        grid-template-columns: 1fr;
    }

    .top .wrap {
        padding-block: 12px;
    }

    .brand span {
        display: none;
    }

    .lede {
        font-size: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .button {
        transition: none;
    }
}
