/* Design close to apple.com: white and light grey, one blue accent, big type, lots of
   space, one idea per screen. Contrasts follow RGAA 3.2 and 3.3: 4.5:1 for text,
   3:1 for interface parts, so the secondary grey is darker than Apple's. */
:root {
  --bg: #ffffff;
  --bg-alt: #f5f5f7;
  --ink: #1d1d1f;
  --ink-2: #515154;
  --line: #d2d2d7;
  --blue: #0066cc;
  --blue-hover: #0058b0;
  --green: #1d7d3a;
  --red: #c4221f;
  --radius: 18px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 17px;
  line-height: 1.47;
  letter-spacing: -0.022em;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 6px; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- Header ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
.nav-inner { max-width: 1024px; margin: 0 auto; padding: 0 22px; height: 52px; display: flex; align-items: center; justify-content: space-between; }
.brand { font-weight: 600; font-size: 19px; color: var(--ink); letter-spacing: -0.02em; }
.brand:hover { text-decoration: none; }
.nav-links { display: flex; gap: 22px; font-size: 14px; }
.nav-links a { color: var(--ink); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 26px;
  border-radius: 980px; border: 0;
  background: var(--blue); color: #fff;
  font: inherit; font-size: 17px; font-weight: 500;
  cursor: pointer; transition: background 0.2s var(--ease), transform 0.2s var(--ease);
}
.btn:hover { background: var(--blue-hover); text-decoration: none; }
.btn:active { transform: scale(0.98); }
.btn[disabled] { opacity: 0.45; cursor: default; }
.btn-secondary { background: transparent; color: var(--blue); border: 1px solid var(--blue); }
.btn-secondary:hover { background: rgba(0, 102, 204, 0.06); }
.btn-ghost { background: transparent; color: var(--blue); padding: 12px 10px; }
.btn-ghost:hover { background: transparent; text-decoration: underline; }
.btn-lg { min-height: 56px; padding: 16px 34px; font-size: 19px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: center; margin-top: 36px; }

/* ---------- Home ---------- */
.hero { text-align: center; padding: 96px 22px 72px; }
.eyebrow { font-size: 21px; font-weight: 600; color: var(--blue); margin: 0 0 8px; }
.hero h1 { font-size: clamp(44px, 8vw, 80px); line-height: 1.05; letter-spacing: -0.015em; font-weight: 700; margin: 0 auto; max-width: 14ch; }
.hero .lead { font-size: clamp(21px, 3vw, 28px); line-height: 1.25; color: var(--ink-2); margin: 20px auto 0; max-width: 30ch; font-weight: 400; }
.hero .meta { margin-top: 16px; font-size: 14px; color: var(--ink-2); }
.section { padding: 88px 22px; }
.section-alt { background: var(--bg-alt); }
.section h2 { font-size: clamp(32px, 5vw, 56px); line-height: 1.07; text-align: center; margin: 0 auto 16px; max-width: 18ch; letter-spacing: -0.01em; }
.section .sub { text-align: center; color: var(--ink-2); font-size: 21px; max-width: 34ch; margin: 0 auto 56px; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; max-width: 1024px; margin: 0 auto; }
.step { background: var(--bg); border-radius: var(--radius); padding: 34px 28px; }
.section-alt .step { background: #fff; }
.step .num { font-size: 15px; font-weight: 600; color: var(--blue); }
.step h3 { font-size: 24px; margin: 8px 0 8px; line-height: 1.17; }
.step p { margin: 0; color: var(--ink-2); }
.promise { max-width: 760px; margin: 0 auto; display: grid; gap: 14px; }
.promise p { margin: 0; font-size: 19px; }
.promise strong { font-weight: 600; }
.footer { background: var(--bg-alt); color: var(--ink-2); font-size: 12px; padding: 28px 22px 40px; border-top: 1px solid var(--line); }
.footer-inner { max-width: 1024px; margin: 0 auto; display: grid; gap: 10px; }
.footer a { color: var(--ink-2); text-decoration: underline; }
.footer nav { display: flex; flex-wrap: wrap; gap: 16px; }

/* ---------- App shell ---------- */
.app { min-height: calc(100vh - 52px); display: flex; flex-direction: column; position: relative; }
.progress { height: 3px; background: var(--bg-alt); }
.progress-bar { height: 100%; width: 0; background: var(--blue); transition: width 0.6s var(--ease); }
.chapter { text-align: center; font-size: 14px; font-weight: 600; color: var(--ink-2); padding: 18px 22px 0; letter-spacing: 0; }
.stage { flex: 1; display: flex; align-items: flex-start; justify-content: center; padding: 28px 22px 64px; }
.screen { width: 100%; max-width: 680px; animation: enter 0.45s var(--ease) both; }
.screen.wide { max-width: 980px; }
@keyframes enter { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.screen h1, .screen .title {
  font-size: clamp(30px, 5vw, 44px); line-height: 1.1; font-weight: 700; letter-spacing: -0.01em;
  margin: 12px 0 14px; text-align: center; outline: none;
}
.screen .hint.left { text-align: left; margin-left: 0; }
.screen .hint { text-align: center; color: var(--ink-2); font-size: 19px; margin: 0 auto 32px; max-width: 34ch; }

/* Big choice cards (situation, goal, scene options). */
.choices { display: grid; gap: 12px; }
.choice {
  width: 100%; text-align: left; font: inherit; font-size: 18px; line-height: 1.4; color: var(--ink);
  background: var(--bg-alt); border: 2px solid transparent; border-radius: var(--radius);
  padding: 20px 22px; cursor: pointer;
  transition: transform 0.25s var(--ease), background 0.25s var(--ease), border-color 0.25s var(--ease), opacity 0.35s var(--ease);
}
.choice:hover { background: #ececf0; }
.choice[aria-pressed="true"], .choice.chosen { border-color: var(--blue); background: #eef5fd; }
.choice.chosen { transform: scale(1.015); }
.choices.answered .choice:not(.chosen) { opacity: 0.25; transform: scale(0.98); }
.choices.answered .choice { pointer-events: none; }

.screen h1.situation, .situation { font-size: clamp(21px, 3vw, 26px); line-height: 1.38; font-weight: 600; letter-spacing: -0.015em; margin: 8px 0 22px; text-align: left; }

/* The live reaction: big type, appearing word by word. */
.reaction {
  font-size: clamp(22px, 3.4vw, 30px); line-height: 1.35; font-weight: 500; letter-spacing: -0.015em;
  margin: 28px 0 0; min-height: 1.4em; white-space: pre-wrap;
}
.reaction.portrait { font-size: clamp(24px, 3.8vw, 34px); }
.caret { display: inline-block; width: 0.5em; height: 1em; vertical-align: -0.12em; margin-left: 2px; background: var(--blue); border-radius: 2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.thinking { display: inline-flex; gap: 6px; padding: 10px 0; }
.thinking span { width: 9px; height: 9px; border-radius: 50%; background: var(--line); animation: dot 1.2s var(--ease) infinite; }
.thinking span:nth-child(2) { animation-delay: 0.15s; }
.thinking span:nth-child(3) { animation-delay: 0.3s; }
@keyframes dot { 0%, 100% { transform: translateY(0); background: var(--line); } 40% { transform: translateY(-6px); background: var(--blue); } }

/* The "spotted" tag that appears under a reaction. */
.tag {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 22px;
  padding: 8px 16px; border-radius: 980px; background: #eef5fd; color: var(--blue);
  font-size: 15px; font-weight: 600; animation: pop 0.5s var(--ease) both;
}
.tag::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(0.96); } to { opacity: 1; transform: none; } }

.relance { margin-top: 30px; padding: 22px; background: var(--bg-alt); border-radius: var(--radius); animation: pop 0.5s var(--ease) both; }
.relance p { margin: 0 0 12px; font-weight: 600; font-size: 18px; }
.notice { margin-top: 18px; padding: 14px 18px; border-radius: 12px; background: #fff7e6; color: #6b4a00; font-size: 15px; }

/* ---------- Forms ---------- */
.field { display: grid; gap: 6px; margin-bottom: 18px; text-align: left; }
.field label { font-weight: 600; font-size: 15px; }
.field .help { font-size: 14px; color: var(--ink-2); margin: 0; }
.input, textarea.input {
  width: 100%; font: inherit; font-size: 17px; color: var(--ink);
  border: 1px solid #86868b; border-radius: 12px; padding: 14px 16px; background: #fff;
}
textarea.input { min-height: 140px; resize: vertical; line-height: 1.45; }
.input:focus { outline: 3px solid rgba(0, 102, 204, 0.35); border-color: var(--blue); }
.input[aria-invalid="true"] { border-color: var(--red); }
.error { color: var(--red); font-size: 15px; margin: 4px 0 0; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; text-align: left; }
.check input { width: 20px; height: 20px; margin-top: 2px; flex: none; }
.password-wrap { position: relative; }
.password-wrap .input { padding-right: 96px; }
.password-wrap button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }
.tabs { display: flex; gap: 6px; background: var(--bg-alt); border-radius: 980px; padding: 4px; margin: 0 auto 28px; width: fit-content; }
.tabs button { font: inherit; font-size: 15px; border: 0; background: transparent; padding: 8px 18px; border-radius: 980px; cursor: pointer; color: var(--ink); }
.tabs button[aria-selected="true"] { background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1); font-weight: 600; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }

/* Job autocomplete. */
.combo { position: relative; }
.listbox { list-style: none; margin: 6px 0 0; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow); max-height: 320px; overflow: auto; }
.listbox li { padding: 12px 14px; border-radius: 8px; cursor: pointer; }
.listbox li[aria-selected="true"], .listbox li:hover { background: var(--bg-alt); }

/* ---------- Card sort ---------- */
.deck { position: relative; height: 300px; max-width: 420px; margin: 0 auto; touch-action: pan-y; }
.swipe-card {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center;
  padding: 36px; border-radius: 28px; background: #fff; box-shadow: var(--shadow); border: 1px solid #e8e8ed;
  font-size: clamp(24px, 4vw, 30px); line-height: 1.25; font-weight: 600; user-select: none; cursor: grab;
  transition: transform 0.35s var(--ease), opacity 0.35s var(--ease);
}
.swipe-card.dragging { transition: none; cursor: grabbing; }
.swipe-card.behind { transform: scale(0.95) translateY(14px); opacity: 0.6; }
.swipe-card .stamp { position: absolute; top: 22px; font-size: 15px; font-weight: 700; padding: 4px 12px; border-radius: 8px; opacity: 0; letter-spacing: 0.02em; }
.swipe-card .stamp.yes { right: 22px; color: var(--green); border: 2px solid var(--green); }
.swipe-card .stamp.no { left: 22px; color: var(--ink-2); border: 2px solid var(--ink-2); }
.deck-count { text-align: center; color: var(--ink-2); font-size: 15px; margin-top: 16px; }
.deck-buttons { display: flex; justify-content: center; gap: 14px; margin-top: 22px; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.chip { font: inherit; font-size: 16px; padding: 12px 18px; border-radius: 980px; border: 1.5px solid var(--line); background: #fff; cursor: pointer; display: inline-flex; gap: 8px; align-items: center; }
.chip[aria-pressed="true"] { border-color: var(--blue); background: #eef5fd; }
.chip .rank { display: inline-flex; width: 22px; height: 22px; border-radius: 50%; background: var(--blue); color: #fff; font-size: 13px; font-weight: 700; align-items: center; justify-content: center; }

/* ---------- Radar ---------- */
.radar-mini { display: flex; justify-content: center; margin: 0 0 6px; }
.radar-mini svg { width: 120px; height: 120px; }
.radar svg { width: 100%; max-width: 560px; height: auto; display: block; margin: 0 auto; }
.rd .grid { fill: none; stroke: #e5e5ea; stroke-width: 1; }
.rd .axis { stroke: #ececf0; stroke-width: 1; }
.rd .shape { fill: rgba(0, 102, 204, 0.16); stroke: var(--blue); stroke-width: 2; stroke-linejoin: round; }
.rd .pt { fill: var(--blue); }
.rd .pt.prouvee { fill: var(--green); }
.rd .lbl { font-size: 13px; fill: var(--ink-2); font-family: var(--font); }
.radar-mini.pulse svg { animation: pulse 0.6s var(--ease); }
@keyframes pulse { 50% { transform: scale(1.08); } }
.legend { display: flex; gap: 18px; justify-content: center; font-size: 14px; color: var(--ink-2); margin-top: 10px; flex-wrap: wrap; }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
.legend .l-testee::before { background: var(--blue); }
.legend .l-prouvee::before { background: var(--green); }
table.scores { width: 100%; border-collapse: collapse; margin-top: 18px; font-size: 15px; }
table.scores th, table.scores td { text-align: left; padding: 10px 8px; border-bottom: 1px solid #e8e8ed; }
table.scores th { font-weight: 600; color: var(--ink-2); font-size: 13px; }
details.more { margin-top: 18px; }
details.more summary { cursor: pointer; color: var(--blue); }

/* ---------- Reveal ---------- */
.reveal { text-align: center; }
.reveal .kicker { font-size: 17px; font-weight: 600; color: var(--blue); margin: 0 0 6px; }
.reveal .big { font-size: clamp(36px, 7vw, 64px); line-height: 1.06; font-weight: 700; letter-spacing: -0.015em; margin: 8px auto 22px; max-width: 16ch; outline: none; }
.reveal .body { font-size: clamp(19px, 2.6vw, 24px); line-height: 1.45; color: var(--ink); max-width: 36ch; margin: 0 auto; }
.reveal-slide { min-height: 62vh; display: flex; flex-direction: column; justify-content: center; animation: enter 0.6s var(--ease) both; }
.reveal-all .reveal-slide { min-height: 0; padding: 48px 0; border-bottom: 1px solid #e8e8ed; }
.items { display: grid; gap: 14px; text-align: left; max-width: 640px; margin: 10px auto 0; }
.item { background: var(--bg-alt); border-radius: var(--radius); padding: 22px 24px; animation: pop 0.6s var(--ease) both; }
.item:nth-child(2) { animation-delay: 0.15s; }
.item:nth-child(3) { animation-delay: 0.3s; }
.item:nth-child(4) { animation-delay: 0.45s; }
.item h3 { margin: 0 0 6px; font-size: 21px; line-height: 1.2; }
.item p { margin: 0; color: var(--ink-2); }
.item .solid { font-size: 13px; font-weight: 600; color: var(--green); margin-top: 8px; }
.reveal-nav { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 34px; }
.dots { display: flex; gap: 6px; }
.dots span { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.dots span.on { background: var(--ink); }
.loading-reveal { text-align: center; padding-top: 10vh; }
.loading-reveal .orb { width: 120px; height: 120px; margin: 0 auto 34px; border-radius: 50%; background: conic-gradient(from 0deg, #0066cc, #5ac8fa, #34c759, #0066cc); animation: spin 3s linear infinite; filter: blur(0.5px); mask: radial-gradient(circle, transparent 52%, #000 54%); -webkit-mask: radial-gradient(circle, transparent 52%, #000 54%); }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-reveal p { font-size: 22px; font-weight: 500; min-height: 1.5em; }
.stars { display: flex; gap: 8px; justify-content: center; }
.stars button { font: inherit; font-size: 17px; width: 48px; height: 48px; border-radius: 50%; border: 1.5px solid var(--line); background: #fff; cursor: pointer; }
.stars button[aria-pressed="true"] { background: var(--blue); color: #fff; border-color: var(--blue); }
.small { font-size: 13px; color: var(--ink-2); }
.center { text-align: center; }
.mt { margin-top: 28px; }

/* ---------- Text pages ---------- */
.page { max-width: 760px; margin: 0 auto; padding: 56px 22px 80px; }
.page h1 { font-size: clamp(34px, 5vw, 48px); line-height: 1.1; margin: 0 0 24px; }
.page h2 { font-size: 24px; margin: 40px 0 10px; }
.page p, .page li { color: var(--ink); }
.page table { border-collapse: collapse; width: 100%; font-size: 15px; }
.page th, .page td { border-bottom: 1px solid var(--line); padding: 10px 8px; text-align: left; vertical-align: top; }

@media (max-width: 700px) {
  body { font-size: 16px; }
  .hero { padding: 64px 18px 48px; }
  .section { padding: 64px 18px; }
  .nav-links { gap: 14px; }
  .choice { font-size: 17px; padding: 18px; }
  .deck { height: 270px; }
}

/* RGAA 13.8 and the "reduce motion" setting: no movement, only short fades. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .loading-reveal .orb { animation: none; }
  .caret { animation: none; }
}

/* ---------- Phone first ----------
   Most people will do the evaluation on their phone. On a small screen:
   - the main button sticks to the bottom, in the thumb zone, above the iPhone home bar;
   - every touch target is at least 48 px high, with no double-tap zoom delay;
   - the screen uses the real visible height (dvh), which follows the browser bars. */
button, a, .choice, .chip, .swipe-card { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.app { min-height: calc(100dvh - 52px); }
body { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }

@media (max-width: 700px) {
  .nav-inner { height: 48px; padding: 0 16px; }
  .brand { font-size: 17px; }
  .app { min-height: calc(100dvh - 48px); }
  .chapter { padding: 12px 16px 0; font-size: 13px; }
  .stage { padding: 14px 16px 24px; }
  .screen h1 { font-size: 30px; margin: 6px 0 10px; }
  .screen .hint { font-size: 17px; margin-bottom: 22px; }
  .screen h1.situation { font-size: 21px; }
  .choice { min-height: 56px; }
  .choices { gap: 10px; }
  .reaction { font-size: 22px; margin-top: 22px; }
  .reaction.portrait { font-size: 24px; }

  /* The main actions stay at the bottom of the screen, always reachable. */
  .actions.sticky {
    position: sticky; bottom: 0; z-index: 20;
    margin: 24px -16px 0; padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #fff 28%);
    flex-direction: column-reverse; align-items: stretch;
  }
  .actions.sticky .btn { width: 100%; }
  .actions .btn-lg { width: 100%; }
  .actions { gap: 8px; }

  .deck { height: min(62vw, 300px); max-width: 100%; }
  .swipe-card { padding: 26px; font-size: 24px; border-radius: 24px; }
  .deck-buttons .btn { flex: 1; min-height: 56px; }
  .chip { font-size: 15px; padding: 12px 14px; min-height: 48px; }

  /* The small radar floats at the right of the situation, and the text wraps around it. */
  .radar-mini { float: right; margin: 4px 0 6px 12px; }
  .radar-mini svg { width: 64px; height: 64px; }

  .reveal-slide { min-height: calc(100dvh - 230px); }
  .reveal .big { font-size: 38px; }
  .reveal .body { font-size: 19px; }
  .item { padding: 18px; }
  .reveal-nav { position: sticky; bottom: 0; background: linear-gradient(to bottom, rgba(255,255,255,0), #fff 30%); padding: 16px 0 calc(12px + env(safe-area-inset-bottom)); margin-top: 12px; }
  .reveal-nav .btn { flex: 1; }
  .card { padding: 20px; }
  .tabs { margin-bottom: 18px; }
  .page { padding: 36px 16px 64px; }
}

/* When the app is installed on the home screen, there is no browser bar: we leave room
   for the status bar of the phone. */
@media (display-mode: standalone) {
  .nav { padding-top: env(safe-area-inset-top); }
}
