/* whitepapers.xyz
   Palette: Warm White #FAFAF5, Deep Graphite #2A2A35,
            Cerulean #4A90D9, Soft Teal #5AB5A8,
            Lavender Mist #8B7EC8, Soft Violet #9B6DB7,
            Cool Slate #C8C8D0, Slate Mid #8888A0
   Fonts: Space Grotesk (display), Inter (body), JetBrains Mono (meta)
*/

:root {
    --bg: #FAFAF5;
    --text: #2A2A35;
    --accent-1: #4A90D9;   /* Cerulean */
    --accent-2: #5AB5A8;   /* Soft Teal */
    --accent-3: #8B7EC8;   /* Lavender Mist */
    --accent-4: #9B6DB7;   /* Soft Violet */
    --border: #C8C8D0;
    --meta: #8888A0;
}

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

html, body {
    background: var(--bg);
    color: var(--text);
    font-family: "Inter", system-ui, sans-serif;
    font-size: clamp(1rem, 1.6vw, 1.1rem);
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

body {
    min-height: 100vh;
    position: relative;
}

/* ---------- Logotype ---------- */
.logotype {
    position: fixed;
    top: 2vw;
    left: 2vw;
    font-family: "Space Grotesk", sans-serif;
    font-weight: 500;
    font-size: 1.2rem;
    letter-spacing: -0.01em;
    color: var(--text);
    z-index: 10;
    opacity: 0.85;
    mix-blend-mode: multiply;
}

/* ---------- Content column ---------- */
.content {
    max-width: 76vw;
    margin: 0 auto;
    padding: 16vh 0 24vh;
}

@media (max-width: 768px) {
    .content {
        max-width: 88vw;
        padding: 14vh 0 18vh;
    }
}

/* ---------- Hero ---------- */
.hero {
    margin-bottom: 200px;
    position: relative;
}

.rainbow-statement {
    font-family: "Space Grotesk", sans-serif;
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1.15;
    letter-spacing: -0.01em;
    margin-bottom: 48px;
    max-width: 18ch;
}

.rainbow-statement .word {
    display: inline-block;
    margin-right: 0.25em;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 500ms ease-out, transform 500ms ease-out;
    will-change: opacity, transform;
}

.rainbow-statement .word.visible {
    opacity: 1;
    transform: translateY(0);
}

.rainbow-statement .word[data-accent="1"] { color: var(--accent-1); }
.rainbow-statement .word[data-accent="2"] { color: var(--accent-2); }
.rainbow-statement .word[data-accent="3"] { color: var(--accent-3); }
.rainbow-statement .word[data-accent="4"] { color: var(--accent-4); }

.hero-sub {
    font-family: "Inter", sans-serif;
    font-weight: 400;
    font-size: 1.1rem;
    color: var(--text);
    max-width: 42ch;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 700ms ease-out 1400ms, transform 700ms ease-out 1400ms;
}

.hero-sub.visible {
    opacity: 0.85;
    transform: translateY(0);
}

/* ---------- Particles ---------- */
.particles {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.particle {
    position: absolute;
    border-radius: 50%;
    opacity: 0;
    animation-name: particle-float;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
    will-change: transform, opacity;
}

@keyframes particle-float {
    0% {
        transform: translate(0, 0);
        opacity: 0;
    }
    15% {
        opacity: 0.15;
    }
    85% {
        opacity: 0.15;
    }
    100% {
        transform: translate(5vw, -100vh);
        opacity: 0;
    }
}

@media (max-width: 768px) {
    .particles {
        display: none;
    }
}

/* ---------- Section titles ---------- */
.section-title {
    font-family: "Space Grotesk", sans-serif;
    font-weight: 700;
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    letter-spacing: -0.01em;
    margin-bottom: 80px;
    color: var(--text);
}

/* ---------- Document stream ---------- */
.document-stream {
    margin-bottom: 200px;
}

.document {
    border: 1px solid var(--border);
    padding: 48px;
    margin-bottom: 120px;
    display: grid;
    grid-template-columns: 1fr 120px;
    gap: 48px;
    align-items: start;
    background: var(--bg);
    position: relative;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 600ms ease-out, transform 600ms ease-out, border-color 300ms ease;
}

.document.visible {
    opacity: 1;
    transform: translateY(0);
}

.document:hover {
    border-color: var(--meta);
}

@media (max-width: 768px) {
    .document {
        grid-template-columns: 1fr;
        padding: 32px;
        margin-bottom: 80px;
    }
    .document .document-visual {
        order: -1;
        justify-self: start;
    }
}

.tag {
    display: inline-block;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 6px;
    color: var(--bg);
    margin-bottom: 24px;
}

.tag-tech     { background: var(--accent-1); }
.tag-markets  { background: var(--accent-2); }
.tag-network  { background: var(--accent-3); }
.tag-physics  { background: var(--accent-4); }

.document-title {
    font-family: "Space Grotesk", sans-serif;
    font-weight: 700;
    font-size: clamp(1.3rem, 2.4vw, 1.8rem);
    line-height: 1.25;
    letter-spacing: -0.01em;
    margin-bottom: 20px;
    color: var(--text);
}

.document-abstract {
    font-family: "Inter", sans-serif;
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.75;
    color: var(--text);
    max-width: 60ch;
    margin-bottom: 28px;
}

.document-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    color: var(--meta);
}

/* ---------- Collage (CSS-only visuals) ---------- */
.document-visual {
    width: 120px;
    height: 120px;
    position: relative;
}

.collage {
    width: 120px;
    height: 120px;
    position: relative;
}

.collage .shape {
    position: absolute;
}

.collage .circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    top: 10px;
    left: 10px;
}

