/* ─── VARIABLES ─── */
:root {
  --bg:        #F5F4EF;
  --bg2:       #ECEAE2;
  --ink:       #181818;
  --ink-light: #6A6A6A;
  --accent:    #1A4FBA;
  --accent2:   #0D3A9E;
  --border:    #D8D6CC;
  --white:     #FFFFFF;
  --card:      #FAFAF7;
  --nav-h:     60px;
  --radius:    4px;
  --trans:     0.22s ease;
}

/* ─── RESET ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Karla', sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ─── TYPOGRAPHY ─── */
.serif { font-family: 'Cormorant Garamond', serif; }
h1 { font-family: 'Cormorant Garamond', serif; font-size: clamp(2.4rem, 5vw, 4rem); font-weight: 500; line-height: 1.1; letter-spacing: -0.02em; }
h2 { font-family: 'Cormorant Garamond', serif; font-size: clamp(1.8rem, 3vw, 2.6rem); font-weight: 500; line-height: 1.2; }
h3 { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-light); }
p { color: var(--ink); max-width: 68ch; }

/* ─── NAV ─── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  background: rgba(245,244,239,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(1.2rem, 4vw, 3rem);
}
.nav-logo {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem; font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.nav-logo span { color: var(--accent); }
.nav-links { display: flex; gap: 0.2rem; align-items: center; }
.nav-links a {
  font-size: 0.8rem; font-weight: 500; letter-spacing: 0.05em;
  padding: 0.4rem 0.8rem; border-radius: var(--radius);
  color: var(--ink-light); transition: color var(--trans), background var(--trans);
}
.nav-links a:hover, .nav-links a.active { color: var(--ink); background: var(--bg2); }
.nav-links a.active { color: var(--accent); }
.burger { display: none; flex-direction: column; gap: 5px; cursor: pointer; padding: 4px; }
.burger span { display: block; width: 22px; height: 2px; background: var(--ink); border-radius: 2px; transition: var(--trans); }

/* ─── PAGES ─── */
.page { padding-top: var(--nav-h); min-height: 100vh; animation: fadeIn 0.35s ease; display: none; }
.page.active { display: block; }
@keyframes fadeIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }

/* ─── LAYOUT HELPERS ─── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 clamp(1.2rem, 4vw, 3rem); }
.section { padding: 5rem 0; }
.label {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 1.2rem;
}
.label::before { content: ''; display: block; width: 20px; height: 1px; background: var(--accent); }
.divider { width: 100%; height: 1px; background: var(--border); margin: 3rem 0; }

/* ─── HOME PAGE ─── */
.hero {
  min-height: calc(100vh - var(--nav-h));
  display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center;
}
.hero-text { padding: 4rem 0; }
.hero-text h1 { margin-bottom: 1.4rem; }
.hero-text .subtitle {
  font-size: 1.05rem; color: var(--ink-light); margin-bottom: 2.4rem; max-width: 50ch;
}
.hero-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 2.4rem; }
.tag {
  font-size: 0.75rem; font-weight: 500; letter-spacing: 0.04em;
  padding: 0.3rem 0.8rem; border: 1px solid var(--border);
  border-radius: 20px; color: var(--ink-light); background: var(--card);
}
.hero-cta { display: flex; gap: 1rem; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.7rem 1.6rem; border-radius: var(--radius);
  font-size: 0.82rem; font-weight: 600; letter-spacing: 0.04em;
  transition: all var(--trans); cursor: pointer; border: none; text-align: center;
}
.btn-primary { background: var(--accent); color: #fff !important; }
.btn-primary:hover { background: var(--accent2); transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--ink) !important; border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--ink); background: var(--bg2); }
.hero-visual {
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.photo-placeholder {
  width: 320px; height: 400px; border-radius: 6px;
  background: linear-gradient(145deg, var(--bg2) 0%, var(--border) 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.8rem; color: var(--ink-light); border: 1px solid var(--border);
  position: relative; overflow: hidden;
}
.photo-placeholder::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, transparent 60%, rgba(26,79,186,0.06));
}
.photo-placeholder svg { opacity: 0.35; }
.photo-placeholder p { font-size: 0.78rem; text-align: center; max-width: 18ch; }
.photo-frame {
  position: absolute; top: -10px; left: -10px; right: -10px; bottom: -10px;
  border: 1px solid var(--accent); opacity: 0.12; border-radius: 8px;
  pointer-events: none;
}

/* quick stats */
.stats-bar {
  display: grid; grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--border); border-radius: 6px; overflow: hidden;
  margin-top: 4rem; background: var(--card);
}
.stat { padding: 1.4rem 1.6rem; border-right: 1px solid var(--border); }
.stat:last-child { border-right: none; }
.stat-num { font-family: 'Cormorant Garamond', serif; font-size: 2.2rem; font-weight: 500; color: var(--accent); line-height: 1; margin-bottom: 0.25rem; }
.stat-label { font-size: 0.75rem; color: var(--ink-light); font-weight: 500; }

