/* ================================================
   p9r.dev — Flat-Design Aurora Workshop
   ================================================ */

/* --- CSS Custom Properties (Design Palette) --- */
:root {
    /* Typography Colors */
    --color-heading: #2A2420;
    --color-text: #5A5048;
    --color-code-label: #8A7868;

    /* Background Colors */
    --color-bg-primary: #FDF8F0;
    --color-bg-secondary: #F8F0E8;

    /* Aurora Shimmer Colors */
    --color-aurora-blue: rgba(180, 200, 220, 0.15);
    --color-aurora-violet: rgba(200, 180, 210, 0.1);
    --color-aurora-coral: rgba(208, 144, 128, 0.06);
    --color-aurora-violet-light: rgba(200, 180, 210, 0.12);
    --color-aurora-coral-alt: rgba(208, 144, 128, 0.05);

    /* Accent Colors */
    --color-accent-coral: #D09080;

    /* Typography */
    --font-sans: 'Albert Sans', sans-serif;
    --font-mono: 'Fira Code', monospace;
}

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-sans);
    font-weight: 400;
    color: var(--color-text);
    background: var(--color-bg-primary);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* --- Paper-Aged Texture Overlay --- */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    color: var(--color-heading);
}

/* --- Sections --- */
.section {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.section--primary {
    background: var(--color-bg-primary);
}

.section--alt {
    background: var(--color-bg-secondary);
}

/* Diagonal clip-path for angled section transitions */
.section:not(:first-child):not(.footer) {
    clip-path: polygon(0 0, 100% 3vh, 100% 100%, 0 calc(100% - 3vh));
    margin-top: -3vh;
}

.section:first-child {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 calc(100% - 3vh));
}

.footer {
    clip-path: polygon(0 0, 100% 3vh, 100% 100%, 0 100%);
    margin-top: -3vh;
    min-height: auto;
    padding: 6rem 2rem 3rem;
}

.section__inner {
    width: 100%;
    max-width: 800px;
    padding: 6rem 2rem;
    position: relative;
    z-index: 2;
}

/* --- Aurora Shimmer Bands --- */
.aurora-band {
    position: absolute;
    width: 200%;
    height: 40%;
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    will-change: transform, opacity;
}

.aurora-band--1 {
    top: 10%;
    left: -50%;
    background: linear-gradient(
        135deg,
        var(--color-aurora-blue) 0%,
        var(--color-aurora-violet) 40%,
        var(--color-aurora-coral) 70%,
        transparent 100%
    );
    animation: auroraShimmer1 12s ease-in-out infinite;
}

.aurora-band--2 {
    top: 40%;
    left: -30%;
    background: linear-gradient(
        160deg,
        var(--color-aurora-violet) 0%,
        var(--color-aurora-violet-light) 50%,
        transparent 100%
    );
    animation: auroraShimmer2 15s ease-in-out infinite;
}

.aurora-band--3 {
    top: 20%;
    left: -40%;
    background: linear-gradient(
        145deg,
        var(--color-aurora-violet) 0%,
        var(--color-aurora-coral-alt) 35%,
        var(--color-aurora-violet-light) 65%,
        transparent 100%
    );
    animation: auroraShimmer3 18s ease-in-out infinite;
}

@keyframes auroraShimmer1 {
    0% {
        transform: translateX(-10%) rotate(-2deg);
        opacity: 0;
    }
    25% {
        opacity: 1;
    }
    50% {
        transform: translateX(10%) rotate(1deg);
        opacity: 0.7;
    }
    75% {
        opacity: 1;
    }
    100% {
        transform: translateX(-10%) rotate(-2deg);
        opacity: 0;
    }
}

@keyframes auroraShimmer2 {
    0% {
        transform: translateX(5%) rotate(1deg);
        opacity: 0;
    }
    30% {
        opacity: 1;
    }
    60% {
        transform: translateX(-15%) rotate(-1deg);
        opacity: 0.6;
    }
    100% {
        transform: translateX(5%) rotate(1deg);
        opacity: 0;
    }
}

@keyframes auroraShimmer3 {
    0% {
        transform: translateX(-5%) rotate(0deg);
        opacity: 0;
    }
    35% {
        opacity: 0.8;
    }
    65% {
        transform: translateX(8%) rotate(-2deg);
        opacity: 0.5;
    }
    100% {
        transform: translateX(-5%) rotate(0deg);
        opacity: 0;
    }
}

/* --- Typography --- */
h1 {
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: clamp(2rem, 4vw, 3.2rem);
    color: var(--color-heading);
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 1.2rem;
}

