/* ===========================================
   SIMULAI.TECH - Styles
   Evolved-minimal, art-deco, navy-metallic
   Palette: #0f1428, #8a9ab8, #4a8a88, #2a3a54,
            #9a6a6a, #e4e8f0, #c4a868
   =========================================== */

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

html {
    scroll-behavior: smooth;
}

body {
    background: #0f1428;
    color: #8a9ab8;
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 400;
    font-size: clamp(15px, 1.5vw, 18px);
    line-height: 1.75;
    overflow-x: hidden;
    min-height: 100vh;
}

/* --- Typography --- */
h1, h2, h3 {
    font-family: 'Poiret One', cursive;
    color: #e4e8f0;
    font-weight: 400;
}

.hero-title {
    font-family: 'Poiret One', cursive;
    font-size: clamp(32px, 5vw, 64px);
    letter-spacing: 0.15em;
    color: #e4e8f0;
    position: relative;
    background: linear-gradient(
        90deg,
        #e4e8f0 0%,
        #c4a868 40%,
        #e4e8f0 60%,
        #c4a868 100%
    );
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: metallicShimmer 800ms ease-out 1400ms both;
    opacity: 0;
}

@keyframes metallicShimmer {
    0% {
        background-position: 200% 0;
        opacity: 0;
    }
    30% {
        opacity: 1;
    }
    100% {
        background-position: 0% 0;
        opacity: 1;
    }
}

.hero-subtitle {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 600;
    font-size: clamp(14px, 1.8vw, 20px);
    color: #8a9ab8;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    margin-top: 1rem;
    opacity: 0;
    animation: fadeInUp 600ms ease-out 2200ms both;
}

code {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 14px;
}

/* --- Organic Background Blobs --- */
.blob {
    position: fixed;
    z-index: 0;
    opacity: 0.3;
    background: #2a3a54;
    animation: blobMorph 25s ease-in-out infinite, blobDrift 30s ease-in-out infinite;
    pointer-events: none;
}

.blob-1 {
    width: 350px;
    height: 350px;
    top: 10%;
    left: -5%;
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    animation-delay: 0s;
}

.blob-2 {
    width: 280px;
    height: 280px;
    top: 50%;
    right: -8%;
    border-radius: 70% 30% 30% 70% / 70% 70% 30% 30%;
    animation-delay: -8s;
    background: #2a3a54;
    opacity: 0.2;
}

.blob-3 {
    width: 220px;
    height: 220px;
    bottom: 15%;
    left: 20%;
    border-radius: 50% 50% 30% 70% / 40% 60% 40% 60%;
    animation-delay: -15s;
    opacity: 0.15;
}

@keyframes blobMorph {
    0% {
        border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    }
    25% {
        border-radius: 50% 50% 30% 70% / 40% 60% 40% 60%;
    }
    50% {
        border-radius: 70% 30% 30% 70% / 70% 70% 30% 30%;
    }
    75% {
        border-radius: 40% 60% 60% 40% / 50% 40% 60% 50%;
    }
    100% {
        border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    }
}

@keyframes blobDrift {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }
    33% {
        transform: translate(30px, -20px) rotate(5deg);
    }
    66% {
        transform: translate(-20px, 15px) rotate(-3deg);
    }
    100% {
        transform: translate(0, 0) rotate(0deg);
    }
}

/* --- Hero Section --- */
#hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #0f1428;
    overflow: hidden;
    z-index: 1;
    animation: navyFadeIn 500ms ease-out both;
}

@keyframes navyFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.hero-watercolor-wash {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 400px;
    background: radial-gradient(
        ellipse at 40% 50%,
        rgba(74, 138, 136, 0.25) 0%,
        rgba(74, 138, 136, 0.12) 30%,
        rgba(74, 138, 136, 0.05) 55%,
        transparent 75%
    );
    filter: blur(40px);
    opacity: 0;
    animation: washFadeIn 800ms ease-out 2200ms both;
    pointer-events: none;
}

@keyframes washFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Art-deco SVG lines */
.deco-lines {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 80px;
    height: 160px;
    z-index: 2;
}

.deco-lines-left {
    left: 10%;
}

.deco-lines-right {
    right: 10%;
}

.deco-draw {
    stroke-dasharray: 300;
    stroke-dashoffset: 300;
    animation: drawLine 900ms ease-out 500ms both;
}

@keyframes drawLine {
    to {
        stroke-dashoffset: 0;
    }
}

.hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
    padding: 2rem;
}

/* Deco divider */
.deco-divider {
    position: absolute;
    bottom: 3rem;
    width: 300px;
    z-index: 3;
    opacity: 0;
    animation: fadeInUp 600ms ease-out 2800ms both;
}

