/* Hero Section */
.hero {
    min-height: 40vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    padding-top: 8vh;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-title {
    margin-bottom: 1.5rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.hero-tagline {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Services Section */
.services {
    padding: 2rem 0 4rem;
}

.section-title {
    font-size: 2.5rem;
    color: var(--rust-primary);
    letter-spacing: 0.2em;
    margin-bottom: 3rem;
    text-transform: uppercase;
    opacity: 0.8;
    text-align: center;
}

.services-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.service-item {
    display: grid;
    grid-template-columns: 4rem 1fr 3rem;
    align-items: flex-start;
    padding: 2rem;
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    background: var(--bg-surface);
    position: relative;
    overflow: hidden;
}

.service-item:hover {
    background: var(--bg-card);
    border-color: var(--rust-primary);
}

/* Glowing accent bar on left */
.service-item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--rust-primary);
    transform: scaleY(0);
    transition: transform 0.4s ease;
    transform-origin: center;
}

.service-item:hover::before {
    transform: scaleY(1);
}

.service-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    /* Same as the grid column width */
    height: 3rem;
    padding-top: 0.25rem;
}

.service-icon {
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0.8;
    transition:
        opacity 0.3s ease,
        transform 0.3s ease;
    filter: drop-shadow(0 0 5px rgba(206, 66, 43, 0.3));
    /* Rust glow */
}

.service-item:hover .service-icon {
    opacity: 1;
    transform: scale(1.1);
    filter: drop-shadow(0 0 8px rgba(206, 66, 43, 0.6));
}

.service-content {
    padding-right: 2rem;
}

.service-title {
    font-family: "interbureautitle", sans-serif;
    /* Overriding mokoto for readability if needed, or keep mokoto */
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    transition: color 0.3s ease;
}

.service-item:hover .service-title {
    color: var(--rust-accent);
    text-shadow: 0 0 20px rgba(206, 66, 43, 0.4);
}

.service-description {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 300;
    margin-bottom: 0;
    transition: opacity 0.3s ease;
}

.service-details {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.4s ease-out;
    opacity: 0;
}

.service-details.expanded {
    grid-template-rows: 1fr;
    opacity: 1;
    margin-top: 1.5rem;
}

.service-details > p {
    overflow: hidden;
    color: var(--text-secondary);
    font-size: 1.1rem;
    /* Increased from 0.95rem */
    line-height: 1.7;
    white-space: pre-line;
}

.service-action {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    height: 100%;
}

.service-arrow {
    font-size: 1.5rem;
    color: var(--text-secondary);
    transition:
        transform 0.4s ease,
        color 0.3s ease;
}

.service-item:hover .service-arrow {
    transform: translateX(5px);
    color: var(--rust-primary);
}

@media (max-width: 768px) {
    .service-item {
        grid-template-columns: 1fr auto;
        padding: 1.5rem 0;
    }

    .service-index {
        display: none;
    }

    .service-title {
        font-size: 1.25rem;
    }
}

/* Contact Section */
.contact {
    /* background-color: var(--bg-primary); Removed to show particles */
}

