/* ============================================================
   namu.style CSS
   ============================================================ */

:root {
    --color-ash-dark: #2E2E2C;
    --color-charcoal: #3A3A38;
    --color-stone-mid: #4A4A46;
    --color-light-gray: #6A6A66;
    --color-warm-stone: #8A8A8A;
    --color-light-taupe: #A8A4A0;
    --color-pale-stone: #C8C4BC;
    --color-bone: #E8E5E0;
    --color-parchment: #F2F0EC;
    --color-kintsugi-gold: #C4B9A8;

    --font-display: 'Zilla Slab', serif;
    --font-body: 'Nunito Sans', sans-serif;

    --grain-opacity-hero: 0.15;
    --grain-opacity-light: 0.08;
    --grain-opacity-dark: 0.12;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--color-ash-dark);
    line-height: 1.8;
    overflow-x: hidden;
}

/* ============================================================
   Grain Overlay
   ============================================================ */

.grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

.grain-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><filter id="noise"><feTurbulence type="fractalNoise" baseFrequency="0.8" numOctaves="4" result="noise" seed="2"/><feColorMatrix in="noise" type="saturate" values="0"/></filter><rect width="100" height="100" filter="url(%23noise)" opacity="0.3"/></svg>');
    background-size: 100px 100px;
    opacity: 0.08;
    mix-blend-mode: overlay;
    pointer-events: none;
}

/* ============================================================
   Zones Structure
   ============================================================ */

.zone {
    position: relative;
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    overflow: hidden;
}

.zone::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><filter id="noise"><feTurbulence type="fractalNoise" baseFrequency="0.8" numOctaves="4" result="noise" seed="2"/><feColorMatrix in="noise" type="saturate" values="0"/></filter><rect width="100" height="100" filter="url(%23noise)" opacity="0.5"/></svg>');
    background-size: 100px 100px;
    opacity: var(--grain-opacity-light);
    mix-blend-mode: overlay;
    pointer-events: none;
}

.zone-content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 900px;
}

/* ============================================================
   Zone 1: The Scar (Hero)
   ============================================================ */

.zone-1 {
    background: var(--color-bone);
    color: var(--color-ash-dark);
    padding-top: 8rem;
    padding-bottom: 8rem;
}

.zone-1::before {
    opacity: var(--grain-opacity-hero);
}

.hero-text {
    position: relative;
    margin-bottom: 2rem;
}

#hero-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 7vw, 5rem);
    font-weight: 700;
    color: var(--color-ash-dark);
    letter-spacing: 0.03em;
    line-height: 1.1;
    animation: shake-entry 0.6s ease-out forwards;
}

#hero-title span {
    display: inline-block;
}

.zone-subtitle {
    font-size: clamp(1rem, 2vw, 1.5rem);
    color: var(--color-warm-stone);
    font-style: italic;
    margin-top: 1rem;
    animation: fade-in 0.8s ease-out 0.3s forwards;
    opacity: 0;
}

/* ============================================================
   Zone 2: The Weathering (Fracture)
   ============================================================ */

.zone-2 {
    background: var(--color-parchment);
    color: var(--color-ash-dark);
}

.zone-2::before {
    opacity: var(--grain-opacity-light);
}

.zone-2 .zone-content {
    max-width: 45ch;
}

.zone-2 h2,
.zone-3 h2,
.zone-4 h2,
.zone-5 h2 {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-weight: 600;
    color: var(--color-ash-dark);
    letter-spacing: 0.02em;
    margin-bottom: 1.5rem;
}

.zone-2 p,
.zone-3 p,
.zone-4 p,
.zone-5 p {
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
    line-height: 1.8;
    color: var(--color-stone-mid);
    margin-bottom: 1.5rem;
    font-weight: 400;
}

/* ============================================================
   Zone 3: The Kiln
   ============================================================ */

.zone-3 {
    background: var(--color-charcoal);
    color: var(--color-pale-stone);
}

.zone-3::before {
    opacity: var(--grain-opacity-dark);
}

.zone-3 h2 {
    color: var(--color-pale-stone);
}

.zone-3 p {
    color: var(--color-kintsugi-gold);
    column-count: 2;
    column-gap: 3rem;
}

/* ============================================================
   Zone 4: The Kintsugi
   ============================================================ */

.zone-4 {
    background: var(--color-bone);
    color: var(--color-ash-dark);
}

.zone-4::before {
    opacity: var(--grain-opacity-light);
}

.kintsugi-container {
    width: 60vw;
    height: 60vh;
    max-width: 600px;
    position: relative;
    margin: 2rem auto;
}

.kintsugi-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--color-ash-dark);
    clip-path: polygon(
        0 0, 15% 0, 18% 8%, 22% 5%, 25% 12%, 28% 8%, 32% 15%, 35% 10%, 38% 18%, 40% 12%, 42% 20%, 45% 15%, 48% 22%, 50% 18%, 52% 25%, 55% 20%, 58% 28%, 60% 22%, 62% 30%, 65% 25%, 68% 32%, 70% 28%, 72% 35%, 75% 30%, 78% 38%, 80% 35%, 82% 40%, 85% 42%, 88% 45%, 90% 50%, 92% 55%, 95% 60%, 98% 65%, 100% 70%, 100% 100%, 0 100%
    );
    opacity: 0.7;
}

