/* ============================================================
   main.css — Portfolio Arnaud Pradines
   ============================================================ */

/* --- Variables ------------------------------------------- */
:root {
    --primary:        #0a6894;
    --primary-dark:   #07506f;
    --primary-light:  #e4f2fb;
    --hero-start:     #071c35;
    --hero-end:       #0a5278;
    --text:           #1a2638;
    --text-muted:     #5c6b80;
    --white:          #ffffff;
    --bg:             #f1f7fb;
    --border:         #d8e9f7;
    --radius:         14px;
    --radius-sm:      8px;
    --radius-pill:    100px;
    --shadow:         0 4px 20px rgba(0, 50, 100, 0.10), 0 1px 4px rgba(0, 50, 100, 0.06);
    --shadow-lg:      0 8px 40px rgba(0, 50, 100, 0.13), 0 2px 8px rgba(0, 50, 100, 0.07);
    --transition:     0.2s ease;
}

/* --- Reset ----------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

/* --- Base ------------------------------------------------ */
body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 15.5px;
    margin: 0;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; }
h1, h2, h3 { line-height: 1.3; }

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

*:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
    border-radius: 3px;
}

/* --- Main layout ----------------------------------------- */
main {
    padding: 1.5em 1em;
}

/* --- Navigation ------------------------------------------ */
.nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.4em;
    flex-wrap: wrap;
    padding: 0.5em 1em 1.4em;
}

.nav a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.45em 1.2em;
    border-radius: var(--radius-pill);
    border: 2px solid transparent;
    transition: all var(--transition);
    letter-spacing: 0.02em;
}

.nav a:hover, .nav a:focus-visible {
    background: var(--primary-light);
    border-color: var(--primary);
    outline: none;
}

.nav a.active, .nav a[aria-current="page"] {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

/* --- Container ------------------------------------------- */
.container {
    max-width: 720px;
    margin: 0 auto 3em;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    text-align: center;
    animation: fadeInUp 0.45s ease-out both;
}

.container-body {
    padding: 2em 2.5em 2.5em;
}

/* --- Hero (home profile header) -------------------------- */
.profile-header {
    background: linear-gradient(150deg, var(--hero-start) 0%, var(--hero-end) 100%);
    padding: 3em 2em 2.5em;
    position: relative;
}

.profile-header::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 15% 50%, rgba(255,255,255,0.05) 0%, transparent 55%),
        radial-gradient(circle at 85% 15%, rgba(255,255,255,0.06) 0%, transparent 45%),
        radial-gradient(circle, rgba(255,255,255,0.07) 1px, transparent 1px);
    background-size: auto, auto, 22px 22px;
    pointer-events: none;
}

.profile-pic {
    border-radius: 50%;
    width: 120px;
    height: 120px;
    border: 3px solid rgba(255,255,255,0.25);
    box-shadow: 0 0 0 6px rgba(255,255,255,0.08), 0 8px 32px rgba(0,0,0,0.35);
    display: block;
    margin: 0 auto 1.2em;
    transition: transform var(--transition), box-shadow var(--transition);
    position: relative;
    z-index: 1;
}

.profile-pic:hover {
    transform: scale(1.04);
    box-shadow: 0 0 0 6px rgba(255,255,255,0.18), 0 12px 40px rgba(0,0,0,0.45);
}

.profile-name {
    color: var(--white);
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 0.3em;
    letter-spacing: -0.025em;
    position: relative;
    z-index: 1;
}

.profile-title {
    display: inline-block;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--radius-pill);
    padding: 0.28em 1.1em;
    color: rgba(255,255,255,0.9);
    font-size: 0.72rem;
    font-weight: 600;
    margin: 0 0 0.7em;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    position: relative;
    z-index: 1;
}

.profile-tagline {
    color: rgba(255,255,255,0.5);
    font-size: 0.82rem;
    margin: 0;
    position: relative;
    z-index: 1;
    letter-spacing: 0.03em;
}

/* --- Page hero (cv, contact) ----------------------------- */
.page-hero {
    background: linear-gradient(150deg, var(--hero-start) 0%, var(--hero-end) 100%);
    padding: 2.2em 2em;
    position: relative;
}

.page-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 15% 50%, rgba(255,255,255,0.05) 0%, transparent 60%),
        radial-gradient(circle, rgba(255,255,255,0.06) 1px, transparent 1px);
    background-size: auto, 22px 22px;
    pointer-events: none;
}

.page-hero h1 {
    color: var(--white);
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.02em;
    position: relative;
    z-index: 1;
}

