/* Apple Herald - Premium Typography & Design System */
*, ::after, ::before {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    transition: background-color 0.3s ease, color 0.3s ease;
    scroll-behavior: smooth;
}

body {
    transition: background-color 0.3s ease, color 0.3s ease;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Poppins', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.5;
}

:root {
    /* Original vars preserved */
    --primary-color: #123451;
    --second-color: #1e3a5f;
    --accent: #2f4f6f;
    --dark: #0d1117;
    --noir: #000;
    --blanc-cass-alt: #f2f4f7;
    --border-color: #265797;
    --blanc-cass: #a6adb5;
    --blanc-pur: #fff;
    --box-shadow: 0 5px 5px rgba(112, 112, 112, 0.3);

    /* Theme vars - Dark base with #123451 background */
    --bg-primary: #123451;
    --bg-secondary: #0a0a0a;
    --text-primary: #f5f5f7;
    --text-secondary: #86868b;
    --accent-primary: #2997ff;
    --accent-secondary: #0a84ff;
    --border: rgba(255, 255, 255, 0.15);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    --glass-bg: rgba(18, 52, 81, 0.85);
    --logo-filter: brightness(0) invert(1);
}

[data-theme="light"] {
    /* Apple premium light */
    --bg-primary: #f5f5f7;
    --bg-secondary: #ffffff;
    --text-primary: #1d1d1f;
    --text-secondary: #6e6e73;
    --accent-primary: #007aff;
    --accent-secondary: #34c759;
    --border: rgba(0, 0, 0, 0.1);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    --glass-bg: rgba(255, 255, 255, 0.85);
    --logo-filter: none;
}

[data-theme="dark"] {
    /* Dark mode with #123451 body bg */
    --bg-primary: #123451;
    --bg-secondary: #0a0a0a;
    --glass-bg: rgba(18, 52, 81, 0.9);
    --logo-filter: brightness(0) invert(1);
}

/* Header - Apple premium glassmorphism */
header {
    position: sticky;
    top: 0;
    width: 100%;
    padding: 1rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    z-index: 1000;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    
}

/* Header scroll effect */
header.scrolled {
    padding: 0.75rem 5%;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.15);
}

.logo {
    display: flex;
    align-items: center;
    gap: clamp(0.5rem, 2vw, 0.75rem);
    font-size: clamp(1.4rem, 4vw, 2rem);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.logo span {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: all 0.4s ease;
}

.logo img {
    height: 45px;
    width: auto;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: filter 0.4s ease, transform 0.3s ease;
}

.logo:hover img {
    transform: scale(1.05) rotate(-2deg);
}

header ul {
    display: flex;
    list-style: none;
    gap: 2.5rem;
    margin: 0;
}

header ul li a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0.5rem 0;
    font-size: clamp(0.875rem, 2.5vw, 1.1rem);
    font-family: inherit;
    letter-spacing: -0.01em;
}

header ul li a:hover {
    color: var(--accent-primary);
    transform: translateY(-2px),scale(1.3);
    
}

header ul li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
    border-radius: 2px;
}

header ul li a:hover::after {
    width: 100%;
}

/* Active nav link */
header ul li a.active {
    color: var(--accent-primary);
}

header ul li a.active::after {
    width: 100%;
}

.btn-mode {
    position: relative;
    width: clamp(140px, 20vw, 200px);
    height: clamp(50px, 8vw, 60px);
}

.btn-mode button {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    border-radius: 30px;
    cursor: pointer;
    font-weight: 500;
    font-size: clamp(0.8rem, 3vw, 0.95rem);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    letter-spacing: 0.3px;
    opacity: 0;
    transform: scale(0.95) translateY(4px);
    z-index: 1;
    pointer-events: none;
    border: 1px solid var(--border-color);
}

/* Light mode: show sombre button, hide claire button */
[data-theme="light"] #btn-sombre {
    opacity: 1;
    z-index: 2;
    pointer-events: auto;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] #btn-sombre:hover {
    background: var(--accent-primary);
    color: #fff;
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 122, 255, 0.35);
}

