/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-black: #000000;
    --primary-white: #ffffff;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--primary-black);
    color: var(--primary-white);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header Styles */
.header {
    background: var(--primary-black);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Blue theme header override: transparent to blend with page (no seam) */
html[data-theme="blue"] .header {
    background: transparent;
    border-bottom: none;
    backdrop-filter: none;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    height: 80px;
    position: relative;
}

/* Header right actions (Swap, Orchestrator, Theme switch) */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}
/* Ensure inline theme toggle sits inside header row (overrides page-local fixed styles) */
.header-actions #themeToggle {
    position: static !important;
    top: auto !important;
    right: auto !important;
}

.nav {
    display: flex;
    gap: 8px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.buy-now-btn {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    color: var(--primary-black);
    border: none;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 12px;
    font-family: inherit;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    z-index: 2;
}

.buy-now-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
    z-index: 1;
}

.buy-now-btn:hover::before {
    left: 100%;
}

.buy-now-btn:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #ffffff 100%);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.3);
}

.buy-now-btn:active {
    transform: translateY(0) scale(1);
    transition: all 0.1s ease;
}

.buy-now-btn span {
    position: relative;
    z-index: 2;
}

.swap-btn {
background: #C7F284;
color: #000000;
border: none;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 12px;
    font-family: inherit;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
box-shadow: none;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    z-index: 2;
    text-decoration: none;
    display: inline-block;
}

.swap-btn::before {
    display: none;
}

.swap-btn:hover::before {
    left: 100%;
}

.swap-btn:hover {
background: #C7F284;
    transform: none;
box-shadow: none;
}

.swap-btn:active {
    transform: translateY(0) scale(1);
    transition: all 0.1s ease;
}

.swap-btn span {
    position: relative;
    z-index: 2;
}

.ai-orchestrator-btn {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: var(--primary-white);
    border: none;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 12px;
    font-family: inherit;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    z-index: 2;
    text-decoration: none;
    display: inline-block;
}

.ai-orchestrator-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
    z-index: 1;
}

.ai-orchestrator-btn:hover::before {
    left: 100%;
}

.ai-orchestrator-btn:hover {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.5);
}

.ai-orchestrator-btn:active {
    transform: translateY(0) scale(1);
    transition: all 0.1s ease;
}

