/* home.css — l'accueil, sobre : papier ou noir chaud selon le système, une seule
   couleur (la braise), des titres au feutre, des traits au marqueur (marker.css).
   Même langage que NADAPROD, l'accent en plus. */

:root {
    --bg: #fafaf7;
    --surface: #f1f1ec;
    --text-main: #0b0b0a;
    --text-secondary: #55554f;
    --text-dim: #6e6e67;
    --border: #d6d6cf;
    --accent: #ff7a1a;     /* la braise : fonds et traits */
    --acc-fg: #a84300;     /* la braise lisible en texte sur papier */
    --err: #b91c1c;
    --selection-bg: #0b0b0a;
    --selection-text: #fafaf7;

    --font-display: 'Permanent Marker', 'Archivo', sans-serif; /* une seule graisse : jamais de gras */
    --font-body: 'Archivo', system-ui, -apple-system, sans-serif;
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0a0a09;
        --surface: #131312;
        --text-main: #f3f3ee;
        --text-secondary: #a3a39b;
        --text-dim: #85857e;
        --border: #2c2c29;
        --acc-fg: #ff8f45;
        --err: #f87171;
        --selection-bg: #ff7a1a;
        --selection-text: #000;
        color-scheme: dark;
    }
}

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

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
    min-height: 100dvh;
    font: 400 1.06rem/1.6 var(--font-body);
    color: var(--text-secondary);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

::selection { background: var(--selection-bg); color: var(--selection-text); }

a { color: var(--text-main); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
a:hover { text-decoration-thickness: 2px; text-decoration-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

code {
    font: 500 0.92em/1 var(--font-body);
    padding: 0.1em 0.35em;
    border-radius: 4px;
    background: var(--surface);
    color: var(--text-main);
}

em { font-style: normal; color: var(--text-main); }

/* ========== En-tête ========== */
.top {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem clamp(1rem, 4vw, 2.5rem);
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.wordmark {
    font: 400 1.3rem/1 var(--font-display);
    color: var(--text-main);
    text-decoration: none;
    letter-spacing: 0.02em;
}

.wordmark span { color: var(--acc-fg); }
.wordmark:hover { text-decoration: none; }

.top-nav { display: flex; gap: clamp(0.8rem, 2.4vw, 1.8rem); }
.top-nav a { font-size: 0.95rem; font-weight: 500; text-decoration: none; color: var(--text-secondary); }
.top-nav a:hover { color: var(--text-main); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; }

/* ========== Le héros : le titre, la phrase, le champ ========== */
main { max-width: 1180px; margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2.5rem); }

.hero { padding: clamp(3rem, 10vh, 7rem) 0 clamp(4rem, 10vh, 6rem); animation: rise 0.6s var(--ease) both; }

@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

.display {
    font: 400 clamp(3rem, 9vw, 7rem)/0.98 var(--font-display);
    font-synthesis: none;
    color: var(--text-main);
    letter-spacing: -0.01em;
}

.accent { color: var(--acc-fg); }

.intro {
    max-width: 38rem;
    margin-top: 1.6rem;
    font-size: clamp(1.1rem, 1.8vw, 1.3rem);
}

/* le nom du salon, souligné au marqueur */
.claim { margin-top: clamp(2.5rem, 6vh, 3.5rem); max-width: 46rem; }

.claim-line {
    display: flex;
    align-items: baseline;
    gap: 0.2rem;
    padding-bottom: 0.35rem;
    border-bottom: 6px solid;
    border-image: var(--mk) 12 round;
    cursor: text;
}

.claim-host {
    flex: none;
    font: 500 clamp(1.3rem, 3.6vw, 2.3rem)/1.2 var(--font-body);
    color: var(--text-dim);
}

.claim-input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    font: 600 clamp(1.3rem, 3.6vw, 2.3rem)/1.2 var(--font-body);
    letter-spacing: -0.01em;
    color: var(--text-main);
    caret-color: var(--accent);
}

.claim-input::placeholder { color: var(--border); }

.claim-go {
    flex: none;
    align-self: center;
    display: grid;
    place-items: center;
    width: 2.6rem;
    height: 2.6rem;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--text-dim);
    cursor: pointer;
    transition: color 0.2s var(--ease), background 0.2s var(--ease), transform 0.3s var(--ease);
}

