/* ═══════════════════════════════════════════════════════════════════════════
   PureSets static site (/ and /training) - shared design system.
   Plain CSS, no framework: these pages load before (and without) Blazor.
   Dark is the default identity; [data-theme="light"] on <html> switches it,
   using the same localStorage key as the app (app_theme).
   Motion: transform / opacity / filter only, custom ease-out curves, hover
   effects gated behind (hover: hover), everything calmer under
   prefers-reduced-motion.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
    --brand: #224c96;
    --brand-strong: #1a3d7c;
    --brand-bright: #3a72e0;
    --brand-glow: 79, 134, 255;

    --bg: #07080b;
    --bg-soft: #0c0e13;
    --surface: #111419;
    --surface-2: #171b22;
    --surface-3: #1e232c;
    --line: rgba(255, 255, 255, 0.07);
    --line-strong: rgba(255, 255, 255, 0.13);
    --text: #f3f5f9;
    --text-2: #a6aec0;
    --text-3: #6c7487;
    --accent-text: #8db0ff;
    --on-brand: #ffffff;
    --success: #34d399;
    --warning: #fbbf24;
    --pink: #f472b6;
    --violet: #a78bfa;
    --shadow-lg: 0 30px 80px -20px rgba(0, 0, 0, 0.7), 0 12px 30px -12px rgba(0, 0, 0, 0.6);
    --shadow-md: 0 14px 40px -16px rgba(0, 0, 0, 0.6);
    --glass: rgba(12, 14, 19, 0.62);
    --glass-line: rgba(255, 255, 255, 0.08);

    --font-display: "Inter Tight", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

    --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
    --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
    --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);

    --radius-xl: 32px;
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 12px;
    --page: 1200px;
    --gutter: clamp(16px, 4vw, 32px);
    --nav-h: 68px;

    color-scheme: dark;
    interpolate-size: allow-keywords;
}

:root[data-theme="light"] {
    --bg: #f5f6f9;
    --bg-soft: #eef0f5;
    --surface: #ffffff;
    --surface-2: #f3f5f9;
    --surface-3: #e9edf4;
    --line: rgba(12, 24, 48, 0.08);
    --line-strong: rgba(12, 24, 48, 0.15);
    --text: #0a0f1c;
    --text-2: #4b5569;
    --text-3: #8790a3;
    --accent-text: #224c96;
    --shadow-lg: 0 30px 80px -24px rgba(16, 32, 72, 0.28), 0 12px 30px -12px rgba(16, 32, 72, 0.16);
    --shadow-md: 0 14px 40px -18px rgba(16, 32, 72, 0.22);
    --glass: rgba(255, 255, 255, 0.7);
    --glass-line: rgba(12, 24, 48, 0.08);
    color-scheme: light;
}

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-h) + 12px);
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: clip;
    -webkit-tap-highlight-color: transparent;
}

/* Theme changes ease instead of flashing (enabled for a moment by site.js). */
html.theme-fade body,
html.theme-fade body *:not(.ps *) {
    transition: background-color 300ms ease, border-color 300ms ease, color 300ms ease !important;
}

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

a {
    color: inherit;
    text-decoration: none;
}

button {
    font: inherit;
    color: inherit;
}

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

::selection {
    background: rgba(var(--brand-glow), 0.35);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.container {
    width: 100%;
    max-width: calc(var(--page) + var(--gutter) * 2);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

/* ── Type scale: tracking tightens as size grows, leading loosens as it shrinks ── */
.display {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2.6rem, 6.4vw, 5.2rem);
    line-height: 1.02;
    letter-spacing: -0.035em;
    text-wrap: balance;
}

.h2 {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2rem, 4.2vw, 3.25rem);
    line-height: 1.06;
    letter-spacing: -0.03em;
    text-wrap: balance;
}

