@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;500;700;800&display=swap');

:root {
    --sky-top: #2980b9;
    --sky-bottom: #6dd5ed;
    --sun-color: #fffeb3;
    --sun-shadow: rgba(255, 254, 179, 1);
    
    --c-m7: #6a89cc; 
    --c-m6: #5a79bc;
    --c-m5: #4a69ac;
    --c-m4: #3c5a9a;
    --c-m3: #2e4a88;
    --c-m2: #1f3a76;
    --c-m1: #0c2461; 
    
    --text-color: #fff;
    --card-border: rgba(255, 255, 255, 0.15);
}

body, html {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
    width: 100%;
    font-family: 'Montserrat', sans-serif;
    background-color: var(--c-m1);
    scroll-behavior: smooth;
    transition: background-color 1.5s ease;
}

body.state-morning {
    --sky-top: #f5af19; --sky-bottom: #f12711;
    --sun-color: #ffdd00; --sun-shadow: rgba(255, 220, 0, 0.8);
    --c-m7: #eccc68; --c-m6: #ffa502; --c-m5: #ff7f50; --c-m4: #ff6348;
    --c-m3: #574b90; --c-m2: #303952; --c-m1: #1e272e;
}

body.state-day {
    --sky-top: #00b4db; --sky-bottom: #0083b0;
    --c-m7: #95afc0; --c-m6: #7899b3; --c-m5: #535c68; --c-m4: #485460;
    --c-m3: #2d3436; --c-m2: #1e272e; --c-m1: #000000;
}

body.state-afternoon {
    --sky-top: #240b36;
    --sky-bottom: #c31432;
    --sun-color: #ffcc00;  
    --sun-shadow: rgba(255, 200, 0, 0.6);
    --c-m7: #c04848; 
    --c-m6: #a63a50;
    --c-m5: #853359;
    --c-m4: #662d60;
    --c-m3: #480048; 
    --c-m2: #300531;
    --c-m1: #1a051d; 
}

body.state-night {
    --sky-top: #0f2027; --sky-bottom: #203a43;
    --sun-color: #fdfdfd; --sun-shadow: rgba(255, 255, 255, 0.2);
    --c-m7: #2f3640; --c-m6: #252a34; --c-m5: #1e222b; --c-m4: #171a21;
    --c-m3: #101218; --c-m2: #08090c; --c-m1: #000000;
}

.scene {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
}

.layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    will-change: transform;
}

.graphic {
    position: absolute;
    width: 160vw; 
    left: -30vw;
    bottom: -15vh;
    transition: background-color 1.5s ease;
}

.sky-gradient {
    position: absolute;
    width: 140vw;
    height: 140vh;
    left: -20vw;
    top: -20vh;
    background: linear-gradient(to bottom, var(--sky-top), var(--sky-bottom));
    z-index: 0;
    transition: background 1.5s ease;
}

.celestial-body {
    position: absolute;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--sun-color);
    box-shadow: 0 0 60px var(--sun-shadow);
    top: 20%;
    left: 50%;
    margin-left: -60px;
    z-index: 1;
    transition: all 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.m7 { height: 80%; background-color: var(--c-m7); clip-path: polygon(0% 50%, 10% 45%, 25% 55%, 40% 40%, 60% 50%, 80% 45%, 100% 55%, 100% 100%, 0% 100%); }
