:root {
  --concreto: #E9EAE6;
  --concreto-2: #DDDFDA;
  --asfalto: #24282C;
  --grafite: #5E646A;
  --faixa: #F1C232;
  --sinal: #1D5AA6;
  --verde: #2E7D4F;
  --linha: #C9CCC6;
  --fundo-torre: #FFFFFF;
  --banda: #24282C;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --concreto: #24282C; --concreto-2: #2D3237; --asfalto: #ECEDEA; --grafite: #A3A9AE;
    --sinal: #7FB0EE; --verde: #6CC28F; --linha: #3B4147; --fundo-torre: #1B1E21; --banda: #141719; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --concreto: #24282C; --concreto-2: #2D3237; --asfalto: #ECEDEA; --grafite: #A3A9AE;
  --sinal: #7FB0EE; --verde: #6CC28F; --linha: #3B4147; --fundo-torre: #1B1E21; --banda: #141719; color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
body {
  margin: 0; background: var(--concreto); color: var(--asfalto);
  font-family: "Archivo", system-ui, sans-serif; font-variation-settings: "wdth" 100;
  font-size: 1.0625rem; line-height: 1.55; -webkit-font-smoothing: antialiased;
}
a { color: var(--sinal); }
:focus-visible { outline: 3px solid var(--sinal); outline-offset: 2px; }
h1, h2, h3, .marca, .torre, .passos strong, th { font-stretch: 70%; font-variation-settings: "wdth" 70; }
h1 { font-size: clamp(2.6rem, 6.4vw, 5rem); line-height: .95; font-weight: 750; margin: 0 0 1.2rem; letter-spacing: -.01em; max-width: 12ch; }
h2 { font-size: clamp(2rem, 4vw, 3rem); line-height: 1; font-weight: 700; margin: 0 0 1rem; max-width: 18ch; }
h3 { font-size: 1.45rem; line-height: 1.1; font-weight: 650; margin: 0 0 .5rem; }
p { margin: 0 0 1rem; max-width: 62ch; }
.lead { font-size: 1.2rem; color: var(--asfalto); }
.lead.curta { max-width: 56ch; }
.nota { font-size: .92rem; color: var(--grafite); }

.topo {
  display: flex; align-items: center; gap: 1.5rem; padding: 1rem clamp(1rem, 4vw, 3rem);
  border-bottom: 1px solid var(--linha);
}
.marca { font-size: 1.6rem; font-weight: 800; color: var(--asfalto); text-decoration: none; }
.topo nav { display: flex; gap: 1.25rem; margin-left: auto; flex-wrap: wrap; }
.topo nav a { color: var(--asfalto); text-decoration: none; font-size: .95rem; }
.topo nav a:hover { text-decoration: underline; }
.idioma { font: inherit; font-weight: 650; background: none; border: 1px solid var(--asfalto); color: var(--asfalto); padding: .25rem .6rem; border-radius: 4px; cursor: pointer; }

main > section { padding: clamp(3rem, 8vw, 6rem) clamp(1rem, 4vw, 3rem); }
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 26rem); gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.controle { margin-top: 2rem; max-width: 30rem; }
.controle label { font-weight: 600; display: block; margin-bottom: .4rem; font-variant-numeric: tabular-nums; }
.controle .de { font-weight: 400; color: var(--grafite); }
input[type="range"] { width: 100%; accent-color: var(--asfalto); }
.dica { font-size: .92rem; color: var(--grafite); margin-top: .5rem; }
.leitura { margin-top: 1.5rem; min-height: 7rem; max-width: 30rem; }
.leitura .grande { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 700; font-stretch: 75%; font-variation-settings: "wdth" 75; line-height: 1.1; margin: 0 0 .4rem; }
.leitura .real-ok { color: var(--verde); font-weight: 650; }
.leitura .real-erro { color: var(--asfalto); font-weight: 650; }

