/* hazync.org
 *
 * Fog and ink. Proven blocks are drawn in solid ink; everything not yet proven sits in the haze.
 * The one warm colour, the lamp, marks the live edge of the proof and nothing else (plus focus).
 */

@font-face {
  font-family: "Schibsted Grotesk";
  src: url("/fonts/schibsted.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Schibsted Grotesk";
  src: url("/fonts/schibsted-italic.woff2") format("woff2");
  font-weight: 400 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Spline Sans Mono";
  src: url("/fonts/spline-mono.woff2") format("woff2");
  font-weight: 400 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --fog: #e3e7ea;      /* page ground */
  --mist: #f0f2f4;     /* raised surfaces */
  --ink: #16212b;      /* text, proven blocks */
  --slate: #52606b;    /* secondary text */
  --haze: #c3cbd2;     /* unproven chain, rules */
  --haze-2: #d3d9de;   /* lighter rule */
  --lamp: #c46a0c;     /* the live frontier */
  --lamp-text: #8f4c06;
  --good: #1f6b4f;
  --bad: #9b2c2c;

  --sans: "Schibsted Grotesk", "Helvetica Neue", Arial, system-ui, sans-serif;
  --mono: "Spline Sans Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --measure: 66ch;
  --wide: 76rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);

  color-scheme: light;
}

/* Light by default, whatever the system prefers; dark only when chosen with the header button. */
:root[data-theme="dark"] {
  --fog: #111a21;
  --mist: #18232c;
  --ink: #e1e6ea;
  --slate: #93a0aa;
  --haze: #2d3a44;
  --haze-2: #24303a;
  --lamp: #e89b3c;
  --lamp-text: #efae5c;
  --good: #6cc49c;
  --bad: #ef8a8a;
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  background: var(--fog);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

img, svg { max-width: 100%; }

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: var(--slate);
}
a:hover { text-decoration-color: currentColor; text-decoration-thickness: 2px; }

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

code, kbd, samp, .mono {
  font-family: var(--mono);
  font-size: 0.86em;
  font-variant-ligatures: none;
}

.num { white-space: nowrap; }

/* ---------- frame ---------- */

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

.skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: var(--fog);
  padding: 0.5rem 1rem;
  z-index: 10;
}
.skip:focus { left: 1rem; }

.site-head {
  padding-block: 1.25rem;
}
.site-head .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 2rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  text-decoration: none;
}
.wordmark svg { width: 1.9rem; height: 0.6rem; flex: none; }

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.97rem;
}
.site-nav a { text-decoration: none; color: var(--slate); }
.site-nav a:hover { color: var(--ink); }
.site-nav { margin-left: auto; }

.theme-toggle {
  align-self: center;
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  margin-block: -0.45rem;
  padding: 0;
  border: 1px solid var(--haze);
  border-radius: 50%;
  background: transparent;
  color: var(--slate);
  cursor: pointer;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--slate); }
.theme-toggle svg { width: 1rem; height: 1rem; }

/* Narrow screens: the wordmark and the toggle share the top row, the nav takes the row below. */
@media (max-width: 48rem) {
  .theme-toggle { order: 1; }
  .site-nav { order: 2; flex-basis: 100%; margin-left: 0; }
}
.site-nav a[aria-current="page"] {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.35em;
}

main { display: block; }

.site-foot {
  margin-top: clamp(4rem, 10vw, 8rem);
  padding-block: 2.5rem 3rem;
  border-top: 1px solid var(--haze);
  color: var(--slate);
  font-size: 0.93rem;
}
.site-foot .wrap {
  display: grid;
  gap: 0.6rem 3rem;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
}
.site-foot p { margin: 0; max-width: 44ch; }
.fingerprint { font-family: var(--mono); font-size: 0.82rem; word-spacing: 0.1em; }

/* ---------- type ---------- */

h1, h2, h3 {
  font-weight: 750;
  letter-spacing: -0.022em;
  line-height: 1.08;
  margin: 0;
  text-wrap: balance;
}

.display {
  font-size: clamp(2.4rem, 6.4vw, 5rem);
  font-weight: 780;
  letter-spacing: -0.038em;
  line-height: 0.98;
  max-width: 19ch;
}