[data-theme="light"] #btn-claire {
    pointer-events: none;
    opacity: 0;
}

/* Dark mode: show claire button, hide sombre button */
[data-theme="dark"] #btn-claire {
    opacity: 1;
    transform: scale(1) translateY(0);
    z-index: 2;
    pointer-events: auto;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] #btn-claire:hover {
    background: var(--accent-primary);
    color: #fff;
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(41, 151, 255, 0.4);
}

[data-theme="dark"] #btn-sombre {
    pointer-events: none;
    opacity: 0;
}

[data-theme="dark"] #btn-sombre {
    pointer-events: none;
}

.btn-mode button:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    box-shadow: 0 8px 25px rgba(0, 122, 255, 0.15);
    transform: translateY(-1px);
}

/* Active button styling */
.btn-mode button[style*="display: block"],
.btn-mode button:not([style*="display: none"]) {
    background: var(--accent-primary);
    color: var(--bg-secondary);
    border-color: var(--accent-primary);
    box-shadow: 0 8px 25px rgba(0, 122, 255, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
    header {
        padding: 1rem 3%;
        flex-direction: column;
        gap: 1rem;
    }
    header ul {
        gap: 1.5rem;
    }
    .logo {
        font-size: 1.5rem;
    }
}

/* Portfolio Pro 2026 Complete Styles */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 5%;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    overflow: hidden;
    
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--second-color) 100%);
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease-out;
    filter: drop-shadow(0 20px 40px rgba(0,0,0,0.3));
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(18, 52, 81, 0.377) 0%, rgba(30, 58, 95, 0.466) 100%);
    z-index: 1;
    pointer-events: none;
}

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

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    color: var(--text-primary);
    text-shadow: #f1f1f1;
    text-align: center;
    padding: 2rem;
}
.hero-content p{
    color: white;
}

.typewriter {
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.1;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: #1d1d1f;
}

.typewriter::after {
    content: '|';
    animation: blink 2s infinite;
}

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

.subtitle {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 400;
    margin-bottom: 1rem;
    opacity: 0.9;
    
}

