/* ==========================================================
   Tokens
   ========================================================== */
:root {
  --bg: #eeefea;
  --bg-alt: #e4e6dd;
  --ink: #1c2321;
  --ink-soft: #4a5450;
  --accent: #2f5d62;
  --accent-warm: #a9702d;
  --line: #cbcfc4;
  --card-bg: #f8f8f4;

  --font-body: "IBM Plex Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  --radius: 3px;
  --max-width: 1080px;
}

@media (prefers-color-scheme: dark) {
  /* Le portfolio reste volontairement en thème clair unique :
     un rapport d'intervention se lit comme un document, pas un dashboard. */
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
}

h1, h2, h3 { font-weight: 700; line-height: 1.15; margin: 0 0 0.5em; }
p { margin: 0 0 1em; color: var(--ink-soft); }
a { color: var(--accent); }

.section-intro { max-width: 60ch; }

/* ==========================================================
   Header
   ========================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
  color: var(--ink);
}

.main-nav { display: flex; gap: 1.75rem; }
.main-nav a {
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 0.95rem;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}
.main-nav a:hover,
.main-nav a.is-active {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
}
.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--ink);
  display: block;
}

/* ==========================================================
   Hero
   ========================================================== */
.hero {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 4.5rem 1.5rem 4rem;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 3rem;
  align-items: start;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.hero h1 {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  margin-bottom: 0.75rem;
}

.hero-pitch {
  max-width: 48ch;
  font-size: 1.05rem;
}

.cta {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: var(--ink);
  color: var(--bg);
  text-decoration: none;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
}
.cta:hover { background: var(--accent); }

/* Spec card: fiche technique, coins en équerre */
.spec-card {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--line);
  padding: 1.5rem;
}
.spec-card::before,
.spec-card::after,
.spec-card-header::before,
.spec-card-header::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  border: 1.5px solid var(--accent-warm);
}
.spec-card::before { top: -1px; left: -1px; border-right: none; border-bottom: none; }
.spec-card::after  { bottom: -1px; right: -1px; border-left: none; border-top: none; }

.spec-card-header {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-soft);
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px dashed var(--line);
}

.spec-list div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}
.spec-list div:last-child { border-bottom: none; }
.spec-list dt {
  font-family: var(--font-mono);
  color: var(--ink-soft);
}
.spec-list dd { margin: 0; font-weight: 600; text-align: right; }

/* ==========================================================
   RP section
   ========================================================== */
.rp-section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

.rp-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-top: 2rem;
}

.rp-card {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}

.rp-card--template {
  border-left-color: var(--accent-warm);
  border-style: dashed;
}

.rp-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin-bottom: 0.75rem;
}
.rp-ref { color: var(--accent); font-weight: 600; }

.rp-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.6rem;
}

.rp-tags {
  list-style: none;
  padding: 0;
  margin: 0.25rem 0 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.rp-tags li {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius);
  color: var(--ink-soft);
}

.rp-link {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink);
  border-bottom: 1px solid var(--ink);
  align-self: flex-start;
  padding-bottom: 2px;
}
.rp-link:hover { color: var(--accent); border-color: var(--accent); }
.icon-doc { width: 15px; height: 15px; }

/* ==========================================================
   Skills
   ========================================================== */
.skills-section {
  background: var(--bg-alt);
  padding: 3.5rem 1.5rem;
}
.skills-grid {
  max-width: var(--max-width);
  margin: 2rem auto 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}
.skill-block h3 {
  font-size: 1rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.5rem;
  margin-bottom: 0.6rem;
}
.skill-block p { font-size: 0.92rem; margin: 0; }

/* ==========================================================
   Footer
   ========================================================== */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 2rem 1.5rem;
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--ink-soft);
}
.footer-inner p { margin: 0; }

/* ==========================================================
   Accessibilité
   ========================================================== */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* ==========================================================
   Responsive
   ========================================================== */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .rp-list { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 1.5rem;
    display: none;
  }
  .main-nav.is-open { display: flex; }
  .main-nav a { padding: 0.75rem 0; border-bottom: 1px solid var(--line); }
  .nav-toggle { display: flex; }
}
