/* Prismatic marketing pages.
 *
 * The page background is a real Prismatic gradient. The four styles below are
 * the four the app renders, built from the same inputs the app uses — a color
 * list, an angle, and a center — and assets/gradient.js picks one at random on
 * every load. It supplies only those inputs; how each style is drawn lives
 * here, so the two can't drift apart.
 *
 * Because the palette is random, no text is ever placed straight onto it.
 * Everything readable sits on a translucent panel over a scrim, which keeps
 * contrast the same whether the roll comes up pastel or near-black. */

:root {
    color-scheme: light dark;

    /* Overwritten by gradient.js before first paint. These values are what the
     * page looks like with JavaScript off, which is a supported way to read
     * it — the site is prose plus screenshots, and none of it needs script. */
    --stops: #4a5cdb, #d94f9e;
    --angle: 160deg;
    --cx: 50%;
    --cy: 45%;

    --bg: #f4f4f8;
    --fg: #15151a;
    --muted: #55555f;
    --rule: rgba(20, 20, 40, 0.12);
    --surface: rgba(255, 255, 255, 0.86);
    --surface-strong: rgba(255, 255, 255, 0.94);
    /* Deliberately light. Everything that has to be read sits on a panel, so
     * the scrim's only job is to stop the brightest palettes glaring — not to
     * carry contrast. Pushed much past this and the pastel palettes turn to
     * mud, which is a poor advert for a gradient app. */
    --scrim: rgba(244, 244, 248, 0.38);
    --shadow: 0 18px 50px rgba(20, 20, 50, 0.14);

    --accent: #4a5cdb;
    --accent-ink: #ffffff;

    --max: 64rem;
    --prose: 44rem;
    --radius: 1.25rem;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0c0c10;
        --fg: #f3f3f7;
        --muted: #a6a6b4;
        --rule: rgba(255, 255, 255, 0.14);
        --surface: rgba(18, 18, 24, 0.82);
        --surface-strong: rgba(18, 18, 24, 0.92);
        --scrim: rgba(10, 10, 14, 0.42);
        --shadow: 0 18px 50px rgba(0, 0, 0, 0.5);

        --accent: #8b98ff;
        --accent-ink: #101018;
    }
}

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

html {
    -webkit-text-size-adjust: 100%;
    background: var(--bg);
}

body {
    margin: 0;
    /* Transparent so the fixed gradient behind it is what shows through; a
     * background here would paint straight over it. */
    background: none;
    color: var(--fg);
    font: 16px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---- The gradient itself ---------------------------------------------- */

.backdrop {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
}

.backdrop-fill {
    position: absolute;
    /* Oversized because the wavy filter displaces pixels outward; at inset 0
     * that would drag the element's own edge into view as a torn border. */
    inset: -15%;
    background-image: var(--grad);
}

.backdrop-scrim {
    position: absolute;
    inset: 0;
    background: var(--scrim);
}

/* The <svg> holding the wave filters. It renders nothing, so it's taken out of
 * flow rather than left as a zero-sized box that still takes a line. */
.filters {
    position: absolute;
    width: 0;
    height: 0;
}

/* The four styles. Only `--grad` differs; the inputs are shared, which is what
 * makes them comparable at a glance the way they are in the app. */

:root { --grad: linear-gradient(var(--angle), var(--stops)); }

:root[data-style="radial"] {
    /* farthest-corner matches the app, which sizes the ramp to the furthest
     * corner so it still resolves when the center is dragged off-middle. */
    --grad: radial-gradient(circle farthest-corner at var(--cx) var(--cy), var(--stops));
}

:root[data-style="angular"] {
    /* No repeat of the first color at the end: the app's sweep runs the stop
     * list once around and meets itself, seam and all. */
    --grad: conic-gradient(from var(--angle) at var(--cx) var(--cy), var(--stops));
}

:root[data-style="wavy"] .backdrop-fill {
    filter: url(#prismatic-wave);
}

.is-fading .backdrop-fill,
.is-fading .chip {
    opacity: 0;
}

.backdrop-fill, .chip {
    transition: opacity 0.2s ease;
}

@media (prefers-reduced-motion: reduce) {
    .backdrop-fill, .chip { transition: none; }
}

/* ---- Layout ------------------------------------------------------------ */

.container {
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 1.25rem;
}

.panel {
    background: var(--surface);
    -webkit-backdrop-filter: saturate(1.6) blur(18px);
    backdrop-filter: saturate(1.6) blur(18px);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

main { padding-bottom: 1rem; }

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

.site-header {
    padding: 1rem 1.25rem;
}

/* The nav is one of the few things sitting straight on the gradient, so it
 * gets the same panel backing as everything else rather than relying on the
 * scrim to keep it legible against an unknown palette. */
.site-header .bar {
    max-width: var(--max);
    margin: 0 auto;
    padding: 0.7rem 1.1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    border-radius: 999px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 650;
    color: inherit;
    text-decoration: none;
}

.brand-mark {
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 0.5rem;
    background-image: var(--grad);
    border: 1px solid var(--rule);
}

.site-header nav a {
    color: var(--fg);
    text-decoration: none;
    margin-left: 1.1rem;
    font-size: 0.95rem;
    opacity: 0.72;
}

.site-header nav a:hover,
.site-header nav a:focus-visible { opacity: 1; }

/* ---- Hero -------------------------------------------------------------- */

.hero { padding: 1.5rem 0 3rem; }

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 2rem;
    align-items: center;
}

@media (max-width: 56rem) {
    .hero-grid { grid-template-columns: 1fr; }
}

.hero-copy { padding: 2rem; }

.eyebrow {
    margin: 0 0 0.6rem;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--accent);
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    line-height: 1.1;
    margin: 0 0 0.85rem;
    letter-spacing: -0.025em;
}

.lede {
    font-size: 1.1rem;
    color: var(--muted);
    margin: 0 0 1.5rem;
}

.cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin: 0 0 1.1rem;
}

