/* ============================================================
   fetch.css — Design "éditorial technique / hacker manual"
   Thème : light · noir brutal · lime acide · condensed bold
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:ital,wght@0,400;0,600;0,700;0,800;0,900;1,700&family=Barlow:wght@300;400;500&family=JetBrains+Mono:wght@400;500;700&display=swap');

/* ── VARIABLES ─────────────────────────────────────────── */
:root {
    --bg:       #f4f1eb;
    --bg2:      #ede9e0;
    --bg3:      #e4e0d5;
    --black:    #0a0a0a;
    --black2:   #1a1a1a;
    --ink:      #2a2820;
    --lime:     #9dff00;
    --lime2:    #7acc00;
    --lime-bg:  rgba(157,255,0,.12);
    --red:      #ff3b30;
    --blue:     #0066ff;
    --muted:    #7a7568;
    --border:   #c8c4b8;
    --border2:  #d8d4c8;
    --code-bg:  #0f0f0f;
    --code-fg:  #e8e8e8;
    --shadow:   0 2px 0 var(--border), 0 8px 32px rgba(0,0,0,.12);
    --mono:     'JetBrains Mono', 'Fira Code', monospace;
    --display:  'Barlow Condensed', sans-serif;
    --sans:     'Barlow', system-ui, sans-serif;
}

/* ── RESET ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
    font-family: var(--sans);
    font-weight: 400;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.7;
    min-height: 100vh;
    /* Grille de papier quadrillé très subtile */
    background-image:
        linear-gradient(rgba(0,0,0,.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,0,0,.04) 1px, transparent 1px);
    background-size: 32px 32px;
}

/* ── SCROLL PROGRESS ───────────────────────────────────── */
#progress {
    position: fixed;
    top: 0; left: 0;
    height: 3px;
    width: 0%;
    z-index: 500;
    background: var(--lime);
    box-shadow: 0 0 8px var(--lime);
    transition: width .08s linear;
}

/* ── HEADER ────────────────────────────────────────────── */
header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--black);
    border-bottom: 3px solid var(--lime);
    padding: 0;
}

.header-inner {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    height: 52px;
}

