/* CSS Variables */
:root {
    --deep-ocean: #023047;
    --ocean-blue: #0077B6;
    --sky-blue: #00B4D8;
    --aqua: #48CAE4;
    --seafoam: #90E0EF;
    --mint: #00E5C7;
    --white: #FFFFFF;
    --light-gray: #CAF0F8;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Outfit', sans-serif;
    background: linear-gradient(135deg, #012A4A 0%, #023047 50%, #014F6B 100%);
    min-height: 100vh;
    color: var(--white);
    overflow-x: hidden;
    position: relative;
}

/* Wave Background */
.wave-container {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40vh;
    pointer-events: none;
    z-index: 0;
}

.wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.wave-1 path {
    fill: rgba(0, 119, 182, 0.15);
    animation: wave 8s ease-in-out infinite;
}

.wave-2 path {
    fill: rgba(0, 180, 216, 0.1);
    animation: wave 10s ease-in-out infinite reverse;
}

.wave-3 path {
    fill: rgba(72, 202, 228, 0.08);
    animation: wave 12s ease-in-out infinite;
}

@keyframes wave {
    0%, 100% { transform: translateX(0) translateY(0); }
    50% { transform: translateX(-2%) translateY(10px); }
}

/* Fiber Streaks Animation */
.fiber-streaks {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.streak {
    position: absolute;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--mint), transparent);
    opacity: 0;
    animation: streak 4s ease-in-out infinite;
}

.streak-1 { top: 20%; left: -100px; width: 200px; animation-delay: 0s; }
.streak-2 { top: 35%; left: -150px; width: 300px; animation-delay: 0.8s; }
.streak-3 { top: 50%; left: -100px; width: 250px; animation-delay: 1.6s; }
.streak-4 { top: 65%; left: -180px; width: 280px; animation-delay: 2.4s; }
.streak-5 { top: 80%; left: -120px; width: 220px; animation-delay: 3.2s; }

@keyframes streak {
    0% { transform: translateX(0); opacity: 0; }
    10% { opacity: 0.8; }
    90% { opacity: 0.8; }
    100% { transform: translateX(calc(100vw + 300px)); opacity: 0; }
}

/* Main Container */
.container {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
}

/* Logo */
.logo-container {
    margin-bottom: 3rem;
    animation: fadeInDown 1s ease-out;
}

.logo {
    width: 420px;
    max-width: 100%;
    height: auto;
}

.logo-text-main {
    font-family: 'Syne', sans-serif;
    font-size: 28px;
    font-weight: 800;
    fill: var(--white);
    letter-spacing: 2px;
}

.logo-text-sub {
    font-family: 'Outfit', sans-serif;
    font-size: 22px;
    font-weight: 300;
    fill: var(--mint);
    letter-spacing: 8px;
}

.logo-icon path {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    animation: flowLine 2.5s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
}

.logo-icon path:nth-child(1) {
    animation-delay: 0s;
}

.logo-icon path:nth-child(2) {
    animation-delay: 0.15s;
}

.logo-icon path:nth-child(3) {
    animation-delay: 0.3s;
}

