/* p9r.dev - Glassmorphic Data Center Aesthetic */

/* ========== CSS Custom Properties ========== */
:root {
    --void: #0a0a1a;
    --deep-panel: #1a1a3e;
    --deep-purple: #2a0040;
    --mid-purple: #3a3a6e;
    --neon-teal: #00ffcc;
    --neon-cyan: #00ffff;
    --neon-magenta: #ff00ff;
    --neon-pink: #ff6ec7;
    --light-text: #e0e0ff;
    --muted-text: #b0b0d0;
    --dark-teal: #002a3a;
    --neon-violet: #8b00ff;
    --glass-bg: rgba(26, 26, 62, 0.6);
    --glass-border: rgba(58, 58, 110, 0.5);
    --glass-blur: blur(20px) saturate(1.4);
    --font-display: 'Bungee Shade', cursive;
    --font-heading: 'Space Grotesk', sans-serif;
    --font-mono: 'IBM Plex Mono', monospace;
    --font-body: 'Inter', sans-serif;
}

/* ========== Reset ========== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background: var(--void);
    color: var(--light-text);
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ========== Background Grid ========== */
.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 1.2s ease;
    background-image:
        linear-gradient(rgba(58, 58, 110, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(58, 58, 110, 0.05) 1px, transparent 1px);
    background-size: 60px 60px;
}

.bg-grid.visible {
    opacity: 1;
}

/* ========== Floating Orbs ========== */
.floating-orbs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
    animation: orbFloat 20s ease-in-out infinite;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: var(--neon-magenta);
    top: -10%;
    right: -10%;
    animation-duration: 25s;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: var(--neon-teal);
    bottom: -10%;
    left: -5%;
    animation-duration: 20s;
    animation-delay: -5s;
}

.orb-3 {
    width: 300px;
    height: 300px;
    background: var(--neon-cyan);
    top: 40%;
    left: 50%;
    animation-duration: 30s;
    animation-delay: -10s;
}

.orb-4 {
    width: 250px;
    height: 250px;
    background: var(--deep-purple);
    bottom: 20%;
    right: 20%;
    animation-duration: 22s;
    animation-delay: -3s;
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -40px) scale(1.05); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(15px, 30px) scale(1.02); }
}

/* ========== Refraction Lines ========== */
.refraction-lines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.refraction-line {
    position: absolute;
    width: 200%;
    height: 1px;
    transform-origin: center;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.refraction-line-1 {
    background: linear-gradient(90deg, transparent, rgba(0, 255, 204, 0.15), transparent);
    top: 30%;
    left: -50%;
    transform: rotate(-8deg);
}

.refraction-line-2 {
    background: linear-gradient(90deg, transparent, rgba(139, 0, 255, 0.15), transparent);
    top: 55%;
    left: -50%;
    transform: rotate(-8deg);
}

.refraction-line-3 {
    background: linear-gradient(90deg, transparent, rgba(0, 255, 255, 0.08), transparent);
    top: 80%;
    left: -50%;
    transform: rotate(-8deg);
}

.refraction-lines.visible .refraction-line {
    opacity: 1;
}

/* ========== Sections ========== */
.section {
    position: relative;
    min-height: 100vh;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.section-inner {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 80px 24px;
    position: relative;
    z-index: 2;
}

/* ========== Diagonal Cuts ========== */
.diagonal-cut {
    position: absolute;
    left: 0;
    width: 100%;
    height: 80px;
    z-index: 3;
    overflow: hidden;
}

.diagonal-cut-top {
    top: -1px;
}

.diagonal-cut-bottom {
    bottom: -1px;
}

.diagonal-cut-top::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -5%;
    width: 110%;
    height: 100%;
    background: var(--void);
    transform: skewY(-3deg);
    transform-origin: top left;
}

.diagonal-cut-bottom::after {
    content: '';
    position: absolute;
    top: 0;
    left: -5%;
    width: 110%;
    height: 100%;
    background: var(--void);
    transform: skewY(-3deg);
    transform-origin: bottom right;
}

.section-signal {
    background: linear-gradient(180deg, transparent 0%, rgba(42, 0, 64, 0.15) 50%, transparent 100%);
}

.section-layers {
    background: linear-gradient(180deg, transparent 0%, rgba(0, 42, 58, 0.15) 50%, transparent 100%);
}

.section-matrix {
    border-top: 1px solid rgba(139, 0, 255, 0.05);
    background: linear-gradient(180deg, transparent 0%, rgba(42, 0, 64, 0.1) 50%, transparent 100%);
}

/* ========== Hero Section ========== */
.hero-content {
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease 0.6s, transform 1s ease 0.6s;
}

.hero-content.visible {
    opacity: 1;
    transform: translateY(0);
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(72px, 18vw, 240px);
    font-weight: 400;
    letter-spacing: 0.08em;
    line-height: 1;
    color: var(--light-text);
    text-shadow:
        0 0 20px rgba(255, 0, 255, 0.6),
        0 0 40px rgba(255, 0, 255, 0.3),
        0 0 80px rgba(0, 255, 255, 0.2),
        0 0 120px rgba(255, 0, 255, 0.1);
    margin-bottom: 24px;
    animation: neonPulse 4s ease-in-out infinite;
}

@keyframes neonPulse {
    0%, 100% {
        text-shadow:
            0 0 20px rgba(255, 0, 255, 0.6),
            0 0 40px rgba(255, 0, 255, 0.3),
            0 0 80px rgba(0, 255, 255, 0.2),
            0 0 120px rgba(255, 0, 255, 0.1);
    }
    50% {
        text-shadow:
            0 0 30px rgba(255, 0, 255, 0.8),
            0 0 60px rgba(255, 0, 255, 0.5),
            0 0 100px rgba(0, 255, 255, 0.35),
            0 0 160px rgba(255, 0, 255, 0.15);
    }
}

.hero-subtitle {
    font-family: var(--font-mono);
    font-size: clamp(14px, 2vw, 20px);
    color: var(--neon-teal);
    margin-bottom: 16px;
    opacity: 0;
    transition: opacity 0.8s ease 1.4s;
}

.hero-subtitle.visible {
    opacity: 1;
}

.subtitle-bracket {
    color: var(--mid-purple);
}

.subtitle-text {
    letter-spacing: 0.15em;
}

.hero-tagline {
    font-family: var(--font-body);
    font-size: clamp(12px, 1.5vw, 16px);
    color: var(--muted-text);
    letter-spacing: 0.3em;
    text-transform: uppercase;
    opacity: 0;
    transition: opacity 0.8s ease 1.8s;
}

.hero-tagline.visible {
    opacity: 1;
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.8s ease 2.4s;
}

.scroll-indicator.visible {
    opacity: 1;
}

.scroll-line {
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, var(--neon-teal), transparent);
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.3; transform: scaleY(1); }
    50% { opacity: 1; transform: scaleY(1.2); }
}

