/* Necrológio — estética de registro civil, não true crime. */

:root {
  --bg: #14110F;
  --surface: #1A1614;
  --surface-2: #201B18;
  --ink: #F2EAE0;
  --muted: #B9AFA3;
  --gold: #C8A24A;
  --blood: #8C1C13;
  --blood-text: #E06A58;
  --steel: #4A5560;
  --service: #3F6B52;
  --service-text: #7FB89A;
  --line: rgba(242, 234, 224, 0.16);
  --line-strong: rgba(242, 234, 224, 0.28);
  --font-display: "EB Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --measure: 68ch;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.1;
}

p {
  margin: 0 0 1rem;
}

a {
  color: var(--gold);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--ink);
}

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

::selection {
  background: var(--gold);
  color: var(--bg);
}

.wrap {
  width: min(1120px, calc(100% - 2rem));
  margin-inline: auto;
}

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

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 100;
  padding: 0.6rem 0.9rem;
  background: var(--gold);
  color: var(--bg);
  text-decoration: none;
  font-weight: 600;
}

.skip-link:focus {
  top: 0.75rem;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(20, 17, 15, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}

.site-header__inner {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 2rem;
  padding: 1rem 0;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  flex-direction: column;
  color: var(--ink);
  text-decoration: none;
}

.brand__name {
  font-family: var(--font-display);
  font-size: 1.55rem;
  letter-spacing: 0.02em;
  line-height: 1.1;
}

.brand__sub {
  font-size: 0.68rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-size: 0.85rem;
}

.nav a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  padding-bottom: 0.15rem;
}

.nav a[aria-current="page"] {
  color: var(--gold);
  border-color: var(--gold);
}

.nav__pending {
  color: var(--muted);
  opacity: 0.55;
  cursor: not-allowed;
}

/* Hero */

.hero {
  padding: clamp(2.5rem, 7vw, 5rem) 0 3rem;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 0.75rem;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}

.hero__label {
  margin: 0 0 0.5rem;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
}

.hero__live {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 2rem);
  flex-wrap: wrap;
  margin: 0.5rem 0 0.75rem;
}

.hero__number {
  margin: 0;
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  font-size: clamp(4.5rem, 15vw, 10rem);
  font-weight: 500;
  line-height: 0.85;
  letter-spacing: -0.03em;
  color: var(--blood-text);
  transform-origin: left center;
}

.hero__clock {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: clamp(104px, 18vw, 148px);
  height: clamp(104px, 18vw, 148px);
}

.hero__countdown {
  position: absolute;
  font-variant-numeric: tabular-nums;
  font-size: clamp(0.95rem, 2.4vw, 1.3rem);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink);
}

/* Anéis */

.ring {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.ring__track {
  fill: none;
  stroke: var(--line);
  stroke-width: 3;
}

.ring__value {
  fill: none;
  stroke: var(--blood-text);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  transition: stroke-dashoffset 260ms linear;
}

.ring--hero .ring__track,
.ring--hero .ring__value {
  stroke-width: 2.5;
}

.hero__caption {
  margin: 0 0 2.5rem;
  color: var(--muted);
  max-width: var(--measure);
}

.hero__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.stat {
  padding: 1.25rem 1.5rem;
  border-left: 1px solid var(--line);
}

.stat:first-child {
  padding-left: 0;
  border-left: 0;
}

.stat__label {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--muted);
}

.stat__value {
  display: block;
  margin: 0.35rem 0;
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  line-height: 1.15;
}

.stat__foot {
  font-size: 0.8rem;
  color: var(--muted);
}

.yearbar {
  height: 4px;
  margin: 1.5rem 0 1rem;
  overflow: hidden;
  background: var(--line);
}

.yearbar span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--blood-text);
  transition: width 0.6s ease-out;
}

.yearbar--hero {
  height: 5px;
  margin: 0 0 0.5rem;
}

.yearbar--row {
  height: 3px;
  margin: 0.6rem 0 0;
  background: var(--line);
}

