/* ============================================
   recycle.digital — Cottagecore Digital Recycling
   ============================================ */

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Cardo', Georgia, serif;
    font-weight: 400;
    font-size: clamp(16px, 1.5vw, 18px);
    line-height: 1.8;
    color: #F5EDE0;
    background-color: #2A0A1A;
    overflow-x: hidden;
}

/* --- Palette Variables (for reference) ---
   Wine Deep:    #4A1A2E
   Berry Dark:   #2A0A1A
   Cream Linen:  #F5EDE0
   Rose Blush:   #C88B8B
   Garden Green: #4A6B4A
   Copper Wire:  #B87B4A
   Glitch White: #FFFFFF
--- */

/* --- Typography --- */
h1, h2, h3 {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-weight: 700;
    line-height: 1.2;
}

h2 {
    font-size: clamp(28px, 4.5vw, 56px);
    margin-bottom: 0.6em;
}

h3 {
    font-size: clamp(20px, 2.5vw, 28px);
    margin-bottom: 0.4em;
}

.fira {
    font-family: 'Fira Code', monospace;
    font-weight: 400;
    font-size: 13px;
}

/* --- Sections --- */
.section {
    position: relative;
    min-height: 100vh;
    padding: clamp(40px, 6vh, 80px) clamp(20px, 5vw, 80px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

.section--dark {
    background: linear-gradient(180deg, #4A1A2E 0%, #2A0A1A 100%);
    color: #F5EDE0;
}

.section--light {
    background-color: #F5EDE0;
    color: #2A0A1A;
}

.section--footer {
    background: linear-gradient(180deg, #2A0A1A 0%, #4A1A2E 50%, #2A0A1A 100%);
    color: #F5EDE0;
    min-height: 60vh;
}

.section-content {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    position: relative;
    z-index: 2;
}

/* --- Cottage Gate (Hero) --- */
#cottage-gate {
    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(180deg, #4A1A2E 0%, #2A0A1A 100%);
}

.gate-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 30% 40%, rgba(74,26,46,0.6) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 60%, rgba(42,10,26,0.8) 0%, transparent 50%);
    filter: sepia(0.3) contrast(0.9);
    opacity: 0;
    transition: opacity 1.2s ease;
    z-index: 0;
}

.gate-bg.visible {
    opacity: 0.4;
}

.gate-content {
    position: relative;
    z-index: 2;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.gate-content.visible {
    opacity: 1;
    transform: translateY(0);
}

.wordmark {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-weight: 700;
    font-size: clamp(36px, 7vw, 80px);
    color: #F5EDE0;
    letter-spacing: -0.02em;
    margin-bottom: 0.3em;
    position: relative;
    display: inline-block;
}

.gate-subtitle {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-weight: 400;
    font-style: italic;
    font-size: clamp(14px, 2vw, 22px);
    color: #C88B8B;
    opacity: 0.9;
}

/* --- Scroll Hint --- */
.scroll-hint {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 2;
    opacity: 0;
    transition: opacity 1s ease 1.5s;
}

.scroll-hint.visible {
    opacity: 0.6;
}

.scroll-hint-text {
    font-family: 'Fira Code', monospace;
    font-size: 11px;
    color: #C88B8B;
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

.scroll-hint-arrow {
    color: #C88B8B;
    animation: scrollBounce 2s ease-in-out infinite;
}

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

/* --- Glitch Animation --- */
@keyframes glitch {
    0%, 90%, 100% {
        transform: none;
        text-shadow: none;
    }
    92% {
        transform: translateX(-3px) skewX(-1deg);
        text-shadow: 2px 0 #FFFFFF, -2px 0 #C88B8B;
    }
    95% {
        transform: translateX(2px);
        text-shadow: -1px 0 #FFFFFF, 1px 0 #B87B4A;
    }
    97% {
        transform: translateX(-1px) skewX(0.5deg);
        text-shadow: 1px 0 #FFFFFF;
    }
}

.glitch-active {
    animation: glitch 0.3s ease-in-out;
}

/* --- Circuit-Vine Patterns --- */
.circuit-vine-pattern {
    position: absolute;
    left: 0;
    right: 0;
    z-index: 1;
    pointer-events: none;
    opacity: 0.3;
}

.circuit-vine-pattern--gate {
    bottom: 0;
    height: 200px;
}

.circuit-vine-pattern--mid {
    top: 0;
    height: 100px;
}

.circuit-vine-pattern--craft {
    top: 0;
    height: 80px;
}

.circuit-vine-pattern--footer {
    top: 20%;
    height: 60%;
    opacity: 0.2;
}

.circuit-vine-pattern svg {
    width: 100%;
    height: 100%;
}

.vine-path {
    fill: none;
    stroke: #B87B4A;
    stroke-width: 1.5;
    stroke-linecap: round;
}

.vine-path--thick {
    stroke-width: 2;
}

.vine-junction {
    fill: #B87B4A;
}

.vine-leaf {
    fill: #4A6B4A;
    opacity: 0.8;
}

.vine-leaf--large {
    opacity: 0.6;
}

/* --- Workshop Layout --- */
.workshop-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(30px, 5vw, 80px);
    align-items: center;
}

.workshop-layout--reverse {
    direction: rtl;
}

.workshop-layout--reverse > * {
    direction: ltr;
}

.workshop-text {
    max-width: 560px;
}

.section-heading {
    position: relative;
}

.section--light .section-heading {
    color: #4A1A2E;
}

.section--dark .section-heading {
    color: #F5EDE0;
}

.section-body {
    margin-bottom: 1.5em;
}

.section--light .section-body {
    color: #2A0A1A;
}

.section--dark .section-body {
    color: #F5EDE0;
    opacity: 0.9;
}

.craft-quote {
    font-family: 'Cardo', Georgia, serif;
    font-weight: 700;
    font-style: italic;
    font-size: clamp(16px, 1.8vw, 20px);
    color: #C88B8B;
    padding-left: 1.2em;
    border-left: 3px solid #B87B4A;
    margin-top: 1em;
}

.section--light .craft-quote {
    color: #4A1A2E;
    border-left-color: #4A6B4A;
}

/* --- Duotone Photo Treatment --- */
.workshop-image {
    position: relative;
}

.duotone-photo {
    position: relative;
    border-radius: 4px;
    overflow: hidden;
}

.duotone-photo::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(74,26,46,0.5), rgba(42,10,26,0.5));
    mix-blend-mode: multiply;
    pointer-events: none;
}

.photo-inner {
    filter: sepia(0.3) contrast(0.9);
}

.photo-illustration {
    width: 100%;
    height: auto;
    display: block;
}

/* Craft card images have clipped edges */
.craft-card-image {
    position: relative;
    overflow: hidden;
    clip-path: polygon(0 0, 98% 2%, 100% 100%, 2% 98%);
    border: 2px solid #F5EDE0;
}

.section--light .craft-card-image {
    border-color: #4A1A2E;
}

.card-illustration {
    width: 100%;
    height: auto;
    display: block;
}

/* --- Craft Room --- */
#craft-room .section-heading {
    text-align: center;
}