.ai-orchestrator-btn span {
    position: relative;
    z-index: 2;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-crack-container {
    position: relative;
    height: 48px;
    width: 48px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.logo-crack-container:hover {
    transform: scale(1.05);
}

.logo-img {
    height: 48px;
    width: 48px;
    object-fit: contain;
    border-radius: 8px;
    position: relative;
    z-index: 2;
    transition: all 0.5s ease;
}

.crack-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    opacity: 0;
    pointer-events: none;
    background: 
        linear-gradient(45deg, transparent 30%, rgba(0,0,0,0.8) 31%, rgba(0,0,0,0.8) 33%, transparent 34%),
        linear-gradient(-45deg, transparent 40%, rgba(0,0,0,0.8) 41%, rgba(0,0,0,0.8) 43%, transparent 44%),
        linear-gradient(135deg, transparent 60%, rgba(0,0,0,0.8) 61%, rgba(0,0,0,0.8) 62%, transparent 63%);
    transition: opacity 0.5s ease;
}

.logo-interior {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.3s ease 0.5s;
}

.ruby-gem {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
    opacity: 0;
    animation: rubyGlow 2s ease-in-out infinite alternate;
}

.empty-interior {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    background: rgba(0, 0, 0, 0.9);
    border-radius: 50%;
    opacity: 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

@keyframes rubyGlow {
    0% { 
        text-shadow: 0 0 5px rgba(255, 0, 0, 0.5);
        transform: translate(-50%, -50%) scale(1);
    }
    100% { 
        text-shadow: 0 0 15px rgba(255, 0, 0, 0.8);
        transform: translate(-50%, -50%) scale(1.1);
    }
}

/* Crack animation states */
.logo-crack-container.cracking .logo-img {
    filter: brightness(0.7);
}

.logo-crack-container.cracking .crack-overlay {
    opacity: 1;
}

.logo-crack-container.split .logo-img {
    transform: scale(0.8);
    filter: brightness(0.5);
}

.logo-crack-container.split .logo-interior {
    opacity: 1;
}

.logo-crack-container.reveal-ruby .ruby-gem {
    opacity: 1;
}

.logo-crack-container.reveal-empty .empty-interior {
    opacity: 1;
}

.logo-text {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-white);
    letter-spacing: -0.025em;
    cursor: pointer;
    position: relative;
}

/* Blue-theme gradient for just the word "Salte" in the hero title */
html[data-theme="blue"] .salte-grad {
    background: linear-gradient(90deg, var(--accent), var(--accent3), var(--accent2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent !important;
    -webkit-text-fill-color: transparent !important;
}

/* Non-clickable brand with hover logo swap */
.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: default;
}
.nav-brand .logo-crack-container {
    position: relative;
    height: 48px;
    width: 48px;
}
.logo-img.base {
    position: relative;
    z-index: 2;
    transition: opacity 0.25s ease;
}
.logo-img.hover {
    position: absolute;
    inset: 0;
    opacity: 0;
    z-index: 3;
    transition: opacity 0.25s ease;
    object-fit: contain;
}
.nav-brand:hover .logo-img.base { opacity: 0; }
.nav-brand:hover .logo-img.hover { opacity: 1; }

.nav-btn {
    background: transparent;
    color: rgba(255, 255, 255, 0.8);
    border: none;
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 16px;
    font-family: inherit;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.025em;
    text-transform: uppercase;
    box-shadow: none;
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-btn .logo-crack-container {
    height: 32px;
    width: 32px;
}

.nav-btn .logo-img {
    height: 32px;
    width: 32px;
}

.nav-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
    z-index: 1;
}

.nav-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    transition: all 0.4s ease;
    transform: translate(-50%, -50%);
    z-index: 1;
}

.nav-btn:hover::before {
    left: 100%;
}

.nav-btn:hover::after {
    width: 200px;
    height: 200px;
}

.nav-btn:hover {
    background: linear-gradient(135deg, var(--primary-white) 0%, #f8f9fa 100%);
    color: var(--primary-black);
    border-color: var(--primary-white);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.3), 0 4px 15px rgba(0, 0, 0, 0.2);
}

.nav-btn:active {
    transform: translateY(-1px) scale(1.02);
    transition: all 0.1s ease;
}

.nav-btn span {
    position: relative;
    z-index: 2;
}

/* Main Content */
.main {
    margin-top: 80px;
}

/* Hero Section */
.hero {
    min-height: calc(100vh - 80px);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: var(--primary-black);
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at center, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.06) 7.5%, rgba(255, 255, 255, 0.02) 18%, transparent 30%);
    animation: spotlight 20s ease-in-out infinite;
}

@keyframes spotlight {
    0%, 100% { 
        transform: translate(0, 0) scale(1);
        opacity: 0.8;
    }
    25% { 
        transform: translate(-30px, -20px) scale(1.1);
        opacity: 1;
    }
    50% { 
        transform: translate(40px, -15px) scale(0.9);
        opacity: 0.9;
    }
    75% { 
        transform: translate(-20px, 25px) scale(1.05);
        opacity: 0.7;
    }
}

.hero-content {
    text-align: center;
    position: relative;
    z-index: 2;
    max-width: 800px;
    padding: 0 24px;
}

.hero-text {
    margin-bottom: 48px;
}

.counter-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 32px;
    animation: slideUp 1s ease-out;
}

.counter-number {
    font-size: clamp(32px, 6vw, 72px);
    font-weight: 800;
    color: rgba(255, 255, 255, 0.9);
    font-family: 'Inter', monospace;
    letter-spacing: 0.1em;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #ffffff 0%, #e9ecef 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: counterGlow 2s ease-in-out infinite alternate;
    transition: transform 0.15s ease;
}

.counter-label {
    font-size: 14px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

@keyframes counterGlow {
    0% { 
        text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
        opacity: 0.9;
    }
    100% { 
        text-shadow: 0 0 20px rgba(255, 255, 255, 0.6);
        opacity: 1;
    }
}

.hero-title {
    font-size: clamp(48px, 8vw, 96px);
    font-weight: 800;
    color: var(--primary-white);
    line-height: 1.1;
    margin-bottom: 24px;
    background: linear-gradient(135deg, #ffffff 0%, #e9ecef 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: slideUp 1s ease-out 0.2s both;
    cursor: pointer;
    position: relative;
}

.contract-address {
    font-size: 16px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.7);
    font-family: 'Inter', monospace;
    letter-spacing: 0.05em;
    margin-bottom: 0;
    animation: slideUp 1s ease-out 0.3s both;
    word-break: break-all;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    cursor: pointer;
    position: relative;
    text-decoration: none;
    transition: color 0.3s ease;
    display: block;
}

.contract-address:hover {
    color: rgba(255, 255, 255, 0.9);
}

.contract-address:visited {
    color: rgba(255, 255, 255, 0.7);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-subtitle {
    font-size: 24px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.8);
    letter-spacing: 0.05em;
    animation: slideUp 1s ease-out 0.2s both;
}

.cta-btn {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    color: var(--primary-black);
    border: none;
    padding: 20px 60px;
    font-size: 24px;
    font-weight: 700;
    cursor: pointer;
    border-radius: 16px;
    font-family: inherit;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-xl);
    min-width: 300px;
    animation: slideUp 1s ease-out 0.4s both;
}