.page-title {
  font-size: clamp(2.1rem, 5vw, 3.6rem);
  letter-spacing: -0.032em;
  line-height: 1;
  max-width: 20ch;
}

h2 {
  font-size: clamp(1.55rem, 3vw, 2.15rem);
}
h3 {
  font-size: 1.2rem;
  letter-spacing: -0.012em;
  line-height: 1.25;
}

.lede {
  font-size: clamp(1.12rem, 1.8vw, 1.3rem);
  line-height: 1.5;
  max-width: 56ch;
  margin: 1.5rem 0 0;
}

.prose { max-width: var(--measure); }
.prose p, .prose ul, .prose ol { margin: 0 0 1rem; }
.prose > :last-child { margin-bottom: 0; }
.prose li { margin-bottom: 0.4rem; }
.prose ul, .prose ol { padding-left: 1.25rem; }

.muted { color: var(--slate); }

/* A figure's provenance: how it was obtained, and where it is recorded. */
.src {
  display: block;
  margin-top: 0.3rem;
  color: var(--slate);
  font-size: 0.86rem;
  line-height: 1.45;
}

/* ---------- sections ---------- */

.section {
  margin-top: clamp(4rem, 9vw, 7rem);
}
.section-head {
  display: grid;
  align-content: start;
  gap: 0.75rem;
  margin-bottom: 2rem;
  max-width: var(--measure);
}
.section-head p { margin: 0; color: var(--slate); }

.page-intro {
  padding-top: clamp(2.5rem, 7vw, 5rem);
}
.page-intro .lede { color: var(--ink); }

/* two-column: heading on the left, content on the right, on wide screens */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem 3rem;
  align-items: start;
}
.split > .section-head { margin-bottom: 0; }
@media (min-width: 62rem) {
  .split { grid-template-columns: 17rem minmax(0, 1fr); }
  .split > .section-head { position: sticky; top: 1.5rem; }
}

/* ---------- buttons ---------- */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.9rem;
  padding: 0.6rem 1.25rem;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: var(--fog);
  font: inherit;
  font-weight: 600;
  font-size: 0.98rem;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: transparent; color: var(--ink); }
.btn.quiet { background: transparent; color: var(--ink); }
.btn.quiet:hover { background: var(--ink); color: var(--fog); }
.btn[disabled] { opacity: 0.45; cursor: progress; }

/* ---------- the chain ribbon ---------- */

.chain {
  margin-top: clamp(2.5rem, 6vw, 4rem);
}

.chain-frame {
  position: relative;
  padding-top: 2.6rem;      /* room for the frontier flag */
  padding-bottom: 2.4rem;   /* room for era labels */
}

.ribbon {
  position: relative;
  display: flex;
  height: clamp(2.75rem, 7vw, 4.5rem);
  background: var(--haze);
  overflow: hidden;
}
.ribbon .cell { flex: 1 1 0; min-width: 0; }
.ribbon .cell[data-s="3"] { background: var(--ink); }
.ribbon .cell[data-s="2"] { background: color-mix(in srgb, var(--ink) 55%, var(--haze)); }
.ribbon .cell[data-s="1"] {
  background: repeating-linear-gradient(90deg, var(--lamp) 0 1px, transparent 1px 3px);
}
.ribbon.interactive .cell { cursor: pointer; }
.ribbon.interactive .cell:hover { box-shadow: inset 0 0 0 2px var(--lamp); }

/* the solid proven run, drawn over the cells so it can animate once on load */
.ribbon .proven {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--proven, 0%);
  background: var(--ink);
  transform-origin: left;
  pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
  .ribbon .proven.draw { animation: draw 1.6s cubic-bezier(.2,.7,.1,1) both; }
}
@keyframes draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.flag {
  position: absolute;
  top: 0;
  bottom: 2.4rem;
  left: var(--at, 0%);
  border-left: 2px solid var(--lamp);
  pointer-events: none;
}
.flag span {
  position: absolute;
  top: 0;
  left: 0.45rem;
  white-space: nowrap;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--lamp-text);
}

