/* ============================================
   layer-2.id -- Fae Couture Design System
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    --deep-leather: #1a0f08;
    --fae-lavender: #c4a7e7;
    --worn-hide: #3d2b1a;
    --moonlit-parchment: #f0e6d3;
    --thorn-gold: #b48e56;
    --moonlit-sage: #a3be8c;
    --fairy-ink: #0d0a06;
    --pixie-dust: #e8d5f5;
    --dark-leather: #2a1a0e;

    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'Nunito Sans', 'Segoe UI', sans-serif;
    --font-accent: 'Josefin Sans', 'Trebuchet MS', sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-weight: 300;
    color: var(--moonlit-parchment);
    background-color: var(--fairy-ink);
    overflow-x: hidden;
    line-height: 1.7;
    letter-spacing: 0.01em;
    font-size: clamp(0.9rem, 1.8vw, 1.05rem);
}

/* --- Leather Texture (applied to body and sections) --- */
.leather-texture {
    background:
        repeating-linear-gradient(135deg, rgba(42,26,14,0.04) 0px, transparent 1px, transparent 3px, rgba(42,26,14,0.02) 4px),
        radial-gradient(ellipse at 30% 40%, rgba(61,43,26,0.08) 0%, transparent 50%),
        linear-gradient(to bottom, transparent 0%, rgba(13,10,6,0.05) 40%, transparent 60%, rgba(13,10,6,0.03) 100%);
    background-size: auto, 120px 80px, auto;
}

body {
    background:
        repeating-linear-gradient(135deg, rgba(42,26,14,0.04) 0px, transparent 1px, transparent 3px, rgba(42,26,14,0.02) 4px),
        radial-gradient(ellipse at 30% 40%, rgba(61,43,26,0.08) 0%, transparent 50%),
        linear-gradient(to bottom, transparent 0%, rgba(13,10,6,0.05) 40%, transparent 60%, rgba(13,10,6,0.03) 100%),
        var(--deep-leather);
    background-size: auto, 120px 80px, auto, auto;
}

/* --- Floating Particles --- */
#particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    will-change: transform, opacity;
}

/* --- Navigation --- */
#main-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    backdrop-filter: blur(12px) saturate(120%);
    -webkit-backdrop-filter: blur(12px) saturate(120%);
    background-color: rgba(26, 15, 8, 0.85);
    border-bottom: 1px solid rgba(180, 142, 86, 0.15);
}

.nav-inner {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: clamp(16px, 3vw, 40px);
    padding: 14px 24px;
}

