/* TaxiCount — landing: vídeo del recorregut + parades */
:root {
  --negre: #1E1B16;
  --negre-2: #2A2620;
  --crema: #FEF7EC;
  --crema-70: rgba(254, 247, 236, 0.72);
  --crema-88: rgba(254, 247, 236, 0.88); /* text de paràgraf: el vídeo és de dia i el 72 % no arribava a 4,5:1 sobre el cel */
  --ambre: #FFC107;
  --ambre-20: rgba(255, 193, 7, 0.2);
  --display: "Bricolage Grotesque", "Trebuchet MS", sans-serif;
  --text: "Atkinson Hyperlegible", "Segoe UI", sans-serif;
  --mono: "Martian Mono", ui-monospace, monospace;
  --gutter: clamp(16px, 5vw, 64px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--negre); scroll-behavior: auto; }
body {
  margin: 0;
  font-family: var(--text);
  color: var(--crema);
  background: var(--negre);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
::selection { background: var(--ambre); color: var(--negre); }
:focus-visible { outline: 2px solid var(--ambre); outline-offset: 3px; }
a { color: inherit; }

/* Fons: vídeo real controlat per l'scroll (si no carrega, es veu el poster) */
#ride { position: fixed; inset: 0; z-index: 0; background: var(--negre); }
#ride video { width: 100%; height: 100%; object-fit: cover; display: block; filter: saturate(1.05) contrast(1.04); }
.ride-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(30,27,22,.66) 0%, rgba(30,27,22,.42) 35%, rgba(30,27,22,.46) 70%, rgba(30,27,22,.82) 100%); }

/* Capçalera */
.top {
  position: fixed; inset: 0 0 auto 0; z-index: 3;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px var(--gutter);
  pointer-events: none;
  /* Fons que difumina el que hi passa per sota (text de les parades) perquè la marca i els botons es llegeixin sempre. */
  background: linear-gradient(180deg, rgba(30,27,22,.82) 0%, rgba(30,27,22,.55) 70%, rgba(30,27,22,0) 100%);
  -webkit-backdrop-filter: blur(14px) saturate(1.1); backdrop-filter: blur(14px) saturate(1.1);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 72%, transparent 100%); mask-image: linear-gradient(180deg, #000 0%, #000 72%, transparent 100%);
  padding-bottom: 26px;
}
.top > * { pointer-events: auto; }
.brand img { height: 36px; width: auto; display: block; }
.top-right { display: flex; align-items: center; gap: 12px; }
.top .btn-enter { min-height: 36px; padding: 0 16px; border-radius: 999px; font: 700 .85rem/1 var(--text); color: var(--negre); background: var(--crema); } /* .top davant: si no, la regla .btn de sota (52 px) la trepitja */
.top .btn-enter:hover { background: #fff; transform: translateY(-1px); }
.lang { display: flex; gap: 2px; border: 1px solid var(--crema-70); border-radius: 999px; padding: 2px; }
.lang button {
  font: 700 13px/1 var(--text); letter-spacing: 0.04em;
  color: var(--crema); background: transparent; border: 0; border-radius: 999px;
  padding: 8px 12px; cursor: pointer;
}
.lang button[aria-pressed="true"] { background: var(--crema); color: var(--negre); }

/* Línia de recorregut */
.route { position: fixed; z-index: 3; left: var(--gutter); top: 50%; transform: translateY(-50%); }
.route ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; position: relative; z-index: 1; }
.route a {
  display: grid; grid-template-columns: 10px auto; align-items: center; gap: 12px;
  text-decoration: none; font: 700 13px/1 var(--text); color: var(--crema-70);
}
.route a::before { content: ""; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--crema-70); background: var(--negre); transition: background .3s, border-color .3s; }
.route a span { opacity: 0; transform: translateX(-6px); transition: opacity .3s, transform .3s; }
.route a:hover span, .route a:focus-visible span { opacity: 1; transform: none; }
/* A escriptori ample l'etiqueta de la parada activa és visible; les seccions deixen espai a l'esquerra perquè no toqui el text. */
.route a span { background: rgba(30,27,22,.75); padding: 4px 8px; border-radius: 6px; white-space: nowrap; }
@media (min-width: 1200px) { .route li.is-active a span { opacity: 1; transform: none; } main .stop { padding-left: calc(var(--gutter) + 170px); } }
.route li.is-active a { color: var(--ambre); }
.route li.is-active a::before, .route li.is-done a::before { border-color: var(--ambre); background: var(--ambre); }
.route-line { position: absolute; left: 4px; top: 5px; bottom: 5px; width: 2px; background: rgba(254,247,236,.18); }
.route-fill { width: 100%; height: 0%; background: var(--ambre); }

