/* ======================================
   Navbar
   ====================================== */
.navbar {
    background-color: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    transition: all var(--transition);
    position: sticky;
    top: 0;
    z-index: 1000;
}

body.dark-mode .navbar {
    background-color: var(--surface);
    border-bottom-color: var(--border);
}

.navbar-brand {
    font-size: 1.25rem;
    color: var(--text) !important;
}

.text-accent {
    color: var(--accent-text) !important;
}

.nav-link {
    color: var(--text) !important;
    font-weight: 500;
    padding: 0.5rem 0.75rem !important;
    position: relative;
    transition: color var(--transition);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width var(--transition);
}

.nav-link:hover::after {
    width: 80%;
}

.nav-link:hover {
    color: var(--accent-text) !important;
}

.navbar-toggler {
    border-color: var(--border);
}

/* ======================================
   Hamburger Menu Animation
   ====================================== */
.hamburger-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 6px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
}

.hamburger-btn:focus {
    box-shadow: 0 0 0 0.2rem rgba(56, 161, 105, 0.35);
    outline: none;
}

.hamburger-bar {
    display: block;
    width: 22px;
    height: 2px;
    background-color: var(--text);
    border-radius: 2px;
    transition: transform 0.35s ease, opacity 0.25s ease, width 0.35s ease;
    transform-origin: center;
}

/* Open state: top bar rotates to \ , middle fades out, bottom rotates to / */
.hamburger-btn[aria-expanded="true"] .hamburger-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger-btn[aria-expanded="true"] .hamburger-bar:nth-child(2) {
    opacity: 0;
    width: 0;
}

.hamburger-btn[aria-expanded="true"] .hamburger-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ======================================
   Hero Section
   ====================================== */
.hero-section {
    background: var(--hero-gradient);
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 0;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 700px;
    margin: 0 auto;
    /* Entrance animation */
    animation: heroFadeUp 0.6s ease both;
}

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

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 0.25rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.hero-subtitle {
    font-size: 1.5rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1rem;
}

.hero-desc {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 2rem;
    line-height: 1.7;
}

.hero-cta .btn {
    margin-bottom: 0.5rem;
}

@media (min-width: 768px) {
    .hero-title {
        font-size: 4rem;
    }

    .hero-subtitle {
        font-size: 1.75rem;
    }
}

/* ======================================
   Skills Section
   ====================================== */
.skills-section {
    background-color: var(--background);
}

.skill-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem 1.5rem;
    text-align: center;
    transition: all var(--transition);
    box-shadow: 0 2px 8px var(--shadow);
}

.skill-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px var(--shadow);
    border-color: var(--accent);
}

.skill-icon {
    font-size: 2.5rem;
    color: var(--accent);
    margin-bottom: 1rem;
}

.skill-card h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text);
}

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

.skill-tag {
    display: inline-block;
    background: var(--background);
    color: var(--text);
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    margin: 0.25rem;
    border: 1px solid var(--border);
    transition: all var(--transition);
}

.skill-card:hover .skill-tag {
    background: var(--accent-on-fill);
    color: #fff;
    border-color: var(--accent-on-fill);
}

/* ======================================
   Projects Section
   ====================================== */
.projects-section {
    background-color: var(--background);
}

body.dark-mode .projects-section {
    background-color: var(--surface);
}

.project-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    box-shadow: 0 2px 8px var(--shadow);
    will-change: transform;
}

.project-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 28px var(--shadow);
    border-color: var(--accent);
}

.project-image {
    height: 160px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.8);
    transition: all var(--transition);
}

.project-card:hover .project-image {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--accent-on-fill) 100%);
    color: #fff;
}

.project-info {
    padding: 1.25rem;
}

