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

/* CSS Variables removed - using hardcoded values throughout */

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.7);
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.146) 0%, rgba(0, 0, 0, 0.427) 100%);
    min-height: 100svh; /* use small viewport to avoid iOS URL bar issues */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html {
    background: #000000;
}

/* Global link styles */
a {
    color: #10b981;
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}
a:hover, a:focus {
    color: #059669;
    text-decoration: underline;
}

.no-select {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    width: 100%;
}

/* Loading Overlay */
.second-loading {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: auto;
    height: auto;
    background: #000000;
    z-index: 9998;
    opacity: 1;
    transition: opacity 0.3s ease-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

.second-loading.fade-out {
    opacity: 0;
    pointer-events: none;
}

/* Green Loading Circle */
.loading-circle {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(16, 185, 129, 0.3);
    border-top: 4px solid #10b981;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Navigation */
.navbar {
    position: absolute;
    top: 1rem;
    left: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.35); /* black glass */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: none;
    border-radius: 12px;
    z-index: 1000;
    padding: 1rem 0;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.2), 0 1px 3px rgba(0, 0, 0, 0.15);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    font-size: 1.125rem;
    color: #ffffff;
}

.nav-logo img {
    height: 19px;
    width: auto;
    object-fit: contain;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
    position: relative;
}

.nav-link:hover {
    color: #10b981;
    text-decoration: none;
}

.nav-link:focus,
.nav-link:active,
.nav-link:visited {
    text-decoration: none;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 50%;
    background: #10b981;
    transition: all 0.2s ease-in-out;
    transform: translateX(-50%);
}

.nav-link:hover::after {
    width: 100%;
}

/* Buttons */
.cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 500;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    font-size: 0.875rem;
    line-height: 1;
}

.cta-button.primary {
    background: #10b981;
    color: #ffffff;
}

.cta-button.primary:hover {
    /* removed background color change */
    /* removed hover translate for stability */
    /* removed box-shadow on hover */
}

.cta-button.secondary {
    background: rgba(0, 0, 0, 0.35); /* black glass */
    color: rgba(255, 255, 255, 0.75);
    border: none;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.cta-button.secondary:hover {
    /* removed background color change */
    /* removed border color */
    /* removed hover translate for stability */
    /* removed box-shadow on hover */
}

.cta-button.large {
    padding: 1rem 2rem;
    font-size: 1rem;
    border-radius: 12px;
}

/* Hero Section */
.hero {
    padding: 110px 0 110px; /* symmetric padding for vertical centering on desktop */
    background: transparent;
    overflow: hidden;
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
}

/* Video Background */
.video-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
}

/* Background Video */
.background-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    z-index: -2;
    /* Video optimization for all devices */
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}


.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at center, rgba(0,0,0,0) 20%, rgba(0,0,0,0.15) 55%, rgba(0,0,0,0.4) 80%, rgba(0,0,0,0.7) 100%),
        radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0.087) 1.5px, transparent 1.5px),
        linear-gradient(to bottom, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.3));
    background-size: 100% 100%, 5px 5px, 100% 100%;
    z-index: 1;
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
    position: relative;
    z-index: 10;
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    align-items: center;
    margin-top: 0;
    text-align: center;
}

