/* esquaresoft — feuille de style unique du site */

:root {
  --bg: #f7f8fa;
  --bg-alt: #eef1f5;
  --surface: #ffffff;
  --border: #dbe1e8;
  --text: #121821;
  --muted: #566273;
  --accent: #0f8f7f;          /* eScope : phosphore */
  --accent-soft: #d8f2ee;
  --corn: #c98a00;            /* Polenta : maïs */
  --corn-soft: #fbefd0;
  --grid: rgba(18, 24, 33, 0.06);
  --code-bg: #0f1620;
  --code-text: #d7e3ee;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 8px 24px rgba(16, 24, 40, .06);
  --radius: 12px;
  --maxw: 1120px;
  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1017;
    --bg-alt: #101722;
    --surface: #131c28;
    --border: #233042;
    --text: #e6edf5;
    --muted: #94a3b6;
    --accent: #2dd4bf;
    --accent-soft: #0f2f2c;
    --corn: #f4c04a;
    --corn-soft: #33290f;
    --grid: rgba(230, 237, 245, 0.05);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1017;
  --bg-alt: #101722;
  --surface: #131c28;
  --border: #233042;
  --text: #e6edf5;
  --muted: #94a3b6;
  --accent: #2dd4bf;
  --accent-soft: #0f2f2c;
  --corn: #f4c04a;
  --corn-soft: #33290f;
  --grid: rgba(230, 237, 245, 0.05);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre, .mono { font-family: var(--mono); }
code { font-size: .9em; background: var(--bg-alt); padding: .1em .35em; border-radius: 4px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 650; }
h3 { font-size: 1.15rem; font-weight: 600; }
p { margin: 0 0 1em; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .container { padding: 0 32px; } }

/* ---------- En-tête ---------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .container { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 650; font-size: 1.1rem; }
.brand:hover { text-decoration: none; }
.brand svg { width: 32px; height: 32px; }
.brand sup { color: var(--accent); font-size: .7em; }
.nav { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.nav a { color: var(--muted); padding: 8px 12px; border-radius: 8px; font-size: .95rem; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); background: var(--bg-alt); text-decoration: none; }
.theme-toggle {
  background: none; border: 1px solid var(--border); color: var(--muted);
  width: 36px; height: 36px; border-radius: 8px; cursor: pointer; display: grid; place-items: center;
}
.theme-toggle:hover { color: var(--text); }
.menu-toggle { display: none; }
@media (max-width: 760px) {
  .menu-toggle {
    display: grid; place-items: center; margin-left: auto;
    background: none; border: 1px solid var(--border); color: var(--text);
    width: 36px; height: 36px; border-radius: 8px; cursor: pointer;
  }
  .nav {
    display: none; position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; padding: 8px 16px 16px;
    background: var(--bg); border-bottom: 1px solid var(--border);
  }
  .nav.open { display: flex; }
  .nav .theme-toggle { align-self: flex-start; margin-top: 8px; }
}

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px; border-radius: 10px; font-weight: 600; font-size: .95rem;
  border: 1px solid transparent; cursor: pointer; transition: transform .1s, background .15s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #fff; }
:root[data-theme="dark"] .btn-primary { color: #06201d; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-primary { color: #06201d; } }
.btn-corn { background: var(--corn); color: #1b1300; }
.btn-ghost { border-color: var(--border); color: var(--text); background: var(--surface); }
.btn svg { width: 18px; height: 18px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Sections ---------- */
section { padding: 72px 0; }
section.alt { background: var(--bg-alt); border-block: 1px solid var(--border); }
.eyebrow {
  font-family: var(--mono); font-size: .8rem; text-transform: uppercase; letter-spacing: .12em;
  color: var(--accent); margin-bottom: 12px; display: block;
}
.lead { font-size: 1.15rem; color: var(--muted); max-width: 62ch; }
.section-head { margin-bottom: 40px; max-width: 70ch; }
.section-head p { color: var(--muted); }

/* ---------- Hero ---------- */
.hero { padding: 80px 0 64px; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse at 70% 40%, #000 30%, transparent 75%);
}
.hero .container { display: grid; gap: 48px; align-items: center; }
@media (min-width: 960px) { .hero .container { grid-template-columns: 1.05fr 1fr; } }
.hero h1 .hl { color: var(--accent); }
.hero .btn-row { margin-top: 28px; }
.hero-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.tag {
  font-family: var(--mono); font-size: .78rem; color: var(--muted);
  border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px; background: var(--surface);
}

/* Écran d'oscilloscope du hero */
.scope {
  background: #0a1210; border-radius: var(--radius); border: 1px solid #1d2b28;
  box-shadow: var(--shadow); overflow: hidden;
}
.scope-bar {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px;
  font: 12px var(--mono); color: #7fa59d; border-bottom: 1px solid #1d2b28;
}
.scope-bar .dot { width: 8px; height: 8px; border-radius: 50%; background: #e5484d; animation: blink 1.2s infinite; }
.scope-bar .right { margin-left: auto; }
@keyframes blink { 50% { opacity: .25; } }
.scope svg { width: 100%; height: auto; }
.scope .trace { fill: none; stroke-width: 2; stroke-linejoin: round; }
.scope .t1 { stroke: #2dd4bf; }
.scope .t2 { stroke: #f4c04a; }
.scope .t3 { stroke: #a78bfa; }
.scope .sweep { animation: sweep 6s linear infinite; }
@keyframes sweep { from { transform: translateX(0); } to { transform: translateX(-300px); } }
.scope-legend { display: flex; flex-wrap: wrap; gap: 16px; padding: 10px 14px; font: 12px var(--mono); color: #9fb8b2; border-top: 1px solid #1d2b28; }
.scope-legend span::before { content: ""; display: inline-block; width: 10px; height: 2px; margin-right: 6px; vertical-align: middle; background: currentColor; }
.scope-legend .l1 { color: #2dd4bf; } .scope-legend .l2 { color: #f4c04a; } .scope-legend .l3 { color: #a78bfa; }
@media (prefers-reduced-motion: reduce) { .scope .sweep, .scope-bar .dot { animation: none; } }

/* ---------- Cartes ---------- */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow); display: flex; flex-direction: column;
}
.card p { color: var(--muted); }
.card .card-foot { margin-top: auto; padding-top: 16px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.product-card { position: relative; overflow: hidden; }
.product-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--accent); }
.product-card.corn::before { background: var(--corn); }
.product-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.product-icon {
  width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); flex: none;
}
.corn .product-icon { background: var(--corn-soft); color: var(--corn); }
.product-icon svg { width: 26px; height: 26px; }
.product-head h3 { margin: 0; font-size: 1.35rem; }
.product-head small { color: var(--muted); font-size: .85rem; display: block; }
.checklist { list-style: none; padding: 0; margin: 0 0 8px; }
.checklist li { padding-left: 26px; position: relative; margin-bottom: 8px; color: var(--text); }
.checklist li::before {
  content: ""; position: absolute; left: 4px; top: .55em; width: 10px; height: 6px;
  border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg);
}
.corn .checklist li::before { border-color: var(--corn); }
.badge {
  font: 600 .72rem var(--mono); text-transform: uppercase; letter-spacing: .06em;
  padding: 3px 8px; border-radius: 6px; background: var(--bg-alt); color: var(--muted); border: 1px solid var(--border);
}
.badge.ok { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.badge.corn { background: var(--corn-soft); color: var(--corn); border-color: transparent; }
.card.soon { border-style: dashed; box-shadow: none; background: transparent; }

.feature h3 { display: flex; align-items: center; gap: 10px; }
.feature .ico { color: var(--accent); width: 22px; height: 22px; flex: none; }

/* ---------- Pages produit ---------- */
.page-hero { padding: 64px 0 48px; border-bottom: 1px solid var(--border); }
.page-hero .container { display: grid; gap: 40px; align-items: center; }
@media (min-width: 960px) { .page-hero .container { grid-template-columns: 1.1fr 1fr; } }
.page-hero.corn .eyebrow { color: var(--corn); }
.meta-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }

.diagram {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow);
}
.diagram svg text { font-family: var(--mono); font-size: 12px; fill: var(--text); }
.diagram .box { fill: var(--bg-alt); stroke: var(--border); }
.diagram .box-a { fill: var(--accent-soft); stroke: var(--accent); }
.diagram .box-c { fill: var(--corn-soft); stroke: var(--corn); }
.diagram .wire { stroke: var(--muted); stroke-width: 1.5; fill: none; }
.diagram .wire-a { stroke: var(--accent); stroke-width: 1.5; fill: none; }
.diagram .lbl { fill: var(--muted); font-size: 11px; }

pre.code {
  background: var(--code-bg); color: var(--code-text); padding: 18px 20px; border-radius: var(--radius);
  overflow-x: auto; font-size: .85rem; line-height: 1.55; margin: 0;
}
pre.code .c { color: #6b8193; } pre.code .k { color: #5eead4; } pre.code .s { color: #fcd34d; }

.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.steps li {
  counter-increment: step; position: relative; padding: 14px 16px 14px 56px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
}
.steps li::before {
  content: counter(step); position: absolute; left: 14px; top: 12px;
  width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center;
  font: 600 .85rem var(--mono); background: var(--accent-soft); color: var(--accent);
}
.corn-steps li::before { background: var(--corn-soft); color: var(--corn); }

table.tbl { width: 100%; border-collapse: collapse; font-size: .95rem; }
.tbl-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.tbl th, .tbl td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: top; }
.tbl th { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--bg-alt); }
.tbl tr:last-child td { border-bottom: 0; }

