/* ==========================================================================
   SpacePill — spacepill.dev
   Dark-first design system. The pill is the brand: every accent on this page
   is one of the pill colours from the app itself.
   ========================================================================== */

/* ---------- Tokens ---------- */

:root {
    /* Dark is the default: the product lives in a dark menu bar. */
    color-scheme: dark light;

    --bg: #0b0e17;
    --bg-raised: #11162290;
    --surface: #131928;
    --surface-2: #1a2135;
    --border: rgba(148, 163, 200, 0.16);
    --border-strong: rgba(148, 163, 200, 0.28);
    --text: #eef1f8;
    --text-muted: #a4aec5;
    --text-faint: #7d88a3;
    --accent: #5b9dff;
    --accent-strong: #7fb3ff;
    --link: #8ab6ff;

    /* Pill palette (matches the app's colour picker) */
    --pill-red: #e8503e;
    --pill-crimson: #e0435c;
    --pill-blue: #3d7bfd;
    --pill-green: #43b45a;
    --pill-purple: #a35ce0;
    --pill-orange: #f5960f;

    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.35), 0 16px 48px -12px rgba(0, 0, 0, 0.55);
    --shadow-pill: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 2px 6px rgba(0, 0, 0, 0.45);

    --radius: 14px;
    --radius-lg: 20px;

    --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
        Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Monaco,
        "Cascadia Mono", monospace;

    --container: 1080px;
    --gutter: clamp(1.25rem, 5vw, 2.5rem);
    --section-pad: clamp(4.5rem, 10vw, 7.5rem);
}

@media (prefers-color-scheme: light) {
    :root {
        --bg: #f6f7fb;
        --bg-raised: #ffffffcc;
        --surface: #ffffff;
        --surface-2: #eef1f8;
        --border: rgba(23, 30, 51, 0.12);
        --border-strong: rgba(23, 30, 51, 0.22);
        --text: #171d2e;
        --text-muted: #4d5871;
        --text-faint: #6b7690;
        --accent: #0a5ce0;
        --accent-strong: #0a4fc2;
        --link: #0a5ce0;

        --shadow-card: 0 1px 2px rgba(23, 30, 51, 0.06), 0 16px 40px -12px rgba(23, 30, 51, 0.18);
    }
}

/* ---------- Base ---------- */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

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

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 1.0625rem;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

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

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

a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

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

::selection {
    background: color-mix(in srgb, var(--accent) 35%, transparent);
}

kbd {
    font-family: var(--font);
    font-size: 0.82em;
    font-weight: 600;
    padding: 0.15em 0.5em;
    border-radius: 6px;
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    border-bottom-width: 2px;
    color: var(--text);
    white-space: nowrap;
}

code {
    font-family: var(--mono);
    font-size: 0.9em;
}

p > code,
li > code {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.1em 0.35em;
}

section {
    scroll-margin-top: 5rem;
}

.container {
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.skip-link {
    position: absolute;
    left: 1rem;
    top: -3.5rem;
    z-index: 100;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: top 0.15s ease;
}

.skip-link:focus {
    top: 1rem;
}

/* ---------- The pill (CSS recreation of the product) ---------- */

.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    padding: 0.28em 1.1em 0.28em 0.3em;
    border-radius: 999px;
    background: var(--pill-color, var(--pill-green));
    border: 2px solid rgba(0, 0, 0, 0.55);
    box-shadow: var(--shadow-pill);
    color: #fff;
    font-weight: 800;
    font-size: 1em;
    letter-spacing: 0.08em;
    line-height: 1;
    white-space: nowrap;
}

.pill .num {
    display: inline-grid;
    place-items: center;
    inline-size: 1.55em;
    block-size: 1.55em;
    border-radius: 50%;
    background: color-mix(in srgb, var(--pill-color, var(--pill-green)) 45%, #000);
    border: 2px solid rgba(0, 0, 0, 0.6);
    font-size: 0.9em;
    letter-spacing: 0;
    font-weight: 800;
    color: #fff;
}

.pill .label {
    text-transform: uppercase;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--bg-raised);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--border);
}

