/* ============================================
   EQF-SOFTWARE — style.css
   Terminal / ingénierie — vert électrique
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:ital,wght@0,300;0,400;0,500;0,600;1,300&family=IBM+Plex+Mono:wght@400;500&display=swap');

/* ── Variables ── */
:root {
  --white:    #ffffff;
  --off:      #f8f9fa;
  --ui:       #f0f2f5;
  --border:   #dde1e7;
  --border2:  #c1c7cd;
  --text:     #121619;
  --text-2:   #3d4349;
  --text-3:   #697077;
  --green:    #00c853;
  --green-2:  #00a846;
  --green-bg: #e6f9ee;
  --red:      #da1e28;
  --amber:    #f1c21b;
  --blue:     #0f62fe;
  --mono:     'IBM Plex Mono', monospace;
  --sans:     'IBM Plex Sans', sans-serif;
}

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

body {
  font-family: var(--sans);
  background: var(--white);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Topbar ── */
.topbar {
  height: 48px;
  background: var(--text);
  display: flex;
  align-items: center;
  padding: 0 2rem;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 2px solid var(--green);
}

.topbar-brand {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--white);
  text-decoration: none;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.topbar-brand span { color: var(--green); }

.topbar-nav {
  display: flex;
  list-style: none;
  gap: 0;
}

.topbar-nav a {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: #8d9399;
  text-decoration: none;
  padding: 0 0.9rem;
  height: 48px;
  display: flex;
  align-items: center;
  letter-spacing: 0.04em;
  border-left: 1px solid rgba(255,255,255,0.06);
  transition: color 0.15s, background 0.15s;
}

.topbar-nav a:hover { color: var(--white); background: rgba(255,255,255,0.04); }
.topbar-nav a.active { color: var(--green); }

/* ── Hero ── */
.hero {
  background: var(--text);
  padding: 5rem 2rem 4rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,200,83,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,200,83,0.04) 1px, transparent 1px);
  background-size: 40px 40px;
}

.hero-inner {
  max-width: 1080px;
  margin: 0 auto;
  position: relative;
}

.hero-tag {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.hero-tag::before {
  content: '';
  display: inline-block;
  width: 1.5rem;
  height: 1px;
  background: var(--green);
}

.hero h1 {
  font-family: var(--sans);
  font-size: clamp(2rem, 4vw, 3.4rem);
  font-weight: 600;
  color: var(--white);
  line-height: 1.1;
  letter-spacing: -0.02em;
  max-width: 800px;
  margin-bottom: 1.5rem;
}

.hero h1 em {
  font-style: normal;
  color: var(--green);
}

.hero-lead {
  font-size: 1rem;
  font-weight: 300;
  color: #8d9399;
  max-width: 640px;
  line-height: 1.75;
  margin-bottom: 2.5rem;
}

.hero-lead a {
  color: var(--green);
  text-decoration: none;
  border-bottom: 1px solid rgba(0,200,83,0.4);
  transition: border-color 0.15s;
}

.hero-lead a:hover { border-color: var(--green); }

.hero-metrics {
  display: flex;
  gap: 0;
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 2rem;
  flex-wrap: wrap;
}

.metric {
  padding: 0 2.5rem 0 0;
  margin-right: 2.5rem;
  border-right: 1px solid rgba(255,255,255,0.08);
}

.metric:last-child { border-right: none; }

.metric-val {
  font-family: var(--mono);
  font-size: 1.8rem;
  font-weight: 500;
  color: var(--green);
  line-height: 1;
  margin-bottom: 0.35rem;
}

.metric-label {
  font-size: 0.75rem;
  color: #697077;
  line-height: 1.4;
  max-width: 160px;
}

/* ── Section wrapper ── */
.section { border-bottom: 1px solid var(--border); }
.section.alt { background: var(--off); }
.section.dark { background: var(--text); }

.section-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 3.5rem 2rem;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 4rem;
  align-items: start;
}

/* ── Sidebar ── */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sidebar-tag {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green);
  background: var(--green-bg);
  padding: 0.2rem 0.55rem;
  display: inline-block;
  width: fit-content;
}

.section.dark .sidebar-tag { background: rgba(0,200,83,0.1); }

.sidebar-title {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-2);
  line-height: 1.3;
}

.section.dark .sidebar-title { color: #8d9399; }

.sidebar-link {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--green);
  text-decoration: none;
  margin-top: 0.5rem;
  letter-spacing: 0.04em;
  transition: opacity 0.15s;
}

.sidebar-link:hover { opacity: 0.75; }

/* ── Typography ── */
h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.015em;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.section.dark h2 { color: var(--white); }

h3 {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-2);
  margin: 2rem 0 0.65rem;
}

.section.dark h3 { color: #8d9399; }

p {
  font-size: 0.92rem;
  color: var(--text-2);
  line-height: 1.75;
  max-width: 680px;
  margin-bottom: 0.9rem;
  font-weight: 300;
}

.section.dark p { color: #8d9399; }
p strong { font-weight: 600; color: var(--text); }
.section.dark p strong { color: var(--white); }

a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
  font-family: var(--mono);
  font-size: 0.8em;
  background: var(--ui);
  color: var(--blue);
  padding: 0.1em 0.4em;
  border: 1px solid var(--border);
}

.section.dark code {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.1);
  color: #82cfff;
}

/* ── Callout ── */
.callout {
  border-left: 3px solid var(--green);
  background: var(--green-bg);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  max-width: 680px;
}

