/* parallel.day -- neomorphism, bento-box, aurora-gradient */

:root {
    --void: #0A0818;
    --surface: #1A1830;
    --aurora-purple: #6040B0;
    --aurora-teal: #30A890;
    --glitch-pink: #E04878;
    --data-white: #E0E0F0;
    --dim-gray: #484860;

    --neo-shadow:
        0 4px 12px rgba(0, 0, 0, 0.45),
        0 1px 3px rgba(0, 0, 0, 0.55),
        inset 0 1px 2px rgba(255, 255, 255, 0.05),
        inset 0 -1px 2px rgba(0, 0, 0, 0.4);

    --neo-shadow-hover:
        0 8px 22px rgba(0, 0, 0, 0.55),
        0 2px 5px rgba(0, 0, 0, 0.6),
        inset 0 1px 2px rgba(255, 255, 255, 0.07),
        inset 0 -1px 2px rgba(0, 0, 0, 0.4);

    --gap: 16px;
    --unit: 300px;
}

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

html, body {
    background: var(--void);
    color: var(--data-white);
    font-family: 'Inter', sans-serif;
    font-size: clamp(14px, 0.9vw, 16px);
    line-height: 1.7;
    overflow-x: hidden;
    min-height: 100vh;
}

body {
    position: relative;
    isolation: isolate;
}

/* Aurora ambient layer */
.aurora-layer {
    position: fixed;
    inset: 0;
    z-index: -2;
    background:
        radial-gradient(ellipse 70% 50% at 20% 30%, rgba(96, 64, 176, 0.18), transparent 60%),
        radial-gradient(ellipse 60% 50% at 80% 70%, rgba(48, 168, 144, 0.16), transparent 60%),
        radial-gradient(ellipse 50% 40% at 50% 50%, rgba(96, 64, 176, 0.10), transparent 70%);
    background-size: 200% 200%;
    animation: aurora-shift 20s ease-in-out infinite;
    pointer-events: none;
}

@keyframes aurora-shift {
    0%, 100% { background-position: 0% 0%, 100% 100%, 50% 50%; }
    25% { background-position: 30% 70%, 60% 30%, 70% 30%; }
    50% { background-position: 100% 50%, 0% 50%, 30% 70%; }
    75% { background-position: 70% 30%, 30% 70%, 80% 50%; }
}

/* Nature minimal silhouettes */
.nature-motifs {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}

.nature-motifs .leaf {
    position: absolute;
    width: 12px;
    height: 12px;
    opacity: 0;
    transition: opacity 1.5s ease-out;
}

.nature-motifs.show .leaf { opacity: 0.05; }

.leaf-1 { top: 12%; left: 8%; }
.leaf-2 { top: 28%; left: 92%; }
.leaf-3 { top: 45%; left: 4%; }
.leaf-4 { top: 60%; left: 88%; }
.leaf-5 { top: 75%; left: 12%; }
.leaf-6 { top: 88%; left: 80%; }
.leaf-7 { top: 18%; left: 50%; }
.leaf-8 { top: 92%; left: 45%; }

/* Labels */
.label {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--dim-gray);
}

.value {
    font-family: 'Bebas Neue', sans-serif;
    font-weight: 400;
    font-size: 18px;
    letter-spacing: 0.04em;
    color: var(--data-white);
}

.metric {
    font-family: 'Bebas Neue', sans-serif;
    font-weight: 400;
    font-size: clamp(32px, 3vw, 52px);
    letter-spacing: 0.04em;
    color: var(--data-white);
    line-height: 1;
    display: block;
}

.metric-medium {
    font-size: clamp(22px, 2vw, 32px);
}

.metric-small {
    font-size: clamp(18px, 1.5vw, 24px);
}

.metric-unit {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--dim-gray);
    display: block;
    margin-top: 4px;
}

.metric-unit-tight {
    margin-top: 6px;
}

/* Convergence point (hero) */
.convergence {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(40px, 6vw, 80px);
    overflow: hidden;
}

