/* Site do Axel the Bat. Paleta de osso com um acento verde.
   Switzer no texto, uma monoespacada so dentro de bloco de codigo. */

:root {
  color-scheme: light;

  /* cor */
  --bg: #eae9e6;
  --surface: #e1e0dc;
  --surface-2: #d3d2cd;
  --ink: #1c1b19;
  --muted: #4e4c47;
  --faint: #656359;
  --accent: #0b6b3b;
  --accent-ink: #ffffff;

  /* severidade: dado, nao decoracao */
  --sev-critical: #98201a;
  --sev-high: #844508;
  --sev-medium: #635108;
  --sev-low: #0b6b3b;

  /* tipo */
  --step-small: 0.8125rem;
  --step-body: 1.0625rem;
  --step-lead: 1.3125rem;
  --step-head: clamp(1.5rem, 1.15rem + 1.5vw, 2.125rem);
  --step-display: clamp(2.75rem, 1.5rem + 4.2vw, 4.5rem);

  --sans: "Switzer", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  /* medida */
  --gutter: 32px;
  --offset: 13%;
}

@media (max-width: 640px) {
  :root { --gutter: 20px; --offset: 0; }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--step-body);
  line-height: 1.5;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--faint); text-underline-offset: 4px; }
a:hover { text-decoration-color: var(--accent); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

img { max-width: 100%; height: auto; display: block; }

/* a monoespacada aparece so dentro de bloco de codigo real */
code, pre { font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.875em; }

code {
  background: var(--surface);
  padding: 0.1em 0.34em;
  border-radius: 3px;
}

pre {
  background: var(--surface);
  padding: 18px 20px;
  border-radius: 4px;
  overflow-x: auto;
  line-height: 1.6;
}
pre code { background: none; padding: 0; }

h1, h2, h3 {
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.028em;
  margin: 0;
}
h1 { font-size: var(--step-head); }
h2 { font-size: var(--step-head); }
h3 { font-size: var(--step-body); letter-spacing: -0.015em; }

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

ul { margin: 0 0 1.1em; padding-left: 1.2em; }
li { margin-bottom: 0.35em; }
li::marker { color: var(--faint); }

.lead { font-size: var(--step-lead); line-height: 1.45; }
.muted { color: var(--muted); }
.small { font-size: var(--step-small); }

/* estrutura */

.page { padding: 0 var(--gutter); }

/* coluna de texto: measure curto, alinhada a 13% da viewport */
.column { max-width: 66ch; margin-left: var(--offset); }

/* coluna larga: tabelas, fotos e listas */
.ledger { max-width: 78ch; margin-left: var(--offset); }

@media (max-width: 900px) {
  .column, .ledger { margin-left: 0; }
}

.section { padding: 5rem 0 0; }

@media (min-width: 900px) {
  .section { padding: 6.5rem 0 0; }
}

.section > h2 { margin-bottom: 2.4rem; max-width: 78ch; margin-left: var(--offset); }

/* cabecalho */

.top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2.5rem;
  padding: 1.8rem 0 0;
}

.wordmark {
  font-size: var(--step-display);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.04em;
  text-decoration: none;
  color: var(--ink);
  margin: 0;
}
.wordmark:hover { text-decoration: none; color: var(--accent); }

.tagline {
  font-size: var(--step-small);
  line-height: 1.45;
  color: var(--muted);
  max-width: 32ch;
  text-align: right;
  margin: 0.4rem 0 0;
}

@media (max-width: 760px) {
  .top { flex-direction: column; gap: 1rem; }
  .tagline { text-align: left; max-width: 46ch; margin: 0; }
}

/* heroi */

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4vh 0 0;
}

.plinth {
  width: min(520px, 78vw);
  min-height: 300px;
  background: var(--surface);
  border-radius: 24px;
  padding: 32px 38px;
  display: grid;
}

.finding {
  grid-area: 1 / 1;
  align-content: center;
  opacity: 0;
  transition: opacity 420ms ease;
  pointer-events: none;
}

.finding[data-active="true"] { opacity: 1; pointer-events: auto; }

.finding dl { margin: 0; }

.finding .row {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 0.1rem 1rem;
  padding: 0.5rem 0;
}

.finding dt {
  font-size: var(--step-small);
  color: var(--faint);
  line-height: 1.6;
}

.finding dd {
  margin: 0;
  font-size: var(--step-small);
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.finding .id { font-weight: 500; }
.finding .sev { font-weight: 500; }
.sev-critical { color: var(--sev-critical); }
.sev-high { color: var(--sev-high); }
.sev-medium { color: var(--sev-medium); }
.sev-low { color: var(--sev-low); }

.hero-action {
  margin-top: 2.4rem;
  display: inline-block;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: var(--step-body);
  font-weight: 500;
  text-decoration: none;
  padding: 0.72rem 1.5rem;
  border-radius: 2px;
  transition: background 140ms ease, transform 140ms ease;
}
.hero-action:hover { background: #084f2d; text-decoration: none; transform: translateY(-1px); }

.hero-note {
  margin: 1rem 0 0;
  font-size: var(--step-small);
  color: var(--muted);
  text-align: center;
  max-width: 46ch;
}

/* introducao */

.intro p + p { margin-top: 0; }
.intro p:first-child { font-weight: 500; }

/* ledger de trabalhos */

.ledger-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 1rem;
  align-items: baseline;
  padding: 1.2rem 0.7rem;
  margin: 0 -0.7rem;
  transition: background 140ms ease;
}
.ledger-row:hover { background: var(--surface); }

.ledger-row .name { font-weight: 500; }
.ledger-row .name a { text-decoration: none; }
.ledger-row .name a:hover { color: var(--accent); }
.ledger-row .kind { font-size: var(--step-small); color: var(--muted); }
.ledger-row .year { font-size: var(--step-small); color: var(--muted); font-variant-numeric: tabular-nums; }

@media (max-width: 620px) {
  .ledger-row { grid-template-columns: 1fr auto; }
  .ledger-row .kind { grid-column: 1 / -1; }
}

/* faixa de fotos que ocupa a largura inteira da tela */
.band {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  margin: 2.8rem calc(50% - 50vw) 0;
  width: 100vw;
}

.band figure { margin: 0; overflow: hidden; border-radius: 3px; }
.band img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  filter: grayscale(1);
  transition: transform 400ms ease;
}
.band figure:hover img { transform: scale(1.04); }

