/* animations.css - Scrollytelling & CSS Art (Candle) */

.reveal-mask {
    overflow: hidden;
    position: relative;
}

.reveal-mask > * {
    transform: translateY(100%);
    opacity: 0;
    transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 1.2s ease;
}

.reveal-mask.is-visible > * {
    transform: translateY(0);
    opacity: 1;
}

/* Float Image Reveal */
.float-reveal {
    opacity: 0;
    transform: translateY(50px) scale(0.95);
    transition: all 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.float-reveal.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Stagger Effects */
.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.3s; }
.stagger-3 { transition-delay: 0.5s; }


/* Text Clip Reveal */
.clip-text-reveal {
    clip-path: polygon(0 100%, 100% 100%, 100% 100%, 0 100%);
    transition: clip-path 1.5s cubic-bezier(0.77, 0, 0.175, 1);
}

.clip-text-reveal.is-visible {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}

/* ---- CSS ART: REALISTIC CANDLE on LIGHT BG ---- */
.candle-wrapper {
    position: relative;
    width: 100%;
    height: 400px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.candle {
    position: relative;
    width: 60px;
    height: 180px;
    background: linear-gradient(to right, #F9F3EA, #E3D9C6 50%, #FAF6F0);
    border-radius: 4px 4px 6px 6px;
    box-shadow: inset 0 -20px 20px rgba(92, 64, 51, 0.1), 
                var(--shadow-soft);
    margin-top: 100px;
}

.candle::before {
    /* Melted top */
    content: '';
    position: absolute;
    top: -10px;
    left: 0;
    width: 60px;
    height: 20px;
    background: #E8DDCA;
    border-radius: 50%;
    box-shadow: inset 0 -2px 5px rgba(0,0,0,0.05);
}

.wick {
    position: absolute;
    width: 4px;
    height: 15px;
    background: #4A3C31;
    top: -20px;
    left: 28px;
    border-radius: 50% 50% 0 0;
    z-index: 2;
}

.flame {
    position: absolute;
    width: 24px;
    height: 45px;
    background: rgba(255, 165, 0, 0.8);
    border-radius: 50% 50% 20% 20%;
    top: -60px;
    left: 18px;
    transform-origin: center bottom;
    animation: flicker 3s linear infinite, size 4s linear infinite;
    box-shadow: 0 0 20px rgba(255, 165, 0, 0.6),
                0 0 40px rgba(255, 200, 0, 0.4),
                0 0 60px rgba(212, 163, 115, 0.3); /* Turuncu vurgu rengine uyumlu */
    z-index: 3;
}

.flame::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 22px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50% 50% 20% 20%;
    bottom: 5px;
    left: 6px;
    box-shadow: 0 0 10px white;
}

@keyframes flicker {
    0%, 100% { transform: rotate(-1deg); }
    25% { transform: rotate(1deg) scale(1.02); }
    50% { transform: rotate(-2deg); }
    75% { transform: rotate(2deg) scale(0.98); }
}

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

/* Scroll Candle Zoom Effect */
.hero-scroll-shrink {
    transition: transform 1s ease-out;
}


/* ============================================================
   CSS ART: KÖKEN — Organic Botanical / Roots
   Bej zemin üzerinde toprak tonlarında dallanma sanatı
   ============================================================ */
.origin-art {
    width: 220px;
    height: 280px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-end;
}

/* Ana kök gövdesi */
.origin-art::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 60%;
    background: linear-gradient(to top, rgba(92,64,51,0.6), rgba(92,64,51,0.15));
    border-radius: 2px;
    animation: root-grow 3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Dal 1 — sol üst */
.origin-leaf {
    position: absolute;
    bottom: 45%;
    left: 50%;
    transform-origin: left center;
    animation: branch-left 4s 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
}
.origin-leaf::before {
    content: '';
    position: absolute;
    width: 70px;
    height: 2px;
    background: linear-gradient(to right, rgba(92,64,51,0.5), transparent);
    border-radius: 2px;
    transform: rotate(-35deg);
    transform-origin: left center;
}
/* Yaprak ucu — sol */
.origin-leaf::after {
    content: '';
    position: absolute;
    top: -22px;
    left: 45px;
    width: 42px;
    height: 28px;
    background: transparent;
    border: 2px solid rgba(212,163,115,0.55);
    border-radius: 50% 5% 50% 5%;
    transform: rotate(-40deg);
    animation: leaf-pulse 4s 1s ease-in-out infinite alternate;
}

/* Dal 2 — sağ orta */
.origin-drop {
    position: absolute;
    bottom: 60%;
    left: 50%;
    transform-origin: left center;
    animation: branch-right 4s 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
}
.origin-drop::before {
    content: '';
    position: absolute;
    width: 55px;
    height: 2px;
    background: linear-gradient(to right, rgba(92,64,51,0.5), transparent);
    border-radius: 2px;
    transform: rotate(30deg);
    transform-origin: left center;
}
/* Yaprak ucu — sağ */
.origin-drop::after {
    content: '';
    position: absolute;
    top: -18px;
    left: 36px;
    width: 36px;
    height: 24px;
    background: transparent;
    border: 2px solid rgba(212,163,115,0.4);
    border-radius: 5% 50% 5% 50%;
    transform: rotate(35deg);
    animation: leaf-pulse 4s 1.5s ease-in-out infinite alternate;
}

/* Tohum / kökenin çekirdeği */
.origin-art .origin-seed {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--clr-accent), rgba(92,64,51,0.3));
    box-shadow: 0 0 20px rgba(212,163,115,0.5), 0 0 40px rgba(212,163,115,0.2);
    animation: seed-glow 3s ease-in-out infinite alternate;
}

