/* ============================================================
   DDAZZL.com — Styles
   Cottagecore x Glitch Fusion
   ============================================================ */

/* ---------- CSS Custom Properties ---------- */
:root {
    --bg-primary: #f5edd6;
    --bg-alt: #ece3cc;
    --text-primary: #3a2e22;
    --text-secondary: #7a7261;
    --accent-warm: #c8961e;
    --accent-botanical: #6b7c4e;
    --glitch-cyan: #00e5cc;
    --glitch-magenta: #e84393;
    --border-rule: #d4c5a9;
    --shadow-hearth: rgba(58, 46, 34, 0.08);
    --shadow-hearth-deep: rgba(58, 46, 34, 0.16);
    --font-mono: 'Space Mono', monospace;
    --font-serif: 'Cormorant Garamond', serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-mono);
    font-weight: 400;
    letter-spacing: 0.02em;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    line-height: 1.7;
    overflow-x: hidden;
    position: relative;
}

/* ---------- Scanline Overlay ---------- */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 1px,
        rgba(58, 46, 34, 0.03) 1px,
        rgba(58, 46, 34, 0.03) 2px
    );
}

/* ---------- Floating Decorative Glyphs ---------- */
.floating-glyphs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.glyph {
    position: absolute;
    font-family: var(--font-mono);
    color: var(--text-secondary);
    opacity: 0.3;
    font-size: 14px;
    animation: glyphRotate 20s linear infinite;
}

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

/* ---------- Navigation ---------- */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px clamp(24px, 6vw, 120px);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    z-index: 100;
    transition: background-color 0.4s ease, backdrop-filter 0.4s ease;
    display: flex;
    align-items: center;
    gap: 0;
}

.nav.scrolled {
    background-color: rgba(245, 237, 214, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.nav-item {
    cursor: pointer;
    color: var(--text-primary);
    transition: color 0.3s ease;
    text-decoration: none;
}

.nav-item:hover {
    color: var(--accent-warm);
}

.nav-sep {
    margin: 0 12px;
    color: var(--text-secondary);
    opacity: 0.5;
}

/* ---------- Hero Section ---------- */
.hero {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-primary);
    overflow: hidden;
}

.hero-sun {
    position: absolute;
    top: -60px;
    right: -60px;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: radial-gradient(circle, #c8961e 0%, rgba(200, 150, 30, 0.3) 40%, transparent 70%);
    opacity: 0.5;
    animation: sunPulse 8s ease-in-out infinite;
    pointer-events: none;
}

@keyframes sunPulse {
    0%, 100% { transform: scale(1.0); opacity: 0.5; }
    50% { transform: scale(1.05); opacity: 0.6; }
}

.hero-content {
    text-align: center;
    position: relative;
    z-index: 2;
}

.hero-wordmark {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 8vw;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-primary);
    line-height: 1.1;
    overflow: hidden;
}

.hero-wordmark .letter {
    display: inline-block;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.08s ease, transform 0.08s ease;
}

.hero-wordmark .letter.visible {
    opacity: 1;
    transform: translateY(0);
}

.hero-curve {
    width: clamp(300px, 50vw, 700px);
    height: 60px;
    margin: 10px auto 0;
    display: block;
}

.hero-curve path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 1.2s ease-in-out;
}

.hero-curve.drawn path {
    stroke-dashoffset: 0;
}

