/* ==========================================================================
   CSS Variables & Design Tokens (Light Theme)
   ========================================================================== */

:root {
    /* Color Palette - Light Theme */
    --color-white: #ffffff;
    --color-gray-50: #f8fafc;
    --color-gray-100: #f1f5f9;
    --color-gray-200: #e2e8f0;
    --color-gray-600: #475569;
    --color-gray-700: #334155;
    --color-gray-800: #1e293b;
    --color-gray-900: #0f172a;
    --color-red-50: #fef2f2;
    --color-red-100: #fee2e2;
    --color-red-400: #f87171;
    --color-red-500: #ef4444;
    --color-red-600: #dc2626;
    --color-red-700: #b91c1c;
    --color-orange-500: #f97316;
    --color-pink-500: #ec4899;
    
    /* Spacing Scale */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 12px;
    --spacing-lg: 16px;
    --spacing-xl: 20px;
    --spacing-2xl: 32px;
    --spacing-3xl: 48px;
    --spacing-4xl: 64px;
    --spacing-5xl: 80px;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 24px;
    --radius-3xl: 32px;
    
    /* Transitions */
    --transition-fast: 0.1s ease-out;
    --transition-base: 0.2s ease;
    --transition-slow: 0.3s ease;
}

/* ==========================================================================
   Reset & Base Styles
   ========================================================================== */

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--color-gray-50);
    color: var(--color-gray-900);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ==========================================================================
   Navigation Bar
   ========================================================================== */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: var(--spacing-2xl) 0;
    background: transparent;
    transition: all var(--transition-slow);
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    padding: var(--spacing-lg) 0;
}

.nav-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--spacing-xl);
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}

.nav-left {
    display: flex;
    align-items: center;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    text-decoration: none;
    transition: transform var(--transition-base);
}

.logo-link:hover {
    transform: scale(1.05);
}

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

.brand-name {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(to right, var(--color-gray-900), var(--color-gray-600));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-right {
    display: flex;
    gap: var(--spacing-lg);
    align-items: center;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--color-gray-600);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition-base);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-lg);
}

.nav-link:hover {
    color: var(--color-gray-900);
    background: var(--color-gray-100);
}

.nav-link .icon {
    width: 20px;
    height: 20px;
}

.discord-link .icon {
    color: #5865F2;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */

.hero {
    position: relative;
    padding: 160px 0 var(--spacing-5xl);
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
    pointer-events: none;
}

.gradient-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.2;
    animation: pulse-slow 4s ease-in-out infinite;
}

.blob-1 {
    top: -20%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: var(--color-red-500);
    animation-delay: 0s;
}

.blob-2 {
    top: 10%;
    right: -10%;
    width: 40vw;
    height: 40vw;
    background: var(--color-pink-500);
    animation-delay: 1s;
}

.blob-3 {
    bottom: 0;
    left: 20%;
    width: 30vw;
    height: 30vw;
    background: var(--color-orange-500);
    animation-delay: 2s;
}

@keyframes pulse-slow {
    0%, 100% { opacity: 0.2; transform: scale(1); }
    50% { opacity: 0.3; transform: scale(1.1); }
}

.hero-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--spacing-xl);
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-3xl);
}

@media (min-width: 1024px) {
    .hero-container {
        flex-direction: row;
        align-items: center;
        gap: var(--spacing-5xl);
    }
}

.hero-content {
    flex: 1;
    text-align: center;
}

@media (min-width: 1024px) {
    .hero-content {
        text-align: left;
    }
}

.beta-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: 999px;
    background: var(--color-red-50);
    border: 1px solid var(--color-red-100);
    color: var(--color-red-600);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: var(--spacing-2xl);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.beta-dot {
    position: relative;
    width: 8px;
    height: 8px;
}

.beta-dot::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--color-red-400);
    animation: ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.beta-dot::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--color-red-500);
}

@keyframes ping {
    75%, 100% {
        transform: scale(2);
        opacity: 0;
    }
}

.hero-title {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: var(--spacing-xl);
    color: var(--color-gray-900);
}

.gradient-text {
    background: linear-gradient(to right, var(--color-red-600), var(--color-pink-500), var(--color-red-600));
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-x 3s linear infinite;
}

@keyframes gradient-x {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

.hero-description {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--color-gray-600);
    margin-bottom: var(--spacing-3xl);
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.7;
}