@keyframes root-grow {
    from { height: 0; opacity: 0; }
    to   { height: 60%; opacity: 1; }
}
@keyframes branch-left {
    from { opacity: 0; transform: scaleX(0) rotate(-10deg); }
    to   { opacity: 1; transform: scaleX(1) rotate(0deg); }
}
@keyframes branch-right {
    from { opacity: 0; transform: scaleX(0) rotate(10deg); }
    to   { opacity: 1; transform: scaleX(1) rotate(0deg); }
}
@keyframes leaf-pulse {
    from { transform: rotate(-40deg) scale(1);   border-color: rgba(212,163,115,0.5); }
    to   { transform: rotate(-35deg) scale(1.08); border-color: rgba(212,163,115,0.9); }
}
@keyframes seed-glow {
    from { box-shadow: 0 0 10px rgba(212,163,115,0.3); }
    to   { box-shadow: 0 0 30px rgba(212,163,115,0.7), 0 0 60px rgba(212,163,115,0.3); }
}


/* ============================================================
   CSS ART: EL İŞÇİLİĞİ — Göksem Sarkaç (Celestial Pendulum)
   Koyu zeminde altın sarkaç + yıldız yörüngeleri
   ============================================================ */

.celestial-art {
    position: relative;
    width: 300px;
    height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Background Orbit Rings */
.orbit-ring {
    position: absolute;
    border: 1px solid rgba(212, 163, 115, 0.1);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.orbit-1 { width: 100px; height: 100px; animation: orbit-pulse 4s ease-in-out infinite; }
.orbit-2 { width: 180px; height: 180px; animation: orbit-pulse 4s 1s ease-in-out infinite; }
.orbit-3 { width: 260px; height: 260px; border-style: dashed; opacity: 0.3; animation: rotate-slow 20s linear infinite; }

/* The Pendulum Rod */
.pendulum-rod {
    position: absolute;
    top: 0;
    left: 50%;
    width: 2px;
    height: 180px;
    background: linear-gradient(to bottom, transparent, rgba(212, 163, 115, 0.8));
    transform-origin: top center;
    animation: pendulum-swing 4s ease-in-out infinite;
}

/* The Pendulum Bob (Sphere) */
.pendulum-bob {
    position: absolute;
    bottom: -15px;
    left: -14px;
    width: 30px;
    height: 30px;
    background: radial-gradient(circle at 30% 30%, #F9F3EA, #D4A373 60%, #8B5A2B);
    border-radius: 50%;
    box-shadow: 0 0 30px rgba(212, 163, 115, 0.4),
                inset -2px -2px 10px rgba(0,0,0,0.3);
}

/* Core Glow halo */
.pendulum-bob::after {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(212, 163, 115, 0.2) 0%, transparent 70%);
    animation: glow-pulse 2s ease-in-out infinite alternate;
}

/* Orbiting Particles (Stars) */
.celestial-star {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 10px #D4A373;
    animation: star-move 6s linear infinite;
}

.star-1 { top: 20%; left: 30%; animation-delay: 0s; }
.star-2 { top: 60%; left: 80%; animation-delay: 2s; }
.star-3 { top: 80%; left: 20%; animation-delay: 4s; }

@keyframes pendulum-swing {
    0%, 100% { transform: rotate(-25deg); }
    50% { transform: rotate(25deg); }
}

@keyframes orbit-pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.1; }
    50% { transform: translate(-50%, -50%) scale(1.05); opacity: 0.3; }
}

