/* Reset & Base Styles */
:root {
    --primary-hue: 250;
    --primary-color: oklch(65% 0.25 var(--primary-hue));
    --surface: oklch(98% 0.01 var(--primary-hue));
    --text: oklch(20% 0.05 var(--primary-hue));
    --bg-texture: url('data:image/svg+xml,<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"><filter id="noiseFilter"><feTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="3" stitchTiles="stitch"/></filter><rect width="100%" height="100%" filter="url(%23noiseFilter)"/></svg>');
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, sans-serif;
    background-color: var(--surface);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: "";
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: var(--bg-texture);
    opacity: 0.03;
    pointer-events: none;
    z-index: 1000;
}

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

section {
    margin-bottom: 4rem;
    padding: 2rem;
    background: white;
    border-radius: 1.5rem;
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.1);
}

h1, h2 {
    color: var(--primary-color);
}

.hero {
    text-align: center;
    padding: 4rem 1rem;
    background: linear-gradient(135deg, oklch(90% 0.1 250), oklch(85% 0.1 280));
    color: oklch(30% 0.1 250);
}

/* 1. Container Queries */
.resize-handle {
    resize: horizontal;
    overflow: hidden;
    border: 2px dashed #ccc;
    padding: 1rem;
    min-width: 250px;
    max-width: 100%;
}

.card-container {
    container-type: inline-size;
    container-name: card;
}

.responsive-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    background: #f9f9f9;
    border-radius: 1rem;
    transition: all 0.3s ease;
}

.card-image {
    width: 100%;
    aspect-ratio: 16/9;
    background: linear-gradient(45deg, #ddd, #eee);
    border-radius: 0.5rem;
}

@container card (min-width: 500px) {
    .responsive-card {
        flex-direction: row;
        align-items: center;
    }
    .card-image {
        width: 150px;
        height: 150px;
    }
}

/* 2. The :has() Selector */
.has-card {
    padding: 2rem;
    border: 2px solid #eee;
    border-radius: 1rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.has-card:has(#accent-toggle:checked) {
    background-color: var(--primary-color);
    color: white;
    border-color: transparent;
    box-shadow: 0 20px 40px -10px oklch(65% 0.25 var(--primary-hue) / 0.5);
}

.has-inner p {
    font-weight: 500;
}

/* 3. Modern Colors (OKLCH) */
.color-grid {
    display: flex;
    gap: 1rem;
    margin: 1rem 0;
}

.swatch {
    width: 60px;
    height: 60px;
    border-radius: 0.75rem;
    background-color: var(--bg);
    box-shadow: 0 5px 15px -5px rgba(0,0,0,0.2);
}

.glow-button {
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 50px;
    background: var(--primary-color);
    color: white;
    cursor: pointer;
    position: relative;
    transition: transform 0.2s ease;
}

.glow-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 20px 5px oklch(65% 0.25 var(--primary-hue) / 0.4);
}

/* Logical Properties */
.glow-button-container {
    margin-block-start: 2rem;
}