.hero-subtitle {
    font-family: var(--font-serif);
    font-weight: 300;
    font-style: italic;
    font-size: clamp(1.5rem, 3vw, 2.8rem);
    color: var(--text-secondary);
    margin-top: 12px;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.hero-subtitle.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Hero glitch transition */
.hero.glitching {
    animation: heroGlitch 0.15s ease-in-out;
}

@keyframes heroGlitch {
    0% { opacity: 1; filter: none; }
    30% { opacity: 0; }
    50% { opacity: 1; filter: none; box-shadow: -2px 0 0 var(--glitch-magenta), 2px 0 0 var(--glitch-cyan); }
    100% { opacity: 1; filter: none; }
}

/* ---------- SVG Vine Curves ---------- */
.vine-svg {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 0;
    display: none;
}

.vine-path {
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    transition: stroke-dashoffset 2s ease;
}

.vine-path.drawn {
    stroke-dashoffset: 0;
}

/* ---------- Content Sections ---------- */
.content-section {
    position: relative;
    padding: 0 clamp(24px, 6vw, 120px);
    margin-top: clamp(60px, 8vh, 160px);
    margin-bottom: clamp(60px, 8vh, 160px);
}

.section-rule {
    height: 1px;
    background-color: var(--border-rule);
    opacity: 0.4;
    margin-bottom: clamp(40px, 5vh, 80px);
}

/* ---------- Pull Quotes ---------- */
.pull-quote {
    font-family: var(--font-serif);
    font-weight: 300;
    font-style: italic;
    font-size: clamp(1.5rem, 3vw, 2.8rem);
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: clamp(40px, 5vh, 80px);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.pull-quote.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* ---------- Card Grid ---------- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

.invitation-block {
    display: flex;
    justify-content: center;
}

.invitation-block .card {
    max-width: 900px;
    width: 100%;
}

/* ---------- Cards ---------- */
.card {
    position: relative;
    background-color: var(--bg-alt);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 4px 20px var(--shadow-hearth);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    cursor: default;
}

.card-tall {
    aspect-ratio: 3 / 4;
}

.card-wide {
    aspect-ratio: 16 / 9;
}

.card-span2 {
    grid-column: span 2;
}

/* Card skew variants */
.card-skew-neg {
    transform: rotate(-1.2deg);
}

.card-skew-pos {
    transform: rotate(0.8deg);
}

/* Dashed border variant */
.card-dashed {
    border: 2px dashed var(--border-rule);
}

/* Torn edge variant */
.card-torn {
    clip-path: polygon(
        0% 0%, 
        100% 0%, 
        100% 92%, 
        97% 94%, 
        93% 91%, 
        88% 95%, 
        83% 92%, 
        78% 96%, 
        72% 93%, 
        67% 95%, 
        62% 92%, 
        57% 96%, 
        52% 93%, 
        47% 95%, 
        42% 92%, 
        37% 96%, 
        32% 93%, 
        27% 95%, 
        22% 92%, 
        17% 96%, 
        12% 93%, 
        7% 95%, 
        3% 92%, 
        0% 95%
    );
}

/* Card hover effects */
.card:hover {
    transform: translateY(-6px) rotate(0deg);
    box-shadow: 0 8px 30px var(--shadow-hearth-deep),
                -2px 0 0 var(--glitch-magenta),
                2px 0 0 var(--glitch-cyan);
}

.card-skew-neg:hover {
    transform: translateY(-6px) rotate(-1.2deg);
}

.card-skew-pos:hover {
    transform: translateY(-6px) rotate(0.8deg);
}

/* Card geometric backgrounds */
.card-geometric {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.15;
    pointer-events: none;
}

.geo-hexagons {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='100' viewBox='0 0 56 100'%3E%3Cpath d='M28 66L0 50L0 16L28 0L56 16L56 50L28 66L28 100' fill='none' stroke='%23c8961e' stroke-width='1'/%3E%3Cpath d='M28 0L28 34L0 50L0 84L28 100L56 84L56 50L28 34' fill='none' stroke='%236b7c4e' stroke-width='1'/%3E%3C/svg%3E");
    background-size: 56px 100px;
}

.geo-polygons {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cpolygon points='40,5 75,25 75,60 40,80 5,60 5,25' fill='none' stroke='%23c8961e' stroke-width='1'/%3E%3C/svg%3E");
    background-size: 80px 80px;
}

.geo-polygons-alt {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'%3E%3Crect x='10' y='10' width='40' height='40' fill='none' stroke='%236b7c4e' stroke-width='1' transform='rotate(15 30 30)'/%3E%3C/svg%3E");
    background-size: 60px 60px;
}

.geo-circles {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'%3E%3Ccircle cx='30' cy='30' r='20' fill='none' stroke='%23d4c5a9' stroke-width='1'/%3E%3Ccircle cx='30' cy='30' r='10' fill='none' stroke='%23c8961e' stroke-width='1'/%3E%3C/svg%3E");
    background-size: 60px 60px;
}

.geo-waves {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='40' viewBox='0 0 120 40'%3E%3Cpath d='M0,20 C30,5 60,35 90,20 C100,15 110,25 120,20' fill='none' stroke='%236b7c4e' stroke-width='1'/%3E%3C/svg%3E");
    background-size: 120px 40px;
}

.geo-honeycomb {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='97' viewBox='0 0 56 97'%3E%3Cpath d='M28,1 L54,17 L54,49 L28,65 L2,49 L2,17 Z' fill='none' stroke='%23c8961e' stroke-width='1'/%3E%3Cpath d='M28,33 L54,49 L54,81 L28,97 L2,81 L2,49 Z' fill='none' stroke='%23d4c5a9' stroke-width='1'/%3E%3C/svg%3E");
    background-size: 56px 97px;
}

/* Card content */
.card-content {
    position: relative;
    z-index: 2;
    padding: clamp(20px, 3vw, 40px);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    height: 100%;
}

.card-heading {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: clamp(1rem, 2vw, 1.5rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.card-text {
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: clamp(0.75rem, 1.2vw, 0.9rem);
    color: var(--text-secondary);
    line-height: 1.8;
}

.card-text-secondary {
    margin-top: 16px;
    font-style: italic;
    color: var(--accent-warm);
}

/* Card sparkle effect */
.sparkle {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: var(--accent-warm);
    pointer-events: none;
    z-index: 10;
    animation: sparkleFade 0.3s ease-out forwards;
}

@keyframes sparkleFade {
    0% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(2.5); }
}

/* ---------- Scroll Reveal Animations ---------- */
.scroll-reveal,
.scroll-reveal-left,
.scroll-reveal-right {
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.scroll-reveal {
    transform: translateY(20px);
}

.scroll-reveal-left {
    transform: translateX(-40px);
}

.scroll-reveal-right {
    transform: translateX(40px);
}

.scroll-reveal.in-view {
    opacity: 1;
    transform: translateY(0);
}

.scroll-reveal-left.in-view {
    opacity: 1;
    transform: translateX(0);
}

.scroll-reveal-right.in-view {
    opacity: 1;
    transform: translateX(0);
}

/* Preserve card skew on reveal */
.card-skew-neg.scroll-reveal-left.in-view {
    transform: translateX(0) rotate(-1.2deg);
}

.card-skew-neg.scroll-reveal-right.in-view {
    transform: translateX(0) rotate(-1.2deg);
}

.card-skew-pos.scroll-reveal-left.in-view {
    transform: translateX(0) rotate(0.8deg);
}

.card-skew-pos.scroll-reveal-right.in-view {
    transform: translateX(0) rotate(0.8deg);
}

/* Text jitter animation */
.jitter {
    animation: textJitter 0.15s ease-in-out 3;
}

@keyframes textJitter {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-1px); }
    75% { transform: translateX(1px); }
}

/* ---------- Footer ---------- */
.footer {
    text-align: center;
    padding: clamp(40px, 6vh, 100px) clamp(24px, 6vw, 120px);
    margin-top: clamp(60px, 8vh, 160px);
}

.footer-curve {
    margin-bottom: 24px;
}

.footer-curve svg {
    width: clamp(200px, 40vw, 500px);
    height: 40px;
    display: block;
    margin: 0 auto;
}

.footer-text {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-secondary);
    letter-spacing: 0.08em;
}

.footer-glyphs {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.3;
    margin-top: 12px;
    letter-spacing: 0.3em;
}

/* ---------- Responsive: Tablet ---------- */
@media (max-width: 1024px) {
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .card-span2 {
        grid-column: span 2;
    }
}

/* ---------- Responsive: Mobile ---------- */
@media (max-width: 640px) {
    .card-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .card-span2 {
        grid-column: span 1;
    }

    .card-tall {
        aspect-ratio: auto;
        min-height: 320px;
    }

    .card-wide {
        aspect-ratio: auto;
        min-height: 260px;
    }

    .hero-wordmark {
        font-size: 12vw;
    }

    .nav {
        padding: 14px clamp(16px, 4vw, 40px);
        font-size: 0.75rem;
    }

    .nav-sep {
        margin: 0 8px;
    }
}
