/* ============================================
   desca.dev — Styles
   ============================================ */

/* --- Custom Properties --- */
:root {
    --warm-sand: #f4ede4;
    --wet-clay: #d9cfc2;
    --kiln-brown: #3d2e1f;
    --driftwood: #7a6b58;
    --terracotta: #c4734b;
    --tide-pool: #4a8b7f;
    --iri-rose: #e8a0c8;
    --iri-gold: #d4b87a;
    --iri-aqua: #7ec8c4;
    --basalt: #2a2218;

    --font-main: 'Commissioner', sans-serif;
    --font-mono: 'DM Mono', monospace;

    --space-xs: 21px;
    --space-sm: 34px;
    --space-md: 55px;
    --space-lg: 89px;
    --space-xl: 144px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.7;
    letter-spacing: 0.005em;
    color: var(--kiln-brown);
    background: var(--warm-sand);
    overflow-x: hidden;
}

/* --- Dot Navigation --- */
#dot-nav {
    position: fixed;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}

.dot-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(122, 107, 88, 0.25);
    z-index: -1;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1.5px solid var(--driftwood);
    background: transparent;
    cursor: pointer;
    transition: all 0.4s ease;
    position: relative;
}

.dot.active {
    background: conic-gradient(var(--iri-rose), var(--iri-gold), var(--iri-aqua), var(--iri-rose));
    border-color: transparent;
    animation: dot-pulse 2s ease-in-out infinite;
}

@keyframes dot-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

/* --- Hero Section --- */
#hero {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--warm-sand);
    overflow: hidden;
}

#caustic-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1.5s ease;
}

#caustic-canvas.visible {
    opacity: 0.35;
}

#hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
}

#hero-title {
    font-family: var(--font-main);
    font-weight: 700;
    font-size: clamp(4rem, 10vw, 8rem);
    letter-spacing: -0.01em;
    line-height: 1.1;
    color: var(--kiln-brown);
}

#hero-title .letter {
    display: inline-block;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

#hero-title .letter.visible {
    opacity: 1;
    transform: translateY(0);
    text-shadow:
        2px 2px 20px rgba(232, 160, 200, 0.3),
        -2px -2px 20px rgba(126, 200, 196, 0.3),
        0 0 40px rgba(212, 184, 122, 0.2);
}

#hero-tagline {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--driftwood);
    margin-top: var(--space-sm);
    opacity: 0;
    transition: opacity 0.8s ease;
}

#hero-tagline.visible {
    opacity: 1;
}

.tag-dot {
    display: inline-block;
    margin: 0 8px;
    background: conic-gradient(var(--iri-rose), var(--iri-gold), var(--iri-aqua), var(--iri-rose));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: holo-rotate 4s linear infinite;
}

@keyframes holo-rotate {
    from { filter: hue-rotate(0deg); }
    to { filter: hue-rotate(360deg); }
}

/* --- Bubbles --- */
.bubble {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: radial-gradient(
        circle at 30% 30%,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(232, 160, 200, 0.06) 30%,
        rgba(212, 184, 122, 0.06) 60%,
        rgba(126, 200, 196, 0.06) 100%
    );
    box-shadow: inset 0 -4px 8px rgba(0, 0, 0, 0.05);
    pointer-events: none;
}

.bubble-hero {
    width: var(--size);
    height: var(--size);
    left: var(--x-start);
    bottom: -40px;
    animation:
        rise var(--duration) ease-in-out infinite,
        sway calc(var(--duration) * 0.6) ease-in-out infinite;
    animation-delay: var(--delay);
    z-index: 15;
}

@keyframes rise {
    0% { transform: translateY(0); opacity: 0; }
    10% { opacity: 0.8; }
    90% { opacity: 0.8; }
    100% { transform: translateY(calc(-100vh - 60px)); opacity: 0; }
}

@keyframes sway {
    0%, 100% { margin-left: 0; }
    50% { margin-left: var(--x-drift); }
}

/* --- Pool Sections --- */
.pool {
    position: relative;
    min-height: 100vh;
    padding: var(--space-xl) 0 var(--space-lg);
    overflow: hidden;
}

.pool-sand {
    background: var(--warm-sand);
}

.pool-clay {
    background: var(--wet-clay);
}

.pool-divider {
    position: absolute;
    top: -1px;
    left: 0;
    width: 100%;
    height: 80px;
    z-index: 5;
}

.pool-content {
    position: relative;
    z-index: 10;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 var(--space-sm);
}

/* --- Stagger Animation --- */
.stagger-item {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    margin-left: var(--offset, 0%);
    margin-bottom: var(--space-md);
}