.claim-go svg { width: 1.6rem; height: 1.6rem; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

.claim-hint { margin-top: 0.8rem; min-height: 1.6em; font-weight: 500; color: var(--text-secondary); }
.claim-rule { margin-top: 0.4rem; font-size: 0.9rem; color: var(--text-dim); }

/* nom libre ou existant : la braise ; invalide ou réservé : le rouge */
body[data-state="ok"] .claim-hint { color: var(--acc-fg); }
body[data-state="ok"] .claim-go { color: #000; background: var(--accent); }
body[data-state="ok"] .claim-go:hover { transform: translateX(3px); }
body[data-state="bad"] .claim-hint { color: var(--err); }
body[data-state="bad"] .claim-input { color: var(--err); }

.claim.shake { animation: shake 0.4s var(--ease); }

@keyframes shake {
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

/* lieu gardé : le mot de passe, sous le nom */
.claim-key { display: grid; gap: 0.5rem; margin-top: 1rem; animation: rise 0.4s var(--ease) both; }
.claim-key-label { color: var(--text-main); }
.claim-key-label b { font-weight: 600; }

.claim-key-input {
    max-width: 22rem;
    padding: 0.55rem 0;
    border: 0;
    border-bottom: 4px solid;
    border-image: var(--mk-soft) 12 round;
    outline: 0;
    background: transparent;
    font: 500 1.3rem var(--font-body);
    color: var(--text-main);
}

.claim-key-err { min-height: 1.4em; font-size: 0.95rem; color: var(--err); }

.elsewhere { display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; margin-top: 2.5rem; font-size: 0.98rem; }
.recent { display: inline-flex; flex-wrap: wrap; gap: 0.4rem 0.9rem; }
.recent > span { color: var(--text-dim); }

/* ========== Les blocs : kicker, titre, contenu ========== */
.block { padding: clamp(3rem, 8vh, 5rem) 0; }

.kicker {
    display: inline-block;
    font: 400 1.05rem/1 var(--font-display);
    color: var(--acc-fg);
    transform: rotate(-1.5deg);
    transform-origin: left;
}

.title {
    margin: 0.8rem 0 2rem;
    max-width: 44rem;
    font: 600 clamp(1.8rem, 3.6vw, 2.8rem)/1.08 var(--font-body);
    letter-spacing: -0.025em;
    color: var(--text-main);
}

h3 { font: 600 clamp(1.25rem, 1.9vw, 1.5rem)/1.2 var(--font-body); letter-spacing: -0.015em; color: var(--text-main); }

/* trois colonnes séparées au marqueur, sur autant de rangées qu'il faut */
.args { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 5px solid; border-image: var(--mk) 12 round; }
.args article { display: grid; gap: 0.8rem; align-content: start; padding: 1.5rem 2rem 1.8rem 0; }
.args article:not(:nth-child(3n + 1)) { padding-left: 2rem; border-left: 4px solid; border-image: var(--mk-soft) 12 round; }
.args article:nth-child(n + 4) { border-top: 4px solid; border-image: var(--mk-soft) 12 round; }
.aside { margin-top: 2rem; font-size: 0.98rem; color: var(--text-dim); }

/* des rangées : l'étiquette et le titre à gauche, le texte à droite */
.rows { list-style: none; border-bottom: 4px solid; border-image: var(--mk-soft) 12 round; }
.row { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 1rem 3rem; padding: 2.4rem 0; border-top: 4px solid; border-image: var(--mk-soft) 12 round; }
.row:first-child { border-top-width: 5px; border-image: var(--mk) 12 round; }
.label { font-size: 0.85rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-dim); }
.row h3 { margin-top: 0.5rem; }
.row > div:last-child { display: grid; gap: 1rem; align-content: start; }
.row p { max-width: 38rem; }

.story { display: grid; gap: 1.1rem; max-width: 40rem; font-size: 1.12rem; }
.story p:first-child { color: var(--text-main); }

.duo { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 3rem; align-items: start; }
.duo .title { margin-bottom: 1.2rem; }
.duo p { max-width: 36rem; }

.links { list-style: none; border-top: 5px solid; border-image: var(--mk) 12 round; }
.links li { border-bottom: 4px solid; border-image: var(--mk-soft) 12 round; }
.links a {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding: 1rem 0;
    font: 600 clamp(1.15rem, 2vw, 1.45rem)/1.1 var(--font-body);
    letter-spacing: -0.02em;
    text-decoration: none;
}

.links a span { font: 400 0.92rem var(--font-body); letter-spacing: 0; color: var(--text-secondary); }
.links a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-decoration-color: var(--accent); text-underline-offset: 0.2em; }

.foot {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.5rem 2rem;
    max-width: 1180px;
    margin: 2rem auto 0;
    padding: 2rem clamp(1rem, 4vw, 2.5rem) 3rem;
    font-size: 0.9rem;
    color: var(--text-dim);
}

.foot span:first-child { font: 400 1rem var(--font-display); color: var(--text-main); }

/* ========== La barre de défilement : discrète, la braise au survol ========== */
html::-webkit-scrollbar { width: 12px; }
html::-webkit-scrollbar-track { background: var(--bg); }
html::-webkit-scrollbar-thumb { border: 3px solid var(--bg); border-radius: 999px; background: var(--border); }
html::-webkit-scrollbar-thumb:hover { background: var(--accent); }

@supports (-moz-appearance: none) {
    html { scrollbar-width: thin; scrollbar-color: var(--border) var(--bg); }
}

/* ========== Petits écrans ========== */
@media (max-width: 860px) {
    .top-nav { display: none; }
    .args { grid-template-columns: minmax(0, 1fr); border-top: 0; }
    .args article, .args article:not(:nth-child(3n + 1)), .args article:nth-child(n + 4) { padding: 1.4rem 0; border-left: 0; border-top: 4px solid; border-image: var(--mk-soft) 12 round; }
    .args article:first-child { border-top-width: 5px; border-image: var(--mk) 12 round; }
    .row, .duo { grid-template-columns: minmax(0, 1fr); gap: 0.8rem; }
    .duo { gap: 2rem; }
}

@media (max-width: 480px) {
    .claim-host { font-size: 1.05rem; }
    .claim-input { font-size: 1.3rem; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .hero, .claim-key, .claim.shake { animation: none; }
    .claim-go { transition: none; }
}