/* ─── PRÉSENTATION PAGE ─── */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; }
.profile-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 6px; padding: 2rem; position: sticky; top: calc(var(--nav-h) + 1.5rem);
}
.profile-photo {
  width: 100%; aspect-ratio: 3/4; border-radius: 4px;
  background: linear-gradient(145deg, var(--bg2), var(--border));
  margin-bottom: 1.4rem; display: flex; align-items: center; justify-content: center;
  color: var(--ink-light); font-size: 0.75rem; border: 1px solid var(--border);
}
.profile-name { font-family: 'Cormorant Garamond', serif; font-size: 1.6rem; font-weight: 500; margin-bottom: 0.2rem; }
.profile-title { font-size: 0.8rem; color: var(--ink-light); margin-bottom: 1.2rem; }
.profile-links { display: flex; flex-direction: column; gap: 0.5rem; }
.profile-link {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-size: 0.8rem; color: var(--ink-light); transition: color var(--trans);
  padding: 0.4rem 0; border-bottom: 1px solid var(--bg2);
}
.profile-link:hover { color: var(--accent); }

.rich-text h2 { margin-bottom: 0.8rem; }
.rich-text p { margin-bottom: 1.2rem; color: var(--ink); }
.rich-text .highlight { color: var(--accent); font-weight: 500; }

.competences-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1.5rem; }
.comp-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 4px;
  padding: 1rem 1.2rem; transition: border-color var(--trans); cursor: pointer; display: block;
}
.comp-card:hover { border-color: var(--accent); }
.comp-card-label { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin-bottom: 0.3rem; }
.comp-card-title { font-size: 0.88rem; font-weight: 500; line-height: 1.4; }

/* ─── SAÉ LIST ─── */
.sae-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.2rem; }
.sae-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 6px;
  padding: 1.6rem; cursor: pointer; transition: all var(--trans);
  display: flex; flex-direction: column; gap: 0.8rem;
}
.sae-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.06); }
.sae-card-code { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.sae-card-title { font-family: 'Cormorant Garamond', serif; font-size: 1.25rem; font-weight: 500; line-height: 1.3; }
.sae-card-sem { font-size: 0.75rem; color: var(--ink-light); }
.sae-card-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.sae-tag { font-size: 0.68rem; padding: 0.15rem 0.5rem; border-radius: 2px; background: var(--bg2); color: var(--ink-light); font-weight: 500; }
.arrow-icon { margin-top: auto; color: var(--accent); font-size: 0.85rem; opacity: 0; transition: opacity var(--trans); }
.sae-card:hover .arrow-icon { opacity: 1; }

/* ─── SAÉ DETAIL ─── */
#sae-detail { display: none; padding-top: var(--nav-h); min-height: 100vh; animation: fadeIn 0.35s ease; }
#sae-detail.active { display: block; }
.back-btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.8rem; color: var(--ink-light); cursor: pointer;
  padding: 1.5rem 0 0; transition: color var(--trans);
}
.back-btn:hover { color: var(--accent); }
.sae-header {
  padding: 2.5rem 0 2rem; border-bottom: 1px solid var(--border);
}
.sae-header-code { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent); margin-bottom: 0.6rem; }
.sae-header h1 { margin-bottom: 1rem; }
.sae-meta { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.sae-meta-item { font-size: 0.8rem; color: var(--ink-light); display: flex; align-items: center; gap: 0.4rem; }

.sae-body { display: grid; grid-template-columns: 1fr 280px; gap: 3rem; padding: 3rem 0; }
.sae-content { display: flex; flex-direction: column; gap: 2.5rem; }
.sae-section { }
.sae-section-title {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent); padding-bottom: 0.7rem; border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}
.sae-section p { color: var(--ink); line-height: 1.75; margin-bottom: 0.8rem; }

.ac-list { display: flex; flex-direction: column; gap: 0.7rem; }
.ac-item { background: var(--card); border: 1px solid var(--border); border-radius: 4px; padding: 0.9rem 1rem; }
.ac-code { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin-bottom: 0.2rem; }
.ac-text { font-size: 0.85rem; line-height: 1.5; }

.trace-list { display: flex; flex-direction: column; gap: 0.8rem; }
.trace-item {
  display: flex; align-items: flex-start; gap: 0.8rem;
  background: var(--card); border: 1px solid var(--border); border-radius: 4px; padding: 0.9rem 1rem;
}
.trace-icon { flex-shrink: 0; width: 32px; height: 32px; background: var(--bg2); border-radius: 4px; display: flex; align-items: center; justify-content: center; color: var(--accent); font-size: 0.9rem; }
.trace-info { flex: 1; }
.trace-name { font-size: 0.85rem; font-weight: 500; margin-bottom: 0.15rem; }
.trace-desc { font-size: 0.78rem; color: var(--ink-light); }

