:root {
    --bg-color: #0f172a;
    --text-color: #f8fafc;
    --accent-primary: #38bdf8;
    --accent-secondary: #fbbf24;
    --accent-tertiary: #f472b6;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --font-main: 'Inter', sans-serif;
    --font-heading: 'Outfit', sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3 {
    font-family: var(--font-heading);
    font-weight: 800;
}

h2 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(to right, #fff, var(--accent-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

p {
    font-size: 1.1rem;
    color: #cbd5e1;
    margin-bottom: 1rem;
}

/* Navigation */
header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 1rem 2rem;
}

nav.glass {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 2rem;
    border-radius: 50px;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: -1px;
}

.logo span {
    color: var(--accent-primary);
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

nav ul li a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: color 0.3s;
}

nav ul li a:hover {
    color: var(--accent-primary);
}

/* Sections */
section {
    padding: 8rem 2rem;
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Hero Section */
#hero {
    text-align: center;
    background: radial-gradient(circle at top right, rgba(56, 189, 248, 0.1), transparent),
                radial-gradient(circle at bottom left, rgba(244, 114, 182, 0.05), transparent);
}

.hero-content {
    max-width: 900px;
    margin: 0 auto;
}

#hero h1 {
    font-size: 5rem;
    margin-bottom: 0.5rem;
    letter-spacing: -2px;
}

.subtitle {
    font-size: 1.5rem;
    color: var(--accent-primary);
    margin-bottom: 3rem;
    font-weight: 300;
}

.hero-image-container {
    position: relative;
    margin-bottom: 4rem;
}

.hero-img {
    width: 100%;
    max-width: 600px;
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--glass-border);
    animation: float 6s ease-in-out infinite;
}

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

.btn-primary {
    display: inline-block;
    padding: 1rem 2.5rem;
    background: var(--accent-primary);
    color: #000;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 700;
    transition: all 0.3s;
    box-shadow: 0 10px 20px rgba(56, 189, 248, 0.3);
}

.btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 30px rgba(56, 189, 248, 0.5);
}

/* Lab Section */
.lab-section {
    background-color: #020617;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.lab-container {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2rem;
    padding: 2rem;
    border-radius: 24px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
}

.canvas-wrapper {
    position: relative;
    background: #000;
    border-radius: 16px;
    overflow: hidden;
    height: 500px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#simCanvas {
    width: 100%;
    height: 100%;
}

.timer-overlay {
    position: absolute;
    top: 20px;
    right: 20px;
    font-family: monospace;
    font-size: 2rem;
    color: var(--accent-primary);
    background: rgba(0,0,0,0.5);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--accent-primary);
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.control-group label {
    display: block;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--accent-primary);
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.check-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
    user-select: none;
}

.checkmark {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    margin-right: 10px;
    display: inline-block;
}

.linear { background-color: #fff; }
.cycloid { background-color: var(--accent-primary); }
.parabola { background-color: var(--accent-secondary); }
.circle { background-color: var(--accent-tertiary); }

.gravity-controls {
    display: flex;
    gap: 0.5rem;
}

.btn-small {
    padding: 0.5rem 1rem;
    background: rgba(255,255,255,0.1);
    border: 1px solid var(--glass-border);
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    transition: 0.3s;
}

.btn-small:hover {
    background: var(--accent-primary);
    color: #000;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn-action {
    flex: 1 1 100%;
    padding: 1rem;
    background: var(--accent-primary);
    border: none;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
    margin-bottom: 0.5rem;
}

.btn-secondary {
    flex: 1;
    padding: 1rem;
    background: transparent;
    border: 1px solid var(--glass-border);
    color: #fff;
    border-radius: 12px;
    cursor: pointer;
    transition: 0.3s;
    font-size: 0.8rem;
}

.btn-action:hover { background: #7dd3fc; }
.btn-secondary:hover { background: rgba(255,255,255,0.1); }

.stats-panel {
    background: rgba(0,0,0,0.3);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
}

.stat-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.stat-label { color: #94a3b8; font-size: 0.85rem; }
.stat-value { font-weight: 700; font-family: monospace; }

/* Grid Layouts */
.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.grid.reverse {
    direction: rtl;
}

.grid.reverse > * {
    direction: ltr;
}

.content-img {
    width: 100%;
    border-radius: 16px;
    margin-bottom: 1rem;
    border: 1px solid var(--glass-border);
}

.img-caption {
    font-size: 0.85rem;
    color: #94a3b8;
    text-align: center;
    font-style: italic;
}

.image-box {
    margin-top: 2rem;
}

.card {
    padding: 3rem;
    border-radius: 24px;
    border: 1px solid var(--glass-border);
}

.card.glass.dark {
    background: rgba(0, 0, 0, 0.4);
}

.story-list {
    list-style: none;
    margin-top: 1.5rem;
}

.story-list li {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
    position: relative;
}

.story-list li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent-primary);
}

.formula {
    background: rgba(255,255,255,0.05);
    padding: 2rem;
    border-radius: 12px;
    margin: 2rem 0;
    text-align: center;
    font-size: 1.2rem;
}

/* Animations */
.fade-in {
    animation: fadeIn 1s ease-out;
}

.delay-1 { animation: fadeIn 1s ease-out 0.3s both; }
.delay-2 { animation: fadeIn 1s ease-out 0.6s both; }
.delay-3 { animation: fadeIn 1s ease-out 0.9s both; }

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

/* Responsive */
@media (max-width: 968px) {
    .grid { grid-template-columns: 1fr; }
    .lab-container { grid-template-columns: 1fr; }
    #hero h1 { font-size: 3.5rem; }
}
