/* The front page: what only it needs on top of the shared template (aeu.css) and the crowd's
   styles (the-average-user/piece.css). Vermilion is an intentional accent here: the primary
   button, the ≠ diagonal, the marginal user, and the visitor's mark and score in the game. */

.home { --red-hover: #ff5a3c; }

/* ---------- buttons on the board ---------- */

.btn { text-decoration: none; gap: 0.6rem; }
.btn-red { background: var(--bermellon); color: var(--ink-on-red); font-weight: 600; }
.btn-red:hover { background: var(--red-hover); }
.btn-red svg { width: 1rem; height: 1rem; transition: transform 0.2s var(--ease-out); }
.btn-red:hover svg { transform: translateX(3px); }
.btn:focus-visible { outline: 2px solid var(--tiza); outline-offset: 3px; }
.btn:disabled { opacity: 0.4; cursor: default; }

/* ---------- the hero: a full-bleed chalkboard, closed by the numeral edge ---------- */

.hero {
  position: relative;
  padding: 0 0 clamp(2rem, 5vw, 3.5rem);
  margin-bottom: calc(var(--stip) + clamp(2.5rem, 6vw, 4.5rem));
}
.hero .strip { border-bottom-color: var(--board-rule); }
.hero .brand { color: var(--tiza); }
.hero .brand:hover { text-decoration: none; }
.hero .strip-meta { gap: clamp(0.9rem, 2.2vw, 1.75rem); }
.hero .strip-meta a { color: var(--tiza); text-decoration: none; }
.hero .strip-meta a:hover { text-decoration: underline; text-decoration-color: var(--chalk-dim); }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
  padding-top: clamp(2.25rem, 5vw, 4rem);
}
.hero h1 {
  margin: 0;
  max-width: 9.5em;
  font-weight: 500;
  font-size: var(--fs-display);
  line-height: 0.98;
  letter-spacing: -0.028em;
  text-wrap: balance;
}
.hero-sub {
  margin: clamp(1.1rem, 2.5vw, 1.6rem) 0 0;
  max-width: 21em;
  font-size: var(--fs-dek);
  line-height: 1.3;
  color: var(--chalk-dim);
  text-wrap: pretty;
}
.hero-sub strong { color: var(--tiza); font-weight: 600; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: clamp(1.5rem, 3vw, 2.25rem); }
.hero-actions .btn { min-height: 50px; padding-inline: 1.3rem; font-size: var(--fs-caption); }
.hero-site {
  margin: clamp(1.75rem, 3.5vw, 2.5rem) 0 0;
  max-width: 34em;
  font: 400 0.8125rem/1.6 var(--mono);
  color: var(--chalk-dim);
}

.hero-sub { max-width: 24em; }
.hero-by { margin: 1.1rem 0 0; font: 500 var(--fs-label)/1.4 var(--mono); color: var(--chalk-dim); }

/* ---------- the hero's switch: all else equal, or the data ---------- */

.ceteris { margin: 0; }
.ceteris-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 1.5rem; margin-bottom: 1rem; }
.ceteris-title { margin: 0; max-width: 22em; font-size: var(--fs-caption); line-height: 1.4; color: var(--tiza); text-wrap: balance; }
.switch {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--tiza);
  font: 500 var(--fs-caption)/1.1 var(--serif);
  text-align: left;
  cursor: pointer;
}
.switch-track {
  position: relative;
  flex: none;
  width: 48px;
  height: 26px;
  border: 1.5px solid var(--board-low);
  border-radius: 13px;
  background: var(--pizarra);
  transition: background-color 0.2s, border-color 0.2s;
}
.switch-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--chalk-dim);
  transition: transform 0.25s var(--ease-out), background-color 0.2s;
}
.switch[aria-checked="true"] .switch-track { background: var(--tiza); border-color: var(--tiza); }
.switch[aria-checked="true"] .switch-knob { transform: translateX(22px); background: var(--pizarra); }
.switch:focus-visible { outline: 2px solid var(--tiza); outline-offset: 4px; }
.switch-sub { display: block; margin-top: 0.2rem; font: 400 0.75rem/1.2 var(--mono); color: var(--chalk-dim); }

