/* nonri.net - glassmorphism / layered-depth / network of logic */

:root {
    --deep-logic:        #0f0c29;
    --midpoint-violet:   #302b63;
    --theorem-dark:      #24243e;
    --proof-lavender:    #e8e0ff;
    --logic-purple:      #a78bfa;
    --aurora-blue:       #667eea;
    --aurora-violet:     #764ba2;
    --aurora-pink:       #f093fb;
    --white:             #ffffff;

    --glass-bg:          rgba(255, 255, 255, 0.12);
    --glass-bg-strong:   rgba(255, 255, 255, 0.18);
    --glass-bg-faint:    rgba(255, 255, 255, 0.08);
    --glass-edge:        rgba(255, 255, 255, 0.20);
    --glass-edge-strong: rgba(255, 255, 255, 0.30);
    --thread:            rgba(255, 255, 255, 0.30);

    --font-display: 'Plus Jakarta Sans', system-ui, sans-serif;
    --font-body:    'Plus Jakarta Sans', system-ui, sans-serif;
    --font-code:    'Fira Code', ui-monospace, monospace;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.75;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.92);
    background: linear-gradient(135deg, var(--deep-logic) 0%, var(--midpoint-violet) 50%, var(--theorem-dark) 100%);
    background-attachment: fixed;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* ============================================================
   Background mesh blobs (low-saturation aurora over gradient)
   ============================================================ */
.mesh-bg {
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    overflow: hidden;
}

.mesh-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(110px);
    opacity: 0.42;
    mix-blend-mode: screen;
    animation: drift 28s ease-in-out infinite alternate;
}

.mesh-blob-1 {
    width: 620px;
    height: 620px;
    background: radial-gradient(circle, var(--aurora-blue), transparent 70%);
    top: -160px;
    left: -120px;
    animation-delay: 0s;
}

.mesh-blob-2 {
    width: 540px;
    height: 540px;
    background: radial-gradient(circle, var(--aurora-violet), transparent 70%);
    top: 30%;
    right: -120px;
    animation-delay: -8s;
}

.mesh-blob-3 {
    width: 720px;
    height: 720px;
    background: radial-gradient(circle, var(--aurora-pink), transparent 70%);
    bottom: -240px;
    left: 25%;
    opacity: 0.32;
    animation-delay: -14s;
}

@keyframes drift {
    0%   { transform: translate3d(0, 0, 0) scale(1); }
    50%  { transform: translate3d(40px, -30px, 0) scale(1.06); }
    100% { transform: translate3d(-30px, 40px, 0) scale(0.96); }
}

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

.particle {
    position: absolute;
    bottom: -20px;
    left: var(--p-left, 50%);
    width: var(--p-size, 3px);
    height: var(--p-size, 3px);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    box-shadow: 0 0 8px rgba(232, 224, 255, 0.4);
    animation: float-up var(--p-duration, 26s) linear infinite;
    animation-delay: var(--p-delay, 0s);
    opacity: 0;
}

@keyframes float-up {
    0%   { transform: translateY(0) translateX(0);    opacity: 0; }
    10%  { opacity: 0.8; }
    50%  { transform: translateY(-55vh) translateX(12px); opacity: 0.6; }
    90%  { opacity: 0.4; }
    100% { transform: translateY(-110vh) translateX(-8px); opacity: 0; }
}

/* ============================================================
   Topbar
   ============================================================ */
.topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 32px;
    background: rgba(15, 12, 41, 0.35);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--glass-edge);
}

.topbar-mark {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--proof-lavender);
    letter-spacing: 0.02em;
}

.topbar-mark .dot {
    width: 8px;
    height: 8px;
    background: var(--logic-purple);
    border-radius: 50%;
    box-shadow: 0 0 14px rgba(167, 139, 250, 0.7);
    animation: pulse 3.2s ease-in-out infinite;
}

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

.mark-text { font-size: 0.95rem; }

.topbar-meta .meta-code {
    font-family: var(--font-code);
    font-size: 0.78rem;
    color: rgba(232, 224, 255, 0.7);
    letter-spacing: 0.03em;
}

@media (max-width: 640px) {
    .topbar { padding: 14px 18px; }
    .topbar-meta { display: none; }
}

/* ============================================================
   Glass primitive
   ============================================================ */
.glass {
    background: var(--glass-bg);
    border: 1px solid var(--glass-edge);
    border-radius: 16px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.30),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    padding: 32px;
    position: relative;
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 120px 24px 60px;
    position: relative;
}