.site-header .container {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    min-height: 3.5rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text);
    letter-spacing: -0.01em;
}

.brand:hover {
    text-decoration: none;
}

.brand svg {
    display: block;
}

.site-nav {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: clamp(0.75rem, 2.5vw, 1.75rem);
}

.site-nav a {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
}

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

.site-nav .nav-github {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--text);
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    padding: 0.35rem 0.9rem;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.site-nav .nav-github:hover {
    background: var(--surface-2);
    border-color: var(--text-faint);
}

@media (max-width: 640px) {
    .site-nav .nav-hide-sm {
        display: none;
    }
}

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

.hero {
    position: relative;
    padding-block: clamp(4rem, 9vw, 7rem) clamp(3.5rem, 7vw, 5.5rem);
    text-align: center;
    overflow: clip;
}

/* Deep-space glow behind the hero — visible in dark, whisper-quiet in light. */
.hero::before {
    content: "";
    position: absolute;
    inset: -20% -10% auto;
    height: 120%;
    background:
        radial-gradient(38% 45% at 24% 12%, color-mix(in srgb, var(--pill-blue) 22%, transparent), transparent 70%),
        radial-gradient(34% 40% at 78% 8%, color-mix(in srgb, var(--pill-purple) 18%, transparent), transparent 70%),
        radial-gradient(30% 34% at 55% 32%, color-mix(in srgb, var(--pill-green) 9%, transparent), transparent 70%);
    pointer-events: none;
    z-index: -1;
}

@media (prefers-color-scheme: light) {
    .hero::before {
        opacity: 0.45;
    }
}

.hero .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted);
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    padding: 0.35rem 1rem;
    background: var(--surface);
}

.hero h1 {
    margin-top: 1.5rem;
    font-size: clamp(2.35rem, 6.5vw, 4.1rem);
    line-height: 1.05;
    letter-spacing: -0.035em;
    font-weight: 800;
    text-wrap: balance;
}

.hero h1 .accent-word {
    background: linear-gradient(100deg, var(--pill-blue), var(--pill-purple));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero .lede {
    margin: 1.4rem auto 0;
    max-width: 42rem;
    font-size: clamp(1.05rem, 2vw, 1.25rem);
    color: var(--text-muted);
    text-wrap: pretty;
}

/* The fake menu bar with the live pill */
.menubar-demo {
    margin: 3rem auto 0;
    max-width: 34rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.55rem 1.1rem;
    border-radius: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-card);
    font-size: clamp(0.95rem, 2.4vw, 1.1rem);
}

.menubar-demo .pill {
    transition: background 0.35s ease;
}

.menubar-demo .pill .num {
    transition: background 0.35s ease;
}

.menubar-demo .status {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    color: var(--text-faint);
}

.menubar-demo .status svg {
    display: block;
    opacity: 0.75;
}

.menubar-demo .clock {
    font-size: 0.85em;
    font-weight: 500;
    white-space: nowrap;
    color: var(--text-muted);
}

@media (max-width: 480px) {
    .menubar-demo .status svg:nth-child(2) {
        display: none;
    }
}

.hero .hero-hint {
    margin-top: 0.9rem;
    font-size: 0.85rem;
    color: var(--text-faint);
}

/* ---------- Install row ---------- */

.install {
    margin: 2.5rem auto 0;
    max-width: 36rem;
}

.install-cmd {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #0d1120;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 0.55rem 0.55rem 0.55rem 1.1rem;
    box-shadow: var(--shadow-card);
    text-align: left;
}

@media (prefers-color-scheme: light) {
    .install-cmd {
        background: #101527;
    }
}

.install-cmd code {
    flex: 1;
    min-width: 0;
    font-size: clamp(0.72rem, 2.35vw, 0.92rem);
    color: #dbe4ff;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
    padding-block: 0.3rem;
}

.install-cmd code .prompt {
    color: #5b9dff;
    user-select: none;
}

.copy-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--font);
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    background: var(--pill-blue);
    border: none;
    border-radius: 9px;
    padding: 0.55rem 0.95rem;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
}