.stagger-item.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* --- Pool Typography --- */
.pool-heading {
    font-family: var(--font-main);
    font-weight: 700;
    font-size: clamp(2rem, 4.5vw, 3.8rem);
    letter-spacing: -0.01em;
    line-height: 1.1;
    color: var(--kiln-brown);
    margin-bottom: var(--space-sm);
}

.pool-body {
    max-width: 520px;
    color: var(--kiln-brown);
    line-height: 1.7;
}

.pool-label {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--driftwood);
    margin-bottom: var(--space-xs);
}

/* --- Holographic Overlay --- */
.holo-overlay {
    position: absolute;
    inset: 0;
    background: conic-gradient(
        from 0deg,
        rgba(232, 160, 200, 0.08),
        rgba(212, 184, 122, 0.08),
        rgba(126, 200, 196, 0.08),
        rgba(232, 160, 200, 0.08)
    );
    animation: holo-spin var(--holo-speed, 20s) linear infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes holo-spin {
    from { transform: rotate(0deg) scale(2); }
    to { transform: rotate(360deg) scale(2); }
}

/* --- Geometric Shapes --- */
.geo-shape {
    position: absolute;
    width: 50px;
    height: 50px;
    z-index: 2;
    animation: geo-rotate var(--rot-dur, 60s) linear infinite;
    pointer-events: none;
}

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

/* --- Bubble Content Containers --- */
.bubble-grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    justify-content: center;
    padding: var(--space-md) 0;
}

.bubble-container {
    width: 240px;
    height: 240px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: radial-gradient(
        circle at 30% 30%,
        rgba(255, 255, 255, 0.12) 0%,
        rgba(232, 160, 200, 0.08) 30%,
        rgba(212, 184, 122, 0.08) 60%,
        rgba(126, 200, 196, 0.06) 100%
    );
    box-shadow:
        inset 0 -6px 12px rgba(0, 0, 0, 0.05),
        0 4px 24px rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    position: relative;
    margin-left: 0 !important;
}

.bubble-container:hover {
    transform: scale(1.08);
    box-shadow:
        inset 0 -6px 12px rgba(0, 0, 0, 0.05),
        0 8px 40px rgba(0, 0, 0, 0.1);
}

.bubble-container:hover .bubble-content {
    background: radial-gradient(
        circle at 30% 30%,
        rgba(255, 255, 255, 0.15) 0%,
        rgba(232, 160, 200, 0.15) 30%,
        rgba(212, 184, 122, 0.15) 60%,
        rgba(126, 200, 196, 0.12) 100%
    );
}

.bubble-content {
    padding: var(--space-xs);
    transition: background 0.4s ease;
}

.bubble-title {
    font-family: var(--font-main);
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--kiln-brown);
    margin-bottom: 4px;
}

.bubble-desc {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--driftwood);
}

.bubble-details {
    position: absolute;
    top: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%);
    width: 220px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.4s ease, transform 0.4s ease;
    transform: translateX(-50%) translateY(10px);
    pointer-events: none;
}

.bubble-container:hover .bubble-details {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.bubble-details p {
    font-size: 0.85rem;
    color: var(--driftwood);
    line-height: 1.5;
}

/* --- Skills Cluster --- */
.skills-cluster {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    max-width: 600px;
}

.skill-bubble {
    width: var(--s, 75px);
    height: var(--s, 75px);
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: radial-gradient(
        circle at 30% 30%,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(74, 139, 127, 0.08) 50%,
        rgba(196, 115, 75, 0.06) 100%
    );
    box-shadow: inset 0 -3px 6px rgba(0, 0, 0, 0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--kiln-brown);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.skill-bubble:hover {
    transform: scale(1.1);
    box-shadow:
        inset 0 -3px 6px rgba(0, 0, 0, 0.04),
        0 4px 16px rgba(74, 139, 127, 0.15);
}

/* --- Contact --- */
.contact-links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.contact-link {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    color: var(--terracotta);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease, color 0.3s ease;
}

.contact-link:hover {
    border-bottom-color: var(--terracotta);
    color: var(--kiln-brown);
}

/* --- Final Pool --- */
.pool-final {
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* --- Mobile --- */
@media (max-width: 768px) {
    #dot-nav {
        right: 12px;
    }

    .bubble-container {
        width: 180px;
        height: 180px;
    }

    .bubble-grid {
        gap: var(--space-sm);
    }

    .stagger-item {
        margin-left: 0 !important;
    }

    .pool-content {
        padding: 0 var(--space-xs);
    }

    .skill-bubble {
        width: 65px !important;
        height: 65px !important;
        font-size: 0.55rem;
    }
}