.project-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.project-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.project-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.project-stack span {
    display: inline-block;
    background: var(--accent-on-fill);
    color: #fff;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* ======================================
   Projects Carousel
   ====================================== */
.projects-slider {
    overflow: hidden;
    position: relative;
    /* Vertical padding gives hovering cards room to lift/shadow without clipping */
    padding-top: 12px;
    margin-top: -12px;
    padding-bottom: 20px;
    margin-bottom: -20px;
    /* Fade edges for a natural bleed effect */
    mask-image: linear-gradient(
        to right,
        transparent 0%,
        #000 8%,
        #000 92%,
        transparent 100%
    );
    -webkit-mask-image: linear-gradient(
        to right,
        transparent 0%,
        #000 8%,
        #000 92%,
        transparent 100%
    );
}

.projects-track {
    display: flex;
    gap: 1.5rem;
    width: max-content;
    animation: scrollProjects 45s linear infinite;
}

.projects-track .project-card {
    min-width: 320px;
    max-width: 350px;
    flex: 0 0 auto;
}

@keyframes scrollProjects {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* Pause scroll on hover, or when a card inside receives keyboard focus, so keyboard
   and touch users can stop the motion — not just mouse users (WCAG 2.2.2). */
.projects-slider:hover .projects-track,
.projects-slider:focus-within .projects-track {
    animation-play-state: paused;
}

/* ======================================
   Projects Index Page (/Projects)
   ====================================== */
.projects-index-section {
    background-color: var(--background);
    min-height: calc(100vh - 64px);
}

body.dark-mode .projects-index-section {
    background-color: var(--surface);
}

.projects-back-link {
    font-size: 0.875rem;
    color: var(--text-muted);
    transition: color var(--transition);
}

.projects-back-link:hover {
    color: var(--accent);
}

/* ======================================
   About Section
   ====================================== */
.about-section {
    background-color: var(--background);
}

.about-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: 0 4px 16px var(--shadow);
}

.about-card p {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text);
    margin-bottom: 1rem;
}

.about-card strong {
    color: var(--accent-text);
}

/* ======================================
   Résumé Section
   --------------------------------------
   Deliberately identical to the About section: --background behind, one
   --surface card on top. That is what "like every other section" means here
   — Skills, Projects and About all stack on --background and rely on their
   heading plus card for separation, so this one does too.
   ====================================== */
.resume-section {
    background-color: var(--background);
}

.resume-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem 2.5rem;
    box-shadow: 0 4px 16px var(--shadow);
}

.resume-lead {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text);
    text-align: center;
    margin: 0 0 1.5rem;
}

.resume-card .resume-meta {
    margin: 1.25rem 0 0;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.resume-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}

@media (max-width: 575.98px) {
    .resume-card {
        padding: 1.5rem 1.25rem;
    }

    .resume-actions .btn {
        width: 100%;
    }
}

/* ======================================
   Contact Section
   ====================================== */
.contact-section {
    background: var(--hero-gradient);
    color: #fff;
}

.contact-section .section-title {
    color: #fff;
}

.contact-section .section-title::after {
    background: #fff;
}

.contact-section p {
    color: rgba(255, 255, 255, 0.85);
}

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.contact-link {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: #fff;
    font-size: 1.1rem;
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    transition: all var(--transition);
    min-width: 200px;
    justify-content: center;
}

.contact-link:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    transform: translateY(-3px);
}

.contact-link i {
    font-size: 1.25rem;
}

/* ======================================
   Footer
   ====================================== */
.site-footer {
    background: var(--primary);
    color: rgba(255, 255, 255, 0.8);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.footer-links a {
    /* The glyphs are 21-23px wide, so the link box was under the 24x24 target
       minimum. Padding to a square hit area rather than scaling the icon. */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.75rem;
    min-height: 2.75rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.5rem;
    transition: all var(--transition);
}

.footer-links a:hover {
    /* --accent is only 3.72:1 against the footer's --primary; the lighter
       tint clears 4.9:1 and reads better on a dark ground anyway. */
    color: var(--accent-light);
    transform: translateY(-3px);
}

.footer-text-link {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 0.15em;
    transition: color var(--transition);
}

.footer-text-link:hover,
.footer-text-link:focus-visible {
    color: var(--accent-light);
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1 0 auto;
}

.site-footer {
    flex-shrink: 0;
}