/* Wayland Wallpaper Engine project page
   SPDX-License-Identifier: GPL-3.0-or-later */

:root {
    --dusk: #1d2040;
    --dusk-deep: #15173a;
    --violet: #5b4b8a;
    --sea: #1f7a80;
    --mist: #eef1f4;
    --mist-2: #e2e7ee;
    --rule: #c6cfdb;
    --ink: #1d2040;
    --ink-soft: #4a4f6e;
    --paper: #ffffff;
    --bar: rgba(22, 22, 26, 0.72);

    --display: "Bricolage Grotesque", "Adwaita Sans", "Cantarell", system-ui, sans-serif;
    --body: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", system-ui, sans-serif;
    --mono: "JetBrains Mono", "Adwaita Mono", ui-monospace, monospace;

    /* scale: 1.25 */
    --step-0: 1.0625rem;
    --step-1: 1.33rem;
    --step-2: 1.66rem;
    --step-3: clamp(1.9rem, 1.4rem + 1.8vw, 2.6rem);
}

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

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

body {
    margin: 0;
    font-family: var(--body);
    font-size: var(--step-0);
    line-height: 1.55;
    color: var(--ink);
    background: var(--mist);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--sea); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
    outline: 3px solid #f2b155;
    outline-offset: 3px;
    border-radius: 4px;
}

code, pre { font-family: var(--mono); font-size: 0.86em; }
p code, li code, dd code {
    background: var(--mist-2);
    padding: 0.1em 0.35em;
    border-radius: 5px;
    overflow-wrap: anywhere;
}

h1, h2, h3 { font-family: var(--display); margin: 0; text-wrap: balance; }
h2 {
    font-size: var(--step-3);
    font-weight: 700;
    font-variation-settings: "wdth" 88;
    line-height: 1.1;
    letter-spacing: -0.01em;
    margin-bottom: 1.25rem;
}
h3 { font-size: var(--step-1); font-weight: 650; margin-bottom: 0.5rem; }

.wrap { width: min(1120px, 100% - 3rem); margin-inline: auto; }
.measure { max-width: 64ch; }

/* ---------- the desktop (hero) ---------- */

.desktop {
    position: relative;
    min-height: clamp(640px, 100svh, 1080px);
    display: grid;
    grid-template-rows: auto 1fr auto;
    grid-template-columns: minmax(0, 1fr);
    color: #f4f2fb;
    background: var(--dusk-deep);
    overflow: hidden;
}

#wallpaper {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.topbar {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    height: 2.1rem;
    padding: 0 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    background: rgba(10, 10, 20, 0.55);
    backdrop-filter: blur(8px);
}
.topbar-clock { justify-self: center; font-variant-numeric: tabular-nums; }
.topbar-links { justify-self: end; display: flex; gap: 1.25rem; }
.topbar-links a { color: inherit; text-decoration: none; }
.topbar-links a:hover { text-decoration: underline; }

