@font-face {
    font-family: 'Smash';
    src: url('/assets/SMASH.TTF') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'BookAntiqua';
    src: url('/assets/BKANT.TTF') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'BookAntiqua';
    src: url('/assets/ANTQUAI.TTF') format('truetype');
    font-weight: normal;
    font-style: italic;
}

@font-face {
    font-family: 'BookAntiqua';
    src: url('/assets/ANTQUABI.TTF') format('truetype');
    font-weight: bold;
    font-style: italic;
}

@font-face {
    font-family: 'Fluox';
    src: url('/assets/Fluox___.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg:        #000000;
    --bg-soft:   #0d0d0d;
    --bg-card:   #111111;
    --border:    #222222;
    --text:      #cccccc;
    --text-dim:  #888888;
    --text-muted:#555555;
    --link:      #999999;
    --link-hover:#cccccc;
    --accent:    #aaaaaa;
    --font:      'BookAntiqua', 'Book Antiqua', Georgia, 'Times New Roman', serif;
    --font-ui:   system-ui, -apple-system, sans-serif;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    line-height: 1.7;
    min-height: 100vh;
}

a { color: var(--link); text-decoration: none; transition: color .2s; }
a:hover { color: var(--link-hover); }
a:visited { color: #777; }

img { max-width: 100%; height: auto; display: block; }

p { margin-bottom: 1em; }

h1, h2, h3, h4 {
    font-family: var(--font);
    font-weight: normal;
    color: var(--accent);
    line-height: 1.3;
}

/* ===== LAYOUT ===== */
.site-wrapper {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto;
    grid-template-areas:
        "header"
        "nav"
        "main"
        "footer";
    min-height: 100vh;
}

/* ===== HEADER ===== */
.site-header {
    grid-area: header;
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.site-header a.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.site-header a.logo img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
}

.site-title {
    display: none;
}

/* hamburger */
.nav-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border);
    color: var(--text);
    padding: .5rem .75rem;
    cursor: pointer;
    font-size: 1.2rem;
    border-radius: 3px;
}

/* ===== HORIZONTAL NAV ===== */
.site-nav {
    grid-area: nav;
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    padding: .3rem 1rem;
    gap: 0;
}

.site-nav ul {
    list-style: none;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.site-nav ul li a {
    display: flex;
    align-items: center;
    padding: .25rem .45rem;
    border-bottom: 2px solid transparent;
    transition: border-color .2s, background .2s;
    font-family: 'Smash', 'Courier New', monospace;
    font-size: .85rem;
    letter-spacing: .04em;
    text-transform: lowercase;
    color: var(--text-dim);
    white-space: nowrap;
}

.site-nav ul li a:hover,
.site-nav ul li a.active {
    border-bottom-color: var(--accent);
    background: var(--bg-soft);
    color: var(--text);
}

.nav-gif {
    height: 1.4em;
    width: auto;
    display: block;
    vertical-align: middle;
}

.site-nav .nav-sep {
    width: 1px;
    height: 18px;
    background: var(--border);
    margin: 0 .3rem;
    flex-shrink: 0;
}

/* ===== MAIN CONTENT ===== */
.site-main {
    grid-area: main;
    padding: 2.5rem 3rem;
    max-width: 960px;
    width: 100%;
}
.site-main.timeline-first { padding-top: 0; }

/* ===== FOOTER ===== */
.site-footer {
    grid-area: footer;
    border-top: 1px solid var(--border);
    padding: 1.25rem 2rem;
    font-family: var(--font-ui);
    font-size: .78rem;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.site-footer-desc {
    font-style: italic;
    max-width: 600px;
}

.site-footer-links {
    white-space: nowrap;
    flex-shrink: 0;
}

/* ===== REGARDS / BLOG ===== */
.regard-list { display: flex; flex-direction: column; gap: 3rem; }

.regard-item { border-bottom: 1px solid var(--border); padding-bottom: 3rem; }
.regard-item:last-child { border-bottom: none; }

.regard-meta {
    font-family: var(--font-ui);
    font-size: .8rem;
    color: var(--text-muted);
    letter-spacing: .05em;
    margin-bottom: .75rem;
}

.regard-title {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--accent);
}

.regard-media {
    margin-bottom: 1.25rem;
    display: flex;
    justify-content: center;
}

.regard-media img {
    max-width: 100%;
    border: 1px solid var(--border);
}

.regard-body { text-align: justify; }

.regard-body p,
.regard-body div,
.regard-body span { text-align: justify; }

.regard-body p { margin-bottom: .85em; }

/* Video HTML5 */
.regard-media video {
    max-width: 100%;
    border: 1px solid var(--border);
}

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    margin-top: 3rem;
    flex-wrap: wrap;
    font-family: var(--font-ui);
    font-size: .85rem;
}