.convergence::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(120deg,
            transparent 0%,
            rgba(96, 64, 176, 0.08) 30%,
            rgba(48, 168, 144, 0.08) 60%,
            transparent 100%);
    background-size: 300% 300%;
    animation: aurora-band 22s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes aurora-band {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.convergence-inner {
    position: relative;
    max-width: 1100px;
    width: 100%;
    z-index: 1;
}

.meta-strip {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: clamp(24px, 3vw, 40px);
    opacity: 0;
    animation: fade-in 600ms 200ms ease-out forwards;
}

.meta-strip .dot {
    width: 4px;
    height: 4px;
    background: var(--dim-gray);
    border-radius: 50%;
}

.domain-title {
    font-family: 'Bebas Neue', sans-serif;
    font-weight: 400;
    font-size: clamp(48px, 9vw, 160px);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--data-white);
    line-height: 0.95;
    position: relative;
    opacity: 0;
    animation: title-fade 500ms 100ms ease-out forwards;
}

.domain-title::before,
.domain-title::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0;
}

.domain-title::before {
    color: var(--glitch-pink);
    transform: translate(-2px, 0);
    mix-blend-mode: screen;
}

.domain-title::after {
    color: var(--aurora-teal);
    transform: translate(2px, 0);
    mix-blend-mode: screen;
}

.domain-title.glitch::before {
    animation: glitch-r 100ms steps(2) 1;
}

.domain-title.glitch::after {
    animation: glitch-l 100ms steps(2) 1;
}

@keyframes glitch-r {
    0%, 100% { opacity: 0; transform: translate(0, 0); clip-path: inset(0 0 0 0); }
    20% { opacity: 0.9; transform: translate(-3px, -1px); clip-path: inset(20% 0 30% 0); }
    40% { opacity: 0.9; transform: translate(-2px, 1px); clip-path: inset(50% 0 10% 0); }
    60% { opacity: 0.9; transform: translate(-4px, 0); clip-path: inset(10% 0 60% 0); }
    80% { opacity: 0.9; transform: translate(-1px, -1px); clip-path: inset(35% 0 35% 0); }
}

@keyframes glitch-l {
    0%, 100% { opacity: 0; transform: translate(0, 0); clip-path: inset(0 0 0 0); }
    20% { opacity: 0.9; transform: translate(3px, 1px); clip-path: inset(40% 0 20% 0); }
    40% { opacity: 0.9; transform: translate(2px, -1px); clip-path: inset(15% 0 50% 0); }
    60% { opacity: 0.9; transform: translate(4px, 0); clip-path: inset(60% 0 10% 0); }
    80% { opacity: 0.9; transform: translate(1px, 1px); clip-path: inset(25% 0 45% 0); }
}

@keyframes title-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.tagline {
    margin-top: clamp(20px, 2.5vw, 32px);
    max-width: 620px;
    color: var(--data-white);
    opacity: 0;
    animation: fade-in 600ms 400ms ease-out forwards;
}

.convergence-meta {
    margin-top: clamp(36px, 4vw, 56px);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: var(--gap);
    max-width: 720px;
    opacity: 0;
    animation: fade-in 600ms 600ms ease-out forwards;
}

.meta-cell {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.meta-cell .value {
    font-size: clamp(20px, 1.6vw, 26px);
}

/* Bento header */
.bento-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: clamp(20px, 2.5vw, 32px);
}

.bento-tag {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--aurora-teal);
    padding: 4px 10px;
    border: 1px solid rgba(48, 168, 144, 0.3);
    border-radius: 2px;
}

.bento-heading {
    font-family: 'Bebas Neue', sans-serif;
    font-weight: 400;
    font-size: clamp(22px, 2.2vw, 36px);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--data-white);
}

.bento-rule {
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, var(--dim-gray), transparent);
}

/* Process grid (bento) */
.process-grid {
    padding: clamp(40px, 5vw, 80px) clamp(20px, 4vw, 60px);
    max-width: 1400px;
    margin: 0 auto;
}

.bento {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: var(--unit);
    gap: var(--gap);
}

