/* Font Faces */
@font-face {
    font-family: 'Inter';
    src: url('../fonts/Inter/Inter-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    src: url('../fonts/Inter/Inter-Italic.woff2') format('woff2');
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    src: url('../fonts/Inter/Inter-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Orbitron';
    src: url('../fonts/Orbitron/Orbitron-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Orbitron';
    src: url('../fonts/Orbitron/Orbitron-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Orbitron';
    src: url('../fonts/Orbitron/Orbitron-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* Liberation Mono is available for use but not directly implemented in styles */
@font-face {
    font-family: 'Liberation Mono';
    src: url('../fonts/LiberationMono/LiberationMono-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Liberation Mono';
    src: url('../fonts/LiberationMono/LiberationMono-Italic.woff2') format('woff2');
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Liberation Mono';
    src: url('../fonts/LiberationMono/LiberationMono-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Liberation Mono';
    src: url('../fonts/LiberationMono/LiberationMono-BoldItalic.woff2') format('woff2');
    font-weight: 700;
    font-style: italic;
    font-display: swap;
}


/* Basic Reset & Global Styles */
:root {
    --background-color: #17191b; /* Dark grey from surface */
    --primary-color: #272c35;    /* Lighter grey from surfaceContainerHighest */
    --accent-color: #00E5FF;     /* Cyan from primary */
    --secondary-accent: #FF00A8; /* Magenta for secondary accents */
    --text-color: #e0e2e6;       /* Light grey from onSurface */
    --text-muted: #899296;      /* Muted grey from outline */
    --border-color: rgba(224, 226, 230, 0.2); /* from onSurface.withAlpha(0.2) */
    --border-radius: 8px;
    --font-display: 'Orbitron', sans-serif;
    --font-body: 'Inter', sans-serif;
    --success-color: #28a745;
    --error-color: #dc3545;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

h1, h2, h3 {
    font-family: var(--font-display);
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: 3rem; }
h2 { font-size: 2.5rem; text-align: center; text-shadow: 0 2px 5px rgba(0, 0, 0, 0.7); }
p { margin-bottom: 1rem; }
a { color: var(--accent-color); text-decoration: none; }

/* Header & Navigation */
header {
    background-color: rgba(23, 25, 27, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    height: 4rem; /* Explicit height based on content (2rem) + padding (2rem) */
    border-bottom: 1px solid var(--primary-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: height 0.3s ease-out; /* Smoother transition on height property */
}

header.scrolled {
    height: 3rem; /* Explicit height based on content (2rem) + padding (1rem) */
}

header nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%; /* Ensure nav content uses full header height for alignment */
}

.logo {
    color: var(--text-color);
    z-index: 1001; /* Ensure logo is above mobile menu background */
    display: flex;
    align-items: center;
    gap: 0.3rem;
    user-select: none;
}

/* Keyframes for the logo spin animation */
@keyframes spin-once {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.logo .logo-icon {
    width: 32px;
    height: 32px;
}

.logo .logo-icon.rotating {
    animation: spin-once 0.7s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.logo span {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: bold;
    letter-spacing: 0.5px;
}

/* Hero Section */
#hero {
    text-align: center;
    padding: 6rem 0;
    background: radial-gradient(ellipse at 50% 100%, var(--primary-color) 0%, var(--background-color) 50%);
    position: relative; /* Needed for absolute positioning of child */
    overflow: hidden; /* Hide overflow from visuals */
}

#hero .container {
    position: relative; /* To keep content above the visuals */
    z-index: 2;
}

#hero h1 {
    color: #fff;
}

#hero .subtitle {
    font-size: 1.33rem;
    max-width: 700px;
    margin: 1rem auto 2rem;
    color: var(--text-color);
    text-shadow: 0 2px 5px rgb(0, 0, 0);
}

.hero-visuals {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    user-select: none;
}

.hero-visuals img {
    opacity: 0.4;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 90%;
    max-width: 800px;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

#constellation-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1; /* Above the SVG */
}

.btn {
    display: inline-block;
    padding: 0.8rem 1.8rem;
    border-radius: var(--border-radius);
    font-weight: bold;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    border: 1px solid transparent;
}

#hero .btn {
    margin-top: 2rem;
}

.btn-primary {
    background-color: var(--accent-color);
    color: transparent;
    text-shadow: 0 0 0 #00363d;
    border-color: var(--accent-color);
}

.btn-primary:hover {
    box-shadow: 0 8px 20px rgba(0, 229, 255, 0.25);
    background-color: #00ffff; /* Brighter cyan */
}

.btn-primary:disabled {
    background-color: var(--primary-color);
    border-color: var(--border-color);
    color: var(--text-muted);
    text-shadow: none;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-secondary {
    background-color: var(--primary-color);
    color: var(--text-color);
    border: 1px solid var(--accent-color);
}

.btn-secondary:hover {
    background-color: var(--accent-color);
    color: #00363d;
    border-color: var(--accent-color);
}

/* Features Section */
#features {
    padding: 4rem 0;
}

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

.feature-card {
    background-color: var(--primary-color);
    padding: 2rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    /* Use a nice "snap back" easing for mouse-leave and a standard ease for scroll-in */
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1), box-shadow 0.3s ease, opacity 0.6s ease-out;
    position: relative; /* For pseudo-element positioning */
    overflow: hidden; /* To contain the glare effect */
    transform-style: preserve-3d; /* Enable 3D transforms for children */
}

/* Hide cards only when JS is enabled to set up the animation */
.js-enabled .feature-card {
    opacity: 0;
    transform: translateY(20px);
}

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

.feature-card:hover {
    /* transform is now handled by JS */
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2), 0 0 15px rgba(38, 233, 255, 0.253);
    /* Make transform changes snappy while hovering */
    transition: transform 0.05s ease-out, box-shadow 0.3s ease;
}

/* Glare effect that follows the mouse */
.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        circle 300px at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(255, 255, 255, 0.03),
        transparent 80%
    );
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none; /* So it doesn't block mouse events on the card */
}

.feature-card:hover::before {
    opacity: 1;
}

.feature-card h3 {
    color: var(--accent-color);
    display: flex;
    align-items: normal;
    gap: 0.75rem;
}

.feature-card h3 svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.feature-card h3, .feature-card p {
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.feature-card:hover h3 {
    transform: translateZ(40px);
}

.feature-card:hover p {
    transform: translateZ(25px);
}

/* CTA Section */
#cta {
    background-color: var(--primary-color);
    text-align: center;
    padding: 4rem 0;
    position: relative;
    overflow: hidden;
}

#cta .container {
    position: relative;
    z-index: 1;
}

.cta-visuals {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.6;
    user-select: none;
    animation: flow-background 12s ease-in-out infinite;
}

.cta-visuals img {
    width: 100%;
    min-width: 1200px;
    height: 100%;
    object-fit: cover;
}

#cta p {
    max-width: 500px;
    margin: 1rem auto 2rem;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.7);
}

