@import url('../vendor/dripicons/webfont.css');

:root {
    --bg: #FAFAFB;
    --ink: #14151A;
    --majorelle: #5B4FE0;
    --majorelle-soft: #EEECFB;
    --muted: #6B6E76;
    --line: #E7E7EC;
    --face-neutral: #F5F5F7;
    --surface: #FFFFFF;
    color-scheme: light;
}

[data-theme="dark"] {
    --bg: #14151A;
    --ink: #F2F2F5;
    --majorelle: #8A7FF5;
    --majorelle-soft: #262047;
    --muted: #9A9CA3;
    --line: #2A2B33;
    --face-neutral: #1D1E24;
    --surface: #1A1B21;
    color-scheme: dark;
}

body { transition: background 0.2s ease, color 0.2s ease; }

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.5;
}

.mono { font-family: 'IBM Plex Mono', monospace; }
.muted-text { color: var(--muted); font-size: 13px; }
a { color: inherit; }
[class^="dripicons-"], [class*=" dripicons-"] { line-height: 1; vertical-align: middle; }
.icon-inline { display: inline-flex; align-items: center; gap: 6px; }

/* Header */
.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    max-width: 960px;
    margin: 0 auto;
}
.site-logo {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 500;
    font-size: 18px;
    text-decoration: none;
    color: var(--ink);
    display: inline-flex;
    align-items: center;
}
.site-logo-img { height: 32px; display: block; }
.accent { color: var(--majorelle); }
.site-nav { display: flex; gap: 24px; align-items: center; }
.site-nav a { text-decoration: none; font-size: 14px; color: var(--muted); }
.site-nav a:hover { color: var(--ink); }
.theme-toggle {
    background: none;
    border: 1px solid var(--line);
    border-radius: 20px;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--muted);
    font-size: 15px;
    line-height: 1;
    padding: 0;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--muted); }

main { max-width: 960px; margin: 0 auto; padding: 0 24px; }

/* Hero */
.hero { padding: 48px 0 40px; max-width: 480px; }
.hero-eyebrow { color: var(--majorelle); font-size: 12px; letter-spacing: 0.05em; margin-bottom: 14px; }
h1 { font-size: 38px; font-weight: 600; line-height: 1.15; margin: 0 0 14px; }
h1 [class*="dripicons-"], h2 [class*="dripicons-"] { font-size: 0.75em; color: var(--majorelle); margin-right: 2px; }
.hero-subtext { color: var(--muted); font-size: 15px; margin: 0 0 20px; }

.ticker {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--muted);
    background: var(--majorelle-soft);
    border-radius: 10px;
    padding: 10px 14px;
    text-decoration: none;
    max-width: 100%;
}
.ticker-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--majorelle); flex-shrink: 0; }

/* Sections */
.section { padding: 40px 0; border-top: 0.5px solid var(--line); }
.section-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 20px; }
h2 { font-size: 20px; font-weight: 600; margin: 0; }
.section-link { font-size: 13px; color: var(--majorelle); text-decoration: none; }
.section-about p { color: var(--muted); max-width: 560px; font-size: 15px; margin: 0; }
.about-content { display: flex; gap: 24px; align-items: flex-start; }
.about-photo { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; border: 2px solid var(--majorelle); flex-shrink: 0; }
@media (max-width: 480px) { .about-content { flex-direction: column; } }

/* Project grid */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.project-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }

.card-motif { width: 100%; height: 90px; display: block; }
.project-card-motif { background: var(--face-neutral); border-radius: 10px; margin-bottom: 12px; }
.project-card-motif--tint { background: var(--majorelle-soft); }

