/* ============================================================
   apple-style.css — design system unique du site
   Refonte : identité visuelle "carnet d'ingénieur" — sobre,
   technique, avec un vrai toggle clair/sombre mémorisé.

   Palette :
     --ink     #14171c  (texte sur fond clair / fond en mode sombre)
     --paper   #faf9f6  (fond clair, blanc cassé chaud)
     --steel   #3a5a78  (bleu-acier — accent technique, liens, focus)
     --graphite#6b7280  (gris neutre — texte secondaire, légendes)
     --signal  #c9663c  (rouille/cuivre — accent chaud, CTA, hover)

   Typo :
     Display : "Space Grotesk" (titres — géométrique, caractère technique)
     Body    : "Inter" (corps de texte — lisibilité maximale)
     Mono    : "JetBrains Mono" (dates, labels, métadonnées techniques)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --font-display: "Space Grotesk", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Consolas, monospace;

  /* ---- Mode clair (par défaut) ---- */
  --ink: #14171c;
  --ink-soft: #2b2f37;
  --paper: #faf9f6;
  --paper-raised: #ffffff;
  --steel: #3a5a78;
  --steel-soft: #e7edf2;
  --graphite: #6b7280;
  --graphite-soft: #9aa1ab;
  --signal: #c9663c;
  --signal-soft: #f3e2d8;
  --border: #e4e1da;
  --shadow-color: 20, 23, 28;

  --radius-card: 18px;
  --radius-chip: 999px;
  --max-width: 980px;
}

.dark {
  --ink: #f3f1ec;
  --ink-soft: #d6d3cc;
  --paper: #14161a;
  --paper-raised: #1c1f24;
  --steel: #7fa3c2;
  --steel-soft: #1f2c36;
  --graphite: #9aa1ab;
  --graphite-soft: #6b7280;
  --signal: #e08a5f;
  --signal-soft: #2e2117;
  --border: #2b2e34;
  --shadow-color: 0, 0, 0;
}

/* ====================== RESET ====================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  background: var(--paper);
  color-scheme: light dark;
}

html, body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* ====================== TYPO ====================== */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink);
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-bottom: 0.9rem;
}
h1 { font-size: 2.75rem; font-weight: 700; margin-bottom: 1.4rem; letter-spacing: -0.02em; }
h2 { font-size: 1.85rem; margin-bottom: 1.5rem; }
h3 { font-size: 1.18rem; margin-bottom: 0.9rem; font-weight: 600; }
h4 { font-size: 1.04rem; margin-bottom: 0.7rem; font-weight: 600; }

p, li { color: var(--ink-soft); font-weight: 400; font-size: 1.04rem; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--signal);
  font-weight: 500;
}

a {
  color: var(--steel);
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: color 0.15s, text-decoration-color 0.15s;
}
a:hover, a:focus-visible {
  color: var(--signal);
  text-decoration-color: var(--signal);
}
a:focus-visible {
  outline: 2px solid var(--steel);
  outline-offset: 3px;
  border-radius: 3px;
}

/* ====================== LAYOUT ====================== */
section {
  margin-bottom: 4rem;
  padding-top: 2.5rem;
  padding-bottom: 2.5rem;
}

.container, .main-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

/* ====================== FADE-IN (animation au scroll) ====================== */
.fade-in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s cubic-bezier(.4,0,.2,1), transform 0.6s cubic-bezier(.4,0,.2,1);
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .fade-in { opacity: 1; transform: none; transition: none; }
}
.image-hover-zoom { transition: transform 0.4s ease; }
.image-hover-zoom:hover { transform: scale(1.04); }

/* ====================== SCHOOL CARDS (éducation) ====================== */
.school-card {
  background: var(--paper-raised);
  border-radius: var(--radius-card);
  box-shadow: 0 1px 2px rgba(var(--shadow-color), 0.04), 0 12px 28px rgba(var(--shadow-color), 0.07);
  padding: 2.4rem 2rem 2rem 2rem;
  margin-bottom: 2.2rem;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
  border: 1px solid var(--border);
  transition: background 0.25s, border-color 0.25s, box-shadow 0.25s;
}
@media (min-width: 700px) {
  .school-card { padding-left: 3.5rem; padding-right: 3.5rem; }
}

.school-logo {
  display: block;
  width: 130px;
  height: 130px;
  object-fit: contain;
  border-radius: 8px;
  margin: 0 auto 1.4rem auto;
}

.school-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  text-align: center;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.4rem;
}
.school-years {
  font-family: var(--font-mono);
  color: var(--graphite);
  text-align: center;
  margin-bottom: 0.75rem;
  font-size: 0.92rem;
  letter-spacing: 0.01em;
}
.school-badge {
  display: inline-block;
  margin: 0 auto 1.2rem auto;
  padding: 0.32em 1.1em;
  border-radius: var(--radius-chip);
  font-size: 0.92rem;
  background: var(--steel-soft);
  color: var(--steel);
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* ====================== CHIPS/BADGES ====================== */
.chips-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
  margin-bottom: 1.6rem;
}
.chip {
  background: var(--steel-soft);
  color: var(--ink-soft);
  font-size: 0.94rem;
  padding: 0.34em 1.05em;
  border-radius: var(--radius-chip);
  display: inline-flex;
  align-items: center;
  font-weight: 500;
  border: 1px solid transparent;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}
