/* simulai.dev — Glassmorphic, candy-bright, ma-negative-space */

:root {
    --hot-pink: #ff6b8a;
    --electric-violet: #a855f7;
    --sky-cyan: #38bdf8;
    --mint-pop: #34d399;
    --glass-white: rgba(255, 255, 255, 0.15);
    --glass-white-strong: rgba(255, 255, 255, 0.22);
    --text-white: #f0f0f8;
    --deep-plum: #1a0a2e;
    --bg-hue: 0deg;
}

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

html, body {
    background: var(--deep-plum);
    color: var(--text-white);
    font-family: "Inter", "Helvetica Neue", sans-serif;
    font-size: clamp(15px, 1.5vw, 18px);
    line-height: 1.75;
    overflow-x: hidden;
    min-height: 100vh;
}

body {
    position: relative;
}

/* ---- Background gradient (animates hue on scroll) ---- */
.bg-gradient {
    position: fixed;
    inset: -10vh -10vw;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 20% 18%, var(--hot-pink) 0%, transparent 55%),
        radial-gradient(circle at 75% 35%, var(--electric-violet) 0%, transparent 60%),
        radial-gradient(circle at 60% 85%, var(--sky-cyan) 0%, transparent 60%),
        linear-gradient(180deg, var(--hot-pink) 0%, var(--electric-violet) 50%, var(--sky-cyan) 100%);
    filter: hue-rotate(var(--bg-hue)) saturate(0);
    transition: filter 1200ms ease-out;
    animation: bgSaturate 900ms 100ms ease-out forwards;
}

@keyframes bgSaturate {
    from { filter: hue-rotate(var(--bg-hue)) saturate(0); }
    to   { filter: hue-rotate(var(--bg-hue)) saturate(1); }
}

/* Once page is loaded, hue rotation is driven dynamically by JS */
body.loaded .bg-gradient {
    animation: none;
    filter: hue-rotate(var(--bg-hue)) saturate(1);
}

