/* Anvil Point Security
   Palette: steel after the quench, with the colors steel turns as it is tempered
   (straw, purple, blue) and forge heat for the attacker's events. */

@font-face {
  font-family: "Besley";
  src: url("/fonts/besley.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/fonts/atkinson-next.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible Mono";
  src: url("/fonts/atkinson-mono.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --quench: #131920;
  --plate: #1a222b;
  --plate-hi: #222d39;
  --seam: #33404d;
  --steel: #e7ecf1;
  --scale: #9ba8b5;
  --straw: #ecc56a;
  --heat: #ff7b36;
  --blue: #6aa2e0;
  --purple: #9477bd;

  --display: "Besley", "Rockwell", "Georgia", serif;
  --text: "Atkinson Hyperlegible Next", "Segoe UI", system-ui, sans-serif;
  --mono: "Atkinson Hyperlegible Mono", "Cascadia Mono", "Consolas", monospace;

  --gutter: clamp(1.25rem, 4vw, 3rem);
  --band: clamp(4rem, 9vw, 7.5rem);
}

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

html {
  color-scheme: dark;
  background: var(--quench);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--quench);
  color: var(--steel);
  font-family: var(--text);
  font-size: 1.125rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ol, ul, table, fieldset { margin: 0; padding: 0; }
ol, ul { list-style: none; }
fieldset { border: 0; min-width: 0; }

a {
  color: var(--straw);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
a:hover { color: var(--steel); }

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

code {
  font-family: var(--mono);
  font-size: 0.9em;
  color: var(--steel);
  background: var(--plate-hi);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  z-index: 10;
  background: var(--straw);
  color: var(--quench);
  padding: 0.5rem 0.9rem;
  border-radius: 3px;
  font-weight: 700;
  text-decoration: none;
}
.skip:focus { top: 0.75rem; color: var(--quench); }

.wrap {
  max-width: 76rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* The temper line: the oxide colors of steel from 290 C down to 220 C. */
.temper {
  height: 4px;
  background: linear-gradient(90deg, var(--blue) 0%, var(--purple) 38%, #c98a55 68%, var(--straw) 100%);
}

/* Header */
.site-header { padding-block: 1.25rem; }
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  flex-wrap: wrap;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  color: var(--steel);
  text-decoration: none;
}
.brand:hover { color: var(--steel); }
.mark { flex: none; display: block; }
.brand-name {
  font-family: var(--display);
  font-weight: 650;
  font-size: 1.2rem;
  letter-spacing: 0.005em;
}
.site-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.75rem;
  font-size: 1rem;
}
.site-header nav a {
  color: var(--scale);
  text-decoration: none;
  padding-block: 0.35rem;
}
.site-header nav a:hover { color: var(--steel); text-decoration: underline; }

/* Hero */
.hero { padding-block: clamp(2rem, 5vw, 3.5rem) clamp(2.25rem, 4vw, 3rem); }
.hero-grid { display: grid; gap: clamp(1.5rem, 3vw, 2.25rem) 3rem; }
h1 {
  font-family: var(--display);
  font-weight: 620;
  font-size: clamp(2.6rem, 6.2vw, 4.6rem);
  line-height: 1.04;
  letter-spacing: -0.018em;
  max-width: 15ch;
  text-wrap: balance;
}
.lede {
  max-width: 38rem;
  font-size: clamp(1.1rem, 1.4vw, 1.2rem);
  line-height: 1.55;
  color: var(--scale);
}
.actions {
  margin-top: 1.6rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.75rem;
}
.button {
  display: inline-block;
  background: var(--straw);
  color: var(--quench);
  font-weight: 700;
  text-decoration: none;
  padding: 0.8rem 1.35rem;
  border-radius: 3px;
  overflow-wrap: anywhere;
}
.button:hover { background: var(--steel); color: var(--quench); }
.plain { font-weight: 600; }

h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.75rem, 3.3vw, 2.6rem);
  line-height: 1.1;
  letter-spacing: -0.012em;
  text-wrap: balance;
}
h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.3rem;
  line-height: 1.25;
}

/* The bench: the pace instrument */
.bench { padding-block: 0 var(--band); }
.bench-head {
  display: grid;
  gap: 1rem 3rem;
  margin-bottom: 1.5rem;
}
.bench-head p { color: var(--scale); max-width: 40rem; }

.instrument {
  background: var(--plate);
  border: 1px solid var(--seam);
  border-radius: 4px;
}

