:root {
    --ink: #000;
    --deep: #01142e;
    --petal: #eaf6ff;
    --mist: #a9c8e4;
    --sky: #5cc2ff;
    --glow: #1e9bff;
    --line: rgb(92 194 255 / 0.28);

    --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
    --body: "Figtree", "Segoe UI", system-ui, sans-serif;

    --gutter: clamp(20px, 5vw, 72px);
    --waterline: 74svh;
    color-scheme: dark;
}

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

html { scroll-behavior: smooth; }

body {
    display: flex;
    flex-direction: column;
    min-height: 100svh;
    margin: 0;
    background: linear-gradient(var(--deep), var(--ink) 90svh);
    color: var(--petal);
    font: 400 1.125rem/1.6 var(--body);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* The home page sinks from night air into deep water below the lotus. */
body.home { background: linear-gradient(var(--ink) var(--waterline), var(--deep) 130svh, var(--ink)); }

h1, h2, h3, p, dl, dd, ul, ol { margin: 0; padding: 0; }

ul, ol { list-style: none; }

main { flex: 1; width: 100%; }

a { color: inherit; }

:focus-visible {
    outline: 2px solid var(--sky);
    outline-offset: 3px;
    border-radius: 2px;
}

h1 {
    font: 800 clamp(2.25rem, 4.4vw, 3.5rem)/1.05 var(--display);
    letter-spacing: -0.03em;
    text-wrap: balance;
}

h2 {
    font: 700 clamp(1.75rem, 3vw, 2.5rem)/1.1 var(--display);
    letter-spacing: -0.02em;
}

h3 { font: 700 1.3rem/1.2 var(--display); }

.lead { color: var(--mist); font-size: 1.25rem; line-height: 1.5; }

/* Header */
.preview-notice {
    padding: 6px var(--gutter);
    background: rgb(92 194 255 / 0.14);
    color: var(--petal);
    font-size: 0.9375rem;
    text-align: center;
}

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

.site-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 20px;
    padding: 20px var(--gutter);
}

.site-header nav { display: flex; gap: clamp(16px, 3vw, 32px); }

.site-header nav a { color: var(--petal); font-weight: 500; text-decoration: none; }

.site-header nav a:hover { color: var(--sky); text-decoration: underline; }

.wordmark {
    font: 800 1.5rem/1 var(--display);
    letter-spacing: -0.02em;
    color: var(--sky);
    text-decoration: none;
}

.wordmark span { color: var(--petal); }

/* Buttons */
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

.button {
    display: inline-block;
    padding: 14px 26px;
    border: 1px solid var(--petal);
    background: var(--petal);
    color: var(--ink);
    font: 600 1.0625rem/1.2 var(--body);
    text-align: center;
    text-decoration: none;
    border-radius: 999px;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s;
}

.button:hover { background: var(--sky); border-color: var(--sky); }

.button.secondary { background: transparent; color: var(--petal); }

.button.secondary:hover { background: rgb(92 194 255 / 0.16); }

.button.small { padding: 11px 20px; }

.text-button {
    padding: 0;
    border: 0;
    background: none;
    color: var(--mist);
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}

.text-button:hover { color: var(--petal); }

/* Hero */
.hero {
    position: relative;
    height: 100svh;
    min-height: 620px;
    overflow: hidden;
}

.hero-copy {
    position: absolute;
    z-index: 1;
    left: var(--gutter);
    top: calc(var(--waterline) / 2 + 44px);
    translate: 0 -50%;
    width: min(46vw, 620px);
}

.hero h1 { font-size: clamp(2.75rem, 5.2vw, 5.25rem); line-height: 1; }

.hero-copy p {
    max-width: 44ch;
    margin-top: 24px;
    color: var(--mist);
    font-size: 1.25rem;
    line-height: 1.5;
}

/* The lotus stands on the waterline; its reflection hangs from the same line. */
.bloom {
    position: absolute;
    top: var(--waterline);
    right: -3vw;
    width: min(56vw, 120svh);
}

.bloom img { display: block; width: 100%; height: auto; }