.pagination a,
.pagination span {
    padding: .35rem .75rem;
    border: 1px solid var(--border);
    color: var(--text-dim);
    transition: color .2s, border-color .2s;
}

.pagination a:hover { color: var(--link-hover); border-color: var(--accent); }
.pagination span.current { color: var(--link-hover); border-color: var(--accent); }

/* ===== TRACES ===== */

/* Timeline */
.traces-timeline {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: 2rem;
    padding: .5rem 0;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--bg);
    max-width: 100vw;
    box-sizing: border-box;
}

.tl-btn {
    flex-shrink: 0;
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 28px;
    height: 44px;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    transition: color .15s, border-color .15s;
    align-self: stretch;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tl-btn:hover { color: var(--link-hover); border-color: var(--accent); }

.traces-tl-track {
    flex: 1 1 0;
    min-width: 0;
    width: 0;
    display: flex;
    gap: .75rem;
    align-items: flex-end;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: .5rem 0;
}
.traces-tl-track::-webkit-scrollbar { display: none; }

.traces-tl-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .4rem;
    opacity: .5;
    transition: opacity .2s;
    flex-shrink: 0;
}

.traces-tl-item:hover,
.traces-tl-item.active {
    opacity: 1;
}

.traces-tl-thumb {
    width: 80px;
    height: 60px;
    border: 1px solid var(--border);
    overflow: hidden;
    position: relative;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
}

.traces-tl-item.active .traces-tl-thumb {
    border-color: var(--accent);
}

.traces-tl-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    margin: 0;
    border: none;
}

.traces-tl-all {
    font-family: var(--font-ui);
    font-size: .75rem;
    color: var(--text-dim);
}

.traces-tl-count {
    position: absolute;
    bottom: 2px;
    right: 4px;
    font-family: var(--font-ui);
    font-size: .62rem;
    color: #fff;
    background: rgba(0,0,0,.55);
    padding: 0 3px;
    line-height: 1.4;
}

.traces-tl-label {
    font-family: var(--font-ui);
    font-size: .72rem;
    letter-spacing: .08em;
    color: var(--text-dim);
}

.traces-tl-item.active .traces-tl-label {
    color: var(--link-hover);
}

/* Filters toolbar — kept for potential future use, currently hidden */
.traces-toolbar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.traces-filter-group {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    flex-wrap: wrap;
}

.traces-filter-label {
    font-family: var(--font-ui);
    font-size: .7rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--text-muted);
    min-width: 40px;
    flex-shrink: 0;
}

.traces-filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
}

.pill {
    font-family: var(--font-ui);
    font-size: .78rem;
    letter-spacing: .04em;
    padding: .25rem .7rem;
    border: 1px solid var(--border);
    color: var(--text-dim);
    transition: all .15s;
    white-space: nowrap;
}

