/* simulai.xyz - cursor reactive creative
   Canvas #0a0a0a / React White #f5f5f5 / Cyan #22d3ee / Violet #a855f7 / Orange #fb923c
   Display: Syne / Body: IBM Plex Sans / Data: IBM Plex Mono
*/

:root {
    --canvas: #0a0a0a;
    --react-white: #f5f5f5;
    --react-cyan: #22d3ee;
    --react-violet: #a855f7;
    --react-orange: #fb923c;

    --font-display: "Syne", "Inter", system-ui, sans-serif;
    --font-body: "IBM Plex Sans", "Inter", system-ui, sans-serif;
    --font-mono: "IBM Plex Mono", "Lora", ui-monospace, monospace;
}

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

html, body {
    background: var(--canvas);
    color: var(--react-white);
    font-family: var(--font-body);
    font-weight: 300;
    line-height: 1.6;
    overflow-x: hidden;
    cursor: none;
}

html { scroll-behavior: smooth; }

body {
    min-height: 100vh;
    position: relative;
    background:
        radial-gradient(1200px 700px at 20% 10%, rgba(34, 211, 238, 0.06), transparent 60%),
        radial-gradient(1000px 800px at 85% 80%, rgba(168, 85, 247, 0.05), transparent 65%),
        var(--canvas);
}

/* ---------------- Morphing SVG background ---------------- */
.morph-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}
.morph-bg svg {
    width: 110%;
    height: 110%;
    position: absolute;
    top: -5%;
    left: -5%;
    filter: blur(0.4px);
    will-change: transform;
}

/* ---------------- Particle canvas ---------------- */
#particle-canvas {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    pointer-events: none;
}

/* ---------------- Click ripples ---------------- */
.ripple-layer {
    position: fixed;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    overflow: hidden;
}
.ripple {
    position: absolute;
    border: 2px solid var(--react-cyan);
    border-radius: 50%;
    width: 0;
    height: 0;
    transform: translate(-50%, -50%);
    opacity: 0.9;
    box-shadow: 0 0 24px rgba(34, 211, 238, 0.45);
    animation: rippleExpand 820ms cubic-bezier(0.16, 0.84, 0.44, 1) forwards;
}
.ripple.violet { border-color: var(--react-violet); box-shadow: 0 0 24px rgba(168, 85, 247, 0.45); }
.ripple.orange { border-color: var(--react-orange); box-shadow: 0 0 24px rgba(251, 146, 60, 0.45); }

@keyframes rippleExpand {
    0%   { width: 0; height: 0; opacity: 0.95; border-width: 2px; }
    60%  { opacity: 0.55; border-width: 1.5px; }
    100% { width: 640px; height: 640px; opacity: 0; border-width: 0.5px; }
}

/* ---------------- Custom cursor (replaces native) ---------------- */
.cursor-dot,
.cursor-ring {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    will-change: transform, opacity;
}
.cursor-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--react-white);
    mix-blend-mode: difference;
}
.cursor-ring {
    width: 28px; height: 28px;
    border: 1px solid var(--react-cyan);
    border-radius: 50%;
    transition: width 200ms ease, height 200ms ease, border-color 200ms ease;
}
.cursor-ring.active { width: 44px; height: 44px; border-color: var(--react-orange); }

/* ---------------- Hidden top navigation ---------------- */
.nav-hover-zone {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 24px;
    z-index: 50;
}
.nav-hover-zone:hover .top-nav,
.top-nav:hover { transform: translateY(0); opacity: 1; pointer-events: auto; }

.top-nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    padding: 1.1rem 2rem;
    background: linear-gradient(180deg, rgba(10,10,10,0.92), rgba(10,10,10,0.6) 70%, transparent);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(245, 245, 245, 0.06);
    transform: translateY(-100%);
    opacity: 0;
    transition: transform 420ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 320ms ease;
    pointer-events: none;
    z-index: 50;
}

.nav-brand {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    font-family: var(--font-display);
    font-weight: 800;
    letter-spacing: -0.01em;
    font-size: 1.05rem;
}
.brand-mark {
    font-family: var(--font-mono);
    font-weight: 400;
    color: var(--react-cyan);
    font-size: 0.85rem;
}
.brand-text { color: var(--react-white); }
.brand-accent { color: var(--react-violet); }