.h3 {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 650;
    font-size: clamp(1.3rem, 2vw, 1.6rem);
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.lead {
    margin: 0;
    color: var(--text-2);
    font-size: clamp(1.05rem, 1.4vw, 1.2rem);
    line-height: 1.6;
    text-wrap: pretty;
}

.muted {
    color: var(--text-2);
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent-text);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.gradient-text {
    background: linear-gradient(100deg, var(--text) 10%, var(--accent-text) 55%, #b9a6ff 95%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.section {
    position: relative;
    padding: clamp(80px, 11vw, 140px) 0;
}

.section-head {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 720px;
    margin-bottom: clamp(40px, 6vw, 64px);
}

.section-head.is-center {
    align-items: center;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

/* ── Buttons: feedback on press, never only on release ── */
.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    padding: 0 22px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: -0.005em;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    transition: transform 160ms var(--ease-out), background-color 200ms ease, border-color 200ms ease, box-shadow 200ms ease, color 200ms ease;
}

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

.btn-primary {
    background: var(--brand);
    color: var(--on-brand);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08) inset, 0 10px 30px -10px rgba(var(--brand-glow), 0.7);
}

.btn-ghost {
    border-color: var(--line-strong);
    background: transparent;
    color: var(--text);
}

.btn-light {
    background: #ffffff;
    color: #0a0f1c;
}

/* The top plan's button, in the tier gold the app uses for paid plans. */
.btn-gold {
    background: #d4af37;
    color: #1f1600;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12) inset, 0 10px 30px -12px rgba(212, 175, 55, 0.65);
}

@media (hover: hover) and (pointer: fine) {
    .btn-gold:hover {
        background: #c9a22c;
    }
}

.btn-sm {
    height: 38px;
    padding: 0 16px;
    font-size: 0.875rem;
}

.btn-lg {
    height: 56px;
    padding: 0 28px;
    font-size: 1rem;
}

.btn .bi-arrow-right {
    transition: transform 200ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
    .btn-primary:hover {
        background: var(--brand-bright);
        box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12) inset, 0 14px 36px -10px rgba(var(--brand-glow), 0.85);
    }

    .btn-ghost:hover {
        border-color: var(--text-3);
        background: var(--surface-2);
    }

    .btn-light:hover {
        background: #e9eefb;
    }

    .btn:hover .bi-arrow-right {
        transform: translateX(3px);
    }
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: transparent;
    color: var(--text-2);
    cursor: pointer;
    transition: transform 160ms var(--ease-out), color 200ms ease, background-color 200ms ease;
}

.icon-btn:active {
    transform: scale(0.94);
}

@media (hover: hover) and (pointer: fine) {
    .icon-btn:hover {
        color: var(--text);
        background: var(--surface-2);
    }
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text-2);
    font-size: 0.82rem;
    font-weight: 500;
}

/* ── Navigation: a translucent layer that content scrolls under ── */
.nav {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 50;
    height: var(--nav-h);
    transition: background-color 250ms ease, box-shadow 250ms ease;
}

.nav::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: var(--glass);
    -webkit-backdrop-filter: blur(18px) saturate(170%);
    backdrop-filter: blur(18px) saturate(170%);
    opacity: 0;
    transition: opacity 250ms ease;
}

.nav.is-scrolled::before,
.nav.is-open::before {
    opacity: 1;
}

.nav.is-scrolled {
    box-shadow: 0 1px 0 var(--glass-line);
}

.nav-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    height: 100%;
}