.callout.warn { border-left-color: var(--amber); background: #fdf6d0; }
.callout.danger { border-left-color: var(--red); background: #fff0f1; }

.callout-tag {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--green-2);
  margin-bottom: 0.4rem;
  font-weight: 500;
}

.callout.warn .callout-tag { color: #8e5f00; }
.callout.danger .callout-tag { color: var(--red); }
.callout p { font-size: 0.88rem; margin: 0; max-width: none; }

/* ── Spec table ── */
.spec-table {
  width: 100%;
  max-width: 680px;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.85rem;
}

.spec-table th {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  border-bottom: 2px solid var(--border2);
  text-align: left;
  background: var(--ui);
}

.spec-table td {
  padding: 0.75rem 0.75rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
  vertical-align: top;
  font-weight: 300;
}

.section.dark .spec-table th { background: #1c2025; color: #697077; border-color: rgba(255,255,255,0.08); }
.section.dark .spec-table td { border-color: rgba(255,255,255,0.06); color: #8d9399; }
.section.dark .spec-table tr:hover td { background: #252a30; }

.spec-table tr:last-child td { border-bottom: none; }
.spec-table tr:hover td { background: var(--off); }

/* ── Badges ── */
.badge {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.18rem 0.5rem;
  border: 1px solid;
  display: inline-block;
}

.badge.ok     { color: var(--green-2); border-color: var(--green-2); background: var(--green-bg); }
.badge.warn   { color: #8e5f00; border-color: #c99d00; background: #fdf6d0; }
.badge.danger { color: var(--red); border-color: var(--red); background: #fff0f1; }

/* ── Checklist ── */
.checklist { list-style: none; max-width: 680px; margin: 1.25rem 0; }

.checklist li {
  display: flex;
  gap: 0.85rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--text-2);
  font-weight: 300;
  align-items: flex-start;
  line-height: 1.6;
}

.checklist li:last-child { border-bottom: none; }
.section.dark .checklist li { border-color: rgba(255,255,255,0.06); color: #8d9399; }

.cl-mark { font-family: var(--mono); font-size: 0.68rem; flex-shrink: 0; margin-top: 0.2rem; font-weight: 500; }
.cl-mark.ok  { color: var(--green); }
.cl-mark.no  { color: var(--red); }
.cl-mark.arr { color: var(--text-3); }

/* ── Card grid ── */
.card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  margin: 1.5rem 0;
  max-width: 680px;
}

.card { background: var(--white); padding: 1.25rem; transition: background 0.12s; }
.section.alt .card { background: var(--off); }
.section.dark .card { background: #1c2025; }
.card:hover { background: var(--ui); }
.section.dark .card:hover { background: #252a30; }

.card-tag { font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 0.5rem; }
.card-tag.ok { color: var(--green); }
.card-tag.no { color: var(--red); }
.card-title { font-size: 0.9rem; font-weight: 600; color: var(--text); margin-bottom: 0.35rem; }
.section.dark .card-title { color: var(--white); }
.card-body { font-size: 0.82rem; color: var(--text-3); line-height: 1.55; font-weight: 300; }
.section.dark .card-body { color: #697077; }

/* ── Figure / schema ── */
figure { margin: 2rem 0; max-width: 680px; }
figcaption { font-family: var(--mono); font-size: 0.7rem; color: var(--text-3); margin-top: 0.5rem; letter-spacing: 0.04em; }
.section.dark figcaption { color: #697077; }

/* ── Page header (pages internes) ── */
.page-header {
  background: var(--text);
  border-bottom: 2px solid var(--green);
  padding: 3rem 2rem 2.5rem;
}

.page-header-inner { max-width: 1080px; margin: 0 auto; }

.page-tag {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.page-tag::before { content: ''; display: inline-block; width: 1rem; height: 1px; background: var(--green); }

.page-header h1 {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 600;
  color: var(--white);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 0.75rem;
}

.page-lead {
  font-size: 0.95rem;
  color: #697077;
  max-width: 620px;
  line-height: 1.75;
  font-weight: 300;
  font-style: italic;
}

/* ── Page nav ── */
.page-nav {
  border-top: 1px solid var(--border);
  padding: 1.75rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  max-width: 1080px;
  margin: 0 auto;
}

.pn-link { display: flex; flex-direction: column; gap: 0.25rem; text-decoration: none; }
.pn-dir { font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3); }
.pn-title { font-size: 0.95rem; font-weight: 500; color: var(--text); transition: color 0.15s; }
.pn-link:hover .pn-title { color: var(--green); }
.pn-link.next { text-align: right; }

/* ── Divider ── */
hr.div { border: none; border-top: 1px solid var(--border); margin: 2rem 0; max-width: 680px; }
.section.dark hr.div { border-color: rgba(255,255,255,0.08); }

/* ── Footer ── */
footer {
  background: var(--text);
  padding: 1.75rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.footer-copy { font-size: 0.72rem; color: #3d4349; }

/* ── Responsive ── */
@media (max-width: 760px) {
  .topbar-nav { display: none; }
  .section-inner { grid-template-columns: 1fr; gap: 1.5rem; }
  .sidebar { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 0.5rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
  .sidebar-link { margin-top: 0; }
  .card-grid { grid-template-columns: 1fr; }
  .hero-metrics { gap: 1.5rem; }
  .metric { border-right: none; padding-right: 0; margin-right: 0; }
}