h2 {
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    color: var(--color-heading);
    letter-spacing: -0.01em;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h3 {
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: clamp(1rem, 1.4vw, 1.2rem);
    color: var(--color-heading);
    margin-bottom: 0.4rem;
}

p {
    font-family: var(--font-sans);
    font-weight: 300;
    font-size: clamp(0.9rem, 1.1vw, 1.05rem);
    line-height: 1.85;
    color: var(--color-text);
    max-width: 600px;
}

/* --- Progressive Disclosure --- */
.disclosure-group {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.disclosure-item {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 300ms ease, transform 300ms ease;
}

.disclosure-item.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.disclosure-stage-1 {
    transition-delay: 0ms;
}

.disclosure-stage-2 {
    transition-delay: 200ms;
}

.disclosure-stage-3 {
    transition-delay: 400ms;
}

.disclosure-stage-4 {
    transition-delay: 600ms;
}

/* --- Hero Section --- */
#hero {
    min-height: 100vh;
}

.hero__tagline {
    font-size: clamp(1rem, 1.5vw, 1.25rem);
    font-weight: 400;
    color: #5A5048;
    max-width: 480px;
}

.hero__note {
    font-size: clamp(0.8rem, 1vw, 0.9rem);
    color: #8A7868;
    font-weight: 400;
}

/* --- Code Blocks --- */
.code-block {
    background: rgba(42, 36, 32, 0.04);
    border-left: 3px solid var(--color-accent-coral);
    padding: 1rem 1.4rem;
    border-radius: 0;
    overflow-x: auto;
}

.code-block code {
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: 0.88rem;
    color: var(--color-heading);
    line-height: 1.7;
    white-space: pre;
    display: block;
}

.code-label {
    font-family: var(--font-mono);
    font-weight: 400;
    color: var(--color-code-label);
    font-size: 0.85rem;
}

/* --- Text Link --- */
.text-link {
    font-family: var(--font-sans);
    font-weight: 400;
    font-size: clamp(0.85rem, 1vw, 0.95rem);
    color: var(--color-accent-coral);
    text-decoration: none;
    display: inline-block;
    transition: color 200ms ease;
}

.text-link:hover {
    color: var(--color-heading);
}

/* --- Principles Grid --- */
.principles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 0.5rem;
}

.principle-card {
    padding: 1.5rem 0;
    border-top: 2px solid var(--color-accent-coral);
}

.principle-card p {
    font-size: clamp(0.82rem, 1vw, 0.92rem);
    line-height: 1.75;
}

/* --- Tools List --- */
.tools-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tool-item {
    display: flex;
    align-items: baseline;
    gap: 1.2rem;
    padding: 0.8rem 0;
    border-bottom: 1px solid rgba(138, 120, 104, 0.15);
}

.tool-item code {
    flex-shrink: 0;
    font-size: 0.85rem;
}

.tool-item span {
    font-family: var(--font-sans);
    font-weight: 300;
    font-size: clamp(0.85rem, 1vw, 0.95rem);
    color: var(--color-text);
    line-height: 1.6;
}

/* --- Workshop Modules --- */
.workshop-modules {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.workshop-module {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
}

.module-number {
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: clamp(1.4rem, 2vw, 1.8rem);
    color: var(--color-accent-coral);
    line-height: 1;
    flex-shrink: 0;
    min-width: 2.5rem;
}

.workshop-module p {
    font-size: clamp(0.82rem, 1vw, 0.92rem);
}

/* --- Community Links --- */
.community-links {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.community-link {
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: clamp(0.9rem, 1.1vw, 1rem);
    color: var(--color-heading);
    padding-bottom: 0.3rem;
    border-bottom: 2px solid var(--color-accent-coral);
    cursor: pointer;
    transition: color 200ms ease;
}

.community-link:hover {
    color: var(--color-accent-coral);
}

/* --- Subtle Note --- */
.subtle-note {
    font-size: clamp(0.78rem, 0.9vw, 0.88rem);
    color: var(--color-code-label);
    font-weight: 400;
    font-style: italic;
}

/* --- Footer --- */
.footer__text {
    font-size: clamp(0.82rem, 1vw, 0.92rem);
    color: var(--color-code-label);
}

.footer__brand {
    font-weight: 700;
    color: var(--color-heading);
}

/* --- Responsive --- */
@media (max-width: 700px) {
    .section__inner {
        padding: 5rem 1.4rem;
    }

    .principles-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .tool-item {
        flex-direction: column;
        gap: 0.3rem;
    }

    .workshop-module {
        gap: 1rem;
    }

    .community-links {
        gap: 1.2rem;
    }
}
