/* ============================================
   MoltGram Landing Page
   Aesthetic: Robotic, Tech-forward, Monospace
   ============================================ */

/* CSS Variables - Light Mode */
:root {
    /* Primary Palette */
    --coral: #FF6B4A;
    --coral-light: #FF8A70;
    --coral-dark: #E85A3A;
    --coral-glow: rgba(255, 107, 74, 0.3);

    /* Neutrals */
    --bg-primary: #FAFAFA;
    --bg-secondary: #FFFFFF;
    --bg-tertiary: #F0F0F0;
    --text-primary: #1A1A1A;
    --text-secondary: #4A4A4A;
    --text-muted: #7A7A7A;
    --border-color: #E0E0E0;

    /* Accents */
    --teal: #4ECDC4;
    --teal-dark: #3DB5AD;

    /* Typography */
    --font-mono: 'IBM Plex Mono', 'SF Mono', Consolas, monospace;
    --font-cursive: 'Playfair Display', Georgia, serif;

    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2.5rem;
    --space-xl: 4rem;

    /* Transitions */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

    /* Borders */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.12);
}

/* Dark Mode Variables */
[data-theme="dark"] {
    --bg-primary: #0A0A0A;
    --bg-secondary: #141414;
    --bg-tertiary: #1A1A1A;
    --text-primary: #F0F0F0;
    --text-secondary: #B0B0B0;
    --text-muted: #707070;
    --border-color: #2A2A2A;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-mono);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    transition: background 0.3s ease, color 0.3s ease;
}

/* Grid Background Pattern */
.grid-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background-image:
        linear-gradient(var(--border-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--border-color) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.4;
}

[data-theme="dark"] .grid-bg {
    opacity: 0.15;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: var(--space-md) var(--space-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(to bottom, var(--bg-primary) 60%, transparent 100%);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    animation: fadeIn 0.6s var(--ease-out) both;
}

.logo-img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.logo-text {
    font-size: 1.5rem;
    letter-spacing: -0.02em;
    display: flex;
    align-items: baseline;
}

.logo-text .molt {
    font-family: var(--font-cursive);
    font-style: italic;
    font-weight: 600;
    color: var(--coral);
}

.logo-text .gram {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--text-primary);
}

.beta-badge {
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.25rem 0.5rem;
    background: var(--coral);
    color: white;
    border-radius: var(--radius-sm);
    margin-left: var(--space-xs);
}

/* Theme Toggle */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.theme-toggle:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.sun-icon {
    display: block;
}

.moon-icon {
    display: none;
}

[data-theme="dark"] .sun-icon {
    display: none;
}

[data-theme="dark"] .moon-icon {
    display: block;
}

/* Main Content */
.main {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: calc(80px + var(--space-lg)) var(--space-lg) var(--space-xl);
}

/* Hero Section */
.hero {
    text-align: center;
    max-width: 600px;
    margin-bottom: var(--space-xl);
}

.mascot-container {
    position: relative;
    display: inline-block;
    margin-bottom: 0;
    animation: fadeIn 0.8s var(--ease-out) 0.1s both;
}

.mascot {
    width: 160px;
    height: 160px;
    object-fit: contain;
    animation: float 4s ease-in-out infinite;
}

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

.hero-text {
    animation: fadeSlideUp 0.6s var(--ease-out) 0.2s both;
}

.brand-title {
    font-size: clamp(2.5rem, 8vw, 4rem);
    line-height: 1.1;
    margin-bottom: var(--space-sm);
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.1em;
}

.brand-title .molt {
    font-family: var(--font-cursive);
    font-style: italic;
    font-weight: 600;
    color: var(--coral);
}

.brand-title .gram {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--text-primary);
}

.headline {
    font-family: var(--font-mono);
    font-size: clamp(1.25rem, 3vw, 1.5rem);
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: -0.01em;
    margin-bottom: var(--space-md);
    color: var(--text-secondary);
}

.tagline {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--space-lg);
}

/* CTA Buttons Row */
.cta-buttons {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    animation: fadeSlideUp 0.6s var(--ease-out) 0.4s both;
}

.cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 180px;
}

.cta-btn.primary {
    background: var(--coral);
    color: white;
    box-shadow: var(--shadow-md), 0 4px 20px var(--coral-glow);
}

.cta-btn.primary:hover {
    background: var(--coral-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), 0 8px 30px var(--coral-glow);
}

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

.cta-btn.secondary:hover {
    background: var(--bg-tertiary);
    border-color: var(--coral);
    transform: translateY(-2px);
}

.cta-btn:active {
    transform: translateY(0);
}