.eras {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.8rem;
  color: var(--slate);
}
.eras li {
  position: absolute;
  top: 0;
  left: var(--at);
  padding-top: 0.55rem;
  padding-left: 0.3rem;
  border-left: 1px solid var(--slate);
  white-space: nowrap;
  line-height: 1.2;
}
.eras li.end { left: auto; right: 0; border-left: 0; border-right: 1px solid var(--slate); padding-left: 0; padding-right: 0.3rem; }
@media (max-width: 40rem) {
  .eras li.minor { display: none; }
}

.chain-caption {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.4rem 2rem;
  font-size: 1.02rem;
}
.chain-caption strong { font-weight: 700; }
.chain-caption .muted { font-size: 0.92rem; }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.4rem;
  margin: 0.9rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.88rem;
  color: var(--slate);
}
.legend li { display: inline-flex; align-items: center; gap: 0.45rem; }
.swatch { width: 0.9rem; height: 0.9rem; flex: none; }
.swatch.s3 { background: var(--ink); }
.swatch.s2 { background: color-mix(in srgb, var(--ink) 55%, var(--haze)); }
.swatch.s1 { background: repeating-linear-gradient(90deg, var(--lamp) 0 1px, var(--haze) 1px 3px); }
.swatch.s0 { background: var(--haze); outline: 1px solid var(--haze-2); }

/* ---------- lists that carry status ---------- */

.status-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--haze);
}
.status-list > li {
  display: grid;
  grid-template-columns: 3rem 1fr;
  gap: 0.25rem 1rem;
  padding-block: 1.15rem;
  border-bottom: 1px solid var(--haze);
}
@media (min-width: 48rem) {
  .status-list > li { grid-template-columns: 3rem minmax(0, 1fr) 13rem; }
}
.status-list .key {
  font-weight: 700;
  color: var(--slate);

}
.status-list h3 { font-size: 1.08rem; margin-bottom: 0.2rem; }
.status-list p { margin: 0; color: var(--slate); max-width: 60ch; }
.status-list .state {
  grid-column: 2;
  font-size: 0.93rem;
  font-weight: 600;
}
@media (min-width: 48rem) {
  .status-list .state { grid-column: 3; grid-row: 1; text-align: right; }
}

/* state marks: filled = met, half = partly, ring = open */
.mark {
  display: inline-block;
  width: 0.72rem;
  height: 0.72rem;
  margin-right: 0.45rem;
  border-radius: 50%;
  vertical-align: 0.02em;
  border: 1.5px solid var(--ink);
}
.mark.met { background: var(--ink); }
.mark.part { background: linear-gradient(90deg, var(--ink) 50%, transparent 50%); }
.mark.open { background: transparent; }
.mark.live { background: var(--lamp); border-color: var(--lamp); }

/* ---------- roadmap ---------- */

.road {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
  position: relative;
}
.road > li {
  position: relative;
  padding: 0 0 2rem 2.4rem;
  max-width: var(--measure);
}
.road > li::before {
  /* the spine of the roadmap: solid where done, hazy where not */
  content: "";
  position: absolute;
  left: 0.52rem;
  top: 0.35rem;
  bottom: -0.35rem;
  width: 2px;
  background: var(--haze);
}
.road > li.done::before { background: var(--ink); }
.road > li:last-child::before { display: none; }
.road > li > .mark {
  position: absolute;
  left: 0;
  top: 0.32rem;
  width: 1.1rem;
  height: 1.1rem;
  margin: 0;
  background: var(--fog);
}
.road > li.done > .mark { background: var(--ink); }
.road > li.now > .mark { background: var(--lamp); border-color: var(--lamp); }
.road h3 { font-size: 1.1rem; }
.road .when {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--slate);
  margin: 0.1rem 0 0.35rem;
}
.road p { margin: 0; color: var(--slate); }

/* ---------- plain panels ---------- */

.panel {
  background: var(--mist);
  padding: clamp(1.1rem, 3vw, 1.75rem);
}

.facts {
  display: grid;
  gap: 1.5rem clamp(1.25rem, 3vw, 2.5rem);
  grid-template-columns: repeat(auto-fit, minmax(min(10rem, 40%), 1fr));
  margin: 0;
}
.facts div { min-width: 0; }
.facts dt { color: var(--slate); font-size: 0.9rem; }
.facts dd {
  margin: 0.15rem 0 0;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 720;
  letter-spacing: -0.02em;

  line-height: 1.1;
}