.logo-icon circle {
    opacity: 0;
    transform: scale(0);
    animation: glowIn 1s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.logo-icon circle:nth-child(4) {
    animation-delay: 1.8s;
}

.logo-icon circle:nth-child(5) {
    animation-delay: 2s;
}

.logo-icon circle:nth-child(6) {
    animation-delay: 2.2s;
}

@keyframes flowLine {
    0% { 
        stroke-dashoffset: 100;
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    100% { 
        stroke-dashoffset: 0;
        opacity: 1;
    }
}

@keyframes glowIn {
    0% {
        opacity: 0;
        transform: scale(0);
        filter: blur(4px);
    }
    60% {
        opacity: 1;
        transform: scale(1.3);
        filter: blur(0px);
    }
    100% {
        opacity: 1;
        transform: scale(1);
        filter: blur(0px);
    }
}

/* Content */
.content {
    max-width: 700px;
    animation: fadeInUp 1s ease-out 0.3s both;
}

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0, 229, 199, 0.15);
    border: 1px solid rgba(0, 229, 199, 0.3);
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--mint);
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.pulse {
    width: 8px;
    height: 8px;
    background: var(--mint);
    border-radius: 50%;
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

/* Typography */
h1 {
    font-family: 'Syne', sans-serif;
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    text-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.highlight {
    background: linear-gradient(135deg, var(--aqua) 0%, var(--mint) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    font-size: 1.125rem;
    color: var(--seafoam);
    line-height: 1.7;
    max-width: 550px;
    margin: 0 auto 2.5rem;
    font-weight: 300;
}

.tagline strong {
    color: var(--mint);
    font-weight: 600;
}

/* Features */
.features {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.feature-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.feature:hover .feature-icon {
    transform: translateY(-5px);
    border-color: var(--mint);
    box-shadow: 0 10px 40px rgba(0, 229, 199, 0.2);
}

.feature span {
    font-size: 0.875rem;
    color: var(--light-gray);
    font-weight: 400;
}

/* Particle Canvas */
#particleCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* Connection Test Section */
.connection-test {
    margin-bottom: 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(0, 119, 182, 0.1), rgba(0, 229, 199, 0.05));
    border: 1px solid rgba(0, 229, 199, 0.15);
    border-radius: 20px;
}

.test-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.test-icon {
    font-size: 1.5rem;
}

.test-header h3 {
    font-family: 'Syne', sans-serif;
    font-size: 1.25rem;
    color: var(--white);
    margin: 0;
}

.test-results {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-bottom: 1.5rem;
}

.test-metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.metric-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    border: 3px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.5s ease;
}

.metric-circle.testing {
    border-color: var(--aqua);
    animation: circlePulse 1s ease infinite;
}

@keyframes circlePulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 rgba(72, 202, 228, 0); }
    50% { transform: scale(1.05); box-shadow: 0 0 30px rgba(72, 202, 228, 0.3); }
}

.metric-circle.excellent {
    border-color: #4ade80;
    box-shadow: 0 0 20px rgba(74, 222, 128, 0.3);
}

.metric-circle.good {
    border-color: var(--mint);
    box-shadow: 0 0 20px rgba(0, 229, 199, 0.3);
}

.metric-circle.okay {
    border-color: #eab308;
    box-shadow: 0 0 20px rgba(234, 179, 8, 0.3);
}

.metric-circle.poor {
    border-color: #ef4444;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
}

.metric-value {
    font-family: 'Syne', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--white);
}

.metric-unit {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
}

.metric-label {
    font-size: 0.875rem;
    color: var(--seafoam);
    font-weight: 500;
}

.test-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    background: linear-gradient(135deg, var(--ocean-blue) 0%, var(--mint) 100%);
    border: none;
    border-radius: 12px;
    color: var(--white);
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.test-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 229, 199, 0.3);
}

.test-btn.testing {
    pointer-events: none;
    opacity: 0.8;
}

.test-btn.testing span {
    opacity: 0;
}

.btn-loader {
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    opacity: 0;
}

.test-btn.testing .btn-loader {
    opacity: 1;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.test-comparison {
    margin-top: 1.25rem;
    font-size: 1rem;
    color: var(--seafoam);
    min-height: 1.5rem;
}

.test-comparison strong {
    color: var(--mint);
}

/* Speed Comparison Section */
.speed-section {
    margin: 2.5rem 0;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.speed-section h3 {
    font-family: 'Syne', sans-serif;
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: var(--mint);
}

.speed-comparisons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.speed-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.speed-item:hover {
    border-color: var(--mint);
    transform: translateX(5px);
    background: rgba(0, 229, 199, 0.05);
}

.speed-item.downloading {
    border-color: var(--aqua);
    box-shadow: 0 0 20px rgba(0, 229, 199, 0.2);
}

.speed-item.completed {
    border-color: #4ade80;
    background: rgba(74, 222, 128, 0.1);
}

.speed-item.completed .speed-icon {
    animation: bounce 0.5s ease;
}

@keyframes bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

.speed-icon {
    font-size: 1.75rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    flex-shrink: 0;
}

.speed-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    text-align: left;
}

.speed-label {
    font-weight: 500;
    color: var(--white);
    font-size: 0.95rem;
}

.speed-time {
    font-size: 0.85rem;
    color: var(--mint);
    font-weight: 600;
}

.progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--ocean-blue), var(--mint));
    transition: width 1s ease-out;
    border-radius: 0 3px 3px 0;
}

