:root {
  color-scheme: light;
  --ink: #172941;
  --muted: #465e78;
  --blue: #204e83;
  --line: #cddbe9;
  --surface: #eef4fa;
  --paper: #fff;
  font: 100%/1.5 system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--surface); }
a { color: var(--blue); text-underline-offset: 0.2em; }
a:focus-visible, .table-scroll:focus-visible { outline: 3px solid #145ca3; outline-offset: 4px; }
.wrap { width: min(100% - 2 * clamp(1rem, 4vw, 2.5rem), 69rem); margin-inline: auto; }

.masthead {
  color: #fff;
  border-bottom: 4px solid #81b2e2;
  background: linear-gradient(112deg, #142945 15%, #1a3960 70%, #204973);
}

.masthead a { color: #e7f2ff; }
.masthead a:focus-visible { outline-color: #b6daff; }

.profile {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(6rem, 14vw, 9.5rem);
  align-items: center;
  gap: clamp(1rem, 5vw, 4rem);
  padding-block: clamp(1.75rem, 5vw, 3.5rem);
}

.school { display: inline-block; font-size: 0.875rem; font-weight: 700; }

h1 {
  margin: 0.35em 0 0.15em;
  font-size: clamp(2rem, 5vw, 3.7rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.role { margin: 0; color: #e3effd; font-size: clamp(1rem, 2.3vw, 1.28rem); }
.email { display: inline-block; margin-top: 1rem; overflow-wrap: anywhere; }

.portrait {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border: 1px solid #8aaccb;
  border-radius: 22%;
  overflow: hidden;
  background: #294d75;
  color: #f0f7ff;
  font-size: clamp(1.5rem, 4vw, 2.8rem);
  font-weight: 650;
}

.portrait::after {
  position: absolute;
  inset: 0;
  background: url("Photo_Moi_Reduit.JPG") center / cover no-repeat;
  content: "";
}

main { padding-block: clamp(1.75rem, 4vw, 2.75rem) 2.75rem; }
.section + .section { margin-top: 2rem; }

h2 {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0 0 0.85rem;
  font-size: clamp(1.15rem, 2.5vw, 1.45rem);
  line-height: 1.25;
  letter-spacing: -0.02em;
}

h2::after { flex: 1; height: 1px; background: var(--line); content: ""; }

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr));
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tile {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0.75rem;
  min-height: 100%;
  padding: 0.6rem 0.6rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--paper);
  color: var(--ink);
  font-weight: 650;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  overflow-wrap: anywhere;
  box-shadow: 0 2px 6px #18355509;
}

.tile:hover, .tile:focus-visible { border-color: #6c98c5; background: #f8fbff; }
.tile:hover .tile-label, .tile:focus-visible .tile-label { text-decoration: underline; }
.tile.primary { border-color: #86add4; background: #e3effd; }
.tile.primary:hover, .tile.primary:focus-visible { background: #d7e8fc; }

.icon-box {
  display: grid;
  place-items: center;
  height: clamp(6.75rem, 11vw, 8.25rem);
  border-radius: 0.65rem;
  background: radial-gradient(ellipse at 50% 28%, #f6faff 10%, #e5eefb 90%);
}

.primary .icon-box { background: radial-gradient(ellipse at 50% 28%, #e7f5ff 10%, #bddbf9 90%); }
.resources .icon-box { background: radial-gradient(ellipse at 50% 28%, #f5fcfc 10%, #dfefed 90%); }
.icon { width: min(100% - 0.65rem, 8.5rem); height: calc(100% - 0.7rem); display: block; object-fit: contain; }
.tile-label { padding-inline: 0.3rem; }
.tile-label small { font-size: 0.875rem; font-weight: 500; color: var(--muted); }

.page-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(6rem, 15vw, 9.5rem);
  align-items: center;
  gap: clamp(1rem, 4vw, 3rem);
  padding-block: clamp(1.75rem, 4vw, 2.75rem);
}

.page-hero h1 { font-size: clamp(1.85rem, 4.5vw, 3.2rem); }
.page-hero .role { margin-top: 0.7rem; }
.back-link { display: inline-block; font-size: 0.875rem; font-weight: 650; }
.page-nav { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; }

.page-art {
  display: block;
  width: 100%;
  height: auto;
  padding: 0.45rem;
  border: 1px solid #97c2e9;
  border-radius: 0.9rem;
  background: radial-gradient(ellipse at 50% 28%, #e7f5ff 10%, #bddbf9 90%);
}

.page-panel {
  padding: clamp(0.9rem, 3vw, 1.65rem);
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--paper);
  box-shadow: 0 2px 6px #18355509;
}

.page-panel + .page-panel { margin-top: 1.1rem; }
.page-panel p { margin: 0 0 0.85rem; }
.page-panel > :last-child { margin-bottom: 0; }
.page-panel li + li { margin-top: 0.35rem; }

.table-scroll {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
}

.page-table {
  width: 100%;
  min-width: 39rem;
  border-collapse: collapse;
  text-align: left;
}

.page-table.fixed { table-layout: fixed; }
.page-table th, .page-table td { padding: 0.65rem 0.75rem; vertical-align: top; }
.page-table td, .page-table tbody th { overflow-wrap: anywhere; }
.page-table tbody tr + tr { border-top: 1px solid var(--line); }
.page-table thead { background: #e3effd; }
.page-table tbody th { font-weight: 650; }
.page-table tbody tr:nth-child(even) { background: #f5f8fc; }
.sujets-e4 .intitule { width: 44%; }
.sujets-e4 .contact { width: 21%; }
.sujets-e4 .type { width: 19%; }

.resource-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  padding: 0;
  list-style: none;
}

.resource-links li + li { margin-top: 0; }
.resource-links a {
  display: inline-block;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  font-weight: 650;
  background: #f4f8fc;
}

.resource-links a:hover { background: #e3effd; }
.calendrier-e4 { display: block; max-width: 100%; height: auto; }
.table-hint { display: none; color: var(--muted); font-size: 0.875rem; }

.legacy-content {
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.legacy-content :is(h2, h3, h4) { margin-top: 1.35rem; }
.legacy-content :is(h3, h4) { line-height: 1.3; }
.legacy-content :is(p, blockquote) { max-inline-size: 80ch; }
.legacy-content blockquote { margin-inline: 0; }
.legacy-content img { max-inline-size: 100%; block-size: auto; }
.legacy-content pre { overflow: auto; }
.legacy-content .table-scroll { margin-block: 0.75rem; }
.legacy-content .note-accent { color: #a32939; }
.legacy-mark { color: var(--blue); font-weight: 700; }

.legacy-nav { margin-block: 1.35rem 0.25rem; }
.legacy-nav .tiles { grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr)); }
.legacy-nav .tiles li + li { margin-top: 0; }
.legacy-nav .icon-box { height: clamp(6.75rem, 10vw, 7.5rem); }

.legacy-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: 1rem;
  margin-block: 1rem;
}

.legacy-gallery article {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: #f5f8fc;
}

.legacy-gallery article :first-child { margin-top: 0; }

footer { border-top: 1px solid var(--line); padding-block: 1rem; color: var(--muted); }
footer address { font-size: 0.875rem; font-style: normal; }

@media (max-width: 45rem) {
  .table-hint { display: block; }
}

@media (max-width: 38rem) {
  .profile { grid-template-columns: minmax(0, 1fr) 4rem; align-items: start; }
  .page-hero { grid-template-columns: minmax(0, 1fr) 4.5rem; align-items: start; }
  .portrait { margin-top: 0.2rem; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 21rem) {
  .profile { grid-template-columns: minmax(0, 1fr) 3rem; }
  .tile { padding: 0.45rem 0.45rem 0.75rem; }
}
