/* ==========================================================================
   Resume — "Hexagon logbook"
   Markup: _layouts/resume.html. Shared by / (fr) and /en/ (en).
   Desktop & print: a single A4 sheet. Below 820px: a fluid, scrolling page.
   ========================================================================== */

/* ---------- Tokens ---------- */

:root {
  /* Palette */
  --accent: #1e3a5f; /* deep navy: masthead, headings, strong cells */
  --signal: #d9b26f; /* sand: highlights (portrait frame, current job) */
  --ink: #12161c;
  --ink-soft: #3a3f4a;
  --ink-muted: #5b616e;
  --line: #dce3ec;
  --paper: #f2f3f5;
  --card: #ffffff;
  --desk: #c9cfd8; /* background around the sheet */
  --on-accent: #ffffff;
  --on-accent-soft: #dce3ec;
  --available: #6fcf97;

  /* Type */
  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "Geist", system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, monospace;
  --font-serif: "Instrument Serif", Georgia, serif;

  /* Sheet */
  --sheet-w: 210mm;
  --sheet-h: 297mm;
  --gutter: 38px;

  /* Vertical rhythm */
  --space-section: 28px; /* above each section */
  --space-title: 12px; /* between a section title and its content */

  /* Honeycomb cell */
  --cell-w: 76px;
  --cell-gap: 5px;
}

/* ---------- Base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--desk);
  color: var(--ink);
  font: 400 12.5px/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p,
ul {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  opacity: 0.8;
}

a:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
}

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

svg {
  flex: none;
}

/* ---------- Shared shapes & helpers ---------- */

.hex {
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}

.eyebrow {
  font: 500 10px/1 var(--font-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.section-title {
  white-space: pre-line; /* a newline in the i18n string forces the line break */
  font: 800 22px/1 var(--font-display);
  letter-spacing: -0.03em;
}

/* ---------- Sheet (the A4 page) ---------- */

.sheet {
  width: var(--sheet-w);
  height: var(--sheet-h);
  margin: 0 auto 32px;
  overflow: hidden;
  zoom: var(--zoom, 1); /* set by js/zoom.js */
  display: flex;
  flex-direction: column;
  background: var(--paper);
  box-shadow:
    0 1px 2px rgb(18 22 28 / 0.12),
    0 12px 40px rgb(18 22 28 / 0.18);
}

.sheet > * {
  flex: none;
}

.section {
  padding: var(--space-section) var(--gutter) 0;
}

/* ---------- Toolbar: language switch + PDF ----------
   Web UI only: sits above the sheet, on the desk, and is never printed. */

.toolbar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 20px var(--gutter);
  font: 500 12px/1 var(--font-body);
  color: var(--accent);
}

.lang-switch {
  display: flex;
  padding: 2px;
  border: 1px solid rgb(30 58 95 / 0.3);
  border-radius: 999px;
}

.lang-switch a {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
}

.lang-switch a[aria-current="page"] {
  background: var(--accent);
  color: var(--on-accent);
}

/* Zoom − 100% + : same pill as .lang-switch */
.zoom {
  display: flex;
  align-items: center;
  padding: 2px;
  border: 1px solid rgb(30 58 95 / 0.3);
  border-radius: 999px;
}

.zoom[hidden] {
  display: none;
}

.zoom button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.zoom button:hover:not(:disabled) {
  background: rgb(30 58 95 / 0.1);
}

.zoom button:disabled {
  opacity: 0.35;
  cursor: default;
}

.zoom button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.zoom__button {
  width: 30px;
}

.zoom__value {
  min-width: 48px;
  padding: 0 4px;
  font-variant-numeric: tabular-nums;
}

.toolbar__pdf {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
}

/* ---------- Masthead ---------- */

.masthead {
  position: relative;
  overflow: hidden;
  padding: 28px var(--gutter) 26px;
  background: var(--accent);
  color: var(--on-accent);
}

.masthead__comb {
  position: absolute;
  right: -70px;
  bottom: -110px;
  width: 400px;
  height: auto;
  stroke: currentColor;
  stroke-opacity: 0.07;
  stroke-width: 1.5;
  fill: none;
}

/* Two columns: identity & contacts | portrait & location */
.masthead__grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px 24px;
}

.masthead__main {
  display: flex;
  flex-direction: column;
}