.ceteris-chart .step { fill: none; stroke: var(--tiza); stroke-width: 2; stroke-linejoin: miter; transition: opacity 0.4s, stroke 0.4s; }
.ceteris-chart .obs { fill: none; stroke: var(--tiza); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ceteris-chart .dot { fill: var(--tiza); stroke: var(--pizarra); stroke-width: 2; transition: opacity 0.2s; }
.ceteris-chart .tail { fill: var(--bermellon); stroke: var(--pizarra); stroke-width: 2; transition: opacity 0.2s; }
.ceteris-chart .tail-label { transition: opacity 0.2s; }
.ceteris-chart:not(.is-equal) .step { opacity: 0.35; stroke: var(--chalk-dim); }
.ceteris-chart:not(.is-equal) .dot { transition-delay: 0.6s; }
.ceteris-chart:not(.is-equal) .tail,
.ceteris-chart:not(.is-equal) .tail-label { transition-delay: 0.95s; }
.ceteris-chart.is-equal .obs,
.ceteris-chart.is-equal .dot,
.ceteris-chart.is-equal .tail,
.ceteris-chart.is-equal .tail-label { opacity: 0; }
.ceteris-caption { margin: 1rem 0 0; min-height: 4.2em; max-width: 34em; font-size: var(--fs-caption); line-height: 1.5; color: var(--tiza); text-wrap: pretty; }
.ceteris-hint { margin: 0.6rem 0 0; font: 400 0.75rem/1.5 var(--mono); color: var(--chalk-dim); }
.ceteris-hint a { color: var(--tiza); }

/* ---------- why (paper): the manifesto ---------- */

.why-body p { margin: 0 0 1em; text-wrap: pretty; }
.why-lead { font-size: var(--fs-dek); line-height: 1.35; }

/* ---------- the latest essay (board) ---------- */

.latest {
  position: relative;
  margin: calc(var(--stip) + clamp(3rem, 7vw, 5rem)) 0;
  padding-block: clamp(2.25rem, 5vw, 4rem);
}
.latest-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(2rem, 5vw, 5rem); align-items: center; }
.latest h2 { margin: 0; font-weight: 500; font-size: var(--fs-headline); line-height: 1.08; letter-spacing: -0.018em; text-wrap: balance; }
.latest-no { display: inline-block; margin-right: 0.6em; font: 500 var(--fs-label)/1 var(--mono); letter-spacing: 0.04em; color: var(--chalk-dim); vertical-align: 0.4em; }
.latest-sub { margin: 1rem 0 0; max-width: 24em; font-size: var(--fs-dek); line-height: 1.3; color: var(--chalk-dim); text-wrap: pretty; }
.latest-sub strong { color: var(--tiza); font-weight: 600; }

/* ---------- the questions and teaching (paper) ---------- */

.questions .piece-q { margin: 0; font-size: var(--fs-title); font-weight: 500; line-height: 1.2; letter-spacing: -0.01em; text-wrap: balance; }
.questions .piece h3 { margin: 0.4rem 0 0; font-size: var(--fs-body); font-weight: 400; font-style: italic; letter-spacing: 0; }
.questions .piece h3.is-next { color: var(--pizarra-media); }
.questions .piece.is-open .piece-q { color: var(--pizarra-media); }
.questions .piece.is-open > .tag { color: var(--pizarra-media); }
.questions .piece .piece-meta { margin-top: 0.4rem; }

.teach-list { margin: 0 0 2rem; border-top: 1px solid var(--linea); }
.teach-list > div { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: 0.25rem 1.5rem; padding: 0.9rem 0; border-bottom: 1px solid var(--linea); }
.teach-list dt { padding-top: 0.25em; font: 500 var(--fs-label)/1.4 var(--mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--pizarra-media); }
.teach-list dd { margin: 0; font-size: var(--fs-caption); line-height: 1.5; }

.close-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 0.5rem; }
.close-actions .btn { min-height: 50px; padding-inline: 1.3rem; font-size: var(--fs-caption); }
.btn-ink { background: transparent; color: var(--pizarra); border-color: var(--pizarra); }
.btn-ink:hover { background: var(--pizarra); color: var(--tiza); }
.btn-ink:focus-visible { outline-color: var(--pizarra); }