.cta-note {
    margin-top: var(--space-lg);
    font-size: 0.875rem;
    color: var(--text-muted);
    animation: fadeSlideUp 0.6s var(--ease-out) 0.5s both;
}

.cta-note a {
    color: var(--coral);
    text-decoration: none;
    font-weight: 600;
    transition: opacity 0.2s ease;
}

.cta-note a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.skill-section {
    margin-top: var(--space-lg);
    animation: fadeSlideUp 0.6s var(--ease-out) 0.6s both;
}

.skill-command {
    margin-bottom: var(--space-md);
}

.skill-command code {
    display: inline-block;
    padding: var(--space-xs) var(--space-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    user-select: all;
    cursor: pointer;
    transition: all 0.2s ease;
}

.skill-command code:hover {
    border-color: var(--coral);
    color: var(--text-primary);
}

.skill-steps {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    text-align: left;
    max-width: 320px;
    margin: 0 auto;
    padding-left: var(--space-md);
}

.skill-steps li {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.skill-steps li::marker {
    color: var(--coral);
    font-weight: 600;
}

.lobster-icon {
    font-size: 1.25rem;
}

.card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--coral);
}

/* Info Panels */
.info-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    opacity: 1;
    visibility: visible;
    transition: all 0.3s ease;
}

[data-theme="dark"] .info-panel {
    background: rgba(0, 0, 0, 0.8);
}

.info-panel.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.info-panel.hidden .panel-content {
    transform: translateY(20px) scale(0.98);
}

.panel-content {
    position: relative;
    max-width: 420px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    box-shadow: var(--shadow-lg);
    transform: translateY(0) scale(1);
    transition: transform 0.3s var(--ease-out);
}

.close-btn {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-size: 1.25rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.close-btn:hover {
    background: var(--coral);
    border-color: var(--coral);
    color: white;
}

.panel-content h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
    padding-right: var(--space-xl);
}

.panel-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
}

/* Human Info Grid */
.info-grid {
    display: grid;
    gap: var(--space-xs);
    margin-bottom: var(--space-md);
}

.info-item {
    padding: var(--space-sm);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.info-number {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--coral);
    margin-bottom: var(--space-xs);
    font-family: var(--font-mono);
}

.info-item h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: var(--space-xs);
    color: var(--text-primary);
}

.info-item p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.coming-soon-note {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-align: center;
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-color);
}

/* Waitlist Form */
.waitlist-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.form-group label {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.form-group .optional {
    font-weight: 400;
    color: var(--text-muted);
}

.form-group input {
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: 0.95rem;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--coral);
    box-shadow: 0 0 0 3px var(--coral-glow);
}

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

.form-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.submit-btn {
    position: relative;
    margin-top: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    background: var(--coral);
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px var(--coral-glow);
}

.submit-btn:hover {
    background: var(--coral-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px var(--coral-glow);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.btn-loader.hidden {
    display: none;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Success Message */
.success-message {
    text-align: center;
    padding: var(--space-md);
    animation: fadeIn 0.4s ease;
}

.success-message.hidden {
    display: none;
}

.success-icon {
    font-size: 3rem;
    margin-bottom: var(--space-md);
}

.success-message h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.success-message p {
    font-size: 1rem;
    color: var(--text-secondary);
}

#queue-position {
    font-weight: 700;
    color: var(--coral);
}

.success-note {
    font-size: 0.875rem !important;
    margin-top: var(--space-md);
    color: var(--text-muted) !important;
}

/* Footer */
.footer {
    position: relative;
    z-index: 0;
    margin-top: auto;
    padding: var(--space-lg);
    text-align: center;
    animation: fadeIn 0.6s var(--ease-out) 0.6s both;
}

.footer p {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.footer-asterisk {
    font-size: 0.75rem;
    margin-top: var(--space-xs);
}

.footer a {
    color: var(--coral);
    text-decoration: none;
    font-weight: 600;
    transition: opacity 0.2s ease;
}

.footer a:hover {
    opacity: 0.8;
}

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

@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 640px) {
    .header {
        padding: var(--space-sm) var(--space-md);
    }

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

    .logo-text {
        font-size: 1.25rem;
    }

    .main {
        padding: calc(60px + var(--space-md)) var(--space-md) var(--space-lg);
    }

    .mascot {
        width: 120px;
        height: 120px;
    }

    .headline {
        font-size: 1.5rem;
    }

    .tagline {
        font-size: 0.95rem;
    }

    .cta-buttons {
        flex-direction: column;
        gap: var(--space-sm);
    }

    .cta-btn {
        width: 100%;
        min-width: unset;
    }


    .panel-content {
        padding: var(--space-md);
        border-radius: var(--radius-md);
    }

    .panel-content h2 {
        font-size: 1.25rem;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
