/* ============================================================
   aiice.dev - Pastoral Transcendence
   ============================================================ */

/* --- Design Palette Reference ---
   Primary Display: Cormorant Garamond (700)
   Handwriting: Caveat (400)
   Body: Nunito Sans (400, 600)
   Code/Accent: DM Mono (400)

   #f5e6c8  Dawn Gold
   #e8e0cc  Warm Parchment
   #d8d4c8  Overcast Linen
   #d4c5e2  Twilight Violet
   #b8c9a3  Sage Mist
   #d4a5a5  Dusty Rose
   #3a3428  Warm Umber
   #4a4239  Deep Warm Gray
   #7a6b5d  Dusty Brown
   #6b8f71  Sage Text
   #8aad72  Meadow Green
   #c4a8d4  Lavender Pulse
   #faf6ef  Faint Cream
   #d4dbc8  Border sage
   --- */

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

html {
    scroll-behavior: smooth;
    scrollbar-width: none;
}

html::-webkit-scrollbar {
    display: none;
}

body {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 400;
    font-size: 17px;
    line-height: 1.75;
    color: #4a4239;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
    background: #f5e6c8;
}

/* --- Full-page dawn-to-twilight gradient (spans entire page height, scrolls with content) --- */
#bg-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        #f5e6c8 0%,
        #e8e0cc 35%,
        #d8d4c8 70%,
        #d4c5e2 100%
    );
    z-index: -10;
    pointer-events: none;
}

/* --- Custom Scrollbar --- */
#custom-scrollbar {
    position: fixed;
    top: 0;
    right: 0;
    width: 3px;
    height: 100vh;
    z-index: 9999;
    background: linear-gradient(to bottom, #f5e6c8, #e8e0cc, #d8d4c8, #d4c5e2);
}

#custom-scrollbar-thumb {
    position: absolute;
    top: 0;
    right: 0;
    width: 3px;
    height: 40px;
    background: rgba(184, 201, 163, 0.6);
    border-radius: 2px;
    transition: opacity 0.3s ease;
}

/* --- Layer 1: Atmospheric Shapes --- */
.atmosphere-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.atmo-shape {
    position: absolute;
    will-change: transform;
}

.atmo-shape-1 {
    width: 300%;
    top: -10%;
    left: -50%;
    opacity: 0;
    transition: opacity 1.5s ease;
}

.atmo-shape-2 {
    width: 250%;
    top: 20%;
    left: -40%;
    opacity: 0;
    transition: opacity 1.5s ease 0.3s;
}

.atmo-shape-3 {
    width: 280%;
    top: 40%;
    left: -60%;
    opacity: 0;
    transition: opacity 1.5s ease 0.5s;
}

.atmo-shape-4 {
    width: 350%;
    top: 55%;
    left: -70%;
    opacity: 0;
    transition: opacity 1.5s ease 0.7s;
}

.atmo-shape-5 {
    width: 220%;
    top: 75%;
    left: -30%;
    opacity: 0;
    transition: opacity 1.5s ease 0.9s;
}

.atmo-shape-6 {
    width: 320%;
    top: 85%;
    left: -55%;
    opacity: 0;
    transition: opacity 1.5s ease 1.1s;
}

.atmosphere-visible .atmo-shape {
    opacity: 1;
}

/* --- Layer 4: Particles --- */
#particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

/* --- Navigation --- */
#main-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    padding: 18px 40px;
    transition: opacity 0.5s ease, transform 0.5s ease;
    background: rgba(245, 230, 200, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

#main-nav.nav-hidden {
    opacity: 0;
    transform: translateY(-100%);
    pointer-events: none;
}

.nav-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1100px;
    margin: 0 auto;
}

.nav-wordmark {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 700;
    font-size: 22px;
    color: #3a3428;
    text-decoration: none;
    letter-spacing: -0.01em;
}

.nav-links {
    display: flex;
    gap: 32px;
}

.nav-links a {
    font-family: 'Nunito Sans', sans-serif;
    font-size: 15px;
    font-weight: 400;
    color: #4a4239;
    text-decoration: none;
    position: relative;
    transition: color 0.3s ease;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 4px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='4'%3E%3Cpath d='M0 3 Q5 0 10 3 Q15 6 20 3' fill='none' stroke='%23d4a5a5' stroke-width='1.5'/%3E%3C/svg%3E") repeat-x;
    background-size: 20px 4px;
    transition: width 0.4s ease;
    border-radius: 1px;
}

.nav-links a:hover {
    color: #3a3428;
}

.nav-links a:hover::after {
    width: 100%;
}

/* --- Content Panels (Layer 2) --- */
.content-panel {
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 48px 52px;
    max-width: 620px;
    position: relative;
    z-index: 3;
    will-change: transform;
}