.inst-side { border-bottom: 1px solid var(--seam); }
.rules { display: grid; }
.rule {
  position: relative;
  display: grid;
  gap: 0.05rem;
  padding: 0.8rem 1.25rem 0.85rem;
  cursor: pointer;
  border-bottom: 1px solid var(--seam);
  border-left: 3px solid transparent;
}
.rule input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.rule-name { font-weight: 700; color: var(--scale); }
.rule-src { font-size: 0.9rem; color: var(--scale); }
.rule:hover .rule-name { color: var(--steel); }
.rule:has(input:checked) { background: var(--plate-hi); border-left-color: var(--straw); }
.rule:has(input:checked) .rule-name { color: var(--steel); }
.rule:has(input:focus-visible) { outline: 2px solid var(--straw); outline-offset: -4px; }

.what {
  padding: 1rem 1.25rem 1.15rem;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--scale);
}

.strip { padding: 0.9rem 1.25rem 0; }
.strip canvas {
  display: block;
  width: 100%;
  height: clamp(150px, 20vw, 190px);
}

.meter {
  position: relative;
  height: 6px;
  margin: 0.75rem 1.25rem 0;
  background: var(--quench);
  border-radius: 3px;
  overflow: hidden;
}
.meter-fill {
  position: absolute;
  inset: 0;
  transform-origin: left center;
  transform: scaleX(0);
  background: var(--blue);
}
.meter-notch {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 66.666%;
  width: 2px;
  background: var(--steel);
}
.is-fired .meter-fill { background: var(--heat); }

.readout {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 1.25rem;
  padding: 0.9rem 1.25rem 0;
}
.status {
  font-family: var(--display);
  font-weight: 650;
  font-size: 1.45rem;
  line-height: 1.2;
  color: var(--blue);
  min-width: 7.5ch;
}
.is-fired .status { color: var(--heat); }
.count { color: var(--scale); font-variant-numeric: tabular-nums; }

.pace {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.5rem 1.25rem;
  padding: 0.7rem 1.25rem 0.9rem;
}
.pace-label { font-weight: 700; }
.pace-slider {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.9rem;
}
.pace-end { font-size: 0.95rem; color: var(--scale); white-space: nowrap; }
.pace-out {
  font-variant-numeric: tabular-nums;
  min-width: 15ch;
  text-align: right;
  color: var(--steel);
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 2.75rem;
  margin: 0;
  background: transparent;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--blue), var(--purple) 40%, var(--straw) 72%, var(--heat));
}
input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--blue), var(--purple) 40%, var(--straw) 72%, var(--heat));
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 1.5rem;
  height: 1.5rem;
  margin-top: calc(3px - 0.75rem);
  border-radius: 50%;
  background: var(--steel);
  border: 4px solid var(--quench);
  box-shadow: 0 0 0 1px var(--steel);
}
input[type="range"]::-moz-range-thumb {
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: var(--steel);
  border: 4px solid var(--quench);
  box-shadow: 0 0 0 1px var(--steel);
}
input[type="range"]:focus-visible { outline-offset: 0; }

.ghost {
  font: inherit;
  font-size: 0.95rem;
  color: var(--steel);
  background: transparent;
  border: 1px solid var(--seam);
  border-radius: 3px;
  padding: 0.45rem 0.9rem;
  min-width: 5.2rem;
  cursor: pointer;
}
.ghost:hover { border-color: var(--scale); }

.log {
  border-top: 1px solid var(--seam);
  padding: 0.9rem 1.25rem 1rem;
  height: calc(5 * 1.55em + 1.9rem);
  overflow: hidden;
  font-family: var(--mono);
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--scale);
}
.log li {
  white-space: pre;
  overflow: hidden;
  text-overflow: ellipsis;
}
.log li:first-child { color: var(--steel); }
.log .alert { color: var(--heat); font-weight: 700; }

.fine {
  margin-top: 0.9rem;
  font-size: 0.95rem;
  color: var(--scale);
  max-width: 46rem;
}

html:not(.js) .strip,
html:not(.js) .meter,
html:not(.js) .pace,
html:not(.js) .log,
html:not(.js) .status { display: none; }
html:not(.js) .readout { padding-bottom: 1.1rem; }
html:not(.js) .ghost { display: none; }

/* Bands */
.band {
  padding-block: var(--band);
  border-top: 1px solid var(--seam);
}
.spine { display: grid; gap: 1.5rem 3rem; }
.body { max-width: 42rem; }
.body > p + p { margin-top: 1.1em; }
.body > p { color: var(--steel); }

.practice { padding-block: 1.6rem; border-top: 1px solid var(--seam); }
.practice:first-child { padding-top: 0; border-top: 0; }
.practice:last-child { padding-bottom: 0; }
.practice p { margin-top: 0.5rem; color: var(--scale); }

