/* ==========================================================================
   Design system « Édition » — Kaiser Lepron
   Source de vérité : design_handoff_kaiser_lepron/ (fidélité haute).
   Base neutre papier/encre + UN accent par sous-site (les 3 sur le hub).
   Pas d'ombres, pas de border-radius : filets encre 1px + filets doux.
   ========================================================================== */

:root {
    /* Base neutre */
    --paper: #f4f1ec;
    --paper-dark: #eae5dc;
    --rule-soft: #d8d2c6;
    --warm-grey: #6f6a62;
    --text-strong: #3d3a36;
    --text-soft: #57534c;
    --ink: #191817;
    --footer-rule: #3a3835;

    /* Accents de domaine (sur papier / sur encre) */
    --saas: #2952cc;
    --saas-light: #7d96ff;
    --studio: #b8452c;
    --studio-light: #ef8a63;
    --games: #1f7a5c;
    --games-light: #4cbe8f;

    /* Accent du site courant (surchargé par body.theme-*) */
    --accent: var(--ink);
    --accent-light: var(--paper);

    --pad-x: clamp(20px, 4vw, 40px);
    --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

    --font-main: "Archivo", sans-serif;
    --font-mono: "IBM Plex Mono", monospace;
}

body.theme-saas { --accent: var(--saas); --accent-light: var(--saas-light); }
body.theme-studio { --accent: var(--studio); --accent-light: var(--studio-light); }
body.theme-games { --accent: var(--games); --accent-light: var(--games-light); }
/* Le hub n'a pas d'accent propre : hover email/manifeste = rouille */
body.theme-kaiserlepron { --accent: var(--studio); --accent-light: var(--studio-light); }

/* ===== Reset minimal ===== */
* { box-sizing: border-box; }
body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-main);
}
main { flex: 1 0 auto; }
a { color: inherit; }
p { margin: 0; }

/* ===== Couleurs utilitaires (étiquettes, barres, CTA) ===== */
.c-saas { color: var(--saas); }
.c-studio { color: var(--studio); }
.c-games { color: var(--games); }
.c-accent { color: var(--accent); }
.c-muted { color: var(--ink); opacity: 0.55; }
.bg-saas { background: var(--saas); }
.bg-studio { background: var(--studio); }
.bg-games { background: var(--games); }
.bg-accent { background: var(--accent); }