.quiet {
    color: var(--muted);
    font-size: 0.9rem;
    margin: 0;
}

.button {
    display: inline-block;
    background: var(--accent);
    color: var(--accent-ink);
    padding: 0.72rem 1.2rem;
    border: 1px solid transparent;
    border-radius: 0.7rem;
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.button:hover, .button:focus-visible { filter: brightness(1.1); }

.button.ghost {
    background: transparent;
    color: var(--fg);
    border-color: var(--rule);
}

.button.ghost:hover, .button.ghost:focus-visible {
    filter: none;
    border-color: var(--accent);
    color: var(--accent);
}

/* ---- Device shots ------------------------------------------------------ */

.device {
    margin: 0;
    border-radius: 2rem;
    border: 1px solid var(--rule);
    background: var(--surface-strong);
    padding: 0.5rem;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.device img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 1.6rem;
}

.hero-shot { justify-self: center; max-width: 20rem; width: 100%; }

.shots {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
    gap: 1.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.shots figcaption {
    margin-top: 0.6rem;
    font-size: 0.9rem;
    color: var(--muted);
    text-align: center;
}

.shots .device { margin-bottom: 0; }

/* ---- Style chips ------------------------------------------------------- */

.chips {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
    gap: 1rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.chips li {
    padding: 1rem;
    border: 1px solid var(--rule);
    border-radius: 1rem;
    background: var(--surface-strong);
}

.chip {
    display: block;
    height: 5.5rem;
    border-radius: 0.7rem;
    border: 1px solid var(--rule);
    margin-bottom: 0.7rem;
}

/* Each chip forces one style, so all four are on screen together no matter
 * which one the page background drew. */
.chip-linear  { background-image: linear-gradient(135deg, var(--stops)); }
.chip-radial  { background-image: radial-gradient(circle farthest-corner at 35% 35%, var(--stops)); }
.chip-angular { background-image: conic-gradient(from 0deg at 50% 50%, var(--stops)); }

/* Wavy is the one style CSS has no gradient function for, so it's a linear
 * ramp pushed through an SVG displacement filter. The filter would drag the
 * chip's own rounded corners out of shape too, so the gradient goes on an
 * oversized child and the chip clips it back to a clean edge. */
.chip-wavy {
    position: relative;
    overflow: hidden;
}

.chip-wavy::before {
    content: "";
    position: absolute;
    inset: -30%;
    background-image: linear-gradient(135deg, var(--stops));
    filter: url(#prismatic-wave-small);
}

.chips b { display: block; font-size: 1rem; }
.chips span:last-child { color: var(--muted); font-size: 0.9rem; }

/* ---- Cards ------------------------------------------------------------- */

.section { padding: 2.5rem 0; }

.section > .container > h2 {
    font-size: clamp(1.5rem, 3.5vw, 2rem);
    letter-spacing: -0.02em;
    margin: 0 0 0.4rem;
}

.section-lede {
    color: var(--muted);
    margin: 0 0 1.75rem;
    max-width: var(--prose);
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    gap: 1.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.cards li {
    padding: 1.4rem;
    border: 1px solid var(--rule);
    border-radius: 1rem;
    background: var(--surface-strong);
}

.cards h3 { margin: 0 0 0.4rem; font-size: 1.05rem; }
.cards p { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* ---- Prose (support, privacy) ------------------------------------------ */

.prose {
    max-width: var(--prose);
    margin: 1.5rem auto 2rem;
    padding: 2rem;
}

.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }

.prose h1 {
    font-size: clamp(1.7rem, 4.5vw, 2.2rem);
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.prose h2 {
    margin-top: 2.25rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--rule);
    font-size: 1.3rem;
}

.prose h3 {
    margin-top: 1.6rem;
    font-size: 1.05rem;
}

.prose a, .cards a, .quiet a { color: var(--accent); }

.prose code {
    background: rgba(128, 128, 150, 0.16);
    padding: 0.1em 0.35em;
    border-radius: 0.25rem;
    font-size: 0.9em;
}

.updated {
    color: var(--muted);
    font-size: 0.88rem;
    margin-top: -0.25rem;
}

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

.site-footer {
    margin-top: 2rem;
    padding: 0 1.25rem 2.5rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.site-footer .row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1.1rem 1.5rem;
}

.site-footer nav a {
    color: var(--muted);
    text-decoration: none;
    margin-right: 1rem;
}

.site-footer nav a:hover, .site-footer nav a:focus-visible { color: var(--fg); }