.pill:hover  { color: var(--link-hover); border-color: var(--accent); }
.pill.active { color: var(--link-hover); border-color: var(--accent); background: #111; }

.traces-empty {
    color: var(--text-muted);
    font-family: var(--font-ui);
    font-size: .9rem;
}

.traces-year-block {
    margin-bottom: 3rem;
}

.traces-year-heading {
    font-family: var(--font-ui);
    font-size: .75rem;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
    padding-bottom: .5rem;
    border-bottom: 1px solid var(--border);
}

.traces-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.trace-card {
    border: 1px solid var(--border);
    background: var(--bg-card);
    transition: border-color .2s;
    display: flex;
    flex-direction: column;
}

.trace-card:hover { border-color: #444; }

.trace-card-img img {
    width: 100%;
    height: auto;
    display: block;
    border-bottom: 1px solid var(--border);
}

.trace-card-body {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: .35rem;
}

.trace-card-type {
    font-family: var(--font-ui);
    font-size: .7rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.trace-card-title {
    font-size: 1rem;
    font-weight: normal;
    color: var(--accent);
    line-height: 1.4;
}

.trace-card-date {
    font-family: var(--font-ui);
    font-size: .78rem;
    color: var(--text-muted);
}

.trace-card-text {
    font-size: .88rem;
    color: var(--text-dim);
    margin-top: .25rem;
    line-height: 1.6;
}

/* ===== PARCOURS ===== */
.parcours-content {
    max-width: 720px;
    text-align: justify;
}

.parcours-content p { text-align: justify; }

/* Unik sections inside .parcours-content: restore centering for titles and centered blocks */
.parcours-content .unik-center,
.parcours-content .unik-center *,
.parcours-content .unik-book-cover,
.parcours-content .unik-book-cover *,
.parcours-content h1,
.parcours-content h2,
.parcours-content h3,
.parcours-content h4 { text-align: center; }

.parcours-content img {
    margin: 1.5rem auto;
    border: 1px solid var(--border);
    max-width: 600px;
}

/* ===== PAGE ACCUEIL ===== */
.home-intro {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.home-intro blockquote {
    font-style: italic;
    color: var(--text-dim);
    font-size: .95rem;
    border-left: 2px solid var(--border);
    padding-left: 1rem;
    margin-top: 1rem;
}

.home-regards {
    margin-bottom: 3rem;
}

.home-regards h2 {
    font-size: 1rem;
    font-family: var(--font-ui);
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.home-regards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.home-regard-card {
    border: 1px solid var(--border);
    padding: 1rem;
    transition: border-color .2s;
}

.home-regard-card:hover { border-color: var(--accent); }

.home-regard-card img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    margin-bottom: .75rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: .75rem;
}

.home-regard-card .date {
    font-family: var(--font-ui);
    font-size: .75rem;
    color: var(--text-muted);
    margin-bottom: .35rem;
}

.home-regard-card .titre {
    font-size: .95rem;
    color: var(--accent);
}

.home-links {
    display: flex;
    flex-direction: column;
    gap: .6rem;
}

.home-links a {
    font-family: var(--font-ui);
    font-size: .85rem;
    letter-spacing: .06em;
    padding: .5rem 1rem;
    border: 1px solid var(--border);
    transition: all .2s;
    text-align: center;
}

.home-links a:hover {
    border-color: var(--accent);
    color: var(--link-hover);
}

/* ===== CONTACT FORM ===== */
.contact-form {
    max-width: 580px;
    margin-top: 2rem;
}

.contact-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

.contact-field {
    display: flex;
    flex-direction: column;
    gap: .45rem;
    margin-bottom: 1.25rem;
}

.contact-row .contact-field { margin-bottom: 0; }

.contact-field label {
    font-family: var(--font-ui);
    font-size: .78rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: .08em;
}

.req { color: var(--text-muted); }

.contact-field input,
.contact-field textarea {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text);
    font-family: var(--font);
    font-size: .95rem;
    padding: .65rem .85rem;
    width: 100%;
    transition: border-color .2s;
    appearance: none;
}

.contact-field input:focus,
.contact-field textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.contact-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: .5rem;
}

.contact-note {
    font-family: var(--font-ui);
    font-size: .75rem;
    color: var(--text-muted);
}

.contact-footer button {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--text);
    font-family: var(--font-ui);
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    padding: .65rem 2.5rem;
    cursor: pointer;
    transition: background .2s, color .2s;
}

.contact-footer button:hover { background: var(--accent); color: var(--bg); }

.contact-success {
    padding: 1rem 1.25rem;
    border: 1px solid #3a5a3a;
    background: #0d1a0d;
    color: #7aaa7a;
    font-family: var(--font-ui);
    font-size: .9rem;
    margin-top: 1rem;
}

.contact-error {
    padding: .8rem 1.25rem;
    border: 1px solid #5a2a2a;
    background: #1a0d0d;
    color: #cc7777;
    font-family: var(--font-ui);
    font-size: .9rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 600px) {
    .contact-row { grid-template-columns: 1fr; }
}

/* ===== HOME BOOKS ===== */
.home-books {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.home-books h2 {
    font-size: .85rem;
    font-family: var(--font-ui);
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

.home-books h2 a {
    color: var(--text-muted);
}

.home-books h2 a:hover {
    color: var(--link-hover);
}

.home-books-strip {
    display: flex;
    gap: .75rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.home-books-strip a {
    opacity: .75;
    transition: opacity .2s;
    display: block;
}

.home-books-strip a:hover { opacity: 1; }

.home-books-strip img {
    height: 120px;
    width: auto;
    display: block;
    border: 1px solid var(--border);
    margin: 0;
}

/* ===== PAGE GÉNÉRIQUE ===== */
.page-header {
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.page-header h1 {
    font-size: 1.6rem;
    letter-spacing: .04em;
}

/* ===== RESPONSIVE ===== */

/* Prevent horizontal scroll — only on html (propagates to viewport); body stays visible to preserve sticky */
html { overflow-x: hidden; }

/* Site wrapper and nav must never exceed viewport width */
.site-wrapper { max-width: 100vw; }
.site-nav { max-width: 100vw; box-sizing: border-box; }

/* Text wrapping in all content areas */
.site-main, .parcours-content, .regard-body, .regard-item, .trace-card-body {
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Desktop centering: center site-main within the full-width grid column */
.site-main { margin: 0 auto; }

/* Responsive iframes (YouTube etc.) */
.site-main iframe {
    max-width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
}

/* Responsive tables (muzik page legacy HTML) */
.site-main table {
    max-width: 100%;
    width: 100% !important;
    border-collapse: collapse;
}
.site-main td, .site-main th {
    width: auto !important;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Images with inline width attributes: enforce CSS max-width */
.site-main img, .parcours-content img {
    max-width: 100% !important;
    height: auto !important;
}

/* Trace card images: cap height on all screens */
.trace-card-img img {
    max-height: 50vh;
    object-fit: contain;
}

@media (max-width: 900px) {
    .site-main { padding: 1.5rem; max-width: 100%; }
    .traces-grid { grid-template-columns: 1fr; }
    .home-regards-grid { grid-template-columns: 1fr; }
    .site-nav ul li a { font-size: .68rem; letter-spacing: .08em; padding: .2rem .35rem; }
}

@media (max-width: 600px) {
    .site-header { padding: .5rem 1rem; }
    .site-header a.logo img { width: 60px; height: 60px; }
    .site-main { padding: .75rem; }
    .site-main.timeline-first { padding-top: 0; }
    .site-footer { flex-direction: column; text-align: center; }
    .regard-title { font-size: 1.1rem; }
    /* Nav: compact wrapping on mobile so all items are visible */
    .site-nav {
        padding: .15rem .4rem;
        flex-wrap: wrap;
    }
    .site-nav ul { flex-wrap: wrap; }
    .site-nav ul li a { font-size: .58rem; letter-spacing: .03em; padding: .1rem .22rem; }
    .site-nav .nav-sep { height: 14px; margin: 0 .15rem; }
    /* Trace card images: smaller cap on mobile */
    .trace-card-img img { max-height: 60vw; }
    /* Timeline thumbnails: smaller on mobile to fit more years */
    .traces-tl-thumb { width: 60px; height: 46px; }
}