/* ===== Animations ===== */
@keyframes klCycle {
    0%, 28% { color: var(--saas); }
    33%, 61% { color: var(--studio); }
    66%, 94% { color: var(--games); }
    100% { color: var(--saas); }
}
@keyframes klPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.45); } }
@keyframes klRise { from { transform: translateY(110%); } to { transform: translateY(0); } }
@keyframes klFadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes klGrow { from { width: 0; } to { width: 56px; } }
@keyframes klBlink { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

/* ===== Voix mono (structure) ===== */
.kicker {
    font: 500 12px var(--font-mono);
    letter-spacing: 2.5px;
    color: var(--warm-grey);
    text-transform: uppercase;
}
.mono-label { font: 500 12px var(--font-mono); letter-spacing: 0.5px; }
.mono-meta { font: 500 11px var(--font-mono); letter-spacing: 1px; color: var(--warm-grey); }
.mono-cta { font: 600 13px var(--font-mono); }

/* ===== Topbar ===== */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 16px var(--pad-x);
    border-bottom: 1px solid var(--ink);
    position: sticky;
    top: 0;
    background: var(--paper);
    z-index: 10;
}
.topbar-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
}
.brand-mark {
    width: 36px;
    height: 36px;
    background: var(--ink);
    color: var(--paper);
    display: grid;
    place-items: center;
    font: 800 15px var(--font-main);
    letter-spacing: -0.5px;
}
.theme-saas .brand-mark,
.theme-studio .brand-mark,
.theme-games .brand-mark { background: var(--accent); color: #fff; }
.brand-name { display: flex; align-items: baseline; gap: 10px; }
.brand-name span { font: 600 13px var(--font-mono); letter-spacing: 1.5px; }
.brand-suffix { color: var(--accent); }
.topbar-nav {
    display: flex;
    gap: clamp(14px, 3vw, 30px);
    font: 500 12px var(--font-mono);
    letter-spacing: 0.5px;
    flex-wrap: wrap;
}
.topbar-nav a {
    text-decoration: none;
    padding: 6px 0;
    border-bottom: 2px solid transparent;
}
.topbar-nav a:hover { border-bottom-color: currentColor; }
.topbar-nav a.c-muted { border-bottom: none; transition: opacity 0.15s; }
.topbar-nav a.c-muted:hover { opacity: 1; }

/* ===== Sections génériques ===== */
.section { border-bottom: 1px solid var(--ink); }

/* ===== Héros ===== */
.hero { padding: clamp(48px, 8vw, 80px) var(--pad-x) clamp(36px, 6vw, 56px); }
.hero .kicker {
    margin-bottom: clamp(16px, 3vw, 26px);
    animation: klFadeUp 0.6s var(--ease) both;
}
.hero-title {
    margin: 0;
    font-family: var(--font-main);
    font-weight: 850;
    font-stretch: 110%;
    font-size: clamp(52px, 9.5vw, 124px);
    line-height: 0.92;
    letter-spacing: -0.035em;
    text-transform: uppercase;
    text-wrap: balance;
}
.hero-title--compact { font-size: clamp(36px, 9.5vw, 124px); }
/* Masque : padding/margin 0.14em pour ne pas rogner accents et cédilles */
.hero-line { overflow: hidden; padding: 0.14em 0; margin: -0.14em 0; }
.hero-line > div { animation: klRise 0.8s var(--ease) both; }
.hero-line:nth-child(1) > div { animation-delay: 0.1s; }
.hero-line:nth-child(2) > div { animation-delay: 0.28s; padding-bottom: 0.06em; }
.hero-dot--cycle { animation: klCycle 6s linear infinite; }
.hero-dot--accent { color: var(--accent); }
.hero-bottom {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: clamp(28px, 5vw, 44px);
    gap: 32px;
    flex-wrap: wrap;
}
.hero-para {
    max-width: 480px;
    font: 400 clamp(15px, 2vw, 17px) / 1.55 var(--font-main);
    color: var(--text-strong);
    text-wrap: pretty;
    animation: klFadeUp 0.7s var(--ease) 0.55s both;
}
.hero-aside {
    display: flex;
    gap: 10px;
    align-items: center;
    animation: klFadeUp 0.7s var(--ease) 0.7s both;
}
.hero-aside .mono-meta { margin-left: 8px; }
.hero-squares { display: flex; gap: 8px; align-items: center; }
.hero-sq { width: 14px; height: 14px; animation: klPulse 6s ease-in-out infinite; }
.hero-sq:nth-child(1) { animation-delay: -2s; }
.hero-sq:nth-child(2) { animation-delay: 0s; }
.hero-sq:nth-child(3) { animation-delay: 2s; }
.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    animation: klBlink 2s ease-in-out infinite;
}

/* ===== Barre d'accent (signature de domaine 4×56) ===== */
.accent-bar { height: 4px; width: 56px; }

/* ===== Portes (hub) ===== */
.doors {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}
.door {
    text-decoration: none;
    color: var(--ink);
    padding: clamp(28px, 4vw, 38px) clamp(20px, 4vw, 32px) clamp(36px, 5vw, 46px);
    border-right: 1px solid var(--ink);
    border-bottom: 1px solid var(--ink);
    margin-bottom: -1px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-height: 280px;
    transition: background 0.25s;
    animation: klFadeUp 0.6s var(--ease) both;
}
.door:last-child { border-right: none; }
.door:hover { background: var(--paper-dark); }
.door:nth-child(1) { animation-delay: 0.85s; }
.door:nth-child(2) { animation-delay: 1s; }
.door:nth-child(3) { animation-delay: 1.15s; }
.door .accent-bar { animation: klGrow 0.6s var(--ease) both; }
.door:nth-child(1) .accent-bar { animation-delay: 1.3s; }
.door:nth-child(2) .accent-bar { animation-delay: 1.45s; }
.door:nth-child(3) .accent-bar { animation-delay: 1.6s; }
.door-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font: 500 12px var(--font-mono);
}
.door-meta { opacity: 0.4; }
.door-heading {
    font: 800 clamp(28px, 3vw, 36px) / 1.05 var(--font-main);
    letter-spacing: -1px;
}
.door-desc {
    font: 400 14.5px / 1.55 var(--font-main);
    color: var(--text-soft);
    text-wrap: pretty;
}
.door-cta { margin-top: auto; }