@media (min-width: 1024px) {
    .hero-description {
        margin-left: 0;
        margin-right: 0;
    }
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-lg) var(--spacing-2xl);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-white);
    background: linear-gradient(to right, var(--color-red-600), var(--color-pink-500));
    border: none;
    border-radius: var(--radius-xl);
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: 0 4px 14px rgba(220, 38, 38, 0.39);
}

.cta-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.23);
}

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

.arrow-icon {
    width: 20px;
    height: 20px;
    transition: transform var(--transition-base);
}

.cta-button:hover .arrow-icon {
    transform: translateX(4px);
}

.hero-visual {
    flex: 1;
    max-width: 600px;
    margin: 0 auto;
}

@media (min-width: 1024px) {
    .hero-visual {
        margin: 0;
    }
}

.whiteboard-card {
    position: relative;
    perspective: 1000px;
}

.whiteboard-card > div {
    transform: rotateX(10deg) rotateY(-10deg) rotateZ(2deg);
    transform-style: preserve-3d;
    transition: transform 0.5s ease-out;
}

.whiteboard-card:hover > div {
    transform: rotateX(5deg) rotateY(-5deg) rotateZ(1deg) scale(1.02);
}


.whiteboard-container {
    display: flex;
    gap: var(--spacing-sm);
    background: transparent;
    border-radius: var(--radius-3xl);
    padding: var(--spacing-lg);
    position: relative;
    z-index: 10;
}

.whiteboard-sidebar {
    width: 80px;
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--spacing-lg) var(--spacing-sm);
}

.tool-section-preview {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    background: var(--color-white);
    border: 1px solid #d0d0d0;
    border-radius: var(--radius-lg);
    padding: var(--spacing-sm);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.tool-button-preview {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    color: var(--color-gray-600);
    transition: all var(--transition-base);
}

.tool-button-preview.active {
    background: var(--color-red-500);
    color: var(--color-white);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
}

.tool-button-preview.active.ai-tool {
    background: var(--color-red-500);
    color: var(--color-white);
    transform: scale(1.15);
    box-shadow: 0 6px 16px rgba(220, 38, 38, 0.5);
    position: relative;
}

.tool-button-preview.active.ai-tool::before {
    content: '';
    position: absolute;
    inset: -4px;
    border: 2px solid var(--color-red-500);
    border-radius: var(--radius-md);
    opacity: 0.3;
    animation: pulse-ring 2s ease-in-out infinite;
}

@keyframes pulse-ring {
    0%, 100% {
        transform: scale(1);
        opacity: 0.3;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.1;
    }
}

.tool-button-preview svg {
    width: 22px;
    height: 22px;
}

.whiteboard-page {
    flex: 1;
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    aspect-ratio: 1360 / 1870;
    max-width: 100%;
}

.canvas-area {
    width: 100%;
    height: 100%;
    padding: var(--spacing-2xl);
    background: var(--color-white);
    background-image: 
        linear-gradient(to right, #d0d0d0 1px, transparent 1px),
        linear-gradient(to bottom, #d0d0d0 1px, transparent 1px);
    background-size: 34px 34px;
    position: relative;
    border-radius: var(--radius-lg);
}

.math-problem-wrapper {
    position: relative;
    display: inline-block;
    margin-bottom: var(--spacing-2xl);
}

.selection-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 60px;
    border: 2px dashed var(--color-red-500);
    border-radius: 30px;
    pointer-events: none;
    animation: pulse-dash 2s ease-in-out infinite;
}

@keyframes pulse-dash {
    0%, 100% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.05);
    }
}

.math-problem {
    font-family: 'Courier New', monospace;
    font-size: 1.5rem;
    color: var(--color-gray-800);
    position: relative;
    z-index: 1;
}

.question-mark {
    color: var(--color-red-600);
    border-bottom: 2px solid var(--color-red-600);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.ai-answer-box {
    position: absolute;
    bottom: 40px;
    right: 40px;
    background: var(--color-white);
    border: 2px solid var(--color-red-500);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2);
    min-width: 280px;
    max-width: 400px;
    z-index: 10;
    animation: slide-in 0.5s ease-out;
}

@keyframes slide-in {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-answer-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--color-red-50);
    border-bottom: 1px solid var(--color-red-100);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.ai-icon-small {
    width: 24px;
    height: 24px;
    color: var(--color-red-600);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-icon-small svg {
    width: 100%;
    height: 100%;
}

.ai-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-red-600);
}