.split { display: grid; gap: 40px; align-items: start; }
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1fr; } }

/* ---------- Téléchargements ---------- */
.release {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow);
}
.release-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 8px; }
.release-head h3 { margin: 0; }
.release-meta { color: var(--muted); font-size: .9rem; margin-bottom: 16px; }
.assets { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 8px; }
.assets a {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 8px;
  border: 1px solid var(--border); color: var(--text); background: var(--bg);
}
.assets a:hover { border-color: var(--accent); text-decoration: none; }
.assets .size { margin-left: auto; color: var(--muted); font: .8rem var(--mono); }
.assets svg { width: 18px; height: 18px; color: var(--accent); flex: none; }
.release-status { color: var(--muted); font-size: .95rem; }
.history { margin-top: 12px; font-size: .9rem; }
.history summary { cursor: pointer; color: var(--muted); }
.history ul { padding-left: 18px; margin: 8px 0 0; }
.notes { font-size: .9rem; color: var(--muted); border-left: 3px solid var(--border); padding-left: 12px; margin-bottom: 16px; white-space: pre-wrap; max-height: 12em; overflow: auto; }

/* ---------- Contact / pied ---------- */
.cta {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 40px; display: grid; gap: 24px; align-items: center; box-shadow: var(--shadow);
}
@media (min-width: 860px) { .cta { grid-template-columns: 1.4fr auto; } }
.cta h2 { margin-bottom: 8px; }
.cta p { color: var(--muted); margin: 0; }

.site-footer { border-top: 1px solid var(--border); padding: 40px 0; color: var(--muted); font-size: .9rem; }
.site-footer .container { display: grid; gap: 24px; }
@media (min-width: 760px) { .site-footer .container { grid-template-columns: 2fr 1fr 1fr; } }
.site-footer h4 { color: var(--text); font-size: .85rem; margin: 0 0 10px; text-transform: uppercase; letter-spacing: .08em; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); }
.copyright { grid-column: 1 / -1; border-top: 1px solid var(--border); padding-top: 20px; font-size: .82rem; }

/* Grilles : une colonne qui ne s'élargit pas au contenu (évite le défilement horizontal sur mobile) */
.hero .container, .page-hero .container, .split { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 960px) {
  .hero .container { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
  .page-hero .container { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
}
@media (min-width: 900px) { .split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); }
@media (max-width: 600px) { .card, .cta { padding: 22px; } }

/* Sélecteur de langue */
.nav .lang-switch {
  font: 600 .8rem var(--mono); letter-spacing: .05em;
  border: 1px solid var(--border); padding: 7px 10px; margin-left: 4px;
}
@media (max-width: 760px) { .nav .lang-switch { align-self: flex-start; margin: 8px 0 0; } }