/* --- Section headings ------------------------------------ */
h2 {
    color: var(--text);
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 2em 0 1em;
    padding-bottom: 0.65em;
    border-bottom: 2px solid var(--border);
    text-align: left;
    display: flex;
    align-items: center;
    gap: 0.55em;
}

h2::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 1em;
    background: var(--primary);
    border-radius: 2px;
    flex-shrink: 0;
}

/* --- Intro section --------------------------------------- */
.intro {
    font-size: 0.975rem;
    line-height: 1.78;
    text-align: left;
    color: var(--text);
    margin-bottom: 0;
}

.intro strong {
    color: var(--primary-dark);
    font-weight: 600;
}

.intro a {
    color: var(--primary);
    text-decoration: underline;
    text-decoration-color: var(--border);
    text-underline-offset: 3px;
    transition: text-decoration-color var(--transition);
}

.intro a:hover, .intro a:focus-visible {
    text-decoration-color: var(--primary);
    outline: none;
}

/* --- Highlights section ---------------------------------- */
.highlights {
    background: var(--primary-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1.3em 1.5em;
    margin-top: 1.8em;
    text-align: left;
}

.highlights h2 {
    margin-top: 0;
    font-size: 0.68rem;
}

.highlights ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.35em 1.5em;
}

.highlights li {
    color: var(--text);
    font-size: 0.88rem;
    padding: 0.25em 0 0.25em 1.2em;
    position: relative;
}

.highlights li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--primary);
    font-size: 0.78em;
    top: 0.22em;
}

/* --- Section wrapper (cv page) -------------------------- */
.section {
    margin-bottom: 0.25em;
}

/* --- Experience timeline --------------------------------- */
.experience-list {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
    position: relative;
}

.experience-list::before {
    content: '';
    position: absolute;
    left: 9px;
    top: 10px;
    bottom: 10px;
    width: 2px;
    background: linear-gradient(to bottom, var(--primary), var(--border));
    border-radius: 2px;
}

.experience-item {
    padding: 0 0 2.2em 2.8em;
    position: relative;
}

.experience-item:last-child {
    padding-bottom: 0;
}

.experience-item::before {
    content: '';
    position: absolute;
    left: 2px;
    top: 4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary);
    border: 3px solid var(--white);
    box-shadow: 0 0 0 2px var(--primary);
    z-index: 1;
}

.experience-header {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.8em;
    font-size: 0.92rem;
    line-height: 1.45;
    background: var(--primary-light);
    border-left: 3px solid var(--primary);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 0.65em 1em;
}

.experience-details {
    list-style: none;
    padding: 0 0 0 0.4em;
    margin: 0;
}

.experience-details li {
    position: relative;
    padding-left: 1.2em;
    margin-bottom: 0.45em;
    line-height: 1.55;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.experience-details li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--primary);
    font-size: 0.72em;
    top: 0.22em;
}

.experience-details li:last-child { margin-bottom: 0; }

/* --- Skills (pill tags) ---------------------------------- */
.skills-list {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em;
}

.skill-item {
    background: var(--primary-light);
    color: var(--primary-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 0.4em 1em;
    font-size: 0.84rem;
    font-weight: 500;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
}

.skill-item::before { content: none; }

.skill-item:hover {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

/* --- Projects, certifications, languages ---------------- */
.projects-list,
.certifications-list,
.languages-list {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 0.6em;
}

.project-item,
.certification-item,
.language-item {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75em 1.1em;
    font-size: 0.875rem;
    line-height: 1.55;
    transition: all var(--transition);
    display: flex;
    align-items: flex-start;
    gap: 0.65em;
}

.project-item::before,
.certification-item::before,
.language-item::before {
    content: '';
    width: 6px;
    height: 6px;
    min-width: 6px;
    border-radius: 50%;
    background: var(--primary);
    flex-shrink: 0;
    align-self: flex-start;
    margin-top: 0.52em;
}
.certification-item::before {
    align-self: center;
    margin-top: 0;
}

.project-item:hover,
.certification-item:hover,
.language-item:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: translateX(3px);
}

/* --- CV page wider container ----------------------------- */
.container-cv {
    max-width: 860px;
}

.cv-grid .section {
    margin-bottom: 1.5em;
}

/* --- CV two-column grid ---------------------------------- */
.cv-grid {
    display: grid;
    grid-template-columns: 1.7fr 1fr;
    gap: 0 2.5em;
    text-align: left;
}

.cv-sidebar {
    border-left: 1px solid var(--border);
    padding-left: 2.5em;
}

.cv-main > .section:first-child h2,
.cv-sidebar > .section:first-child h2 {
    margin-top: 0.5em;
}

/* --- Certification badges (Credly embeds) --------------- */
.certifications-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 1em;
    justify-content: center;
    padding: 1.2em 1em;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 1.2em;
}