@media (max-width: 620px) {
  .band { grid-template-columns: 1fr; }
}

/* tabela de regras */

.rules { width: 100%; border-collapse: collapse; margin: 0 0 1.6rem; }

.rules th {
  text-align: left;
  font-weight: 500;
  font-size: var(--step-small);
  color: var(--muted);
  padding: 0 1rem 0.9rem 0;
  border-bottom: 1px solid var(--surface-2);
}

.rules td {
  padding: 0.95rem 1rem 0.95rem 0;
  border-bottom: 1px solid var(--surface-2);
  vertical-align: top;
}

.rules tbody tr { cursor: pointer; }
.rules tbody tr:hover td,
.rules tbody tr[data-selected="true"] td { background: var(--surface); }
.rules tbody tr[data-selected="true"] td:first-child { color: var(--accent); }

.rules .rid { font-weight: 500; white-space: nowrap; }
.rules .sev { font-weight: 500; white-space: nowrap; }

.rule-detail {
  background: var(--surface);
  border-radius: 4px;
  padding: 1.3rem 1.4rem;
  margin-bottom: 2rem;
}
.rule-detail h3 { margin-bottom: 0.7rem; font-size: 1rem; }
.rule-detail pre { background: var(--bg); margin: 0.8rem 0 0; }

/* texto corrido */

.letter { max-width: 66ch; }
.letter p + p { margin-top: 0; }
.letter p:first-child { font-weight: 500; }

.figure-wide {
  margin: 2.4rem 0 0;
  max-width: 78ch;
  overflow: hidden;
  border-radius: 4px;
}
.figure-wide img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  filter: grayscale(1);
  animation: drift 26s ease-in-out infinite alternate;
}
.figure-wide figcaption {
  font-size: var(--step-small);
  color: var(--muted);
  margin-top: 0.7rem;
  line-height: 1.5;
}

/* a foto anda devagar, para a pagina nao ficar parada */
@keyframes drift {
  from { transform: scale(1); }
  to { transform: scale(1.07); }
}

/* contato */

.contact-line {
  font-size: var(--step-lead);
  line-height: 1.4;
  max-width: 32ch;
  margin-bottom: 1.2rem;
}

.contact-links { display: flex; flex-wrap: wrap; gap: 1.6rem; font-size: var(--step-body); }
.contact-links a { text-decoration-color: var(--accent); }

/* rodape */

.footer {
  margin-top: 8rem;
  background: var(--surface);
  padding: 2.6rem 0 3.2rem;
}

.footer-name {
  display: block;
  font-size: var(--step-body);
  color: var(--ink);
  margin-bottom: 0.35rem;
}

.footer-note { font-size: var(--step-small); color: var(--muted); }

/* utilitarios */

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.back {
  display: inline-block;
  font-size: var(--step-small);
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 2.4rem;
}
.back:hover { color: var(--accent); text-decoration: none; }

.post-list { list-style: none; padding: 0; margin: 0; max-width: 46ch; }
.post-list li { padding: 1.2rem 0.7rem; margin: 0 -0.7rem; transition: background 140ms ease; }
.post-list li:hover { background: var(--surface); }
.post-list a { font-weight: 500; text-decoration: none; }
.post-list a:hover { color: var(--accent); }
.post-list .when { display: block; font-size: var(--step-small); color: var(--muted); margin-top: 0.25rem; }

article { max-width: 78ch; margin-left: var(--offset); }

@media (max-width: 900px) {
  article { margin-left: 0; }
}

article h2 { margin: 3.4rem 0 1.2rem; }
article h3 { margin: 2.4rem 0 0.8rem; }
article .byline { font-size: var(--step-small); color: var(--muted); margin: 0.6rem 0 0; }
article .diagram { margin: 2rem 0 2.4rem; max-width: 100%; }
article .diagram img { width: 100%; height: auto; }
article .letter p { max-width: 58ch; }
article p, article li { max-width: 64ch; }
article .strip { max-width: 78ch; }
article .post-action { margin: 1.6rem 0 0; }

/* movimento */

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 560ms ease, transform 560ms cubic-bezier(0.22, 0.61, 0.36, 1);
}
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .finding { transition: none; }
  .figure-wide img { animation: none; }
  .hero-action, .ledger-row, .post-list li, .band img { transition: none; }
  .band figure:hover img { transform: none; }
}