/* Portrait at the top (level with the name), location at the bottom (level with the links row) */
.masthead__aside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.identity__name {
  white-space: nowrap;
  font: 800 46px/0.9 var(--font-display);
  letter-spacing: -0.045em;
}

.identity__surname {
  color: transparent;
  -webkit-text-stroke: 1.5px var(--on-accent);
}

.identity__role {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  font: 500 22px/1.05 var(--font-display);
  letter-spacing: -0.02em;
}

.identity__bullet {
  width: 12px;
  height: 14px;
  flex: none;
  background: var(--signal);
}

.identity__quote {
  margin: 8px 0 0 22px;
  font: italic 400 16px/1.3 var(--font-serif);
  letter-spacing: 0.01em;
  color: var(--on-accent-soft);
}

.portrait {
  width: 120px;
  height: 138px;
  padding: 4px;
  background: var(--signal);
}

.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 100%;
}

.contacts {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 22px;
}

.contacts__row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.contact {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgb(255 255 255 / 0.4);
  font-size: 11.5px;
}

.contact--primary {
  border-color: var(--on-accent);
  background: var(--on-accent);
  color: var(--accent);
  font-weight: 600;
}

.location {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px; /* same height as a .contact, so their bottoms line up */
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgb(255 255 255 / 0.16);
  background: rgb(255 255 255 / 0.08);
  font-size: 11px;
  color: var(--on-accent-soft);
}

.location__dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--available);
}

/* ---------- 01 · Hive (skills) ---------- */

.hive {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px 32px;
}

.hive__text {
  flex: 1 1 240px;
  min-width: 0;
}

.hive__lead {
  margin-top: var(--space-title);
  font-size: 13px;
  color: var(--ink-soft);
}

.hive__stack {
  margin-top: 8px;
  font: 400 11.5px/1.8 var(--font-mono);
  color: var(--accent);
}

.comb {
  flex: none;
}

.comb__row {
  display: flex;
  gap: var(--cell-gap);
}

/* Rows interlock: each overlaps the previous by ~1/5 of a cell's height
   and every second row shifts by half a cell. */
.comb__row + .comb__row {
  margin-top: calc(var(--cell-w) * -0.227);
}

.comb__row--offset {
  margin-left: calc((var(--cell-w) + var(--cell-gap)) / 2);
}

.cell {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--cell-w);
  height: calc(var(--cell-w) * 1.155);
  padding: 0 9px;
  text-align: center;
  font-size: 9.5px;
  font-weight: 600;
  line-height: 1.15;
  background: var(--line);
  color: var(--accent);
}

.cell--strong {
  background: var(--accent);
  color: var(--on-accent);
}

.cell--signal {
  background: var(--signal);
}

/* ---------- 02 · Logbook (experience) ---------- */

.logbook {
  margin: calc(var(--space-title) + 4px) 0 0 6px;
  border-left: 1px solid var(--accent);
}

.job {
  position: relative;
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 16px;
  padding: 0 0 13px 26px;
}

.job:last-child {
  padding-bottom: 2px;
}

/* Centered on the 1px timeline */
.job__node {
  position: absolute;
  left: -5.5px;
  top: 10px;
  width: 10px;
  height: 11.5px;
  background: var(--accent);
}

.job--current .job__node {
  background: var(--signal);
}

.job__year {
  font: 800 38px/0.85 var(--font-display);
  letter-spacing: -0.04em;
  color: transparent;
  -webkit-text-stroke: 1px rgb(30 58 95 / 0.33);
}

.job--current .job__year {
  -webkit-text-stroke-color: var(--accent);
}

.job__title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.job__org {
  font-weight: 400;
  color: var(--ink-muted);
}

.job__desc {
  margin-top: 4px;
  max-width: 560px;
  color: var(--ink-soft);
}

.clients {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
}

.clients__label {
  margin-right: 4px;
  color: var(--ink-muted);
}

.chip {
  padding: 2px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  font: 500 12px/1.4 var(--font-display);
  color: var(--accent);
}

/* ---------- 03 · Training (education) ---------- */

.schools {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: var(--space-title);
}

/* Name and year share the first line; the degree runs underneath */
.school {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-content: start;
  gap: 4px 8px;
  padding: 11px 13px;
  border-radius: 12px;
  background: var(--card);
}

