/* tally.css — the counting door.
   The door CSP forbids inline scripts, so the logic lives in tally.js and the
   styling lives here. Nothing is fetched from anywhere. */

:root {
  --paper: #f1e8d3;
  --ink: #1d2b2a;
  --green: #2f5d50;
  --chalk: #d9cdae;
  --door: #2d4a6b;
  --rule: #cbbb98;
}

* { box-sizing: border-box; }

body {
  max-width: 40rem;
  margin: 0 auto;
  padding: 2.5rem 1.2rem 3rem;
  background: var(--paper);
  color: var(--ink);
  font: 1.05rem/1.65 Georgia, "Iowan Old Style", serif;
}

.masthead {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--rule);
  padding-bottom: .6rem;
  margin-bottom: 2.2rem;
  font: .78rem/1.4 ui-monospace, Menlo, Consolas, monospace;
  letter-spacing: .06em;
}

.masthead a { color: var(--green); text-decoration: none; }
.masthead a:hover { text-decoration: underline; }
.imprint { color: #6c6252; }

.eyebrow {
  font: .78rem/1.4 ui-monospace, Menlo, Consolas, monospace;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #6c6252;
  margin: 0 0 .5rem;
}

h1 {
  font-size: clamp(2.6rem, 9vw, 4.2rem);
  line-height: 1;
  margin: 0 0 .7rem;
  letter-spacing: -.02em;
  color: var(--door);
}

.lede {
  font-size: 1.15rem;
  line-height: 1.5;
  color: #3c4a45;
  margin: 0 0 2rem;
  font-style: italic;
}

h2 {
  font: 700 .82rem ui-monospace, Menlo, Consolas, monospace;
  text-transform: uppercase;
  letter-spacing: .14em;
  margin: 2.6rem 0 .8rem;
  padding-bottom: .4rem;
  border-bottom: 2px solid var(--ink);
}

.prose p { margin: 0 0 1.05rem; }
.prose b { color: #16241f; }

.mono {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: .92em;
  background: #e6dcc4;
  padding: .05em .3em;
  border-radius: 3px;
}

blockquote {
  margin: 1.4rem 0 1.4rem 0;
  padding: .2rem 0 .2rem 1.1rem;
  border-left: 3px solid var(--green);
  color: #33413c;
  font-style: italic;
}
blockquote p { margin: 0; }

.closing { margin-top: 2.2rem; }
.quiet {
  font-size: .92rem;
  color: #6c6252;
  border-top: 1px solid var(--rule);
  padding-top: 1rem;
}

/* ---- the counting board ---- */

.counter-note {
  font-size: .98rem;
  color: #4a564f;
  margin: 0 0 1rem;
}

.board {
  display: block;
  width: 100%;
  min-height: 13rem;
  padding: 1.4rem 1.2rem;
  background: var(--door);
  border: 0;
  border-radius: 4px;
  cursor: pointer;
  font: inherit;
  color: var(--chalk);
  box-shadow: inset 0 0 0 2px rgba(0,0,0,.28), 0 1px 0 #b8ab8c;
  overflow-wrap: break-word;
  word-break: break-word;
}
.board:hover { background: #35577e; }
.board:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; }
.board:active { transform: translateY(1px); }

/* Each stroke is a thin chalk line; every fifth group gets the diagonal. */
.strokes { display: flex; flex-wrap: wrap; gap: .55rem .45rem; align-items: flex-end; }
.group { display: inline-flex; gap: .28rem; align-items: flex-end; }
.group .v {
  width: 3px;
  height: 2.4rem;
  background: var(--chalk);
  border-radius: 1px;
  opacity: .92;
}
.group.crossed { position: relative; }
.group.crossed::after {
  content: "";
  position: absolute;
  left: -2px;
  right: -2px;
  top: 50%;
  height: 2px;
  background: var(--chalk);
  transform: rotate(-22deg);
  opacity: .92;
}
.group.partial .v { height: 1.7rem; opacity: .62; }

.readout {
  font: 700 1.6rem/1 ui-monospace, Menlo, Consolas, monospace;
  color: var(--door);
  margin: 1rem 0 .4rem;
}
.readout .unit {
  font-size: .8rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #6c6252;
  font-weight: 400;
}
.counter-foot { font-size: .9rem; color: #6c6252; margin: 0; }

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

footer {
  margin-top: 3rem;
  padding-top: .8rem;
  border-top: 1px solid var(--rule);
  font: .82rem ui-monospace, Menlo, Consolas, monospace;
}
footer a { color: var(--green); }
