@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&display=swap');

/* ===== Dark Mode (Default) ===== */
:root {
    --bg-dark: #16181f;
    --primary: #26c6a0;
    --primary-foreground: #16181f;
    --text-primary: #f0f1f3;
    --text-muted: #8f939e;
    --border-color: #303440;
    --grid-color: rgba(38, 198, 160, 0.03);
    --card: #1d2029;
    --card-elevated: #232633;
    --glow: rgba(38, 198, 160, 0.20);
    --glow-muted: rgba(38, 198, 160, 0.12);
    --modal-bg: #1d2029;
    --input-bg: rgba(255, 255, 255, 0.03);
    --input-bg-focus: rgba(255, 255, 255, 0.05);
    --placeholder-color: rgba(255, 255, 255, 0.2);
    --btn-secondary-border: rgba(255, 255, 255, 0.1);
    --btn-secondary-hover-bg: rgba(255, 255, 255, 0.05);
    --btn-secondary-hover-border: rgba(255, 255, 255, 0.2);
    --tooltip-bg: #232633;
    --backdrop-bg: rgba(0, 0, 0, 0.7);
    --modal-shadow: rgba(0, 0, 0, 0.5);
    --ring-opacity: 0.3;
    --code-border-color: rgba(38, 198, 160, 0.2);
}

/* ===== Light Mode ===== */
.light {
    --bg-dark: #f8f9fb;
    --primary: #1d9e80;
    --primary-foreground: #ffffff;
    --text-primary: #16181f;
    --text-muted: #686d7a;
    --border-color: #d4d8e2;
    --grid-color: rgba(29, 158, 128, 0.03);
    --card: #eff1f5;
    --card-elevated: #f5f6f9;
    --glow: rgba(29, 158, 128, 0.06);
    --glow-muted: rgba(29, 158, 128, 0.03);
    --modal-bg: #ffffff;
    --input-bg: rgba(0, 0, 0, 0.03);
    --input-bg-focus: rgba(0, 0, 0, 0.05);
    --placeholder-color: rgba(0, 0, 0, 0.3);
    --btn-secondary-border: #d4d8e2;
    --btn-secondary-hover-bg: rgba(0, 0, 0, 0.03);
    --btn-secondary-hover-border: #b0b5c0;
    --tooltip-bg: #ffffff;
    --backdrop-bg: rgba(0, 0, 0, 0.4);
    --modal-shadow: rgba(0, 0, 0, 0.15);
    --ring-opacity: 0.2;
    --code-border-color: rgba(29, 158, 128, 0.2);
}

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

body {
    background-color: var(--bg-dark);
    font-family: 'Space Grotesk', sans-serif;
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    /* Grid Background Pattern */
    background-image:
        linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 40px 40px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Subtle Vignette & Concentric Rings */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background:
        repeating-radial-gradient(circle at center,
            transparent 0,
            transparent 120px,
            rgba(38, 198, 160, 0.05) 120px,
            rgba(38, 198, 160, 0.05) 121px),
        radial-gradient(circle at center, transparent 0%, var(--bg-dark) 100%);
    pointer-events: none;
    z-index: -1;
    transition: background 0.3s ease;
}

.light body::after,
body.light::after {
    background:
        radial-gradient(circle at center, transparent 0%, var(--bg-dark) 100%);
}

/* Navbar */
.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    position: relative;
    z-index: 10;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.logo-dot {
    width: 8px;
    height: 8px;
    background-color: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--primary);
}

/* Theme Toggle */
.theme-toggle {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    width: 38px;
    height: 38px;
}

.theme-toggle:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--glow-muted);
}

.theme-toggle svg {
    width: 18px;
    height: 18px;
}

.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
.light .theme-toggle .icon-sun { display: block; }
.light .theme-toggle .icon-moon { display: none; }

/* Hero Section */
.hero {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem;
    position: relative;
    z-index: 10;
}

/* "Private Beta" Badge */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background: var(--glow-muted);
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    font-size: 0.875rem;
    color: var(--text-primary);
    margin-bottom: 2rem;
    animation: fadedown 1s ease-out;
}

.badge-dot {
    width: 6px;
    height: 6px;
    background-color: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--primary);
}