.kintsugi-container::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 40%, var(--color-kintsugi-gold) 45%, var(--color-kintsugi-gold) 55%, transparent 60%);
    opacity: 0.6;
    mix-blend-mode: screen;
}

.kintsugi-inner {
    position: absolute;
    inset: 0;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><filter id="noise"><feTurbulence type="fractalNoise" baseFrequency="0.8" numOctaves="4" result="noise" seed="2"/><feColorMatrix in="noise" type="saturate" values="0"/></filter><rect width="100" height="100" filter="url(%23noise)" opacity="0.5"/></svg>');
    background-size: 100px 100px;
    opacity: 0.15;
}

/* ============================================================
   Zone 5: The Ash
   ============================================================ */

.zone-5 {
    background: var(--color-ash-dark);
    color: var(--color-pale-stone);
    padding-bottom: 4rem;
}

.zone-5::before {
    opacity: var(--grain-opacity-dark);
}

.zone-5 h2 {
    color: var(--color-pale-stone);
}

.zone-5 p {
    color: var(--color-warm-stone);
}

.site-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(200, 196, 188, 0.3);
    text-align: center;
    font-size: 0.95rem;
    color: var(--color-warm-stone);
}

/* ============================================================
   Sharp-Angle SVG Motifs (CSS Implementation)
   ============================================================ */

.sharp-angle {
    position: absolute;
    width: 3px;
    background: var(--color-warm-stone);
    opacity: 0.7;
}

.sharp-angle-container {
    position: relative;
    width: 100%;
    height: 100%;
}

/* ============================================================
   Content Grid (Zone 3)
   ============================================================ */

.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.grid-item {
    padding: 2rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(200, 196, 188, 0.2);
    position: relative;
}

.grid-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><filter id="noise"><feTurbulence type="fractalNoise" baseFrequency="0.8" numOctaves="4" result="noise" seed="2"/><feColorMatrix in="noise" type="saturate" values="0"/></filter><rect width="100" height="100" filter="url(%23noise)" opacity="0.5"/></svg>');
    background-size: 100px 100px;
    opacity: 0.1;
    mix-blend-mode: overlay;
    pointer-events: none;
}

.grid-item h3 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--color-kintsugi-gold);
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.grid-item p {
    position: relative;
    z-index: 1;
    color: var(--color-warm-stone);
}

/* ============================================================
   Fragment List (Zone 4)
   ============================================================ */

.fragment-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
}

.fragment-item {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--color-stone-mid);
    padding: 1.5rem;
    border-left: 3px solid var(--color-ash-dark);
    position: relative;
    animation: slide-in-left 0.6s ease-out;
}

.fragment-item:nth-child(2) {
    animation-delay: 0.1s;
}

.fragment-item:nth-child(3) {
    animation-delay: 0.2s;
}

/* ============================================================
   Animations
   ============================================================ */

@keyframes shake-entry {
    0% {
        transform: translateX(-4px) rotateZ(-1deg);
        opacity: 0;
    }
    20% {
        transform: translateX(3px) rotateZ(0.5deg);
        opacity: 1;
    }
    40% {
        transform: translateX(-2px) rotateZ(-0.5deg);
    }
    60% {
        transform: translateX(1px) rotateZ(0.2deg);
    }
    80% {
        transform: translateX(-0.5px) rotateZ(-0.1deg);
    }
    100% {
        transform: translateX(0) rotateZ(0deg);
        opacity: 1;
    }
}

@keyframes fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slide-in-left {
    from {
        transform: translateX(-30px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes shake-subtle {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-2px);
    }
    75% {
        transform: translateX(2px);
    }
}

/* ============================================================
   Responsive Design
   ============================================================ */

@media (max-width: 768px) {
    .zone {
        min-height: 60vh;
        padding: 2rem 1rem;
    }

    #hero-title {
        text-align: center;
    }

    .zone-subtitle {
        text-align: center;
    }

    .zone-2 .zone-content {
        max-width: 100%;
    }

    .zone-3 p {
        column-count: 1;
    }

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

    .kintsugi-container {
        width: 90vw;
        height: 50vh;
    }

    .fragment-item {
        font-size: 1.1rem;
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .zone {
        min-height: 50vh;
        padding: 1.5rem 1rem;
    }

    .zone-2 h2,
    .zone-3 h2,
    .zone-4 h2,
    .zone-5 h2 {
        font-size: 1.3rem;
    }

    .zone-2 p,
    .zone-3 p,
    .zone-4 p,
    .zone-5 p {
        font-size: 1rem;
    }

    .kintsugi-container {
        width: 95vw;
        height: 40vh;
    }
}
