/* Turing Patterns - Distill.pub-inspired minimal design */

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #000;
    color: #1a1a1a;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* Full-screen canvas */
#patternCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    cursor: crosshair;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    z-index: 1;
}

/* Title overlay */
.title-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #fff;
    z-index: 2;
    pointer-events: none;
    transition: opacity 0.5s ease-out;
}

.title-overlay h1 {
    font-family: 'EB Garamond', Georgia, serif;
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 400;
    letter-spacing: 0.02em;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
}

.subtitle {
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    font-weight: 400;
    opacity: 0.8;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.5);
}

/* Hide title when scrolled */
.title-hidden {
    opacity: 0;
    pointer-events: none;
}

/* Controls container */
.controls-container {
    position: relative;
    z-index: 10;
    margin-top: 100vh;
    background: #fff;
    min-height: 100vh;
    transform: translateY(0);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.controls-inner {
    max-width: 650px;
    margin: 0 auto;
    padding: 80px 20px;
}

/* Typography */
section {
    margin-bottom: 60px;
}

h2 {
    font-family: 'EB Garamond', Georgia, serif;
    font-size: 2rem;
    font-weight: 500;
    margin-bottom: 1rem;
    color: #1a1a1a;
}

h3 {
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #666;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e5e5;
}

p {
    font-family: 'EB Garamond', Georgia, serif;
    font-size: 1.125rem;
    line-height: 1.7;
    color: #3a3a3a;
    margin-bottom: 1rem;
}

/* Parameters */
.parameter-group {
    margin-bottom: 2rem;
}

.param {
    margin-bottom: 1.5rem;
}

.param label {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
}

.param-symbol {
    font-family: 'EB Garamond', Georgia, serif;
    font-style: italic;
    color: #666;
    margin-left: 0.5rem;
}

.value {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
    font-size: 0.875rem;
    color: #0066cc;
    margin-left: auto;
    padding: 2px 8px;
    background: #f0f4f8;
    border-radius: 4px;
}

input[type="range"] {
    width: 100%;
    height: 2px;
    background: #e5e5e5;
    outline: none;
    -webkit-appearance: none;
    margin: 0.5rem 0;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #1a1a1a;
    cursor: pointer;
    transition: background 0.2s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    background: #0066cc;
}

input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #1a1a1a;
    cursor: pointer;
    border: none;
    transition: background 0.2s;
}

input[type="range"]::-moz-range-thumb:hover {
    background: #0066cc;
}

.param-description {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    color: #999;
    margin-top: 0.25rem;
}

/* Presets */
.preset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

.preset-btn {
    padding: 12px 16px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.preset-btn:hover {
    border-color: #0066cc;
    background: #f8f9fa;
    transform: translateY(-1px);
}

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

.preset-name {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 0.25rem;
}

.preset-params {
    display: block;
    font-family: 'SF Mono', 'Monaco', monospace;
    font-size: 0.7rem;
    color: #999;
}

/* Visualization controls */
.vis-controls {
    display: flex;
    gap: 20px;
    align-items: center;
}

select {
    padding: 8px 12px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.2s;
}

select:hover {
    border-color: #ccc;
}

select:focus {
    outline: none;
    border-color: #0066cc;
}

.checkbox-label {
    display: flex;
    align-items: center;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 8px;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Simulation controls */
.simulation-controls {
    display: flex;
    gap: 12px;
}

.control-btn {
    flex: 1;
    padding: 12px 24px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    background: #1a1a1a;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.control-btn:hover {
    background: #333;
    transform: translateY(-1px);
}

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

/* Equations */
.equation {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    font-family: 'EB Garamond', Georgia, serif;
    font-size: 1.1rem;
    text-align: center;
    letter-spacing: 0.02em;
}

.equation div {
    margin: 10px 0;
}

/* Responsive */
@media (max-width: 768px) {
    .controls-inner {
        padding: 60px 20px;
    }

    h2 {
        font-size: 1.75rem;
    }

    p {
        font-size: 1rem;
    }

    .preset-grid {
        grid-template-columns: 1fr 1fr;
    }

    .vis-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .simulation-controls {
        flex-direction: column;
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Loading state */
@keyframes subtle-pulse {
    0%, 100% {
        opacity: 0.8;
    }
    50% {
        opacity: 1;
    }
}

.loading {
    animation: subtle-pulse 2s ease-in-out infinite;
}