/* long identifiers: method ids, hashes, commands */
.hash {
  font-family: var(--mono);
  font-size: 0.84rem;
  overflow-wrap: anywhere;
  word-break: break-all;
  line-height: 1.5;
}

pre, .cmd {
  margin: 0 0 1rem;
  padding: 0.9rem 1.1rem;
  background: var(--mist);
  border-left: 3px solid var(--ink);
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.86rem;
  line-height: 1.6;
}
pre code { font-size: inherit; }

.note {
  margin: 1.5rem 0 0;
  padding: 0.9rem 1.1rem;
  border-left: 3px solid var(--lamp);
  background: var(--mist);
  max-width: var(--measure);
}
.note p { margin: 0; }
.note p + p { margin-top: 0.5rem; }

/* ---------- ways to help (contribute page) ---------- */

.way {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem 3rem;
  padding-block: clamp(2rem, 5vw, 3rem);
  border-top: 1px solid var(--haze);
}
@media (min-width: 62rem) {
  .way { grid-template-columns: 17rem minmax(0, 1fr); }
}
.way h2 { font-size: clamp(1.4rem, 2.6vw, 1.85rem); }
.way .need { margin: 0.6rem 0 0; color: var(--slate); font-size: 0.95rem; max-width: 30ch; }

.checklist {
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
  counter-reset: item;
}
.checklist > li {
  counter-increment: item;
  position: relative;
  padding: 0 0 0.9rem 2.2rem;
}
.checklist > li::before {
  content: counter(item);
  position: absolute;
  left: 0;
  top: 0;
  width: 1.5rem;
  font-weight: 700;
  color: var(--slate);

}

.todo {
  outline: 2px dashed var(--lamp);
  outline-offset: 4px;
}

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

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

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

.status-list.help-list > li { grid-template-columns: minmax(0, 1fr); }
.help-list h3 a { text-decoration-thickness: 1.5px; }

@media (max-width: 30rem) {
  .site-nav ul { gap: 0.25rem 1rem; font-size: 0.92rem; }
}
@media (max-width: 30rem) {
  .site-nav li.ext { display: none; }
}

/* ---------- diagrams and numbered steps (how it works) ---------- */

.diagram { margin: 0 0 2.5rem; }
.diagram-scroll { overflow-x: auto; padding-bottom: 0.5rem; }
.diagram svg { display: block; width: 100%; min-width: 46rem; height: auto; }
.diagram text { white-space: pre; }

.steps { counter-reset: step; }
.steps > li { counter-increment: step; }
.steps > li::before { background: var(--ink); }
.steps > li::after {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.05rem;
  width: 1.15rem;
  height: 1.15rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: var(--fog);
  font-size: 0.72rem;
  font-weight: 700;
}
@media (min-width: 62rem) {
  .steps { display: grid; grid-template-columns: 1fr 1fr; column-gap: 3rem; }
  .steps > li::before { display: none; }
}

/* ---------- achieved: a dated ledger ---------- */

.ledger {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--haze);
}
.ledger > li {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.15rem 1.5rem;
  padding-block: 1rem;
  border-bottom: 1px solid var(--haze);
}
@media (min-width: 48rem) {
  .ledger > li { grid-template-columns: 9.5rem minmax(0, 1fr); }
}
.ledger .date {
  margin: 0;
  padding-top: 0.1rem;
  color: var(--slate);
  font-size: 0.93rem;
  font-weight: 600;
}
.ledger h3 { font-size: 1.08rem; margin-bottom: 0.2rem; }
.ledger p { margin: 0; color: var(--slate); max-width: 62ch; }
.ledger .src { margin-top: 0.35rem; }

/* ---------- questions ---------- */

.faq { max-width: var(--measure); border-top: 1px solid var(--haze); }
.faq details { border-bottom: 1px solid var(--haze); }
.faq summary {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1rem;
  font-weight: 650;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--slate); font-weight: 400; font-size: 1.25rem; line-height: 1; }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { margin: 0 0 1.1rem; color: var(--slate); }

.contact { font-weight: 650; font-size: 1.15em; }