@media (max-width: 1100px) {
    .bento {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .bento {
        grid-template-columns: 1fr;
        grid-auto-rows: 220px;
    }
}

.box {
    position: relative;
    background: var(--surface);
    border-radius: 14px;
    padding: clamp(18px, 1.6vw, 26px);
    box-shadow: var(--neo-shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(0);
    transition: opacity 200ms ease-out, box-shadow 280ms ease-out, background 280ms ease-out;
}

.box.visible { opacity: 1; }

.box::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 14px;
    pointer-events: none;
    opacity: 0.10;
    transition: opacity 280ms ease-out;
}

.box[data-tint="purple"]::before {
    background: linear-gradient(135deg, rgba(96, 64, 176, 0.6), transparent 65%);
}
.box[data-tint="teal"]::before {
    background: linear-gradient(135deg, rgba(48, 168, 144, 0.6), transparent 65%);
}
.box[data-tint="pink"]::before {
    background: linear-gradient(135deg, rgba(224, 72, 120, 0.55), transparent 65%);
}

.box:hover {
    box-shadow: var(--neo-shadow-hover);
}

.box:hover::before { opacity: 0.15; }

/* Bento spans */
.box-1x1 { grid-column: span 1; grid-row: span 1; }
.box-2x1 { grid-column: span 2; grid-row: span 1; }
.box-1x2 { grid-column: span 1; grid-row: span 2; }
.box-2x2 { grid-column: span 2; grid-row: span 2; }

@media (max-width: 1100px) {
    .box-2x1, .box-2x2 { grid-column: span 2; }
    .box-1x2 { grid-column: span 1; grid-row: span 2; }
}

@media (max-width: 600px) {
    .box-1x1, .box-2x1, .box-1x2, .box-2x2 {
        grid-column: span 1;
        grid-row: span 1;
    }
    .box-1x2, .box-2x2 { min-height: 320px; }
}

.box-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    position: relative;
    z-index: 1;
}

.status {
    font-family: 'Inter', sans-serif;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.14em;
    padding: 3px 7px;
    border-radius: 2px;
    text-transform: uppercase;
}

.status-active {
    color: var(--aurora-teal);
    background: rgba(48, 168, 144, 0.1);
    border: 1px solid rgba(48, 168, 144, 0.25);
    position: relative;
}

.status-active::before {
    content: "";
    display: inline-block;
    width: 5px;
    height: 5px;
    background: var(--aurora-teal);
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
    animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

.box-body {
    flex: 1;
    position: relative;
    z-index: 1;
}

.box-body-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.box-body-stack {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 10px;
}

.box-text {
    font-size: clamp(13px, 0.85vw, 14px);
    color: var(--data-white);
    line-height: 1.6;
}

.box-foot {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    position: relative;
    z-index: 1;
    padding-top: 12px;
    border-top: 1px solid rgba(72, 72, 96, 0.3);
}

/* dataviz */
.dataviz {
    width: 100%;
    height: auto;
    display: block;
    position: relative;
    z-index: 1;
}

.dataviz-line {
    margin-top: 14px;
    height: 80px;
}

.dataviz-vertical {
    position: absolute;
    right: 16px;
    top: 60px;
    bottom: 60px;
    width: 60px;
    height: auto;
    opacity: 0.85;
}

.dataviz-area {
    margin-top: 16px;
    flex: 1;
    height: 180px;
}

.dataviz-spark {
    width: 80px;
    height: 20px;
    flex-shrink: 0;
}

.line-path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 1.4s ease-out;
}

.box.visible .line-path {
    stroke-dashoffset: 0;
}

.box.visible .line-path-2 {
    transition-delay: 200ms;
}

.box.visible .line-path-3 {
    transition-delay: 400ms;
}

/* Counter / thread bars */
.thread-bars {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
    margin-top: 16px;
    position: relative;
    z-index: 1;
}

.thread-bars span {
    height: 10px;
    background: var(--dim-gray);
    border-radius: 1px;
    opacity: 0.4;
}

.thread-bars span.alive {
    background: linear-gradient(to right, var(--aurora-teal), var(--aurora-purple));
    opacity: 1;
}

/* Glitch box */
.metric-glitch {
    position: relative;
}

.metric-glitch::before,
.metric-glitch::after {
    content: attr(data-text);
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
}

.metric-glitch::before {
    color: var(--glitch-pink);
    transform: translate(-1px, 0);
}

.metric-glitch::after {
    color: var(--aurora-teal);
    transform: translate(1px, 0);
}

.metric-glitch.glitch::before {
    animation: glitch-small 80ms steps(2) 1;
}

.metric-glitch.glitch::after {
    animation: glitch-small-2 80ms steps(2) 1;
}

@keyframes glitch-small {
    0%, 100% { opacity: 0; transform: translate(0, 0); }
    50% { opacity: 0.85; transform: translate(-2px, 0); }
}

@keyframes glitch-small-2 {
    0%, 100% { opacity: 0; transform: translate(0, 0); }
    50% { opacity: 0.85; transform: translate(2px, 0); }
}

