/* ===========================================================================
   Layer 8 Times / shared design system
   O Caderno de Bancada: papel quadriculado, tinta carbono, fita laranja,
   carimbo violeta. Uma família (Archivo variável), estado como marca física.
   Token API preservada: as páginas internas leem os mesmos nomes de var.
   =========================================================================== */

/* Archivo variável, self-hosted: a única família do sistema */
@font-face {
  font-family: "Archivo";
  src: url("fonts/archivo-var-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Archivo";
  src: url("fonts/archivo-var-latin-ext.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --ground: #f7f6f1;
  --raised: #efeee7;
  --raised-2: #e6e4da;
  --fg: #1a1c1e;
  --fg-2: rgba(26, 28, 30, 0.76);
  --fg-3: rgba(26, 28, 30, 0.62);

  /* a voz da casa: laranja de fita. --green é o laranja legível em texto,
     --tape é o laranja de superfície (fita, grifo, marca). */
  --green: #a84005;
  --green-dim: rgba(232, 89, 12, 0.13);
  --tape: #e8590c;
  --tape-deep: #c94a06;
  --hl: rgba(232, 89, 12, 0.26);

  /* o carimbo: violeta. --blue mantém o nome pela API. */
  --blue: #5f3dc4;
  --blue-dim: rgba(95, 61, 196, 0.09);

  --amber: #9a6100;
  --red: #c92a1a;

  --grid: rgba(59, 77, 95, 0.085);
  --rule: rgba(26, 28, 30, 0.22);
  --rule-soft: rgba(26, 28, 30, 0.1);
  --rule-strong: rgba(26, 28, 30, 0.82);

  --serif: "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --sans: "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --page: 1080px;
  --measure: 34rem;
  --gut: 24px;
  --r: 2px;

  color-scheme: light;
}

:root[data-theme="dark"] {
  --ground: #14161a;
  --raised: #1c1f25;
  --raised-2: #262a32;
  --fg: #eef0f3;
  --fg-2: rgba(238, 240, 243, 0.75);
  --fg-3: rgba(238, 240, 243, 0.58);

  --green: #ff8a45;
  --green-dim: rgba(240, 98, 26, 0.16);
  --tape: #f0621a;
  --tape-deep: #ff7a33;
  --hl: rgba(240, 98, 26, 0.32);

  --blue: #a897ff;
  --blue-dim: rgba(168, 151, 255, 0.12);

  --amber: #f0b354;
  --red: #ff6f60;

  --grid: rgba(158, 180, 205, 0.06);
  --rule: rgba(238, 240, 243, 0.2);
  --rule-soft: rgba(238, 240, 243, 0.08);
  --rule-strong: rgba(238, 240, 243, 0.75);

  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

/* o papel quadriculado é o chão de tudo */
body {
  margin: 0;
  background-color: var(--ground);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 420;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  accent-color: var(--tape);
  caret-color: var(--tape);
}

::selection {
  background: var(--tape);
  color: #16181a;
}

/* as superfícies do navegador também são do caderno */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--rule) transparent;
}

/* --- typography ----------------------------------------------------------- */

h1,
h2,
h3,
h4 {
  font-family: var(--sans);
  font-weight: 800;
  font-stretch: 115%;
  font-style: normal;
  letter-spacing: -0.015em;
  line-height: 1.04;
  margin: 0;
  text-wrap: balance;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: none;
}

p {
  margin: 0;
}

/* o registro de instrumentação: caps, denso, tabular */
.inst,
.kicker,
.label,
.btn {
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-weight: 700;
  font-stretch: 96%;
  font-variant-numeric: tabular-nums;
  font-size: 0.7rem;
  line-height: 1.25;
}

.num {
  font-variant-numeric: tabular-nums;
  font-stretch: 108%;
  letter-spacing: -0.02em;
  font-weight: 800;
}

.deck-text {
  font-weight: 400;
  color: var(--fg-2);
  text-wrap: pretty;
}

.wrap {
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 var(--gut);
}

/* --- o wordmark: caps expandidas, o 8 carimbado em violeta ---------------- */

.wordmark {
  font-family: var(--sans);
  font-style: normal;
  font-weight: 900;
  font-stretch: 122%;
  text-transform: uppercase;
  letter-spacing: 0.015em;
  line-height: 0.96;
  white-space: nowrap;
  margin: 0;
}

.wordmark em {
  font-style: normal;
  color: var(--blue);
}

/* --- o wire: a régua de itens no topo, fita na etiqueta ------------------- */

.wire {
  display: flex;
  align-items: stretch;
  border-bottom: 1.5px solid var(--rule-strong);
  background: var(--ground);
  overflow: hidden;
  position: sticky;
  top: 0;
  z-index: 60;
}

.wire-tag {
  display: flex;
  align-items: center;
  padding: 0 14px;
  background: var(--tape);
  color: #16181a;
  letter-spacing: 0.16em;
  font-weight: 800;
  flex: none;
  z-index: 2;
  font-family: var(--sans);
  text-transform: uppercase;
  font-size: 0.7rem;
}

.wire-track {
  flex: 1;
  display: flex;
  min-width: 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 2%, #000 97%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 2%, #000 97%, transparent);
}

.wire-run {
  display: flex;
  align-items: center;
  flex: none;
  animation: wire 150s linear infinite;
}

.wire:hover .wire-run {
  animation-play-state: paused;
}

@keyframes wire {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}

.wire-item {
  display: flex;
  align-items: baseline;
  gap: 9px;
  padding: 9px 22px;
  white-space: nowrap;
  border-right: 1px solid var(--rule-soft);
}

.wire-item .t,
.wire-item .s {
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 750;
  font-stretch: 96%;
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
}

.wire-item .t { color: var(--fg-3); }
.wire-item .s { color: var(--green); }
.wire-item .x { font-size: 0.82rem; color: var(--fg-2); font-weight: 420; }
.wire-item:hover .x { color: var(--fg); }

/* --- masthead: a etiqueta de amostra -------------------------------------- */

.masthead {
  text-align: center;
  padding: 26px var(--gut) 16px;
}

.masthead .etq {
  display: inline-block;
  position: relative;
  border: 2px solid var(--fg);
  background: var(--ground);
  padding: 18px 30px 14px;
  box-shadow: 0 2px 8px rgba(20, 22, 26, 0.07);
  max-width: 100%;
}

.masthead .etq .wordmark,
.masthead .etq .slogan {
  display: block;
}

/* a fita que prende a etiqueta na folha */
.masthead .etq::before {
  content: "";
  position: absolute;
  top: -9px;
  left: 50%;
  width: 92px;
  height: 18px;
  transform: translateX(-50%) rotate(-1.6deg);
  background: color-mix(in srgb, var(--tape) 82%, transparent);
  opacity: 0.85;
}

.masthead .wordmark {
  font-size: clamp(1.7rem, 4vw, 2.5rem);
}

.masthead .slogan,
.foot .slogan {
  margin-top: 7px;
  color: var(--fg-3);
  letter-spacing: 0.28em;
  font-size: 0.7rem;
  font-family: var(--sans);
  text-transform: uppercase;
  font-weight: 700;
}

/* o carimbo: número de edição, BLINDSPOT, marcas de registro */
.stamp {
  display: inline-block;
  border: 2px solid var(--blue);
  color: var(--blue);
  padding: 3px 8px;
  transform: rotate(-2deg);
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 800;
  font-stretch: 100%;
  font-variant-numeric: tabular-nums;
  font-size: 0.7rem;
  line-height: 1.3;
  border-radius: 2px;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='40'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.72' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .62 .38'/%3E%3C/filter%3E%3Crect width='120' height='40' fill='%23fff' filter='url(%23n)'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='40'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.72' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .62 .38'/%3E%3C/filter%3E%3Crect width='120' height='40' fill='%23fff' filter='url(%23n)'/%3E%3C/svg%3E");
  -webkit-mask-size: 120px 40px;
  mask-size: 120px 40px;
}

.masthead .etq .stamp {
  position: absolute;
  right: -16px;
  top: -12px;
  background: var(--ground);
}

.mh-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: var(--page);
  margin: 0 auto;
  padding: 8px var(--gut);
  border-top: 1px solid var(--rule);
}