.header-logo {
    font-family: var(--display);
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--lime);
    letter-spacing: 2px;
    text-transform: uppercase;
    white-space: nowrap;
}
.header-logo .dot { color: #fff; }

.header-nav {
    display: flex;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
}
.header-nav::-webkit-scrollbar { display: none; }
.header-nav a {
    font-family: var(--display);
    font-size: .72rem;
    font-weight: 700;
    color: rgba(255,255,255,.45);
    text-decoration: none;
    padding: 0 14px;
    height: 52px;
    display: flex;
    align-items: center;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    border-left: 1px solid rgba(255,255,255,.08);
    transition: color .15s, background .15s;
    white-space: nowrap;
}
.header-nav a:hover, .header-nav a.active {
    color: var(--lime);
    background: rgba(157,255,0,.06);
}

/* ── HERO ──────────────────────────────────────────────── */
.hero {
    background: var(--black);
    color: #fff;
    padding: 64px 28px 56px;
    position: relative;
    overflow: hidden;
}

/* Quadrillage sombre en fond hero */
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(157,255,0,.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(157,255,0,.06) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}

.hero-inner {
    max-width: 1140px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.hero-tag {
    font-family: var(--mono);
    font-size: .72rem;
    color: var(--lime);
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.hero-tag::before {
    content: '$ ';
    opacity: .5;
}

.hero h1 {
    font-family: var(--display);
    font-size: clamp(4.5rem, 12vw, 9rem);
    font-weight: 900;
    line-height: .92;
    letter-spacing: -2px;
    text-transform: uppercase;
    color: #fff;
    margin-bottom: 4px;
}
.hero h1 .hl { color: var(--lime); }

.hero-desc {
    font-size: 1.1rem;
    color: rgba(255,255,255,.55);
    font-weight: 300;
    max-width: 580px;
    margin: 22px 0 36px;
    line-height: 1.65;
}

/* Stats bar */
.hero-stats {
    display: flex;
    gap: 0;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 0;
    overflow: hidden;
    display: inline-flex;
}
.hero-stat {
    padding: 12px 24px;
    border-right: 1px solid rgba(255,255,255,.1);
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.hero-stat:last-child { border-right: none; }
.hero-stat .sv {
    font-family: var(--display);
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--lime);
    line-height: 1;
}
.hero-stat .sl {
    font-family: var(--mono);
    font-size: .6rem;
    color: rgba(255,255,255,.4);
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

/* ── MAIN LAYOUT ───────────────────────────────────────── */
.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 28px 80px;
}

/* ── SECTION BLOCK ─────────────────────────────────────── */
.block {
    border: 2px solid var(--border);
    border-top: none;
    background: #fff;
    position: relative;
    opacity: 0;
    transform: translateY(14px);
    transition: opacity .4s ease, transform .4s ease;
}
.block.visible { opacity: 1; transform: translateY(0); }
.block + .block { margin-top: 28px; }
.block:first-child { border-top: 2px solid var(--border); margin-top: 28px; }

/* Bande de titre */
.block-head {
    background: var(--black2);
    color: #fff;
    padding: 14px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 2px solid var(--border);
}
.block-num {
    font-family: var(--display);
    font-size: 3rem;
    font-weight: 900;
    color: var(--lime);
    line-height: 1;
    min-width: 52px;
    letter-spacing: -1px;
}
.block-title {
    font-family: var(--display);
    font-size: 1.5rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .5px;
    line-height: 1.15;
    flex: 1;
}
.block-tag {
    font-family: var(--mono);
    font-size: .62rem;
    color: rgba(255,255,255,.35);
    letter-spacing: 2px;
    text-transform: uppercase;
    white-space: nowrap;
}
.block-body { padding: 28px 22px; }

/* ── PIPELINE DIAGRAM ──────────────────────────────────── */
.pipeline {
    display: flex;
    align-items: stretch;
    gap: 0;
    margin: 24px 0;
    border: 2px solid var(--border);
    overflow: hidden;
    border-radius: 2px;
}
.pipe-step {
    flex: 1;
    padding: 18px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: var(--bg);
    border-right: 2px solid var(--border);
    position: relative;
    transition: background .2s;
    cursor: default;
}
.pipe-step:last-child { border-right: none; }
.pipe-step.active {
    background: var(--black);
    color: #fff;
}
.pipe-step.active .ps-num { color: var(--lime); }
.pipe-step.active .ps-label { color: rgba(255,255,255,.6); }
.pipe-step.active .ps-icon { filter: none; }

/* Flèche entre steps */
.pipe-step:not(:last-child)::after {
    content: '→';
    position: absolute;
    right: -14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    color: var(--lime);
    z-index: 2;
    font-weight: 900;
    background: var(--bg);
    padding: 0 1px;
    line-height: 1;
}
.pipe-step.active:not(:last-child)::after {
    background: var(--black);
}

.ps-num {
    font-family: var(--mono);
    font-size: .62rem;
    color: var(--muted);
    letter-spacing: 2px;
    text-transform: uppercase;
}
.ps-icon { font-size: 1.4rem; }
.ps-name {
    font-family: var(--display);
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .3px;
    color: var(--black);
}
.pipe-step.active .ps-name { color: #fff; }
.ps-label {
    font-size: .75rem;
    color: var(--muted);
    line-height: 1.4;
}

/* ── CODE BLOCK ────────────────────────────────────────── */
.code-block {
    margin: 18px 0;
    border: 2px solid var(--black);
    overflow: hidden;
}
.code-bar {
    background: var(--black);
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.code-bar-dots { display: flex; gap: 5px; }
.code-bar-dots span {
    width: 10px; height: 10px;
    border-radius: 50%;
    display: block;
}
.cb-r { background: #ff5f57; }
.cb-y { background: #ffbd2e; }
.cb-g { background: #28ca41; }
.code-lang {
    font-family: var(--mono);
    font-size: .6rem;
    color: var(--lime);
    letter-spacing: 2px;
    text-transform: uppercase;
}
.code-copy {
    font-family: var(--mono);
    font-size: .6rem;
    color: rgba(255,255,255,.35);
    letter-spacing: 1px;
    cursor: pointer;
    background: none;
    border: 1px solid rgba(255,255,255,.15);
    color: rgba(255,255,255,.5);
    padding: 3px 10px;
    border-radius: 3px;
    transition: border-color .15s, color .15s;
}
.code-copy:hover { border-color: var(--lime); color: var(--lime); }
pre {
    margin: 0;
    padding: 20px 20px;
    background: var(--code-bg);
    color: var(--code-fg);
    font-family: var(--mono);
    font-size: .83rem;
    line-height: 1.75;
    overflow-x: auto;
}
/* Syntax colors */
pre .kw  { color: #c792ea; }
pre .fn  { color: #82aaff; }
pre .str { color: #c3e88d; }
pre .cm  { color: #546e7a; font-style: italic; }
pre .me  { color: #f78c6c; }
pre .ky  { color: #89ddff; }

/* ── STEPS LIST ────────────────────────────────────────── */
.steps {
    list-style: none;
    counter-reset: st;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 16px 0;
}
.steps li {
    counter-increment: st;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 12px 16px;
    background: var(--bg);
    border: 1px solid var(--border2);
    border-left: 3px solid var(--lime);
    font-size: .95rem;
    line-height: 1.55;
    transition: background .15s, border-color .15s;
}
.steps li:hover { background: var(--bg2); }
.steps li::before {
    content: counter(st, decimal-leading-zero);
    font-family: var(--display);
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--lime);
    line-height: 1;
    min-width: 28px;
    margin-top: 1px;
}

/* ── BULLET LIST ───────────────────────────────────────── */
ul.feat {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
    margin: 16px 0;
}
ul.feat li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    background: var(--bg);
    border: 1px solid var(--border2);
    font-size: .9rem;
    line-height: 1.5;
    color: var(--ink);
    transition: border-color .15s, background .15s;
}
ul.feat li:hover { border-color: var(--lime); background: var(--lime-bg); }
ul.feat li::before {
    content: '▸';
    color: var(--lime);
    font-size: .85rem;
    flex-shrink: 0;
    margin-top: 2px;
}

/* ── COMPARISON TABLE ──────────────────────────────────── */
.cmp-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    border: 2px solid var(--border);
}
.cmp-table th {
    font-family: var(--display);
    font-size: .82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 12px 16px;
    background: var(--black2);
    color: var(--lime);
    text-align: left;
    border-right: 1px solid rgba(255,255,255,.1);
}
.cmp-table th:first-child { color: rgba(255,255,255,.5); }
.cmp-table td {
    padding: 11px 16px;
    font-size: .88rem;
    border-top: 1px solid var(--border);
    border-right: 1px solid var(--border);
    vertical-align: top;
    line-height: 1.5;
    color: var(--ink);
}
.cmp-table td:first-child { font-weight: 600; color: var(--black); background: var(--bg); }
.cmp-table tr:hover td { background: var(--lime-bg); }
.cmp-table tr:hover td:first-child { background: var(--lime-bg); }
.td-yes { color: #138a00; font-family: var(--mono); font-size: .78rem; font-weight: 700; }
.td-no  { color: var(--red); font-family: var(--mono); font-size: .78rem; font-weight: 700; }

/* ── NOTICE BOX ────────────────────────────────────────── */
.notice {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px 16px;
    margin: 16px 0;
    font-size: .88rem;
    line-height: 1.65;
    border: 2px solid;
}
.notice-icon { font-size: .95rem; flex-shrink: 0; margin-top: 2px; }
.notice.n-ok     { border-color: #138a00; background: rgba(19,138,0,.06);  color: #0a4f00; }
.notice.n-warn   { border-color: #b45309; background: rgba(180,83,9,.06);  color: #7c3a04; }
.notice.n-info   { border-color: var(--blue); background: rgba(0,102,255,.05); color: #003399; }

/* ── DEMO LIVE ─────────────────────────────────────────── */
.demo-box {
    border: 2px solid var(--black);
    overflow: hidden;
    margin: 18px 0;
}
.demo-topbar {
    background: var(--black);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.demo-topbar span {
    font-family: var(--mono);
    font-size: .65rem;
    color: rgba(255,255,255,.4);
    letter-spacing: 1.5px;
    text-transform: uppercase;
}
.demo-topbar .live-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--lime);
    box-shadow: 0 0 6px var(--lime);
    animation: livePulse 1.8s ease-in-out infinite;
}
@keyframes livePulse {
    0%,100% { opacity: 1; } 50% { opacity: .3; }
}
.demo-inner {
    padding: 20px;
    background: var(--bg);
}
.demo-url-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.demo-url {
    flex: 1;
    font-family: var(--mono);
    font-size: .82rem;
    padding: 9px 14px;
    background: #fff;
    border: 2px solid var(--border);
    color: var(--ink);
    outline: none;
    min-width: 180px;
    transition: border-color .2s;
}
.demo-url:focus { border-color: var(--black); }
.btn-run {
    font-family: var(--display);
    font-size: 1rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 9px 22px;
    background: var(--lime);
    color: var(--black);
    border: 2px solid var(--lime2);
    cursor: pointer;
    transition: background .15s, transform .1s;
    white-space: nowrap;
}
.btn-run:hover { background: #aaff11; transform: translateY(-1px); }
.btn-run:active { transform: translateY(0); }
.btn-run:disabled { opacity: .5; cursor: default; }

.demo-output {
    font-family: var(--mono);
    font-size: .78rem;
    line-height: 1.7;
    min-height: 100px;
    padding: 14px 16px;
    background: var(--code-bg);
    color: var(--code-fg);
    border: 2px solid var(--black);
    white-space: pre-wrap;
    overflow-x: auto;
}
.demo-output .out-ok  { color: #c3e88d; }
.demo-output .out-err { color: #f07178; }
.demo-output .out-dim { color: #546e7a; }

/* ── AI GRID ───────────────────────────────────────────── */
.ai-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin: 16px 0;
}
.ai-card {
    background: var(--black);
    color: #fff;
    padding: 18px 16px;
    border: 2px solid var(--black);
    position: relative;
    overflow: hidden;
    transition: transform .2s;
    cursor: default;
}
.ai-card::before {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    height: 3px;
    width: 0%;
    background: var(--lime);
    transition: width .3s;
}
.ai-card:hover { transform: translateY(-3px); }
.ai-card:hover::before { width: 100%; }
.ai-card .ac-icon { font-size: 1.6rem; margin-bottom: 10px; display: block; }
.ai-card .ac-title {
    font-family: var(--display);
    font-size: .95rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 6px;
    color: var(--lime);
}
.ai-card .ac-body { font-size: .78rem; color: rgba(255,255,255,.55); line-height: 1.5; }

/* ── SCROLL TO TOP ─────────────────────────────────────── */
#top-btn {
    position: fixed;
    right: 24px; bottom: 24px;
    width: 44px; height: 44px;
    background: var(--black);
    border: 2px solid var(--lime);
    color: var(--lime);
    display: flex; align-items: center; justify-content: center;
    text-decoration: none;
    font-family: var(--display);
    font-size: 1.1rem;
    font-weight: 900;
    box-shadow: var(--shadow);
    opacity: 0; pointer-events: none;
    transform: translateY(10px);
    transition: opacity .25s, transform .25s;
    z-index: 200;
}
#top-btn.show { opacity: 1; pointer-events: auto; transform: translateY(0); }
#top-btn:hover { background: var(--lime); color: var(--black); }

/* ── FOOTER ────────────────────────────────────────────── */
footer {
    background: var(--black);
    color: rgba(255,255,255,.35);
    padding: 20px 28px;
    font-family: var(--mono);
    font-size: .68rem;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
footer .f-lime { color: var(--lime); }

/* ── RESPONSIVE ────────────────────────────────────────── */
@media (max-width: 768px) {
    .hero { padding: 44px 18px 40px; }
    .hero h1 { font-size: 4rem; }
    .hero-stats { flex-wrap: wrap; }
    .container { padding: 0 16px 60px; }
    .block-body { padding: 20px 16px; }
    .pipeline { flex-direction: column; }
    .pipe-step:not(:last-child)::after { content: '↓'; right: auto; top: auto; bottom: -12px; left: 50%; transform: translateX(-50%); }
    .block-num { font-size: 2rem; }
    .block-title { font-size: 1.2rem; }
    .header-inner { padding: 0 16px; }
    ul.feat { grid-template-columns: 1fr; }
    .ai-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
    .ai-grid { grid-template-columns: 1fr; }
    .demo-url-row { flex-direction: column; align-items: stretch; }
    .btn-run { width: 100%; }
}