.brand {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

/* The PNG logo has a white "PURE", so the mark is drawn here and the word is live text. */
.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.logo svg {
    width: 30px;
    height: auto;
    color: var(--brand-bright);
}

:root[data-theme="light"] .logo svg {
    color: var(--brand);
}

.logo-word {
    font-family: var(--font-display);
    font-size: 1.02rem;
    letter-spacing: 0.24em;
    line-height: 1;
}

.logo-word b {
    font-weight: 700;
    color: var(--text);
}

.logo-word span {
    font-weight: 400;
    color: var(--text-3);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 999px;
    color: var(--text-2);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 200ms ease, background-color 200ms ease;
}

.nav-link.is-tool {
    color: var(--text);
}

.nav-link.is-tool i {
    color: var(--accent-text);
}

@media (hover: hover) and (pointer: fine) {
    .nav-link:hover {
        color: var(--text);
        background: var(--surface-2);
    }
}

.nav-sep {
    width: 1px;
    height: 18px;
    margin: 0 8px;
    background: var(--line-strong);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.nav-burger {
    display: none;
}

.nav-burger span {
    position: relative;
    display: block;
    width: 16px;
    height: 1.5px;
    border-radius: 2px;
    background: currentColor;
    transition: transform 300ms var(--ease-out), opacity 200ms ease;
}

.nav-burger span + span {
    margin-top: 4px;
}

.nav.is-open .nav-burger span:first-child {
    transform: translateY(2.75px) rotate(45deg);
}

.nav.is-open .nav-burger span:last-child {
    transform: translateY(-2.75px) rotate(-45deg);
}

/* Mobile sheet drops from the bar it belongs to and leaves the same way. */
.nav-sheet {
    position: fixed;
    inset: var(--nav-h) 0 auto 0;
    z-index: 49;
    display: none;
    padding: 8px var(--gutter) 24px;
    background: var(--glass);
    -webkit-backdrop-filter: blur(18px) saturate(170%);
    backdrop-filter: blur(18px) saturate(170%);
    border-bottom: 1px solid var(--glass-line);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: transform 320ms var(--ease-drawer), opacity 220ms ease, visibility 0s linear 320ms;
}

.nav.is-open + .nav-sheet {
    transform: none;
    opacity: 1;
    visibility: visible;
    transition: transform 380ms var(--ease-drawer), opacity 220ms ease, visibility 0s;
}

.nav-sheet a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 4px;
    border-bottom: 1px solid var(--line);
    font-size: 1.05rem;
    font-weight: 500;
}

.nav-sheet a i {
    color: var(--accent-text);
}

.nav-sheet .btn {
    width: 100%;
    margin-top: 16px;
    border-bottom: none;
}

@media (max-width: 1080px) {
    .nav-links .is-section {
        display: none;
    }

    .nav-sep {
        display: none;
    }
}

@media (max-width: 760px) {
    .nav-links,
    .nav-actions .hide-mobile {
        display: none;
    }

    .nav-burger {
        display: inline-flex;
        flex-direction: column;
    }

    .nav-sheet {
        display: block;
    }
}

/* ── Scroll reveal (only when JS runs; no-JS sees everything) ── */
.js [data-reveal] {
    opacity: 0;
    transform: translateY(18px);
    filter: blur(6px);
    transition: opacity 700ms var(--ease-out), transform 900ms var(--ease-out), filter 700ms var(--ease-out);
    transition-delay: var(--d, 0ms);
}

.js [data-reveal].is-in {
    opacity: 1;
    transform: none;
    filter: none;
}

/* ── Footer ── */
.footer {
    padding: 72px 0 40px;
    border-top: 1px solid var(--line);
    background: var(--bg-soft);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr repeat(4, 1fr);
    gap: 40px;
}

.footer-brand p {
    max-width: 280px;
    margin: 16px 0 20px;
    color: var(--text-2);
    font-size: 0.92rem;
}

.footer h4 {
    margin: 0 0 14px;
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 600;
}

.footer ul {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.footer ul a {
    color: var(--text-2);
    font-size: 0.9rem;
    transition: color 200ms ease;
}

@media (hover: hover) and (pointer: fine) {
    .footer ul a:hover {
        color: var(--text);
    }
}

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 56px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
    color: var(--text-3);
    font-size: 0.85rem;
}

.store-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.store-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 48px;
    padding: 0 16px 0 14px;
    border: 1px solid var(--line-strong);
    border-radius: 14px;
    background: var(--surface);
    transition: transform 160ms var(--ease-out), border-color 200ms ease;
}

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

.store-btn i {
    font-size: 22px;
}

.store-btn span {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.store-btn small {
    color: var(--text-3);
    font-size: 0.68rem;
    font-weight: 500;
}

.store-btn strong {
    font-size: 0.92rem;
    font-weight: 600;
}

.store-btn.is-soon {
    opacity: 0.55;
    pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
    .store-btn:hover {
        border-color: var(--text-3);
    }
}

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

    .footer-brand {
        grid-column: 1 / -1;
    }
}

/* ── Accessibility preferences ── */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .js [data-reveal] {
        transform: none;
        filter: none;
        transition: opacity 400ms ease;
    }

    .btn:active,
    .icon-btn:active,
    .store-btn:active {
        transform: none;
    }

    .nav-sheet,
    .nav.is-open + .nav-sheet {
        transform: none;
    }
}

@media (prefers-reduced-transparency: reduce) {
    .nav::before,
    .nav-sheet {
        background: var(--bg);
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }
}

@media (prefers-contrast: more) {
    :root {
        --line: rgba(255, 255, 255, 0.28);
        --line-strong: rgba(255, 255, 255, 0.4);
        --text-2: #d2d7e2;
    }

    :root[data-theme="light"] {
        --line: rgba(0, 0, 0, 0.3);
        --line-strong: rgba(0, 0, 0, 0.45);
        --text-2: #2c3446;
    }
}

/* Component display rules must not bring back something marked hidden. */
[hidden] {
    display: none !important;
}

.nav-link {
    white-space: nowrap;
}

/* Language button: two letters in the round icon button. */
.icon-btn.lang-btn {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
}