.mh-meta span { color: var(--fg-3); white-space: nowrap; }
.mh-meta b { color: var(--fg); font-weight: 800; }

/* seções: abas de fichário */
.sections {
  display: flex;
  gap: 2px;
  padding: 0 var(--gut);
  border-top: 1px solid var(--rule);
  border-bottom: 1.5px solid var(--rule-strong);
  overflow-x: auto;
  scrollbar-width: none;
}

.sections a:first-child { margin-left: auto; }
.sections a:last-child { margin-right: auto; }

.sections::-webkit-scrollbar { display: none; }

.sections a {
  padding: 11px 14px 9px;
  color: var(--fg-2);
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 750;
  font-stretch: 96%;
  font-size: 0.7rem;
}

.sections a:hover,
.sections a.on { color: var(--fg); border-bottom-color: var(--tape); }
.sections a.soon { color: var(--fg-3); cursor: default; }
.sections a.soon:hover { color: var(--fg-3); border-bottom-color: transparent; }

/* --- a etiqueta da matéria (o que era kicker) ----------------------------- */

.kicker {
  color: var(--green);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--rule);
  background: var(--ground);
  padding: 4px 9px;
  border-radius: var(--r);
}

.kicker .sec { color: var(--fg-3); }

.kicker.is-blindspot {
  color: var(--blue);
  border: 2px solid var(--blue);
  transform: rotate(-1.4deg);
  font-weight: 800;
}