.nav-link {
    position: relative;
    text-decoration: none;
    color: var(--moonlit-parchment);
    font-family: var(--font-accent);
    font-size: clamp(0.65rem, 1.2vw, 0.8rem);
    font-weight: 400;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    transition: color 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.nav-link:hover {
    color: var(--fae-lavender);
}

.nav-underline {
    display: block;
    width: 100%;
    height: 1px;
    background: var(--thorn-gold);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    margin-top: 4px;
}

.nav-link.active .nav-underline,
.nav-link:hover .nav-underline {
    transform: scaleX(1);
}

/* --- Canopy Section (Hero) --- */
.canopy-section {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    z-index: 2;
}

.canopy-bg {
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(135deg, rgba(42,26,14,0.04) 0px, transparent 1px, transparent 3px, rgba(42,26,14,0.02) 4px),
        radial-gradient(ellipse at 30% 40%, rgba(61,43,26,0.08) 0%, transparent 50%),
        linear-gradient(to bottom, transparent 0%, rgba(13,10,6,0.05) 40%, transparent 60%, rgba(13,10,6,0.03) 100%),
        radial-gradient(ellipse at 50% 50%, rgba(42,26,14,0.6) 0%, rgba(13,10,6,0.95) 70%),
        var(--dark-leather);
    background-size: auto, 120px 80px, auto, auto, auto;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.canopy-bg.visible {
    opacity: 1;
}

.canopy-content {
    position: relative;
    z-index: 5;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* --- Hero Title (Kinetic Typography) --- */
.hero-title {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: clamp(3rem, 8vw, 7rem);
    letter-spacing: -0.02em;
    color: var(--moonlit-parchment);
    position: relative;
    display: inline-block;
}

.char {
    display: inline-block;
    opacity: 0;
    transform: translateY(60px) rotateX(-90deg);
    animation: charEntry 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    animation-delay: calc(1.8s + var(--i) * 0.07s);
    background: linear-gradient(90deg, transparent 0%, rgba(196,167,231,0.3) 50%, transparent 100%);
    background-size: 200% 100%;
    background-clip: text;
    -webkit-background-clip: text;
    color: var(--moonlit-parchment);
}

.char.entered {
    animation: charBreathe calc(2.5s + var(--i) * 0.15s) ease-in-out infinite,
               charShimmer 6s linear infinite;
    background: linear-gradient(90deg, transparent 0%, rgba(196,167,231,0.3) 50%, transparent 100%);
    background-size: 200% 100%;
    background-clip: text;
    -webkit-background-clip: text;
    color: var(--moonlit-parchment);
    opacity: 1;
    transform: translateY(0) rotateX(0);
}

@keyframes charEntry {
    0% {
        opacity: 0;
        transform: translateY(60px) rotateX(-90deg);
    }
    100% {
        opacity: 1;
        transform: translateY(0) rotateX(0);
    }
}

@keyframes charBreathe {
    0%, 100% {
        transform: translateY(-3px);
        opacity: 0.85;
    }
    50% {
        transform: translateY(3px);
        opacity: 1;
    }
}

@keyframes charShimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* --- Pixie Flash --- */
.pixie-flash {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(232,213,245,0.15) 0%, transparent 70%);
    transform: translate(-50%, -50%) scale(0);
    pointer-events: none;
    z-index: 4;
}

.pixie-flash.active {
    animation: pixieFlash 0.6s ease-out forwards;
}

@keyframes pixieFlash {
    0% {
        width: 50px;
        height: 50px;
        opacity: 0.15;
        transform: translate(-50%, -50%) scale(0);
    }
    50% {
        opacity: 0.15;
    }
    100% {
        width: 50px;
        height: 50px;
        opacity: 0;
        transform: translate(-50%, -50%) scale(3);
    }
}

/* --- Tagline --- */
.tagline {
    font-family: var(--font-display);
    font-weight: 300;
    font-style: italic;
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    color: var(--moonlit-parchment);
    opacity: 0;
    transform: translateY(30px);
    margin-top: 24px;
    letter-spacing: 0.01em;
}

.tagline.visible {
    animation: taglineFade 1.2s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

@keyframes taglineFade {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Gold Line --- */
.gold-line {
    border: none;
    height: 1px;
    background: var(--thorn-gold);
    margin-top: 32px;
    width: 0;
    max-width: 200px;
    opacity: 0;
}

.gold-line.visible {
    animation: goldLineExpand 0.8s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

@keyframes goldLineExpand {
    0% {
        width: 0;
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    100% {
        width: 200px;
        opacity: 1;
    }
}

/* --- Scroll Indicator --- */
.scroll-indicator {
    margin-top: 40px;
    opacity: 0;
    animation: scrollFadeIn 0.5s ease forwards;
    animation-delay: 5.5s;
}

.scroll-indicator svg {
    animation: scrollBob 2s ease-in-out infinite;
}

@keyframes scrollFadeIn {
    to { opacity: 0.7; }
}

@keyframes scrollBob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(5px); }
}

/* --- Sigil Dividers --- */
.sigil-divider {
    display: flex;
    justify-content: center;
    padding: 60px 0;
}

.fae-sigil {
    width: 200px;
    height: 200px;
    animation: sigilRotate 120s linear infinite;
}

@keyframes sigilRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* --- Section Headings --- */
.section-heading {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(1.6rem, 3.5vw, 2.8rem);
    color: var(--moonlit-parchment);
    letter-spacing: -0.02em;
    text-align: center;
    margin-bottom: 48px;
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.section-heading.visible {
    opacity: 1;
    transform: translateX(0);
}

.section-heading:hover .heading-char {
    animation: headingLetterJitter 0.2s ease forwards;
}

/* --- Masonry Grid --- */
.collection-section {
    position: relative;
    z-index: 2;
    padding: 40px clamp(16px, 4vw, 60px) 80px;
}

.masonry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    grid-auto-rows: 20px;
    gap: clamp(12px, 2vw, 24px);
    max-width: 1400px;
    margin: 0 auto;
}

/* --- Masonry Card Sizes --- */
.masonry-card.card-tall {
    grid-row: span 20;
}

.masonry-card.card-medium {
    grid-row: span 14;
}

.masonry-card.card-short {
    grid-row: span 10;
}

.masonry-card.card-wide {
    grid-column: span 2;
    grid-row: span 12;
}

/* --- Masonry Card Styling --- */
.masonry-card {
    position: relative;
    background:
        repeating-linear-gradient(45deg, transparent, transparent 2px, rgba(42,26,14,0.03) 2px, rgba(42,26,14,0.03) 4px),
        var(--worn-hide);
    border: 1px solid rgba(180, 142, 86, 0.3);
    border-radius: 2px;
    overflow: hidden;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s cubic-bezier(0.23, 1, 0.32, 1),
                transform 0.6s cubic-bezier(0.23, 1, 0.32, 1),
                border-color 0.15s ease,
                box-shadow 0.4s ease;
    cursor: pointer;
    z-index: 2;
}

.masonry-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.masonry-card:hover {
    border-color: rgba(180, 142, 86, 0.8);
    box-shadow: 0 8px 32px rgba(196, 167, 231, 0.12);
    transform: translateY(-4px);
    transition: border-color 0.15s ease,
                box-shadow 0.4s ease,
                transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.card-content {
    padding: clamp(16px, 3vw, 32px);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card-tag {
    font-family: var(--font-accent);
    font-size: clamp(0.65rem, 1.2vw, 0.8rem);
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--moonlit-sage);
    margin-bottom: 12px;
}

.card-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    letter-spacing: 0.01em;
    color: var(--moonlit-parchment);
    margin-bottom: 12px;
    line-height: 1.3;
}

.card-desc {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(0.9rem, 1.8vw, 1.05rem);
    color: rgba(240, 230, 211, 0.8);
    line-height: 1.7;
    flex: 1;
}

.card-meta {
    font-family: var(--font-accent);
    font-size: clamp(0.65rem, 1.2vw, 0.75rem);
    font-weight: 400;
    letter-spacing: 0.1em;
    color: var(--thorn-gold);
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid rgba(180, 142, 86, 0.2);
}

/* --- Gilded Corners (Featured Cards) --- */
.featured-card {
    position: relative;
}

.card-corner {
    position: absolute;
    width: 24px;
    height: 24px;
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

.corner-tl {
    top: 6px;
    left: 6px;
    border-top: 2px solid var(--thorn-gold);
    border-left: 2px solid var(--thorn-gold);
}

.corner-br {
    bottom: 6px;
    right: 6px;
    border-bottom: 2px solid var(--thorn-gold);
    border-right: 2px solid var(--thorn-gold);
}

.featured-card:hover .card-corner {
    opacity: 0.7;
}

/* --- Card Ripple Effect --- */
.card-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(196, 167, 231, 0.1);
    transform: scale(0);
    animation: rippleExpand 0.6s ease-out forwards;
    pointer-events: none;
}

@keyframes rippleExpand {
    0% {
        transform: scale(0);
        opacity: 0.1;
    }
    60% {
        opacity: 0.1;
    }
    100% {
        transform: scale(1);
        opacity: 0;
    }
}

/* --- Chronicles Section --- */
.chronicles-section {
    position: relative;
    z-index: 2;
    padding: 40px clamp(16px, 4vw, 60px) 80px;
    max-width: 900px;
    margin: 0 auto;
}

.chronicles-content {
    display: flex;
    flex-direction: column;
    gap: 48px;
}

.chronicle-entry {
    padding: clamp(24px, 4vw, 40px);
    background:
        repeating-linear-gradient(45deg, transparent, transparent 2px, rgba(42,26,14,0.02) 2px, rgba(42,26,14,0.02) 4px),
        rgba(61, 43, 26, 0.3);
    border: 1px solid rgba(180, 142, 86, 0.15);
    border-radius: 2px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.chronicle-entry.visible {
    opacity: 1;
    transform: translateY(0);
}

.chronicle-date {
    font-family: var(--font-accent);
    font-size: clamp(0.65rem, 1.2vw, 0.8rem);
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--fae-lavender);
    display: block;
    margin-bottom: 12px;
}

.chronicle-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(1.3rem, 2.5vw, 2rem);
    letter-spacing: -0.02em;
    color: var(--moonlit-parchment);
    margin-bottom: 16px;
}

.chronicle-text {
    font-family: var(--font-body);
    font-weight: 300;
    color: rgba(240, 230, 211, 0.8);
    line-height: 1.8;
}

/* --- Thorn Divider --- */
.thorn-divider {
    padding: 60px clamp(16px, 4vw, 60px);
    max-width: 900px;
    margin: 0 auto;
}

.thorn-hr {
    border: none;
    height: 24px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='24' viewBox='0 0 120 24'%3E%3Cpath d='M0 12 Q10 6 20 12 Q30 18 40 12 Q50 6 60 12 Q70 18 80 12 Q90 6 100 12 Q110 18 120 12' fill='none' stroke='%23b48e56' stroke-width='0.8' opacity='0.4'/%3E%3Ccircle cx='20' cy='10' r='1.5' fill='%23b48e56' opacity='0.4'/%3E%3Ccircle cx='60' cy='14' r='1.5' fill='%23b48e56' opacity='0.4'/%3E%3Ccircle cx='100' cy='10' r='1.5' fill='%23b48e56' opacity='0.4'/%3E%3Cpath d='M15 8 L17 6' stroke='%23b48e56' stroke-width='0.6' opacity='0.3'/%3E%3Cpath d='M55 16 L57 18' stroke='%23b48e56' stroke-width='0.6' opacity='0.3'/%3E%3Cpath d='M95 8 L97 6' stroke='%23b48e56' stroke-width='0.6' opacity='0.3'/%3E%3C/svg%3E");
    background-repeat: repeat-x;
    background-position: center;
    opacity: 0.6;
}

/* --- Atelier Section --- */
.atelier-section {
    position: relative;
    z-index: 2;
    padding: 40px clamp(16px, 4vw, 60px) 80px;
    max-width: 1100px;
    margin: 0 auto;
}

.atelier-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: clamp(16px, 3vw, 32px);
}

.atelier-item {
    text-align: center;
    padding: clamp(24px, 4vw, 40px);
    background: rgba(61, 43, 26, 0.2);
    border: 1px solid rgba(180, 142, 86, 0.15);
    border-radius: 2px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease, border-color 0.3s ease;
}

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

.atelier-item:hover {
    border-color: rgba(180, 142, 86, 0.5);
}

.leather-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}

.icon-shape {
    width: 48px;
    height: 48px;
    background: var(--thorn-gold);
    box-shadow: inset 0 1px 2px rgba(13, 10, 6, 0.3);
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.atelier-item:hover .icon-shape {
    opacity: 1;
}

.icon-circle {
    border-radius: 50%;
}

.icon-diamond {
    width: 36px;
    height: 36px;
    transform: rotate(45deg);
    border-radius: 3px;
}

.icon-leaf {
    border-radius: 50% 2px 50% 2px;
    transform: rotate(-30deg);
}

.atelier-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    letter-spacing: 0.01em;
    color: var(--moonlit-parchment);
    margin-bottom: 12px;
}

.atelier-desc {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(0.85rem, 1.6vw, 0.95rem);
    color: rgba(240, 230, 211, 0.7);
    line-height: 1.7;
}

/* --- Whispers Section --- */
.whispers-section {
    position: relative;
    z-index: 2;
    padding: 40px clamp(16px, 4vw, 60px) 80px;
    max-width: 800px;
    margin: 0 auto;
}

.whispers-content {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.whisper-quote {
    padding: clamp(24px, 4vw, 40px);
    border-left: 2px solid var(--fae-lavender);
    background: rgba(196, 167, 231, 0.03);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.whisper-quote.visible {
    opacity: 1;
    transform: translateY(0);
}

.whisper-quote p {
    font-family: var(--font-display);
    font-weight: 300;
    font-style: italic;
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    color: var(--moonlit-parchment);
    line-height: 1.5;
    margin-bottom: 16px;
}

.whisper-quote cite {
    font-family: var(--font-accent);
    font-size: clamp(0.65rem, 1.2vw, 0.8rem);
    font-weight: 400;
    font-style: normal;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--thorn-gold);
}

/* --- Footer --- */
.site-footer {
    position: relative;
    z-index: 2;
    padding: 80px 24px 60px;
    text-align: center;
    border-top: 1px solid rgba(180, 142, 86, 0.15);
}

.footer-sigil {
    display: block;
    font-size: 2rem;
    color: var(--fae-lavender);
    opacity: 0.4;
    margin-bottom: 16px;
}

.footer-text {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    color: var(--moonlit-parchment);
    letter-spacing: -0.02em;
}

.footer-sub {
    font-family: var(--font-accent);
    font-size: clamp(0.65rem, 1.2vw, 0.8rem);
    font-weight: 400;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(240, 230, 211, 0.4);
    margin-top: 8px;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .masonry-grid {
        grid-template-columns: 1fr;
    }

    .masonry-card.card-wide {
        grid-column: span 1;
    }

    .masonry-card.card-tall {
        grid-row: span 16;
    }

    .masonry-card.card-medium {
        grid-row: span 12;
    }

    .masonry-card.card-short {
        grid-row: span 10;
    }

    .nav-inner {
        gap: 12px;
        padding: 10px 16px;
    }

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

@media (min-width: 769px) and (max-width: 1024px) {
    .masonry-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .masonry-card.card-wide {
        grid-column: span 2;
    }
}

@media (min-width: 1025px) {
    .masonry-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* --- Parallax helper --- */
.canopy-section .canopy-bg {
    will-change: transform;
}

/* --- Selection --- */
::selection {
    background: rgba(196, 167, 231, 0.3);
    color: var(--moonlit-parchment);
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--fairy-ink);
}

::-webkit-scrollbar-thumb {
    background: rgba(180, 142, 86, 0.4);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(180, 142, 86, 0.7);
}
