:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --secondary: #ec4899;
    --accent: #10b981;
    --background: #0f172a;
    --surface: rgba(30, 41, 59, 0.7);
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --font-main: 'Outfit', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

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

/* Background Animation */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Typography */
h1 {
    font-size: 3.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
    text-align: center;
}

h2 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: var(--primary);
}

p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    color: var(--text-muted);
}

/* Glassmorphism Classes */
.glass-card {
    background: var(--surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: var(--glass-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 2rem;
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.45);
}

/* Grid Layouts */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

/* Symmetry Lab UI */
.lab-container {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    height: 700px;
}

.canvas-wrapper {
    position: relative;
    background: #000;
    border-radius: 16px;
    overflow: hidden;
    cursor: crosshair;
}

#lab-canvas {
    width: 100%;
    height: 100%;
}

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

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

label {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

select,
button {
    padding: 0.8rem 1.2rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.05);
    color: white;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

select:hover,
button:hover {
    background: rgba(255, 255, 255, 0.1);
}

select option {
    background-color: var(--background);
    color: white;
}

button.primary {
    background: var(--primary);
    border: none;
    font-weight: 600;
}

button.primary:hover {
    background: var(--primary-hover);
}

/* Footer & Nav */
header {
    padding: 4rem 0;
    text-align: center;
}

.tagline {
    color: var(--secondary);
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 1rem;
    display: block;
}

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

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

.reveal {
    animation: fadeIn 0.8s ease forwards;
}

/* Interactive Elements */
.symmetry-type-card {
    cursor: pointer;
    text-align: center;
}

.symmetry-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--accent);
}

/* Escher Section */
.escher-limit {
    position: relative;
    aspect-ratio: 1;
    background: #000;
    border-radius: 50%;
    margin: 2rem auto;
    max-width: 500px;
    overflow: hidden;
    border: 4px solid var(--primary);
}

#escher-canvas {
    width: 100%;
    height: 100%;
}

/* Image styles */
.symmetry-img {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.escher-img {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin-bottom: 1rem;
    border: 2px solid var(--glass-border);
}

figure {
    margin: 0;
}

figcaption {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 0.5rem;
    line-height: 1.4;
}


/* Tour Styles */

/* Tour Styles (Embedded) */
.tour-controls {
    margin: 1.5rem 0;
    text-align: center;
}

.tour-panel {
    margin-bottom: 2rem;
    animation: fadeIn 0.5s ease;
}

.tour-panel.hidden {
    display: none;
}

.tour-card-embedded {
    background: rgba(99, 102, 241, 0.1);
    border: 2px solid var(--primary);
    padding: 1.5rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.tour-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
}

.tour-header h3 {
    font-size: 1.5rem;
    color: var(--primary);
    margin: 0;
}

.badge {
    background: var(--primary);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 99px;
    font-size: 0.8rem;
    font-weight: 600;
}

#tour-message {
    font-size: 1.1rem;
    color: var(--text);
}

.tour-actions-embedded {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    align-items: center;
}

.text-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    text-decoration: underline;
    font-size: 0.9rem;
    padding: 0.5rem;
}

.text-btn:hover {
    color: var(--text);
    background: none;
}