/* Headings */
h1 {
    font-size: 3.75rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: 2.5rem;
    max-width: 800px;
    background: linear-gradient(to bottom right, #fff, #a1a1aa);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: fadeup 1s ease-out 0.2s backwards;
}

.light h1 {
    background: linear-gradient(to bottom right, #16181f, #686d7a);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

h1 span {
    background: linear-gradient(to right, #26c6a0, #4dd8b8);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
}

.light h1 span {
    background: linear-gradient(to right, #1d9e80, #26c6a0);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

p {
    color: var(--text-muted);
    font-size: 1.25rem;
    max-width: 600px;
    margin-bottom: 0.75rem;
    line-height: 1.6;
    animation: fadeup 1s ease-out 0.4s backwards;
}

/* Buttons */
.cta-group {
    display: flex;
    gap: 1rem;
    animation: fadeup 1s ease-out 0.6s backwards;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--primary-foreground);
    border: 1px solid transparent;
}

.btn-primary:hover {
    box-shadow: 0 0 25px var(--glow);
    transform: translateY(-1px);
}

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

.btn-secondary:hover {
    background-color: var(--btn-secondary-hover-bg);
    border-color: var(--btn-secondary-hover-border);
    transform: translateY(-1px);
}

/* Disabled Button (Coming Soon) */
.btn-disabled {
    cursor: not-allowed !important;
    opacity: 0.6;
    position: relative;
}

/* Tooltip */
.btn-disabled::after {
    content: "Coming Soon";
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: var(--tooltip-bg);
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 0.5rem 0.8rem;
    border-radius: 6px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
    box-shadow: 0 4px 20px var(--modal-shadow);
    font-weight: 600;
    z-index: 100;
}

/* Tooltip Arrow */
.btn-disabled::before {
    content: '';
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%) translateY(16px) rotate(45deg);
    width: 8px;
    height: 8px;
    background: var(--tooltip-bg);
    border-right: 1px solid var(--primary);
    border-bottom: 1px solid var(--primary);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 100;
}

.btn-disabled:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.btn-disabled:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(6px) rotate(45deg);
}

/* Override all hover effects */
.btn.btn-disabled:hover {
    transform: none !important;
    box-shadow: none !important;
    background-color: transparent !important;
    border-color: var(--btn-secondary-border) !important;
    color: var(--text-muted) !important;
}

.contact-info {
    margin-top: 1.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    animation: fadeup 1s ease-out 0.8s backwards;
}

.contact-info a {
    color: var(--text-primary);
    text-decoration: none;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.2s;
}

.contact-info a:hover {
    color: var(--primary);
    border-color: var(--primary);
}

/* Footer */
footer {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
    z-index: 10;
}

/* Animations */
@keyframes fadeup {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadedown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

    .cta-group {
        flex-direction: column;
        width: 100%;
        max-width: 300px;
    }

    .btn {
        width: 100%;
    }
}

/* ===== Access Modal ===== */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--backdrop-bg);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--modal-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2.5rem;
    width: 90%;
    max-width: 450px;
    position: relative;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 20px 50px var(--modal-shadow);
}

.modal-backdrop.active .modal {
    transform: translateY(0);
}

.modal-header {
    margin-bottom: 2rem;
    text-align: center;
}

.modal-header h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.modal-header p {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 0;
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
    font-size: 1.5rem;
    line-height: 1;
    transition: color 0.2s;
}

.close-modal:hover {
    color: var(--primary);
}

.form-input {
    width: 100%;
    padding: 1rem;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s, background-color 0.2s;
    margin-bottom: 1rem;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--input-bg-focus);
}

::placeholder {
    color: var(--placeholder-color);
}

.btn-block {
    width: 100%;
    margin-top: 1rem;
    justify-content: center;
}

.success-message {
    display: none;
    text-align: center;
    padding: 2rem 0;
}

.success-icon {
    font-size: 4rem;
    color: var(--primary);
    margin-bottom: 1rem;
    display: block;
}

/* Legal Card Styles for Invitation Flow */
.legal-links-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.legal-card {
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    text-decoration: none;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    width: 100%;
}

.legal-card:hover {
    background: var(--glow-muted);
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: 0 10px 30px var(--modal-shadow);
}

.legal-card svg {
    width: 32px !important;
    height: 32px !important;
    color: var(--primary) !important;
    stroke: var(--primary) !important;
    stroke-width: 2;
    transition: transform 0.3s ease;
}

.legal-card:hover svg {
    transform: scale(1.1);
}

.legal-card span {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9rem;
}

.legal-card .view-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

@media (max-width: 480px) {
    .legal-links-container {
        grid-template-columns: 1fr;
    }
}