.copy-btn:hover {
    background: color-mix(in srgb, var(--pill-blue) 85%, #fff);
}

.copy-btn:active {
    transform: scale(0.97);
}

.copy-btn.copied {
    background: var(--pill-green);
}

.install-alt {
    margin-top: 0.9rem;
    font-size: 0.9rem;
    color: var(--text-faint);
}

.install-badges {
    margin-top: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 1.4rem;
    font-size: 0.85rem;
    color: var(--text-faint);
}

.install-badges span {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.install-badges .dot {
    inline-size: 5px;
    block-size: 5px;
    border-radius: 50%;
    background: var(--pill-green);
}

/* ---------- Sections ---------- */

.section {
    padding-block: var(--section-pad);
    border-top: 1px solid var(--border);
}

.section-head {
    max-width: 40rem;
    margin-bottom: clamp(2.5rem, 6vw, 4rem);
}

.section-head .kicker {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
}

.section-head h2 {
    margin-top: 0.6rem;
    font-size: clamp(1.7rem, 4vw, 2.5rem);
    line-height: 1.15;
    letter-spacing: -0.025em;
    font-weight: 800;
    text-wrap: balance;
}

.section-head p {
    margin-top: 0.9rem;
    color: var(--text-muted);
    font-size: 1.05rem;
    text-wrap: pretty;
}

/* ---------- Demo video ---------- */

.demo-frame {
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow-card);
    background: var(--surface);
}

.demo-frame video {
    width: 100%;
}

.demo-caption {
    margin-top: 1rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-faint);
}

/* ---------- Feature rows ---------- */

.feature {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: clamp(2rem, 5vw, 4.5rem);
    align-items: center;
    padding-block: clamp(2.25rem, 5vw, 3.75rem);
}

.feature + .feature {
    border-top: 1px solid var(--border);
}

.feature.flip .feature-copy {
    order: 2;
}

.feature h3 {
    font-size: clamp(1.35rem, 2.8vw, 1.75rem);
    letter-spacing: -0.02em;
    line-height: 1.2;
    font-weight: 750;
    text-wrap: balance;
}

.feature .hotkey {
    display: inline-flex;
    gap: 0.25rem;
    margin-bottom: 0.9rem;
}

.feature p {
    margin-top: 0.9rem;
    color: var(--text-muted);
    text-wrap: pretty;
}

.feature .shot {
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow-card);
    background: var(--surface);
}

.feature .shot img {
    width: 100%;
}

.feature .shot.shot-pad {
    padding: clamp(1.5rem, 4vw, 2.75rem);
    background:
        radial-gradient(120% 130% at 20% 0%, color-mix(in srgb, var(--pill-blue) 16%, transparent), transparent 60%),
        var(--surface);
    display: grid;
    place-items: center;
}

.feature .shot.shot-pad img {
    width: min(100%, 300px);
    border-radius: 10px;
}

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

    .feature.flip .feature-copy {
        order: 0;
    }
}

/* ---------- Terminal ---------- */

.cli-grid {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: clamp(2rem, 5vw, 4rem);
    align-items: start;
}

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

.cli-copy p {
    margin-top: 0.9rem;
    color: var(--text-muted);
    text-wrap: pretty;
}

.cli-commands {
    margin-top: 1.4rem;
    list-style: none;
    display: grid;
    gap: 0.55rem;
    font-size: 0.95rem;
}

.cli-commands li {
    display: flex;
    gap: 0.75rem;
    align-items: baseline;
    color: var(--text-muted);
}

.cli-commands code {
    flex-shrink: 0;
    min-width: 9.5ch;
    color: var(--text);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.1em 0.5em;
}

.terminal {
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow-card);
    background: #0d1120;
    font-family: var(--mono);
    font-size: clamp(0.78rem, 1.8vw, 0.9rem);
    line-height: 1.7;
    color: #c8d3ee;
}

.terminal-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1rem;
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.terminal-bar .light {
    inline-size: 11px;
    block-size: 11px;
    border-radius: 50%;
    background: #3a4157;
}