.panel-left {
    margin-left: 12%;
    margin-right: auto;
}

.panel-right {
    margin-right: 12%;
    margin-left: auto;
}

.panel-center {
    margin-left: auto;
    margin-right: auto;
}

/* --- Typography --- */
h1 {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 700;
    font-size: 44px;
    letter-spacing: -0.01em;
    line-height: 1.15;
    color: #3a3428;
    text-shadow: 0 2px 8px rgba(180, 160, 130, 0.3);
    margin-bottom: 24px;
}

h2 {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 700;
    font-size: 38px;
    letter-spacing: -0.01em;
    line-height: 1.15;
    color: #3a3428;
    text-shadow: 0 2px 8px rgba(180, 160, 130, 0.3);
    margin-bottom: 20px;
}

h3 {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 700;
    font-size: 24px;
    letter-spacing: -0.01em;
    line-height: 1.25;
    color: #3a3428;
    text-shadow: 0 2px 8px rgba(180, 160, 130, 0.3);
    margin-bottom: 10px;
}

.body-text {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 400;
    font-size: 17px;
    line-height: 1.75;
    color: #4a4239;
    margin-bottom: 16px;
}

.body-text:last-child {
    margin-bottom: 0;
}

.body-text strong {
    font-weight: 600;
    color: #3a3428;
}

/* --- Code Labels (DM Mono) --- */
.code-label {
    font-family: 'DM Mono', monospace;
    font-weight: 400;
    font-size: 14px;
    color: #6b8f71;
    display: inline-block;
    padding: 3px 10px;
    border: 2px solid #d4dbc8;
    border-radius: 6px;
    margin-bottom: 8px;
}

/* --- Annotations (Caveat) --- */
.annotation {
    font-family: 'Caveat', cursive;
    font-weight: 400;
    font-size: 19px;
    color: #7a6b5d;
    position: absolute;
    z-index: 4;
    white-space: nowrap;
}

.annotation::before {
    content: '';
    position: absolute;
    width: 40px;
    height: 0;
    border-top: 0.5px dashed #7a6b5d;
}

.annotation-1 {
    top: 15%;
    right: 14%;
    transform: rotate(-2deg);
}

.annotation-1::before {
    bottom: -8px;
    left: -45px;
    transform: rotate(15deg);
}

.annotation-2 {
    bottom: 25%;
    left: 10%;
    transform: rotate(1.5deg);
}

.annotation-2::before {
    top: -8px;
    right: -45px;
    transform: rotate(-10deg);
}

.annotation-3 {
    top: 35%;
    right: 10%;
    transform: rotate(-1deg);
}

.annotation-3::before {
    bottom: -8px;
    left: -45px;
    transform: rotate(12deg);
}

.annotation-4 {
    bottom: 18%;
    left: 12%;
    transform: rotate(2deg);
}

.annotation-4::before {
    top: -8px;
    right: -45px;
    transform: rotate(-8deg);
}

/* --- Collage Elements (Layer 3) --- */
.collage-element {
    position: absolute;
    z-index: 2;
    pointer-events: none;
    transition: transform 0.4s ease, filter 0.4s ease;
    filter: drop-shadow(8px 8px 30px rgba(90, 70, 60, 0.15));
}

.collage-element.collage-hoverable:hover {
    transform: translateY(-3px);
    filter: drop-shadow(8px 8px 45px rgba(90, 70, 60, 0.2));
}

/* Botanical collage elements */
.collage-botanical-1 {
    width: 100px;
    top: 25%;
    left: 5%;
    transform: rotate(-3deg);
}

.collage-botanical-opening-2 {
    width: 50px;
    bottom: 22%;
    right: 10%;
    transform: rotate(3deg);
}

.collage-botanical-2 {
    width: 80px;
    bottom: 10%;
    right: 8%;
    transform: rotate(4deg);
}

.collage-botanical-3 {
    width: 60px;
    bottom: 15%;
    right: 6%;
    transform: rotate(-2deg);
}

.collage-botanical-work {
    width: 55px;
    top: 8%;
    left: 6%;
    transform: rotate(5deg);
    opacity: 0.6;
}

.collage-botanical-contact {
    width: 55px;
    top: 20%;
    right: 12%;
    transform: rotate(-3deg);
    opacity: 0.5;
}

/* Waveform collage elements */
.collage-waveform-1 {
    width: 250px;
    top: 40%;
    right: 3%;
    transform: rotate(1deg);
    opacity: 0.7;
}

.collage-waveform-about {
    width: 320px;
    bottom: 8%;
    left: -3%;
    transform: rotate(-1.5deg);
    opacity: 0.5;
    z-index: 1;
}