.cta-text {
    position: relative;
    z-index: 2;
    letter-spacing: 0.05em;
}

.cta-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: rotate(-45deg);
    transition: transform 0.6s ease;
}

.cta-btn:hover {
    transform: translateY(-8px) scale(1.05);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.cta-btn:hover .cta-glow {
    transform: rotate(-45deg) translate(100%, 100%);
}

.cta-btn:active {
    transform: translateY(-4px) scale(1.02);
}

/* Disabled button state for testing */
.cta-btn.disabled {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: rgba(255, 255, 255, 0.5);
    cursor: not-allowed;
    opacity: 0.6;
}

.cta-btn.disabled:hover {
    transform: none;
    box-shadow: var(--shadow-xl);
}

.cta-btn.disabled .cta-glow {
    display: none;
}

/* Error message styling */
.error-message {
    display: none;
    opacity: 0;
    background: rgba(220, 53, 69, 0.1);
    border: 2px solid rgba(220, 53, 69, 0.3);
    color: #dc3545;
    padding: 16px 24px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    animation: slideUp 0.5s ease-out;
}

.error-message.show {
    display: block;
    opacity: 1;
}

/* Salt explosion particles */
.salt-particle {
    pointer-events: none;
    user-select: none;
    will-change: transform, opacity;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Falling salt particles */
.falling-salt-particle {
    pointer-events: none;
    user-select: none;
    will-change: transform, opacity;
    text-shadow: 0 0 3px rgba(255, 255, 255, 0.4);
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
    color: #ffffff;
    text-rendering: optimizeSpeed;
    animation: saltShimmer 2s ease-in-out infinite alternate;
}

@keyframes saltShimmer {
    0% { 
        text-shadow: 0 0 3px rgba(255, 255, 255, 0.4);
        filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
    }
    100% { 
        text-shadow: 0 0 5px rgba(255, 255, 255, 0.6);
        filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3));
    }
}


/* SaltVerse Page Styles */
.saltverse-display {
    text-align: center;
    animation: slideUp 1s ease-out;
}

.saltverse-title {
    font-size: clamp(56px, 10vw, 120px);
    font-weight: 800;
    color: var(--primary-white);
    line-height: 1.1;
    margin-bottom: 40px;
    background: linear-gradient(135deg, #ffffff 0%, #e9ecef 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: slideUp 1s ease-out 0.2s both;
    letter-spacing: -0.02em;
}

.saltverse-image-container {
    margin: 40px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: slideUp 1s ease-out 0.4s both;
}

.saltverse-image {
    max-width: 100%;
    height: auto;
    max-height: 70vh;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.1));
}

.saltverse-image:hover {
    transform: scale(1.02);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
    filter: drop-shadow(0 0 30px rgba(255, 255, 255, 0.2));
}

.saltverse-description {
    font-size: 20px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.8);
    letter-spacing: 0.05em;
    margin-top: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
    animation: slideUp 1s ease-out 0.6s both;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav {
        position: static;
        transform: none;
        gap: 4px;
    }
    
    .nav-btn {
        padding: 8px 16px;
        font-size: 14px;
    }
    
    .hero-title {
        font-size: 48px;
    }
    
    .hero-subtitle {
        font-size: 18px;
    }
    
    .cta-btn {
        padding: 16px 40px;
        font-size: 20px;
        min-width: 250px;
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .features {
        padding: 80px 0;
    }
}

@media (max-width: 480px) {
    .header .container {
        flex-direction: column;
        height: auto;
        padding: 16px 24px;
    }
    
    .nav {
        margin-top: 16px;
    }
    
    .main {
        margin-top: 120px;
    }
    
    .hero {
        min-height: calc(100vh - 120px);
        padding: 40px 0;
    }
}