.hero-title {
    font-size: 4rem;
    font-weight: 700;
    line-height: 1.1;
    color: #ffffff;
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.hero-subtitle {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
    line-height: 1.6;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* Traffic Light Demo */
.traffic-light-demo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2.5rem; /* controlled gap below countdown */
}

.prediction-display {
    background: rgba(0, 0, 0, 0.35); /* black glass */
    border: none;
    border-radius: 12px;
    padding: 0.75rem;
    text-align: center;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.25), 0 1px 5px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.countdown {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: transparent;
    color: white;
    transition: background 0.5s ease;
}

.countdown-number {
    font-size: 120px;
    font-weight: 900;
    display: block;
    z-index: 2;
    color: #000000; /* Solid black like ESP32 */
    margin-top: 0;
    line-height: 1;
    font-family: 'Arial', 'Helvetica', sans-serif; /* Clean, bold font like ESP32 */
}

/* Smaller footprint for the GO label to match number silhouette */
.countdown-number.is-go {
    font-size: 96px;
    letter-spacing: 1px;
}

.countdown-label {
    font-size: 0.75rem;
    margin-top: 0.25rem;
    text-align: center;
    z-index: 2;
}

.wipe-overlay {
    position: absolute;
    top: -1px;
    left: -1px;
    width: 242px;
    height: 242px;
    border-radius: 50%;
    pointer-events: none;
    background: transparent;
    z-index: 1;
}


/* Sections */
section {
    padding: 5rem 0;
}

/* Alternating solid backgrounds for sections (excluding hero) */
main > section:not(.hero) {
    background-color: #0a0a0a; /* dark black */
}
main > section:nth-of-type(even):not(.hero) {
    background-color: #0f0f10; /* slightly lighter black */
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-header h2 {
    font-size: 2.25rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 1rem;
}

.section-header p {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Legal pages spacing */
.legal .content-block-1 h2,
.legal .content-block-1 h3,
.legal .content-block-1 h4 {
    margin-top: 1.75rem;
    margin-bottom: 0.75rem;
    color: #ffffff;
}

.legal .content-block-1 p,
.legal .content-block-1 li {
    margin-bottom: 0.9rem;
}

.legal .content-block-1 ul {
    margin: 0 0 1rem 1.25rem;
    list-style: disc;
}

/* Features Section */
.features {
    background: transparent;
    margin-top: 0; /* align desktop/tablet spacing with mobile */
    position: relative;
    z-index: 5;
    border-radius: 12px 12px 0 0;
    backdrop-filter: blur(20px);
    /* removed top border */
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: rgba(0, 0, 0, 0.35);
    border: none;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25), 0 2px 6px rgba(0, 0, 0, 0.2);
    text-align: center;
    transition: all 0.2s ease-in-out;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.feature-card:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.25), 0 2px 6px rgba(0, 0, 0, 0.2);
    /* removed background color change */
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.feature-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 1rem;
}

.feature-card p {
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
}

/* How It Works Section */
.process-flow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.process-step {
    flex: 1;
    min-width: 200px;
    max-width: 250px;
    text-align: center;
}

.step-number {
    width: 60px;
    height: 60px;
    background: #10b981;
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 auto 1rem;
}

.step-content h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 0.5rem;
}

.step-content p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
}

.process-arrow {
    font-size: 1.5rem;
    color: #10b981;
    font-weight: bold;
}

/* Technology Section */
.technology {
    background: transparent;
    color: #ffffff;
}

.technology .section-header h2,
.technology .section-header p {
    color: #ffffff;
}

.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.tech-category {
    background: rgba(0, 0, 0, 0.35);
    padding: 1.5rem;
    border-radius: 12px;
    border: none;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25), 0 2px 6px rgba(0, 0, 0, 0.2);
}

.tech-category:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.25), 0 2px 6px rgba(0, 0, 0, 0.2);
    /* removed background color change */
}

.tech-category h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #ffffff;
}

.tech-category ul {
    list-style: none;
}

.tech-category li {
    padding: 0.5rem 0;
    color: rgba(255, 255, 255, 0.7);
    position: relative;
    padding-left: 1.25rem;
}

.tech-category li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #10b981;
    font-weight: bold;
}

/* Apps Section */
.apps {
    background: transparent;
}

.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.app-card {
    background: #0f0f10;
    border: none;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45), 0 4px 12px rgba(0, 0, 0, 0.35);
    text-align: center;
    transition: all 0.2s ease-in-out;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.app-card:hover {
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.45), 0 4px 12px rgba(0, 0, 0, 0.35);
    /* removed background color change */
}

.app-icon {
    margin-bottom: 1.5rem;
}

.app-icon img {
    height: 80px;
    width: auto;
    max-width: 120px;
    border-radius: 12px;
    object-fit: contain;
}

.app-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 1rem;
}

.app-card p {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.app-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.feature-tag {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Contact Section */
.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    max-width: 1000px;
    margin: 0 auto;
}

.contact-form {
    background: rgb(10, 10, 10);
    border: none;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45), 0 4px 12px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1rem;
    transition: all 0.2s ease-in-out;
    background: rgb(10, 10, 10); /* match black glass card */
    color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    /* keep focus ring only below */
    box-shadow: 0 0 0 3px rgb(16, 185, 129);
}

.info-link {
    text-decoration-thickness: 2px;
}
.info-link:hover {
    text-decoration: underline;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.info-item h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 0.75rem;
}

.info-item p {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.info-link {
    color: #10b981;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
}

.info-link:hover {
    color: #059669;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 0.5rem;
    background: #10b981; /* brand green */
    border: none;
    transition: all 0.2s ease-in-out;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.social-link:hover {
    /* removed background color change */
}

.social-link img {
    width: 20px;
    height: 20px;
}

/* Footer */
.footer {
    background: rgba(0, 0, 0, 0.35);
    box-shadow: 0 -10px 24px rgba(0, 0, 0, 0.35);
    color: #ffffff;
    padding: 4rem 0 2rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    font-size: 1.125rem;
    margin-bottom: 1rem;
}

.footer-logo img {
    height: 24px;
    width: auto;
    object-fit: contain;
}

.footer-section p {
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.6;
}

.footer-section h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #10b981;
    text-decoration: none;
    transition: all 0.2s ease-in-out;
}

.footer-section a:hover {
    color: #059669;
    text-decoration: underline;
}

.footer-bottom {
    padding-top: 2rem;
    /* removed footer top border */
    text-align: center;
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.7);
}

