/* Psychic UI's site: Pivotal's tokens (the library's default skin set), light and dark */

:root {
    --base: #fbfbfc;
    --surface: #f4f5f6;
    --raised: #ffffff;
    --line: rgb(0 0 0 / 8%);
    --line-strong: rgb(0 0 0 / 14%);
    --text: #1b1c1f;
    --text-secondary: #43484d;
    --text-muted: #646a70;
    --accent: #5e6ad2;
    --accent-text: #4c57c0;
    --dot: rgb(0 0 0 / 11%);
    --glow: rgb(94 106 210 / 22%);
    --shadow: 0 1px 0 rgb(0 0 0 / 4%), 0 24px 60px -18px rgb(20 22 40 / 28%);
    --code-bg: #f4f5f6;
    --tok-key: #7b3fe4;
    --tok-str: #1f7a4d;
    --tok-com: #7a8086;
    --tok-fn: #2759c4;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --base: #08090a;
        --surface: #0e0f11;
        --raised: #16171a;
        --line: rgb(255 255 255 / 7%);
        --line-strong: rgb(255 255 255 / 12%);
        --text: #f7f8f8;
        --text-secondary: #9ba1a6;
        --text-muted: #7a8086;
        --accent: #5e6ad2;
        --accent-text: #8d95ec;
        --dot: rgb(255 255 255 / 7%);
        --glow: rgb(94 106 210 / 30%);
        --shadow: 0 0 0 1px rgb(255 255 255 / 6%), 0 30px 80px -20px rgb(0 0 0 / 80%);
        --code-bg: #0e0f11;
        --tok-key: #b9a3ff;
        --tok-str: #7fd1a5;
        --tok-com: #6b7177;
        --tok-fn: #8db2ff;
        color-scheme: dark;
    }
}

:root[data-theme="dark"] {
    --base: #08090a;
    --surface: #0e0f11;
    --raised: #16171a;
    --line: rgb(255 255 255 / 7%);
    --line-strong: rgb(255 255 255 / 12%);
    --text: #f7f8f8;
    --text-secondary: #9ba1a6;
    --text-muted: #7a8086;
    --accent: #5e6ad2;
    --accent-text: #8d95ec;
    --dot: rgb(255 255 255 / 7%);
    --glow: rgb(94 106 210 / 30%);
    --shadow: 0 0 0 1px rgb(255 255 255 / 6%), 0 30px 80px -20px rgb(0 0 0 / 80%);
    --code-bg: #0e0f11;
    --tok-key: #b9a3ff;
    --tok-str: #7fd1a5;
    --tok-com: #6b7177;
    --tok-fn: #8db2ff;
    color-scheme: dark;
}

/* Float's violet when its skin set shows */
:root[data-set="float"] {
    --accent: #7357ff;
    --glow: rgb(115 87 255 / 24%);
}

* {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    background: var(--base);
    color: var(--text);
    font: 400 16px/1.6 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    font-feature-settings: "cv11", "ss01";
    -webkit-font-smoothing: antialiased;
    transition: background-color .25s ease, color .25s ease;
}

a {
    color: inherit;
}

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

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

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

/* region Navigation */

.nav {
    position: sticky;
    top: 0;
    z-index: 10;
    background: color-mix(in srgb, var(--base) 82%, transparent);
    backdrop-filter: blur(14px) saturate(1.4);
    -webkit-backdrop-filter: blur(14px) saturate(1.4);
    border-bottom: 1px solid var(--line);
}

.nav .wrap {
    display: flex;
    align-items: center;
    gap: 24px;
    height: 60px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    letter-spacing: -0.01em;
}

.mark {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 7px;
    background: var(--accent);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    transition: background-color .25s ease;
}

.nav-links {
    display: flex;
    gap: 22px;
    margin-left: auto;
    font-size: 14px;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
}

.nav-links a:hover {
    color: var(--text);
}

