/* thesecond.day - CSS Foundation */

/* CSS Custom Properties */
:root {
    --color-burgundy-deep: #5b1a2e;
    --color-burgundy-light: #8c3a56;
    --color-cream: #f5ece0;
    --color-gold: #b8924a;
    --color-pink-glitch: #d94f7a;
    --color-indigo: #4a5568;
    --color-ink: #2e1a1f;
    --color-vellum: #faf8f4;

    --font-playfair: "Playfair Display", serif;
    --font-caveat: "Caveat", cursive;
    --font-cormorant: "Cormorant Garamond", serif;
    --font-georgian: "Noto Sans Georgian", sans-serif;

    --angle: 0deg;
}

@property --angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-cormorant);
    color: var(--color-ink);
    background-color: var(--color-burgundy-deep);
    overflow-x: hidden;
}

/* Page Container */
.page-container {
    display: grid;
    grid-template-columns: [margin-left] minmax(1.5rem, 1fr) [content-start] minmax(0, 54rem) [content-end] minmax(1.5rem, 1fr) [margin-right];
    gap: 0;
}

/* Zone Base Styles */
.zone {
    grid-column: margin-left / margin-right;
    position: relative;
    overflow: hidden;
}

.zone > * {
    grid-column: content-start / content-end;
}

/* Zone 1: The Wash */
.zone-1 {
    min-height: 100vh;
    display: grid;
    align-items: center;
    justify-items: center;
    position: relative;
}

.wash-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(170deg, var(--color-burgundy-deep) 0%, var(--color-cream) 100%);
    background-size: 400% 400%;
    animation: wash-drift 12s ease infinite;
    z-index: 0;
}

@keyframes wash-drift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.zone-1-content {
    position: relative;
    z-index: 1;
    text-align: left;
    width: 100%;
    max-width: 54rem;
    padding: 0 1.5rem;
    left: 15%;
    top: 40%;
}

.hero-title {
    font-family: var(--font-playfair);
    font-size: clamp(2.6rem, 8vw, 7rem);
    font-weight: 700;
    font-style: italic;
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: var(--color-burgundy-deep);
    mix-blend-mode: multiply;
    opacity: 0;
    transform: translateY(12px);
    animation: hero-fade-in 1200ms cubic-bezier(0.25, 0.1, 0.25, 1) forwards 500ms;
    text-shadow: 
        -2px 1px rgba(217, 79, 122, 0.4),
        2px -1px rgba(74, 85, 104, 0.4);
}

@keyframes hero-fade-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-subtitle {
    font-family: var(--font-caveat);
    font-size: clamp(1.1rem, 2.2vw, 1.6rem);
    font-weight: 400;
    line-height: 1.6;
    color: var(--color-burgundy-light);
    margin-top: 1rem;
    opacity: 0;
    transform: translateY(12px);
    animation: hero-fade-in 1200ms cubic-bezier(0.25, 0.1, 0.25, 1) forwards 1300ms;
    text-shadow: 
        -2px 1px rgba(217, 79, 122, 0.4),
        2px -1px rgba(74, 85, 104, 0.4);
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    height: 2rem;
    border: 1px solid var(--color-gold);
    z-index: 10;
    animation: indicator-scale 600ms ease-out forwards, indicator-pulse 2s infinite 600ms;
}

@keyframes indicator-scale {
    from {
        transform: translateX(-50%) scaleY(0);
    }
    to {
        transform: translateX(-50%) scaleY(1);
    }
}

@keyframes indicator-pulse {
    0%, 100% {
        opacity: 0.4;
    }
    50% {
        opacity: 1;
    }
}

/* Zone 2: The Fracture */
.zone-2 {
    min-height: 250vh;
    padding: 50vh 0;
    background: linear-gradient(170deg, var(--color-cream) 0%, var(--color-burgundy-deep) 100%);
    background-size: 400% 400%;
    animation: wash-drift 12s ease infinite;
}

.fracture-block {
    grid-column: content-start / content-end;
    margin-bottom: 4rem;
    padding: 2rem;
    background-color: rgba(250, 248, 244, 0.85);
    clip-path: polygon(0% 0%, 98% 1%, 100% 3%, 99% 97%, 2% 100%, 0% 98%);
    border: 1px solid var(--color-gold);
    position: relative;
    border-image: linear-gradient(var(--angle), var(--color-gold), var(--color-burgundy-light), var(--color-burgundy-deep)) 1;
    animation: border-rotate 8s linear infinite;
}

@keyframes border-rotate {
    to {
        --angle: 360deg;
    }
}