.hero-figure { margin: 0; }
.hero-figure.crowd { grid-template-columns: minmax(0, 1fr); gap: 0.5rem; align-items: start; }
.hero-figure .crowd-stage { margin: -9% auto -6%; width: 100%; max-width: 36rem; }
.hero-figure .crowd-status { min-height: 0; margin-top: 1rem; }
.hero-figure .crowd-who { min-height: 1.5em; margin-top: 0.6rem; }
.hero-source { margin-top: 0.9rem; font: 400 0.75rem/1.5 var(--mono); color: var(--chalk-dim); }
.hero-source a { color: var(--tiza); }

/* ---------- how it works (paper) ---------- */

.how .essay h2,
.essays .essay h2 { margin-top: 0; }
.how-lead,
.how-plates { margin: 0 0 1.4rem; text-wrap: pretty; }
.how-lead { font-size: var(--fs-dek); line-height: 1.35; }
.how .layer b { font-weight: 600; font-style: normal; }
.how .layer + .layer { margin-top: 1.25rem; }
.how-plates { margin-top: 2.25rem; }
.how-credits { margin-top: 0; }

/* ---------- the game band ---------- */

.play {
  position: relative;
  margin: calc(var(--stip) + clamp(3rem, 7vw, 5rem)) 0;
  padding-block: clamp(2.25rem, 5vw, 4rem);
}
.play-grid {
  display: grid;
  grid-template-columns: minmax(13rem, 0.75fr) minmax(0, 2fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: start;
}
.play h2 {
  margin: 0;
  font-weight: 500;
  font-size: var(--fs-headline);
  line-height: 1;
  letter-spacing: -0.025em;
}
.play-intro { margin: 0.9rem 0 0; max-width: 18em; color: var(--chalk-dim); font-size: var(--fs-caption); line-height: 1.5; }
.score { display: flex; align-items: baseline; gap: 0.6rem; margin: clamp(1.75rem, 4vw, 2.75rem) 0 0; font-family: var(--mono); }
.score-label,
.score-of { font-size: 0.8125rem; color: var(--chalk-dim); }
.score output { font-size: var(--fs-figure); font-weight: 500; line-height: 1; letter-spacing: -0.03em; color: var(--bermellon); }
.pips { display: flex; gap: 0.5rem; margin: 1rem 0 0; padding: 0; list-style: none; }
.pips li { width: 11px; height: 11px; border-radius: 50%; border: 1.5px solid var(--board-low); }
.pips li.done { background: var(--tiza); border-color: var(--tiza); }
.pips li.now { border-color: var(--tiza); }
.best { margin: 1rem 0 0; font: 400 0.8125rem/1.4 var(--mono); color: var(--chalk-dim); }

.g-q {
  margin: 0;
  max-width: 24em;
  font-weight: 500;
  font-size: var(--fs-title);
  line-height: 1.15;
  letter-spacing: -0.012em;
  text-wrap: balance;
}
.g-n {
  display: inline-block;
  margin-right: 0.7em;
  font: 500 0.8125rem/1 var(--mono);
  letter-spacing: 0.04em;
  color: var(--chalk-dim);
  vertical-align: 0.35em;
}
.g-track { position: relative; margin-top: clamp(2.75rem, 5vw, 3.5rem); }
.g-marks { position: absolute; left: 11px; right: 11px; top: 0; height: 44px; pointer-events: none; }
.g-mark {
  position: absolute;
  top: 50%;
  width: 16px;
  height: 16px;
  border: 2px solid var(--pizarra);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
}
.g-mark.you { background: var(--bermellon); }
.g-mark.data { background: var(--tiza); transition: opacity 0.2s; }
.g-tag {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font: 500 0.8125rem/1 var(--mono);
  color: var(--tiza);
}
.g-mark.data .g-tag { bottom: calc(100% + 10px); }
.g-mark.you .g-tag { top: calc(100% + 10px); color: var(--chalk-dim); }
.g-chalk {
  position: absolute;
  top: calc(50% - 1px);
  height: 2px;
  background: var(--tiza);
  transform: scaleX(0);
  transition: transform 0.7s cubic-bezier(0.3, 0.7, 0.2, 1);
}
.revealed .g-mark { opacity: 1; }
.revealed .g-mark.data { transition-delay: 0.55s; }
.revealed .g-chalk { transform: scaleX(1); }
.revealed .range::-webkit-slider-thumb { opacity: 0; }
.revealed .range::-moz-range-thumb { opacity: 0; }
.g-ends { display: flex; justify-content: space-between; margin-top: 0.15rem; padding-inline: 2px; font: 400 0.75rem/1 var(--mono); color: var(--chalk-dim); }
.revealed .g-ends { margin-top: 1.9rem; }
.g-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; margin-top: 1.4rem; }
.g-val { min-width: 6ch; font: 500 var(--fs-figure)/1 var(--mono); letter-spacing: -0.02em; }
.g-result { margin: 1.6rem 0 0; font-size: var(--fs-body); line-height: 1.4; }
.g-result strong { font-weight: 600; }
.g-pts { font-family: var(--mono); font-weight: 500; white-space: nowrap; }
.g-note { margin: 0.6rem 0 0; max-width: 36em; color: var(--chalk-dim); font-size: var(--fs-caption); line-height: 1.5; text-wrap: pretty; }
.g-note a { color: var(--tiza); }
.g-next { margin-top: 1.4rem; }