.chip.project {
  background: var(--signal-soft);
  border-color: rgba(201, 102, 60, 0.18);
  font-style: italic;
}
.chip a {
  color: inherit !important;
  text-decoration: underline dotted var(--graphite-soft);
  font-weight: 500;
}

/* ====================== SEMESTER TITLES ====================== */
.semester-title {
  font-family: var(--font-mono);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--graphite);
  margin: 2rem 0 0.8rem 0;
  font-size: 0.82rem;
  text-align: left;
  padding-left: 0.5rem;
  border-left: 2px solid var(--signal);
}

/* ====================== DIVIDER ====================== */
.divider {
  height: 1px;
  border: none;
  background: linear-gradient(to right, transparent, var(--border), transparent);
  margin: 2.2rem auto;
  width: 90%;
}

.apple-link {
  color: var(--steel);
  text-decoration: underline dotted var(--graphite-soft);
  font-weight: 500;
  transition: color 0.18s;
}
.apple-link:hover {
  color: var(--signal);
  text-decoration: underline solid var(--signal);
}

/* ====================== APPLE CARD (projets) ====================== */
.apple-card {
  background: var(--paper-raised);
  border-radius: var(--radius-card);
  box-shadow: 0 1px 2px rgba(var(--shadow-color), 0.04), 0 12px 28px rgba(var(--shadow-color), 0.07);
  padding: 2.6rem 2rem 2.1rem 2rem;
  margin-bottom: 2.2rem;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  text-align: left;
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  transition: background 0.25s, border-color 0.25s;
}
/* Coin chanfreiné technique en pseudo-élément : pas de clip-path qui
   couperait box-shadow et déclencherait des bugs de rendu */
.apple-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 28px;
  height: 28px;
  background: var(--paper);
  clip-path: polygon(0 0, 100% 0, 100% 100%);
  border-bottom-left-radius: 4px;
  transition: background 0.25s;
}
@media (max-width: 640px) {
  .apple-card { padding: 1.5rem 1.1rem; }
  .apple-card::before { width: 18px; height: 18px; }
}

/* ====================== EXPERIENCE LOGO ====================== */
.experience-logo {
  height: 4rem;
  width: 4rem;
  object-fit: contain;
  border-radius: 8px;
}

/* ====================== NAV/FOOTER ====================== */
footer, header {
  background: var(--paper-raised);
  color: var(--graphite);
  border-color: var(--border);
}

footer a, header a {
  color: var(--ink-soft);
  font-weight: 500;
  text-decoration: none;
}
footer a:hover, header a:hover { color: var(--signal); text-decoration: underline; }

[data-nav].active-nav-link {
  color: var(--signal) !important;
  font-weight: 700;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: var(--paper-raised); /* fallback si color-mix non supporté */
  background-color: color-mix(in srgb, var(--paper-raised) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none !important;
}
.brand-logo { height: 2.3rem; width: 2.3rem; border-radius: 8px; }
.brand-name {
  font-family: var(--font-display);
  font-size: 1.28rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
  user-select: none;
}
.nav-desktop {
  display: none;
  align-items: center;
  gap: 1.9rem;
  font-size: 0.92rem;
  font-weight: 500;
}
.nav-desktop a { color: var(--ink-soft); text-decoration: none; }
.nav-desktop a:hover { color: var(--signal); }
.lang-switch {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 0.25em 0.65em;
}
.lang-switch:hover { border-color: var(--signal); }

.nav-mobile-controls { display: flex; align-items: center; gap: 0.6rem; }
.burger-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  cursor: pointer;
}
.burger-btn svg { width: 20px; height: 20px; }
.burger-btn:hover { border-color: var(--signal); color: var(--signal); }

.nav-mobile {
  border-top: 1px solid var(--border);
  padding: 0.5rem 1.5rem 1rem 1.5rem;
  display: flex;
  flex-direction: column;
}
.nav-mobile a {
  padding: 0.75rem 0;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}
.nav-mobile a:last-child { border-bottom: none; }
.nav-mobile a:hover { color: var(--signal); }
.nav-mobile.hidden { display: none; }

@media (min-width: 768px) {
  .nav-desktop { display: flex; }
  .nav-mobile-controls .burger-btn { display: none; }
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 5rem;
  padding: 2.4rem 0;
}
.site-footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
.footer-copy {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--graphite);
  letter-spacing: 0.01em;
}
.footer-links { display: flex; gap: 1.8rem; }
.footer-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
}
.footer-links a:hover { color: var(--signal); text-decoration: underline; }

@media (min-width: 640px) {
  .site-footer-inner { flex-direction: row; justify-content: space-between; }
}