.certification-item {
    align-items: center;
}

.cert-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    margin-left: auto;
    padding-left: 0.75em;
    font-weight: 500;
}

/* --- Contact page ---------------------------------------- */
.contact-info {
    text-align: center;
    padding-top: 0.5em;
}

.contact-info > p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.4em;
}

.linkedin {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    background: var(--primary);
    color: var(--white) !important;
    text-decoration: none !important;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.85em 2.2em;
    border-radius: var(--radius-pill);
    transition: all var(--transition);
    letter-spacing: 0.02em;
    box-shadow: 0 2px 12px rgba(0,119,181,0.25);
}

.linkedin:hover, .linkedin:focus-visible {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,119,181,0.35);
    outline: none;
}

/* --- Contact meta cards ---------------------------------- */
.contact-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75em;
    margin-top: 2em;
    text-align: left;
}

.contact-meta-item {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1em 1.2em;
    display: flex;
    flex-direction: column;
    gap: 0.3em;
    transition: border-color var(--transition);
}

.contact-meta-item:last-child {
    grid-column: 1 / -1;
}

.contact-meta-item:hover {
    border-color: var(--primary);
}

.contact-meta-label {
    font-size: 0.67rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--primary);
}

.contact-meta-value {
    font-size: 0.9rem;
    color: var(--text);
    font-weight: 500;
}

/* --- Language switch ------------------------------------- */
.lang-switch {
    margin-top: 2.5em;
    padding-top: 1.5em;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25em;
    font-size: 0.78rem;
    color: var(--border);
}

.lang-switch a {
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.3em 0.85em;
    border-radius: var(--radius-pill);
    border: 1px solid transparent;
    transition: all var(--transition);
    font-weight: 500;
    letter-spacing: 0.06em;
}

.lang-switch a:hover, .lang-switch a:focus-visible {
    color: var(--primary);
    border-color: var(--primary);
    outline: none;
}

.lang-switch a[aria-current="page"] {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--primary-light);
    font-weight: 600;
}

/* --- General links (body content) ----------------------- */
a:not(.nav a):not(.lang-switch a):not(.linkedin) {
    color: var(--primary);
    text-decoration: underline;
    text-decoration-color: transparent;
    text-underline-offset: 3px;
    transition: text-decoration-color var(--transition);
}

a:not(.nav a):not(.lang-switch a):not(.linkedin):hover,
a:not(.nav a):not(.lang-switch a):not(.linkedin):focus-visible {
    text-decoration-color: var(--primary);
    outline: none;
}

/* --- Animation ------------------------------------------ */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* --- Responsive ----------------------------------------- */
@media (max-width: 768px) {
    .container { margin: 0 0.75em 2em; }
    .container-body { padding: 1.5em 1.5em 2em; }
    .highlights ul { grid-template-columns: 1fr; }
    .cv-grid { grid-template-columns: 1fr; }
    .cv-sidebar { border-left: none; padding-left: 0; border-top: 1px solid var(--border); padding-top: 0.5em; margin-top: 0.5em; }
}

@media (max-width: 600px) {
    .profile-pic { width: 96px; height: 96px; }
    .profile-name { font-size: 1.65rem; }
    .nav a { font-size: 0.82rem; padding: 0.4em 1em; }
}

@media (max-width: 480px) {
    main { padding: 0.75em 0; }
    .container { margin: 0 0 1.5em; border-radius: 0; }
    .container-body { padding: 1.2em; }
    .nav { padding: 1em 0.75em 1.2em; gap: 0.3em; }
    .experience-list::before,
    .experience-item::before { display: none; }
    .experience-item { padding-left: 0; }
    .contact-meta { grid-template-columns: 1fr; }
    .contact-meta-item:last-child { grid-column: 1; }
}

/* --- Print ---------------------------------------------- */
@media print {
    .nav, .lang-switch { display: none; }
    main { padding: 0; }
    .container { box-shadow: none; border: 1px solid #ddd; border-radius: 0; }
    .profile-header, .page-hero {
        background: white !important;
        padding: 1em;
    }
    .profile-name, .page-hero h1 { color: #000; }
    .profile-title, .profile-tagline { color: #444; }
    .experience-list::before,
    .experience-item::before { display: none; }
    .experience-item { padding-left: 0; }
    a { color: #000 !important; text-decoration: none !important; }
}

/* --- Reduced motion ------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    html { scroll-behavior: auto; }
}
