/* --- VARS & GLOBALS --- */
:root {
    /* Brighter, more playful palette */
    --bg-color: #1f1f24; /* Slightly softer dark */
    --primary-color: #ffd700; /* Energetic Gold/Yellow */
    --secondary-color: #00c9a7; /* Playful Turquoise */
    --accent-color: #f85f73; /* Pop of Coral */
    --text-color: #f0f0f0; /* Bright Text */
    --text-muted-color: #ababab;
    --card-bg-color: #2d2d34;
    --font-main: "Poppins", sans-serif;
    --font-handwritten: "Caveat", cursive; /* For playful accents */
    --transition-speed: 0.25s;
    --fast-transition: 0.1s;
    --elastic-transition: cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.7;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center; /* Center vertically too */
    padding: 2rem 1rem;
    /* Dynamic background elements - subtle dots */
    background-image: radial-gradient(
        var(--text-muted-color) 0.5px,
        transparent 0.5px
    );
    background-size: 15px 15px;
    background-position: center center;
    position: relative; /* For absolute positioned elements like cursor trail */
    cursor: none; /* Hide default cursor for custom one */
}

/* --- CUSTOM CURSOR --- */
.cursor-dot,
.cursor-outline {
    pointer-events: none;
    position: fixed;
    top: 50%;
    left: 50%;
    border-radius: 50%;
    opacity: 0;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease-in-out, transform 0.1s ease; /* Fast position update */
    z-index: 9999;
}
.cursor-dot {
    width: 8px;
    height: 8px;
    background-color: var(--primary-color);
}
.cursor-outline {
    width: 40px;
    height: 40px;
    background-color: rgba(255, 215, 0, 0.2); /* Lighter primary */
    transition: width 0.2s ease, height 0.2s ease, background-color 0.2s ease,
        opacity 0.3s ease-in-out, transform 0.15s ease-out; /* Smoother outline transitions */
}
body:hover .cursor-dot,
body:hover .cursor-outline {
    opacity: 1;
}
/* Cursor interaction state */
body[data-cursor="hover"] .cursor-outline {
    background-color: rgba(0, 201, 167, 0.3); /* Secondary color */
    transform: translate(-50%, -50%) scale(1.4);
}
body[data-cursor="click"] .cursor-outline {
    background-color: rgba(248, 95, 115, 0.4); /* Accent color */
    transform: translate(-50%, -50%) scale(0.8);
    transition-duration: 0.1s;
}

/* --- ACCESSIBILITY --- */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Add a clear focus outline for keyboard navigators */
a:focus-visible,
button:focus-visible,
.interactive-card:focus-visible {
    outline: 3px solid var(--secondary-color);
    outline-offset: 3px;
    border-radius: 5px; /* Optional: makes the outline match rounded corners */
}

/* --- MAIN CONTAINER --- */
.container {
    max-width: 850px;
    width: 100%;
    text-align: center;
    padding: 2.5rem 1.5rem;
    background-color: rgba(45, 45, 52, 0.8); /* Slightly more opaque card */
    border-radius: 20px; /* Rounder */
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    position: relative;
    transform-style: preserve-3d; /* Enable 3D transforms for children */
    transition: transform 0.1s linear;
    /* Set transform using CSS variables for JS to update */
    transform: perspective(1000px) rotateX(var(--rotateX, 0deg)) rotateY(var(--rotateY, 0deg));
}