.terminal-bar .light:nth-child(1) { background: #ff5f57; }
.terminal-bar .light:nth-child(2) { background: #febc2e; }
.terminal-bar .light:nth-child(3) { background: #28c840; }

.terminal-bar .title {
    margin-inline: auto;
    transform: translateX(-1.6rem);
    font-size: 0.8em;
    color: #7d88a3;
    font-family: var(--font);
}

.terminal pre {
    margin: 0;
    padding: 1.1rem 1.25rem 1.3rem;
    overflow-x: auto;
}

.terminal .t-prompt { color: #5b9dff; }
.terminal .t-cmd { color: #eef1f8; font-weight: 600; }
.terminal .t-dim { color: #67718c; }
.terminal .t-ok { color: #4ade80; }
.terminal .t-dot-crimson { color: var(--pill-crimson); }
.terminal .t-dot-blue { color: #6296ff; }
.terminal .t-dot-red { color: #ff7a5c; }
.terminal .t-dot-green { color: #4ade80; }
.terminal .t-dot-purple { color: #c084fc; }

/* ---------- Values ---------- */

.values-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    gap: 1rem;
}

.value-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.4rem 1.5rem;
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.value-card:hover {
    border-color: var(--border-strong);
    transform: translateY(-2px);
}

.value-card h3 {
    font-size: 1.02rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.value-card h3 .swatch {
    inline-size: 10px;
    block-size: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.value-card p {
    margin-top: 0.5rem;
    font-size: 0.92rem;
    color: var(--text-muted);
    text-wrap: pretty;
}

/* ---------- Caveat aside ---------- */

.caveat {
    margin-top: clamp(2.5rem, 6vw, 4rem);
    border: 1px solid color-mix(in srgb, var(--pill-orange) 45%, var(--border));
    background: color-mix(in srgb, var(--pill-orange) 7%, var(--surface));
    border-radius: var(--radius);
    padding: 1.4rem 1.6rem;
    font-size: 0.97rem;
    color: var(--text-muted);
}

.caveat strong {
    color: var(--text);
}

/* ---------- Closing CTA ---------- */

.cta {
    text-align: center;
}

.cta h2 {
    font-size: clamp(1.8rem, 4.5vw, 2.75rem);
    letter-spacing: -0.03em;
    font-weight: 800;
    text-wrap: balance;
}

.cta .lede {
    margin: 1rem auto 0;
    max-width: 34rem;
    color: var(--text-muted);
}

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

.site-footer {
    border-top: 1px solid var(--border);
    padding-block: 2.5rem 3rem;
    font-size: 0.9rem;
    color: var(--text-faint);
}

.site-footer .container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 2rem;
    align-items: center;
}

.site-footer nav {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-left: auto;
}

.site-footer a {
    color: var(--text-muted);
}

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

@media (max-width: 640px) {
    .site-footer .container {
        flex-direction: column;
        align-items: flex-start;
    }

    .site-footer nav {
        margin-left: 0;
    }
}

/* ---------- 404 ---------- */

.notfound {
    min-height: 70vh;
    display: grid;
    place-items: center;
    text-align: center;
    padding-block: 4rem;
}

.notfound .pill {
    font-size: 1.35rem;
    --pill-color: #8b93a8;
    opacity: 0.85;
}

.notfound h1 {
    margin-top: 1.75rem;
    font-size: clamp(2rem, 5vw, 3rem);
    letter-spacing: -0.03em;
    font-weight: 800;
}

.notfound p {
    margin-top: 1rem;
    color: var(--text-muted);
    max-width: 28rem;
}

.notfound .actions {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 999px;
    padding: 0.6rem 1.4rem;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
    background: var(--pill-blue);
    color: #fff;
}

.btn-primary:hover {
    background: color-mix(in srgb, var(--pill-blue) 85%, #fff);
    text-decoration: none;
}

.btn-ghost {
    border: 1px solid var(--border-strong);
    color: var(--text);
}

.btn-ghost:hover {
    background: var(--surface-2);
    text-decoration: none;
}
