/* Charte CESI : noir adouci #222222, anthracite #2B2B2B, gris #6B6B6B, gris clair #F2F2F2, jaune #FFCD00.
   Titres Arial gras, texte Calibri. Pas de dégradé ni d'ombre. Angles peu arrondis. */
:root {
  --black: #222222;
  --anthracite: #2B2B2B;
  --grey: #6B6B6B;
  --grey-l: #F2F2F2;
  --grey-m: #D9D9D9;
  --yellow: #FFCD00;
  --radius: 8px;      /* tuiles, cartes */
  --teal: #2F5F66;    /* touches issues du visuel de référence (adoucies) */
  --aqua: #BBDDDD;
  --aqua-l: #E6F1F1;
  --red: #D1434B;
  --gap: 10px;
  --pad: 14px;        /* marge extérieure de la page */
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Calibri, Carlito, "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color: var(--black);
  background: #fff;
  line-height: 1.5;
}
h1, h2, .eyebrow, .btn, .job, .num, .t-label, .m-kicker, .a-tag, .share-label { font-family: Arial, "Liberation Sans", Helvetica, sans-serif; }

/* ---------- Mise en page : panneau + bento (toute la largeur) ---------- */
.layout { width: 100%; max-width: 1680px; margin: 0 auto; padding: var(--pad); display: grid; gap: var(--gap); align-items: stretch; }
@media (min-width: 900px) {
  :root { --gap: 12px; --pad: 20px; }
  .layout { grid-template-columns: 380px minmax(0, 1fr); }
}
@media (min-width: 1300px) {
  :root { --gap: 14px; --pad: 28px; }
  .layout { grid-template-columns: 430px minmax(0, 1fr); }
}

/* Panneau jaune : même hauteur que la grille, contenu qui reste visible au défilement */
.panel { position: relative; background: var(--yellow); color: var(--black); border-radius: var(--radius); padding: 24px 22px; overflow: clip; display: flex; flex-direction: column; }
.panel-top { flex: 1 1 auto; position: relative; } /* zone dans laquelle le contenu fixe peut glisser : s'arrête avant le décor */
.panel-inner { display: flex; flex-direction: column; gap: 20px; position: relative; }
@media (min-width: 900px) { .panel { padding: 28px 26px; } }
@media (min-width: 900px) and (min-height: 800px) { .panel-inner { position: sticky; top: var(--pad); } }