.project-card-name { font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.project-card-tagline { font-size: 12.5px; color: var(--muted); line-height: 1.4; margin-bottom: 12px; }

.project-card-stats { border-top: 0.5px solid var(--line); padding-top: 8px; margin-bottom: 10px; }
.project-card-stats div { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-bottom: 4px; }

.project-card-footer { display: flex; justify-content: space-between; align-items: center; }
.project-card-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.tag-chip {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    color: var(--majorelle);
    background: var(--majorelle-soft);
    padding: 2px 6px;
    border-radius: 4px;
}
.project-card-face:not(.project-card--featured) .tag-chip { color: var(--muted); background: var(--face-neutral); }

.pill {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 6px;
    background: var(--face-neutral);
    color: var(--muted);
    white-space: nowrap;
}
.pill--accent { background: var(--majorelle-soft); color: var(--majorelle); }

/* Timeline (journal) */
.timeline { position: relative; padding-left: 22px; }
.timeline::before {
    content: '';
    position: absolute;
    left: 3px;
    top: 6px;
    bottom: 6px;
    width: 1px;
    background: var(--majorelle);
    opacity: 0.25;
}
.timeline-entry { position: relative; margin-bottom: 26px; }
.timeline-entry:last-child { margin-bottom: 0; }
.timeline-dot {
    position: absolute;
    left: -22px;
    top: 5px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #B4B2A9;
}
.timeline-dot--accent { background: var(--majorelle); }
.timeline-meta { font-size: 11.5px; color: var(--muted); margin-bottom: 4px; }
.timeline-meta a { color: var(--majorelle); text-decoration: none; }
.timeline-content p { margin: 0; font-size: 14px; }
.timeline-photo { max-width: 280px; border-radius: 10px; margin-top: 8px; display: block; }
.timeline-full { margin-top: 24px; }

/* Project detail page */
.back-link { display: inline-block; margin-bottom: 20px; color: var(--muted); text-decoration: none; font-size: 13px; }
.project-detail-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.project-detail-header h1 { font-size: 26px; margin: 6px 0 6px; }
.project-detail-tagline { color: var(--muted); font-size: 15px; margin: 0; }
.project-detail-motif { width: 100%; height: 160px; border-radius: 14px; background: var(--face-neutral); margin-bottom: 20px; }
.project-detail-motif .card-motif { height: 100%; }
.project-detail-description { font-size: 15px; color: var(--ink); max-width: 620px; margin-bottom: 20px; }
.project-detail-meta { display: flex; gap: 28px; margin-bottom: 16px; flex-wrap: wrap; }
.project-detail-meta div { display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.btn-link {
    display: inline-block;
    margin-top: 18px;
    padding: 10px 18px;
    background: var(--majorelle);
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
}

/* Filtres */
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.filter-chip {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    padding: 5px 12px;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--muted);
    cursor: pointer;
}
.filter-chip--active { background: var(--majorelle); border-color: var(--majorelle); color: #fff; }

/* Flip card */
.project-card-flip { perspective: 1200px; cursor: pointer; outline: none; }
.project-card-inner {
    position: relative;
    width: 100%;
    min-height: 280px;
    transition: transform 0.5s;
    transform-style: preserve-3d;
}
.project-card-flip.is-flipped .project-card-inner { transform: rotateY(180deg); }
.project-card-face {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 16px;
    display: flex;
    flex-direction: column;
}
.project-card-back { transform: rotateY(180deg); justify-content: center; }
.project-card-back-inner { display: flex; flex-direction: column; gap: 10px; }
.project-card-back-text { font-size: 13px; color: var(--muted); line-height: 1.5; margin: 0; }
.btn-link-mini { font-size: 13px; color: var(--majorelle); text-decoration: none; font-weight: 500; }
.project-card--featured { border: 2px solid var(--majorelle); }

.project-card-cover { border-radius: 10px; overflow: hidden; margin-bottom: 12px; height: 90px; }
.project-card-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Lightbox */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(20, 21, 26, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 1000;
    padding: 24px;
}
.lightbox-overlay--open { opacity: 1; pointer-events: auto; }
.lightbox-img { max-width: 90vw; max-height: 90vh; border-radius: 8px; }
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.lightbox-close:hover { background: rgba(255, 255, 255, 0.3); }
.project-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-top: 16px; }
.project-gallery img { width: 100%; height: 110px; object-fit: cover; border-radius: 8px; cursor: pointer; }

/* Contact */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
    max-width: 440px;
    margin-top: 20px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 24px;
}
.contact-form .form-row { display: flex; flex-direction: column; gap: 6px; }
.contact-form label { font-size: 13px; color: var(--muted); font-weight: 500; }
.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
    width: 100%;
    padding: 11px 14px;
    border-radius: 10px;
    border: 1px solid var(--line);
    font-family: inherit;
    font-size: 14px;
    color: var(--ink);
    background: var(--bg);
    transition: border-color 0.15s ease, background 0.15s ease;
}
.contact-form input[type="text"]:focus,
.contact-form input[type="email"]:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--majorelle);
    background: var(--surface);
}
.contact-form textarea { resize: vertical; min-height: 120px; }
.contact-form button[type="submit"] {
    align-self: flex-start;
    background: var(--majorelle);
    color: #fff;
    border: none;
    padding: 11px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}
.contact-form--inline {
    flex-direction: row;
    max-width: 440px;
    align-items: center;
    padding: 8px 8px 8px 16px;
    gap: 10px;
}
.contact-form--inline input {
    flex: 1;
    border: none;
    padding: 8px 0;
    background: transparent;
}
.contact-form--inline input:focus { outline: none; }
.contact-form--inline button[type="submit"] { align-self: center; white-space: nowrap; }
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.form-error-public { color: #C1443A; font-size: 13px; margin-bottom: 8px; }

/* Recherche */
.nav-search { text-decoration: none; font-size: 15px; line-height: 1; }
.search-form { display: flex; gap: 8px; max-width: 480px; margin-top: 16px; }
.search-form input {
    flex: 1;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
    font-size: 14px;
    font-family: inherit;
}
.search-form input:focus { outline: none; border-color: var(--majorelle); }
.search-form button {
    padding: 10px 18px;
    border-radius: 10px;
    border: none;
    background: var(--majorelle);
    color: #fff;
    font-size: 14px;
    cursor: pointer;
}

/* Retour en haut */
.back-to-top {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(20, 21, 26, 0.12);
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 900;
}
.back-to-top.is-visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.back-to-top:hover { border-color: var(--majorelle); color: var(--majorelle); }

/* Transitions douces à l'apparition du contenu */
body { opacity: 0; animation: nudg-fade-in 0.35s ease forwards; }
@keyframes nudg-fade-in { from { opacity: 0; } to { opacity: 1; } }

.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.5s ease, transform 0.5s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
    body { animation: none; opacity: 1; }
    .reveal { opacity: 1; transform: none; transition: none; }
}

/* Toast de confirmation */
.toast-container {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%) translateY(20px);
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--ink);
    color: var(--bg);
    padding: 14px 18px;
    border-radius: 12px;
    font-size: 14px;
    box-shadow: 0 8px 24px rgba(20, 21, 26, 0.25);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 1100;
    max-width: 90vw;
}
.toast-container.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.toast-icon { font-size: 18px; flex-shrink: 0; }
.toast-close { background: none; border: none; color: inherit; opacity: 0.6; cursor: pointer; font-size: 14px; margin-left: 4px; padding: 0; }
.toast-close:hover { opacity: 1; }

/* Footer */
.site-footer { text-align: center; padding: 32px 24px; color: var(--muted); font-size: 12px; }

/* Mobile */
@media (max-width: 640px) {
    .site-header { padding: 16px; }
    .site-nav { gap: 16px; }
    h1 { font-size: 28px; }
    .project-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
    .project-detail-header { flex-direction: column; }
}