.contact-form {
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.contact-form button[type="submit"] {
    width: 100%;
    margin-top: 1rem;
}

.status-message {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    text-align: center;
    font-weight: 500;
}

.status-message.success {
    background-color: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

.status-message.error {
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

/* Tech Stack Showcase Slider */
.tech-stack {
    padding: 4rem 0;
    overflow: hidden;
}

.tech-slider {
    position: relative;
    width: 100%;
    margin-top: 3rem;
    overflow: hidden;
}

/* Gradient fades for the edges */
.tech-slider::before,
.tech-slider::after {
    content: "";
    position: absolute;
    top: 0;
    width: 100px;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

.tech-slider::before {
    left: 0;
    background: linear-gradient(to right, var(--bg-primary), transparent);
}

.tech-slider::after {
    right: 0;
    background: linear-gradient(to left, var(--bg-primary), transparent);
}

.tech-slider-track {
    display: flex;
    width: max-content;
    animation: scroll 30s linear infinite;
}

.tech-slider:hover .tech-slider-track {
    animation-play-state: paused;
}

.tech-slide {
    width: 300px;
    /* Fixed width for stability */
    flex-shrink: 0;
    padding: 0 1rem;
}

@media (max-width: 768px) {
    .tech-slide {
        width: 250px;
    }
}

@media (max-width: 480px) {
    .tech-slide {
        width: 200px;
    }
}

.tech-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    transition: var(--transition);
    text-align: center;
    height: 100%;
    cursor: pointer;
}

.tech-card:hover {
    border-color: var(--rust-primary);
    background: var(--bg-card);
    box-shadow: 0 4px 15px rgba(206, 66, 43, 0.15);
}

.tech-icon-wrapper {
    width: 3rem;
    height: 3rem;
    margin-bottom: 1rem;
    color: var(--rust-primary);
}

.tech-icon {
    width: 100%;
    height: 100%;
}

.tech-name {
    font-family: "interbureautitle", sans-serif;
    font-weight: 600;
    color: var(--text-primary);
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }

    100% {
        /* Move by half the track width (the original list length) */
        transform: translateX(-50%);
    }
}

.tech-description-container {
    margin-top: 2rem;
    position: relative;
    min-height: 250px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 0;
}

.tech-description-content {
    width: 100%;
    max-width: 900px;
    position: relative;
    text-align: center;
    min-height: 200px;
}

.particles-wrapper {
    position: relative;
    z-index: 2;
    pointer-events: none;
    animation: fadeOutSlow 3.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.real-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    font-family: "interbureautitle", sans-serif;
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    line-height: 1.6;
    font-weight: 400;
    color: var(--text-primary);
    opacity: 0;
    z-index: 1;
    animation: fadeInDelayed 3.5s ease-in-out forwards;
    padding: 0 1rem;
}

@keyframes fadeInDelayed {
    0% {
        opacity: 0;
        filter: blur(5px);
        transform: translate(-50%, -45%);
    }
    40% {
        opacity: 0;
        filter: blur(5px);
        transform: translate(-50%, -45%);
    }
    100% {
        opacity: 1;
        filter: blur(0);
        transform: translate(-50%, -50%);
    }
}

@keyframes fadeOutSlow {
    0% {
        opacity: 0.8;
    }
    65% {
        opacity: 0.8;
    }
    100% {
        opacity: 0;
    }
}

.close-description {
    position: absolute;
    top: -1rem;
    right: 0;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-description:hover {
    color: var(--rust-primary);
}

.text-particles-canvas {
    width: 100%;
    height: 200px;
    background: transparent;
}

/* Process Section */
.process {
    padding: 4rem 0;
}

.process-steps {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    margin-top: 3rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.process-step {
    display: flex;
    align-items: flex-start;
    gap: 2rem;
    position: relative;
    padding: 1.5rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    transition: var(--transition);
}

.process-step:hover {
    border-color: var(--rust-primary);
}

.process-step:not(:last-child)::after {
    content: "";
    position: absolute;
    left: 2.75rem;
    top: 4.5rem;
    bottom: -2.5rem;
    width: 2px;
    background: var(--border-color);
}

.step-number {
    width: 3rem;
    height: 3rem;
    background: var(--rust-primary);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "mokoto", sans-serif;
    font-size: 1.25rem;
    flex-shrink: 0;
    z-index: 1;
}

.step-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.step-description {
    font-family: "interbureautitle", sans-serif;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 300;
    line-height: 1.7;
}
.footer {
    background: var(--bg-surface);
    padding: 2rem 0;
    margin-top: 5rem;
    border-top: 2px solid var(--rust-primary);
}

.footer-content {
    text-align: center;
}

.footer-text {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.footer-tagline {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

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

    .hero {
        min-height: 50vh;
    }
}

/* Modal Dialog */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background-color: var(--bg-surface);
    border: 1px solid var(--rust-primary);
    border-radius: 1rem;
    padding: 2rem;
    max-width: 90%;
    width: 400px;
    box-shadow: 0 0 30px rgba(206, 66, 43, 0.2);
    animation: slideUp 0.3s ease-out;
    text-align: center;
}

.modal-title {
    font-family: "mokoto", sans-serif;
    color: var(--text-primary);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    letter-spacing: 0.1em;
}

.modal-body {
    font-family: "interbureautitle", sans-serif;
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.modal-footer {
    display: flex;
    justify-content: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Typewriter specific styles */
.typewriter-text {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.cursor {
    display: inline-block;
    width: 8px;
    background-color: var(--rust-primary);
    animation: blink 1s step-end infinite;
    margin-left: 2px;
}

@keyframes blink {
    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.service-full-description .typewriter-text {
    font-family: "interbureautitle", sans-serif;
}

/* Force canvas to be between background and content */
.particles-canvas {
    z-index: 0 !important;
}

/* ─────────────────────────────────────────────
   Scroll Reveal Animations
   ───────────────────────────────────────────── */
.section-reveal {
    opacity: 0;
}

.section-reveal.revealed {
    animation: revealUp 0.7s ease-out forwards;
}

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