@keyframes rotate-slow {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes star-move {
    0% { transform: rotate(0deg) translateX(100px) rotate(0deg); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: rotate(360deg) translateX(100px) rotate(-360deg); opacity: 0; }
}

/* ============================================================
   CSS ART: HİKAYEMİZ — Organik Toprak & Kökler (Earth & Roots)
   Kahverengi tonlarında derinlikli arka plan sanatı
   ============================================================ */

.story-bg-art {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
    pointer-events: none;
    background: radial-gradient(circle at 50% -20%, rgba(92, 64, 51, 0.05), transparent 70%);
}

.earth-layer {
    position: absolute;
    bottom: -10%;
    left: -10%;
    width: 120%;
    height: 60%;
    background: rgba(92, 64, 51, 0.03);
    border-radius: 45% 55% 50% 50% / 40% 40% 60% 60%;
    transform-origin: center;
    animation: earth-float 15s ease-in-out infinite alternate;
}

.layer-2 {
    background: rgba(212, 163, 115, 0.02);
    height: 50%;
    bottom: -5%;
    animation-delay: -5s;
    animation-duration: 20s;
}

.root-path {
    position: absolute;
    top: 10%;
    right: 5%;
    width: 300px;
    height: 500px;
    stroke: rgba(212, 163, 115, 0.15);
    stroke-width: 1;
    fill: none;
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 3s cubic-bezier(0.16, 1, 0.3, 1);
}

.root-path.is-visible {
    stroke-dashoffset: 0;
}

.dust-mote {
    position: absolute;
    width: 2px;
    height: 2px;
    background: rgba(212, 163, 115, 0.4);
    border-radius: 50%;
    animation: float-rise 10s linear infinite;
    opacity: 0;
}

@keyframes earth-float {
    0% { transform: scale(1) rotate(0deg) translateY(0); }
    100% { transform: scale(1.1) rotate(3deg) translateY(20px); }
}

@keyframes float-rise {
    0% { transform: translateY(100vh) translateX(0); opacity: 0; }
    20% { opacity: 0.6; }
    80% { opacity: 0.6; }
    100% { transform: translateY(-10vh) translateX(50px); opacity: 0; }
}

/* ============================================================
   CSS ART: İLK KIVILCIM — Köz & Işıltı (Spark & Glow)
   ============================================================ */

.spark-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.spark-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 80%;
    background: radial-gradient(circle, rgba(212, 163, 115, 0.25) 0%, transparent 70%);
    animation: glow-pulse 4s ease-in-out infinite alternate;
    z-index: 1;
}

.ember {
    position: absolute;
    width: 2px;
    height: 2px;
    background: #D4A373;
    border-radius: 50%;
    box-shadow: 0 0 5px #D4A373;
    animation: ember-rise 4s linear infinite;
    opacity: 0;
}