.autoeval-box {
  background: linear-gradient(135deg, rgba(26,79,186,0.05) 0%, rgba(26,79,186,0.02) 100%);
  border: 1px solid rgba(26,79,186,0.2); border-radius: 6px; padding: 1.4rem 1.6rem;
}
.autoeval-box .niveau {
  display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem;
}
.niveau-dots { display: flex; gap: 0.35rem; }
.dot { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--accent); }
.dot.filled { background: var(--accent); }
.niveau-label { font-size: 0.78rem; color: var(--accent); font-weight: 500; }

/* sidebar */
.sae-sidebar { display: flex; flex-direction: column; gap: 1.2rem; }
.sidebar-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 6px; padding: 1.2rem;
}
.sidebar-card-title { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-light); margin-bottom: 0.8rem; }
.sidebar-item { font-size: 0.82rem; padding: 0.3rem 0; border-bottom: 1px solid var(--bg2); color: var(--ink); }
.sidebar-item:last-child { border-bottom: none; }
.sidebar-item span { color: var(--accent); font-weight: 600; }

/* ─── BILAN PAGE ─── */
.bilan-tabs { display: flex; gap: 0.3rem; border-bottom: 1px solid var(--border); margin-bottom: 3rem; overflow-x: auto; }
.bilan-tab {
  padding: 0.7rem 1.2rem; font-size: 0.8rem; font-weight: 500; cursor: pointer;
  border-bottom: 2px solid transparent; white-space: nowrap; color: var(--ink-light);
  transition: all var(--trans);
}
.bilan-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.bilan-tab:hover { color: var(--ink); }

.bilan-panel { display: none; }
.bilan-panel.active { display: block; animation: fadeIn 0.3s ease; }

.bilan-header { margin-bottom: 2rem; }
.bilan-header h2 { margin-bottom: 0.5rem; }
.bilan-header p { color: var(--ink-light); font-size: 0.9rem; max-width: 55ch; }

.ac-progress-list { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 2.5rem; }
.ac-progress {
  background: var(--card); border: 1px solid var(--border); border-radius: 4px;
  padding: 1rem 1.2rem;
}
.ac-progress-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 0.6rem; }
.ac-progress-code { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.ac-progress-level { font-size: 0.72rem; color: var(--ink-light); }
.ac-progress-text { font-size: 0.85rem; margin-bottom: 0.7rem; line-height: 1.5; }
.progress-bar { height: 4px; background: var(--bg2); border-radius: 2px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 2px; transition: width 0.8s ease; }

.bilan-synthesis {
  background: var(--card); border: 1px solid var(--border); border-radius: 6px;
  padding: 1.6rem 1.8rem; margin-top: 2rem;
}
.bilan-synthesis h3 { font-size: 0.82rem; font-weight: 600; margin-bottom: 1rem; color: var(--ink); text-transform: none; letter-spacing: 0; }
.synthesis-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.synthesis-col-title { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-light); margin-bottom: 0.6rem; }
.synthesis-item {
  display: flex; align-items: flex-start; gap: 0.5rem;
  font-size: 0.83rem; margin-bottom: 0.4rem; line-height: 1.5;
}
.synthesis-item::before { content: '—'; color: var(--accent); flex-shrink: 0; margin-top: 0.05rem; }

/* ─── FOOTER ─── */
footer {
  border-top: 1px solid var(--border); padding: 2rem 0;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem;
}
footer .foot-left { font-size: 0.78rem; color: var(--ink-light); }
footer .foot-right { font-size: 0.78rem; color: var(--ink-light); display: flex; gap: 1.2rem; }

/* ─── RESPONSIVE ─── */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .hero-visual { display: none; }
  .two-col { grid-template-columns: 1fr; }
  .profile-card { position: static; }
  .sae-body { grid-template-columns: 1fr; }
  .sae-sidebar { display: grid; grid-template-columns: 1fr 1fr; }
  .competences-grid { grid-template-columns: 1fr; }
  .synthesis-grid { grid-template-columns: 1fr; }
  .stats-bar { grid-template-columns: 1fr; }
  .stat { border-right: none; border-bottom: 1px solid var(--border); }
  .stat:last-child { border-bottom: none; }
  .nav-links { display: none; position: absolute; top: var(--nav-h); left: 0; right: 0; background: var(--bg); border-bottom: 1px solid var(--border); flex-direction: column; padding: 1rem; gap: 0.2rem; }
  .nav-links.open { display: flex; }
  .burger { display: flex; }
}
@media (max-width: 480px) {
  .sae-sidebar { grid-template-columns: 1fr; }
}