.hero {
    position: relative;
    align-self: center;
    width: min(1120px, 100% - 3rem);
    margin: 0 auto;
    padding: 3rem 0 7rem;
}
.hero h1 {
    max-width: 14ch;
    font-size: clamp(2.6rem, 1.2rem + 5.4vw, 5.8rem);
    font-weight: 750;
    font-variation-settings: "wdth" 80;
    line-height: 0.98;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 30px rgba(10, 8, 30, 0.45);
}
.hero-lede {
    max-width: 52ch;
    margin: 1.5rem 0 0;
    font-size: var(--step-1);
    line-height: 1.5;
    color: #ebe8f7;
    text-shadow: 0 1px 12px rgba(10, 8, 30, 0.6);
}
.hero-hint { margin: 1rem 0 0; font-size: 0.95rem; color: #cfc8ea; }
@media (prefers-reduced-motion: reduce), (hover: none) { .hero-hint { display: none; } }

/* floating taskbar holding the install command */
.dock {
    position: relative;
    justify-self: center;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    max-width: calc(100% - 2rem);
    margin-bottom: 1.25rem;
    padding: 0.45rem 0.5rem 0.45rem 1.1rem;
    background: var(--bar);
    backdrop-filter: blur(14px);
    border-radius: 18px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}
.dock-command {
    min-width: 0;
    overflow-x: auto;
    white-space: nowrap;
    font-size: 0.85rem;
    color: #e8e6f2;
    scrollbar-width: none;
}
.dock-link {
    flex: none;
    padding: 0.5rem 0.85rem;
    border-radius: 12px;
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
}
.dock-link:hover { background: rgba(255, 255, 255, 0.12); }

.copy {
    flex: none;
    font: 600 0.95rem var(--body);
    padding: 0.5rem 0.95rem;
    border: 0;
    border-radius: 12px;
    color: var(--dusk);
    background: #f4f2fb;
    cursor: pointer;
    min-width: 5.5rem;
}
.copy:hover { background: #fff; }

/* ---------- content bands ---------- */

.band { padding: clamp(4rem, 8vw, 7rem) 0; }
.band + .band { border-top: 1px solid var(--rule); }

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    gap: 2.25rem 3rem;
    margin: 2.5rem 0 0;
}
.features div { border-top: 2px solid var(--ink); padding-top: 1rem; }
.features dt {
    font-family: var(--display);
    font-size: var(--step-1);
    font-weight: 650;
    line-height: 1.2;
}
.features dd { margin: 0.5rem 0 0; color: var(--ink-soft); max-width: 40ch; }

.split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    gap: clamp(2rem, 5vw, 5rem);
    align-items: center;
}
.split-media { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.split > * { min-width: 0; }
.split-text > p { max-width: 52ch; }
.aside { color: var(--ink-soft); font-size: 0.95rem; }

pre {
    margin: 1rem 0 0;
    padding: 1rem 1.25rem;
    background: var(--dusk);
    color: #e6e4f2;
    border-radius: 10px;
    overflow-x: auto;
    line-height: 1.6;
}

/* ---------- pause demo ---------- */

.band-pause { background: var(--mist-2); }

.mini {
    position: relative;
    aspect-ratio: 16 / 10;
    border-radius: 14px;
    overflow: hidden;
    background: var(--dusk-deep);
    box-shadow: 0 24px 60px rgba(29, 32, 64, 0.28);
    cursor: pointer;
}
.mini canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.mini-window {
    position: absolute;
    left: 12%;
    top: 14%;
    width: 50%;
    height: 54%;
    display: flex;
    flex-direction: column;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: #fafafb;
    text-align: left;
    font: inherit;
    color: var(--ink);
    cursor: pointer;
    opacity: 0.9;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
    transition: opacity 0.2s, box-shadow 0.2s;
}
.mini-titlebar {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #6b6f86;
    background: #ececf0;
    border-radius: 10px 10px 0 0;
    transition: color 0.2s, background 0.2s;
}
.mini-lines { display: grid; gap: 0.55rem; padding: 0.9rem 0.75rem; }
.mini-lines i { display: block; height: 0.42rem; border-radius: 3px; background: #dadde5; }
.mini-lines i:nth-child(1) { width: 80%; }
.mini-lines i:nth-child(2) { width: 62%; }
.mini-lines i:nth-child(3) { width: 72%; }
.mini-lines i:nth-child(4) { width: 40%; }

.mini.is-paused .mini-window { opacity: 1; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45); }
.mini.is-paused .mini-titlebar { color: var(--ink); background: #e1e2e8; }

/* keyboard route back to the desktop; visible when focused */
.mini-desktop {
    position: absolute;
    right: 0.75rem;
    top: 0.75rem;
    padding: 0.35rem 0.7rem;
    border: 0;
    border-radius: 8px;
    font: 600 0.85rem var(--body);
    color: var(--dusk);
    background: #f4f2fb;
    opacity: 0;
    pointer-events: none;
}
.mini-desktop:focus-visible { opacity: 1; pointer-events: auto; }

.mini-status, .mini-frames {
    position: absolute;
    bottom: 0.75rem;
    margin: 0;
    padding: 0.3rem 0.7rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    background: var(--bar);
}
.mini-status { left: 0.75rem; }
.mini-frames { right: 0.75rem; font-variant-numeric: tabular-nums; }

/* ---------- screenshot ---------- */

.shot { margin: 0; }
.shot img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 14px;
    box-shadow: 0 24px 60px rgba(29, 32, 64, 0.25);
}

/* ---------- how it works ---------- */

.band-how { background: var(--dusk); color: #e9e7f5; }
.band-how h2 { color: #fff; }
.band-how code { background: rgba(255, 255, 255, 0.12); }
.band.band-how + .band { border-top: 0; }

.chain {
    list-style: none;
    counter-reset: chain;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: 2rem;
    margin: 2.5rem 0;
    padding: 0;
}
.chain li { counter-increment: chain; position: relative; padding-top: 3.25rem; color: #c9c5e2; }
.chain li::before {
    content: counter(chain);
    position: absolute;
    top: 0;
    left: 0;
    font: 700 2.2rem/1 var(--display);
    color: #a99be0;
}
.chain li:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 1.1rem;
    left: 2.5rem;
    right: -1rem;
    height: 2px;
    background: linear-gradient(to right, #6c5fa6, transparent);
}
.chain strong { display: block; color: #fff; font-family: var(--display); font-size: var(--step-1); font-weight: 650; line-height: 1.25; margin-bottom: 0.4rem; }

/* ---------- install ---------- */

.band-install .split { align-items: start; }
.steps { margin: 1.5rem 0; padding-left: 1.4rem; }
.steps li { padding-left: 0.4rem; margin-bottom: 1.25rem; }
.steps li::marker { font: 700 1.15rem var(--display); color: var(--violet); }
.steps p { margin: 0; }

.command {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.4rem 0.4rem 0.4rem 1rem;
    background: var(--dusk);
    border-radius: 12px;
}
.command code {
    min-width: 0;
    padding: 0;
    background: none;
    overflow-x: auto;
    white-space: nowrap;
    color: #e6e4f2;
    font-size: 0.82rem;
    scrollbar-width: thin;
}

.needs {
    padding: 1.75rem;
    background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: 14px;
}
.needs ul { margin: 0 0 1.75rem; padding-left: 1.1rem; }
.needs li { margin-bottom: 0.6rem; }
.needs p { margin: 0; }

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

.footer { padding: 2.5rem 0 3rem; background: var(--dusk-deep); color: #bdb8d8; font-size: 0.95rem; }
.footer a { color: #e4defa; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 1rem 3rem; justify-content: space-between; align-items: baseline; }
.footer-inner p { margin: 0; max-width: 62ch; }
.footer nav { display: flex; gap: 1.5rem; flex-wrap: wrap; }

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

@media (max-width: 820px) {
    /* minmax(0, ...): a long command must scroll in its box, not widen the page */
    .split, .split-media { grid-template-columns: minmax(0, 1fr); }
    .split-media .shot { order: 2; }
    .chain li:not(:last-child)::after { display: none; }
}

@media (max-width: 640px) {
    .topbar {
        grid-template-columns: 1fr auto;
        gap: 1rem;
        height: auto;
        min-height: 2.1rem;
        padding-block: 0.4rem;
        line-height: 1.25;
    }
    .topbar-clock { display: none; }
    .hero { padding-bottom: 2.5rem; }
    .hero-lede { font-size: var(--step-0); }

    /* show the whole install command, wrapped, with the buttons below it */
    .dock { flex-wrap: wrap; justify-content: center; margin-inline: 1rem; padding: 0.75rem; border-radius: 16px; }
    .dock-command, .command code {
        flex: 1 1 100%;
        white-space: normal;
        overflow-wrap: anywhere;
        line-height: 1.5;
    }
    .dock-command { padding: 0 0.25rem 0.25rem; }
    .command { flex-wrap: wrap; padding: 0.75rem; }
    .command .copy { margin-left: auto; }

    pre { font-size: 0.78em; padding: 0.85rem 1rem; }

    .mini { aspect-ratio: 4 / 3; }
    .mini-window { left: 8%; width: 64%; }
    .mini-frames { bottom: auto; top: 0.75rem; }
}