/* Responsive Design */
/* Tablet and Small Desktop (768px and below) */
@media (max-width: 768px) {
    /* Container spacing */
    .container {
        padding: 0 40px;
        max-width: 100%;
    }
    
    /* Navigation */
    .nav-menu {
        display: none;
    }
    
    .navbar {
        padding: 16px 0;
        top: 0.5rem;
        left: 0.5rem;
        right: 0.5rem;
    }
    
    .nav-container {
        padding: 0 40px;
    }
    
    /* Hero section */
    .hero {
        padding: 104px 0 72px; /* tablet explicit pixels */
    }
    
    .hero-content {
        grid-template-columns: 1fr;
        gap: 2.5rem;
        text-align: center;
        padding: 0 40px;
    }
    
    .hero-title {
        font-size: 2.5rem;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 1.125rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        line-height: 1.5;
    }
    
    /* Traffic light demo */
    .traffic-light-demo {
        gap: 24px;
    }
    
    /* Sections */
    section {
        padding: 48px 0;
    }
    
    .section-header {
        margin-bottom: 32px;
    }
    
    .section-header h2 {
        font-size: 2rem;
    }
    
    /* Grids - single column */
    .features-grid,
    .tech-grid,
    .apps-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    /* Process flow - vertical */
    .process-flow {
        flex-direction: column;
        gap: 24px;
    }
    
    .process-arrow {
        transform: rotate(90deg);
        margin: 8px 0;
    }
    
    /* Contact section */
    .contact-content {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 32px;
    }
}

/* Mobile (480px and below) */
@media (max-width: 480px) {
    /* Container spacing */
    .container {
        padding: 0 20px;
    }
    
    .navbar {
        top: 0.5rem;
        left: 0.5rem;
        right: 0.5rem;
    }
    
    .nav-container {
        padding: 0 20px;
    }
    
    /* Hero section */
    .hero {
        padding: 88px 0 64px; /* mobile explicit pixels */
    }
    
    .hero-content {
        padding: 0 24px;
        gap: 2.5rem; /* normalize spacing between blocks */
    }
    
    .hero-title {
        font-size: 2.25rem; /* larger title on mobile */
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 1rem;
    }
    
    .cta-button.large {
        width: 100%;
        padding: 1rem;
    }
    
    /* Keep countdown layout centered on mobile */
    .traffic-light-demo {
        flex-direction: column;
        align-items: center;
        gap: 1.75rem;
        margin-bottom: 0;
    }
    
    /* More space between hero and features on mobile */
    .features {
        margin-top: 0;
    }
    
    /* Keep desktop countdown size on mobile */
    .countdown { width: 240px; height: 240px; }
    .countdown-number { font-size: 120px; }
    .countdown-number.is-go { font-size: 96px; }
    .wipe-overlay { width: 242px; height: 242px; }
    
    .prediction-display {
        padding: 1rem;
    }
    
    /* Sections */
    section {
        padding: 2rem 0;
    }
    
    .section-header {
        margin-bottom: 1.5rem;
    }
    
    .section-header h2 {
        font-size: 1.75rem;
    }
    
    .section-header p {
        font-size: 0.9rem;
    }
    
    /* Cards */
    .feature-card,
    .app-card,
    .tech-category {
        padding: 1.5rem;
    }
    
    /* Process steps */
    .process-step {
        padding: 1.5rem;
    }
    
    .step-number {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    /* Contact form */
    .contact-form {
        padding: 1.5rem;
    }
    
    /* Footer - single column */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        text-align: center;
    }
}

/* Large tablets and small desktops (1024px and above) */
@media (min-width: 1024px) {
    .hero-content {
        padding: 0 120px;
        grid-template-columns: 1fr 1fr; /* text left, countdown right */
        gap: 3rem;
    }
    /* Desktop explicit pixels - keep symmetric centering */
    .hero {
        padding: 110px 0 110px;
    }
    /* Nudge countdown down slightly to align visually with text block */
    .hero-visual {
        align-self: center;
        margin-top: 24px;
    }
}

/* Large mobile landscape and small tablets (600px and below) */
@media (max-width: 600px) and (orientation: landscape) {
    .hero {
        padding: 130px 0 16px;
    }
    
    .hero-content {
        padding: 0 40px;
    }
    
    section {
        padding: 32px 0;
    }
    
    .traffic-light-demo {
        gap: 16px;
    }
}

/* Stronger mobile rules (portrait or landscape) up to 600px */
@media (max-width: 600px) {
    .hero {
        padding: 100px 0 72px; /* small devices landscape explicit pixels */
    }
    .hero-title {
        font-size: 2.5rem; /* clearly larger on mobile */
        line-height: 1.2;
    }
}