/* Ledger */
.ledger {
  width: 100%;
  margin-top: clamp(2rem, 4vw, 3rem);
  border-collapse: collapse;
  font-size: 1.05rem;
}
.ledger th, .ledger td {
  text-align: left;
  vertical-align: top;
  padding: 0.95rem 1.5rem 0.95rem 0;
  border-top: 1px solid var(--seam);
}
.ledger thead th {
  border-top: 0;
  padding-bottom: 0.6rem;
  font-weight: 400;
  font-size: 0.95rem;
  color: var(--scale);
}
.ledger tbody th {
  font-family: var(--display);
  font-weight: 600;
  white-space: nowrap;
}
.ledger td:nth-child(2) { color: var(--scale); }
.ledger td:nth-child(3) { white-space: nowrap; }
.ledger td:last-child, .ledger th:last-child {
  padding-right: 0;
  white-space: nowrap;
  color: var(--scale);
  font-variant-numeric: tabular-nums;
}

/* Method */
.containment {
  margin-top: clamp(2rem, 4vw, 3rem);
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) 7rem minmax(0, 1.3fr) 6rem minmax(0, 1fr);
  align-items: stretch;
}
.box {
  border: 1px solid var(--seam);
  border-radius: 4px;
  background: var(--plate);
  padding: 1.1rem 1.25rem 1.2rem;
}
.box-vm { border-color: var(--blue); }
.box-title { font-family: var(--display); font-weight: 600; font-size: 1.15rem; }
.box-text { margin-top: 0.35rem; font-size: 1rem; color: var(--scale); line-height: 1.5; }
.link {
  position: relative;
  display: grid;
  place-items: center;
  font-size: 0.9rem;
  color: var(--scale);
}
.link::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  border-top: 1px solid var(--scale);
}
.link span {
  position: relative;
  background: var(--quench);
  padding-inline: 0.5rem;
  white-space: nowrap;
}
.blocked {
  grid-column: 1 / -1;
  margin-top: 1rem;
  padding-left: 1rem;
  border-left: 3px solid var(--heat);
  color: var(--scale);
  font-size: 1rem;
}

.steps {
  margin-top: clamp(2.5rem, 5vw, 4rem);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 2.25rem 3rem;
  counter-reset: step;
}
.steps li { counter-increment: step; border-top: 1px solid var(--seam); padding-top: 1.1rem; }
.steps h3::before {
  content: counter(step) ". ";
  color: var(--straw);
}
.steps p { margin-top: 0.5rem; color: var(--scale); font-size: 1.05rem; }

/* Contact and footer */
.elsewhere {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.75rem;
}
.site-footer {
  border-top: 1px solid var(--seam);
  padding-block: 2.25rem 3rem;
  font-size: 0.95rem;
  color: var(--scale);
}
.site-footer p + p { margin-top: 0.5rem; }

/* Not found */
.lost { padding-block: clamp(4rem, 14vw, 10rem); }
.lost p { margin-top: 1.25rem; color: var(--scale); max-width: 34rem; }

@media (min-width: 62rem) {
  .spine { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: start; }
  .hero-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 25rem); align-items: end; }
  .hero-side { padding-bottom: 0.6rem; }
  .spine > h2 { position: sticky; top: 2.5rem; }
  .instrument { display: grid; grid-template-columns: 19rem minmax(0, 1fr); }
  .inst-side { border-bottom: 0; border-right: 1px solid var(--seam); }
  .log { grid-column: 1 / -1; }
  .bench-head { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: end; }
}

@media (max-width: 61.99rem) {
  .containment { grid-template-columns: 1fr; }
  .link { height: 3rem; justify-items: start; padding-left: 2rem; }
  .link::before {
    left: 1.25rem;
    right: auto;
    top: 0;
    bottom: 0;
    border-top: 0;
    border-left: 1px solid var(--scale);
  }
  .pace { grid-template-columns: auto minmax(0, 1fr) auto; }
  .pace-slider { grid-column: 1 / -1; grid-row: 2; }
  .pace-out { text-align: left; min-width: 0; white-space: nowrap; }
}

@media (max-width: 44rem) {
  body { font-size: 1.0625rem; }
  .log { font-size: 0.78rem; }
  .site-header nav { gap: 0.2rem 1.1rem; font-size: 0.95rem; }
  .pace { grid-template-columns: auto minmax(0, 1fr); }
  .pace-out { text-align: right; }
  .pace .ghost { grid-column: 1 / -1; grid-row: 3; justify-self: start; }

  .ledger thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .ledger, .ledger tbody, .ledger tr, .ledger th, .ledger td { display: block; }
  .ledger tr { border-top: 1px solid var(--seam); padding-block: 1rem; }
  .ledger th, .ledger td { border: 0; padding: 0; white-space: normal; }
  .ledger td { margin-top: 0.3rem; }
  .ledger td:nth-child(3), .ledger td:last-child { display: inline-block; margin-right: 1rem; }
}

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