.deco-divider svg {
    width: 100%;
    height: auto;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Portfolio Grid Section --- */
#portfolio {
    position: relative;
    z-index: 1;
    padding: 4rem 2rem;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* --- Portfolio Cards --- */
.portfolio-card {
    position: relative;
    background: #2a3a54;
    border-radius: 12px;
    padding: 3rem;
    overflow: hidden;
    opacity: 0;
    transform: translateY(30px);
    transition: none;
}

.portfolio-card.revealed {
    animation: bounceEnter 500ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes bounceEnter {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    70% {
        opacity: 1;
        transform: translateY(-4px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Art-deco corner frames */
.card-deco-frame {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 2;
}

.card-corner {
    position: absolute;
    width: 24px;
    height: 24px;
}

.card-corner-tl { top: 8px; left: 8px; }
.card-corner-tr { top: 8px; right: 8px; }
.card-corner-bl { bottom: 8px; left: 8px; }
.card-corner-br { bottom: 8px; right: 8px; }

/* Card arc above title */
.card-arc {
    position: relative;
    width: 100%;
    margin-bottom: 1rem;
    z-index: 1;
}

.card-arc svg {
    width: 100%;
    height: auto;
}

/* Watercolor illustration headers */
.card-watercolor {
    width: 100%;
    height: 140px;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}

/* Data Flow - Rivers */
.watercolor-rivers {
    background:
        radial-gradient(ellipse at 20% 50%, rgba(74, 138, 136, 0.6) 0%, transparent 50%),
        radial-gradient(ellipse at 60% 30%, rgba(74, 138, 136, 0.4) 0%, transparent 45%),
        radial-gradient(ellipse at 80% 70%, rgba(74, 138, 136, 0.3) 0%, transparent 40%),
        linear-gradient(135deg, rgba(74, 138, 136, 0.15) 0%, rgba(42, 58, 84, 0.8) 50%, rgba(15, 20, 40, 0.9) 100%);
}

.watercolor-rivers::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        linear-gradient(170deg, transparent 20%, rgba(74, 138, 136, 0.2) 30%, transparent 40%),
        linear-gradient(190deg, transparent 50%, rgba(74, 138, 136, 0.15) 60%, transparent 70%);
    filter: blur(8px);
}

/* Neural Network - Roots */
.watercolor-roots {
    background:
        radial-gradient(ellipse at 50% 80%, rgba(154, 106, 106, 0.5) 0%, transparent 40%),
        radial-gradient(ellipse at 30% 40%, rgba(154, 106, 106, 0.3) 0%, transparent 35%),
        radial-gradient(ellipse at 70% 20%, rgba(154, 106, 106, 0.25) 0%, transparent 30%),
        linear-gradient(180deg, rgba(42, 58, 84, 0.6) 0%, rgba(154, 106, 106, 0.2) 100%);
}

.watercolor-roots::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        radial-gradient(circle at 50% 90%, rgba(154, 106, 106, 0.3) 0%, transparent 30%),
        radial-gradient(circle at 35% 60%, rgba(154, 106, 106, 0.15) 0%, transparent 20%),
        radial-gradient(circle at 65% 50%, rgba(154, 106, 106, 0.15) 0%, transparent 20%);
    filter: blur(6px);
}

/* Weather Patterns */
.watercolor-weather {
    background:
        radial-gradient(ellipse at 30% 40%, rgba(74, 138, 136, 0.5) 0%, transparent 40%),
        radial-gradient(ellipse at 70% 60%, rgba(138, 154, 184, 0.4) 0%, transparent 35%),
        radial-gradient(ellipse at 50% 20%, rgba(196, 168, 104, 0.2) 0%, transparent 30%),
        linear-gradient(160deg, rgba(42, 58, 84, 0.7) 0%, rgba(15, 20, 40, 0.9) 100%);
}

.watercolor-weather::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        radial-gradient(ellipse at 40% 30%, rgba(74, 138, 136, 0.2) 0%, transparent 40%),
        radial-gradient(ellipse at 60% 50%, rgba(138, 154, 184, 0.15) 0%, transparent 35%);
    filter: blur(12px);
}

/* Structural Stress */
.watercolor-stress {
    background:
        radial-gradient(ellipse at 50% 50%, rgba(196, 168, 104, 0.4) 0%, transparent 35%),
        radial-gradient(ellipse at 20% 30%, rgba(154, 106, 106, 0.4) 0%, transparent 30%),
        radial-gradient(ellipse at 80% 70%, rgba(74, 138, 136, 0.3) 0%, transparent 30%),
        linear-gradient(145deg, rgba(154, 106, 106, 0.3) 0%, rgba(196, 168, 104, 0.15) 50%, rgba(42, 58, 84, 0.8) 100%);
}

.watercolor-stress::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        linear-gradient(90deg, rgba(154, 106, 106, 0.2) 0%, rgba(196, 168, 104, 0.15) 50%, rgba(74, 138, 136, 0.1) 100%);
    filter: blur(10px);
}

/* Particle Systems */
.watercolor-particles {
    background:
        radial-gradient(circle at 25% 35%, rgba(196, 168, 104, 0.4) 0%, transparent 20%),
        radial-gradient(circle at 60% 25%, rgba(74, 138, 136, 0.3) 0%, transparent 18%),
        radial-gradient(circle at 40% 70%, rgba(138, 154, 184, 0.3) 0%, transparent 22%),
        radial-gradient(circle at 75% 60%, rgba(196, 168, 104, 0.25) 0%, transparent 15%),
        radial-gradient(circle at 15% 65%, rgba(154, 106, 106, 0.2) 0%, transparent 16%),
        linear-gradient(180deg, rgba(42, 58, 84, 0.6) 0%, rgba(15, 20, 40, 0.9) 100%);
}

.watercolor-particles::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        radial-gradient(circle at 50% 50%, rgba(196, 168, 104, 0.1) 0%, transparent 50%);
    filter: blur(5px);
}

