/* ==========================================================================
   Glokus — feuille de style unique (accueil, mentions légales, 404)
   Aucune police distante : pile système (SF Pro sur Apple, Segoe UI sur
   Windows, Roboto sur Android). Rien n'est chargé depuis un tiers.
   ========================================================================== */

:root {
  --bg: #fbfbfa;
  --surface: #f1f0ed;
  --surface-hover: #ebe9e5;
  --text: #1c1c1e;
  --muted: #6c6c70;
  --faint: #a1a1a6;
  --line: rgba(28, 28, 30, .12);
  --line-strong: rgba(28, 28, 30, .28);
  --accent: #1a4a5d;
  --accent-soft: rgba(26, 74, 93, .08);
  --invert-bg: #1c1c1e;
  --invert-text: #fbfbfa;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI Variable Display", "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;

  --ease: cubic-bezier(.2, .7, .1, 1);
  --measure: 44rem;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0b0c;
    --surface: #161618;
    --surface-hover: #1d1d20;
    --text: #f2f2f0;
    --muted: #98989d;
    --faint: #636366;
    --line: rgba(242, 242, 240, .12);
    --line-strong: rgba(242, 242, 240, .3);
    --accent: #8cc0d3;
    --accent-soft: rgba(140, 192, 211, .1);
    --invert-bg: #f2f2f0;
    --invert-text: #0b0b0c;
    color-scheme: dark;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.5 var(--font);
  letter-spacing: -.011em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }
button, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }

::selection { background: var(--accent); color: var(--bg); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 8px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap;
}

.wrap {
  width: 100%;
  max-width: 68rem;
  margin: 0 auto;
  padding-inline: 24px;
}

/* ============================== Accueil =============================== */

.intro {
  padding-block: clamp(72px, 17vh, 180px) clamp(56px, 11vh, 120px);
}

.intro-inner {
  max-width: var(--measure);
}

.portrait {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface);
  /* un liseré intérieur très fin, pour que la photo claire ne se dissolve pas dans le fond */
  box-shadow: 0 0 0 1px var(--line);
}

.hello {
  margin: 24px 0 8px;
  color: var(--muted);
  font-size: 17px;
  letter-spacing: -.015em;
}

.question {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.75rem, 3.4vw, 2.4rem);
  line-height: 1.15;
  letter-spacing: -.025em;
  text-wrap: balance;
}

/* --- Réponses ------------------------------------------------------- */

.answer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin: 36px 0 0;
}

.answers {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.answer {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  text-decoration: none;
  font-size: 17px;
  white-space: nowrap;
  transition: background-color .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease), opacity .35s var(--ease);
}

.answer:hover { background: var(--surface); border-color: var(--line-strong); }

.answer[aria-pressed="true"] {
  background: var(--invert-bg);
  color: var(--invert-text);
  border-color: var(--invert-bg);
}

/* une fois la réponse choisie, les autres s'effacent
   (la transition est assurée par l'API View Transitions quand elle existe) */
.answers.chosen li:not(:has([aria-pressed="true"])) { display: none; }

.answers li:nth-child(1) { view-transition-name: answer-1; }
.answers li:nth-child(2) { view-transition-name: answer-2; }
.answers li:nth-child(3) { view-transition-name: answer-3; }
.answers li:nth-child(4) { view-transition-name: answer-4; }

::view-transition-group(*) { animation-duration: .5s; animation-timing-function: cubic-bezier(.2, .7, .1, 1); }

.change {
  display: none;
  padding: 8px 4px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 15px;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
}
.change:hover { color: var(--text); }
.answers.chosen + .change { display: inline-block; }

/* --- Réplique de Roland ------------------------------------------------- */

.reply {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .6s var(--ease);
}
.reply.open { grid-template-rows: 1fr; }
.reply > div { overflow: hidden; }

.reply-body {
  padding-top: 36px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .5s var(--ease) .1s, transform .6s var(--ease) .1s;
}
.reply.open .reply-body { opacity: 1; transform: none; }

.reply-text {
  margin: 0;
  max-width: 34rem;
  font-size: clamp(1.1rem, 1.8vw, 1.25rem);
  line-height: 1.45;
  letter-spacing: -.015em;
  text-wrap: pretty;
}

.compose {
  margin-top: 28px;
  max-width: 34rem;
}

.compose label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 15px;
}

.compose textarea {
  display: block;
  width: 100%;
  min-height: 7.5rem;
  padding: 16px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: transparent;
  resize: vertical;
  font-size: 17px;
  line-height: 1.45;
  transition: border-color .2s var(--ease), background-color .2s var(--ease);
}
.compose textarea::placeholder { color: var(--faint); }
.compose textarea:focus { outline: none; border-color: var(--text); background: var(--surface); }