/* Seccions */
main { position: relative; z-index: 1; }
.stop { min-height: 100vh; min-height: 100svh; display: grid; align-items: center; padding: 20vh var(--gutter) 20vh calc(var(--gutter) + 64px); }
.stop .copy { max-width: 36rem; }
.stop:nth-child(even) .copy { margin-left: auto; }
.stop.end .copy { margin-inline: auto; text-align: center; }

h1, h2 {
  font-family: var(--display); font-weight: 800; letter-spacing: -0.03em; line-height: 0.98;
  margin: 0 0 0.6em; text-wrap: balance;
  font-variation-settings: "opsz" 96;
}
h1 { font-size: clamp(2.6rem, 8vw, 6rem); }
h2 { font-size: clamp(2rem, 5.2vw, 4.2rem); }
.lead { font-size: clamp(1.1rem, 2vw, 1.4rem); max-width: 30rem; margin: 0 0 1.6em; color: var(--crema); text-wrap: pretty; }
.stop p { font-size: clamp(1.05rem, 1.6vw, 1.25rem); max-width: 34rem; color: var(--crema-88); margin: 0; text-wrap: pretty; }

.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 1.4em; }
.end .cta { justify-content: center; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 52px;
  padding: 0 22px; border-radius: 12px; text-decoration: none;
  font: 700 1rem/1 var(--text); letter-spacing: 0.01em;
  transition: transform .18s cubic-bezier(.2,.8,.2,1), box-shadow .18s, background .18s;
}
.btn-primary { background: var(--ambre); color: var(--negre); box-shadow: 0 10px 22px -12px rgba(0,0,0,.7); }
.btn-primary:hover { transform: translateY(-2px); background: #ffcb2e; box-shadow: 0 14px 26px -12px rgba(0,0,0,.75); }
.btn-ghost { color: var(--crema); border: 1.5px solid var(--crema-70); background: rgba(30,27,22,.35); }
.btn-ghost:hover { border-color: var(--crema); transform: translateY(-2px); }

.scroll-hint {
  position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%);
  display: grid; justify-items: center; gap: 10px; text-decoration: none;
  font: 700 14px/1 var(--text); color: var(--crema-88); white-space: nowrap;
}
.scroll-hint i { width: 1px; height: 44px; background: linear-gradient(var(--ambre), transparent); animation: hint 1.8s ease-in-out infinite; }
@keyframes hint { 0% { transform: scaleY(0); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }
.hero { position: relative; }

footer { margin-top: 2.5rem; display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; font-size: .9rem; color: var(--crema-88); }
footer a { text-underline-offset: 3px; }

/* Estat de la secció (l'omple main.js). Només amb html.js: sense JS o si main.js no arrenca, tot visible. */
.js .copy > * { opacity: 0; transform: translateY(18px); transition: opacity .7s cubic-bezier(.2,.8,.2,1), transform .7s cubic-bezier(.2,.8,.2,1); }
.stop.is-in .copy > * { opacity: 1; transform: none; }
.stop.is-in .copy > *:nth-child(2) { transition-delay: .08s; }
.stop.is-in .copy > *:nth-child(3) { transition-delay: .16s; }

/* Mòbil */
@media (max-width: 760px) {
  .route { display: none; }
  .stop { padding: 18vh var(--gutter) 16vh; }
  .stop:nth-child(even) .copy { margin-left: 0; }
  .brand img { height: 30px; }
  .btn { width: 100%; }
  .top .btn-enter { width: auto; min-height: 34px; padding: 0 12px; }
  .top-right { gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-hint i { animation: none; }
  .js .copy > * { transition: none; opacity: 1; transform: none; }
  .btn { transition: none; }
}

/* ---------- Contingut de les parades ---------- */
.stop.with-phone, .stop.with-report, .stop.with-meter { display: grid; grid-template-columns: minmax(0, 34rem) auto; align-items: center; justify-content: center; gap: clamp(32px, 6vw, 110px); } /* centrat amb un espai fix: amb space-between el mòbil quedava a l'altra punta del text a pantalles amples */
.stop:nth-child(even).with-phone { grid-template-columns: auto minmax(0, 36rem); }
.stop:nth-child(even).with-phone .copy { order: 2; margin-left: 0; }
.stop:nth-child(even).with-phone .phone { order: 1; }

/* Mòbil amb captura real */
.phone { margin: 0; width: min(clamp(240px, 27vw, 380px), 33vh); /* 33vh: amb la proporció 639/1420 fa ~73vh d'alt, cap dins la finestra a escriptori */ aspect-ratio: 639 / 1420; border-radius: 30px; padding: 7px; background: #0b0a09; box-shadow: 0 30px 80px -30px rgba(0,0,0,.9), 0 0 0 1px rgba(254,247,236,.12), inset 0 0 0 1px rgba(254,247,236,.06); position: relative; backface-visibility: hidden; }
.js .phone { transform: translateY(24px); opacity: 0; transition: transform 1s cubic-bezier(.2,.8,.2,1), opacity .8s; }
.phone img { width: 100%; height: 100%; object-fit: cover; border-radius: 24px; display: block; image-rendering: -webkit-optimize-contrast; }
.js .stop.is-in .phone { opacity: 1; transform: none; } /* sense inclinació: la captura es veu nítida (res de resampleig) */

/* La frase dita i com queda apuntada (estàtic: res d'escriptura simulada) */
.said { margin: 1.8em 0 0; max-width: 34rem; }
.said blockquote { margin: 0; font: 700 clamp(1.4rem, 2.4vw, 1.9rem)/1.15 var(--display); letter-spacing: -0.015em; color: var(--crema); text-wrap: balance; }
.ticket { display: flex; align-items: baseline; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed rgba(254,247,236,.3); font: 500 14px/1.3 var(--mono); color: var(--crema-88); }
.ticket span:first-child { flex: 1; display: flex; gap: 10px; align-items: baseline; }
.ticket span:first-child::after { content: ""; flex: 1; border-bottom: 1px dotted rgba(254,247,236,.35); transform: translateY(-4px); }
.ticket b { color: var(--ambre); font-weight: 700; font-variant-numeric: tabular-nums; }

/* Llista de fets (flota) */
.facts { list-style: none; margin: 1.6em 0 0; padding: 0; display: grid; max-width: 34rem; border-bottom: 1px solid rgba(254,247,236,.18); }
.facts li { padding: 11px 0; border-top: 1px solid rgba(254,247,236,.18); color: var(--crema); font-size: clamp(1rem, 1.4vw, 1.1rem); text-wrap: pretty; }

/* Informe: retall d'un PDF real (generat amb buildPdf i dades de prova; script a assets/shots/src/gen-informe.mjs) */
.stop.with-report { grid-template-columns: minmax(0, 26rem) auto; }
.paper { margin: 0; width: clamp(320px, 52vw, 720px); }
.paper img { display: block; width: 100%; height: auto; border-radius: 4px; background: #fff; box-shadow: 0 24px 50px -24px rgba(0,0,0,.85), 0 2px 6px rgba(0,0,0,.25);
  -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
.paper figcaption { margin-top: 10px; font-size: .9rem; color: var(--crema-88); }
.js .paper { transform: translateY(24px); opacity: 0; transition: transform 1s cubic-bezier(.2,.8,.2,1), opacity .8s; }
.js .stop.is-in .paper { opacity: 1; transform: none; }

/* Fundador: just després de la portada, text gran i a l'esquerra */
.stop.founder .copy { max-width: 44rem; margin-left: 0; }
.stop.founder p { font-size: clamp(1.2rem, 2.1vw, 1.55rem); line-height: 1.45; max-width: 40rem; color: var(--crema); }

/* Taxímetre */
.meter { width: clamp(240px, 26vw, 340px); border-radius: 18px; padding: 16px 18px 14px; background: #0b0a09; color: var(--crema); box-shadow: 0 30px 80px -30px rgba(0,0,0,.95), 0 0 0 1px rgba(254,247,236,.12); font-family: var(--mono); }
.js .meter { transform: translateY(24px); opacity: 0; transition: transform 1s cubic-bezier(.2,.8,.2,1), opacity .8s; }
.js .stop.is-in .meter { opacity: 1; transform: none; }
.meter-top { display: flex; justify-content: space-between; align-items: center; font: 500 11px/1 var(--mono); letter-spacing: .16em; color: var(--crema-70); }
.meter-led { width: 8px; height: 8px; border-radius: 50%; background: var(--ambre); box-shadow: 0 0 10px var(--ambre); animation: led 1.2s steps(2) infinite; }
@keyframes led { 50% { opacity: .25; } }
.meter-digits { display: flex; align-items: baseline; justify-content: flex-end; gap: 8px; margin: 14px 0 2px; padding: 10px 12px; border-radius: 10px; background: #15130f; box-shadow: inset 0 0 0 1px rgba(255,193,7,.18); }
.meter-amount { font: 700 clamp(2.6rem, 4.6vw, 3.6rem)/1 var(--mono); color: var(--ambre); letter-spacing: .02em; text-shadow: 0 0 18px rgba(255,193,7,.45); font-variant-numeric: tabular-nums; }
.meter-unit { font: 700 1.4rem/1 var(--mono); color: var(--ambre); }
.meter-sub { text-align: right; font: 500 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--crema-70); margin-bottom: 14px; }
.meter-rows { display: grid; gap: 8px; border-top: 1px dashed rgba(254,247,236,.18); padding-top: 12px; }
.meter-rows > div { display: flex; justify-content: space-between; font: 500 13px/1.2 var(--mono); color: var(--crema-70); }
.meter-rows strong { color: var(--crema); font-weight: 700; }
.meter-rows .promo { color: var(--ambre); } .meter-rows .promo strong { color: var(--ambre); }
.meter-rows .promo { align-items: center; gap: 10px; } .meter-rows .promo strong { white-space: nowrap; }
.meter-rows .promo code { font: 700 12px/1 var(--mono); letter-spacing: .08em; padding: 3px 6px; border-radius: 6px; background: rgba(255,193,7,.14); color: var(--ambre); }
.meter-drop { font-size: 1.25em; text-shadow: 0 0 14px rgba(255,193,7,.45); font-variant-numeric: tabular-nums; }

.end .copy > p { margin-inline: auto; margin-bottom: 1.2em; }

@media (max-width: 760px) {
  .stop.with-phone, .stop.with-report, .stop.with-meter, .stop:nth-child(even).with-phone { grid-template-columns: 1fr; justify-items: start; gap: 28px; }
  .stop:nth-child(even).with-phone .copy { order: 1; } .stop:nth-child(even).with-phone .phone { order: 2; }
  .phone { width: min(78vw, 320px); margin-inline: auto; } .js .phone { transform: translateY(16px); } .js .stop.is-in .phone { transform: none; }
  .stop.with-phone, .stop:nth-child(even).with-phone { justify-items: stretch; }
  .meter { width: min(100%, 340px); }
  .paper { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .js .phone, .js .paper, .js .meter { transition: none; opacity: 1; transform: none; }
  .meter-led { animation: none !important; }
}