/* a linha de metadados: texto plano com separadores */
.meta-line {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--fg-3);
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  font-stretch: 96%;
  font-variant-numeric: tabular-nums;
  font-size: 0.7rem;
}

.meta-line b { color: var(--fg); font-weight: 800; }
.meta-line .sep { color: var(--rule-strong); }
.meta-line .warn { color: var(--amber); }

/* a banda de confiança: incerteza visível como células preenchidas */
.conf-band {
  display: inline-flex;
  gap: 2px;
  vertical-align: -1px;
}

.conf-band i {
  width: 9px;
  height: 9px;
  border: 1px solid var(--rule-strong);
  background: transparent;
  display: block;
}

.conf-band i.on { background: var(--tape); border-color: var(--tape-deep); }
.conf-band.is-weak i.on { background: var(--amber); border-color: var(--amber); }

.meta-line a.conf-a {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: inherit;
}
.meta-line a.conf-a:hover,
.meta-line a.conf-a:hover b { color: var(--green); }

.band-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  border-bottom: 1.5px solid var(--rule-strong);
  padding-bottom: 8px;
  margin-bottom: 22px;
}

.band-head .label {
  color: var(--fg);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  font-weight: 800;
}

.band-head .sub {
  color: var(--fg-3);
  letter-spacing: 0.04em;
  font-weight: 450;
  text-transform: none;
  font-size: 0.78rem;
}

.band-head .grow { flex: 1; }

.tag {
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-weight: 750;
  font-stretch: 96%;
  font-size: 0.7rem;
  color: var(--fg-3);
}

.tag.hi { color: var(--green); }
.tag.warn { color: var(--amber); }
a.tag:hover { color: var(--green); }

/* --- invenção 1: a linha Layer 8, grifada de marca-texto ------------------- */

.l8line {
  margin: 24px 0;
  padding-right: 8px;
}

.l8line .label {
  color: var(--green);
  display: block;
  margin-bottom: 7px;
}

.l8line p {
  display: inline;
  font-family: var(--sans);
  font-weight: 800;
  font-stretch: 110%;
  font-size: 1.32rem;
  line-height: 1.5;
  letter-spacing: -0.012em;
  background: linear-gradient(100deg, transparent 0.5%, var(--hl) 3.5%, var(--hl) 96.5%, transparent 99.5%);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  padding: 0.08em 0.32em;
  margin-left: -0.32em;
}

.l8line.sm p { font-size: 1.06rem; }

/* --- invenção 2: stack depth como régua de instrumento --------------------- */

.stack {
  display: inline-flex;
  align-items: flex-end;
  gap: 5px;
  height: 14px;
  padding-bottom: 0;
  border-bottom: 1.5px solid var(--rule-strong);
  cursor: help;
  vertical-align: -2px;
}

.stack i {
  width: 1.5px;
  height: 5px;
  background: var(--rule);
  display: block;
}

.stack i.on { background: var(--fg); height: 9px; }
.stack i.human { background: var(--tape); width: 3px; height: 13px; }

/* --- fotografia: presa na folha com fita ---------------------------------- */

.ph {
  margin: 0;
  position: relative;
}

