/* opensource.css — IUT Informatique — Design académique éditorial */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,700;1,9..144,400&family=DM+Sans:wght@400;500;600&family=DM+Mono:wght@400;500&display=swap');

:root {
  --bg:        #f8f5f0;
  --bg2:       #f0ebe3;
  --surface:   #ffffff;
  --border:    #e2d9cc;
  --ink:       #1c1a17;
  --ink2:      #3d3730;
  --muted:     #7c7168;
  --accent:    #2d6a4f;       /* vert forêt profond */
  --accent2:   #d4a017;       /* ocre doré */
  --accent3:   #b5451b;       /* rouge brique */
  --light-g:   #d8f3dc;
  --light-y:   #fff3cd;
  --light-r:   #fde8e0;
  --light-b:   #e8f4fd;
  --font-head: 'Fraunces', serif;
  --font-body: 'DM Sans', sans-serif;
  --font-mono: 'DM Mono', monospace;
  --radius:    10px;
}

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15.5px;
  line-height: 1.75;
}

/* ─── HERO ──────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--accent) 0%, #1b4332 60%, #0a2e1e 100%);
  color: #e9f5ee;
  padding: 64px 48px 52px;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}
.hero-inner { position: relative; max-width: 1100px; margin: 0 auto; }
.hero-kicker {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--accent2);
  margin-bottom: 16px; display: flex; align-items: center; gap: 8px;
}
.hero-kicker::before { content: ''; display: block; width: 24px; height: 1px; background: var(--accent2); }
.hero h1 {
  font-family: var(--font-head); font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 700; line-height: 1.1; letter-spacing: -.5px;
  color: #fff; margin-bottom: 18px;
}
.hero h1 em { color: var(--accent2); font-style: italic; }
.hero-sub { color: rgba(233,245,238,.8); font-size: 16px; max-width: 600px; margin-bottom: 32px; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.badge {
  font-family: var(--font-mono); font-size: 11px;
  padding: 5px 13px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.08);
  color: #d0edda;
}

/* ─── LAYOUT ─────────────────────────────────────────────── */
.layout { display: flex; max-width: 1260px; margin: 0 auto; padding: 0 20px; }

nav.sidebar {
  width: 220px; flex-shrink: 0;
  position: sticky; top: 24px; align-self: flex-start;
  padding: 32px 0; margin-right: 40px;
}
.nav-label {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted);
  padding: 0 10px 8px; margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.nav-list { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
nav.sidebar a {
  color: var(--muted); text-decoration: none; font-size: 13px;
  padding: 6px 10px; border-radius: 6px;
  transition: all .2s; display: block;
}
nav.sidebar a:hover { color: var(--accent); background: var(--light-g); }
nav.sidebar a.active { color: var(--accent); background: var(--light-g); font-weight: 600; }

/* ─── MAIN ──────────────────────────────────────────────── */
main { flex: 1; padding: 40px 0 80px; min-width: 0; }

section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 34px;
  margin-bottom: 20px;
  scroll-margin-top: 30px;
  transition: border-color .25s, box-shadow .25s;
}
section:hover { border-color: #b5c9bd; box-shadow: 0 4px 20px rgba(45,106,79,.07); }

h2 {
  font-family: var(--font-head); font-size: 22px; font-weight: 700;
  color: var(--ink); margin-bottom: 16px;
  display: flex; align-items: center; gap: 10px;
}
h2 .num {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--accent); border: 1px solid var(--accent);
  border-radius: 4px; padding: 2px 7px;
}
h3 { font-family: var(--font-head); font-size: 16px; color: var(--ink2); margin: 20px 0 8px; }

p { color: var(--ink2); margin-bottom: 12px; }