.collage-waveform-2 {
    width: 200px;
    top: 10%;
    left: 3%;
    transform: rotate(-2deg);
    opacity: 0.7;
}

.collage-waveform-3 {
    width: 280px;
    top: 15%;
    left: 5%;
    transform: rotate(1.5deg);
    opacity: 0.7;
}

.collage-waveform-signals {
    width: 170px;
    bottom: 22%;
    right: 4%;
    transform: rotate(2deg);
    opacity: 0.6;
}

.collage-waveform-closing {
    width: 400px;
    top: 40%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0.4;
}

/* Watercolor washes */
.collage-watercolor-opening {
    width: 220px;
    height: 180px;
    top: 15%;
    right: 15%;
    background: radial-gradient(ellipse at center, rgba(212, 197, 226, 0.25), rgba(212, 197, 226, 0.05) 70%, transparent 100%);
    border-radius: 55% 45% 50% 40%;
    z-index: 1;
}

.collage-watercolor-1 {
    width: 180px;
    height: 140px;
    top: 5%;
    right: 6%;
    background: radial-gradient(ellipse at center, rgba(184, 201, 163, 0.35), rgba(184, 201, 163, 0.05) 70%, transparent 100%);
    border-radius: 50% 40% 55% 45%;
}

.collage-watercolor-2 {
    width: 200px;
    height: 160px;
    top: -5%;
    left: 5%;
    background: radial-gradient(ellipse at center, rgba(212, 165, 165, 0.3), rgba(212, 165, 165, 0.05) 70%, transparent 100%);
    border-radius: 45% 55% 40% 50%;
}

.collage-watercolor-3 {
    width: 160px;
    height: 130px;
    bottom: 10%;
    right: 8%;
    background: radial-gradient(ellipse at center, rgba(196, 168, 212, 0.35), rgba(196, 168, 212, 0.05) 70%, transparent 100%);
    border-radius: 50% 45% 55% 40%;
}

.collage-watercolor-work {
    width: 150px;
    height: 120px;
    bottom: 5%;
    left: 4%;
    background: radial-gradient(ellipse at center, rgba(184, 201, 163, 0.25), rgba(184, 201, 163, 0.04) 70%, transparent 100%);
    border-radius: 40% 50% 45% 55%;
    z-index: 1;
}

/* Landscape photograph crops */
.collage-landscape {
    border-radius: 8px 4px 12px 6px;
    filter: sepia(0.3) hue-rotate(-10deg) saturate(0.6) drop-shadow(8px 8px 30px rgba(90, 70, 60, 0.15));
}

.collage-landscape-opening {
    width: 140px;
    height: 90px;
    bottom: 18%;
    left: 8%;
    background: linear-gradient(135deg, rgba(184, 201, 163, 0.4) 0%, rgba(232, 224, 204, 0.3) 50%, rgba(212, 197, 226, 0.25) 100%);
    transform: rotate(-2.5deg);
}

.collage-landscape-about {
    width: 150px;
    height: 95px;
    bottom: 12%;
    left: 8%;
    background: linear-gradient(to bottom, rgba(184, 201, 163, 0.35), rgba(232, 224, 204, 0.25), rgba(212, 197, 226, 0.2));
    transform: rotate(1.5deg);
}

.collage-landscape-work {
    width: 160px;
    height: 100px;
    bottom: 10%;
    right: 15%;
    background: linear-gradient(to bottom, rgba(184, 201, 163, 0.3), rgba(212, 197, 226, 0.2));
    transform: rotate(2deg);
}

.collage-landscape-signals {
    width: 130px;
    height: 85px;
    top: 10%;
    right: 8%;
    background: linear-gradient(160deg, rgba(212, 197, 226, 0.3), rgba(196, 168, 212, 0.2), rgba(184, 201, 163, 0.15));
    transform: rotate(-1.5deg);
}

/* --- Sections --- */
.opening-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 80px 40px;
}

.opening-panel {
    text-align: center;
    max-width: 580px;
    margin: 0 auto;
    opacity: 0;
    transform: translateY(30px);
}

.opening-panel.panel-visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.opening-subtitle {
    opacity: 0;
    transition: opacity 0.8s ease 0.6s;
}

.opening-panel.panel-visible .opening-subtitle {
    opacity: 1;
}

.content-section {
    position: relative;
    padding: 80px 40px;
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.contact-section {
    padding-bottom: 120px;
}

/* --- Wave-form Dividers --- */
.wave-divider {
    width: 100%;
    padding: 40px 0;
    position: relative;
    z-index: 3;
}

.wave-divider svg {
    width: 100%;
    height: 40px;
    display: block;
}

.wave-divider-path {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 1.5s ease;
}

.wave-divider.wave-drawn .wave-divider-path {
    stroke-dashoffset: 0;
}

/* Wave breathing animation */
@keyframes waveBreathe {
    0%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(1.15); }
}