.nav-links {
    list-style: none;
    display: flex;
    gap: 1.6rem;
    flex: 1;
    justify-content: center;
}
.nav-links a {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: rgba(245, 245, 245, 0.7);
    text-decoration: none;
    letter-spacing: 0.04em;
    position: relative;
    padding: 0.25rem 0;
    transition: color 200ms ease;
}
.nav-links a::before {
    content: "";
    position: absolute;
    left: 0; right: 100%;
    bottom: -2px;
    height: 1px;
    background: var(--react-cyan);
    transition: right 280ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.nav-links a:hover { color: var(--react-cyan); }
.nav-links a:hover::before { right: 0; }

.nav-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: rgba(245, 245, 245, 0.6);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.status-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--react-cyan);
    box-shadow: 0 0 12px var(--react-cyan);
    animation: pulseDot 1.6s ease-in-out infinite;
}
@keyframes pulseDot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.7); }
}

/* ---------------- Debug coordinate panel ---------------- */
.debug-panel {
    position: fixed;
    bottom: 1.5rem;
    left: 1.5rem;
    z-index: 30;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    line-height: 1.7;
    color: rgba(245, 245, 245, 0.55);
    padding: 0.75rem 1rem;
    background: rgba(10, 10, 10, 0.55);
    border: 1px solid rgba(34, 211, 238, 0.12);
    border-radius: 2px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    min-width: 200px;
    pointer-events: none;
}
.debug-row {
    display: flex;
    justify-content: space-between;
    gap: 1.2rem;
}
.debug-key { color: rgba(245, 245, 245, 0.35); text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.66rem; }
.debug-val { color: var(--react-cyan); font-variant-numeric: tabular-nums; }

/* ---------------- Right-side meta panel ---------------- */
.meta-panel {
    position: fixed;
    top: 50%;
    right: 1.5rem;
    transform: translateY(-50%) rotate(180deg);
    writing-mode: vertical-rl;
    z-index: 30;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: rgba(245, 245, 245, 0.3);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    display: flex;
    gap: 1.4rem;
    pointer-events: none;
}
.meta-line { white-space: nowrap; }

/* ---------------- Bottom hint bar ---------------- */
.hint-bar {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: rgba(245, 245, 245, 0.55);
    letter-spacing: 0.08em;
    padding: 0.5rem 1rem;
    border: 1px solid rgba(245, 245, 245, 0.08);
    border-radius: 2px;
    background: rgba(10, 10, 10, 0.5);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: opacity 600ms ease;
    pointer-events: none;
}
.hint-bar.fade { opacity: 0.15; }
.hint-pulse {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--react-cyan);
    box-shadow: 0 0 10px var(--react-cyan);
    animation: pulseDot 1.4s ease-in-out infinite;
}

/* ---------------- Scroll progress ---------------- */
.scroll-progress {
    position: fixed;
    top: 50%;
    left: 1.5rem;
    transform: translateY(-50%);
    z-index: 30;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    pointer-events: none;
}
.scroll-track {
    width: 1px;
    height: 220px;
    background: rgba(245, 245, 245, 0.08);
    position: relative;
    overflow: hidden;
}
.scroll-fill {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 0%;
    background: linear-gradient(180deg, var(--react-cyan), var(--react-violet));
    box-shadow: 0 0 8px rgba(34, 211, 238, 0.6);
    transition: height 80ms linear;
}
.scroll-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: rgba(245, 245, 245, 0.5);
    letter-spacing: 0.1em;
}

/* ---------------- Scroll stage / sections ---------------- */
.scroll-stage {
    position: relative;
    z-index: 5;
    width: 100%;
}
.overlay-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 6rem 7vw;
    position: relative;
}