/* Acoustic Waves */
.watercolor-acoustic {
    background:
        radial-gradient(ellipse at 50% 50%, rgba(138, 154, 184, 0.4) 0%, transparent 25%),
        radial-gradient(ellipse at 50% 50%, transparent 20%, rgba(138, 154, 184, 0.15) 28%, transparent 36%),
        radial-gradient(ellipse at 50% 50%, transparent 40%, rgba(74, 138, 136, 0.12) 48%, transparent 56%),
        radial-gradient(ellipse at 50% 50%, transparent 60%, rgba(138, 154, 184, 0.08) 68%, transparent 76%),
        linear-gradient(180deg, rgba(42, 58, 84, 0.5) 0%, rgba(15, 20, 40, 0.9) 100%);
}

.watercolor-acoustic::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        radial-gradient(ellipse at 50% 50%, rgba(138, 154, 184, 0.15) 0%, transparent 50%);
    filter: blur(15px);
}

/* Card Title */
.card-title {
    font-family: 'Poiret One', cursive;
    font-size: clamp(22px, 2.5vw, 32px);
    color: #e4e8f0;
    margin-bottom: 1rem;
    letter-spacing: 0.05em;
    position: relative;
    z-index: 1;
}

/* Card Body */
.card-body {
    color: #8a9ab8;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

/* Card Tech/Code block */
.card-tech {
    background: rgba(15, 20, 40, 0.6);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    border-left: 2px solid #c4a868;
    position: relative;
    z-index: 1;
}

.card-tech code {
    color: #c4a868;
}

/* Metallic shimmer on card hover */
.portfolio-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(196, 168, 104, 0.04) 40%,
        rgba(228, 232, 240, 0.06) 50%,
        rgba(196, 168, 104, 0.04) 60%,
        transparent 100%
    );
    z-index: 1;
    transition: left 600ms ease;
    pointer-events: none;
}

.portfolio-card:hover::before {
    left: 100%;
}

/* --- Footer --- */
#footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 4rem 2rem 3rem;
}

.footer-deco {
    width: 250px;
    margin: 0 auto 2rem;
}

.footer-deco svg {
    width: 100%;
    height: auto;
}

.footer-text {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 600;
    font-size: clamp(14px, 1.5vw, 18px);
    color: #e4e8f0;
    letter-spacing: 0.15em;
    margin-bottom: 0.5rem;
}

.footer-sub {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 14px;
    color: #8a9ab8;
    opacity: 0.6;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .deco-lines {
        width: 50px;
        height: 100px;
    }

    .deco-lines-left {
        left: 5%;
    }

    .deco-lines-right {
        right: 5%;
    }

    .portfolio-card {
        padding: 2rem;
    }

    .hero-watercolor-wash {
        width: 350px;
        height: 250px;
    }

    .deco-divider {
        width: 220px;
    }
}

@media (max-width: 480px) {
    .deco-lines {
        display: none;
    }

    #portfolio {
        padding: 2rem 1rem;
    }

    .portfolio-card {
        padding: 1.5rem;
    }

    .card-watercolor {
        height: 100px;
    }
}