.hero-stack {
    position: relative;
    width: min(720px, 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    isolation: isolate;
}

.glass-hero {
    width: min(560px, 100%);
    padding: 56px 48px 52px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: var(--glass-bg-strong);
    border-color: var(--glass-edge-strong);
    text-align: center;
    z-index: 3;
    transform: translateY(0);
    animation: hero-rise 1.2s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.glass-back {
    position: absolute;
    width: 280px;
    height: 220px;
    z-index: 1;
    background: var(--glass-bg-faint);
    border-color: rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    padding: 24px;
    overflow: hidden;
}

.glass-back-left {
    left: -10%;
    top: 8%;
    transform: rotate(-6deg);
    animation: back-rise-l 1.4s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both;
}

.glass-back-right {
    right: -10%;
    bottom: 6%;
    transform: rotate(5deg);
    z-index: 2;
    animation: back-rise-r 1.4s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
}

.proof-snippet {
    font-family: var(--font-code);
    font-size: 0.85rem;
    color: rgba(232, 224, 255, 0.75);
    letter-spacing: 0.04em;
}

@keyframes hero-rise {
    0%   { opacity: 0; transform: translateY(28px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes back-rise-l {
    0%   { opacity: 0; transform: translate(-20px, 10px) rotate(-12deg); }
    100% { opacity: 1; transform: rotate(-6deg); }
}

@keyframes back-rise-r {
    0%   { opacity: 0; transform: translate(20px, 10px) rotate(11deg); }
    100% { opacity: 1; transform: rotate(5deg); }
}

.hero-eyebrow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-bottom: 22px;
}

.eyebrow-rule {
    flex: 0 0 36px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--logic-purple), transparent);
}

.eyebrow-text {
    font-family: var(--font-code);
    font-size: 0.78rem;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--logic-purple);
}

.hero-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(1.8rem, 4.5vw, 3.2rem);
    color: var(--white);
    letter-spacing: -0.02em;
    line-height: 1.05;
    text-shadow: 0 2px 24px rgba(167, 139, 250, 0.35);
}

.hero-subtitle {
    margin-top: 14px;
    font-size: 1.02rem;
    font-weight: 400;
    color: rgba(232, 224, 255, 0.86);
    letter-spacing: 0.01em;
}

.hero-formula {
    margin-top: 28px;
    display: inline-flex;
    padding: 10px 18px;
    border-radius: 10px;
    background: rgba(15, 12, 41, 0.35);
    border: 1px solid rgba(167, 139, 250, 0.25);
}

.hero-formula code {
    font-family: var(--font-code);
    font-size: 0.92rem;
    color: var(--proof-lavender);
    letter-spacing: 0.03em;
}

.scroll-hint {
    margin-top: 64px;
    font-family: var(--font-code);
    font-size: 0.72rem;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    color: rgba(232, 224, 255, 0.5);
}

.scroll-hint span {
    display: inline-block;
    animation: hint-bounce 2.2s ease-in-out infinite;
}

@keyframes hint-bounce {
    0%, 100% { transform: translateY(0); opacity: 0.5; }
    50%      { transform: translateY(6px); opacity: 0.9; }
}

@media (max-width: 640px) {
    .glass-hero { padding: 40px 28px 36px; }
    .glass-back { display: none; }
}

/* ============================================================
   Proof Stack (overlapping logic nodes)
   ============================================================ */
.proof-stack {
    position: relative;
    max-width: 760px;
    margin: 40px auto 0;
    padding: 60px 24px 80px;
    isolation: isolate;
}

.connection-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.connection-canvas .thread {
    fill: none;
    stroke: url(#threadGradient);
    stroke-width: 1;
    stroke-dasharray: 6 6;
    opacity: 0;
    transition: opacity 1s ease;
}

.connection-canvas .thread.visible {
    opacity: 0.85;
    animation: dashflow 4s linear infinite;
}

@keyframes dashflow {
    to { stroke-dashoffset: -60; }
}

.logic-node {
    position: relative;
    z-index: 1;
    margin-top: var(--card-offset, -40px);
    padding: 36px 38px 38px;
    transform: translateY(28px) rotate(2deg);
    opacity: 0;
    transition:
        opacity 0.65s cubic-bezier(0.2, 0.7, 0.2, 1),
        transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1),
        box-shadow 0.4s ease;
}

.logic-node[data-node="1"] { z-index: 1; --card-blur: 24px; background: rgba(255,255,255,0.08); }
.logic-node[data-node="2"] { z-index: 2; --card-blur: 20px; background: rgba(255,255,255,0.10); }
.logic-node[data-node="3"] { z-index: 3; --card-blur: 16px; background: rgba(255,255,255,0.13); }
.logic-node[data-node="4"] { z-index: 4; --card-blur: 12px; background: rgba(255,255,255,0.16); }
.logic-node[data-node="5"] { z-index: 5; --card-blur: 8px;  background: rgba(255,255,255,0.20); border-color: var(--glass-edge-strong); }

.logic-node {
    backdrop-filter: blur(var(--card-blur, 16px));
    -webkit-backdrop-filter: blur(var(--card-blur, 16px));
}

.logic-node.visible {
    opacity: 1;
    transform: translateY(0) rotate(var(--card-rotate, 0.5deg));
}

