:root {
    --bg-color: #0b0e16;
    --text-color: #e0e0e0;
    --accent-color: #3b82f6;
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    /* --cta-gap: clamp(1.5rem, 2.5vw, 3rem);  OLD VALUE */
    --cta-gap: clamp(3rem, 5vw, 6rem); /* DOUBLED the gap */
    --badge-gap: clamp(2rem, 4vw, 4rem);
}

@property --gradient-angle {
    syntax: "<angle>";
    initial-value: 0deg;
    inherits: false;
}

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

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: var(--bg-color);
    font-family: var(--font-family);
    color: var(--text-color);
}

#canvas-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.top-logo {
    position: fixed;
    top: 30px;
    left: 30px;
    height: 60px; /* Increased size to match app */
    width: auto;
    z-index: 10;
    opacity: 0;
    animation: fadeIn 2s ease-out forwards;
}

.logo-spin-in {
  opacity: 0;
  transform: rotate(-180deg);
  transform-origin: 50% 50%;
  animation: logoFadeRotate 900ms forwards;
  animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, opacity;
}

@keyframes logoFadeRotate {
    from {
        opacity: 0;
        transform: rotate(-180deg) scale(0.8);
    }
    to {
        opacity: 1;
        transform: rotate(0deg) scale(1);
    }
}

.content {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    pointer-events: none; /* Let clicks pass through to the canvas by default */
    /* transform: translateY(-2rem); REMOVED: Don't move the top */
}

.site-footer {
    position: fixed;
    bottom: 20px;
    width: 100%;
    padding: 0 30px;
    
    display: flex;
    flex-direction: column; /* Stack them */
    align-items: center;    /* Center horizontally */
    gap: 15px;              /* Space between icons and text */
    
    font-family: monospace;
    font-size: 0.75rem;
    color: #64748b; /* Matches tagline color */
    
    opacity: 0;
    z-index: 10;
    pointer-events: none; /* Allows clicking through to canvas if needed */
    animation: fadeIn 2s ease-out 3s forwards; /* Appears last */
}

.site-footer .copyright {
    order: 1; /* Pushes to the top */
}

.social-links {
    order: 2; /* Pushes to the bottom */
    display: flex;
    gap: 20px; /* Slightly more space between icons */
    pointer-events: auto; /* Re-enable clicks for links */
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.social-links a:hover {
    opacity: 1;
    transform: translateY(-2px);
}

.social-links img {
    height: 18px; /* Slightly bigger icons for centered layout */
    width: auto;
    filter: invert(34%) sepia(21%) saturate(373%) hue-rotate(186deg) brightness(97%) contrast(92%); /* Approximates #64748b (Slate-500) */
    opacity: 0.7; /* Initial dim state */
    transition: opacity 0.3s ease;
}

.social-links a:hover img {
    opacity: 1;
    /* #3b82f6 (Blue-500) */
    filter: invert(42%) sepia(93%) saturate(1352%) hue-rotate(202deg) brightness(101%) contrast(96%);
}

/* Mobile: Stack them centered */
@media (max-width: 600px) {
    .site-footer {
        gap: 10px;
        bottom: 15px;
    }
}

/* Enable pointer events for interactive elements */
#brand-container, #interaction-container {
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.8s ease;
}

#brand-container {
    text-align: center;
    width: 100%;
    max-width: 1000px; /* Constrain width to force break earlier */
    padding: 0 2rem;   /* Ensure text doesn't touch edges */
}

/* Backed By Badge */
.backed-by-badge {
    opacity: 0;
    animation: fadeIn 2s ease-out 2.2s forwards;
    display: inline-flex;
    align-items: center;
    gap: 4px; /* Reduced from 10px */
    padding: 6px 14px;
    border: 1px solid rgba(51, 65, 85, 0.3);
    border-radius: 9999px;
    background: rgba(11, 14, 22, 0.5);
    backdrop-filter: blur(4px);
    margin-bottom: var(--badge-gap);
    transition: all 0.3s ease;
}

.backed-by-badge:hover {
    border-color: rgba(99, 102, 241, 0.4); /* Subtle indigo tint on hover */
    background: rgba(15, 23, 42, 0.8);
    transform: translateY(-1px);
}

.backed-text {
    font-size: 0.75rem;
    color: #94a3b8;
    font-family: monospace;
    /* text-transform: uppercase; */
    letter-spacing: 0.05em;
    font-weight: 500;
}

.backed-logo {
    height: 22px;
    width: auto;
    border-radius: 2px;
    /* Invert colors to handle white background on dark mode */
    filter: invert(1) grayscale(1) brightness(1.2); /* Reduced brightness from 1.5 to 1.2 */
    mix-blend-mode: screen;
    opacity: 0.8; /* Added opacity to reduce intensity */
}

.hero-title {
    /* Use clamp for smooth scaling: min 2rem, preferred 5vw, max 3rem */
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 200;
    letter-spacing: 0.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 0; /* Start invisible */
    animation: fadeIn 2s ease-out 0.2s forwards;
    transition: letter-spacing 0.8s ease;
}

.mobile-break {
    display: none;
}