.m6 { height: 70%; background-color: var(--c-m6); clip-path: polygon(100% 49%, 98% 50%, 97% 50%, 95% 50%, 94% 51%, 93% 51%, 91% 52%, 86% 53%, 85% 54%, 84% 53%, 83% 53%, 82% 53%, 80% 52%, 77% 54%, 76% 54%, 76% 54%, 74% 54%, 73% 54%, 72% 52%, 70% 51%, 69% 50%, 68% 50%, 66% 49%, 64% 48%, 63% 48%, 62% 48%, 60% 47%, 59% 47%, 58% 48%, 56% 49%, 55% 49%, 54% 49%, 52% 50%, 51% 50%, 50% 51%, 47% 51%, 46% 51%, 45% 51%, 43% 51%, 42% 51%, 41% 51%, 40% 50%, 39% 49%, 38% 49%, 36% 49%, 35% 50%, 33% 51%, 31% 52%, 29% 53%, 29% 52%, 28% 54%, 26% 55%, 25% 56%, 24% 56%, 23% 56%, 22% 56%, 20% 56%, 18% 56%, 17% 56%, 15% 56%, 14% 55%, 13% 55%, 13% 56%, 11% 56%, 10% 56%, 9% 55%, 9% 55%, 8% 55%, 7% 56%, 6% 56%, 3% 56%, 2% 56%, 1% 56%, 0% 55%, 0% 100%, 100% 100%); }
.m5 { height: 75%; background-color: var(--c-m5); clip-path: polygon(0% 61%, 1% 60%, 3% 61%, 3% 60%, 7% 61%, 10% 61%, 13% 62%, 15% 61%, 17% 62%, 19% 61%, 21% 62%, 23% 60%, 25% 60%, 27% 60%, 28% 61%, 29% 61%, 31% 61%, 32% 60%, 33% 61%, 35% 61%, 38% 61%, 40% 61%, 43% 60%, 45% 59%, 47% 58%, 48% 57%, 50% 57%, 51% 57%, 54% 58%, 56% 59%, 57% 59%, 58% 59%, 60% 59%, 62% 60%, 62% 60%, 63% 59%, 64% 59%, 66% 58%, 67% 57%, 69% 57%, 71% 58%, 74% 58%, 77% 58%, 82% 58%, 84% 57%, 86% 55%, 89% 55%, 91% 56%, 93% 55%, 97% 54%, 100% 56%, 100% 100%, 0% 100%); }
.m4 { height: 65%; background-color: var(--c-m4); clip-path: polygon(0% 66%, 1% 65%, 3% 64%, 6% 65%, 11% 67%, 15% 70%, 17% 72%, 25% 73%, 72% 71%, 100% 71%, 100% 100%, 0% 100%); }
.m3 { height: 80%; background-color: var(--c-m3); clip-path: polygon(0% 78%, 1% 79%, 3% 79%, 5% 78%, 7% 77%, 9% 75%, 10% 75%, 12% 75%, 14% 74%, 16% 73%, 17% 71%, 18% 70%, 19% 70%, 21% 70%, 22% 70%, 23% 69%, 24% 69%, 26% 69%, 27% 69%, 29% 67%, 30% 66%, 31% 65%, 33% 66%, 34% 66%, 35% 66%, 36% 65%, 38% 66%, 39% 66%, 40% 65%, 41% 65%, 43% 65%, 45% 66%, 47% 67%, 48% 67%, 49% 67%, 51% 66%, 52% 64%, 54% 64%, 55% 64%, 56% 63%, 57% 62%, 59% 62%, 60% 62%, 62% 61%, 63% 62%, 65% 62%, 66% 61%, 67% 60%, 68% 60%, 69% 59%, 71% 58%, 72% 57%, 73% 58%, 75% 59%, 76% 60%, 78% 60%, 79% 60%, 81% 60%, 83% 60%, 85% 60%, 87% 59%, 89% 59%, 90% 59%, 92% 59%, 93% 59%, 95% 59%, 97% 59%, 98% 58%, 99% 56%, 100% 57%, 100% 100%, 0% 100%); }
.m2 { height: 90%; background-color: var(--c-m2); clip-path: polygon(0% 84%, 3% 85%, 4% 88%, 10% 88%, 38% 86%, 45% 83%, 61% 84%, 69% 80%, 71% 78%, 74% 75%, 76% 73%, 78% 72%, 80% 70%, 83% 69%, 84% 68%, 87% 64%, 90% 62%, 92% 61%, 94% 58%, 96% 56%, 97% 56%, 99% 57%, 100% 59%, 100% 100%, 0% 100%); }

.m1 {
    height: 110%; 
    background-color: var(--c-m1);
    bottom: -5%; 
    clip-path: polygon(0% 88%, 2% 87%, 3% 86%, 4% 85%, 6% 86%, 7% 85%, 7% 84%, 8% 84%, 9% 83%, 10% 81%, 11% 81%, 12% 80%, 13% 80%, 13% 78%, 14% 78%, 15% 78%, 16% 77%, 17% 76%, 19% 76%, 19% 74%, 21% 73%, 22% 74%, 24% 73%, 24% 74%, 25% 75%, 25% 74%, 26% 74%, 27% 75%, 28% 74%, 29% 75%, 30% 76%, 30% 76%, 31% 76%, 32% 77%, 33% 77%, 34% 77%, 35% 78%, 36% 78%, 37% 78%, 38% 79%, 39% 80%, 40% 79%, 40% 80%, 41% 80%, 42% 79%, 43% 80%, 44% 79%, 44% 80%, 45% 81%, 45% 79%, 46% 79%, 47% 80%, 48% 78%, 49% 79%, 50% 79%, 51% 79%, 51% 81%, 52% 80%, 53% 79%, 54% 80%, 55% 80%, 56% 81%, 56% 81%, 57% 80%, 57% 80%, 59% 81%, 60% 81%, 61% 81%, 62% 81%, 63% 82%, 63% 81%, 64% 81%, 65% 80%, 66% 79%, 67% 80%, 67% 79%, 68% 79%, 70% 80%, 70% 81%, 71% 80%, 72% 81%, 73% 79%, 74% 79%, 75% 80%, 76% 79%, 76% 78%, 77% 79%, 77% 78%, 78% 79%, 79% 80%, 80% 80%, 80% 81%, 81% 80%, 82% 79%, 82% 81%, 83% 80%, 84% 79%, 85% 80%, 85% 81%, 86% 79%, 87% 81%, 88% 81%, 89% 80%, 90% 82%, 90% 80%, 92% 79%, 95% 79%, 96% 79%, 97% 79%, 98% 79%, 99% 80%, 100% 80%, 100% 100%, 0% 100%);
}