#cta .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}

#cta .btn svg {
    width: 20px;
    height: 20px;
}

/* Keyframes for CTA background animation */
@keyframes flow-background {
    0% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-10px) scale(1.05);
    }
    100% {
        transform: translateY(0) scale(1);
    }
}

/* Beta Form Section */
#beta-form-section {
    padding: 4rem 0;
}

.form-container {
    max-width: 700px;
    margin: 0 auto;
    background-color: var(--primary-color);
    padding: 2rem 3rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.form-container h2 {
    text-align: left;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-color);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.2);
}

.form-container .btn {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    margin-top: 1rem;
}

#form-message {
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: var(--border-radius);
    display: none; /* Hidden by default */
    text-align: center;
    font-weight: 700;
}

#form-message.success {
    display: block;
    background-color: rgba(40, 167, 69, 0.2);
    border: 1px solid var(--success-color);
    color: #d1f0d9;
}

#form-message.error {
    display: block;
    background-color: rgba(220, 53, 69, 0.2);
    border: 1px solid var(--error-color);
    color: #f8d7da;
}

/* --- Download Page Styles --- */
#download-section {
    padding: 4rem 0;
    text-align: center;
}

#download-section p {
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    color: var(--text-muted);
}

.download-grid {
    display: grid;
    /* create columns that are 350px wide */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
    text-align: left;
    justify-content: center;
}

.download-card {
    background-color: var(--primary-color);
    padding: 2rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.download-card:not(.coming-soon):hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2), 0 0 15px rgba(0, 229, 255, 0.15);
}

.download-card.coming-soon {
    opacity: 0.6;
}

.download-card .os-icon {
    margin-bottom: 1.5rem;
    color: var(--accent-color);
}

.download-card h3 {
    margin-bottom: 0.5rem;
}

.download-card p {
    color: var(--text-muted);
    flex-grow: 1; /* Pushes the button to the bottom */
    margin-bottom: 1.5rem;
}

.download-card .btn {
    width: 100%;
    font-size: 1rem;
}


/* --- Confirmation Modal --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s 0.3s linear;
}

.modal-overlay.visible {
    opacity: 1;
    visibility: visible;
    transition-delay: 0s;
}

.modal-content {
    background-color: var(--primary-color);
    padding: 2rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    width: 90%;
    max-width: 450px;
    text-align: center;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.modal-overlay.visible .modal-content {
    transform: scale(1);
}

.modal-content h3 {
    font-family: var(--font-display);
    color: var(--accent-color);
    margin-top: 0;
    margin-bottom: 1rem;
}

.modal-content p {
    margin-bottom: 2rem;
    color: var(--text-color);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.modal-actions .btn {
    padding: 0.6rem 1.2rem;
}

.modal-actions .btn-secondary {
    background-color: transparent;
    border-color: var(--text-muted);
    color: var(--text-muted);
}

.modal-actions .btn-secondary:hover {
    background-color: var(--text-muted);
    border-color: var(--text-muted);
    color: var(--primary-color);
}

/* --- Access Modal Specifics --- */
#access-modal .modal-content {
    text-align: left;
}

#access-modal .form-group {
    margin-bottom: 2rem;
}

#access-modal input {
    text-align: center;
    font-family: var(--font-display);
    font-size: 1.2rem;
    letter-spacing: 2px;
}

#access-message {
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: var(--border-radius);
    display: none; /* Hidden by default */
    text-align: center;
    font-weight: 700;
}

#access-message.error {
    display: block;
    background-color: rgba(220, 53, 69, 0.2);
    border: 1px solid var(--error-color);
    color: #f8d7da;
}

/* Accessibility class for screen readers */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
    border-top: 1px solid var(--primary-color);
    color: var(--text-muted);
    font-family: var(--font-display);
}

/* Responsive */
@media (max-width: 768px) {
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
}