/* --- GENERAL ANIMATIONS --- */
@keyframes popIn {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    70% {
        transform: scale(1.05);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}
.pop-in {
    animation: popIn 0.5s var(--elastic-transition) forwards;
    opacity: 0;
}
.pop-in.delay-1 {
    animation-delay: 0.1s;
}
.pop-in.delay-2 {
    animation-delay: 0.25s;
}
.pop-in.delay-3 {
    animation-delay: 0.4s;
}
.pop-in.delay-4 {
    animation-delay: 0.55s;
}
.pop-in.delay-5 {
    animation-delay: 0.7s;
}
/* Add more delays as needed */

@keyframes wiggle {
    0%,
    100% {
        transform: rotate(-1deg);
    }
    50% {
        transform: rotate(1deg);
    }
}
.wiggle-on-hover:hover {
    animation: wiggle 0.4s ease-in-out infinite;
}

@keyframes jiggle {
    0% {
        transform: translate(1px, 1px) rotate(0deg);
    }
    25% {
        transform: translate(-1px, -2px) rotate(-1deg);
    }
    50% {
        transform: translate(-2px, 0px) rotate(1deg);
    }
    75% {
        transform: translate(1px, 2px) rotate(0deg);
    }
    100% {
        transform: translate(1px, -1px) rotate(1deg);
    }
}

/* --- HERO SECTION --- */
header {
    margin-bottom: 3rem;
}

.name-intro {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    color: var(--text-muted-color);
    margin-bottom: 0.5rem;
    font-weight: 400;
}
.name-intro .name {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.2em; /* Make name slightly bigger */
    display: inline-block; /* For transform */
    transition: transform 0.2s var(--elastic-transition);
}
.name-intro .name:hover {
    transform: scale(1.1) rotate(-3deg);
    color: var(--secondary-color);
}

h1 {
    font-size: clamp(2.5rem, 6vw, 4rem); /* Bigger headline */
    color: var(--text-color);
    margin-bottom: 1.5rem;
    font-weight: 700;
    min-height: 60px; /* Placeholder height for typing */
    position: relative;
    cursor: text;
}
h1 .highlight {
    color: var(--secondary-color);
    transition: color var(--fast-transition);
    display: inline-block; /* For effects */
}
h1 .highlight:hover {
    color: var(--accent-color);
    animation: jiggle 0.3s linear infinite; /* Jiggle on hover */
}

/* Typing caret simulation */
.typing-effect::after {
    content: "|";
    display: inline-block;
    vertical-align: baseline;
    animation: blinkCaret 0.7s infinite;
    color: var(--primary-color);
    margin-left: 3px;
    opacity: 1;
    font-weight: 100;
}
@keyframes blinkCaret {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
}

.subtitle {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    color: var(--text-muted-color);
    max-width: 600px;
    margin: 0 auto;
    font-weight: 400;
}
.subtitle strong {
    font-weight: 600;
    color: var(--primary-color);
    cursor: help;
    position: relative;
    display: inline-block;
    transition: transform var(--fast-transition) ease;
}
.subtitle strong:hover {
    transform: translateY(-3px);
    color: var(--secondary-color);
}

/* Simple hover info - no complex tooltip */
.subtitle strong::after {
    content: attr(data-info);
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%) scale(0);
    background: var(--accent-color);
    color: var(--bg-color);
    font-size: 0.8rem;
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
    font-family: var(--font-main); /* Use main font */
    font-weight: 600;
    opacity: 0;
    transition: transform var(--transition-speed) var(--elastic-transition),
        opacity var(--transition-speed);
    pointer-events: none;
}
.subtitle strong:hover::after {
    transform: translateX(-50%) scale(1);
    opacity: 1;
}

/* --- WORD LAB SECTION --- */
.word-lab {
    margin-bottom: 3.5rem;
}

h2 {
    font-size: clamp(1.8rem, 4.5vw, 2.8rem);
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-weight: 700;
    position: relative;
    display: inline-block;
    cursor: pointer; /* Make it look interactive */
}
/* Add some playful element to H2 */
h2 .icon {
    display: inline-block;
    margin: 0 5px;
    font-size: 0.8em;
    color: var(--secondary-color);
    transition: transform 0.3s var(--elastic-transition);
}
h2:hover .icon {
    transform: rotate(360deg) scale(1.3);
    color: var(--accent-color);
}

.word-lab p {
    max-width: 600px;
    margin: 0 auto 1rem auto;
    font-size: 1.05rem; /* Slightly larger text */
}

.interactive-word {
    font-family: var(--font-handwritten); /* Different font! */
    font-size: 1.3em; /* Bigger */
    color: var(--secondary-color);
    display: inline-block; /* Needed for transform */
    cursor: pointer;
    position: relative;
    top: 3px; /* Adjust baseline */
    margin: 0 2px;
    transition: transform 0.2s var(--elastic-transition), color 0.2s ease;
}
.interactive-word:hover {
    transform: scale(1.2) rotate(5deg);
    color: var(--accent-color);
}

/* --- STUFF I DO SECTION --- */
.stuff-i-do {
    margin-bottom: 3.5rem;
}

.service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.service-card {
    background-color: var(--card-bg-color);
    padding: 2rem;
    border-radius: 15px;
    border: 1px solid transparent; /* Start transparent */
    transition: transform var(--transition-speed) ease,
        box-shadow var(--transition-speed) ease,
        border-color var(--transition-speed) ease;
    position: relative;
    overflow: hidden;
    /* Add slight perspective */
    transform: perspective(1000px) rotateY(0deg) rotateX(0deg);
}

.service-card:hover {
    transform: perspective(1000px) rotateY(5deg) rotateX(3deg) scale(1.03);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 215, 0, 0.5); /* Primary color border */
}