/* ====================== PAGE ACCUEIL ====================== */
.hero-section { padding-top: 3.5rem; padding-bottom: 1rem; }
.hero-grid {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 3rem;
}
.hero-text { text-align: center; }
.hero-text .lede {
  font-size: 1.2rem;
  color: var(--ink-soft);
  font-weight: 500;
  margin-bottom: 1rem;
}
.hero-portrait img {
  border-radius: 50%;
  box-shadow: 0 18px 40px rgba(var(--shadow-color), 0.18);
  max-width: 230px;
  width: 100%;
  object-fit: cover;
  border: 1px solid var(--border);
}

@media (min-width: 768px) {
  .hero-section { padding-top: 5rem; padding-bottom: 2rem; }
  .hero-grid { flex-direction: row; align-items: center; gap: 4rem; }
  .hero-text { text-align: left; flex: 1; }
  .hero-text .lede, .hero-text p { max-width: 32rem; }
  .hero-portrait { flex: 0 0 auto; }
  .hero-portrait img { max-width: 280px; }
}

.panel-card {
  background: var(--paper-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 2.4rem 2rem;
  box-shadow: 0 1px 2px rgba(var(--shadow-color), 0.04), 0 12px 28px rgba(var(--shadow-color), 0.06);
}

.reason-list {
  list-style: none;
  display: grid;
  gap: 0.9rem;
  margin-top: 1.5rem;
}
.reason-list li {
  position: relative;
  padding-left: 1.6rem;
  font-size: 1.05rem;
}
.reason-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 8px;
  height: 8px;
  background: var(--signal);
  border-radius: 2px;
  transform: rotate(45deg);
}

/* ====================== PAGE EXPÉRIENCES ====================== */
.exp-card {
  background: var(--paper-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 2.2rem 1.6rem;
  margin-bottom: 2rem;
}
@media (min-width: 700px) {
  .exp-card { padding: 2.4rem 2.4rem; }
}
.exp-head {
  display: flex;
  align-items: center;
  gap: 1.3rem;
  margin-bottom: 1.6rem;
}
.exp-head h3 { margin-bottom: 0.25rem; }
.exp-meta {
  font-family: var(--font-mono);
  font-size: 0.86rem;
  color: var(--graphite);
}
.exp-grid {
  display: grid;
  gap: 2rem;
}
@media (min-width: 768px) {
  .exp-grid { grid-template-columns: 1.4fr 1fr; }
}
.exp-list {
  list-style: none;
  display: grid;
  gap: 1rem;
}
.exp-list li {
  font-size: 1rem;
  padding-left: 1.1rem;
  border-left: 2px solid var(--border);
}
.exp-list strong { display: block; color: var(--ink); margin-bottom: 0.2rem; font-weight: 600; }
.exp-skills {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-content: flex-start;
}
.exp-skills li {
  background: var(--steel-soft);
  color: var(--ink-soft);
  font-size: 0.85rem;
  padding: 0.32em 0.85em;
  border-radius: var(--radius-chip);
}

/* ====================== BOUTON CTA ====================== */
.cta-button {
  display: inline-block;
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
  font-size: 0.98rem;
  padding: 0.65em 1.7em;
  border-radius: var(--radius-chip);
  text-decoration: none !important;
  transition: background 0.2s, transform 0.15s;
}
.cta-button:hover {
  background: var(--signal);
  transform: translateY(-1px);
}
.dark .cta-button { background: var(--paper-raised); border: 1px solid var(--border); }
.dark .cta-button:hover { background: var(--signal); border-color: var(--signal); }

/* ====================== PORTFOLIO NAV (cartes "Explorer le portfolio") ====================== */
.portfolio-nav-section {
  background: var(--ink);
  color: var(--paper);
}
.dark .portfolio-nav-section { background: var(--paper-raised); }

.portfolio-nav {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin: 2rem auto 0 auto;
  max-width: 700px;
}
@media (min-width: 600px) {
  .portfolio-nav { grid-template-columns: repeat(3, 1fr); }
}
.portfolio-nav a {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 1.1rem 0.6rem;
  color: var(--paper);
  font-weight: 500;
  text-align: center;
  transition: background 0.2s, border-color 0.2s;
  text-decoration: none;
  display: block;
}
.portfolio-nav a:hover { background: rgba(255,255,255,0.12); border-color: var(--signal); color: var(--paper); }

/* ====================== TOGGLE CLAIR/SOMBRE ====================== */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--paper-raised);
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
}
.theme-toggle:hover { border-color: var(--signal); color: var(--signal); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
.dark .theme-toggle .icon-sun { display: block; }
.dark .theme-toggle .icon-moon { display: none; }

/* ====================== RESPONSIVE GLOBAL ====================== */
@media (max-width: 600px) {
  .school-logo { width: 100px; height: 100px; }
  .container, .main-container { padding: 1rem 0.3rem; }
  h1 { font-size: 2.1rem; }
}

::-webkit-scrollbar { width: 9px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 7px; }

/* ========== END ========== */
