*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg:      #ffffff;
    --fg:      #000000;
    --muted:   rgba(0,0,0,0.48);
    --rule:    rgba(0,0,0,0.09);
    --dot:     rgba(0,0,0,0.13);
    --dot-gap: 20px;
}

[data-theme="dark"] {
    --bg:    #000000;
    --fg:    #ffffff;
    --muted: rgba(255,255,255,0.50);
    --rule:  rgba(255,255,255,0.08);
    --dot:   rgba(255,255,255,0.12);
}

@media (prefers-reduced-motion: reduce) {
    .cursor { animation: none !important; opacity: 1; }
}

html { scroll-behavior: smooth; }

body {
    background-color: var(--bg);
    color: var(--fg);
    font-family: 'Space Mono', monospace;
    font-size: 13px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    background-image: radial-gradient(var(--dot) 1px, transparent 1px);
    background-size: var(--dot-gap) var(--dot-gap);
    min-height: 100vh;
    transition: background-color 0.35s ease, color 0.35s ease;
}

/* ── Wave canvas ── */
#wave-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
    opacity: 0;
}

/* ── Layout ──
   Largeur fluide : la marge sur les côtés s'adapte à la taille de l'écran
   au lieu d'une bande vide fixe sur grand écran. */
.page {
    max-width: 880px;
    width: 100%;
    margin: 0 auto;
    padding: 0 clamp(20px, 5vw, 56px);
    position: relative;
    z-index: 1;
}

/* ── Header ── */
header {
    padding: 72px 0 56px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.logo {
    display: block;
    text-decoration: none;
    color: var(--fg);
    transition: color 0.35s ease;
}

.logo svg {
    height: 42px;
    fill: currentColor;
    display: block;
}

/* ── Nav ── */
nav {
    border-top: 1px solid var(--fg);
    padding: 13px 0;
    display: flex;
    gap: 28px;
    flex-wrap: wrap;
    margin-bottom: 88px;
    transition: border-color 0.35s ease;
}

nav a {
    color: var(--muted);
    text-decoration: none;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    transition: color 0.12s;
}

nav a:hover,
nav a[aria-current] { color: var(--fg); }

.ext-arrow {
    display: inline-block;
    margin-left: 3px;
    font-size: 10px;
    opacity: 0.55;
    transition: opacity 0.12s, transform 0.12s;
}

.nav-lb:hover .ext-arrow {
    opacity: 1;
    transform: translate(1px, -1px);
}

/* ── Section label ── */
.section-label {
    font-size: 11px;
    font-weight: 400;
    font-style: italic;
    color: var(--muted);
    letter-spacing: 0.04em;
    margin-bottom: 6px;
    padding-left: 52px;
}

/* ── List ── */
.list {
    list-style: none;
    margin-bottom: 64px;
}

/* ── Row ── */
.row {
    display: grid;
    grid-template-columns: 40px 1fr auto;
    align-items: center;
    gap: 0 12px;
    border-bottom: 1px solid var(--rule);
    text-decoration: none;
    color: var(--fg);
    cursor: pointer;
    transition: background 0.1s, color 0.1s;
    padding: 0 8px 0 4px;
    margin: 0 -8px 0 -4px;
}

.list li:first-child .row { border-top: 1px solid var(--rule); }

.row:hover { background: var(--fg); color: var(--bg); }
.row:hover .row-tag  { color: var(--bg); opacity: 0.45; }
.row:hover .row-date { color: var(--bg); opacity: 0.45; }

.row:focus-visible {
    outline: 2px solid var(--fg);
    outline-offset: -2px;
}

.row-tag {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--muted);
    padding: 18px 0;
    white-space: nowrap;
    transition: color 0.1s, opacity 0.1s;
}

.row-title {
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.01em;
    padding: 18px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.row-date {
    font-size: 11px;
    color: var(--muted);
    white-space: nowrap;
    letter-spacing: 0.04em;
    padding: 18px 0;
    transition: color 0.1s, opacity 0.1s;
}

.wip-dot {
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--fg);
    margin-right: 6px;
    vertical-align: middle;
    position: relative;
    top: -1px;
    opacity: 0.35;
}

/* ── Page placeholder (outils / logs) ── */
.placeholder-page {
    padding: 24px 0 80px;
}

.placeholder-page .status {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--muted);
}

/* ── Page projet ── */
.back-link {
    display: inline-block;
    margin-bottom: 28px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--muted);
    text-decoration: none;
}

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

.projet-titre {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.01em;
    margin: 4px 0 24px;
    line-height: 1.3;
}

.projet-desc {
    font-size: 13px;
    line-height: 1.7;
    max-width: 60ch;
    margin-bottom: 32px;
}

.video-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    background: var(--rule);
    margin-bottom: 24px;
}

.video-wrapper iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ── Annonces (lebonlabs) ── */
.annonces {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 64px;
}

.annonce {
    display: grid;
    grid-template-columns: 92px 1fr;
    gap: 16px;
    border: 1px solid var(--rule);
    padding: 14px;
    transition: border-color 0.15s;
}

.annonce:hover { border-color: var(--fg); }

.annonce-photo {
    width: 92px;
    height: 92px;
    border: 1px solid var(--rule);
    background-color: var(--rule);
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 22px;
    color: var(--muted);
    flex-shrink: 0;
}

.annonce-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.annonce-title {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.annonce-price {
    font-size: 13px;
    font-weight: 400;
    margin-top: 2px;
}

.annonce-desc {
    font-size: 11px;
    color: var(--muted);
    margin-top: 8px;
    letter-spacing: 0.01em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.annonce-desc.expanded {
    display: block;
    -webkit-line-clamp: unset;
}

.toggle-desc {
    background: none;
    border: none;
    padding: 0;
    margin-top: 4px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--fg);
    cursor: pointer;
    text-decoration: underline;
    align-self: flex-start;
    display: none;
}

.toggle-desc.visible { display: inline-block; }

.annonce-footer {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-contact {
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--bg);
    background: var(--fg);
    border: 1px solid var(--fg);
    padding: 7px 14px;
    cursor: pointer;
    transition: opacity 0.12s;
}

.btn-contact:hover { opacity: 0.8; }

.btn-contact.active {
    background: transparent;
    color: var(--fg);
}

.contact-reveal {
    font-size: 11px;
    color: var(--muted);
    letter-spacing: 0.02em;
}

.contact-reveal strong { color: var(--fg); font-weight: 700; }

.annonce-photo.has-photo {
    cursor: zoom-in;
}

.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 1000;
    cursor: zoom-out;
}

.lightbox[hidden] { display: none; }

.lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ── Footer ── */
footer {
    border-top: 1px solid var(--fg);
    padding: 20px 0 64px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 10px;
    letter-spacing: 0.08em;
    color: var(--muted);
    transition: border-color 0.35s ease;
}

footer a { color: var(--muted); text-decoration: none; transition: color 0.1s; }
footer a:hover { color: var(--fg); }
footer .right { display: flex; gap: 20px; }

/* ── Mobile ── */
@media (max-width: 520px) {
    header { padding: 44px 0 36px; }
    nav { margin-bottom: 56px; gap: 20px; }
    .logo svg { height: 34px; }
    .row-date { display: none; }
    .row-title { font-size: 12px; }
    .section-label { padding-left: 44px; }
    .annonce { grid-template-columns: 64px 1fr; padding: 10px; gap: 10px; }
    .annonce-photo { width: 64px; height: 64px; font-size: 16px; }
}