.ph .frame {
  position: relative;
  overflow: hidden;
  background: var(--raised-2);
  border: 1px solid var(--rule-strong);
  aspect-ratio: 16 / 9;
  box-shadow: 0 2px 8px rgba(20, 22, 26, 0.09);
}

.ph::before,
.ph::after {
  content: "";
  position: absolute;
  top: -8px;
  width: 54px;
  height: 17px;
  background: color-mix(in srgb, var(--tape) 78%, transparent);
  opacity: 0.82;
  z-index: 2;
  pointer-events: none;
}

.ph::before { left: 9%; transform: rotate(-3.5deg); }
.ph::after { right: 9%; transform: rotate(2.5deg); }

.ph img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ph figcaption {
  color: var(--fg-2);
  padding-top: 8px;
  font-size: 0.74rem;
  line-height: 1.5;
  font-weight: 420;
}

.ph figcaption .credit {
  display: block;
  margin-top: 3px;
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  font-stretch: 96%;
  font-size: 0.7rem;
  color: var(--fg-3);
  opacity: 0.85;
}

/* placas geradas: continuam o fallback, dentro do mesmo frame */
.plate {
  position: relative;
  overflow: hidden;
  background: linear-gradient(155deg, var(--raised-2), var(--raised) 74%);
  aspect-ratio: 16 / 9;
}

.plate svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* --- botões: retangulares, tinta e fita, sem pílula ------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1.5px solid var(--rule-strong);
  background: var(--ground);
  color: var(--fg);
  padding: 10px 16px;
  border-radius: var(--r);
  cursor: pointer;
  transition: background 0.13s, border-color 0.13s, color 0.13s, transform 0.08s;
}

.btn:hover {
  background: var(--raised);
  border-color: var(--fg);
  color: var(--fg);
}

.btn:active { transform: translateY(1px); }

.btn.primary {
  background: var(--tape);
  border-color: var(--tape-deep);
  color: #16181a;
  font-weight: 800;
}

.btn.primary:hover {
  background: color-mix(in srgb, var(--tape) 84%, #fff);
  border-color: var(--tape-deep);
  color: #16181a;
}

:root[data-theme="dark"] .btn.primary,
:root[data-theme="dark"] .btn.primary:hover { color: #101216; }

.btn.quiet {
  border-color: var(--rule);
  background: transparent;
  color: var(--fg-2);
}

.btn.quiet:hover {
  background: var(--raised);
  color: var(--fg);
  border-color: var(--rule-strong);
}

.btn.sm { padding: 7px 12px; }

/* --- o registro de evidências: protocolo numerado -------------------------- */

details.exp {
  border-top: 2px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule);
}

details.exp > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 0;
  color: var(--fg-2);
}

details.exp > summary::-webkit-details-marker { display: none; }
details.exp > summary:hover { color: var(--fg); }

details.exp > summary .arrow {
  margin-left: auto;
  color: var(--fg-3);
  transition: transform 0.18s;
  font-size: 0.7rem;
}

details.exp[open] > summary .arrow { transform: rotate(180deg); }

.ledger {
  padding: 0 0 16px;
  counter-reset: fonte;
}

.ledger-row {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  gap: 4px 14px;
  align-items: baseline;
  padding: 10px 0;
  border-top: 1px solid var(--rule-soft);
  counter-increment: fonte;
}

.ledger-row::before {
  content: counter(fonte, decimal-leading-zero);
  font-family: var(--sans);
  font-weight: 800;
  font-stretch: 96%;
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
  color: var(--fg-3);
}

.ledger-row .src { font-size: 0.9rem; color: var(--fg); font-weight: 500; }
.ledger-row .src a:hover { color: var(--green); }

.ledger-row .src small {
  display: block;
  color: var(--fg-3);
  font-size: 0.76rem;
  font-weight: 400;
  margin-top: 2px;
}

.ledger-row .kind {
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  font-stretch: 96%;
  font-size: 0.7rem;
  color: var(--fg-3);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.ledger-row .kind .thin { color: var(--amber); }

/* --- a conta (THE MATH): fecha numa linha grifada --------------------------- */

.ldg table { width: 100%; border-collapse: collapse; }

.ldg td {
  padding: 9px 0;
  border-bottom: 1px solid var(--rule-soft);
  font-size: 0.95rem;
  color: var(--fg-2);
}

.ldg td:last-child {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--fg);
  font-weight: 700;
  font-stretch: 104%;
  white-space: nowrap;
}

