/* ============================================================
   Joël Antonin — CV personnel
   Design : sober, sans-serif, Gantt with half-year resolution
   ============================================================ */

:root {
  --bg: #f9f7f4;
  --bg-elevated: #ffffff;
  --ink: #1a1a1a;
  --ink-soft: #4a4a4a;
  --ink-muted: #7a7a7a;
  --rule: #d8d4cf;
  --rule-soft: #e8e5e0;

  --accent: #1e3a5f;
  --formation: #1e3a5f;
  --formation-bg: rgba(30, 58, 95, 0.07);
  --formation-bg-hover: rgba(30, 58, 95, 0.13);
  --stage: #8c6d3f;
  --stage-bg: rgba(140, 109, 63, 0.08);
  --stage-bg-hover: rgba(140, 109, 63, 0.14);
  --emploi: #2d4a2b;
  --emploi-bg: rgba(45, 74, 43, 0.08);
  --emploi-bg-hover: rgba(45, 74, 43, 0.14);

  --font-body: 'Manrope', system-ui, -apple-system, sans-serif;

  --content-max: 1100px;
  --half-row-h: 34px;   /* height of one half-year row */
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  font-weight: 400;
}

a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--ink); }

img { max-width: 100%; display: block; }

.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 32px;
}

/* ============================================================
   HERO
   ============================================================ */

.hero {
  padding: 80px 0 60px;
  border-bottom: 1px solid var(--rule);
}

.hero__inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 32px;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 48px;
  align-items: start;
}

.hero__photo {
  position: relative;
  aspect-ratio: 3 / 4;
  background: var(--bg-elevated);
  border: 1px solid var(--rule);
  overflow: hidden;
}

.hero__photo img { width: 100%; height: 100%; object-fit: cover; }

.hero__photo-placeholder {
  display: none;
  width: 100%; height: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--ink-muted);
  background: linear-gradient(135deg, #f4f1ec 0%, #ebe7e0 100%);
}

.hero__photo-placeholder svg { width: 56%; height: auto; margin-bottom: 8px; opacity: 0.4; }
.hero__photo-placeholder span { font-size: 12px; letter-spacing: 0.15em; text-transform: uppercase; opacity: 0.6; }

.hero__eyebrow {
  font-size: 12px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 16px;
  font-weight: 600;
}

.hero__name {
  font-weight: 700;
  font-size: clamp(40px, 6vw, 60px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin-bottom: 10px;
  color: var(--ink);
}

.hero__title {
  font-size: 17px;
  color: var(--ink-soft);
  font-weight: 400;
  margin-bottom: 32px;
}

.hero__contact {
  list-style: none;
  margin-bottom: 36px;
  display: grid;
  gap: 6px;
}

.hero__contact li {
  display: grid;
  grid-template-columns: 100px 1fr;
  font-size: 15px;
}

.contact-label {
  color: var(--ink-muted);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding-top: 4px;
  font-weight: 600;
}

.hero__actions { display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid var(--ink);
  transition: all 0.2s ease;
  cursor: pointer;
  font-family: var(--font-body);
}

.btn--primary { background: var(--ink); color: var(--bg); }
.btn--primary:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--bg); }
.btn_margin { margin-top: 20px;}

/* ============================================================
   SECTIONS
   ============================================================ */

.section { padding: 72px 0 0 0; }

.section__title {
  font-weight: 700;
  font-size: 28px;
  letter-spacing: -0.02em;
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--rule);
}

.profil__text {
  font-size: 16.5px;
  line-height: 1.75;
  color: var(--ink-soft);
  max-width: 75ch;
}

/* ============================================================
   TIMELINE LEGEND
   ============================================================ */

.timeline-section {
  background: linear-gradient(180deg, transparent 0%, rgba(216, 212, 207, 0.2) 100%);
}

.timeline-legend {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px dashed var(--rule);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  text-transform: uppercase;
  font-weight: 600;
}

.legend-item i { width: 12px; height: 12px; display: inline-block; }
.legend-item--formation i { background: var(--formation); }
.legend-item--stage i { background: var(--stage); }
.legend-item--emploi i { background: var(--emploi); }

/* ============================================================
   TIMELINE GANTT (DESKTOP) — half-year resolution
   ============================================================ */

.timeline-grid {
  display: grid;
  grid-template-columns: 70px 1fr 1fr 1fr;
  grid-auto-rows: minmax(var(--half-row-h), auto);
  position: relative;
}

.row-line {
  border-bottom: 1px solid var(--rule-soft);
  pointer-events: none;
  z-index: 0;
}

.timeline-grid__head {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 700;
  padding: 0 14px 14px;
  align-self: end;
  border-bottom: 1.5px solid var(--ink);
  display: flex;
  align-items: flex-end;
  z-index: 2;
  background: var(--bg);
}

.timeline-grid__head--year { padding-left: 0; }

.timeline-grid__year {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-muted);
  padding: 14px 14px 0 0;
  align-self: start;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  z-index: 1;
}

/* Vertical column separators */
.timeline-grid::before,
.timeline-grid::after {
  content: "";
  position: absolute;
  top: var(--half-row-h);
  bottom: 0;
  width: 1px;
  background: var(--rule);
  pointer-events: none;
  z-index: 0;
}
.timeline-grid::before { left: calc(70px + (100% - 70px) / 3); }
.timeline-grid::after  { left: calc(70px + 2 * (100% - 70px) / 3); }