.yearbar--row span {
  transition: width 0.6s ease-out;
}

.hero__progress {
  margin: 1.5rem 0 1.25rem;
}

.hero__progress-text {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.hero__progress-text strong {
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.stamp {
  display: inline-block;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.stamp--small {
  padding: 0.2rem 0.4rem;
  font-size: 0.6rem;
}

.hero__note {
  max-width: var(--measure);
  margin: 1rem 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

/* Sections */

.section {
  padding: clamp(3rem, 6vw, 5rem) 0;
  border-bottom: 1px solid var(--line);
}

.section__head {
  max-width: var(--measure);
  margin-bottom: 2rem;
}

.section__head h2 {
  margin: 0.25rem 0 0.75rem;
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
}

.section__lede {
  margin: 0;
  color: var(--muted);
}

.note {
  max-width: var(--measure);
  margin: 1.25rem 0 0;
  font-size: 0.88rem;
  color: var(--muted);
}

/* Linhas com anel e contador */

.death-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.death-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.25rem;
  padding: 1.35rem 0;
  border-bottom: 1px solid var(--line);
}

.death-row.is-complete .ring__value {
  stroke: var(--gold);
}

.death-row__clock {
  position: relative;
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
}

.death-row__countdown {
  position: absolute;
  font-variant-numeric: tabular-nums;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink);
}

.death-row__body {
  min-width: 0;
}

.death-row__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 0.35rem;
}

.tag {
  padding: 0.12rem 0.42rem;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
}

.tag--derived {
  border-style: dashed;
  color: var(--muted);
}

.death-row__title {
  margin: 0;
  font-size: clamp(1.15rem, 2.4vw, 1.5rem);
  line-height: 1.2;
}

.death-row__meta {
  margin: 0.25rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.death-row__bar {
  min-width: 0;
}

.death-row__count {
  margin: 0;
  text-align: right;
  justify-self: end;
}

.death-row__count strong {
  display: block;
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 500;
  line-height: 1;
  color: var(--blood-text);
}

.death-row__count-label {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.72rem;
  color: var(--muted);
}

/* Contexto */

.context {
  padding: clamp(1.5rem, 4vw, 2.5rem);
  background: var(--surface);
  border: 1px solid var(--line);
}

.context__quote {
  max-width: 30ch;
  margin: 0 0 2rem;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  line-height: 1.25;
}

.context__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: 1.5rem 2rem;
  margin-bottom: 1.5rem;
}

.context__value {
  margin: 0;
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
  color: var(--gold);
}

.context__label {
  margin: 0.4rem 0 0;
  font-size: 0.9rem;
}

.context__detail {
  margin: 0.3rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

/* Gráficos */

.charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: 1.5rem;
}

.chart {
  margin: 0;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
}

.chart h3 {
  margin: 0 0 0.15rem;
  font-size: 1.2rem;
}

.chart p {
  margin: 0 0 0.75rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.chart svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart__grid {
  stroke: var(--line);
  stroke-width: 1;
}

.chart__axis {
  fill: var(--muted);
  font-family: var(--font-sans);
  font-size: 11px;
}

.chart__line {
  fill: none;
  stroke: var(--blood-text);
  stroke-width: 2.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.chart__dot {
  fill: var(--blood-text);
}

.chart__dot--peak {
  fill: var(--gold);
}

.chart__value {
  fill: var(--ink);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
}

.chart__peak-label {
  fill: var(--gold);
  font-family: var(--font-sans);
  font-size: 11px;
}

/* Tabela da série */

.data-table {
  margin-top: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
}

.data-table summary {
  padding: 0.9rem 1rem;
  color: var(--gold);
  font-size: 0.9rem;
  cursor: pointer;
}

.data-table summary:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: -2px;
}

.data-table__body {
  padding: 0 1rem 1rem;
  overflow-x: auto;
}

.data-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.data-table caption {
  padding: 0.5rem 0;
  color: var(--muted);
  font-size: 0.78rem;
  text-align: left;
}

.data-table th,
.data-table td {
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.data-table th {
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.data-table .num {
  text-align: right;
}

/* Método */

.method {
  background: var(--surface);
  border: 1px solid var(--line);
}

.method summary {
  padding: 1rem 1.25rem;
  color: var(--gold);
  font-size: 0.95rem;
  cursor: pointer;
}

.method__body {
  max-width: var(--measure);
  padding: 0 1.25rem 1.25rem;
}

.method__body p,
.method__body li {
  color: var(--muted);
}

.method__body strong {
  color: var(--ink);
}

.method__body code {
  padding: 0.1rem 0.3rem;
  background: var(--bg);
  border: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--ink);
}

.method pre {
  padding: 0.9rem;
  overflow-x: auto;
  background: var(--bg);
  border: 1px solid var(--line);
}

.method pre code {
  padding: 0;
  border: 0;
}

/* Fontes e rodapé */

.sources {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sources li {
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
}

.sources a {
  color: var(--ink);
  text-decoration-color: var(--gold);
}

.sources span {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.site-footer {
  padding: 2.5rem 0 3rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.site-footer p {
  max-width: var(--measure);
  margin: 0.4rem 0;
}

.site-footer strong {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.1rem;
}

.load-error {
  margin-top: 1rem;
  padding: 0.75rem;
  border: 1px solid var(--blood);
  color: var(--blood-text);
}

/* Movimento */

.is-increment {
  animation: necro-pulse 900ms cubic-bezier(0.2, 0.8, 0.3, 1);
}

@keyframes necro-pulse {
  0% {
    transform: scale(1);
    text-shadow: 0 0 0 transparent;
  }
  30% {
    transform: scale(1.04);
    text-shadow: 0 0 18px rgba(200, 162, 74, 0.55);
  }
  100% {
    transform: scale(1);
    text-shadow: 0 0 0 transparent;
  }
}

@keyframes necro-reveal {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .death-row {
    animation: necro-reveal 480ms ease-out both;
    animation-delay: calc(var(--row-index, 0) * 45ms);
  }

  .chart,
  .context__item,
  .data-table {
    animation: necro-reveal 560ms ease-out both;
  }
}

/* Responsivo */

@media (max-width: 760px) {
  .site-header__inner {
    align-items: flex-start;
  }

  .hero__grid {
    grid-template-columns: 1fr;
  }

  .stat {
    padding: 0.9rem 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .stat:first-child {
    border-top: 0;
  }

  .death-row {
    grid-template-columns: 64px minmax(0, 1fr);
    grid-template-areas:
      "clock body"
      "clock count";
    row-gap: 0.45rem;
    align-items: start;
    gap: 0.45rem 1rem;
    padding: 1.1rem 0;
  }

  .death-row__clock {
    grid-area: clock;
    align-self: center;
    width: 64px;
    height: 64px;
  }

  .death-row__body {
    grid-area: body;
  }

  .death-row__count {
    grid-area: count;
    text-align: left;
    justify-self: start;
  }

  .death-row__count strong {
    font-size: 1.9rem;
  }
}

@media (max-width: 460px) {
  .nav {
    gap: 0.75rem;
    font-size: 0.8rem;
  }

  .brand__sub {
    font-size: 0.6rem;
  }

  .death-row__countdown {
    font-size: 0.68rem;
  }

  .hero__number {
    font-size: clamp(3.6rem, 19vw, 5rem);
  }
}

/* Acessibilidade de movimento */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .ring__value {
    transition: none;
  }
}

@media print {
  .site-header,
  .site-footer,
  .nav,
  .yearbar,
  .death-row__countdown {
    display: none;
  }

  body {
    background: #fff;
    color: #111;
  }

  a {
    color: #111;
  }

  .death-row,
  .context,
  .chart,
  .method,
  .data-table {
    break-inside: avoid;
    border-color: #bbb;
    background: #fff;
  }

  .ring__track {
    stroke: #ccc;
  }

  .ring__value {
    stroke: #111;
    transition: none;
  }
}
