/* Petit Pont tester page, in the game's Minimal look (see STYLE-GUIDE.md):
   flat paper, no gradients, no shadows, square corners, Outfit Bold, uppercase block buttons.
   The top of the page is a journey you scroll through (journey.js). */
/* Outfit, SIL Open Font License 1.1 - see /fonts/Outfit-OFL.txt. Served from this server. */
@font-face {
  font-family: "Outfit PP";
  src: url("/fonts/outfit-bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #F4F1E8;
  --ink: #1A1A1A;
  --ink-72: rgba(26, 26, 26, .72);
  --ink-60: rgba(26, 26, 26, .6);
  --ink-50: rgba(26, 26, 26, .5);
  --gold: #FFC83D;
  --gold-pressed: #FFD66E;      /* gold lightened 25 % toward white */
  --ink-pressed: #535353;       /* ink lightened 25 % toward white */
  --sand: #E9E5D6;
  --white: #FFFFFF;
  --alert: #B3261E;
  --font: "Outfit PP", "Outfit", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 700;
  font-size: 1.0625rem;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; font-weight: 700; line-height: 1.15; }
p { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- the journey ---------- */
.journey { position: relative; height: 100vh; height: 100svh; }
.journey.js { height: 1300vh; }   /* longer = less story per swipe */
.stage {
  /* day palette; journey.js blends these toward dusk and night as the car travels */
  --sky: #F4F1E8; --ground: #E8E3D5; --far1: #ECE8DC; --far2: #E4DFD0; --snow: #F4F1E8; --block: #E1DCCC;
  --water: #F4F1E8; --ink: #1A1A1A; --line: #1A1A1A; --pill: #1A1A1A; --pillText: #F4F1E8; --night: 0; --win: 0;
  position: relative;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  background: var(--sky);
  color: var(--ink);
}
.journey.js .stage { position: sticky; top: 0; }
.sky, .world { position: absolute; inset: 0; width: 100%; height: 100%; }
.world { display: block; }

.sun, .moon {
  position: absolute;
  width: clamp(54px, 9vmin, 104px);
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
}
.sun { left: 80%; top: 15%; background: #FFC83D; }
.moon { left: 78%; top: 30%; background: #F2F6FF; overflow: hidden; }
.moon::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--sky); transform: translate(30%, -14%); }
.stars { position: absolute; inset: 0; opacity: 0; }
.star-dot { position: absolute; border-radius: 50%; background: #F2F6FF; animation: twinkle 3s ease-in-out infinite alternate; }
.stage:not(.night) .star-dot { animation-play-state: paused; }
@keyframes twinkle { from { opacity: .2; } to { opacity: 1; } }

/* world drawing (SVG) */
.w-far1 { fill: var(--far1); }
.w-far2 { fill: var(--far2); }
.w-snow { fill: var(--snow); }
.w-block { fill: var(--block); }
.w-win { fill: #FFC83D; opacity: var(--win); }
.w-ground { fill: var(--ground); }
.w-water { fill: var(--water); }
.w-line { fill: none; stroke: var(--line); stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.w-grid { fill: #B9B6AA; }
.w-beam { fill: none; stroke-linecap: butt; }
.w-joint { fill: var(--ink); }
.w-jc { fill: var(--sky); }
.w-logo-text { fill: var(--ink); font-family: var(--font); font-weight: 700; font-size: 99px; }
.w-car { fill: #E5484D; stroke: var(--line); stroke-width: 2.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.w-glass, .w-wheel { fill: #FFFFFF; stroke: var(--line); stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.w-hub { fill: var(--line); }
.w-light { fill: #FFF1C2; opacity: calc(var(--night) * .32); }
.w-sel { fill: #FFC83D; }
.w-ghost { fill: none; stroke: var(--ink); stroke-width: 2.5; vector-effect: non-scaling-stroke; opacity: .35; }
.w-pulse { fill: none; stroke: #5FBF6E; stroke-width: 6; animation: pulse 1.05s ease-in-out infinite alternate; }   /* the game's PASTE pulse, 6 rad/s */
@keyframes pulse { from { opacity: .3; } to { opacity: .9; } }
.w-drag { fill: none; stroke: #FFC83D; stroke-width: 8; stroke-dasharray: 1 1; stroke-dashoffset: 1; animation: drag 2.8s ease-in-out infinite; }
@keyframes drag { 0%, 12% { stroke-dashoffset: 1; } 62%, 88% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: 1; } }

/* captions and HUD on top of the world */
.cap {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 11%;
  width: min(90%, 780px);
  transform: translateX(-50%);
  text-align: center;
  font-size: clamp(1.4rem, 5.6vw, 2.7rem);
  line-height: 1.2;
  color: var(--ink);
  pointer-events: none;
}
.journey.js .cap { opacity: 0; visibility: hidden; }
/* scrolling captions: big, positioned by journey.js from the top of the stage */
.journey.js .cap:not(.low) { top: 0; font-size: clamp(2.1rem, 9.5vw, 4.6rem); line-height: 1.08; width: min(92%, 980px); transform-origin: 50% 50%; will-change: transform, opacity; }
.cap.low { top: auto; bottom: 17%; font-size: clamp(1.05rem, 4.2vw, 1.5rem); opacity: .65; }
.journey.js .cap.low { opacity: 0; }
.cap small { display: block; margin-top: 14px; font-size: .42em; opacity: .65; }
.journey:not(.js) .cap:not(.low),
.journey:not(.js) .j-stress, .journey:not(.js) .j-play, .journey:not(.js) .crossed,
.journey:not(.js) .j-skip, .journey:not(.js) .j-cue, .journey:not(.js) .j-dots { display: none; }

/* peak stress, floating above the bridge (positioned by journey.js) */
.j-stress {
  position: absolute;
  z-index: 2;
  left: 0;
  top: 0;
  padding-bottom: 14px;
  text-align: center;
  color: var(--ink);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.j-stress-label { font-size: clamp(.72rem, 2.6vw, 1rem); opacity: .6; white-space: nowrap; }
.j-stress-num { font-size: clamp(2.8rem, 13vw, 5rem); line-height: 1; margin-top: 2px; font-variant-numeric: tabular-nums; }
.j-stress-bar { width: clamp(150px, 42vw, 240px); height: 12px; margin: 8px auto 0; background: color-mix(in srgb, var(--ink) 15%, transparent); }
.j-stress-bar span { display: block; height: 100%; width: 0; }
.j-play {
  position: absolute;
  z-index: 3;
  right: 16px;
  bottom: 64px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 30px;
  background: #FFC83D;
  color: #1A1A1A;
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  opacity: 0;
}
.j-play svg { width: .8em; height: .8em; fill: currentColor; }
.j-play.pressed { background: #FFD66E; }
.crossed {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%);
  min-width: min(86vw, 420px);
  padding: 26px 40px 24px;
  background: #E9E5D6;
  color: #1A1A1A;
  text-align: center;
  opacity: 0;
  visibility: hidden;
}
.crossed-title { font-size: clamp(2.2rem, 9vw, 3.6rem); line-height: 1; }
.crossed-stars { display: flex; justify-content: center; gap: 14px; margin: 18px 0 14px; }
.crossed .star { width: clamp(44px, 12vw, 64px); height: auto; overflow: visible; transform: scale(0); }
.crossed .star polygon { fill: #FFC83D; stroke: #1A1A1A; stroke-width: .12; stroke-linejoin: round; }
.crossed-sub { color: rgba(26, 26, 26, .6); }
.j-skip {
  position: absolute;
  z-index: 3;
  right: 16px;
  top: 16px;
  padding: 8px 16px;
  background: var(--pill);
  color: var(--pillText);
  text-decoration: none;
  font-size: 1rem;
}
.j-skip:hover { opacity: .85; }
.j-cue {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 64px;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin-left: -27px;
  padding: 0;
  border-radius: 50%;
  border: 3px solid var(--ink);
  background: rgba(244, 241, 232, .92);
  color: var(--ink);
  cursor: pointer;
  opacity: 0;
}
.j-cue:active { background: rgba(26, 26, 26, .18); }
/* the game's level dots: a thin line of dots, the current one ringed */
.j-dots {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 16px;
  opacity: 0;
}
.j-dots::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 2px; margin-top: -1px; background: var(--ink); opacity: .25; }
.j-dots span { position: relative; width: 7px; height: 7px; border-radius: 50%; background: var(--ink); opacity: .5; }
.j-dots span.on { width: 20px; height: 20px; margin: -6.5px; opacity: 1; background: var(--sky); border: 3px solid var(--ink); }
.j-dots span.on::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--ink); }

/* ---------- content ---------- */
main { max-width: 640px; margin: 0 auto; padding: 0 16px 24px; }
h2 { font-size: clamp(1.6rem, 6.5vw, 2.1rem); }
.welcome { padding: 44px 4px 32px; }
.welcome p { font-size: clamp(1.2rem, 4.8vw, 1.45rem); line-height: 1.35; }

.panel { background: var(--sand); padding: 28px 22px; }

/* Word block buttons: solid rectangle, no border, no shadow, no radius. Pressed (and hover) = 25 % lighter. */
.block {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 64px;
  padding: 10px 26px;
  border: 0;
  border-radius: 0;
  font: inherit;
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1;
  text-transform: uppercase;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.block.gold { background: var(--gold); color: var(--ink); }
.block.ink  { background: var(--ink);  color: var(--paper); }
.block.gold:not(:disabled):hover, .block.gold:not(:disabled):active { background: var(--gold-pressed); }
.block.ink:not(:disabled):hover,  .block.ink:not(:disabled):active  { background: var(--ink-pressed); }
.block:disabled { opacity: .5; cursor: default; }

.download { text-align: center; }
.action { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 24px; }
.motif { flex: none; width: 74px; height: auto; }
.block.big { flex: 1 1 auto; max-width: 380px; min-height: 92px; font-size: clamp(2rem, 9vw, 2.8rem); }
.block.busy span::after { content: ""; display: inline-block; width: 1em; text-align: left; animation: dots 1.2s steps(4) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }

.dl-meta { margin-top: 10px; color: var(--ink-60); font-variant-numeric: tabular-nums; }
/* three big choices: square, no border, no shadow (game style) */
.choices { display: grid; gap: 16px; margin-top: 22px; }
.block.choice { display: flex; flex-direction: column; width: 100%; min-height: 84px; padding: 14px 20px; font-size: clamp(1.25rem, 5.4vw, 1.75rem);
                line-height: 1.1; text-decoration: none; text-align: center; }
.block.choice small { display: block; margin-top: 6px; font-size: .58em; opacity: .75; text-transform: none; }
.block.choice:disabled { opacity: .45; }
.choice-row .status { margin-top: 4px; }
.choice-note { margin: -4px 4px 0; font-size: .95rem; color: var(--ink-60); }
.status { min-height: 1.4em; margin-top: 10px; }
.status.ok { color: #2E7D3E; }
.status.err { color: var(--alert); }
.fingerprint { margin-top: 14px; font-size: .85rem; color: var(--ink-60); text-align: left; }
.fingerprint summary { cursor: pointer; text-align: center; }
.fingerprint code { display: block; margin-top: 8px; padding: 10px 12px; background: var(--paper); word-break: break-all; font-size: .78rem; font-weight: 400; }

.steps { padding: 48px 0 8px; }
.steps h2 { padding: 0 4px; }
.steps ol { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 12px; }
.steps li { display: flex; gap: 16px; align-items: flex-start; background: var(--sand); padding: 18px; }
.steps h3 { font-size: 1.25rem; margin-bottom: 4px; }
.steps li p { color: var(--ink-72); }
/* step numbers drawn as joints: ink circle, paper number */
.num { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--ink); color: var(--paper); font-size: 1.2rem; }
.note { margin: 14px 0 0; padding: 16px 18px 16px 22px; background: var(--sand); border-left: 8px solid var(--gold); color: var(--ink-72); }

.feedback { margin-top: 44px; }
.lead { margin-top: 10px; color: var(--ink-72); }
form { margin-top: 20px; display: grid; }
label { font-size: .95rem; margin: 14px 0 6px; color: var(--ink-60); }
input[type=text], textarea {
  width: 100%;
  font: inherit;
  font-weight: 700;
  color: var(--ink);
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: 0;
  padding: 12px 14px;
}
textarea { resize: vertical; min-height: 130px; }
input[type=text]:focus, textarea:focus { outline: none; box-shadow: 0 0 0 4px var(--gold); }
.counter { justify-self: end; margin-top: 6px; font-size: .85rem; color: var(--ink-50); font-variant-numeric: tabular-nums; }
.counter.near { color: var(--alert); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.send-row { display: flex; justify-content: flex-end; margin-top: 16px; }   /* primary action on the right, under the thumb */
.send-row .block { min-width: 150px; font-size: clamp(1.2rem, 5vw, 1.5rem); }
/* thank-you message in the game's toast style: ink block, paper text */
.thanks { margin-top: 18px; padding: 18px 22px; background: var(--ink); color: var(--paper); }

.comments-title { margin-top: 36px; font-size: 1.3rem; }
.comments { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.comments li { padding: 14px 16px; background: var(--paper); }
.comments .meta { font-size: .9rem; color: var(--ink-50); }
.comments .meta strong { color: var(--ink); }
.comments .text { margin-top: 4px; color: var(--ink-72); white-space: pre-line; overflow-wrap: anywhere; }
.comments li.new { animation: appear .35s ease-out; }
@keyframes appear { from { opacity: 0; } to { opacity: 1; } }
.empty { margin-top: 10px; color: var(--ink-50); }

footer { max-width: 640px; margin: 0 auto; padding: 28px 22px 48px; font-size: .88rem; color: var(--ink-50); text-align: center; }
.noscript { margin-top: 10px; color: var(--alert); }

@media (min-width: 720px) {
  .panel { padding: 40px 44px; }
  .welcome { padding: 60px 4px 40px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
