@charset "UTF-8";

/**
 * CARNET28 — DESIGN SYSTEM
 */

:root {
    --accent: #e855f7;
    --bg: #f4efea;
    --bg-card: #ffffff;
    --text: #1c1917;
    --text-muted: #6b6661;
    --border: #1c1917;
    --grid-color: #ece6de;
    --font-mono: "JetBrains Mono", ui-monospace, monospace;
    --font-serif: Georgia, serif;
}

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

body {
    background-color: var(--bg);
    background-image:
        linear-gradient(to right, var(--grid-color) 1px, transparent 1px),
        linear-gradient(to bottom, var(--grid-color) 1px, transparent 1px);
    background-size: 24px 24px;
    color: var(--text);
    font-family: var(--font-serif);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

.main-header {
    background-color: var(--bg);
    border-bottom: 2px solid var(--border);
    padding: 24px 0 16px;
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-top {
    display: flex;
    align-items: stretch;
    height: 32px;
    margin-bottom: 20px;
    gap: 0;
}
.logo {
    background: var(--accent);
    color: white;
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: bold;
    width: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    text-transform: uppercase;
    height: 100%;
    flex-shrink: 0;
}
.header-stripes {
    flex: 1;
    background: repeating-linear-gradient(
        90deg,
        var(--accent),
        var(--accent) 2px,
        transparent 2px,
        transparent 6px
    );
    margin: 0;
}

.lang-selector {
    display: flex;
    align-items: stretch;
    height: 100%;
    flex-shrink: 0;
}
.lang-link {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: bold;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    background: var(--accent);
}
.lang-link:first-child {
    border-right: none;
}
.lang-link.active {
    outline: 2px solid var(--border);
    outline-offset: -2px;
}
.lang-link:hover:not(.active) {
    opacity: 0.7;
}
.lang-sep {
    display: none;
}

.main-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    padding-top: 12px;
}
.main-nav a {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 12px;
    text-decoration: none;
    text-transform: uppercase;
}
.main-nav a.active,
.main-nav a:hover {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 4px;
}

.title-h3 {
    font-family: var(--font-mono);
    font-size: 17px;
    margin: 24px 0 12px;
    color: var(--accent);
}
.title-h4 {
    font-family: var(--font-mono);
    font-size: 15px;
    margin: 24px 0 10px;
    color: var(--accent);
}
.accent-link {
    color: var(--accent);
    text-decoration: none;
}

.accent-link::after {
    content: " [" attr(href) "]";
    font-family: var(--font-mono);
    font-size: 0.75em;
    color: var(--text-muted);
    text-decoration: none;
    word-break: break-all;
}

.intro-section {
    padding: 48px 20px 32px;
}
.intro-text {
    border-left: 4px solid var(--accent);
    padding-left: 20px;
    font-style: italic;
    font-size: 18px;
}

main {
    flex: 1;
    padding-bottom: 80px;
}

.section-title-bar {
    border-bottom: 2px solid var(--accent);
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding-bottom: 8px;
    margin: 40px 0 24px;
}
.section-title {
    font-family: var(--font-mono);
    font-size: 14px;
    text-transform: uppercase;
}
.section-date {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
}

.project-list {
    display: flex;
    flex-direction: column;
    gap: 60px;
}
.project-card {
    display: grid;
    gap: 30px;
    padding-bottom: 40px;
}
@media (min-width: 768px) {
    .project-card {
        grid-template-columns: 1fr 1.5fr;
    }
}

@media (max-width: 767px) {
    figcaption,
    .img-caption-bar,
    .img-toggle-btn {
        font-size: 5px !important;
    }
}
.project-card--full {
    grid-template-columns: 1fr 1.5fr;
    grid-template-rows: auto 1fr;
}
.project-card--full .project-header {
    align-self: center;
}
.project-card--full .project-body {
    grid-column: 1 / -1;
}
.project-card--full .project-visual {
    width: 100%;
}
.project-visual {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 16px;
    align-self: start;
}

.visual-header {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 9px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--grid-color);
    margin-bottom: 12px;
    padding-bottom: 6px;
}
.visual-body {
    aspect-ratio: 5 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #faf9f6;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11'%3E%3Crect x='4.25' y='4.25' width='2.5' height='2.5' fill='%23e855f7'/%3E%3C/svg%3E");
    background-size: 11px 11px;
    background-position: center;
    background-origin: content-box;
    background-clip: content-box;
    padding: 4px 9px;
    position: relative;
    overflow: hidden;
}