@media (max-width: 720px) {
    .nav-links .optional {
        display: none;
    }
}

/* endregion */

/* region Hero */

.hero {
    position: relative;
    padding: 88px 0 40px;
    overflow: hidden;
}

/* The library's own canvas: a dot grid fading out, the current set's accent glowing behind the capture */
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(var(--dot) 1px, transparent 1.4px);
    background-size: 16px 16px;
    background-position: 8px 8px;
    mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 30%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 30%, transparent 75%);
    pointer-events: none;
}

.hero-copy {
    position: relative;
    max-width: 820px;
}

.status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 28px;
    padding: 5px 12px 5px 8px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: var(--raised);
    color: var(--text-secondary);
    font-size: 13px;
}

.status .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4cb782;
    box-shadow: 0 0 0 3px rgb(76 183 130 / 20%);
}

h1 {
    margin: 0;
    font-size: clamp(40px, 7vw, 80px);
    line-height: 1.02;
    font-weight: 600;
    letter-spacing: -0.045em;
}

.lead {
    max-width: 640px;
    margin: 24px 0 0;
    color: var(--text-secondary);
    font-size: clamp(17px, 2vw, 20px);
    line-height: 1.55;
    letter-spacing: -0.01em;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 32px;
}

.button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 42px;
    padding: 0 18px;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    background: var(--raised);
    color: var(--text);
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    transition: border-color .15s ease, background-color .15s ease;
}

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

.button.primary {
    background: var(--accent);
    border-color: transparent;
    color: #fff;
}