.bg-pattern {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.07;
    background-image:
        radial-gradient(circle at 14% 22%, #ffffff 0 1.5px, transparent 2px),
        radial-gradient(circle at 38% 70%, #ffffff 0 1.5px, transparent 2px),
        radial-gradient(circle at 70% 18%, #ffffff 0 1.5px, transparent 2px),
        radial-gradient(circle at 88% 60%, #ffffff 0 1.5px, transparent 2px),
        repeating-linear-gradient(60deg, rgba(255,255,255,0.08) 0 1px, transparent 1px 60px),
        repeating-linear-gradient(120deg, rgba(255,255,255,0.06) 0 1px, transparent 1px 80px);
    background-size: 220px 220px, 320px 320px, 280px 280px, 360px 360px, auto, auto;
    animation: drift 36s linear infinite;
}

@keyframes drift {
    from { background-position: 0 0, 0 0, 0 0, 0 0, 0 0, 0 0; }
    to   { background-position: 200px 100px, -180px 220px, 240px -160px, -240px -200px, 0 0, 0 0; }
}

/* ---- Vertical breadcrumb path threading through panels ---- */
.breadcrumb-line {
    position: absolute;
    top: 6vh;
    bottom: 6vh;
    left: 50%;
    width: 1px;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.15);
    z-index: 1;
    pointer-events: none;
}

.bc-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 0 16px rgba(255, 255, 255, 0.55);
    position: relative;
    z-index: 2;
}

/* ---- Sections (ma-negative-space) ---- */
.hero,
.section {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(80px, 12vh, 160px) clamp(20px, 5vw, 60px);
}

.hero {
    min-height: 100vh;
}

.section {
    min-height: 70vh;
}

/* ---- Glass panel ---- */
.glass-panel {
    background: var(--glass-white);
    backdrop-filter: blur(20px) saturate(1.05);
    -webkit-backdrop-filter: blur(20px) saturate(1.05);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 24px;
    padding: clamp(28px, 4vw, 56px);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
    color: var(--text-white);
    position: relative;
    opacity: 0;
    transform: translateY(28px) scale(0.97);
    transition: opacity 700ms ease, transform 800ms cubic-bezier(0.2, 0.7, 0.2, 1);
    will-change: opacity, transform;
}

.glass-panel.in-view {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.hero-panel {
    width: min(820px, 92vw);
    text-align: left;
    padding: clamp(38px, 5vw, 72px);
    transform: scale(0.84);
    opacity: 0;
    animation: heroPanelIn 1200ms 350ms cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}

@keyframes heroPanelIn {
    0%   { opacity: 0; transform: scale(0.84); }
    60%  { opacity: 1; transform: scale(1.02); }
    100% { opacity: 1; transform: scale(1); }
}

.kicker {
    font-family: "Fira Code", "Menlo", monospace;
    font-size: 13px;
    color: rgba(240, 240, 248, 0.7);
    letter-spacing: 0.06em;
    margin-bottom: 18px;
}

.hero-title {
    font-family: "Sora", "Helvetica Neue", sans-serif;
    font-weight: 700;
    font-size: clamp(36px, 7vw, 84px);
    letter-spacing: -0.015em;
    line-height: 1.02;
    color: var(--text-white);
    margin-bottom: 22px;
    word-break: break-word;
    text-shadow: 0 2px 24px rgba(26, 10, 46, 0.35);
}

.hero-name {
    background: linear-gradient(120deg, #ffffff 0%, #ffe8f1 50%, #d3edff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.hero-tld {
    color: var(--mint-pop);
    text-shadow: 0 0 18px rgba(52, 211, 153, 0.5);
}

.cursor-bar {
    display: inline-block;
    color: var(--mint-pop);
    margin-left: 4px;
    animation: blinkBar 0.5s steps(1, end) infinite;
    font-family: "Sora", sans-serif;
    font-weight: 500;
}

@keyframes blinkBar {
    50% { opacity: 0; }
}

.hero-sub {
    font-family: "Inter", sans-serif;
    font-size: clamp(16px, 1.7vw, 22px);
    line-height: 1.6;
    color: rgba(240, 240, 248, 0.92);
    max-width: 620px;
    margin-bottom: 24px;
}

.hero-sub em {
    font-family: "Fraunces", "Georgia", serif;
    font-weight: 600;
    font-style: italic;
    color: #ffffff;
}

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

.chip {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.28);
    font-family: "Fira Code", monospace;
    font-size: 12px;
    color: var(--text-white);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    letter-spacing: 0.04em;
}

.chip-mint {
    background: rgba(52, 211, 153, 0.22);
    border-color: rgba(52, 211, 153, 0.5);
    color: #d8fff0;
}

/* ---- Particles (mint burst from period) ---- */
.particles {
    position: absolute;
    pointer-events: none;
    width: 0;
    height: 0;
    z-index: 4;
}

.particle {
    position: absolute;
    left: 0;
    top: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--mint-pop);
    box-shadow: 0 0 10px rgba(52, 211, 153, 0.7);
    opacity: 0;
}

.particle.fly {
    animation: particleFly 1100ms ease-out forwards;
}

@keyframes particleFly {
    0%   { opacity: 1; transform: translate(0, 0) scale(0.6); }
    60%  { opacity: 1; }
    100% { opacity: 0; transform: translate(var(--dx, 0), var(--dy, 0)) scale(0.2); }
}

/* ---- Generic section panel ---- */
.section-manifesto .panel-manifesto {
    width: min(720px, 92vw);
}

.panel-wide {
    width: min(940px, 94vw);
}

.section-title {
    font-family: "Sora", sans-serif;
    font-weight: 700;
    font-size: clamp(28px, 4vw, 52px);
    letter-spacing: -0.012em;
    line-height: 1.08;
    color: var(--text-white);
    margin-bottom: 18px;
}

.pull-quote {
    font-family: "Fraunces", serif;
    font-style: italic;
    font-weight: 600;
    font-size: clamp(20px, 2.6vw, 32px);
    line-height: 1.4;
    color: #ffffff;
    margin: 6px 0 24px;
}

.body-text {
    font-size: clamp(15px, 1.5vw, 18px);
    color: rgba(240, 240, 248, 0.92);
    margin-bottom: 14px;
    max-width: 64ch;
}

.body-text code {
    font-family: "Fira Code", monospace;
    background: rgba(26, 10, 46, 0.45);
    color: #d8fff0;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.92em;
}

/* ---- Code glass (inner panel) ---- */
.code-glass {
    margin-top: 20px;
    background: rgba(26, 10, 46, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 0;
    overflow: hidden;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.code-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-family: "Fira Code", monospace;
    font-size: 12px;
    color: rgba(240, 240, 248, 0.7);
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    flex: 0 0 auto;
}

.dot-pink   { background: var(--hot-pink); }
.dot-violet { background: var(--electric-violet); }
.dot-cyan   { background: var(--sky-cyan); }

.code-file {
    margin-left: auto;
}

.code-glass pre {
    margin: 0;
    padding: 22px 26px 26px;
    background: transparent;
    overflow-x: auto;
    position: relative;
}

.code-block {
    display: block;
    font-family: "Fira Code", "Menlo", monospace;
    font-size: clamp(13px, 1.2vw, 15px);
    line-height: 1.65;
    color: #e8d8ff;
    white-space: pre;
}

.code-cursor {
    color: var(--mint-pop);
    font-family: "Fira Code", monospace;
    font-size: 1em;
    margin-left: 2px;
}

/* ---- Modules ---- */
.section-modules {
    padding: clamp(60px, 10vh, 120px) clamp(20px, 5vw, 60px);
}

.modules-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: clamp(24px, 4vw, 60px);
    width: min(1100px, 96vw);
    align-items: stretch;
}

.panel-module {
    padding: clamp(26px, 3vw, 42px);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.panel-offset {
    transform: translateY(28px) scale(0.97);
}

.panel-offset.in-view {
    transform: translateY(40px) scale(1);
}

.module-title {
    font-family: "Sora", sans-serif;
    font-weight: 700;
    font-size: clamp(22px, 2.4vw, 30px);
    letter-spacing: -0.01em;
    color: #ffffff;
    margin: 4px 0 10px;
}

.meter {
    position: relative;
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.15);
    margin: 12px 0 6px;
    overflow: hidden;
}

.meter-bar {
    position: absolute;
    inset: 0;
    width: var(--meter, 50%);
    background: linear-gradient(90deg, var(--hot-pink), var(--electric-violet), var(--sky-cyan));
    box-shadow: 0 0 14px rgba(168, 85, 247, 0.55);
    transform-origin: left;
    transform: scaleX(0);
    transition: transform 1100ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.glass-panel.in-view .meter-bar {
    transform: scaleX(1);
}

.meter-bar-mint {
    background: linear-gradient(90deg, var(--mint-pop), var(--sky-cyan));
    box-shadow: 0 0 14px rgba(52, 211, 153, 0.5);
}

.meter-label {
    font-family: "Fira Code", monospace;
    font-size: 12px;
    color: rgba(240, 240, 248, 0.78);
}

.meter-label strong {
    color: var(--mint-pop);
    font-weight: 500;
}

/* ---- Example panel (deeper offset) ---- */
.panel-example {
    transform: translateY(24px) translateX(2vw);
}

@media (max-width: 720px) {
    .panel-example { transform: translateY(24px); }
}

/* ---- Footer ---- */
.section-footer { padding-bottom: clamp(80px, 14vh, 160px); }

.panel-footer {
    width: min(720px, 92vw);
    text-align: center;
}

.footer-meta {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 18px 0;
}

.footer-credit {
    font-family: "Fira Code", monospace;
    font-size: 13px;
    color: rgba(240, 240, 248, 0.7);
    margin-top: 8px;
}

.frx {
    font-family: "Fraunces", serif;
    font-style: italic;
    font-weight: 600;
    color: #ffffff;
}

.frx-tld {
    color: var(--mint-pop);
    font-family: "Fira Code", monospace;
    font-style: normal;
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
    .glass-panel,
    .hero-panel,
    .meter-bar,
    .bg-gradient,
    .bg-pattern {
        animation: none !important;
        transition: none !important;
    }
    .glass-panel { opacity: 1; transform: none; }
    .meter-bar { transform: scaleX(1); }
}

/* ---- Mobile ---- */
@media (max-width: 640px) {
    .breadcrumb-line { display: none; }
    .modules-row { grid-template-columns: 1fr; }
    .panel-offset { transform: none; }
    .panel-offset.in-view { transform: none; }
}