.logic-node:hover {
    box-shadow:
        0 14px 44px rgba(0, 0, 0, 0.40),
        0 0 0 1px rgba(167, 139, 250, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.node-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px dashed rgba(232, 224, 255, 0.22);
}

.node-tag {
    font-family: var(--font-code);
    font-size: 0.72rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--logic-purple);
}

.node-depth {
    font-family: var(--font-code);
    font-size: 0.7rem;
    color: rgba(232, 224, 255, 0.5);
}

.logic-node h2 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(1.4rem, 2.6vw, 1.85rem);
    color: var(--proof-lavender);
    letter-spacing: -0.01em;
    line-height: 1.2;
    margin-bottom: 14px;
}

.logic-node p {
    font-size: 1rem;
    line-height: 1.75;
    color: rgba(255, 255, 255, 0.86);
    margin-bottom: 18px;
}

.node-formula {
    display: inline-block;
    padding: 8px 14px;
    font-family: var(--font-code);
    font-size: 0.82rem;
    color: var(--proof-lavender);
    background: rgba(15, 12, 41, 0.40);
    border: 1px solid rgba(167, 139, 250, 0.22);
    border-radius: 8px;
    letter-spacing: 0.04em;
}

.logic-node-final {
    border: 1px solid rgba(232, 224, 255, 0.4);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.42),
        0 0 80px rgba(167, 139, 250, 0.20),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

@media (max-width: 640px) {
    .proof-stack { padding: 40px 16px 60px; }
    .logic-node { padding: 28px 24px; margin-top: -28px; }
    .logic-node[data-node="1"] { margin-top: 0; }
    .node-head { flex-wrap: wrap; }
}

/* ============================================================
   Network Map
   ============================================================ */
.network-map {
    max-width: 980px;
    margin: 40px auto 0;
    padding: 80px 24px 60px;
}

.map-intro {
    text-align: center;
    max-width: 640px;
    margin: 0 auto 36px;
}

.map-eyebrow {
    display: inline-block;
    font-family: var(--font-code);
    font-size: 0.74rem;
    letter-spacing: 0.34em;
    text-transform: uppercase;
    color: var(--logic-purple);
    margin-bottom: 16px;
}

.map-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(1.6rem, 3.2vw, 2.4rem);
    color: var(--proof-lavender);
    letter-spacing: -0.015em;
    line-height: 1.18;
    margin-bottom: 14px;
}

.map-desc {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.78);
    line-height: 1.7;
}

.map-stage {
    position: relative;
    padding: 28px;
    border-radius: 20px;
    background: rgba(15, 12, 41, 0.35);
    border: 1px solid var(--glass-edge);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.32);
    overflow: hidden;
}

.map-stage::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(102, 126, 234, 0.18), transparent 50%),
        radial-gradient(circle at 85% 75%, rgba(240, 147, 251, 0.12), transparent 55%);
    pointer-events: none;
}

.map-svg {
    position: relative;
    display: block;
    width: 100%;
    height: auto;
    max-height: 460px;
}

.map-edges line {
    stroke-dasharray: 4 6;
    stroke-dashoffset: 0;
    animation: edge-flow 6s linear infinite;
}

@keyframes edge-flow {
    to { stroke-dashoffset: -40; }
}

.map-node circle {
    transform-origin: center;
    transform-box: fill-box;
    animation: node-pulse 4s ease-in-out infinite;
}

.map-node:nth-child(2) circle { animation-delay: -0.6s; }
.map-node:nth-child(3) circle { animation-delay: -1.2s; }
.map-node:nth-child(4) circle { animation-delay: -1.8s; }
.map-node:nth-child(5) circle { animation-delay: -2.4s; }
.map-node:nth-child(6) circle { animation-delay: -3.0s; }

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

.map-node-anchor circle {
    filter: drop-shadow(0 0 18px rgba(232, 224, 255, 0.55));
}

@media (max-width: 640px) {
    .network-map { padding: 60px 16px 40px; }
    .map-stage { padding: 14px; }
}

/* ============================================================
   Footer
   ============================================================ */
.footer {
    padding: 60px 24px 80px;
    max-width: 760px;
    margin: 0 auto;
}

.footer-glass {
    padding: 28px 36px;
    background: var(--glass-bg-faint);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: center;
    text-align: center;
}

.footer-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: center;
    gap: 14px;
}

.footer-text {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--white);
    letter-spacing: -0.01em;
}

.footer-note {
    font-family: var(--font-code);
    font-size: 0.78rem;
    color: rgba(232, 224, 255, 0.65);
    letter-spacing: 0.06em;
}

.footer-formula {
    font-family: var(--font-code);
    font-size: 0.84rem;
    color: var(--logic-purple);
    letter-spacing: 0.04em;
    padding: 6px 14px;
    border-radius: 8px;
    background: rgba(15, 12, 41, 0.40);
    border: 1px solid rgba(167, 139, 250, 0.22);
}

@media (max-width: 640px) {
    .footer { padding: 40px 16px 60px; }
    .footer-glass { padding: 22px 22px; }
}
