/* tourdupain.com. Night palette, Alfa Slab One for headlines, Libre Franklin for everything else.
   Zone colours appear only in training charts. Pages are generated by tools/build.py. */

@font-face {
  font-family: 'Alfa Slab One';
  src: url('/fonts/alfa-slab-one-400.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Libre Franklin';
  src: url('/fonts/libre-franklin-var.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'Big Shoulders Display';
  src: url('/fonts/big-shoulders-800.woff2') format('woff2');
  font-weight: 800;
  font-display: swap;
}

:root {
  --night: #11141c;
  --night-2: #161a25;
  --dusk: #1d2233;
  --line: #2b3144;
  --text: #ece8ef;
  --soft: #cfccd6;
  --muted: #a3a8ba;
  --crust: #d9a04e;
  --crust-hi: #e7b263;
  --borne: #c4372b;
  --stone: #eee9e0;
  --error: #f08a7e;
  --r: 12px;
  --slab: 'Alfa Slab One', Rockwell, 'Roboto Slab', Georgia, serif;
  --sans: 'Libre Franklin', 'Helvetica Neue', Arial, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--night); color: var(--text); font: 400 16px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, ul, figure { margin: 0; }
h1, h2 { font-family: var(--slab); font-weight: 400; line-height: 1.05; text-wrap: balance; }
h3 { font-size: 1rem; font-weight: 700; line-height: 1.3; }
a { color: inherit; text-underline-offset: .2em; }
.num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--crust); outline-offset: 3px; border-radius: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--crust); color: var(--night); padding: 8px 12px; border-radius: 8px; z-index: 10; font-weight: 700; }
.skip:focus { top: 12px; }

.wrap { max-width: 1280px; margin: 0 auto; padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px)); }
@media (min-width: 700px) { .wrap { padding-inline: 28px; } }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; font: 700 1rem/1 var(--sans); color: var(--night); background: var(--crust); border: 0; border-radius: var(--r); padding: 14px 20px; min-height: 48px; cursor: pointer; text-decoration: none; white-space: nowrap; transition: transform .15s, background .15s; }
.btn:hover { background: var(--crust-hi); transform: translateY(-1px); }
.btn:disabled { opacity: .6; cursor: progress; transform: none; }
.btn.small { padding: 9px 14px; min-height: 38px; font-size: .9rem; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.ghost:hover { border-color: var(--crust); }

/* Header */
.top .wrap { display: flex; align-items: center; gap: 16px; padding-block: 14px; }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; font: 400 1.15rem var(--slab); margin-right: auto; }
.brand svg { width: 22px; height: 28px; }
.lang { color: var(--muted); font-size: .9rem; text-decoration: none; padding: 6px 4px; }
.lang:hover { color: var(--text); }
.lang .short { display: none; }

/* Hero */
.hero .wrap { display: grid; grid-template-columns: minmax(0, .82fr) minmax(0, 1.45fr); gap: 32px 44px; align-items: center; padding-block: 28px 8px; }
.badge { display: inline-block; background: rgba(217, 160, 78, .14); color: var(--crust); border: 1px solid rgba(217, 160, 78, .35); border-radius: 999px; padding: 5px 12px; font-size: .85rem; font-weight: 700; margin-bottom: 16px; }
.hero h1 { font-size: clamp(2rem, 3.5vw, 2.9rem); }
.hero h1 span { color: var(--crust); display: block; }
.sub { color: var(--soft); margin: 14px 0 22px; max-width: 40ch; }

