@layer base, layout, components, utilities;

@layer base {
    :root {
        --bg-color: oklch(0.98 0.01 240);
        --text-primary: oklch(0.2 0.01 240);
        --accent-color: oklch(0.6 0.15 30);
        --stroke-color: oklch(0.3 0.02 240);
        --selection-glow: oklch(0.6 0.2 30 / 0.3);
        --font-family: 'Space Grotesk', sans-serif;
    }

    body {
        margin: 0;
        padding: 0;
        background-color: var(--bg-color);
        color: var(--text-primary);
        font-family: var(--font-family);
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        overflow-x: hidden;
        /* Subtle noise texture */
        background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
        background-blend-mode: overlay;
        opacity: 0.98;
    }
}

@layer layout {
    header {
        text-align: center;
        margin-bottom: 2rem;
        z-index: 10;
    }

    h1 {
        font-size: clamp(2rem, 8vw, 4rem);
        font-weight: 700;
        margin: 0;
        letter-spacing: -0.02em;
    }

    h1 span {
        color: var(--accent-color);
    }

    p {
        font-weight: 300;
        opacity: 0.8;
    }

    main {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2rem;
        width: 100%;
        max-width: 800px;
        padding: 2rem;
    }

    .canvas-container {
        width: 100%;
        aspect-ratio: 1 / 1;
        max-width: 500px;
        display: flex;
        justify-content: center;
        align-items: center;
        background: white;
        border-radius: 2rem;
        box-shadow: 0 20px 50px oklch(0 0 0 / 0.05);
        border: 1px solid oklch(0 0 0 / 0.05);
    }
}

@layer components {
    #status-panel {
        padding: 1rem 2rem;
        background: white;
        border-radius: 100px;
        box-shadow: 0 4px 20px oklch(0 0 0 / 0.05);
        font-weight: 500;
    }

    #selection-label {
        margin: 0;
        transition: color 0.3s ease;
    }

    /* Has selector example: if the canvas has a selection, change background slightly */
    main:has([data-selected="true"]) {
        /* This is a placeholder for potential interaction changes */
    }
}

@layer utilities {
    .visually-hidden {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }
}