.glitch-bar {
    margin-top: 14px;
    position: relative;
    height: 4px;
    background: var(--dim-gray);
    border-radius: 1px;
    overflow: hidden;
    z-index: 1;
}

.glitch-bar::after {
    content: "";
    position: absolute;
    top: 0;
    left: -30%;
    height: 100%;
    width: 30%;
    background: linear-gradient(to right, transparent, var(--glitch-pink), transparent);
    animation: glitch-sweep 3s ease-in-out infinite;
}

@keyframes glitch-sweep {
    0%, 100% { left: -30%; }
    50% { left: 100%; }
}

/* Sparkline */
.spark-row {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: space-between;
}

/* Sync ring */
.sync-ring {
    width: 100px;
    height: 100px;
    margin-bottom: 8px;
}

.sync-ring svg {
    width: 100%;
    height: 100%;
}

.ring-stroke {
    transform-origin: center;
    animation: ring-rotate 8s linear infinite;
}

.ring-stroke-2 {
    animation-duration: 5s;
    animation-direction: reverse;
}

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

/* Data band */
.data-band {
    padding: clamp(40px, 5vw, 80px) clamp(20px, 4vw, 60px);
    max-width: 1400px;
    margin: 0 auto;
}

.data-band-head {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: clamp(20px, 2.5vw, 32px);
}

.data-band-head .bento-tag {
    color: var(--aurora-purple);
    border-color: rgba(96, 64, 176, 0.3);
}

.stream-wrap {
    position: relative;
    background: var(--surface);
    border-radius: 14px;
    padding: clamp(20px, 2.5vw, 36px);
    box-shadow: var(--neo-shadow);
    overflow: hidden;
}

.stream-wrap::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 60% 50% at 30% 50%, rgba(96, 64, 176, 0.10), transparent 60%),
        radial-gradient(ellipse 60% 50% at 70% 50%, rgba(48, 168, 144, 0.10), transparent 60%);
    opacity: 0.8;
}

.stream-svg {
    width: 100%;
    height: 240px;
    display: block;
    position: relative;
    z-index: 1;
}

.stream-labels {
    margin-top: 16px;
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

/* Merge point footer */
.merge-point {
    position: relative;
    padding: clamp(60px, 8vw, 120px) clamp(20px, 4vw, 60px);
    margin-top: clamp(40px, 5vw, 80px);
    overflow: hidden;
}

.merge-aurora {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 50% 100%, rgba(96, 64, 176, 0.35), transparent 70%),
        radial-gradient(ellipse 70% 50% at 30% 80%, rgba(48, 168, 144, 0.30), transparent 70%),
        radial-gradient(ellipse 60% 40% at 80% 50%, rgba(224, 72, 120, 0.20), transparent 70%);
    background-size: 200% 200%;
    animation: aurora-shift 16s ease-in-out infinite;
    pointer-events: none;
    transition: opacity 800ms ease-out;
    opacity: 0.5;
}

.merge-point.intensify .merge-aurora {
    opacity: 1;
}

.merge-inner {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    background: var(--surface);
    border-radius: 18px;
    padding: clamp(28px, 4vw, 56px);
    box-shadow: var(--neo-shadow);
}

.merge-block {
    margin-bottom: clamp(24px, 3vw, 40px);
}

.merge-title {
    font-family: 'Bebas Neue', sans-serif;
    font-weight: 400;
    font-size: clamp(28px, 3vw, 48px);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--data-white);
    margin-top: 12px;
    line-height: 1;
}

.merge-text {
    margin-top: 14px;
    max-width: 620px;
    color: var(--data-white);
}

.merge-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: var(--gap);
    margin-top: clamp(20px, 2.5vw, 32px);
}

.merge-rule {
    height: 1px;
    background: linear-gradient(to right,
        transparent,
        var(--aurora-teal) 30%,
        var(--aurora-purple) 70%,
        transparent);
    margin: clamp(28px, 3vw, 40px) 0 24px;
    opacity: 0.6;
}

.merge-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Chart stats */
.chart-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 18px;
}

.chart-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Small responsive tweaks */
@media (max-width: 600px) {
    .convergence-meta { grid-template-columns: 1fr 1fr; }
    .merge-meta { grid-template-columns: 1fr 1fr; }
    .meta-strip { flex-wrap: wrap; }
}