.hero-top { display: flex; flex-wrap: nowrap; align-items: center; justify-content: space-between; gap: 12px 16px; padding-bottom: 16px; border-bottom: 2px solid var(--black); }
.eyebrow { margin: 0; padding: 6px 12px; border-radius: 5px; background: var(--black); color: #fff; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: .72rem; line-height: 1.2; }
.logo { display: block; height: 58px; width: auto; }

/* « Campus de Strasbourg » : texte horizontal, grand, */
.campus { margin: 0; text-align: right; color: var(--black); font-family: Arial, "Liberation Sans", Helvetica, sans-serif; line-height: 1; }
.campus small { display: block; margin-bottom: 7px; font-size: .85rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; }
.campus strong { display: inline-block; font-size: clamp(1.1rem, 4.8vw, 1.65rem); font-weight: 800; letter-spacing: .01em; text-transform: uppercase; white-space: nowrap; }
h1 { margin: 22px 0 10px; font-size: clamp(2.1rem, 8vw, 3rem); line-height: 1.08; font-weight: 800; letter-spacing: -.02em; }
.hl { display: inline-block; padding: 0 .2em; border-radius: 6px; background: var(--black); color: var(--yellow); transform: rotate(-2deg); }
.subtitle { margin: 0; font-size: 1.1rem; max-width: 28rem; }
.progress { margin-top: 18px; }
.bar { height: 8px; border-radius: 4px; background: rgba(34, 34, 34, .18); overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; background: var(--black); transition: width .5s ease; }
.progress p { margin: 8px 0 0; font-size: .95rem; }
.progress strong { font-weight: 800; }

/* Porte du jour */
.today { background: var(--black); color: #fff; border-radius: var(--radius); padding: 18px; }
.t-label { margin: 0 0 8px; color: var(--yellow); font-weight: 700; font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; }
.t-text { margin: 0 0 16px; font-size: 1.15rem; line-height: 1.3; font-weight: 600; }
.today .btn { width: 100%; }

/* Journée portes ouvertes */
.event { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 2px solid var(--black); border-radius: var(--radius); color: var(--black); text-decoration: none; }
.event:hover { background: rgba(34, 34, 34, .07); }
.event:focus-visible { outline: 3px solid var(--black); outline-offset: 3px; }
.ev-date { flex: none; width: 58px; padding: 8px 0 7px; border-radius: 8px; background: var(--black); color: #fff; text-align: center; font-family: Arial, "Liberation Sans", Helvetica, sans-serif; line-height: 1; }
.ev-date strong { display: block; font-size: 1.9rem; font-weight: 800; }
.ev-date span { display: block; margin-top: 4px; color: var(--yellow); font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.ev-body { flex: 1; min-width: 0; }
.ev-body p { margin: 0; line-height: 1.3; }
.ev-kicker { font-family: Arial, "Liberation Sans", Helvetica, sans-serif; font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.ev-main { margin: 3px 0 2px !important; font-family: Arial, "Liberation Sans", Helvetica, sans-serif; font-size: 1.15rem; font-weight: 800; line-height: 1.15; }
.ev-sub { font-size: .92rem; }
.ev-arrow { flex: none; font-size: 1.4rem; font-weight: 700; }

/* Décor du panneau (grands écrans) */
.deco { display: none; position: relative; height: 110px; margin-top: 24px; flex: none; }
@media (min-width: 900px) { .deco { display: block; } }
.deco .motif { position: absolute; top: auto; left: auto; fill: none; stroke: var(--black); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; overflow: visible; --acc: #fff; --bg: var(--yellow); }
.deco .d1 { stroke: var(--teal); --acc: var(--aqua); left: 0; bottom: 0; width: 100px; height: 100px; transform: rotate(-6deg); }
.deco .d2 { --acc: var(--red); left: 50%; bottom: 0; width: 100px; height: 100px; margin-left: -50px; transform: rotate(4deg); }
.deco .d3 { stroke: var(--red); right: 0; bottom: 0; width: 84px; height: 100px; transform: rotate(8deg); }
.deco .d4 { display: none; }

/* Barre de démo */
.demo { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; margin: 12px; padding: 8px 12px; background: var(--grey-l); border: 2px dashed var(--grey); font-size: .85rem; }
.demo button, .demo input { font: inherit; padding: 4px 8px; border: 1px solid var(--grey); background: #fff; color: var(--black); }

/* ---------- Grille bento : 3 colonnes (mobile), 4 (tablette / portable), 6 (grand écran) ---------- */
.grid { display: grid; gap: 8px; grid-template-columns: repeat(3, 1fr); }
.grid[data-cols="4"] { grid-template-columns: repeat(4, 1fr); gap: 10px; }
.grid[data-cols="6"] { grid-template-columns: repeat(6, 1fr); gap: 12px; }
@media (min-width: 900px) { .grid[data-cols="4"] { gap: 12px; } }

/* 8 tuiles : charte CESI (noir, jaune, gris) + petites touches sapin / givre / rouge doux
   (--bg fond, --fg trait et numéro, --acc petits aplats) */
.s0 { --bg: #FFCD00; --fg: #222222; --acc: #222222; }
.s1 { --bg: #222222; --fg: #FFFFFF; --acc: #FFCD00; }
.s2 { --bg: #BBDDDD; --fg: #2F5F66; --acc: #D1434B; }
.s3 { --bg: #F2F2F2; --fg: #222222; --acc: #FFCD00; }
.s4 { --bg: #2F5F66; --fg: #F6F1E7; --acc: #D1434B; }
.s5 { --bg: #4A4A4A; --fg: #FFFFFF; --acc: #FFCD00; }
.s6 { --bg: #D1434B; --fg: #FFF4EC; --acc: #FFD9CF; }
.s7 { --bg: #6B6B6B; --fg: #FFFFFF; --acc: #FFCD00; }

.door {
  position: relative; aspect-ratio: 1 / 1; min-width: 0; padding: 0; border: 0; cursor: pointer;
  border-radius: var(--radius); background: var(--bg); color: var(--fg); font: inherit;
  transition: transform .2s ease;
  -webkit-tap-highlight-color: transparent;
}
.door.wide { grid-column: span 2; aspect-ratio: auto; }
.motif { position: absolute; left: 12%; top: 9%; width: 76%; height: 64%; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.door.wide .motif { left: 30%; width: 40%; height: 70%; }
.num { position: absolute; right: 9%; bottom: 6%; font-size: clamp(1rem, 3.6vw, 1.6rem); font-weight: 700; line-height: 1; }
.door.wide .num { right: 5%; }
.badge { position: absolute; top: 7%; right: 7%; width: 22%; aspect-ratio: 1; border-radius: 5px; display: grid; place-items: center; }
.door.wide .badge { width: 13%; right: 4%; top: 10%; }
.badge svg { width: 66%; height: 66%; fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 6; }

.door.available:hover, .door.available:focus-visible { transform: translateY(-3px); }
.door:focus-visible { outline: 3px solid var(--black); outline-offset: 3px; }

.door.opened .badge { background: var(--fg); }
.door.opened .badge svg { stroke: var(--bg); }

.door.today { animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--black); } }

/* Verrouillée : gris très clair */
.door.locked { --bg: #E9EEEF; --fg: #A7B3B6; --acc: #D3DBDD; cursor: not-allowed; }
.door.locked .badge { background: transparent; }
.door.locked .badge svg { stroke: #A7B3B6; stroke-width: 7; }
.door.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }

.footer { text-align: center; padding: 8px 16px 32px; font-size: .85rem; color: var(--grey); }
.footer a { color: var(--black); font-weight: 700; }

/* ---------- Fenêtre ---------- */
dialog { border: 0; padding: 0; background: transparent; color: var(--black); max-width: min(94vw, 600px); width: 100%; max-height: 94vh; margin: auto; overflow: visible; }
dialog::backdrop { background: rgba(34, 34, 34, .75); }
.card { position: relative; max-height: 94vh; overflow: auto; border-radius: var(--radius); background: #fff; animation: pop .22s ease-out; }
@keyframes pop { from { transform: translateY(12px); opacity: 0; } }

.m-bar { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--black); color: #fff; }
.m-tile { position: relative; width: 48px; height: 48px; flex: none; border-radius: 8px; background: var(--bg); color: var(--fg); }
.m-tile .motif { left: 14%; top: 14%; width: 72%; height: 72%; }
.m-day { margin: 0; flex: 1; font-family: Arial, "Liberation Sans", Helvetica, sans-serif; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; line-height: 1.35; }
.close { width: 40px; height: 40px; flex: none; display: grid; place-items: center; font-size: 1.7rem; line-height: 1; border: 0; border-radius: 8px; background: var(--yellow); color: var(--black); cursor: pointer; }
.close:focus-visible, .btn:focus-visible { outline: 3px solid var(--black); outline-offset: 2px; }
.m-bar .close:focus-visible { outline-color: #fff; }

.m-body { padding: 24px 22px 22px; }
.m-kicker { margin: 0 0 8px; color: var(--grey); font-weight: 700; font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; }
.m-riddle { margin: 0 0 22px; font-size: clamp(1.4rem, 4.2vw, 1.8rem); line-height: 1.2; font-weight: 800; letter-spacing: -.01em; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.actions .btn { flex: 1 1 160px; }
.hint { margin: 14px 0 0; padding: 12px 14px; border-left: 4px solid var(--teal); border-radius: 0 8px 8px 0; background: var(--aqua-l); color: var(--teal); font-weight: 600; }

.btn { display: inline-block; text-decoration: none; font-size: .95rem; font-weight: 700; padding: 13px 18px; border-radius: 8px; border: 2px solid transparent; cursor: pointer; text-align: center; line-height: 1.2; }
.btn.primary { background: var(--yellow); color: var(--black); }
.btn.ghost { background: #fff; color: var(--black); border-color: var(--black); }
.btn.linkedin { background: var(--black); color: #fff; }
.btn.block { display: block; margin-top: 16px; }
.btn.primary:hover { background: #ffd933; }
.btn.ghost:hover { background: var(--grey-l); }

.answer { margin-top: 20px; padding: 22px 18px 18px; border: 2px solid var(--black); border-radius: var(--radius); position: relative; animation: pop .22s ease-out; }
.a-tag { position: absolute; top: -12px; left: 14px; margin: 0; padding: 3px 10px; border-radius: 5px; background: var(--black); color: var(--yellow); font-weight: 700; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; }
.job { margin: 0 0 10px; font-size: clamp(1.4rem, 4.2vw, 1.75rem); font-weight: 800; line-height: 1.15; }
.chip { display: inline-block; padding: 3px 9px; border-radius: 5px; font-family: Arial, "Liberation Sans", Helvetica, sans-serif; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; background: var(--yellow); color: var(--black); }
.blurb { margin: 12px 0 0; font-size: 1.05rem; }

.share { padding: 16px 22px 20px; background: var(--aqua-l); border-top: 1px solid var(--aqua); }
.share-label { margin: 0 0 10px; color: var(--teal); font-weight: 700; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; }
.share-btns { display: flex; flex-wrap: wrap; gap: 10px; }
.share-btns .btn { flex: 1 1 170px; }

@media (max-width: 480px) {
  .m-body { padding: 20px 16px 18px; }
  .share { padding: 14px 16px 18px; }
  dialog { max-width: calc(100vw - 20px); }
}

/* Toast */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); opacity: 0; pointer-events: none; z-index: 10; background: var(--black); color: #fff; padding: 10px 18px; border-radius: var(--radius); font-weight: 700; font-size: .9rem; transition: .25s; max-width: 90vw; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  .door, .card, .answer, .bar span { transition: none; animation: none; }
  .door.today { animation: none; box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--black); }
}

@media (max-width: 480px) {
  .logo { height: 48px; }
}

@media (max-width: 340px) {
  .hero-top { flex-wrap: wrap; }
  .campus { text-align: left; }
}

/* ---------- Fonds de page au choix : ajouter ?fond=a à f à l'adresse pour les voir ---------- */
.fond-a { background: #F2F2F2; }
.fond-b { background: #E3F0F0; }
.fond-c { background: #A9B8BF; }
.fond-d { background: #F5F8F8 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72'%3E%3Cg stroke='%23D3E4E4' stroke-width='2' stroke-linecap='round' fill='none'%3E%3Cpath d='M14 8v12M8 14h12M10 10l8 8M18 10l-8 8'/%3E%3Cpath d='M50 44v12M44 50h12M46 46l8 8M54 46l-8 8'/%3E%3C/g%3E%3C/svg%3E"); }
.fond-e { background: #DCEBEB url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56'%3E%3Ccircle cx='10' cy='10' r='2.6' fill='%23fff'/%3E%3Ccircle cx='38' cy='30' r='2' fill='%23fff'/%3E%3Ccircle cx='20' cy='46' r='1.6' fill='%23fff'/%3E%3C/svg%3E"); }
.fond-f { background: #F5F8F8; }
.fond-f .footer { padding-top: 110px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='150' height='96'%3E%3Cg fill='%23CFE3E3'%3E%3Cpath d='M36 6L56 40H46L62 68H10L26 40H16Z'/%3E%3Crect x='32' y='68' width='8' height='12'/%3E%3Cpath d='M112 26L128 52H120L132 74H92L104 52H96Z'/%3E%3Crect x='109' y='74' width='7' height='10'/%3E%3C/g%3E%3C/svg%3E") repeat-x center bottom / 150px 96px; margin-top: 8px; }
.fond-f .footer p { position: relative; margin: 0; padding-bottom: 6px; }
.fond-c .footer, .fond-c .footer a { color: var(--black); }

/* Badges */
.medals { background: var(--black); color: #fff; border-radius: var(--radius); padding: 16px 18px 18px; }
.medals-title { margin: 0 0 12px; color: var(--yellow); font-family: Arial, "Liberation Sans", Helvetica, sans-serif; font-weight: 700; font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; }
.medals-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.medal { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 50%; aspect-ratio: 1; color: #fff; font-family: Arial, "Liberation Sans", Helvetica, sans-serif; }
.medal img { display: block; width: 100%; height: auto; aspect-ratio: 1; }
.medal.locked { border: 2px dashed rgba(255, 255, 255, .5); }
.medal.locked strong { font-size: 1.25rem; line-height: 1; }
.medal.locked span { margin-top: 3px; font-size: .55rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; opacity: .8; }
.medal.locked:hover { border-color: #fff; }
.medal:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.medals-bar { height: 7px; margin: 16px 0 10px; border-radius: 4px; background: rgba(255, 255, 255, .25); overflow: hidden; }
.medals-bar span { display: block; height: 100%; width: 0; background: var(--yellow); transition: width .5s ease; }
.medals-text { margin: 0; font-size: .95rem; line-height: 1.35; }
.medals-text strong { font-weight: 800; }
.demo-sep { font-weight: 700; margin-left: 8px; }
.b-card { overflow: visible; }
.b-close { position: absolute; top: 10px; right: 10px; z-index: 2; }
.b-body { padding: 26px 22px 22px; text-align: center; }
.b-img { display: block; width: min(240px, 62vw); height: auto; margin: 6px auto 8px; }
.b-title { margin: 0 0 6px; font-size: 1.4rem; line-height: 1.2; }
.b-text { margin: 0 0 18px; color: var(--grey); }
.b-btns { display: flex; flex-direction: column; gap: 10px; }