/* Forms */
.signup { display: grid; gap: 10px; max-width: 460px; }
.fields { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.fields .email { grid-column: 1 / -1; }
.signup input, .signup select { width: 100%; font: inherit; color: var(--text); background: var(--night-2); border: 1px solid #3a4157; border-radius: var(--r); padding: 12px 14px; min-height: 48px; }
.signup select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.signup select:invalid, .signup select option[value=''] { color: var(--muted); }
.signup input::placeholder { color: #7d8398; }
.signup input:focus, .signup select:focus { border-color: var(--crust); outline: none; box-shadow: 0 0 0 3px rgba(217, 160, 78, .25); }
.signup .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.fine { font-size: .8rem; color: var(--muted); }
.msg { font-size: .92rem; font-weight: 600; color: var(--crust); }
.msg:empty { display: none; }
.msg.error { color: var(--error); }
.signup.done .fields, .signup.done .fine { display: none; }
.signup.done .msg { font-size: 1rem; padding: 12px 14px; border: 1px solid rgba(217, 160, 78, .4); border-radius: var(--r); background: rgba(217, 160, 78, .08); }
.ts:empty { display: none; }

/* App screen mock */
.screen { border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); background: var(--night-2); box-shadow: 0 30px 60px -30px #000; }
.screen .chrome { display: flex; align-items: center; gap: 7px; padding: 8px 12px; background: #1a1e2a; border-bottom: 1px solid var(--line); }
.screen .chrome i { width: 10px; height: 10px; border-radius: 50%; background: #3a3f52; }
.screen .url { display: inline-flex; align-items: center; gap: 6px; margin: 0 auto; background: var(--night); border-radius: 7px; padding: 3px 14px; font-size: .78rem; color: var(--soft); }
.screen .url svg { width: 9px; height: 11px; color: #6fbf8a; }
.screen figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 16px; font-size: .78rem; color: var(--muted); padding: 9px 12px; border-top: 1px solid var(--line); }
.web { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--soft); font-size: .82rem; font-weight: 600; }
.web li { display: inline-flex; align-items: center; gap: 6px; }
.web li::before { content: ''; width: 8px; height: 5px; border-left: 2px solid var(--crust); border-bottom: 2px solid var(--crust); transform: rotate(-45deg) translateY(-2px); }
.game { position: relative; aspect-ratio: 16 / 9; container-type: inline-size; }
.game > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.hud { position: absolute; inset: 0; padding: 2.2cqw 2.4cqw; display: grid; grid-template-rows: auto 1fr auto; font-size: max(9px, 1.45cqw); color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .5); }
.hud .row { display: flex; justify-content: space-between; align-items: start; gap: 2cqw; }
.hud .tile { background: rgba(13, 15, 22, .72); border-radius: 1cqw; padding: .9cqw 1.3cqw; }
.hud .wk b { display: block; font-size: 1.1em; letter-spacing: .02em; }
.hud .wk span, .hud .target span { color: #c7c9d4; }
.hud .target { text-align: center; }
.hud .target b { display: block; font-size: 2.4em; line-height: 1; font-weight: 800; }
.hud .bag { display: flex; align-items: center; gap: .8cqw; font-weight: 800; font-size: 1.45em; }
.hud .bag svg { width: 3.2cqw; }
.hud .bag small { font-size: .6em; font-weight: 500; color: #c7c9d4; margin-left: .6cqw; }
.hud .metrics { align-self: center; justify-self: start; display: grid; gap: .7cqw; }
.hud .metrics div { display: grid; }
.hud .metrics span { font-size: .75em; color: #c7c9d4; letter-spacing: .06em; text-transform: uppercase; }
.hud .metrics b { font-size: 1.7em; line-height: 1.05; font-weight: 800; }
.hud .metrics b small { font-size: .5em; font-weight: 500; margin-left: .3em; }
.hud .prof { display: grid; gap: .5cqw; }
.hud .prof svg { width: 100%; height: 5cqw; display: block; }
.hud .prof div { display: flex; justify-content: space-between; color: #c7c9d4; font-size: .85em; }

/* Sections */
.block { padding-block: 72px 0; }
.kicker { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .85rem; font-weight: 600; margin-bottom: 12px; }
.km { background: var(--borne); color: #fff; font: 800 .75rem/1 'Big Shoulders Display', 'Arial Narrow', sans-serif; letter-spacing: .05em; padding: 5px 7px 3px; border-radius: 8px 8px 2px 2px; }
section h2 { font-size: clamp(1.5rem, 2.8vw, 2.1rem); max-width: 22ch; }
.lede { max-width: 52ch; color: var(--soft); margin-top: 10px; }

.train { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 28px 48px; align-items: center; }
.feat { list-style: none; padding: 0; margin-top: 20px; display: grid; gap: 8px; }
.feat li { padding-left: 22px; position: relative; color: var(--soft); }
.feat li::before { content: ''; position: absolute; left: 0; top: .55em; width: 10px; height: 10px; border-radius: 2px; background: var(--crust); }
.chart { background: var(--night-2); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 16px 12px; display: grid; gap: 10px; }
.chart .head { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; font-size: .9rem; }
.chart .head span { color: var(--muted); font-size: .82rem; }
.chart svg { width: 100%; height: auto; display: block; font-family: var(--sans); }
.legend { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .78rem; color: var(--muted); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.z1 { background: #8a93a6; } .z2 { background: #3d8bd9; } .z3 { background: #45b06c; }
.z4 { background: #e8c13a; } .z5 { background: #ec8a2f; } .z6 { background: #d9483b; }

.play { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-top: 28px; }
.play li { display: grid; gap: 4px; align-content: start; }
.play figure { border-radius: var(--r); overflow: hidden; aspect-ratio: 5 / 3; border: 1px solid var(--line); margin-bottom: 6px; }
.play figure svg { width: 100%; height: 100%; display: block; }
.play p { color: var(--muted); font-size: .9rem; }
.quote { margin-top: 24px; display: flex; gap: 12px; align-items: center; color: var(--muted); font-size: .92rem; }
.quote b { color: var(--text); }
.face { flex: none; width: 34px; height: 34px; border-radius: 50%; background: #e6b896; position: relative; overflow: hidden; }
.face::before { content: ''; position: absolute; left: 3px; right: 3px; top: -3px; height: 11px; border-radius: 50%; background: #0b0d12; }
.face::after { content: ''; position: absolute; left: 9px; right: 9px; top: 21px; height: 4px; border-top: 2px solid #2b2118; border-radius: 50%; }

.price { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 24px; max-width: 760px; }
.card { border: 1px solid var(--line); border-radius: var(--r); padding: 20px; display: grid; gap: 8px; align-content: start; background: var(--night-2); }
.card.ours { border-color: var(--crust); background: linear-gradient(180deg, #221d18, var(--night-2)); }
.card .label { font-weight: 700; font-size: .9rem; }
.card .amount { font: 400 2rem/1.05 var(--slab); }
.card.ours .amount { color: var(--crust); }
.card p { color: var(--muted); font-size: .92rem; }
.compare { margin-top: 12px; color: var(--muted); font-size: .82rem; }

.join { margin-top: 72px; background: var(--dusk); border-top: 1px solid var(--line); }
.join .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px 48px; padding-block: 52px; align-items: center; }

footer.site { padding-block: 22px 36px; color: var(--muted); font-size: .82rem; }
footer.site .wrap { display: flex; flex-wrap: wrap; gap: 6px 24px; justify-content: space-between; }
footer.site a { color: var(--muted); }
footer.site a:hover { color: var(--text); }

/* Small pages */
.notice .wrap { display: flex; gap: 36px; align-items: center; padding-block: 72px; max-width: 760px; }
.notice h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: 14px; }
.notice p { color: var(--soft); margin-bottom: 12px; max-width: 48ch; }
.notice p:last-child { margin: 20px 0 0; }
.borne-big { flex: none; width: 96px; height: auto; }
.unsub { display: grid; gap: 12px; justify-items: start; margin-top: 8px; }
.legal .wrap { max-width: 720px; padding-block: 40px 56px; }
.legal h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); margin-bottom: 18px; }
.legal h2 { font-family: var(--sans); font-weight: 700; font-size: 1.05rem; margin: 26px 0 6px; }
.legal p { color: var(--soft); margin-bottom: 10px; }
.legal a { color: var(--crust); }
.legal .updated { color: var(--muted); font-size: .85rem; margin: -8px 0 20px; }

/* Motion: the scene keeps riding. Sections ease in where scroll-driven animation exists. */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes roll { to { transform: translateX(-120px); } }
@keyframes sway { 0%, 100% { transform: rotate(-1.2deg); } 50% { transform: rotate(1.2deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.game .wheel { animation: spin 1s linear infinite; transform-box: fill-box; transform-origin: center; }
.game .dashes { animation: roll .8s linear infinite; }
.sway { animation: sway 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 100%; }
.play .wheel, .play .dashes { animation: none; }
.hero .pitch > * { animation: rise .6s ease-out both; }
.hero .pitch > :nth-child(2) { animation-delay: .06s; }
.hero .pitch > :nth-child(3) { animation-delay: .12s; }
.hero .pitch > :nth-child(4) { animation-delay: .18s; }
@supports (animation-timeline: view()) {
  .block .wrap > *, .join .wrap > * { animation: rise linear both; animation-timeline: view(); animation-range: entry 0% entry 40%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* Layout below desktop */
@media (max-width: 900px) {
  .hero .wrap, .train, .join .wrap { grid-template-columns: minmax(0, 1fr); }
  .hero .wrap { gap: 28px; }
  .play { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .block { padding-top: 56px; }
  .join { margin-top: 56px; }
}
@media (max-width: 560px) {
  .lang .long { display: none; }
  .lang .short { display: inline; }
  .top .btn.small { display: none; }
  .fields { grid-template-columns: minmax(0, 1fr); }
  .fields .btn { width: 100%; }
  .play { gap: 14px; }
  .play p { font-size: .85rem; }
  .price { grid-template-columns: minmax(0, 1fr); }
  .hud { font-size: 8px; }
  .hud .wk span, .hud .metrics div:nth-child(n+3), .hud .prof div { display: none; }
  .notice .wrap { flex-direction: column; align-items: flex-start; gap: 20px; padding-block: 40px; }
  .borne-big { width: 64px; }
}