.g-end h3 { margin: 0; font-weight: 500; font-size: var(--fs-headline); line-height: 1.1; letter-spacing: -0.015em; }
.g-recap { margin: 1.5rem 0 0; padding: 0; list-style: none; border-top: 1px solid var(--board-rule); }
.g-recap li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 0.25rem 1.25rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--board-rule);
  font-size: var(--fs-caption);
  line-height: 1.4;
}
.g-recap .mono { font-size: 0.8125rem; color: var(--chalk-dim); white-space: nowrap; }
.g-recap .pts { color: var(--tiza); font-weight: 500; text-align: right; min-width: 3.5ch; }
.g-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }
.g-share { margin: 1rem 0 0; padding: 0.8rem 1rem; border: 1px solid var(--board-low); font: 400 0.8125rem/1.5 var(--mono); user-select: all; }

/* ---------- essays (paper) ---------- */

.piece { margin-top: 0; padding-block: 1.4rem; border-top: 1px solid var(--linea); }
.piece:last-child { border-bottom: 1px solid var(--linea); }
.piece > .tag { padding-top: 0.75em; color: var(--pizarra); }
.piece > .tag::after { display: none; }
.piece h3 { margin: 0; font-weight: 500; font-size: var(--fs-title); line-height: 1.15; letter-spacing: -0.012em; }
.piece h3 a { text-decoration: none; }
.piece h3 a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.15em; }
.piece .piece-dek { margin: 0.4rem 0 0; font-style: italic; color: var(--pizarra-media); }
.piece .piece-meta { margin: 0.6rem 0 0; font: 400 0.8125rem/1.5 var(--mono); color: var(--pizarra-media); }
.piece.is-next h3 { color: var(--pizarra-media); }
.piece.is-next > .tag { color: var(--pizarra-media); }

.home .foot { margin-top: clamp(3rem, 7vw, 5rem); }

/* ---------- narrow screens ---------- */

@media (max-width: 999px) {
  .hero-grid,
  .latest-grid { grid-template-columns: minmax(0, 1fr); }
  .teach-list > div { grid-template-columns: minmax(0, 1fr); }
  .hero-figure .crowd-stage { margin: -6% auto -4%; max-width: 30rem; }
  .play-grid { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
}
@media (max-width: 599px) {
  .hero .strip { flex-wrap: wrap; row-gap: 0.75rem; padding-block: 0.9rem; }
  .hero .strip-meta { width: 100%; justify-content: space-between; }
  .g-recap li { grid-template-columns: minmax(0, 1fr) auto; }
  .g-recap li .you-v { display: none; }
}
@media (max-width: 899px) {
  .piece { padding-block: 1.1rem; }
  .piece > .tag { padding-top: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .g-chalk,
  .g-mark.data { transition: none !important; }
}