.speed-item.completed .progress-fill {
    background: linear-gradient(90deg, #4ade80, #22c55e);
}

.speed-hint {
    margin-top: 1rem;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
    animation: badgePulse 2s ease-in-out infinite;
}

/* Fiber Facts Section */
.fiber-facts {
    margin: 2rem 0;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, rgba(0, 119, 182, 0.1), rgba(0, 229, 199, 0.05));
    border: 1px solid rgba(0, 229, 199, 0.2);
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.fact-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.fact-text {
    flex: 1;
    min-width: 200px;
    font-size: 1rem;
    color: var(--seafoam);
    line-height: 1.6;
    text-align: left;
    transition: all 0.3s ease;
}

.fact-btn {
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid var(--mint);
    border-radius: 8px;
    color: var(--mint);
    font-family: inherit;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.fact-btn:hover {
    background: var(--mint);
    color: var(--deep-ocean);
}

/* Speed Game Section */
.speed-game {
    margin: 2rem 0;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
}

.speed-game h3 {
    font-family: 'Syne', sans-serif;
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--white);
}

.game-desc {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 1.5rem;
}

.game-area {
    height: 120px;
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.game-area:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.game-area span {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--white);
    transition: all 0.2s ease;
}

.game-area.waiting {
    background: rgba(234, 179, 8, 0.1);
    border-color: #eab308;
}

.game-area.waiting span {
    color: #eab308;
}

.game-area.ready {
    background: rgba(74, 222, 128, 0.15);
    border-color: #4ade80;
    animation: gameGlow 0.5s ease infinite;
}

.game-area.ready span {
    color: #4ade80;
    animation: gameText 0.3s ease infinite;
}

@keyframes gameGlow {
    0%, 100% { box-shadow: 0 0 20px rgba(74, 222, 128, 0.3); }
    50% { box-shadow: 0 0 40px rgba(74, 222, 128, 0.5); }
}

@keyframes gameText {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.game-area.too-early {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
}

.game-area.too-early span {
    color: #ef4444;
}

.game-result {
    margin-top: 1rem;
    font-size: 1rem;
    color: var(--mint);
    font-weight: 500;
    min-height: 1.5rem;
}

/* Signup Form */
.signup-section {
    margin-top: 1rem;
}

.signup-text {
    font-size: 0.95rem;
    color: var(--seafoam);
    margin-bottom: 1rem;
}

.signup-form {
    display: flex;
    gap: 0.75rem;
    max-width: 450px;
    margin: 0 auto;
    flex-wrap: wrap;
    justify-content: center;
}

.signup-form input {
    flex: 1;
    min-width: 250px;
    padding: 1rem 1.5rem;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--white);
    font-size: 1rem;
    font-family: inherit;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.signup-form input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.signup-form input:focus {
    outline: none;
    border-color: var(--mint);
    background: rgba(255, 255, 255, 0.08);
}

.signup-form button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--ocean-blue) 0%, var(--mint) 100%);
    border: none;
    border-radius: 12px;
    color: var(--white);
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
}

.signup-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 40px rgba(0, 229, 199, 0.3);
}

.signup-form button:active {
    transform: translateY(0);
}

.signup-form button svg {
    transition: transform 0.3s ease;
}

.signup-form button:hover svg {
    transform: translateX(4px);
}

.success-message {
    margin-top: 1rem;
    color: var(--mint);
    font-weight: 500;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.success-message.show {
    opacity: 1;
    transform: translateY(0);
}

/* Footer */
footer {
    margin-top: auto;
    padding-top: 3rem;
    animation: fadeInUp 1s ease-out 0.6s both;
}

footer p {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.4);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 600px) {
    .container {
        padding: 1.5rem;
    }

    .logo {
        width: 100%;
        max-width: 380px;
    }

    .logo-text-main {
        font-size: 28px;
    }

    .logo-text-sub {
        font-size: 22px;
        letter-spacing: 6px;
    }

    .features {
        gap: 1.5rem;
    }

    .feature-icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }

    .signup-form {
        flex-direction: column;
    }

    .signup-form input,
    .signup-form button {
        width: 100%;
        min-width: auto;
    }

    .speed-section {
        padding: 1.5rem;
    }

    .speed-item {
        padding: 0.875rem 1rem;
    }

    .speed-icon {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }

    .connection-test {
        padding: 1.5rem;
    }

    .test-results {
        gap: 1.5rem;
    }

    .metric-circle {
        width: 85px;
        height: 85px;
    }

    .metric-value {
        font-size: 1.5rem;
    }

    .fiber-facts {
        padding: 1.25rem;
        flex-direction: column;
        text-align: center;
    }

    .fact-text {
        text-align: center;
    }

    .speed-game {
        padding: 1.5rem;
    }

    .game-area {
        height: 100px;
    }
}