.scroll-text {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--muted-text);
    letter-spacing: 0.3em;
    text-transform: uppercase;
}

/* ========== Section Headers ========== */
.section-header {
    margin-bottom: 48px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.section-header.visible {
    opacity: 1;
    transform: translateY(0);
}

.section-label {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--neon-teal);
    letter-spacing: 0.2em;
    display: block;
    margin-bottom: 8px;
}

.section-title {
    font-family: var(--font-heading);
    font-size: clamp(28px, 5vw, 48px);
    font-weight: 700;
    color: var(--light-text);
    letter-spacing: -0.02em;
}

/* ========== Glass Cards ========== */
.glass-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 24px;
}

.glass-grid-three {
    grid-template-columns: 1fr 1fr 1fr;
}

.glass-grid-two {
    grid-template-columns: 1fr 1fr;
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 24px;
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease, box-shadow 0.3s ease;
}

.glass-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 204, 0.3), transparent);
}

.glass-card:hover {
    box-shadow:
        0 0 30px rgba(0, 255, 204, 0.08),
        0 0 60px rgba(255, 0, 255, 0.05);
}

.glass-card-wide {
    grid-column: 1 / -1;
}

.glass-card-tall {
    min-height: 420px;
}

.glass-card-stack {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Card Header */
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.card-tag {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.15em;
    color: var(--muted-text);
    text-transform: uppercase;
}

.card-status {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.1em;
    padding: 3px 10px;
    border-radius: 20px;
}

.status-live {
    color: var(--neon-teal);
    background: rgba(0, 255, 204, 0.1);
    border: 1px solid rgba(0, 255, 204, 0.3);
    animation: statusPulse 2s ease-in-out infinite;
}

.status-active {
    color: var(--neon-magenta);
    background: rgba(255, 0, 255, 0.1);
    border: 1px solid rgba(255, 0, 255, 0.3);
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.card-footer {
    display: flex;
    gap: 24px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid rgba(58, 58, 110, 0.3);
}

.data-label {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--muted-text);
}

.data-value {
    color: var(--neon-teal);
    font-weight: 600;
}

/* ========== Waveform ========== */
.waveform-container {
    width: 100%;
    overflow: hidden;
    border-radius: 8px;
}

.waveform-container canvas {
    width: 100%;
    height: 160px;
    display: block;
}

/* ========== Progress Rings ========== */
.metrics-grid {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 16px 0;
}

.metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.progress-ring {
    position: relative;
    width: 80px;
    height: 80px;
}

.progress-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.ring-bg {
    fill: none;
    stroke: rgba(58, 58, 110, 0.4);
    stroke-width: 4;
}

.ring-fill {
    fill: none;
    stroke: var(--neon-teal);
    stroke-width: 4;
    stroke-linecap: round;
    stroke-dasharray: 213.628;
    stroke-dashoffset: 213.628;
    transition: stroke-dashoffset 1.5s ease;
}

#ring-2 .ring-fill {
    stroke: var(--neon-magenta);
}