.content-wrapper {
    position: absolute;
    z-index: 8; 
    text-align: center;
    top: 30%;
    pointer-events: none;
    width: 100%;
}

h1 {
    color: var(--text-color);
    font-size: 5rem;
    letter-spacing: -2px;
    text-shadow: 0 10px 30px rgba(0,0,0,0.3);
    margin: 0;
    line-height: 1;
}

h2 {
    color: rgba(255,255,255,0.8);
    font-size: 1.2rem;
    font-weight: 300;
    margin-top: 15px;
    letter-spacing: 8px;
    text-transform: uppercase;
}

.time-control {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
    background: rgba(0,0,0,0.6);
    padding: 15px;
    border-radius: 12px;
    color: white;
    backdrop-filter: blur(5px);
    width: 200px;
    font-size: 0.8rem;
}

.time-control label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

input[type=range] {
    width: 100%;
    cursor: pointer;
}

.projects-section {
    position: relative;
    z-index: 20; 
    background-color: var(--c-m1); 
    min-height: 100vh;
    padding: 120px 20px 80px;
    margin-top: -2px; 
    transition: background-color 1.5s ease;
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.projects-title {
    text-align: center;
    margin-bottom: 60px;
    opacity: 0; 
    transform: translateY(20px);
    animation: fadeIn 1s forwards;
    max-width: 800px;
}

.projects-title h3 {
    font-size: 2.2rem;
    margin: 0;
    letter-spacing: -1px;
    color: rgba(255,255,255,0.6);
    font-weight: 500;
    line-height: 1.3;
}

.highlight { color: #fff; font-weight: 700; }
#highlight-simple { text-decoration: underline; font-weight: 300; color: #fff; }

.projects-grid {
    display: grid;
    margin-top: 30px;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    width: 100%;
    max-width: 1200px;
    padding: 0 10px;
}

.project-card {
    position: relative;
    display: block;
    height: 480px;
    border-radius: 24px;
    overflow: hidden;
    text-decoration: none;
    background-color: rgba(255,255,255,0.05);
    border: 1px solid var(--card-border);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.4s ease, border-color 0.4s ease;
    opacity: 0;
    transform: translateY(40px);
}

.project-card.visible { opacity: 1; transform: translateY(0); }

.project-card:hover {
    transform: scale(1.01);
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
    z-index: 2;
    border-color: rgba(255,255,255,0.4);
}

.project-card__img-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.project-card__img {
    width: 100%;
    height: 92%;
    object-fit: cover;
    transition: transform 0.8s ease, filter 0.8s ease;
}

.project-card--mobile {
    overflow: visible;
    clip-path: polygon(-50% -50%, 150% -50%, 150% 100%, -50% 100%);
}

.project-card--mobile .project-card__img {
    object-fit: contain;
    transform: translateY(40px) scale(0.9);
}

.project-card--mobile:hover .project-card__img {
    transform: translateY(-25px) rotate(-1.5deg);
    filter: drop-shadow(0 30px 40px rgba(0,0,0,0.6));
}

.project-card__overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70%;
    background: linear-gradient(to top, rgba(0,0,0,0.95) 10%, rgba(0,0,0,0.6) 50%, rgba(0,0,0,0) 100%);
    z-index: 1;
    pointer-events: none;
    border-radius: 0 0 24px 24px;
}

.project-card__content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 30px;
    box-sizing: border-box;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.project-card__header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.project-card__icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    backdrop-filter: blur(4px);
}

.project-card__icon svg { width: 18px; height: 18px; fill: #fff; }

.project-card__label {
    background: linear-gradient(90deg, #fff, rgba(255,255,255,0.7));
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
    font-size: 2rem;
}

.project-card__desc {
    color: rgba(255,255,255,0.8);
    font-size: 0.9rem;
    line-height: 1.4;
    margin: 0;
}

.project-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    margin-right: 8px;
    margin-top: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.in-dev-badge {
    background: rgba(255, 159, 67, 0.25);
    border: 1px solid rgba(255, 159, 67, 0.6);
    color: #ffda79;
    box-shadow: 0 0 15px rgba(255, 159, 67, 0.15);
    text-shadow: 0 0 5px rgba(255, 159, 67, 0.4);
}

.project-badge:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

footer {
    text-align: center;
    color: rgba(255,255,255,0.3);
    font-size: 0.7rem;
    padding: 40px 20px;
    background-color: var(--c-m1);
    position: relative;
    z-index: 20;
}

@keyframes fadeIn { to { opacity: 1; } }

@media screen and (max-width: 768px) {
    .projects-grid { grid-template-columns: 1fr; }
    h1 { font-size: 3rem; }
    .project-card--mobile { clip-path: none; overflow: hidden; }
}