/* Autopsy — one page, one accent, one spacing scale. */

:root {
  --red: #ff2a4e;
  --chalk: #f3ecdf;
  --ink: #141019;
  --teal: #79e8cc;

  --ink-72: rgb(20 16 25 / 0.72);
  --ink-62: rgb(20 16 25 / 0.62);
  --ink-48: rgb(20 16 25 / 0.48);
  --ink-32: rgb(20 16 25 / 0.32);
  --hair: rgb(20 16 25 / 0.3);

  --display: "Big Shoulders Display", Impact, sans-serif;
  --body: "Archivo", system-ui, sans-serif;
  --data: "Chivo Mono", ui-monospace, monospace;

  --shell: 76rem;
  --step-1: 0.5rem;
  --step-2: 1rem;
  --step-3: 1.5rem;
  --step-4: 2.5rem;
  --step-5: 4rem;
  --step-6: 6rem;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

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

body {
  margin: 0;
  background: var(--red);
  color: var(--chalk);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1 0 auto;
}

h1,
h2,
p {
  margin: 0;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

input {
  font: inherit;
  color: inherit;
}

::selection {
  background: var(--ink);
  color: var(--chalk);
}

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

/* ---------- primitives ---------- */

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: 1.25rem;
}
@media (min-width: 640px) {
  .shell {
    padding-inline: 2rem;
  }
}

.display {
  font-family: var(--display);
  font-weight: 900;
  text-transform: uppercase;
  line-height: 0.86;
  letter-spacing: -0.015em;
}

/* Small caps label. Tracking is wide because at 11px it stops being type and
   starts being texture. */
.tag {
  font-family: var(--data);
  font-size: 0.6875rem;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-62);
}

.tag.accent {
  color: var(--ink);
}

.lede {
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ink-72);
  max-width: 46ch;
}

.mono {
  font-family: var(--data);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "zero" 1;
}

/* ---------- hero ---------- */

.hero {
  padding-top: var(--step-6);
  padding-bottom: var(--step-5);
}

.hero-title {
  margin-top: var(--step-3);
  font-size: clamp(3.25rem, 12vw, 8.5rem);
  max-width: 14ch;
}

.hero .lede {
  margin-top: var(--step-3);
}

/* ---------- form ---------- */

.form {
  margin-top: var(--step-5);
  max-width: 48rem;
}

.form-label {
  display: block;
  margin-bottom: 0.75rem;
}

.field {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--ink-32);
  background: rgb(20 16 25 / 0.16);
  transition: border-color 180ms var(--ease), background 180ms var(--ease);
}
.field:focus-within {
  border-color: var(--ink);
  background: rgb(20 16 25 / 0.22);
}

@media (min-width: 640px) {
  .field {
    flex-direction: row;
    align-items: stretch;
  }
}

.field input {
  flex: 1 1 auto;
  min-width: 0;
  background: none;
  border: 0;
  outline: none;
  padding: 1.1rem 1.25rem;
  font-family: var(--data);
  font-size: 0.9375rem;
  letter-spacing: 0.01em;
}
.field input::placeholder {
  color: rgb(243 236 223 / 0.5);
}
@media (min-width: 640px) {
  .field input {
    padding: 1.4rem 1.6rem;
    font-size: 1.0625rem;
  }
}

.btn {
  background: var(--ink);
  color: var(--chalk);
  font-family: var(--display);
  font-weight: 900;
  font-size: 1.75rem;
  line-height: 1;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 1rem 2.25rem;
  transition: background 180ms var(--ease), color 180ms var(--ease);
}
@media (min-width: 640px) {
  .btn {
    font-size: 2rem;
    padding-inline: 2.75rem;
  }
}
.btn:hover {
  background: var(--chalk);
  color: var(--ink);
}
.btn[disabled] {
  opacity: 0.55;
  cursor: progress;
}

.field-error {
  margin-top: 0.85rem;
  font-family: var(--data);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--ink);
}