/* ─── CALLOUTS ──────────────────────────────────────────── */
.note, .ok, .warn, .info {
  border-radius: var(--radius); padding: 14px 18px; margin: 14px 0;
  font-size: 14px; display: flex; gap: 12px; align-items: flex-start;
}
.note { background: var(--light-y); border-left: 4px solid var(--accent2); color: #7a5800; }
.ok   { background: var(--light-g); border-left: 4px solid var(--accent);  color: #145c37; }
.warn { background: var(--light-r); border-left: 4px solid var(--accent3); color: #7a2310; }
.info { background: var(--light-b); border-left: 4px solid #3085c3; color: #1a4f72; }
.callout-icon { flex-shrink: 0; font-size: 16px; }

/* ─── GRID ──────────────────────────────────────────────── */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; margin: 16px 0; }
.card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px;
}
.card h3 { margin-top: 0; font-size: 15px; color: var(--accent); }
.card p { font-size: 14px; color: var(--muted); margin: 0; }

/* ─── LICENSE GRID ──────────────────────────────────────── */
.lic-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin: 16px 0; }
.lic-card {
  border-radius: var(--radius); padding: 18px;
  border: 1px solid var(--border);
}
.lic-card.permissive { background: linear-gradient(135deg, #e9f7ef, #f8fff9); }
.lic-card.copyleft   { background: linear-gradient(135deg, #fef9e7, #fffdf0); }
.lic-card.other      { background: linear-gradient(135deg, #e8f4fd, #f5faff); }
.lic-card h3 { font-family: var(--font-mono); font-size: 14px; margin: 0 0 8px; color: var(--ink); }
.lic-tag {
  display: inline-block; font-family: var(--font-mono); font-size: 10px;
  padding: 2px 8px; border-radius: 999px; margin-bottom: 8px;
}
.lic-tag.p { background: #d8f3dc; color: #1b5e35; }
.lic-tag.c { background: #fff3cd; color: #7a5800; }
.lic-tag.o { background: #dbeafe; color: #1e3a8a; }
.lic-card p { font-size: 13px; margin: 0; color: var(--muted); }

/* ─── TABLE ─────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); margin: 16px 0; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { background: var(--bg2); color: var(--accent); font-family: var(--font-mono); font-size: 11.5px;
     letter-spacing: .05em; text-transform: uppercase; padding: 10px 14px; text-align: left;
     border-bottom: 2px solid var(--accent); }
td { padding: 10px 14px; border-bottom: 1px solid var(--border); color: var(--ink2); }
td:first-child { font-weight: 600; color: var(--ink); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg); }

/* ─── ORDERED LIST ──────────────────────────────────────── */
.steps { counter-reset: step; list-style: none; padding: 0; }
.steps li {
  counter-increment: step;
  padding: 10px 0 10px 48px;
  position: relative;
  border-bottom: 1px solid var(--border);
  color: var(--ink2);
}
.steps li:last-child { border-bottom: none; }
.steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute; left: 0; top: 10px;
  font-family: var(--font-mono); font-size: 12px;
  color: var(--accent); font-weight: 600;
  background: var(--light-g); border-radius: 4px;
  width: 32px; text-align: center; padding: 2px 0;
}

/* ─── CHIP LIST ─────────────────────────────────────────── */
.chip-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.chip {
  background: var(--light-g); border: 1px solid #b7e4c7;
  color: var(--accent); border-radius: 6px;
  font-family: var(--font-mono); font-size: 12px;
  padding: 4px 12px;
}

/* ─── PROGRESS BAR ──────────────────────────────────────── */
#progress { position: fixed; top: 0; left: 0; height: 3px; background: var(--accent); z-index: 999; width: 0%; transition: width .1s; }

/* ─── FOOTER ─────────────────────────────────────────────── */
footer {
  background: var(--accent); color: #a8d5bc;
  padding: 24px 48px; text-align: center;
  font-family: var(--font-mono); font-size: 12px;
}

/* ─── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 900px) {
  nav.sidebar { display: none; }
  .layout { padding: 0 14px; }
  .hero { padding: 40px 20px 34px; }
}
@media (max-width: 600px) {
  section { padding: 18px; }
  .grid, .lic-grid { grid-template-columns: 1fr; }
}