.compose-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  margin-top: 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  background: var(--invert-bg);
  color: var(--invert-text);
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.btn:hover { opacity: .86; }
.btn:active { transform: scale(.98); }

.link {
  padding: 8px 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 15px;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
}
.link:hover { color: var(--text); }

#learnActions { margin-top: 24px; }

.fine {
  margin: 14px 0 0;
  color: var(--faint);
  font-size: 13px;
  line-height: 1.45;
}

/* ============================== Formations ============================= */

.learn {
  padding-block: 0 clamp(80px, 14vh, 160px);
}

.eyebrow {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -.005em;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 15rem;
  padding: 32px 34px 30px;
  border-radius: 28px;
  background: var(--surface);
  text-decoration: none;
  transition: background-color .35s var(--ease), box-shadow .35s var(--ease);
}
.tile:hover { background: var(--surface-hover); }
.tile.pulse { box-shadow: 0 0 0 2px var(--accent); }

.tile-kicker {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 14px;
}

.tile-name {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.4rem, 2.2vw, 1.75rem);
  line-height: 1.15;
  letter-spacing: -.025em;
}
.tile-name .ai { color: var(--accent); }

.tile-text {
  margin: 12px 0 0;
  max-width: 24rem;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.45;
}

.tile-go {
  margin-top: auto;
  padding-top: 24px;
  color: var(--accent);
  font-size: 17px;
  font-weight: 500;
}
.tile-go span {
  display: inline-block;
  transition: transform .35s var(--ease);
}
.tile:hover .tile-go span { transform: translateX(4px); }

/* =========================== À côté (projets) ========================== */

.aside {
  padding-block: 0 clamp(64px, 10vh, 120px);
}

.aside .eyebrow { color: var(--faint); }

.side-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 0;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 15px;
}

.side-list li + li::before {
  content: "·";
  margin: 0 12px;
  color: var(--faint);
}

.side-list a {
  text-decoration: none;
  transition: color .2s var(--ease);
}
.side-list a:hover { color: var(--text); }
.side-list small { color: var(--faint); font-size: inherit; }

/* =============================== Pied =================================== */

.foot {
  border-top: 1px solid var(--line);
  padding: 22px 0 40px;
  color: var(--faint);
  font-size: 13px;
}
.foot .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
}
.foot a { text-decoration: none; }
.foot a:hover { color: var(--text); }
.foot .grow { flex: 1; }

/* ========================= Pages de texte =============================== */

.page {
  padding-block: 14vh 12vh;
}
.page .back {
  display: inline-block;
  margin-bottom: 40px;
  color: var(--muted);
  font-size: 15px;
  text-decoration: none;
}
.page .back:hover { color: var(--text); }
.page h1 {
  margin: 0 0 40px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.75rem, 3.4vw, 2.4rem);
  line-height: 1.15;
  letter-spacing: -.025em;
}
.page h2 {
  margin: 44px 0 10px;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -.02em;
}
.page p, .page li {
  max-width: var(--measure);
  color: var(--muted);
}
.page p { margin: 0 0 12px; }
.page ul { margin: 0 0 12px; padding-left: 1.2em; }

/* ============================ Entrée en scène ============================ */

.rise {
  opacity: 0;
  transform: translateY(14px);
  animation: rise .9s var(--ease) forwards;
}
.rise:nth-child(1) { animation-delay: .05s; }
.rise:nth-child(2) { animation-delay: .18s; }
.rise:nth-child(3) { animation-delay: .3s; }
.rise:nth-child(4) { animation-delay: .46s; }

@keyframes rise {
  to { opacity: 1; transform: none; }
}

/* ================================ Adaptatif ============================= */

@media (max-width: 760px) {
  body { font-size: 16px; }
  .wrap { padding-inline: 16px; }
  .intro { padding-block: 64px 56px; }
  .answer-row { margin-top: 28px; }
  .answer { min-height: 44px; padding: 0 18px; font-size: 16px; white-space: normal; }
  .tiles { grid-template-columns: 1fr; gap: 12px; }
  .tile { min-height: 0; padding: 26px 24px 24px; border-radius: 22px; }
  .tile-go { padding-top: 20px; }
  .side-list { flex-direction: column; gap: 10px; }
  .side-list li + li::before { content: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-delay: 0s !important;
    transition-duration: .01ms !important;
    transition-delay: 0s !important;
  }
  .rise { opacity: 1; transform: none; }
}

.page mark {
  padding: 0 4px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--text);
}