.collage .rectangle {
    width: 60px;
    height: 100px;
    top: 10px;
    left: 50px;
    transform: rotate(-12deg);
}

.collage .triangle {
    width: 0;
    height: 0;
    top: 60px;
    left: 20px;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-bottom: 34px solid transparent;
    transform: rotate(14deg);
}

.collage .line-illustration {
    position: absolute;
    top: 30px;
    left: 30px;
    width: 60px;
    height: 60px;
    opacity: 0.7;
}

.collage-tech .circle    { background: rgba(74, 144, 217, 0.22); }
.collage-tech .rectangle { background: rgba(90, 181, 168, 0.18); }
.collage-tech .triangle  { border-bottom-color: rgba(139, 126, 200, 0.28); }

.collage-markets .circle    { background: rgba(90, 181, 168, 0.22); }
.collage-markets .rectangle { background: rgba(74, 144, 217, 0.18); }
.collage-markets .triangle  { border-bottom-color: rgba(155, 109, 183, 0.28); }

.collage-network .circle    { background: rgba(139, 126, 200, 0.24); }
.collage-network .rectangle { background: rgba(74, 144, 217, 0.16); }
.collage-network .triangle  { border-bottom-color: rgba(90, 181, 168, 0.28); }

.collage-physics .circle    { background: rgba(155, 109, 183, 0.22); }
.collage-physics .rectangle { background: rgba(139, 126, 200, 0.18); }
.collage-physics .triangle  { border-bottom-color: rgba(74, 144, 217, 0.26); }

.collage-alt .circle    { transform: translate(10px, -4px) scale(0.9); }
.collage-alt .rectangle { transform: rotate(8deg) translate(-6px, 4px); }
.collage-alt .triangle  { transform: rotate(-8deg) translate(4px, -6px); }

/* ---------- Lottie-style animated boxes (shown >= 1024px) ---------- */
.lottie-box {
    display: none;
    position: absolute;
    inset: 20px;
    width: 80px;
    height: 80px;
}

@media (min-width: 1024px) {
    .collage {
        display: none;
    }
    .lottie-box {
        display: block;
    }
}

/* Tech: spinning wireframes */
.lottie-tech .wire {
    position: absolute;
    inset: 0;
    border: 1px solid var(--accent-1);
    border-radius: 50%;
    animation: tech-spin 3.6s linear infinite;
}
.lottie-tech .wire-2 {
    border-color: var(--accent-3);
    inset: 12px;
    animation-duration: 4.2s;
    animation-direction: reverse;
}
.lottie-tech .wire-3 {
    border-color: var(--accent-2);
    inset: 26px;
    animation-duration: 2.8s;
    border-radius: 6px;
}

@keyframes tech-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* Markets: flowing waves */
.lottie-waves .wave {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-1);
    border-radius: 2px;
    opacity: 0.8;
    animation: wave-move 2.4s ease-in-out infinite;
}
.lottie-waves .wave       { top: 20px; background: var(--accent-1); }
.lottie-waves .wave-2     { top: 38px; background: var(--accent-2); animation-delay: 0.3s; }
.lottie-waves .wave-3     { top: 56px; background: var(--accent-3); animation-delay: 0.6s; }

@keyframes wave-move {
    0%   { transform: translateX(-30%) scaleX(0.6); opacity: 0.3; }
    50%  { transform: translateX(10%)  scaleX(1.0); opacity: 0.9; }
    100% { transform: translateX(30%)  scaleX(0.6); opacity: 0.3; }
}

/* Network: pulsing node graph */
.lottie-nodes .node {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-3);
    animation: node-pulse 2.4s ease-in-out infinite;
}
.lottie-nodes .node-a      { top: 6px; left: 8px; }
.lottie-nodes .node-b      { top: 10px; right: 6px; background: var(--accent-1); animation-delay: 0.3s; }
.lottie-nodes .node-c      { bottom: 8px; left: 12px; background: var(--accent-2); animation-delay: 0.6s; }
.lottie-nodes .node-d      { bottom: 6px; right: 10px; background: var(--accent-4); animation-delay: 0.9s; }
.lottie-nodes .node-center {
    top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 12px; height: 12px;
    background: var(--accent-3);
    animation-delay: 0.15s;
}