.visual-svg {
    width: 100%;
    height: auto;
    position: relative;
    z-index: 1;
}

.project-tag {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent);
    font-weight: bold;
}
.project-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
}
.project-title {
    font-size: 22px;
    margin: 8px 0 16px;
}
.project-desc {
    font-size: 15px;
    margin-bottom: 20px;
    text-align: justify;
}
.project-desc p {
    margin-bottom: 1em;
}
.project-desc p:last-child {
    margin-bottom: 0;
}
.project-body p {
    margin-bottom: 1em;
}
.project-body p:last-child {
    margin-bottom: 0;
}
.project-card:not(.project-card--full) .project-desc {
    overflow: hidden;
}
.project-card--full .project-desc {
    overflow: visible;
}
.project-link {
    display: inline-block;
    border: 1px solid var(--accent);
    padding: 8px 16px;
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 11px;
    text-decoration: none;
    font-weight: bold;
}
.project-link:hover {
    background: var(--accent);
    color: white;
}

.static-content {
    max-width: 680px;
}
.static-content p {
    margin-bottom: 16px;
}

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

/* --- Image toggle : tramée / originale --- */
.img-gallery {
    display: flex;
    gap: 16px;
    margin: 32px 0;
}

.img-gallery .img-figure {
    flex: 1;
    min-width: 0;
    margin: 0;
}

.img-figure {
    margin: 32px 0;
    max-width: 100%;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    border: 1px solid var(--border);
    background: var(--bg-card);
    padding: 16px;
}
.img-toggle {
    display: none;
}
.img-container {
    position: relative;
    flex: 1;
    min-width: 0;
}
.img-dithered,
.img-original {
    width: 100%;
    height: auto;
    display: block;
}
/* Par défaut : tramée visible, originale cachée */
.img-original {
    display: none;
}
/* Quand le toggle est coché : originale visible, tramée cachée */
.img-toggle:checked ~ .img-container .img-dithered {
    display: none;
}
.img-toggle:checked ~ .img-container .img-original {
    display: block;
}
.img-caption-bar {
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 9px;
    color: var(--text-muted);
    border-right: 1px solid var(--grid-color);
    margin-left: 12px;
    padding-right: 10px;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
}
.img-toggle-btn {
    font-family: var(--font-mono);
    font-size: 9px;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
    text-decoration: underline;
    text-underline-offset: 3px;
    white-space: nowrap;
}
.img-toggle-btn:hover {
    color: var(--accent);
}
/* Bascule du texte du bouton */
.label-show-dithered {
    display: none;
}
.img-toggle:checked ~ .img-caption-bar .label-show-original {
    display: none;
}
.img-toggle:checked ~ .img-caption-bar .label-show-dithered {
    display: inline;
}
figcaption {
    font-family: var(--font-mono);
    font-size: 9px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.md-list {
    margin-left: 24px;
    margin-bottom: 16px;
    list-style: square;
}
.md-list li {
    margin-bottom: 8px;
}

.archive-item {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 13px;
    padding: 8px 0;
    border-bottom: 1px dashed var(--grid-color);
}
.archive-meta {
    color: var(--text-muted);
    margin-right: 12px;
}
.archive-tag {
    color: var(--accent);
    font-size: 11px;
    margin-right: 12px;
}
.archive-title-link {
    color: var(--text);
    text-decoration: none;
}
.archive-title-link:hover {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.main-footer {
    background: var(--grid-color);
    border-top: 2px solid var(--border);
    padding: 40px 0;
    margin-top: auto;
}
.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}
.footer-tagline {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: bold;
    color: var(--text-muted);
}
.footer-links {
    display: flex;
    gap: 20px;
}