.school__year {
  grid-area: 1 / 2;
  font: 400 10.5px/1.75 var(--font-mono);
  color: var(--accent);
}

.school__name {
  grid-area: 1 / 1;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
}

.school__degree {
  grid-column: 1 / -1;
  font-size: 11px;
  line-height: 1.4;
  color: var(--ink-muted);
}

/* ---------- 04–05 · Languages & off screen ---------- */

.closing {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 40px;
  margin: calc(var(--space-section) + 4px) var(--gutter) 0;
  padding: 18px 0 0;
  border-top: 1px solid var(--accent);
}

.closing__col {
  flex: 1 1 200px;
  min-width: 0;
}

/* Two columns of "name … level" pairs need the room */
.closing__col--wide {
  flex: 1.6 1 300px;
}

.languages {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 16px;
  margin-top: 10px;
}

.language {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
  border-bottom: 1px solid var(--line);
}

.language__name {
  font: 500 16px/1.2 var(--font-display);
  letter-spacing: -0.02em;
}

.language__level {
  white-space: nowrap;
  font: 400 10.5px/1 var(--font-mono);
  color: var(--accent);
}

.language__level--intermediate {
  color: var(--ink-muted);
}

.hobbies {
  margin-top: 12px;
  font: italic 400 24px/1.25 var(--font-serif);
  color: #2a3240;
}

/* ---------- Mobile: drop the sheet, become a fluid page ---------- */

@media screen and (max-width: 820px) {
  :root {
    --gutter: 16px;
    --space-section: 40px;
    --space-title: 16px;
    --cell-w: 72px;
  }

  body {
    background: var(--paper);
    font-size: 15px;
  }

  .sheet {
    width: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    box-shadow: none;
    zoom: 1;
  }

  /* No sheet to zoom here: pinch-zoom does the job */
  .zoom {
    display: none;
  }

  .section-title {
    font-size: 30px;
  }

  .masthead {
    padding-top: 28px;
    padding-bottom: 32px;
  }

  /* Everything in the header is centered */
  .masthead__grid {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    text-align: center;
  }

  /* Flatten the side column so it stacks: portrait, identity & contacts, location */
  .masthead__aside {
    display: contents;
  }

  .toolbar {
    justify-content: flex-end;
    padding-block: 10px;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
  }

  .lang-switch a,
  .toolbar__pdf {
    min-height: 40px;
  }

  .portrait {
    order: -1;
  }

  .identity__name {
    white-space: normal;
    font-size: clamp(44px, 14vw, 72px);
  }

  .identity__role {
    justify-content: center;
    font-size: 24px;
  }

  .identity__quote {
    margin-left: 0;
    font-size: 20px;
  }

  .contacts {
    align-items: center;
  }

  .contacts__row {
    justify-content: center;
  }

  .contact {
    min-height: 44px;
    padding: 0 16px;
    font-size: 15px;
  }

  .location {
    font-size: 13px;
  }

  .languages {
    grid-template-columns: minmax(0, 1fr);
  }

  .hive__lead {
    font-size: 16px;
  }

  .hive__stack {
    font-size: 13px;
  }

  .cell {
    padding: 0 8px;
    font-size: 9.5px;
  }

  .job {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    padding-bottom: 28px;
  }

  .job__node {
    top: 4px;
  }

  .job__title {
    font-size: 18px;
  }

  .chip {
    font-size: 15px;
    padding: 6px 12px;
  }

  .schools {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .school__name {
    font-size: 16px;
  }

  .school__degree {
    font-size: 14px;
  }

  .school__year,
  .language__level {
    font-size: 13px;
  }

  .language__name {
    font-size: 22px;
  }

  .closing {
    margin-top: 40px;
    margin-bottom: 48px;
  }

  .hobbies {
    font-size: 28px;
  }
}

@media screen and (max-width: 420px) {
  :root {
    --cell-w: 62px;
    --cell-gap: 4px;
  }

  .cell {
    padding: 0 4px;
    font-size: 8.5px;
  }

  .schools {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- Print: exactly one A4 page ---------- */

@page {
  size: A4;
  margin: 0;
}

@media print {
  body {
    background: none;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .sheet {
    margin: 0;
    box-shadow: none;
    zoom: 1;
  }

  .no-print {
    display: none !important;
  }
}