.overlay-content {
    max-width: 560px;
    position: relative;
    z-index: 5;
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 700ms cubic-bezier(0.2, 0.8, 0.2, 1), transform 700ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.overlay-content.visible { opacity: 1; transform: translateY(0); }
.overlay-content.right { margin-left: auto; }
.overlay-content.centered { margin: 0 auto; text-align: center; }

.section-tag {
    font-family: var(--font-mono);
    font-size: 0.74rem;
    color: rgba(245, 245, 245, 0.5);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-bottom: 1.2rem;
}
.tag-bracket { color: var(--react-cyan); }
.tag-sep { color: var(--react-violet); margin: 0 0.05em; }

.display-headline {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(2.4rem, 6.5vw, 5.6rem);
    line-height: 0.95;
    letter-spacing: -0.025em;
    color: var(--react-white);
    margin-bottom: 1.8rem;
}
.text-cyan { color: var(--react-cyan); }
.text-violet { color: var(--react-violet); }
.text-orange { color: var(--react-orange); }

.overlay-body {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 1.05rem;
    line-height: 1.65;
    color: rgba(245, 245, 245, 0.78);
    max-width: 44ch;
    margin-bottom: 1.6rem;
}
.overlay-content.centered .overlay-body { margin-left: auto; margin-right: auto; }

.kbd-hints {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}
.kbd-chip {
    font-family: var(--font-mono);
    font-size: 0.74rem;
    padding: 0.35rem 0.7rem;
    color: var(--react-white);
    border: 1px solid rgba(245, 245, 245, 0.18);
    border-radius: 2px;
    letter-spacing: 0.05em;
    background: rgba(245, 245, 245, 0.03);
    transition: border-color 220ms ease, color 220ms ease, transform 220ms ease;
}
.kbd-chip:hover { border-color: var(--react-cyan); color: var(--react-cyan); transform: translateY(-2px); }

.data-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 1.4rem;
    margin-top: 1.4rem;
    padding-top: 1.2rem;
    border-top: 1px solid rgba(245, 245, 245, 0.08);
}
.data-cell {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-family: var(--font-mono);
}
.data-label {
    font-size: 0.66rem;
    color: rgba(245, 245, 245, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.16em;
}
.data-value {
    font-size: 0.86rem;
    color: var(--react-cyan);
    font-variant-numeric: tabular-nums;
}

/* Manifesto */
.manifesto-body {
    font-size: 1.15rem;
    max-width: 50ch;
}
.cta-row {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin: 2.2rem 0 2rem;
    flex-wrap: wrap;
}
.cta-btn {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.8rem 1.6rem;
    border-radius: 2px;
    cursor: none;
    transition: transform 220ms ease, background 220ms ease, color 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
    background: transparent;
    color: var(--react-white);
}
.cta-btn.primary {
    border: 1px solid var(--react-cyan);
    color: var(--react-cyan);
}
.cta-btn.primary:hover {
    background: var(--react-cyan);
    color: var(--canvas);
    box-shadow: 0 0 28px rgba(34, 211, 238, 0.55);
    transform: translateY(-2px);
}
.cta-btn.ghost {
    border: 1px solid rgba(245, 245, 245, 0.2);
    color: rgba(245, 245, 245, 0.7);
}
.cta-btn.ghost:hover {
    border-color: var(--react-violet);
    color: var(--react-violet);
    transform: translateY(-2px);
}

.footer-row {
    display: flex;
    justify-content: center;
    gap: 1.6rem;
    flex-wrap: wrap;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: rgba(245, 245, 245, 0.35);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(245, 245, 245, 0.06);
}
.foot-cell { white-space: nowrap; }

/* ---------------- Responsive ---------------- */
@media (max-width: 880px) {
    .overlay-section { padding: 5rem 5vw; }
    .nav-links { display: none; }
    .top-nav { padding: 0.9rem 1.2rem; }
    .meta-panel { display: none; }
    .scroll-progress { left: 0.6rem; }
    .scroll-track { height: 140px; }
    .debug-panel { font-size: 0.66rem; min-width: 170px; bottom: 0.8rem; left: 0.8rem; }
    .hint-bar { bottom: 0.8rem; font-size: 0.66rem; }
}

@media (max-width: 540px) {
    .display-headline { font-size: clamp(2rem, 11vw, 3.4rem); }
    .overlay-content.right { margin-left: 0; }
    .meta-panel { display: none; }
}

/* ---------------- prefers-reduced-motion ---------------- */
@media (prefers-reduced-motion: reduce) {
    html, body { cursor: auto; }
    .cursor-dot, .cursor-ring { display: none !important; }
    #particle-canvas { display: none; }
    .ripple-layer { display: none; }
    .morph-bg { opacity: 0.4; }
    .overlay-content { opacity: 1; transform: none; transition: none; }
    .status-dot, .hint-pulse { animation: none; }
    .scroll-fill { transition: none; }
    .ripple { animation: none; }
    .cta-btn, .kbd-chip { cursor: pointer; }
    html { scroll-behavior: auto; }
}
