/* PowderKeg Intelligence — shared design system */

:root {
    --pk-bg: #050208;
    --pk-bg-soft: #0b0612;
    --pk-surface: rgba(20, 10, 35, 0.55);
    --pk-surface-strong: rgba(15, 8, 28, 0.75);
    --pk-border: rgba(168, 138, 255, 0.14);
    --pk-border-strong: rgba(168, 138, 255, 0.28);
    --pk-text: #ECE6F5;
    --pk-muted: #9C92B0;
    --pk-dim: #6E667F;
    --pk-violet: #8B5CF6;
    --pk-violet-2: #A78BFA;
    --pk-violet-3: #C7B2FF;
    --pk-violet-4: #DCADEC;
    --pk-violet-deep: #6000E5;
    --pk-accent: #6E48FF;
    --pk-danger: #FF4F6E;
    --pk-warn: #FFB547;
    --pk-success: #34D399;
    --pk-radius: 14px;
    --pk-radius-lg: 22px;
    --pk-shadow-glow: 0 0 60px -10px rgba(140, 80, 255, 0.45);
    --pk-shadow-card: 0 30px 80px -30px rgba(0, 0, 0, 0.9), 0 0 0 1px var(--pk-border);
    --pk-font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --pk-font-display: 'Space Grotesk', 'Inter', sans-serif;
    --pk-font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
    margin: 0;
    background: var(--pk-bg);
    color: var(--pk-text);
    font-family: var(--pk-font-sans);
    font-feature-settings: "ss01", "cv11";
    overflow-x: hidden;
}