/* ============================================================
   BLOCK
   ============================================================ */

.block {
  margin: 4px 8px 4px 14px;
  padding: 10px 12px;
  border-left: 3px solid;
  border-radius: 3px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 8px;
  position: relative;
  z-index: 2;
  transition: background-color 0.2s, transform 0.2s;
}

.block--formation { background: var(--formation-bg); border-left-color: var(--formation); }
.block--formation:hover { background: var(--formation-bg-hover); }
.block--stage { background: var(--stage-bg); border-left-color: var(--stage); }
.block--stage:hover { background: var(--stage-bg-hover); }
.block--emploi { background: var(--emploi-bg); border-left-color: var(--emploi); }
.block--emploi:hover { background: var(--emploi-bg-hover); }

/* Compact mode: 1 row containing multiple span-1 events */
.block--compact {
  gap: 4px;
  padding: 8px 12px;
}

.block__year {
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  margin-bottom: 2px;
}

.block--formation .block__year { color: var(--formation); opacity: 0.75; }
.block--stage .block__year { color: var(--stage); opacity: 0.85; }
.block--emploi .block__year { color: var(--emploi); opacity: 0.8; }

.block--compact .event { gap: 0; }
.block--compact .event__title { font-size: 13px; line-height: 1.25; }
.block--compact .event__org { font-size: 11.5px; margin-top: 0; }
.block--compact .event + .event {
  border-top: 1px dashed rgba(26, 26, 26, 0.12);
  margin-top: 3px;
  padding-top: 3px;
}

/* Event inside a block */
.event { display: flex; flex-direction: column; gap: 1px; }
.event + .event {
  border-top: 1px dashed rgba(26, 26, 26, 0.15);
  padding-top: 6px;
  margin-top: 4px;
}

.event__range {
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.block--formation .event__range { color: var(--formation); opacity: 0.75; }
.block--stage .event__range { color: var(--stage); opacity: 0.85; }
.block--emploi .event__range { color: var(--emploi); opacity: 0.8; }

.event__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.event__title-text { flex: 1; }

.event__ongoing {
  font-weight: 400;
  color: var(--ink-muted);
  font-size: 12.5px;
  font-style: italic;
}

.event__org {
  font-size: 12.5px;
  color: var(--ink-soft);
  line-height: 1.35;
  font-weight: 400;
}

.event__doc {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  flex-shrink: 0;
  color: var(--accent);
  margin-top: -1px;
  opacity: 0.5;
  transition: opacity 0.2s, transform 0.2s;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 50%;
}

.event__doc:hover { opacity: 1; transform: translateY(-1px); }
.event__doc svg { width: 13px; height: 13px; }

/* ============================================================
   MOBILE LIST
   ============================================================ */

.timeline-list { display: none; }

/* ============================================================
   FOOTER
   ============================================================ */

.footer {
  padding: 32px 0;
  border-top: 1px solid var(--rule);
  font-size: 13px;
  color: var(--ink-muted);
  text-align: center;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 900px) {
  .hero { padding: 48px 0 40px; }

  .hero__inner { grid-template-columns: 1fr; gap: 32px; }
  .hero__photo { max-width: 200px; margin: 0 auto; }
  .hero__name, .hero__title { text-align: center; }
  .hero__contact li { grid-template-columns: 90px 1fr; font-size: 14px; }
  .hero__actions { justify-content: center; }

  .section { padding: 56px 0; }
  .section__title { font-size: 24px; }

  .timeline-grid { display: none; }
  .timeline-list { display: block; }

  .tl-year-block {
    padding: 20px 0;
    border-bottom: 1px solid var(--rule);
  }
  .tl-year-block:last-child { border-bottom: none; }

  .tl-year-block__year {
    font-size: 22px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 12px;
    letter-spacing: -0.01em;
  }

  .tl-year-block__items {
    display: flex; flex-direction: column; gap: 10px;
  }

  .tl-cat {
    padding: 10px 12px;
    border-left: 3px solid;
    border-radius: 3px;
  }

  .tl-cat--formation { background: var(--formation-bg); border-left-color: var(--formation); }
  .tl-cat--stage { background: var(--stage-bg); border-left-color: var(--stage); }
  .tl-cat--emploi { background: var(--emploi-bg); border-left-color: var(--emploi); }

  .tl-cat__label {
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--ink-muted);
    margin-bottom: 6px;
  }

  .tl-cat--formation .tl-cat__label { color: var(--formation); }
  .tl-cat--stage .tl-cat__label { color: var(--stage); }
  .tl-cat--emploi .tl-cat__label { color: var(--emploi); }

  .tl-cat .event + .event {
    border-top: 1px dashed rgba(26, 26, 26, 0.15);
    margin-top: 6px;
    padding-top: 6px;
  }
}

@media (max-width: 480px) {
  .container { padding: 0 20px; }
  .hero__inner { padding: 0 20px; }
  .hero__actions { flex-direction: column; }
  .btn { justify-content: center; }
}

/* ============================================================
   PRINT
   ============================================================ */

@media print {
  .hero__actions, .footer { display: none; }
  body { background: white; }
  .timeline-section { background: white; }
}