@keyframes ember-rise {
    0% { transform: translateY(0) translateX(0) scale(1); opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { transform: translateY(-100px) translateX(20px) scale(0); opacity: 0; }
}

/* ============================================================
   CSS ART: USTALIK — Çizgi İzleme (Craft Trace)
   ============================================================ */

.craft-trace-svg {
    position: absolute;
    top: -10px;
    left: -10px;
    width: calc(100% + 20px);
    height: calc(100% + 20px);
    pointer-events: none;
    z-index: 10;
}

.trace-rect {
    fill: none;
    stroke: var(--clr-accent);
    stroke-width: 1.5;
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 4s cubic-bezier(0.16, 1, 0.3, 1);
}

.is-visible .trace-rect {
    stroke-dashoffset: 0;
}

@keyframes glow-pulse {
    0% { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(1.1); opacity: 0.9; }
}

/* ============================================================
   CANVAS ART: İLK KIVILCIM (Radiant Core)
   ============================================================ */

.story-image-placeholder.canvas-spark {
    background: linear-gradient(135deg, #2D1B14 0%, #3D2B22 100%);
    display: flex;
    justify-content: center;
    align-items: center;
}

.spark-core {
    width: 60px;
    height: 60px;
    background: #D4A373;
    transform: rotate(45deg);
    box-shadow: 0 0 50px #D4A373, 0 0 100px rgba(212, 163, 115, 0.4);
    animation: spark-throb 3s ease-in-out infinite alternate;
}

.radiator-wave {
    position: absolute;
    border: 1px solid rgba(212, 163, 115, 0.2);
    border-radius: 50%;
    animation: radiator-out 4s linear infinite;
}

@keyframes spark-throb {
    0% { transform: rotate(45deg) scale(1); filter: brightness(1); }
    100% { transform: rotate(45deg) scale(1.2); filter: brightness(1.5); }
}

@keyframes radiator-out {
    0% { width: 0; height: 0; opacity: 0.8; }
    100% { width: 500px; height: 500px; opacity: 0; }
}

/* ============================================================
   CANVAS ART: USTALIK (Artisan Potter's Wheel)
   ============================================================ */

.story-image-placeholder.canvas-mastery {
    background: #FAF6F0;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1000px;
}

.sculpting-canvas {
    position: relative;
    width: 300px;
    height: 350px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Rotating Wheel Base */
.pottery-wheel {
    width: 200px;
    height: 40px;
    background: rgba(139, 90, 43, 0.1);
    border: 2px solid rgba(139, 90, 43, 0.2);
    border-radius: 50%;
    transform: rotateX(70deg);
    animation: rotate-wheel 8000ms linear infinite;
    position: relative;
    margin-top: 40px;
}

.pottery-wheel::after {
    content: '';
    position: absolute;
    inset: 4px;
    border: 1px dashed rgba(139, 90, 43, 0.3);
    border-radius: 50%;
}

/* Pulsing Vase Silhouette */
.vase-silhouette {
    width: 100px;
    height: 180px;
    background: linear-gradient(to top, rgba(139, 90, 43, 0.15), transparent);
    border-radius: 40% 40% 30% 30% / 100% 100% 20% 20%;
    position: relative;
    animation: vase-pulse 5s ease-in-out infinite alternate;
    margin-bottom: -15px;
}

.vase-silhouette::before {
    content: '';
    position: absolute;
    top: 10%; left: 0; right: 0; height: 1px;
    background: rgba(212, 163, 115, 0.3);
    box-shadow: 0 40px 0 rgba(212, 163, 115, 0.2), 0 80px 0 rgba(212, 163, 115, 0.1);
}

.wax-seal {
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 45px;
    height: 45px;
    background: #8B5A2B;
    color: #F9F3EA;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-serif);
    font-weight: 600;
    font-size: 0.75rem;
    border-radius: 50%;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.2), inset 0 0 10px rgba(0,0,0,0.3);
    border: 3px double rgba(255,255,255,0.2);
    z-index: 5;
}

@keyframes rotate-wheel {
    from { transform: rotateX(70deg) rotate(0deg); }
    to { transform: rotateX(70deg) rotate(360deg); }
}

@keyframes vase-pulse {
    0% { transform: scaleX(0.95) scaleY(1); opacity: 0.6; }
    100% { transform: scaleX(1.05) scaleY(0.98); opacity: 0.9; }
}

/* Reverse Grid Utility */
.grid-reverse {
    direction: rtl; /* Fallback */
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.grid-reverse > * {
    direction: ltr; /* Reset text direction for content */
}

@media (max-width: 900px) {
    .grid-reverse {
        display: flex;
        flex-direction: column-reverse;
    }
}