::selection { background: rgba(139, 92, 246, 0.4); color: #fff; }

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

/* ---------- Background system ---------- */

.pk-bg-shell {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    background:
        radial-gradient(1200px 700px at 12% -10%, rgba(96, 0, 229, 0.35), transparent 60%),
        radial-gradient(900px 600px at 100% 10%, rgba(220, 173, 236, 0.18), transparent 65%),
        radial-gradient(1100px 700px at 50% 110%, rgba(110, 72, 255, 0.28), transparent 60%),
        var(--pk-bg);
}

.pk-bg-grid {
    position: absolute;
    inset: -2px;
    background-image:
        linear-gradient(rgba(168, 138, 255, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(168, 138, 255, 0.06) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse at 50% 30%, #000 30%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse at 50% 30%, #000 30%, transparent 75%);
}

.pk-bg-noise {
    position: absolute;
    inset: 0;
    opacity: 0.05;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='0.5'/></svg>");
}

.pk-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.55;
    animation: pk-float 18s ease-in-out infinite;
    will-change: transform;
}

.pk-orb-1 { width: 520px; height: 520px; left: -120px; top: -100px; background: radial-gradient(circle, #6000E5 0%, transparent 70%); }
.pk-orb-2 { width: 600px; height: 600px; right: -180px; top: 20%; background: radial-gradient(circle, #B57BFF 0%, transparent 65%); animation-delay: -6s; opacity: 0.35; }
.pk-orb-3 { width: 700px; height: 700px; left: 25%; bottom: -260px; background: radial-gradient(circle, #4A1AB0 0%, transparent 70%); animation-delay: -12s; opacity: 0.5; }

@keyframes pk-float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%      { transform: translate(40px, -30px) scale(1.05); }
    66%      { transform: translate(-30px, 25px) scale(0.97); }
}

.pk-spotlight {
    position: fixed;
    pointer-events: none;
    width: 700px; height: 700px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(167, 139, 250, 0.18) 0%, rgba(167, 139, 250, 0) 60%);
    transform: translate(-50%, -50%);
    z-index: 1;
    transition: opacity 0.4s ease;
    mix-blend-mode: screen;
}

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

.pk-page { position: relative; z-index: 2; }

.pk-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

@media (min-width: 768px) {
    .pk-container { padding: 0 40px; }
}

/* ---------- Nav ---------- */

.pk-nav {
    position: sticky; top: 0;
    z-index: 50;
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    background: rgba(5, 2, 8, 0.55);
    border-bottom: 1px solid rgba(168, 138, 255, 0.08);
}

.pk-nav-inner {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 8px;
    gap: 12px;
}
@media (min-width: 768px) {
    .pk-nav-inner { padding: 16px 12px; }
}

.pk-brand {
    display: flex; align-items: center; gap: 10px;
    font-family: var(--pk-font-display);
    font-weight: 600;
    letter-spacing: -0.01em;
    color: #fff;
    font-size: 15px;
    white-space: nowrap;
}
.pk-brand img { width: 26px; height: 26px; }
.pk-brand-text { display: inline; }
.pk-brand-text-short { display: none; }
@media (max-width: 480px) {
    .pk-brand-text { display: none; }
    .pk-brand-text-short { display: inline; }
}

.pk-nav-links {
    display: none; align-items: center; gap: 28px;
    font-size: 14px; color: var(--pk-muted);
}
.pk-nav-links a { transition: color .25s; }
.pk-nav-links a:hover { color: #fff; }

@media (min-width: 720px) {
    .pk-nav-links { display: flex; }
}

/* ---------- Buttons ---------- */

.pk-btn {
    position: relative;
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 20px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: transform .25s ease, box-shadow .25s ease, background .25s ease, border-color .25s ease;
    border: 1px solid transparent;
    white-space: nowrap;
    text-decoration: none;
}
.pk-btn:hover { transform: translateY(-1px); }
.pk-btn:active { transform: translateY(0); }

.pk-btn-primary {
    color: #fff;
    background: linear-gradient(135deg, #8B5CF6 0%, #6000E5 50%, #B57BFF 100%);
    background-size: 200% 200%;
    box-shadow: 0 10px 30px -8px rgba(139, 92, 246, 0.6), inset 0 1px 0 rgba(255,255,255,0.18);
    animation: pk-btn-shimmer 6s ease infinite;
}
.pk-btn-primary:hover {
    box-shadow: 0 16px 40px -10px rgba(139, 92, 246, 0.8), inset 0 1px 0 rgba(255,255,255,0.25);
}
@keyframes pk-btn-shimmer {
    0%, 100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
}

.pk-btn-ghost {
    color: var(--pk-text);
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--pk-border);
}
.pk-btn-ghost:hover {
    background: rgba(168, 138, 255, 0.08);
    border-color: var(--pk-border-strong);
}

.pk-btn-arrow { transition: transform .25s ease; }
.pk-btn:hover .pk-btn-arrow { transform: translateX(3px); }

/* ---------- Eyebrow / chip ---------- */

.pk-chip {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 7px 14px;
    border-radius: 999px;
    background: rgba(168, 138, 255, 0.08);
    border: 1px solid var(--pk-border-strong);
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--pk-violet-3);
    font-weight: 600;
}

.pk-chip-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--pk-violet-2);
    box-shadow: 0 0 10px var(--pk-violet-2);
    animation: pk-pulse 1.8s ease-in-out infinite;
}
.pk-chip-dot.live { background: #ff4f6e; box-shadow: 0 0 10px #ff4f6e; }

@keyframes pk-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.55; transform: scale(0.85); }
}

/* ---------- Headings ---------- */

.pk-display {
    font-family: var(--pk-font-display);
    font-weight: 600;
    letter-spacing: -0.035em;
    line-height: 1.02;
    color: #fff;
}
.pk-display-xl { font-size: clamp(2.6rem, 6vw, 5.4rem); }
.pk-display-lg { font-size: clamp(2rem, 4.4vw, 3.6rem); }
.pk-display-md { font-size: clamp(1.6rem, 3vw, 2.4rem); }

.pk-gradient-text {
    background: linear-gradient(120deg, #fff 0%, #DCADEC 35%, #8B5CF6 80%);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.pk-lede { color: var(--pk-muted); font-size: 18px; line-height: 1.6; max-width: 640px; }
@media (min-width: 768px) { .pk-lede { font-size: 19px; } }

/* ---------- Reveal animations ---------- */

.pk-reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity .9s cubic-bezier(.2,.7,.2,1), transform .9s cubic-bezier(.2,.7,.2,1);
}
.pk-reveal.is-in { opacity: 1; transform: translateY(0); }
.pk-reveal[data-delay="1"] { transition-delay: .08s; }
.pk-reveal[data-delay="2"] { transition-delay: .16s; }
.pk-reveal[data-delay="3"] { transition-delay: .24s; }
.pk-reveal[data-delay="4"] { transition-delay: .32s; }
.pk-reveal[data-delay="5"] { transition-delay: .4s; }
.pk-reveal[data-delay="6"] { transition-delay: .48s; }

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

.pk-section {
    position: relative;
    padding: 96px 0;
}
@media (min-width: 768px) {
    .pk-section { padding: 140px 0; }
}

.pk-section-head { text-align: center; margin: 0 auto 56px; max-width: 760px; }
.pk-section-head .pk-lede { margin: 18px auto 0; }

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

.pk-card {
    position: relative;
    border-radius: var(--pk-radius-lg);
    padding: 28px;
    background: var(--pk-surface);
    border: 1px solid var(--pk-border);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    overflow: hidden;
    transition: opacity .8s cubic-bezier(.2,.7,.2,1), border-color .35s ease, transform .35s ease, background .35s ease;
}
.pk-card::before {
    content: "";
    position: absolute; inset: 0;
    border-radius: inherit;
    background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgba(167, 139, 250, 0.18), transparent 40%);
    opacity: 0;
    transition: opacity .35s;
    pointer-events: none;
}
.pk-card:hover { border-color: var(--pk-border-strong); transform: translateY(-3px); transition: border-color .35s ease, transform .35s ease, background .35s ease; }
.pk-card:hover::before { opacity: 1; }

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

.pk-footer {
    position: relative;
    z-index: 2;
    padding: 56px 0 40px;
    border-top: 1px solid rgba(168, 138, 255, 0.08);
    background: linear-gradient(180deg, rgba(10, 4, 20, 0.5), rgba(5, 2, 8, 0.95));
}

.pk-footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
    align-items: center;
}
@media (min-width: 720px) {
    .pk-footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
}

.pk-footer-brand-col {
    display: flex;
    align-items: center;
}

.pk-footer h4 {
    font-family: var(--pk-font-display);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--pk-violet-3);
    margin: 0 0 16px;
}
.pk-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.pk-footer a { color: var(--pk-muted); font-size: 14px; transition: color .25s; }
.pk-footer a:hover { color: #fff; }

.pk-footer-bottom {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid rgba(168, 138, 255, 0.06);
    display: flex; flex-wrap: wrap; gap: 12px;
    align-items: center; justify-content: space-between;
    font-size: 12px;
    color: var(--pk-dim);
}

/* ---------- Document (legal / mission) layout ---------- */

.pk-doc-wrap {
    padding: 64px 0 96px;
}
.pk-doc {
    max-width: 880px;
    margin: 0 auto;
    background: var(--pk-surface-strong);
    border: 1px solid var(--pk-border);
    border-radius: var(--pk-radius-lg);
    padding: 36px 28px;
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    box-shadow: var(--pk-shadow-card);
}
@media (min-width: 768px) {
    .pk-doc { padding: 56px 56px; }
}

.pk-doc h1 {
    font-family: var(--pk-font-display);
    font-weight: 600;
    font-size: clamp(2rem, 4vw, 2.8rem);
    letter-spacing: -0.02em;
    margin: 0 0 8px;
    color: #fff;
}
.pk-doc-subtitle {
    color: var(--pk-muted);
    font-size: 14px;
    text-align: center;
    margin: 0 0 36px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
}

.pk-prose { color: var(--pk-text); line-height: 1.7; font-size: 15.5px; }
.pk-prose p { margin: 0 0 16px; color: #C9C0D8; }
.pk-prose h2 {
    font-family: var(--pk-font-display);
    font-size: 1.5rem; font-weight: 600;
    margin: 36px 0 12px;
    color: #fff;
    letter-spacing: -0.01em;
}
.pk-prose h3 {
    font-size: 1.1rem; font-weight: 600;
    margin: 24px 0 8px;
    color: #fff;
}
.pk-prose ul {
    list-style: none;
    padding: 0;
    margin: 0 0 16px;
    display: flex; flex-direction: column; gap: 10px;
}
.pk-prose li {
    position: relative;
    padding-left: 22px;
    color: #C9C0D8;
}
.pk-prose li::before {
    content: "";
    position: absolute;
    left: 4px; top: 11px;
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--pk-violet-2);
    box-shadow: 0 0 8px var(--pk-violet-2);
}
.pk-prose ul ul { margin-top: 8px; padding-left: 8px; }
.pk-prose strong { color: #fff; font-weight: 600; }
.pk-prose a { color: var(--pk-violet-3); border-bottom: 1px dashed rgba(199, 178, 255, 0.4); transition: color .2s, border-color .2s; }
.pk-prose a:hover { color: #fff; border-bottom-color: #fff; }

.pk-doc-back {
    display: flex; justify-content: center;
    margin-top: 40px;
}

/* ---------- Accordion (mission / changelog) ---------- */

.pk-accordion-list { display: flex; flex-direction: column; gap: 10px; }
.pk-accordion-item {
    border: 1px solid var(--pk-border);
    border-radius: var(--pk-radius);
    background: rgba(15, 8, 28, 0.55);
    overflow: hidden;
    transition: border-color .25s ease, background .25s ease;
}
.pk-accordion-item:hover { border-color: var(--pk-border-strong); }
.pk-accordion-item.is-open { border-color: var(--pk-border-strong); background: rgba(20, 10, 40, 0.7); }

.pk-accordion-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 22px;
    cursor: pointer;
    gap: 16px;
}
.pk-accordion-title {
    font-family: var(--pk-font-display);
    font-size: 1.05rem;
    font-weight: 600;
    color: #fff;
    margin: 0;
}
.pk-accordion-version {
    font-family: var(--pk-font-mono);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--pk-violet-3);
    letter-spacing: 0.02em;
}
.pk-accordion-icon {
    flex-shrink: 0;
    width: 30px; height: 30px;
    border-radius: 50%;
    border: 1px solid var(--pk-border-strong);
    color: var(--pk-violet-2);
    display: grid; place-items: center;
    transition: transform .35s ease, background .25s, color .25s, border-color .25s;
    font-size: 18px;
}
.pk-accordion-item.is-open .pk-accordion-icon {
    transform: rotate(45deg);
    background: var(--pk-violet);
    color: #fff;
    border-color: var(--pk-violet);
}
.pk-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height .5s cubic-bezier(.2,.7,.2,1);
}
.pk-accordion-content-inner {
    padding: 0 22px 22px;
    color: #C9C0D8;
    line-height: 1.65;
}
.pk-accordion-content-inner p { margin: 0 0 12px; }
.pk-accordion-content-inner ul {
    list-style: none; padding: 0; margin: 0;
    display: flex; flex-direction: column; gap: 8px;
}
.pk-accordion-content-inner li {
    position: relative;
    padding-left: 22px;
    font-size: 14.5px;
}
.pk-accordion-content-inner li::before {
    content: "";
    position: absolute;
    left: 4px; top: 9px;
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--pk-violet-2);
    box-shadow: 0 0 8px var(--pk-violet-2);
}
.pk-accordion-content-inner ul ul { margin-top: 8px; }
.pk-accordion-content-inner em { color: var(--pk-muted); font-style: normal; opacity: .9; }
.pk-accordion-content-inner strong { color: #fff; }

/* ---------- Reduce motion ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        transition-duration: .001ms !important;
    }
    html { scroll-behavior: auto; }
}
