/* --- Hero Section --- */
.hero-section {
    min-height: calc(85vh - var(--header-height));
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 2rem;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('data:image/svg+xml,<svg width="20" height="20" xmlns="http://www.w3.org/2000/svg"><circle cx="2" cy="2" r="1" fill="%232F4F4F"/></svg>');
    opacity: 0.1;
    z-index: -1;
}

.hero-content {
    max-width: 800px;
}

.hero-headline, .hero-subheadline, .hero-button {
    opacity: 0;
}

.hero-headline {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--primary-dark);
    display: block;
}

.headline-line {
    display: block;
    overflow: hidden;
}

.headline-line > span {
    display: block;
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.6s cubic-bezier(0.215, 0.61, 0.355, 1), opacity 0.6s ease;
}

.headline-line.is-visible > span {
    transform: translateY(0);
    opacity: 1;
}

.hero-subheadline {
    font-size: 1.25rem;
    color: #555;
    margin-bottom: 2rem;
    transition: opacity 1.2s ease-in;
}

.hero-subheadline.is-visible {
    opacity: 1;
}

/* --- Intro Section --- */
.intro-section {
    padding: 6rem 2rem;
    overflow-x: hidden;
    background: var(--neutral-light);
}

.intro-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 3rem;
    align-items: center;
    max-width: 1100px;
    margin: 0 auto;
}

.intro-photo {
    position: relative;
}

.intro-text {
    position: relative;
}

.intro-photo img {
    width: 100%;
    border-radius: 50%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.intro-text h2 {
    font-size: 2.2rem;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 1rem;
    line-height: 1.3;
}

.intro-text p {
    font-size: 1.1rem;
    color: #555;
    margin-bottom: 2rem;
}

/* --- Services Panel Section --- */
.services-summary-section {
    padding: 4rem 2rem;
}

.services-panel {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 3rem;
    max-width: 1100px;
    margin: 0 auto;
    background-color: #fff;
    border: 1px solid #eaeaea;
    border-radius: 12px;
    padding: 2rem;
}

.service-tabs {
    list-style: none;
    padding: 0;
    margin: 0;
}

.service-tab {
    padding: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 4px solid transparent;
    position: relative;
}

.progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 0;
    background-color: var(--primary-accent);
}

.service-tab.active .progress-bar {
    animation: fillProgress 5s linear forwards;
}

.service-tab:hover {
    background-color: var(--neutral-light);
}

.service-tab.active {
    background-color: var(--neutral-light);
    color: var(--primary-dark);
    border-left: 4px solid var(--primary-accent);
}

.service-content-panes {
    position: relative;
    min-height: 320px;
}

.service-pane {
    position: absolute;
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.service-pane-text {
    flex: 1;
}

.service-pane img {
    max-width: 120px;
    flex-shrink: 0;
    margin-top: 1rem;
}

.service-pane.active {
    opacity: 1;
    pointer-events: auto;
}

.service-pane h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
}


/* --- Tech Stack Section --- */
.stack-section {
    padding: 8rem 2rem;
    background-color: var(--neutral-light);
    clip-path: polygon(0 10%, 100% 0, 100% 90%, 0 100%);
}

.stack-logos {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4rem;
    flex-wrap: wrap;
    max-width: 800px;
    margin: 0 auto;
}

.stack-logos a {
    display: inline-block;
    transition: transform 0.3s ease;
}
.stack-logos a:hover {
    transform: scale(1.1);
}

.stack-logo {

    max-height: 60px;
    width: auto;
    opacity: 0;
    filter: grayscale(100%);
    transform: translateY(20px);
    transition: all 0.5s ease;
}

.stack-logo.visible {

    opacity: 1;
    filter: grayscale(0%);
    transform: translateY(0);
}


/* --- Portfolio Section --- */
.portfolio-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 3rem;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.portfolio-text h3 {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 1rem;
}

.portfolio-text p {
    font-size: 1.1rem;
    color: #555;
    margin-bottom: 2rem;
    line-height: 1.7;
}

@media (max-width: 900px) {
    .portfolio-grid {
        grid-template-columns: 1fr;
    }

    .portfolio-text {
        text-align: center;
    }
}

/* --- Latest Posts Section --- */
.latest-posts-section {
    padding: 6rem 2rem;
}

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

.card .read-more {
    font-weight: 600;
    color: var(--primary-dark);
}

.card .read-more:hover {
    transform: scale(1.1);
}

/* --- Scroll Animation Triggers --- */
.animations-ready .hero-headline {
    animation: fadeIn 0.8s ease-out forwards;
}

.animations-ready .hero-subheadline {
    animation: fadeIn 0.8s 0.3s ease-out forwards;
}

.animations-ready .hero-button {
    animation: fadeIn 0.8s 0.6s ease-out forwards;
}

.intro-photo.hidden, .intro-text.hidden {
    opacity: 0;
    transition: all 0.8s ease-out;
}

.intro-photo.hidden {
    transform: translateX(-50px);
}

.intro-text.hidden {
    transform: translateX(50px);
    transition-delay: 0.2s;
}

.intro-photo.visible,
.intro-text.visible {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

@media (min-width: 1200px) {
  .service-content-panes {
    min-height: 0;
    max-height: 220px;
    overflow-y: auto;
  }
}

/* --- Tablet Responsiveness --- */
@media (max-width: 900px) {
    .services-panel {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .service-pane {
        width: 100%;
        height: 100%;
        box-sizing: border-box;
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }

    .service-pane img {
        margin-top: 1rem;
        width: 100%;
        max-width: 100px;
    }
}

/* --- Small Mobile Screen Responsiveness --- */
@media (max-width: 480px) {
    html {
        font-size: 14px;
    }

    .portfolio-section,
    .intro-section,
    .stack-section,
    .services-summary-section,
    .page-container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .hero-headline,
    .page-header h1,
    .about-intro h1 {
        font-size: 2.5rem;
    }

    .interactive-cta h2 {
        font-size: 1.8rem;
    }
}

@media (max-width: 900px) {
    .service-pane {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }

    .service-pane img {
        margin-top: 1rem;
        width: 100%;
        max-width: 100px;
    }
}