/* ===== Manifeste ===== */
.manifesto {
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
    padding: clamp(48px, 7vw, 72px) var(--pad-x);
}
.manifesto-label { flex: 0 0 180px; }
.manifesto-body { flex: 1 1 380px; min-width: 0; }
.manifesto-quote {
    font: 600 clamp(24px, 3.4vw, 34px) / 1.3 var(--font-main);
    letter-spacing: -0.5px;
    max-width: 760px;
    text-wrap: balance;
}
.manifesto-quote .quote-dot { color: var(--studio); }
.manifesto-note {
    margin-top: 24px;
    font: 400 15.5px / 1.6 var(--font-main);
    color: var(--text-soft);
    max-width: 560px;
    text-wrap: pretty;
}

/* ===== Rangées (en ce moment / projets) ===== */
.rows { padding: clamp(40px, 6vw, 60px) var(--pad-x); }
.rows .kicker { margin-bottom: 28px; }
.rows-list { display: flex; flex-direction: column; }
.row {
    display: flex;
    align-items: baseline;
    gap: 20px;
    flex-wrap: wrap;
    padding: 18px 0;
    border-top: 1px solid var(--rule-soft);
    transition: background 0.25s;
}
.row:hover { background: var(--paper-dark); }
.rows-list::after { content: ""; border-top: 1px solid var(--rule-soft); }
.row-tag { font: 500 12px var(--font-mono); min-width: 90px; }
.row-heading { font: 700 19px var(--font-main); letter-spacing: -0.3px; }
.row-desc { font: 400 14px var(--font-main); color: var(--text-soft); }
.row-badge {
    margin-left: auto;
    font: 500 10.5px var(--font-mono);
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 4px 8px;
}

/* ===== Placeholder rayé (visuels manquants) ===== */
.media-placeholder {
    background: repeating-linear-gradient(-45deg, var(--paper-dark) 0 10px, var(--paper) 10px 20px);
    border: 1px solid var(--rule-soft);
    display: grid;
    place-items: center;
}
.media-placeholder span {
    font: 500 11px var(--font-mono);
    letter-spacing: 1.5px;
    color: var(--warm-grey);
    text-transform: uppercase;
    text-align: center;
    padding: 0 12px;
}
.media-frame { border: 1px solid var(--rule-soft); }
.media-frame img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* ===== Produits (rangées 2 colonnes) ===== */
.product {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    gap: clamp(24px, 4vw, 48px);
    padding: clamp(32px, 5vw, 48px) var(--pad-x);
    border-bottom: 1px solid var(--rule-soft);
    transition: background 0.25s;
    animation: klFadeUp 0.6s var(--ease) both;
}
.product:hover { background: var(--paper-dark); }
.product:nth-child(1) { animation-delay: 0.85s; }
.product:nth-child(2) { animation-delay: 1s; }
.product:nth-child(3) { animation-delay: 1.15s; }
.products > .product:last-child { border-bottom: none; }
.product-info { display: flex; flex-direction: column; gap: 16px; }
.product-top {
    display: flex;
    gap: 14px;
    align-items: center;
    font: 500 12px var(--font-mono);
}
.status-tag {
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 3px 8px;
    font-size: 10.5px;
}
.product-heading {
    font: 800 clamp(26px, 3vw, 34px) / 1.05 var(--font-main);
    letter-spacing: -1px;
}
.product-desc {
    font: 400 14.5px / 1.55 var(--font-main);
    color: var(--text-soft);
    text-wrap: pretty;
}
.product-cta { margin-top: auto; text-decoration: none; }
.product-media { height: 220px; }

/* ===== Approche (colonnes numérotées) ===== */
.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}
.step {
    padding: clamp(28px, 4vw, 38px) clamp(20px, 4vw, 32px);
    border-right: 1px solid var(--ink);
    border-bottom: 1px solid var(--ink);
    margin-bottom: -1px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    animation: klFadeUp 0.6s var(--ease) both;
}
.step:last-child { border-right: none; }
.step:nth-child(1) { animation-delay: 0.85s; }
.step:nth-child(2) { animation-delay: 1s; }
.step:nth-child(3) { animation-delay: 1.15s; }
.step-num { font: 500 12px var(--font-mono); color: var(--accent); }
.step-heading { font: 800 22px var(--font-main); letter-spacing: -0.5px; }
.step-desc { font: 400 14px / 1.55 var(--font-main); color: var(--text-soft); text-wrap: pretty; }