.lotus {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    transform-origin: 50% 100%;
    animation: bloom 1.6s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.reflection {
    transform-origin: 50% 0;
    transform: translateY(62%) scaleY(-0.62);
    opacity: 0.8;
    filter: blur(1.5px);
    mask-image: linear-gradient(to top, #000, transparent 72%);
    -webkit-mask-image: linear-gradient(to top, #000, transparent 72%);
    animation: surface 1.6s ease-out 0.5s both;
}

@keyframes bloom {
    from { opacity: 0; scale: 0.82 0.7; filter: brightness(0.5); }
}

@keyframes surface {
    from { opacity: 0; }
}

/* Page frames */
.band,
.page {
    width: 100%;
    max-width: 1180px;
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.band { padding-top: clamp(64px, 12vh, 120px); }

.band h2 { margin-bottom: 28px; }

.page { padding-block: clamp(28px, 6vh, 56px) clamp(56px, 10vh, 96px); }

.page > h1 { margin-bottom: 28px; }

.page.narrow { max-width: 760px; }

.page.narrow > h1 { margin-bottom: 16px; }

.page.narrow > h2 { margin-top: 48px; }

.page.narrow > .lead + .button { margin-top: 28px; }

/* The petal tile repeats the shape of the logo's leaves. */
.leaf {
    flex: none;
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    border: 2px solid var(--glow);
    border-radius: 4px 70% 4px 70%;
    background: var(--petal);
    box-shadow: 0 0 16px rgb(30 155 255 / 0.65);
    color: #0366c4;
    font: 800 1.25rem/1 var(--display);
}

.leaf.large { width: 96px; height: 96px; font-size: 1.875rem; }

/* Listings */
.listings {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
    gap: 0 40px;
}

.listing {
    display: flex;
    gap: 18px;
    padding-block: 22px;
    border-top: 1px solid var(--line);
    text-decoration: none;
}

.listing-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.listing-name { font: 700 1.3rem/1.2 var(--display); }

.listing:hover .listing-name { color: var(--sky); text-decoration: underline; }

.listing-tagline { color: var(--mist); font-size: 1rem; line-height: 1.4; }

.listing-price { margin-top: 6px; font-weight: 600; }

/* Home categories */
.category-list > div {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 8px 40px;
    align-items: baseline;
    padding-block: 20px;
    border-top: 1px solid var(--line);
}

.category-list dt {
    font: 500 clamp(1.5rem, 3.4vw, 2.25rem)/1.1 var(--display);
    letter-spacing: -0.02em;
}

.category-list dt a { text-decoration: none; }

.category-list dt a:hover { color: var(--sky); text-decoration: underline; }

.category-list dd { color: var(--mist); }

/* Audiences */
.audiences {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px clamp(40px, 8vw, 112px);
    padding-bottom: clamp(64px, 12vh, 120px);
}

.audiences h2 { margin-bottom: 0; }

.audiences p { max-width: 44ch; margin-top: 14px; color: var(--mist); }

/* Browse */
.browse {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 48px;
    align-items: start;
}

.category-nav li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-block: 7px;
    color: var(--mist);
}

.category-nav a { color: var(--petal); text-decoration: none; }

.category-nav a:hover { color: var(--sky); text-decoration: underline; }

.category-nav a[aria-current] { color: var(--sky); font-weight: 600; }

.filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 14px 18px;
}

.field { display: grid; gap: 4px; font-size: 1rem; color: var(--mist); }

.field.search { flex: 1 1 240px; }

.field input,
.field select {
    width: 100%;
    min-height: 46px;
    padding: 8px 14px;
    border: 1px solid rgb(169 200 228 / 0.55);
    border-radius: 8px;
    background: var(--ink);
    color: var(--petal);
    font: inherit;
}

.field input::placeholder { color: #7f9db8; }

.check {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 46px;
    font-size: 1rem;
    cursor: pointer;
}

.check input { width: 18px; height: 18px; accent-color: var(--sky); }

.result-count { margin-block: 22px 12px; color: var(--mist); font-size: 1rem; }

.empty { display: grid; justify-items: start; gap: 14px; margin-top: 32px; }

.pagination { display: flex; gap: 6px; margin-top: 24px; }

.pagination a {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    text-decoration: none;
}

.pagination a:hover { background: rgb(92 194 255 / 0.16); }

.pagination a[aria-current] { background: var(--petal); color: var(--ink); font-weight: 600; }

/* Software detail */
.crumb { margin-bottom: 20px; color: var(--mist); font-size: 1rem; }

.crumb a { color: inherit; }

.product {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: clamp(32px, 6vw, 72px);
    align-items: start;
}

.product-title { display: flex; align-items: center; gap: 24px; margin-bottom: 28px; }

.product-title .lead { margin-top: 6px; }

.product-main > p { max-width: 64ch; }

.sample-tag { margin-bottom: 10px; color: var(--sky); font-weight: 600; }

.product-main h2 { margin-block: 40px 16px; font-size: 1.625rem; }

.features li { padding-block: 10px; border-top: 1px solid var(--line); }

.buy {
    display: grid;
    gap: 18px;
    padding: 26px;
    border: 1px solid var(--line);
    border-radius: 14px 44px 14px 44px;
    background: rgb(0 0 0 / 0.4);
}

.buy .button { width: 100%; }

.buy p { color: var(--mist); font-size: 1rem; }

.buy .price { color: var(--petal); font: 800 2.25rem/1 var(--display); letter-spacing: -0.02em; }

.facts { font-size: 1rem; }

.facts > div {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: baseline;
    padding-block: 8px;
    border-top: 1px solid var(--line);
}

.facts dt { color: var(--mist); flex: none; }

.facts dd { text-align: right; }

.related { margin-top: 72px; }

.related h2 { margin-bottom: 24px; font-size: 1.625rem; }

/* Cart */
.cart {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: clamp(32px, 6vw, 72px);
    align-items: start;
}

.cart-items li {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    gap: 18px;
    align-items: center;
    padding-block: 18px;
    border-top: 1px solid var(--line);
}

.cart-items a { font: 700 1.3rem/1.2 var(--display); text-decoration: none; }

.cart-items a:hover { color: var(--sky); text-decoration: underline; }

.cart-licence { display: block; color: var(--mist); font-size: 1rem; }

.cart-price { font-weight: 600; }

.cart .facts > div { border-top: 0; padding-block: 0; }

.cart .facts dt { align-self: center; }

/* Sell: these steps happen in this order, so they are numbered. */
.steps { counter-reset: step; margin-block: 24px 36px; }

.steps li {
    counter-increment: step;
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    padding-block: 18px;
    border-top: 1px solid var(--line);
}

.steps li::before {
    content: counter(step);
    grid-row: span 2;
    color: var(--sky);
    font: 800 2rem/1 var(--display);
}

.steps p { margin-top: 4px; color: var(--mist); }

/* Footer */
.site-footer {
    padding: 28px var(--gutter);
    color: var(--mist);
    font-size: 1rem;
    text-align: center;
}

/* Error page */
.error-page {
    max-width: 60ch;
    margin: 0 auto;
    padding: 12vh var(--gutter);
}

.error-page h1 { margin-bottom: 20px; }

.error-page p { margin-top: 12px; color: var(--mist); }

@media (max-width: 980px) {
    .browse,
    .product,
    .cart { grid-template-columns: minmax(0, 1fr); }

    .browse { gap: 24px; }

    .category-nav {
        display: flex;
        gap: 8px 22px;
        overflow-x: auto;
        padding-bottom: 6px;
    }

    .category-nav li { flex: none; }

    .category-nav span { display: none; }
}

/* Narrow screens: the flower takes the top, copy reads beneath the water. */
@media (max-width: 860px) {
    :root { --waterline: 350px; }

    .hero {
        height: auto;
        min-height: 0;
        padding: calc(var(--waterline) + 72px) var(--gutter) 24px;
    }

    .hero-copy {
        position: relative;
        left: auto;
        top: auto;
        translate: none;
        width: auto;
    }

    .hero h1 { font-size: clamp(2.5rem, 11vw, 3.75rem); }

    .bloom {
        left: 50%;
        right: auto;
        width: min(112vw, 560px);
        translate: -50% 0;
    }

    .reflection { opacity: 0.6; }

    .category-list > div,
    .audiences { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
    .cart-items li { grid-template-columns: auto minmax(0, 1fr) auto; }

    .cart-items form { grid-column: 2 / -1; }

    .product-title { flex-direction: column; align-items: flex-start; }

    .buy { padding: 20px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .lotus, .reflection { animation: none; }
}