.form-foot {
  margin-top: var(--step-3);
  display: flex;
  flex-wrap: wrap;
  gap: var(--step-2) var(--step-3);
  align-items: center;
  justify-content: space-between;
}

.ranges {
  display: flex;
  gap: 0.25rem;
}

.ranges button {
  font-family: var(--data);
  font-size: 0.6875rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0.55rem 0.85rem;
  color: var(--ink-62);
  transition: color 160ms var(--ease), background 160ms var(--ease);
}
.ranges button:hover {
  color: var(--ink);
}
.ranges button[aria-checked="true"] {
  background: var(--ink);
  color: var(--chalk);
}

.link {
  font-family: var(--data);
  font-size: 0.6875rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-62);
  border-bottom: 1px solid var(--ink-32);
  padding-bottom: 2px;
  transition: color 160ms var(--ease), border-color 160ms var(--ease);
}
.link:hover {
  color: var(--ink);
  border-color: var(--ink);
}

/* ---------- working ---------- */

.progress {
  margin-top: var(--step-4);
  height: 1px;
  max-width: 48rem;
  background: var(--ink-32);
  overflow: hidden;
}
.progress span {
  display: block;
  height: 1px;
  width: 34%;
  background: var(--ink);
  animation: sweep 1.3s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}
@keyframes sweep {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(320%);
  }
}

/* ---------- report ---------- */

.verdict {
  margin-top: var(--step-3);
  font-size: clamp(2.75rem, 9vw, 6.5rem);
  max-width: 16ch;
}

.headline {
  margin-top: var(--step-4);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 1.25rem;
}

.headline-sol {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(2.5rem, 8vw, 5.5rem);
  line-height: 0.85;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

.headline-usd {
  font-family: var(--data);
  font-size: 1.0625rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink-62);
}

.pos {
  color: var(--teal);
}
.neg {
  color: var(--ink);
}