.craft-room-intro {
    text-align: center;
    font-family: 'Libre Baskerville', Georgia, serif;
    font-weight: 400;
    font-style: italic;
    font-size: clamp(14px, 1.5vw, 18px);
    color: #C88B8B;
    margin-bottom: clamp(30px, 4vh, 60px);
}

.craft-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(20px, 3vw, 40px);
}

.craft-card {
    background: rgba(74,26,46,0.4);
    border: 1px solid rgba(245,237,224,0.1);
    border-radius: 6px;
    overflow: hidden;
    transition: transform 0.4s ease, border-color 0.4s ease;
}

.craft-card:hover {
    transform: translateY(-4px);
    border-color: #C88B8B;
}

.craft-card-body {
    padding: clamp(16px, 2vw, 24px);
}

.craft-card-title {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-weight: 700;
    font-size: clamp(16px, 1.5vw, 20px);
    color: #F5EDE0;
    margin-bottom: 0.4em;
}

.craft-card-desc {
    font-family: 'Cardo', Georgia, serif;
    font-size: clamp(14px, 1.2vw, 16px);
    color: #F5EDE0;
    opacity: 0.8;
    line-height: 1.6;
    margin-bottom: 0.8em;
}

.craft-card-tag {
    font-family: 'Fira Code', monospace;
    font-size: 11px;
    color: #B87B4A;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* --- Garden Footer --- */
.footer-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.footer-wordmark {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-weight: 700;
    font-size: clamp(24px, 4vw, 40px);
    color: #F5EDE0;
    margin-bottom: 0.4em;
}

.footer-tagline {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-weight: 400;
    font-style: italic;
    font-size: clamp(14px, 1.5vw, 18px);
    color: #C88B8B;
    margin-bottom: 1.5em;
}

.footer-details {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.footer-detail {
    font-family: 'Cardo', Georgia, serif;
    font-size: 14px;
    color: #F5EDE0;
    opacity: 0.6;
}

.footer-divider {
    color: #B87B4A;
    opacity: 0.5;
}

/* --- Scroll-Reveal Animations --- */
.workshop-text,
.workshop-image,
.craft-card {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.workshop-text.in-view,
.workshop-image.in-view,
.craft-card.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger craft cards */
.craft-card:nth-child(2) { transition-delay: 0.1s; }
.craft-card:nth-child(3) { transition-delay: 0.2s; }
.craft-card:nth-child(4) { transition-delay: 0.3s; }
.craft-card:nth-child(5) { transition-delay: 0.4s; }
.craft-card:nth-child(6) { transition-delay: 0.5s; }

/* --- Responsive --- */
@media (max-width: 900px) {
    .workshop-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .workshop-layout--reverse {
        direction: ltr;
    }

    .craft-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .craft-grid {
        grid-template-columns: 1fr;
    }

    .section {
        padding: clamp(30px, 5vh, 60px) 20px;
    }
}

/* --- Section Transition Glitch --- */
@keyframes sectionGlitch {
    0%, 85%, 100% { opacity: 0; }
    90% { opacity: 0.08; transform: translateX(-2px); }
    95% { opacity: 0.04; transform: translateX(1px); }
}

.section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent 0%, #FFFFFF 20%, transparent 40%, #C88B8B 60%, transparent 80%);
    opacity: 0;
    z-index: 10;
    pointer-events: none;
}

.section.section-entering::before {
    animation: sectionGlitch 0.5s ease-in-out;
}