/* ===== Cartes jeux ===== */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}
.game-card {
    padding: clamp(28px, 4vw, 38px) clamp(20px, 4vw, 32px) clamp(36px, 5vw, 46px);
    border-right: 1px solid var(--ink);
    border-bottom: 1px solid var(--ink);
    margin-bottom: -1px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    transition: background 0.25s;
    animation: klFadeUp 0.6s var(--ease) both;
}
.game-card:last-child { border-right: none; }
.game-card:hover { background: var(--paper-dark); }
.game-card:nth-child(1) { animation-delay: 0.85s; }
.game-card:nth-child(2) { animation-delay: 1s; }
.game-card:nth-child(3) { animation-delay: 1.15s; }
.game-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font: 500 12px var(--font-mono);
}
.game-media { height: 180px; }
.game-heading {
    font: 800 clamp(24px, 2.6vw, 30px) / 1.05 var(--font-main);
    letter-spacing: -1px;
}
.game-desc { font: 400 14.5px / 1.55 var(--font-main); color: var(--text-soft); text-wrap: pretty; }
.game-cta { margin-top: auto; text-decoration: none; }

/* ===== Contact ===== */
.contact { padding: clamp(56px, 9vw, 96px) var(--pad-x); }
.contact .kicker { margin-bottom: 20px; }
.contact-email {
    display: inline-block;
    text-decoration: none;
    color: var(--ink);
    font-family: var(--font-main);
    font-weight: 850;
    font-stretch: 110%;
    font-size: clamp(16px, 5vw, 92px);
    line-height: 1.05;
    letter-spacing: -0.03em;
    text-transform: uppercase;
    overflow-wrap: anywhere;
    max-width: 100%;
    border-bottom: 4px solid var(--ink);
    padding-bottom: 8px;
    transition: color 0.15s, border-color 0.15s;
}
.contact-email:hover { color: var(--accent); border-bottom-color: var(--accent); }
.contact-note {
    margin-top: 24px;
    font: 400 15px / 1.55 var(--font-main);
    color: var(--text-soft);
    max-width: 440px;
}

/* ===== Footer ===== */
.footer {
    background: var(--ink);
    color: var(--paper);
    padding: clamp(36px, 5vw, 48px) var(--pad-x) 24px;
    margin-top: auto;
}
.footer-top {
    display: flex;
    justify-content: space-between;
    gap: 40px;
    flex-wrap: wrap;
    padding-bottom: 36px;
    border-bottom: 1px solid var(--footer-rule);
}
.footer-brand { display: flex; flex-direction: column; gap: 14px; }
.footer-mark {
    width: 36px;
    height: 36px;
    background: var(--paper);
    color: var(--ink);
    display: grid;
    place-items: center;
    font: 800 15px var(--font-main);
}
.theme-saas .footer-mark,
.theme-studio .footer-mark,
.theme-games .footer-mark { background: var(--accent-light); color: var(--ink); }
.footer-brand-name { font: 500 12px var(--font-mono); letter-spacing: 1.5px; opacity: 0.65; }
.footer-cols { display: flex; gap: clamp(32px, 6vw, 80px); flex-wrap: wrap; }
.footer-col { display: flex; flex-direction: column; gap: 10px; }
.footer-col-heading {
    font: 500 11px var(--font-mono);
    letter-spacing: 2px;
    opacity: 0.45;
    text-transform: uppercase;
}
.footer-col a {
    font: 400 14px var(--font-main);
    color: var(--paper);
    text-decoration: none;
    opacity: 0.85;
    transition: color 0.15s, opacity 0.15s;
}
.footer-col a:hover { opacity: 1; }
.footer-col a.fl-saas:hover { color: var(--saas-light); }
.footer-col a.fl-studio:hover { color: var(--studio-light); }
.footer-col a.fl-games:hover { color: var(--games-light); }
.footer-legal {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding-top: 20px;
    font: 500 11px var(--font-mono);
    letter-spacing: 1.5px;
    opacity: 0.6;
}

/* ===== Page interne (template default) & erreurs ===== */
.page-plain { padding: clamp(48px, 8vw, 80px) var(--pad-x); border-bottom: 1px solid var(--ink); }
.page-plain h1 {
    margin: 0 0 32px;
    font-family: var(--font-main);
    font-weight: 850;
    font-stretch: 110%;
    font-size: clamp(36px, 6vw, 72px);
    line-height: 0.95;
    letter-spacing: -0.03em;
    text-transform: uppercase;
}
.page-plain .article {
    max-width: 720px;
    font: 400 16px / 1.6 var(--font-main);
    color: var(--text-strong);
}
.page-plain .article a { color: var(--accent); }