.ai-answer-content {
    padding: var(--spacing-lg);
}

.answer-step {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    font-size: 0.875rem;
    line-height: 1.5;
}

.answer-step:last-child {
    margin-bottom: 0;
}

.step-number {
    font-weight: 600;
    color: var(--color-red-600);
    flex-shrink: 0;
    min-width: 60px;
}

.step-text {
    color: var(--color-gray-800);
    font-family: 'Courier New', monospace;
    flex: 1;
}


/* ==========================================================================
   Features Section
   ========================================================================== */

.features {
    padding: var(--spacing-5xl) 0;
    background: var(--color-white);
    position: relative;
}

.features::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(to right, rgba(128, 128, 128, 0.07) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(128, 128, 128, 0.07) 1px, transparent 1px);
    background-size: 24px 24px;
    mask-image: radial-gradient(ellipse 60% 50% at 50% 0%, #000 70%, transparent 100%);
    pointer-events: none;
}

.features-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--spacing-xl);
    position: relative;
    z-index: 10;
}

.features-header {
    max-width: 768px;
    margin: 0 auto var(--spacing-4xl);
    text-align: center;
}

.features-title {
    font-size: clamp(1.875rem, 4vw, 2.25rem);
    font-weight: 700;
    color: var(--color-gray-900);
    margin-bottom: var(--spacing-lg);
}

.features-subtitle {
    font-size: 1.125rem;
    color: var(--color-gray-600);
}

.features-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-2xl);
}

@media (min-width: 768px) {
    .features-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--spacing-3xl);
    }
}

.feature-item {
    background: var(--color-white);
    padding: var(--spacing-2xl);
    border-radius: var(--radius-2xl);
    border: 1px solid var(--color-gray-100);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transition: all var(--transition-slow);
}

.feature-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-2xl);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--spacing-xl);
    transition: transform var(--transition-base);
}

.feature-item:hover .feature-icon {
    transform: scale(1.1);
}

.feature-icon svg {
    width: 28px;
    height: 28px;
}

.feature-icon.blue {
    background: var(--color-red-50);
}

.feature-icon.blue svg {
    color: var(--color-red-500);
}

.feature-icon.violet {
    background: #fef2f2;
}

.feature-icon.violet svg {
    color: var(--color-pink-500);
}

.feature-icon.cyan {
    background: #fff7ed;
}

.feature-icon.cyan svg {
    color: var(--color-orange-500);
}

.feature-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-gray-900);
    margin-bottom: var(--spacing-md);
}

.feature-text {
    color: var(--color-gray-600);
    line-height: 1.7;
}

/* ==========================================================================
   Transition Section
   ========================================================================== */

.transition {
    padding: var(--spacing-5xl) 0;
    background: var(--color-gray-50);
    text-align: center;
}

.transition-container {
    max-width: 1024px;
    margin: 0 auto;
    padding: 0 var(--spacing-xl);
}

.quote-wrapper {
    display: inline-block;
    position: relative;
}

.quote-icon {
    position: absolute;
    top: -24px;
    left: -24px;
    width: 40px;
    height: 40px;
    color: #fecaca;
}

.transition-text {
    font-size: clamp(1.25rem, 3vw, 1.875rem);
    font-style: italic;
    font-weight: 500;
    color: var(--color-gray-800);
    font-family: Georgia, serif;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
    padding: var(--spacing-3xl) 0;
    background: var(--color-white);
    border-top: 1px solid var(--color-gray-200);
}

.footer-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--spacing-xl);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    align-items: center;
    text-align: center;
}

@media (min-width: 768px) {
    .footer-container {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.footer-logo-link {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    text-decoration: none;
    transition: transform var(--transition-base);
}

.footer-logo-link:hover {
    transform: scale(1.05);
}

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

.footer-name {
    font-weight: 600;
    color: var(--color-gray-900);
}

.footer-copyright {
    font-size: 0.875rem;
    color: var(--color-gray-600);
}

.footer-contact {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-gray-600);
    text-decoration: none;
    transition: color var(--transition-base);
}

.footer-contact:hover {
    color: var(--color-red-600);
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    .nav-right {
        gap: var(--spacing-sm);
    }
    
    .nav-link span {
        display: none;
    }
    
    .discord-link span {
        display: inline;
    }
    
    .hero {
        padding-top: 120px;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
}