.ldg td .u { color: var(--fg-3); font-weight: 450; font-size: 0.8em; margin-left: 3px; }

.ldg tr.grp td {
  padding: 18px 0 5px;
  border-bottom: 1px solid var(--rule);
  color: var(--fg-3);
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 750;
  font-stretch: 96%;
  font-size: 0.7rem;
}

.ldg tr.sum td { color: var(--fg); font-weight: 700; }
.ldg tr.sum td:first-child { color: var(--green); }

.ldg tr.out td {
  background: var(--hl);
  color: var(--fg);
  font-weight: 800;
  padding: 13px 12px;
  border-bottom: 0;
  border-top: 1.5px solid var(--rule-strong);
}

.ldg tr.out td:last-child { font-size: 1.25rem; font-stretch: 108%; }

.fnote {
  color: var(--fg-3);
  font-size: 0.78rem;
  line-height: 1.6;
  margin-top: 15px;
  font-weight: 420;
}

.fnote b { color: var(--fg-2); font-weight: 700; }

/* --- rodapé ----------------------------------------------------------------- */

.foot {
  border-top: 2px solid var(--rule-strong);
  margin-top: 8px;
  background: var(--ground);
}

.foot-in {
  max-width: var(--page);
  margin: 0 auto;
  padding: 34px var(--gut) 40px;
}

.foot-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  flex-wrap: wrap;
}

.foot .wordmark { font-size: 1.5rem; }

.foot-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
}

.foot-links a { color: var(--fg-2); }
.foot-links a:hover { color: var(--green); }

.foot-chrome {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
}

.foot-chrome .grow { flex: 1; }

.foot-note {
  color: var(--fg-2);
  font-size: 0.72rem;
  line-height: 1.6;
  margin-top: 18px;
  max-width: 62ch;
  font-weight: 420;
}

.foot-note b { color: var(--amber); font-weight: 700; }

/* os controles de idioma e tema, no topo de toda página */
.chrome-top {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  max-width: var(--page);
  margin: 0 auto;
  padding: 10px var(--gut) 0;
}

.ctl {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--rule);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--ground);
}

.ctl button {
  all: unset;
  cursor: pointer;
  padding: 6px 12px;
  color: var(--fg-3);
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-weight: 750;
  font-stretch: 96%;
  font-size: 0.7rem;
  transition: color 0.15s, background 0.15s;
}

.ctl button:hover { color: var(--fg); background: var(--raised); }

.ctl button[aria-pressed="true"] {
  background: var(--fg);
  color: var(--ground);
}

.ctl button:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
}

.ctl button + button { border-left: 1px solid var(--rule); }

/* --- o vocabulário de marcas físicas de estado ----------------------------- */

/* risco: a correção riscada a lápis de cera, o texto antigo fica legível */
.risco {
  text-decoration: line-through;
  text-decoration-color: var(--red);
  text-decoration-thickness: 2px;
  color: var(--fg-3);
}

/* furo: a marca de arquivado, um furo de fichário na folha */
.furo {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--raised-2);
  border: 1px solid var(--rule-strong);
  box-shadow: inset 0 1px 2px rgba(20, 22, 26, 0.25);
  vertical-align: -1px;
}

/* --- utilities ------------------------------------------------------------ */

.up { color: var(--green); }
.down { color: var(--red); }
.hide { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  :root { --gut: 18px; }
  /* balance encurta as linhas por igual e o título parece colado à esquerda;
     na coluna estreita, pretty preenche a medida */
  h1, h2 { text-wrap: pretty; }
  .mh-meta { font-size: 0.7rem; flex-wrap: wrap; row-gap: 4px; }
  .mh-meta span { white-space: normal; }
  .masthead { padding: 24px var(--gut) 12px; }
  .masthead .etq { padding: 14px 20px 11px; }
  .masthead .etq .stamp { right: -10px; top: -11px; }
  .band-head { flex-wrap: wrap; row-gap: 4px; }
  .foot-top { align-items: flex-start; }
  .ph::before, .ph::after { width: 42px; height: 14px; top: -7px; }
}

/* nothing is allowed to widen the page on a phone */
html, body { max-width: 100%; overflow-x: clip; }