/* torre de cronometragem */
.torre-wrap { margin: 0; }
.torre-wrap figcaption { font-size: .85rem; color: var(--grafite); margin-bottom: .5rem; }
.torre { list-style: none; margin: 0; padding: .35rem 0; background: var(--fundo-torre); border-radius: 6px; border: 1px solid var(--linha); font-variant-numeric: tabular-nums; }
.torre li { position: relative; }
.torre button {
  display: grid; grid-template-columns: 2.2rem 1fr 4.6rem 3.2rem; align-items: center; width: 100%;
  font: inherit; font-stretch: 70%; font-variation-settings: "wdth" 70; font-size: 1.05rem;
  background: none; border: 0; color: var(--asfalto); padding: .18rem .8rem; text-align: left; cursor: pointer;
}
.torre button:hover { background: var(--concreto-2); }
.torre .pos { font-weight: 700; color: var(--grafite); }
.torre .piloto { font-weight: 650; letter-spacing: .02em; }
.torre .gap { text-align: right; color: var(--grafite); }
.torre .pneu { text-align: right; font-size: .9rem; color: var(--grafite); }
.torre li.sel button { background: var(--asfalto); color: var(--concreto); }
.torre li.sel .pos, .torre li.sel .gap, .torre li.sel .pneu { color: var(--concreto); }
.torre li.alvo::before {
  content: ""; position: absolute; left: 0; right: 0; top: -2px; height: 4px; background: var(--faixa);
}
.torre li.alvo .fantasma {
  position: absolute; left: 5.4rem; top: -.72rem; z-index: 1; background: var(--faixa); color: #24282C;
  font-size: .78rem; font-weight: 700; padding: .05rem .4rem; border-radius: 3px;
  font-stretch: 75%; font-variation-settings: "wdth" 75;
}
.torre .sc { padding: .3rem .8rem; font-weight: 700; background: var(--faixa); color: #24282C; font-stretch: 75%; font-variation-settings: "wdth" 75; }

.faixa { border-top: 1px solid var(--linha); }
.faixa.escura { background: var(--banda); color: #ECEDEA; }
.faixa.escura .lead { color: #ECEDEA; }
.faixa.escura a { color: #7FB0EE; }
.dois { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(2rem, 5vw, 4rem); margin-top: 2rem; }
.tres { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1.5rem, 4vw, 3rem); margin-top: 2rem; }

.posts { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem; margin: 2.5rem 0 1rem; }
.post { background: var(--fundo-torre); border-left: 4px solid var(--faixa); padding: 1rem 1.1rem; border-radius: 0 4px 4px 0; }
.post p { margin: 0; font-size: 1rem; }
.post .tipo { font-size: .82rem; color: var(--grafite); margin-bottom: .35rem; }

.passos { list-style: none; counter-reset: p; padding: 0; margin: 2.5rem 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; }
.passos li { counter-increment: p; display: grid; gap: .3rem; border-top: 4px solid var(--faixa); padding-top: .8rem; }
.passos li strong::before { content: counter(p) ". "; }
.passos strong { font-size: 1.6rem; font-weight: 700; }
.passos span { color: #C9CDD1; max-width: 32ch; }
.hash { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; margin-bottom: 2rem; }
.hash span { color: #C9CDD1; }
.hash code { font-size: .95rem; background: rgba(255,255,255,.08); padding: .3rem .55rem; border-radius: 4px; word-break: break-all; }
.hash button { font: inherit; font-size: .9rem; background: var(--faixa); color: #24282C; border: 0; padding: .3rem .8rem; border-radius: 4px; cursor: pointer; font-weight: 650; }
.corridas { border-collapse: collapse; width: 100%; max-width: 40rem; font-variant-numeric: tabular-nums; }
.corridas th, .corridas td { text-align: left; padding: .55rem .8rem .55rem 0; border-bottom: 1px solid rgba(255,255,255,.15); }
.corridas th { font-weight: 600; color: #C9CDD1; font-size: 1rem; }
.corridas td:first-child { font-weight: 650; }

.metricas { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; margin-bottom: 1rem; }
.metricas th, .metricas td { padding: .5rem .6rem .5rem 0; border-bottom: 1px solid var(--linha); text-align: right; }
.metricas th:first-child, .metricas td:first-child { text-align: left; }
.metricas th { font-weight: 600; color: var(--grafite); font-size: .95rem; }
.metricas td.forte { font-weight: 700; }
#calibracao { width: 100%; max-width: 22rem; height: auto; display: block; margin: .5rem 0 1rem; }
#calibracao text { font-family: "Archivo", sans-serif; font-size: 11px; fill: var(--grafite); }

.rodape { padding: 2rem clamp(1rem, 4vw, 3rem) 3rem; border-top: 1px solid var(--linha); font-size: .9rem; color: var(--grafite); }
.rodape .fonte { font-size: .82rem; }

@media (max-width: 860px) {
  .hero, .dois, .tres, .passos { grid-template-columns: minmax(0, 1fr); }
  .topo nav { display: none; }
  .torre-wrap { max-width: 30rem; }
}