#ring-3 .ring-fill {
    stroke: #8b00ff;
}

.ring-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 600;
    color: var(--light-text);
}

.metric-label {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--muted-text);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* ========== Bar Chart ========== */
.bar-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 180px;
    padding-top: 16px;
    gap: 8px;
}

.bar {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
}

.bar-inner {
    width: 100%;
    border-radius: 4px 4px 0 0;
    background: var(--bar-color);
    opacity: 0.7;
    height: 0%;
    transition: height 1.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    box-shadow: 0 0 10px color-mix(in srgb, var(--bar-color) 40%, transparent);
}

.bar-label {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--muted-text);
    margin-top: 8px;
}

/* ========== Sparklines ========== */
.sparklines {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sparkline-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sparkline-label {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--muted-text);
    width: 48px;
    flex-shrink: 0;
}

.sparkline-canvas {
    flex: 1;
    height: 32px;
    border-radius: 4px;
}

.sparkline-value {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--neon-teal);
    font-weight: 600;
    width: 40px;
    text-align: right;
    flex-shrink: 0;
}

/* ========== Terminal ========== */
.terminal {
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.8;
    padding: 8px 0;
}

.terminal-line {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.terminal-line.visible {
    opacity: 1;
}

.terminal-prompt {
    color: var(--neon-teal);
    font-weight: 600;
}

.terminal-cmd {
    color: var(--light-text);
}

.terminal-output {
    color: var(--muted-text);
    padding-left: 16px;
}

.terminal-highlight {
    color: var(--neon-teal);
    font-weight: 600;
}

.cursor-blink {
    color: var(--neon-teal);
    animation: blink 1s step-end infinite;
}

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

/* ========== Network Canvas ========== */
.network-viz {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.network-viz canvas {
    width: 100%;
    max-width: 400px;
    height: auto;
    aspect-ratio: 1;
}

/* ========== Stat Rows ========== */
.stat-rows {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.stat-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.stat-label {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--muted-text);
    width: 80px;
    flex-shrink: 0;
}

.stat-bar-track {
    flex: 1;
    height: 6px;
    background: rgba(58, 58, 110, 0.3);
    border-radius: 3px;
    overflow: hidden;
}

.stat-bar-fill {
    height: 100%;
    width: 0%;
    background: var(--fill-color);
    border-radius: 3px;
    transition: width 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 0 8px color-mix(in srgb, var(--fill-color) 50%, transparent);
}

.stat-value {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--light-text);
    font-weight: 600;
    width: 60px;
    text-align: right;
    flex-shrink: 0;
}

/* ========== Hash Display ========== */
.hash-display {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hash-line {
    font-family: var(--font-mono);
    font-size: 14px;
    letter-spacing: 0.15em;
    color: var(--neon-magenta);
    opacity: 0.7;
    padding: 6px 12px;
    background: rgba(255, 0, 255, 0.05);
    border-radius: 4px;
    border-left: 2px solid rgba(255, 0, 255, 0.3);
    transition: opacity 0.3s ease;
}

.hash-line:hover {
    opacity: 1;
}

/* ========== Footer ========== */
.section-footer {
    min-height: 50vh;
}

.footer-content {
    text-align: center;
}

.footer-domain {
    font-family: var(--font-heading);
    font-size: clamp(32px, 6vw, 64px);
    font-weight: 700;
    color: var(--light-text);
    margin-bottom: 16px;
}

.footer-tld {
    color: var(--neon-teal);
}

.footer-line {
    width: 60px;
    height: 1px;
    background: linear-gradient(90deg, var(--neon-teal), var(--neon-magenta));
    margin: 24px auto;
}

.footer-meta {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.footer-item {
    font-family: var(--font-mono);
    font-size: 12px;
}

.footer-key {
    color: var(--muted-text);
}

.footer-val {
    color: var(--neon-teal);
    font-weight: 600;
}

.footer-copyright {
    font-family: var(--font-mono);
    font-size: 11px;
    color: rgba(176, 176, 208, 0.4);
    letter-spacing: 0.1em;
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
    .glass-grid,
    .glass-grid-three,
    .glass-grid-two {
        grid-template-columns: 1fr;
    }

    .glass-card-wide {
        grid-column: 1;
    }

    .section-inner {
        padding: 60px 16px;
    }

    .footer-meta {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }

    .metrics-grid {
        flex-direction: column;
        gap: 24px;
    }
}