.bio-short {
    font-size: 1.3rem;
    margin-bottom: 3rem;
    opacity: 0.8;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.cta-btn {
    display: inline-block;
    padding: 1.2rem 3rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: var(--bg-secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.2rem;
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(41, 151, 255, 0.4);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.cta-btn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 20px 40px rgba(41, 151, 255, 0.6);
}

/* About */
.about {
    padding: 120px 0;
    background: var(--bg-secondary);
}

.about h2 {
    text-align: center;
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: 4rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.profile-img img {
    width: 100%;
    border-radius: 20px;
    box-shadow: var(--shadow);
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.profile-img:hover img {
    transform: scale(1.05) rotate(3deg);
}

.about-text p {
    font-size: 1.2rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

/* Skills */
.skills {
    padding: 120px 0;
}

.skills h2 {
    text-align: center;
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: 4rem;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.skill-item {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    padding: 2rem;
    border-radius: 20px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: all 0.4s ease;
}

.skill-item:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow);
}

.skill-item i {
    font-size: 3rem;
    color: var(--accent-primary);
    align-self: center;
}

.skill-item span {
    font-size: 1.4rem;
    font-weight: 600;
    text-align: center;
}

.skill-bar {
    height: 8px;
    background: var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.skill-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    width: 0%;
    border-radius: 10px;
    transition: width 2s ease-out;
}

/* Experience */
.experience {
    padding: 120px 0;
    background: var(--bg-primary);
}

.experience h2 {
    text-align: center;
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: 4rem;
}

.timeline {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--accent-primary);
    transform: translateX(-50%);
}

.timeline-item {
    margin-bottom: 4rem;
    position: relative;
}

.timeline-icon {
    position: absolute;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
    width: 60px;
    height: 60px;
    background: var(--accent-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    box-shadow: 0 10px 20px rgba(41, 151, 255, 0.4);
}

.timeline-content {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    padding: 2rem;
    border-radius: 20px;
    border: 1px solid var(--border);
    width: 45%;
    margin: 0;
}

.timeline-item:nth-child(odd) .timeline-content {
    margin-left: 55px;
}

.timeline-item:nth-child(even) .timeline-content {
    margin-right: 55px;
    text-align: right;
}

.date {
    color: var(--accent-primary);
    font-weight: 600;
}

/* Projects */
.projects {
    padding: 120px 0;
}

.projects h2 {
    text-align: center;
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: 4rem;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.project-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(0) rotateX(0deg);
    transform-style: preserve-3d;
}

.project-card:hover {
    transform: translateY(-20px) rotateX(10deg) rotateY(10deg);
    box-shadow: 0 30px 60px rgba(0,0,0,0.3);
}

.project-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.project-card:hover img {
    transform: scale(1.1);
}

.project-info {
    padding: 2rem;
}

.project-links-card {
    margin-top: 1rem;
}

.btn-github {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    background: var(--accent-primary);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-github:hover {
    background: var(--accent-secondary);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(41, 151, 255, 0.4);
}

.project-info h3 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.project-info p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tech-tags span {
    background: var(--accent-primary);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(10px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--glass-bg);
    backdrop-filter: blur(30px);
    border-radius: 20px;
    padding: 3rem;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    border: 1px solid var(--border);
}

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

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

.modal-content img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 15px;
    margin: 1.5rem 0;
}

.project-links a {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.8rem 2rem;
    background: var(--accent-primary);
    color: white;
    text-decoration: none;
    border-radius: 30px;
    transition: all 0.3s ease;
}

.project-links a:hover {
    background: var(--accent-secondary);
    transform: translateY(-2px);
}

/* Contact */
.contact {
    padding: 120px 0;
    background: var(--bg-secondary);
}

.contact h2 {
    text-align: center;
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: 4rem;
}

.contact-form {
    max-width: 600px;
    margin: 0 auto 3rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contact-form input,
.contact-form textarea {
    padding: 1.2rem;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(41, 151, 255, 0.1);
}

.contact-form button {
    padding: 1.2rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.contact-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(41, 151, 255, 0.4);
}

.contact-form button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.hp-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.form-status {
    min-height: 1.2rem;
    font-weight: 600;
    font-size: 0.95rem;
}

.form-status.is-success {
    color: #17ce82;
}

.form-status.is-error {
    color: #ff6b6b;
}

.info {
    text-align: center;
    padding: 0.5rem;
    margin-bottom: 1rem;
    border-radius: 10px;
    color: #ffffff;
    background: #d13a3ab6;
    transform: translateY(10px);
    transition: all .7s ease;
    font-weight: bold;
}

.info-succes {
    text-align: center;
    padding: 0.5rem;
    margin-bottom: 1rem;
    border-radius: 10px;
    color: #ffffff;
    background: #17ce82c4;
    transform: translateY(10px);
    transition: all .7s ease;
    font-weight: bold;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: var(--glass-bg);
    border-radius: 50%;
    color: var(--text-primary);
    font-size: 1.5rem;
    transition: all 0.3s ease;
    border: 1px solid var(--border);
}

.social-links a:hover {
    background: var(--accent-primary);
    color: white;
    transform: translateY(-5px) scale(1.1);
}

/* Footer */
footer {
    background: var(--noir);
    padding: 2rem 0;
    text-align: center;
    color: var(--text-secondary);
}

/* Responsive Additional */
@media (max-width: 768px) {
    .about-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }

    .timeline::before {
        left: 20px;
    }

    .timeline-item:nth-child(odd) .timeline-content,
    .timeline-item:nth-child(even) .timeline-content {
        width: calc(100% - 80px);
        margin-left: 60px !important;
        margin-right: 0 !important;
    }

    .timeline-icon {
        left: 20px;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .hero-content {
        padding: 1rem;
    }
}

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