.stats {
  margin-top: var(--step-5);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--step-4) var(--step-3);
}
@media (min-width: 640px) {
  .stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (min-width: 1024px) {
  .stats {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

.cell {
  border-top: 1px solid var(--hair);
  padding-top: 0.9rem;
}
.cell-value {
  margin-top: 0.5rem;
  font-family: var(--display);
  font-weight: 900;
  font-size: 2.25rem;
  line-height: 0.95;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}
.unit {
  font-size: 1.125rem;
  color: rgb(243 236 223 / 0.45);
}

.cards {
  margin-top: var(--step-5);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--step-2);
}
@media (min-width: 640px) {
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.card {
  border: 1px solid var(--hair);
  background: rgb(20 16 25 / 0.4);
  padding: 1.5rem;
}
.card-symbol {
  margin-top: 0.75rem;
  font-family: var(--display);
  font-weight: 900;
  font-size: 1.875rem;
  line-height: 1;
  text-transform: uppercase;
}
.card-line {
  margin-top: 0.5rem;
  font-family: var(--data);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}
.card .tag {
  color: rgb(243 236 223 / 0.5);
}
.card .neg {
  color: rgb(243 236 223 / 0.78);
}

.ledger {
  margin-top: var(--step-5);
}
.scroller {
  margin-top: var(--step-2);
  overflow-x: auto;
}
table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  text-align: left;
}
th {
  padding-bottom: 0.85rem;
  font-weight: 400;
}
td {
  padding: 1rem 0;
  border-top: 1px solid var(--hair);
}
th.r,
td.r {
  text-align: right;
}
.sym {
  font-family: var(--display);
  font-weight: 900;
  font-size: 1.5rem;
  line-height: 1;
  text-transform: uppercase;
}
.mint {
  margin-top: 0.3rem;
  font-family: var(--data);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  color: var(--ink-48);
}
.cellmono {
  font-family: var(--data);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink-72);
}
.realised {
  font-family: var(--display);
  font-weight: 900;
  font-size: 1.5rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.realised-usd {
  display: block;
  margin-top: 0.25rem;
  font-family: var(--data);
  font-size: 0.6875rem;
  color: var(--ink-48);
}

/* ---------- between the lines ---------- */

.reading {
  margin-top: var(--step-6);
  padding-top: var(--step-4);
  border-top: 1px solid var(--hair);
}
.reading-title {
  margin-top: var(--step-2);
  font-size: clamp(2.25rem, 6vw, 4.25rem);
  max-width: 18ch;
}
.reading .lede {
  margin-top: var(--step-2);
  max-width: 54ch;
}

.findings {
  margin-top: var(--step-4);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1px;
  background: var(--hair);
  border: 1px solid var(--hair);
}
@media (min-width: 700px) {
  .findings {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .finding-wide {
    grid-column: 1 / -1;
  }
  /* The clock spans the row, so an even total strands the last one alone. */
  .finding:last-child:nth-child(even) {
    grid-column: 1 / -1;
  }
}

.finding {
  background: var(--red);
  padding: 1.75rem;
}
.finding-body {
  margin-top: 0.9rem;
  font-size: 0.9375rem;
  line-height: 1.7;
  max-width: 62ch;
}
.finding-body strong {
  font-weight: 400;
  border-bottom: 2px solid rgb(20 16 25 / 0.5);
}
.addr {
  font-family: var(--data);
  font-size: 0.875em;
  color: rgb(20 16 25 / 0.85);
}

.clock {
  margin-top: var(--step-3);
}
.bars {
  display: grid;
  grid-template-columns: repeat(24, minmax(0, 1fr));
  align-items: end;
  gap: 3px;
  height: 132px;
}
.bar {
  background: var(--chalk);
  min-height: 2px;
}
/* The six hours nothing happens are the finding, so they read as absence. */
.bar.quiet {
  background: rgb(20 16 25 / 0.42);
}
.axis {
  margin-top: 0.6rem;
  display: grid;
  grid-template-columns: repeat(24, minmax(0, 1fr));
  gap: 3px;
  font-family: var(--data);
  font-size: 0.625rem;
  letter-spacing: 0.14em;
  color: var(--ink-62);
}
.axis span:nth-child(1) {
  grid-column: 1;
}
.axis span:nth-child(2) {
  grid-column: 7;
}
.axis span:nth-child(3) {
  grid-column: 13;
}
.axis span:nth-child(4) {
  grid-column: 19;
}
.axis span:nth-child(5) {
  grid-column: 24;
  justify-self: end;
}

.report-foot {
  margin-top: var(--step-5);
  padding-top: var(--step-4);
  border-top: 1px solid var(--hair);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--step-3) var(--step-4);
}
.note {
  max-width: 52ch;
  font-family: var(--data);
  font-size: 0.6875rem;
  line-height: 1.8;
  letter-spacing: 0.04em;
  color: var(--ink-62);
}

/* ---------- footer ---------- */

.footer {
  position: relative;
  margin-top: var(--step-6);
  border-top: 1px solid var(--hair);
  padding-block: var(--step-4);
  flex-shrink: 0;
}

/* He rises from behind the hairline — the crop lands on a line that is already
   there, so it reads as looking over the edge rather than being cut off. */
.footer::before {
  content: "";
  position: absolute;
  right: clamp(0px, 5vw, 110px);
  bottom: 100%;
  width: clamp(200px, 26vw, 400px);
  aspect-ratio: 1231 / 678;
  background: url("/peek.png") bottom center / contain no-repeat;
  pointer-events: none;
  animation: peek 620ms var(--ease) 200ms both;
}
@keyframes peek {
  from {
    transform: translateY(38%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
@media (max-width: 767px) {
  .footer::before {
    right: -6vw;
    width: 58vw;
  }
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--step-4);
}
@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--step-5);
  }
}

.footer-copy {
  margin-top: 0.9rem;
  font-size: 0.875rem;
  line-height: 1.75;
  color: var(--ink-72);
  max-width: 58ch;
}

.footer-base {
  margin-top: var(--step-4);
  padding-top: var(--step-3);
  border-top: 1px solid var(--hair);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--step-2);
}

.wordmark {
  font-size: 1.75rem;
  letter-spacing: 0.02em;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