@keyframes node-pulse {
    0%, 100% { transform: scale(0.8); opacity: 0.5; }
    50%      { transform: scale(1.1); opacity: 1; }
}

.lottie-nodes .node-center {
    animation-name: node-pulse-center;
}

@keyframes node-pulse-center {
    0%, 100% { transform: translate(-50%, -50%) scale(0.9); opacity: 0.7; }
    50%      { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
}

/* Physics: orbiting dots */
.lottie-orbit {
    border-radius: 50%;
}

.lottie-orbit .orbit-center {
    position: absolute;
    top: 50%; left: 50%;
    width: 10px; height: 10px;
    margin: -5px 0 0 -5px;
    border-radius: 50%;
    background: var(--accent-4);
}

.lottie-orbit .orbit {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    animation: orbit-spin linear infinite;
}

.lottie-orbit .orbit-1 { animation-duration: 4s; }
.lottie-orbit .orbit-2 { animation-duration: 6s; animation-direction: reverse; }
.lottie-orbit .orbit-3 { animation-duration: 8s; }

.lottie-orbit .orbit .dot {
    position: absolute;
    top: -3px; left: 50%;
    width: 6px; height: 6px;
    margin-left: -3px;
    border-radius: 50%;
    background: var(--accent-1);
}

.lottie-orbit .orbit-2 .dot { background: var(--accent-2); top: auto; bottom: -3px; }
.lottie-orbit .orbit-3 .dot { background: var(--accent-3); top: 50%; left: -3px; margin-top: -3px; margin-left: 0; }

@keyframes orbit-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ---------- About ---------- */
.about {
    margin-bottom: 120px;
    max-width: 72ch;
}

.about-copy {
    font-family: "Inter", sans-serif;
    font-size: 1.05rem;
    line-height: 1.85;
    margin-bottom: 24px;
    color: var(--text);
}

.about-meta {
    margin-top: 40px;
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    color: var(--meta);
}

/* ---------- Command palette pill ---------- */
.cmd-pill {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(42, 42, 53, 0.9);
    color: var(--bg);
    border: none;
    border-radius: 24px;
    padding: 10px 22px;
    font-family: "Inter", sans-serif;
    font-weight: 500;
    font-size: 0.88rem;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 50;
    transition: transform 300ms ease, opacity 300ms ease, background 300ms ease;
}

.cmd-pill:hover {
    background: rgba(42, 42, 53, 1);
    transform: translateX(-50%) translateY(-2px);
}

.cmd-pill.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(12px);
}

.cmd-glyph {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--bg);
    opacity: 0.9;
}

.cmd-label {
    white-space: nowrap;
}

.cmd-hint {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    padding: 2px 8px;
    border: 1px solid rgba(250, 250, 245, 0.3);
    border-radius: 6px;
    opacity: 0.75;
}

/* ---------- Command palette overlay ---------- */
.cmd-overlay {
    position: fixed;
    inset: 0;
    background: rgba(250, 250, 245, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 100;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 18vh;
    clip-path: circle(0% at 50% calc(100% - 44px));
    transition: clip-path 400ms cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
}

.cmd-overlay.open {
    clip-path: circle(150% at 50% calc(100% - 44px));
    pointer-events: auto;
}

.cmd-panel {
    width: min(640px, 86vw);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 8px;
    box-shadow: 0 24px 60px rgba(42, 42, 53, 0.08);
    display: flex;
    flex-direction: column;
    max-height: 64vh;
    overflow: hidden;
}

.cmd-input {
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.2rem;
    padding: 18px 20px;
    border: none;
    background: transparent;
    color: var(--text);
    outline: none;
    border-bottom: 1px solid var(--border);
}

.cmd-input::placeholder {
    color: var(--meta);
}

.cmd-results {
    flex: 1;
    overflow-y: auto;
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cmd-group-label {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--meta);
    padding: 12px 14px 6px;
}

.cmd-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 160ms ease;
}

.cmd-item:hover,
.cmd-item.active {
    background: rgba(139, 126, 200, 0.10);
}

.cmd-item-title {
    font-family: "Space Grotesk", sans-serif;
    font-weight: 500;
    font-size: 1rem;
    color: var(--text);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cmd-item-kind {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    color: var(--meta);
}

.cmd-empty {
    padding: 20px 14px;
    font-family: "Inter", sans-serif;
    color: var(--meta);
}

.cmd-footer {
    display: flex;
    gap: 18px;
    justify-content: flex-end;
    padding: 10px 14px 12px;
    border-top: 1px solid var(--border);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.72rem;
    color: var(--meta);
    letter-spacing: 0.04em;
}

/* ---------- Misc ---------- */
::selection {
    background: rgba(139, 126, 200, 0.25);
    color: var(--text);
}