.button.primary:hover {
    background: color-mix(in srgb, var(--accent) 88%, #fff);
}

.button svg {
    width: 16px;
    height: 16px;
}

/* The switcher: segmented controls, as the library draws them */
.switcher {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 20px;
    margin: 56px 0 20px;
    font-size: 13px;
    color: var(--text-muted);
}

.switcher .group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.segmented {
    display: inline-flex;
    padding: 3px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: var(--surface);
}

.segmented button {
    appearance: none;
    border: 0;
    margin: 0;
    padding: 0 14px;
    height: 30px;
    border-radius: 999px;
    background: transparent;
    color: var(--text-secondary);
    font: 500 13px/1 inherit;
    font-family: inherit;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease;
}

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

.segmented button[aria-pressed="true"] {
    background: var(--raised);
    color: var(--text);
    box-shadow: 0 0 0 1px var(--line-strong), 0 1px 2px rgb(0 0 0 / 12%);
}

.stage {
    position: relative;
}

.stage::before {
    content: "";
    position: absolute;
    inset: -6% -2% -10%;
    background: radial-gradient(closest-side, var(--glow), transparent);
    filter: blur(40px);
    pointer-events: none;
    transition: background .4s ease;
}

.shot {
    position: relative;
    margin: 0;
    border-radius: 14px;
    overflow: hidden;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.shot img {
    width: 100%;
    transition: opacity .2s ease;
}

.shot img.loading {
    opacity: .35;
}

.hero .shot {
    border-radius: 16px;
}

.caption {
    margin: 14px 0 0;
    color: var(--text-muted);
    font-size: 14px;
}

/* endregion */

/* region Sections */

section {
    padding: 96px 0 0;
}

h2 {
    margin: 0;
    font-size: clamp(28px, 4vw, 44px);
    line-height: 1.1;
    font-weight: 600;
    letter-spacing: -0.035em;
}

h3 {
    margin: 0;
    font-size: 17px;
    line-height: 1.4;
    font-weight: 600;
    letter-spacing: -0.015em;
}

.intro {
    max-width: 680px;
    margin: 16px 0 0;
    color: var(--text-secondary);
    font-size: 18px;
}

/* Ideas: a grid of short notes between hairlines, not boxes */
.ideas {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0 40px;
    margin-top: 48px;
}

.idea {
    padding: 24px 0 32px;
    border-top: 1px solid var(--line-strong);
}

.idea p {
    margin: 10px 0 0;
    color: var(--text-secondary);
    font-size: 15px;
}

.idea code,
.prose code {
    font: 500 0.88em/1 ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
    padding: 2px 5px;
    border-radius: 5px;
    background: var(--surface);
    border: 1px solid var(--line);
}

.icon {
    width: 22px;
    height: 22px;
    margin-bottom: 14px;
    color: var(--accent);
    transition: color .25s ease;
}

@media (max-width: 900px) {
    .ideas {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .ideas {
        grid-template-columns: 1fr;
    }
}

/* Code */
.split {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: 56px;
    align-items: start;
    margin-top: 0;
}

/* Grid items may shrink below their content, so code scrolls inside its block instead of widening the page */
.split > * {
    min-width: 0;
}

.prose p {
    color: var(--text-secondary);
    margin: 16px 0 0;
}

pre {
    margin: 0;
    padding: 22px 24px;
    overflow-x: auto;
    border-radius: 14px;
    background: var(--code-bg);
    border: 1px solid var(--line);
    font: 400 13.5px/1.65 ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
    tab-size: 4;
}

pre + pre {
    margin-top: 16px;
}

.k { color: var(--tok-key); }
.s { color: var(--tok-str); }
.c { color: var(--tok-com); font-style: italic; }
.f { color: var(--tok-fn); }

@media (max-width: 900px) {
    .split {
        grid-template-columns: 1fr;
        gap: 32px;
    }
}

/* Skin sets */
.sets {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 40px 0 28px;
}

.set {
    appearance: none;
    text-align: left;
    padding: 18px 20px;
    border-radius: 14px;
    border: 1px solid var(--line-strong);
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease;
}

.set:hover {
    border-color: var(--text-muted);
}

.set[aria-pressed="true"] {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 7%, transparent);
}

.set p {
    margin: 6px 0 0;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
}

@media (max-width: 760px) {
    .sets {
        grid-template-columns: 1fr;
    }
}

/* Gallery */
.group-title {
    margin: 64px 0 20px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: -0.005em;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 40px 28px;
}

.gallery .wide {
    grid-column: 1 / -1;
}

.tile {
    margin: 0;
}

.zoomable {
    appearance: none;
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    font: inherit;
    cursor: zoom-in;
}

.tile figcaption {
    margin-top: 14px;
}

.tile figcaption p {
    margin: 4px 0 0;
    color: var(--text-secondary);
    font-size: 15px;
}

@media (max-width: 760px) {
    .gallery {
        grid-template-columns: 1fr;
    }
}

/* Pointer and touch, side by side */
.pair {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px;
    margin-top: 40px;
}

@media (max-width: 640px) {
    .pair {
        grid-template-columns: 1fr;
    }
}

/* Getting started */
.steps {
    margin-top: 32px;
}

/* endregion */

/* region Footer */

footer {
    margin-top: 120px;
    padding: 40px 0 56px;
    border-top: 1px solid var(--line);
    color: var(--text-muted);
    font-size: 14px;
}

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

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

footer a {
    color: var(--text-secondary);
    text-decoration: none;
}

footer a:hover {
    color: var(--text);
}

/* endregion */

/* region Zoom */

dialog.zoom {
    width: min(1400px, 100vw - 32px);
    max-height: calc(100vh - 32px);
    padding: 0;
    border: 0;
    border-radius: 16px;
    background: var(--surface);
    box-shadow: var(--shadow);
    overflow: auto;
    cursor: zoom-out;
}

dialog.zoom::backdrop {
    background: rgb(0 0 0 / 55%);
    backdrop-filter: blur(4px);
}

dialog.zoom[open] {
    animation: zoom-in .18s ease-out;
}

@keyframes zoom-in {
    from {
        opacity: 0;
        transform: scale(.97);
    }
}

/* endregion */

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

    *,
    *::before {
        transition: none !important;
        animation: none !important;
    }
}