.tagline {
    opacity: 0; /* Start invisible */
    animation: fadeIn 2s ease-out 0.8s forwards;
    font-size: 1rem;
    font-weight: 300;
    letter-spacing: 0.2rem;
    color: #64748b;
    font-family: monospace;
}

/* Interaction container positioning */
#interaction-container {
    position: relative; /* Changed from absolute to flow naturally */
    margin-top: var(--cta-gap);
    width: 100%;
    display: flex;
    justify-content: center;
    height: 60px; 
    align-items: center;
}

/* Join Beta Chip (Button) */
/* Copied from .backed-by-badge with modifications */
.join-beta-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px; /* Slightly larger padding for button feel */
    border: 1px solid rgba(51, 65, 85, 0.3);
    border-radius: 9999px;
    background: rgba(11, 14, 22, 0.5);
    backdrop-filter: blur(4px);
    
    /* Text Styles (Merged from .backed-text) */
    font-size: 0.75rem;
    color: #94a3b8;
    font-family: monospace;
    letter-spacing: 0.1rem;
    font-weight: 500;
    
    cursor: pointer;
    position: relative; /* For pseudo-elements */
    isolation: isolate; /* Create new stacking context */
    
    opacity: 0;
    animation: fadeIn 2s ease-in-out 1.5s forwards;
    
    /* Smooth transition for scale */
    transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), background-color 0.3s ease;
}

/* Rotating Light Effect (Always active but smoother/thinner when idle) */
.join-beta-chip::before {
    content: "";
    position: absolute;
    inset: -1px; /* 1px thicker than border */
    padding: 1px; /* Thinner border for the idle state */
    z-index: -1;
    border-radius: inherit;
    background: conic-gradient(
        from var(--gradient-angle),
        rgba(51, 65, 85, 0.2) 0%,   /* Much lower opacity */
        rgba(51, 65, 85, 0.2) 30%,
        rgba(59, 130, 246, 0.6) 50%, /* Dimmer blue */
        rgba(51, 65, 85, 0.2) 70%,
        rgba(51, 65, 85, 0.2) 100%
    );
    animation: spin-light 4s linear infinite; /* Slower rotation */
    opacity: 0.6; /* Partially visible by default */
    transition: opacity 0.4s ease, padding 0.3s ease; /* Smooth transition */
    
    /* Mask to show only border ring */
    -webkit-mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
}

.join-beta-chip:hover {
    color: #fff;
    background: rgba(15, 23, 42, 0.8);
    transform: scale(1.05); /* Slower, smoother scale */
    border-color: transparent; /* Hide static border so running light takes over */
}

.join-beta-chip:hover::before {
    opacity: 1; /* Full brightness */
    padding: 2px; /* Thicker border on hover */
    animation-duration: 2s; /* Faster spin */
    background: conic-gradient(
        from var(--gradient-angle),
        rgba(51, 65, 85, 0.5) 0%,
        rgba(51, 65, 85, 0.5) 30%,
        #3b82f6 50%,                /* Bright blue */
        rgba(51, 65, 85, 0.5) 70%,
        rgba(51, 65, 85, 0.5) 100%
    );
}

/* Waitlist Form */
#waitlist-form {
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.5s ease;
    width: 300px;
    position: absolute; /* Stack on top of hint */
}

#waitlist-form.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.input-group {
    position: relative;
    width: 100%;
    border-bottom: 1px solid #334155;
    display: flex;
    align-items: center;
}

.input-group input {
    width: 100%;
    background: transparent;
    border: none;
    color: #fff;
    font-family: monospace;
    font-size: 0.9rem;
    padding: 10px 0;
    outline: none;
}

.input-group input::placeholder {
    color: #334155;
}

.input-group button {
    background: transparent;
    border: none;
    color: #334155;
    cursor: pointer;
    padding: 5px;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.input-group button:hover {
    color: #3b82f6;
}

.form-message {
    margin-top: 10px;
    font-size: 0.75rem;
    color: #64748b;
    font-family: monospace;
    text-align: center;
    min-height: 1.2em;
}

/* State: Input Active (Logo moves up) */
body.input-mode #brand-container {
    transform: translateY(-50px);
}

body.input-mode .hero-title {
    letter-spacing: 0.8rem; /* Expand logo slightly */
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes spin-light {
    0% { --gradient-angle: 0deg; }
    100% { --gradient-angle: 360deg; }
}

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

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Mobile adjustments - Trigger earlier (was 768px) */
@media (max-width: 900px) {
    .hero-title {
        /* Allow clamp to handle font-size, just adjust spacing/line-height */
        letter-spacing: 0.2rem;
        line-height: 1.3;
    }

    body.input-mode .hero-title {
        letter-spacing: 0.3rem; /* Prevent huge expansion on mobile */
    }

    .mobile-break {
        display: block; /* Force line break earlier */
    }

    .tagline {
        font-size: 0.9rem;
        letter-spacing: 0.1rem;
        padding: 0 1rem;
    }

    .top-logo {
        top: 20px;
        left: 20px;
        height: 40px;
    }
}

@media (max-height: 600px) {
    #interaction-container {
        margin-top: calc(var(--cta-gap) * 0.8);
    }
    .backed-by-badge {
        margin-bottom: calc(var(--badge-gap) * 0.75);
    }
}