.service-card i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: block;
    transition: transform 0.4s var(--elastic-transition); /* Longer bounce */
}
.service-card:hover i {
    transform: scale(1.2) rotate(-15deg) translateY(-10px);
}

.service-card h3 {
    font-size: 1.5rem;
    color: var(--text-color);
    margin-bottom: 0.8rem;
    font-weight: 600;
}

.service-card p {
    font-size: 0.95rem;
    color: var(--text-muted-color);
}

/* --- LET'S TALK SECTION --- */
.lets-talk {
    margin-bottom: 2.5rem;
}

.lets-talk p {
    margin-bottom: 2rem;
    max-width: 550px;
    margin-left: auto;
    margin-right: auto;
    font-size: 1.1rem;
}

/* Buttons instead of just icons */
.contact-buttons {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap; /* Allow wrapping on small screens */
}

.contact-button {
    background-color: var(--primary-color);
    color: var(--bg-color);
    border: none;
    padding: 12px 25px;
    border-radius: 50px; /* Pill shape */
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-main);
    text-decoration: none;
    display: inline-flex; /* Use flex for icon alignment */
    align-items: center;
    gap: 8px; /* Space between icon and text */
    cursor: pointer;
    transition: transform var(--fast-transition) var(--elastic-transition),
        background-color var(--transition-speed) ease,
        box-shadow var(--transition-speed) ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.contact-button .icon {
    font-size: 1.2em;
    transition: transform 0.3s ease;
}

.contact-button:hover {
    background-color: var(--secondary-color);
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.4);
}
.contact-button:hover .icon {
    transform: rotate(-10deg) scale(1.1);
}

.contact-button:active {
    transform: translateY(-2px) scale(0.98); /* Click squish */
    background-color: var(--accent-color);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

/* Specific button colors if desired */
.telegram-btn {
    background-color: #2aabee;
    color: white;
}
.twitter-btn {
    background-color: #1da1f2;
    color: white;
} /* Or black for X logo */
.telegram-btn:hover {
    background-color: #1e90d1;
}
.twitter-btn:hover {
    background-color: #0c85d0;
} /* Or darker grey */

/* Keep original color scheme:
         .telegram-btn { background-color: var(--primary-color); color: var(--bg-color); }
         .twitter-btn { background-color: var(--primary-color); color: var(--bg-color); }
         .telegram-btn:hover { background-color: var(--secondary-color); }
         .twitter-btn:hover { background-color: var(--secondary-color); }
        */

/* --- FOOTER --- */
footer {
    margin-top: 3rem;
    font-size: 0.9rem;
    color: var(--text-muted-color);
    opacity: 0.8;
    transition: opacity var(--transition-speed);
    position: relative;
}
footer:hover {
    opacity: 1;
}

/* Playful footer element */
#footer-sparkle {
    position: absolute;
    top: -10px; /* Position above text */
    left: 50%;
    transform: translateX(-50%) scale(0.5);
    font-size: 1.5rem;
    color: var(--primary-color);
    opacity: 0;
    transition: transform 0.4s var(--elastic-transition), opacity 0.3s ease;
    pointer-events: none;
}
footer:hover #footer-sparkle {
    opacity: 1;
    transform: translateX(-50%) scale(1) rotate(15deg);
}

/* --- RESPONSIVENESS --- */
@media (max-width: 768px) {
    body {
        padding: 1.5rem 0.5rem;
        cursor: auto; /* Disable custom cursor on mobile */
    }
    .cursor-dot,
    .cursor-outline {
        display: none;
    }
    .container {
        padding: 2rem 1rem;
    }
    h1 {
        font-size: 2.8rem;
        min-height: 50px;
    }
    .name-intro {
        font-size: 1.5rem;
    }
    h2 {
        font-size: 2rem;
    }
    .service-grid {
        gap: 1.5rem;
        grid-template-columns: 1fr;
    }
    .contact-buttons {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }
    .contact-button {
        width: 80%;
        justify-content: center;
    }
}
@media (max-width: 480px) {
    h1 {
        font-size: 2.2rem;
        min-height: 40px;
    }
    .name-intro {
        font-size: 1.3rem;
    }
    .subtitle {
        font-size: 0.95rem;
    }
    h2 {
        font-size: 1.8rem;
    }
    .word-lab p {
        font-size: 1rem;
    }
    .service-card {
        padding: 1.5rem;
    }
    .service-card h3 {
        font-size: 1.3rem;
    }
    .lets-talk p {
        font-size: 1rem;
    }
    .contact-button {
        width: 90%;
        font-size: 0.9rem;
        padding: 10px 20px;
    }
}