.wave-divider.wave-drawn svg {
    animation: waveBreathe 6s ease-in-out infinite;
    transform-origin: center;
}

/* --- Waveform path animation --- */
.waveform-path {
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
}

.waveform-animated .waveform-path {
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1.2s ease;
}

@keyframes waveformBreathe {
    0%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(1.15); }
}

.waveform-animated svg {
    animation: waveformBreathe 6s ease-in-out infinite;
    transform-origin: center;
}

/* --- Scroll Reveal --- */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* --- Reveal Text (character animation) --- */
.reveal-text .char {
    display: inline-block;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.reveal-text .char.char-visible {
    opacity: 1;
    transform: scale(1);
}

.reveal-text .char-space {
    width: 0.3em;
    display: inline-block;
}

.reveal-text br {
    display: block;
}

/* --- Pulse Attention --- */
.pulse-element {
    position: relative;
}

.pulse-element::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    transform: translate(-50%, -50%) scale(1);
    background: radial-gradient(circle, rgba(138, 173, 114, 0.2) 0%, transparent 70%);
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
    z-index: -1;
}

@keyframes pulseAttention {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 0.8; }
    100% { transform: translate(-50%, -50%) scale(1.5); opacity: 0; }
}

.pulse-element.pulsing::before {
    animation: pulseAttention 2s ease-out;
}

.pulse-element:hover::before {
    animation: pulseAttention 3s ease-out infinite;
    background: radial-gradient(circle, rgba(138, 173, 114, 0.35) 0%, transparent 70%);
}

/* --- Work Items --- */
.work-items {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.work-item {
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.35);
    border-radius: 16px;
    transition: background 0.3s ease;
}

.work-item:hover {
    background: rgba(250, 246, 239, 0.6);
}

.work-item .body-text {
    margin-bottom: 0;
    font-size: 15px;
}

/* --- Signal Entries --- */
.signal-entries {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.signal-entry {
    padding-left: 16px;
    border-left: 2px solid #d4dbc8;
}

.signal-entry h3 {
    font-size: 20px;
    margin-bottom: 6px;
}

.signal-entry .body-text {
    margin-bottom: 0;
    font-size: 15px;
}

/* --- Contact --- */
.contact-links {
    margin-top: 20px;
}

.contact-link {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 700;
    font-size: 26px;
    color: #3a3428;
    text-decoration: none;
    position: relative;
    display: inline-block;
    transition: color 0.3s ease;
}

.contact-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 4px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='4'%3E%3Cpath d='M0 3 Q5 0 10 3 Q15 6 20 3' fill='none' stroke='%23d4a5a5' stroke-width='1.5'/%3E%3C/svg%3E") repeat-x;
    background-size: 20px 4px;
    transition: width 0.4s ease;
    border-radius: 1px;
}

.contact-link:hover {
    color: #6b8f71;
}

.contact-link:hover::after {
    width: 100%;
}

/* --- Closing Wash --- */
.closing-wash {
    height: 30vh;
    position: relative;
    z-index: 1;
    background: linear-gradient(to bottom, transparent 0%, rgba(212, 197, 226, 0.08) 100%);
}

/* --- Mobile Responsive --- */
@media (max-width: 768px) {
    h1 {
        font-size: 30px;
    }

    h2 {
        font-size: 28px;
    }

    h3 {
        font-size: 20px;
    }

    .content-panel {
        padding: 32px 28px;
        max-width: 100%;
        margin-left: 20px;
        margin-right: 20px;
    }

    .panel-left,
    .panel-right,
    .panel-center {
        margin-left: 20px;
        margin-right: 20px;
    }

    .opening-section {
        padding: 60px 20px;
    }

    .content-section {
        padding: 60px 20px;
    }

    .nav-inner {
        flex-direction: column;
        gap: 8px;
    }

    .nav-links {
        gap: 20px;
    }

    .annotation {
        display: none;
    }

    .collage-botanical-1,
    .collage-botanical-2,
    .collage-botanical-3,
    .collage-botanical-work,
    .collage-botanical-contact,
    .collage-botanical-opening-2 {
        display: none;
    }

    .collage-landscape {
        display: none;
    }

    .collage-waveform-about,
    .collage-waveform-signals {
        display: none;
    }

    .contact-link {
        font-size: 20px;
    }

    .collage-watercolor-opening {
        width: 120px;
        height: 100px;
    }
}