.block-opener {
    font-family: var(--font-caveat);
    font-size: clamp(1.1rem, 2.2vw, 1.6rem);
    font-weight: 700;
    color: var(--color-burgundy-light);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.block-text {
    font-family: var(--font-cormorant);
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    line-height: 1.75;
    letter-spacing: 0.005em;
    color: var(--color-ink);
    opacity: 0;
    animation: text-fade-in 800ms ease-out forwards 200ms;
}

@keyframes text-fade-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.glitch-strip {
    grid-column: margin-left / margin-right;
    height: 6px;
    background: repeating-linear-gradient(
        90deg,
        var(--color-burgundy-deep) 0px,
        var(--color-burgundy-deep) 3px,
        transparent 3px,
        transparent 7px,
        var(--color-burgundy-light) 7px,
        var(--color-burgundy-light) 10px
    );
    margin: 3rem 0;
    opacity: 0.3;
    animation: glitch-flicker 4s ease-in-out infinite;
    mix-blend-mode: screen;
}

@keyframes glitch-flicker {
    0% { opacity: 0.3; }
    15% { opacity: 0.3; }
    16% { opacity: 0.9; }
    45% { opacity: 0.9; }
    46% { opacity: 0.3; }
    100% { opacity: 0.3; }
}

/* Zone 3: The Garden */
.zone-3 {
    min-height: 150vh;
    padding: 50vh 0;
    background: linear-gradient(170deg, var(--color-burgundy-deep) 0%, var(--color-cream) 100%);
    background-size: 400% 400%;
    animation: wash-drift 12s ease infinite;
    position: relative;
}

.garden-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.05;
    z-index: 0;
}

.garden-content {
    position: relative;
    z-index: 1;
    grid-column: content-start / content-end;
}

.garden-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
}

.garden-item {
    position: relative;
    padding: 2rem;
    display: flex;
    align-items: flex-start;
    gap: 2rem;
}

.garden-item.item-right {
    justify-self: end;
}

.garden-item.item-left {
    justify-self: start;
}

.cultural-motif {
    flex-shrink: 0;
    width: clamp(2rem, 5vw, 4rem);
    height: auto;
    opacity: 0.25;
    transform: rotate(-12deg);
}

.garden-text {
    font-family: var(--font-cormorant);
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    line-height: 1.75;
    color: var(--color-ink);
    flex: 1;
}

/* Zone 4: The Dissolution */
.zone-4 {
    min-height: 100vh;
    padding: 50vh 0;
    background: linear-gradient(170deg, var(--color-cream) 0%, var(--color-burgundy-deep) 100%);
    background-size: 400% 400%;
    animation: wash-drift 12s ease infinite;
    position: relative;
}

.dissolution-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.dissolution-content {
    position: relative;
    z-index: 1;
    grid-column: content-start / content-end;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.dissolution-text {
    font-family: var(--font-cormorant);
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    line-height: 1.75;
    color: var(--color-ink);
    text-align: center;
    margin-bottom: 2rem;
    opacity: 1;
    animation: dissolution-fade 600ms ease-out forwards;
}

.text-1 {
    animation-delay: 0ms;
}

.text-2 {
    animation-delay: 400ms;
}

.text-3 {
    animation-delay: 800ms;
}

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

.dissolution-watermark {
    font-family: var(--font-georgian);
    font-size: clamp(20rem, 40vw, 50rem);
    font-weight: 300;
    color: var(--color-burgundy-deep);
    opacity: 0.08;
    line-height: 1;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* SVG Cultural Motifs */
.georgian-character {
    animation: georgian-draw 4s ease-in-out infinite;
}

@keyframes georgian-draw {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 0.4; }
}

.mesoamerican-greca {
    animation: greca-dash 6s linear infinite;
}

@keyframes greca-dash {
    0% {
        stroke-dashoffset: 0;
    }
    100% {
        stroke-dashoffset: -200px;
    }
}

.celtic-knot {
    animation: knot-dash 8s linear infinite;
}

@keyframes knot-dash {
    0% {
        stroke-dashoffset: 0;
    }
    100% {
        stroke-dashoffset: -200px;
    }
}

/* Scan Lines Overlay */
.zone::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(91, 26, 46, 0.06) 2px,
        rgba(91, 26, 46, 0.06) 4px
    );
    animation: scan-shift 4s ease-in-out infinite;
    z-index: 5;
}

@keyframes scan-shift {
    0%, 100% {
        transform: translateX(-1px);
    }
    50% {
        transform: translateX(1px);
    }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .page-container {
        grid-template-columns: [margin-left] 1rem [content-start] 1fr [content-end] 1rem [margin-right];
    }

    .zone-1-content {
        left: 0;
        top: 35%;
        padding: 0 1rem;
    }

    .garden-item {
        flex-direction: column;
        gap: 1rem;
    }

    .garden-item.item-right,
    .garden-item.item-left {
        justify-self: center;
    }

    .hero-title {
        letter-spacing: 0.01em;
    }
}

/* Print Styles */
@media print {
    .scroll-indicator {
        display: none;
    }

    body {
        background-color: var(--color-cream);
    }
}
