/* Fonts are served from here, not from Google, so visitors' addresses don't go to a third party.
   Newsreader and JetBrains Mono, latin and latin-ext, under the SIL Open Font License (public/fonts/OFL-*.txt). */

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("/fonts/jetbrains-mono-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("/fonts/jetbrains-mono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Newsreader";
  font-style: italic;
  font-weight: 300 600;
  font-display: swap;
  src: url("/fonts/newsreader-italic-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Newsreader";
  font-style: italic;
  font-weight: 300 600;
  font-display: swap;
  src: url("/fonts/newsreader-italic-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url("/fonts/newsreader-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url("/fonts/newsreader-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ninebits.today: the front page is a 9.
   Colours, type and the bit come straight from the brand book (design/brand.html, plate 8). */

:root {
  --press: #111210;
  --press-raised: #1a1b18;
  --newsprint: #edece4;
  --newsprint-sunk: #e1e0d6;
  --marker: #dfff3a;
  --marker-ink: #586400;
  --wire: #8c8f88;
  --wire-ink: #575a53;
  --off: #262724;
  --off-paper: #d6d5cb;

  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --ease: cubic-bezier(.7, 0, .2, 1);
  --gap: 8px;

  /* press, the default */
  --bg: var(--press);
  --raised: var(--press-raised);
  --raised-hover: #1f201d;
  --sheet: #151613;
  --fg: var(--newsprint);
  --fg-2: #c3c2b9;
  --soft: var(--wire);
  --line: rgba(237, 236, 228, .12);
  --line-strong: rgba(237, 236, 228, .28);
  --dash: rgba(237, 236, 228, .2);
  --bit-off: var(--off);
  --accent-text: var(--marker);
  --tail: var(--marker);
  --hl: var(--marker);
  --hl-fg: var(--press);
  /* on press, any part of a letter outside the band is dark on dark and disappears,
     so the band covers ascenders to descenders with a little room above and below */
  --hl-pad: .08em;
  --hl-y: 0%;
  --hl-h: 100%;
  --dot: var(--marker);
  --dot-hl: transparent;
  --ph: var(--marker);
  /* the history reel's playhead */

  color-scheme: dark;
}

/* newsprint: marker can't be read on paper, so it moves behind the words */
:root[data-theme="paper"] {
  --bg: var(--newsprint);
  --raised: #f6f5ef;
  --raised-hover: #fbfaf6;
  --sheet: #f3f2eb;
  --fg: var(--press);
  --fg-2: #3c3d38;
  --soft: var(--wire-ink);
  --line: rgba(17, 18, 16, .13);
  --line-strong: rgba(17, 18, 16, .3);
  --dash: rgba(17, 18, 16, .25);
  --bit-off: var(--off-paper);
  --accent-text: var(--marker-ink);
  --tail: var(--marker-ink);
  /* a highlighter stroke through the middle of the words */
  --hl-pad: 0;
  --hl-y: 62%;
  --hl-h: 76%;
  --dot: var(--press);
  --dot-hl: var(--marker);
  --ph: var(--press);

  color-scheme: light;
}

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

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 13px/1.5 var(--mono);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd,
figure {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

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

:root[data-theme="paper"] :focus-visible {
  outline-color: var(--press);
  box-shadow: 0 0 0 4px var(--marker);
}

svg {
  display: block;
}

.label {
  color: var(--soft);
  font: 500 10.5px/1.2 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* ---------- the bit ---------- */

/* each story wears the 9 with its own bit lit */
.pip {
  height: 12px;
  width: auto;
  flex: none;
  overflow: visible;
}

.pip rect {
  fill: var(--fg);
}

.pip .off {
  opacity: .26;
}

.pip .on.t {
  fill: var(--tail);
}

/* a date code: the lit bits add up to the day of the year */
.dm rect {
  transform-box: fill-box;
  transform-origin: 50% 50%;
}

.dm .on {
  fill: var(--fg);
}

.dm .on.t {
  fill: var(--tail);
}

.dm .off {
  fill: var(--bit-off);
}

.wm {
  font-family: var(--serif);
  font-weight: 480;
  line-height: 1;
  letter-spacing: -.02em;
  white-space: nowrap;
}

.wm em {
  font-style: italic;
  font-weight: 400;
  letter-spacing: -.01em;
}

.wm a {
  text-decoration: none;
}

.dot {
  display: inline-block;
  width: .17em;
  height: .17em;
  margin: 0 .07em 0 .06em;
  background: var(--dot);
  box-shadow: 0 0 0 .045em var(--dot-hl);
}

/* ---------- the front page ---------- */

.front {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(4, minmax(0, 1fr));
  grid-template-areas:
    "s1 s2 s3"
    "s4 day s5"
    "s6 s7 s8"
    "mast mast s9";
  gap: var(--gap);
  height: 100dvh;
  padding: clamp(10px, 2vw, 28px);
}

/* the footer's row is min-content, not auto: .fp-src clips (for its ellipsis), and a
   clipping item in an auto row lets the row shrink and cut the footer in half instead
   of letting the tile overflow, which is what tells fit() to shrink the headline */
.fp-story {
  position: relative;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) min-content;
  gap: clamp(10px, 1.5vh, 16px);
  min-width: 0;
  min-height: 0;
  padding: clamp(14px, 1.25vw, 24px) clamp(16px, 1.35vw, 26px) clamp(12px, 1.1vw, 20px);
  overflow: hidden;
  border-radius: 3px;
  background: var(--raised);
  transition: background .2s;
}

/* one column, everything pinned to it: on hover the reason spans rows 3–4 over the
   footer, and an unpinned row would be pushed into a new column that steals the
   headline's width and rewraps it */
.fp-story>* {
  grid-column: 1;
}

.fp-story:hover {
  background: var(--raised-hover);
}

.fp-story:has(.fp-hed a:focus-visible) {
  outline: 2px solid var(--marker);
  outline-offset: 2px;
}

.fp-story--tail {
  box-shadow: inset 0 2px 0 var(--marker);
}

.fp-meta {
  grid-row: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding-right: 30px;
  color: var(--soft);
  font: 500 clamp(10.5px, .74vw, 12px)/1.2 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.fp-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.fp-hed {
  grid-row: 2;
  font: 450 calc(clamp(18px, min(1.7vw, 3vh), 32px) * var(--hs, 1))/1.15 var(--serif);
  letter-spacing: -.01em;
  text-wrap: pretty;
}

.fp-hed a {
  text-decoration: none;
}

/* the whole tile opens the story */
.fp-hed a::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* the reason it made the nine: hidden until you point at a story, then highlighted */
.fp-why {
  grid-row: 3;
  min-height: 0;
  overflow: hidden;
}

/* pointing at a story, the reason takes the footer's room too */
.fp-story:not(.is-read):hover .fp-why,
.fp-story:not(.is-read):focus-within .fp-why {
  grid-row: 3 / 5;
}

.fp-story:not(.is-read):hover .fp-src,
.fp-story:not(.is-read):focus-within .fp-src {
  opacity: 0;
}

.fp-why p {
  display: -webkit-box;
  overflow: hidden;
  color: var(--fg-2);
  font: 400 clamp(15px, 1.05vw, 18px)/1.4 var(--serif);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .3s, transform .45s var(--ease);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: var(--why-lines, 3);
}

.fp-why mark {
  padding: var(--hl-pad) .1em;
  margin: 0 -.1em;
  background: linear-gradient(var(--hl), var(--hl)) no-repeat 0 var(--hl-y) / 0% var(--hl-h);
  color: inherit;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  transition: background-size .6s var(--ease) .1s, color .2s .25s;
}

.fp-story:not(.is-read):hover .fp-why p,
.fp-story:not(.is-read):focus-within .fp-why p {
  opacity: 1;
  transform: none;
}

.fp-story:not(.is-read):hover .fp-why mark,
.fp-story:not(.is-read):focus-within .fp-why mark {
  background-size: 100% var(--hl-h);
  color: var(--hl-fg);
}

.fp-src {
  grid-row: 4;
  min-width: 0;
  transition: opacity .2s;
  overflow: hidden;
  color: var(--soft);
  font: 400 clamp(11px, .78vw, 12.5px)/1.3 var(--mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* opens the details sheet; it takes the tile's own background, so it can sit over
   the end of a long meta line without moving anything */
.more {
  position: absolute;
  top: clamp(10px, 1vw, 18px);
  right: clamp(10px, 1vw, 18px);
  z-index: 2;
  display: grid;
  place-items: center;
  height: 26px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: inherit;
  color: var(--soft);
  font: 500 clamp(10px, .7vw, 11px)/1 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity .2s, color .2s, border-color .2s;
}

.fp-story:hover .more,
.fp-story:focus-within .more {
  opacity: 1;
}

/* a long meta line ends in an ellipsis before the button instead of under it */
.fp-story:hover .fp-meta,
.fp-story:focus-within .fp-meta {
  padding-right: 80px;
}

.more:hover {
  border-color: var(--line-strong);
  color: var(--fg);
}

@media (hover: none) {
  .more {
    opacity: 1;
  }

  .fp-meta {
    padding-right: 80px;
  }
}

/* read: its bit goes dark and the story steps back */
.fp-story.is-read .fp-hed {
  color: var(--soft);
  opacity: .7;
}

.fp-story.is-read .pip .on {
  opacity: .26;
}

.fp-story.is-read .fp-meta {
  opacity: .7;
}

.fp-story.is-new {
  animation: flip .5s var(--ease) both;
}

@keyframes flip {
  50% {
    transform: scaleY(0);
  }
}

/* the counter holds the date */
.fp-day {
  grid-area: day;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: clamp(10px, 1.6vh, 16px);
  min-height: 0;
  padding: 16px;
  border: 1px dashed var(--dash);
  border-radius: 3px;
  background: none;
  color: inherit;
  text-align: center;
  transition: opacity .5s .3s, border-color .2s;
}

button.fp-day:hover {
  border-color: var(--line-strong);
}

.fp-day svg {
  height: clamp(44px, 7.5vh, 78px);
  width: auto;
}

.fp-day b {
  font: 400 clamp(34px, min(3.3vw, 6.2vh), 64px)/1 var(--serif);
  letter-spacing: -.02em;
}

.fp-day span {
  color: var(--soft);
  font: 500 clamp(10.5px, .74vw, 12px)/1.2 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* the space under the bowl holds the masthead */
.fp-mast {
  grid-area: mast;
  display: grid;
  align-content: end;
  justify-items: start;
  gap: clamp(10px, 1.6vh, 16px);
  min-height: 0;
  padding: clamp(8px, 2vh, 20px) 8px 8px;
  transition: opacity .5s .3s;
}

/* --ws and the blurb's clamp come from fitMast(), on screens too short for all of it */
.fp-mast .wm {
  font-size: calc(clamp(34px, min(4.2vw, 8vh), 76px) * var(--ws, 1));
}

.fp-blurb {
  max-width: 50ch;
  color: var(--soft);
  font-size: clamp(12px, .82vw, 13.5px);
  line-height: 1.6;
}

.fp-blurb.is-wide {
  max-width: 80ch;
}

.fp-blurb.is-clamped {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: var(--blurb-lines);
}

.fp-blurb.is-cut {
  display: none;
}

.fp-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 0;
  color: var(--soft);
  font: 500 clamp(10.5px, .74vw, 12px)/1.2 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.fp-nav>*+*::before {
  content: "·";
  margin: 0 .8em;
  color: var(--soft);
  opacity: .6;
}

.fp-nav button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--soft);
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
}

.fp-nav button:hover {
  color: var(--fg);
}

.fp-nav .fp-count {
  color: var(--fg-2);
}

.fp-nav .accent {
  color: var(--accent-text);
}

/* tablets and phones: a list from 1 to 9 that still ends */
@media (max-width: 860px),
(max-height: 520px) {
  .front {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: none;
    grid-auto-rows: auto;
    grid-template-areas:
      "mast mast"
      "day s1"
      "s2 s3"
      "s4 s5"
      "s6 s7"
      "s8 s9";
    height: auto;
  }

  .fp-story {
    min-height: 190px;
  }

  .fp-why p {
    opacity: 1;
    transform: none;
  }

  .fp-story.is-read .fp-why p {
    opacity: .5;
  }

  .fp-mast {
    padding: 12px 4px 18px;
  }
}

@media (max-width: 600px) {
  .front {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "mast" "day" "s1" "s2" "s3" "s4" "s5" "s6" "s7" "s8" "s9";
  }

  .fp-story {
    min-height: 0;
  }

  .fp-day {
    grid-template-columns: auto auto;
    justify-content: center;
    align-items: center;
    column-gap: 18px;
    text-align: left;
  }

  .fp-day svg {
    grid-row: span 2;
  }
}

/* ---------- the finale: the page folds into the mark ---------- */

.finale {
  position: fixed;
  inset: 0;
  z-index: 20;
}

/* the page stays where it was, under a veil, so the mark reads as a layer over today's nine
   rather than a different screen; the nine lift off it and leave their faint selves behind */
.finale::before {
  content: "";
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(5px);
  opacity: 0;
  transition: opacity .9s var(--ease);
}

.finale.is-veiled::before {
  opacity: 1;
}

.finale.is-instant::before {
  transition: none;
}

.finale-lockup {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: calc(var(--u, 120px) * .8);
  padding: 24px;
}

.finale-mark {
  flex: none;
  width: calc(var(--u, 120px) * 3);
  height: calc(var(--u, 120px) * 4);
}

.finale-text {
  display: grid;
  justify-items: start;
  gap: calc(var(--u, 120px) * .14);
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}

.finale.is-settled .finale-text {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.finale-text .wm {
  font-size: clamp(36px, calc(var(--u, 120px) * .5), 84px);
}

.finale-line {
  font: italic 400 clamp(24px, calc(var(--u, 120px) * .27), 44px)/1.1 var(--serif);
  letter-spacing: -.01em;
}

.finale-sub {
  color: var(--soft);
  font: 500 12px/1.4 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.finale-text .btn {
  margin-top: calc(var(--u, 120px) * .18);
}

.finale .ghost {
  position: fixed;
  z-index: 1;
  margin: 0;
  pointer-events: none;
}

.finale .ghost.is-bit {
  pointer-events: auto;
  cursor: pointer;
}

.finale .ghost>* {
  transition: opacity .25s linear var(--d, 0ms);
}

.finale .ghost.is-bit>* {
  opacity: 0;
}

/* the puzzle (app.js, "fold it back yourself"): the dot in the wordmark opens it */
.dot-door {
  position: relative;
  padding: 0;
  border: 0;
  border-radius: 0;
  transition: transform .2s var(--ease);
}

/* bigger to tap than it looks */
.dot-door::after {
  content: "";
  position: absolute;
  inset: -14px;
}

.dot-door:hover {
  transform: scale(1.4);
}

.finale-say,
.finale-game {
  display: grid;
  justify-items: inherit;
  gap: inherit;
}

.finale-game {
  animation: game-in .5s cubic-bezier(0, 0, .3, 1) both;
}

@keyframes game-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

.game-rule {
  max-width: 32ch;
  color: var(--soft);
  font: 400 clamp(16px, calc(var(--u, 120px) * .15), 20px)/1.4 var(--serif);
}

/* no keys to press on a phone */
@media (hover: none) {
  .game-keys {
    display: none;
  }
}

/* while playing, the bits are only bits: the stories' links underneath stay out of the way */
.finale.is-playing .ghost.is-bit {
  transition: none;
  touch-action: manipulation;
}

.finale.is-playing .ghost.is-bit>* {
  pointer-events: none;
}

.finale .ghost.is-hint {
  outline: 2px solid var(--accent-text);
  outline-offset: calc(var(--u, 120px) * .08);
  animation: hint 1s ease-in-out infinite alternate;
}

@keyframes hint {
  to {
    outline-offset: calc(var(--u, 120px) * .02);
  }
}

@media (prefers-reduced-motion: reduce) {

  .finale-game,
  .finale .ghost.is-hint {
    animation: none;
  }
}

.is-instant,
.is-instant * {
  transition: none !important;
}

@media (max-width: 760px) {
  .finale-lockup {
    flex-direction: column;
    gap: calc(var(--u, 120px) * .5);
  }

  .finale-text {
    justify-items: center;
    text-align: center;
  }
}

/* ---------- history: a reel of days under the front page ---------- */

/* the reel slides up from the bottom and the nine make room for it (only then: a window
   being resized shouldn't animate) */
body.reel-moving .front {
  transition: height .5s var(--ease), padding .5s var(--ease);
}

body.reel-open .front {
  height: calc(100dvh - var(--reel-h, 140px));
}

/* while the reel is open, the counter also says how much of that day you read */
.fp-day .fp-read {
  display: none;
}

body.reel-open .fp-day .fp-read {
  display: inline;
  color: var(--fg-2);
}

body.reel-open .fp-day .fp-read::before {
  content: "·";
  margin: 0 .8em;
  color: var(--soft);
}

body.reel-open .fp-day .fp-read.is-done {
  color: var(--accent-text);
}

/* rewinding: the counter's dashes close into a line in the playhead's colour */
.front.is-scrubbing .fp-day {
  border-style: solid;
  border-color: var(--ph);
}

.fp-nav button.is-on {
  color: var(--fg);
}

body.reel-open .toast,
body.reel-open .offer {
  bottom: calc(var(--reel-h, 140px) + 16px);
}

.reel {
  --pitch: 34px;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  display: grid;
  gap: 2px;
  padding: 10px 0 max(6px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--bg);
  user-select: none;
  -webkit-user-select: none;
  transform: translateY(100%);
  visibility: hidden;
  transition: transform .5s var(--ease), visibility 0s linear .5s;
}

body.reel-open .reel {
  transform: none;
  visibility: visible;
  transition: transform .5s var(--ease), visibility 0s;
}

.reel-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 0 clamp(10px, 2vw, 28px);
  color: var(--soft);
  font: 500 10.5px/1.2 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.reel-left {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.reel-stat {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reel-stat b {
  color: var(--fg-2);
  font-weight: 500;
}

/* what the marks show: the date code, or which of the nine you read */
.reel-lens {
  display: inline-flex;
  flex: none;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.reel-lens button {
  padding: 5px 11px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--soft);
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  transition: background .2s, color .2s;
}

.reel-lens button:hover {
  color: var(--fg);
}

.reel-lens button[aria-checked="true"] {
  background: var(--fg);
  color: var(--bg);
}

/* over the playhead: the date, the day and the nine bits as digits */
.reel-readout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .8em;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.reel-date {
  color: var(--fg);
}

.reel-rw {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--accent-text);
}

.reel-bin span {
  opacity: .5;
}

.reel-bin span+span {
  margin-left: .28em;
}

.reel-bin .on {
  color: var(--fg);
  opacity: 1;
}

.reel-bin .on.t {
  color: var(--accent-text);
}

.reel-ico {
  width: 12px;
  height: 10px;
  fill: currentColor;
}

.reel-ctl {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.reel-btn {
  display: inline-grid;
  place-items: center;
  height: 28px;
  min-width: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: none;
  color: var(--soft);
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  touch-action: none;
  transition: color .2s, border-color .2s;
}

.reel-btn:hover:not(:disabled) {
  border-color: var(--line-strong);
  color: var(--fg);
}

.reel-btn.is-held {
  border-color: var(--ph);
  color: var(--fg);
}

.reel-btn:disabled {
  opacity: .4;
  cursor: default;
}

.reel-view {
  position: relative;
  height: 90px;
}

.reel-track {
  position: absolute;
  inset: 0;
  overflow-x: auto;
  overflow-y: hidden;
  cursor: grab;
  outline: none;
  scrollbar-width: none;
  touch-action: pan-x;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent);
}

.reel-track::-webkit-scrollbar {
  display: none;
}

.reel-track.is-drag {
  cursor: grabbing;
}

.reel-strip {
  position: relative;
  display: flex;
  width: max-content;
  height: 100%;
}

/* where the reel starts */
.reel-lead {
  position: absolute;
  bottom: 28px;
  display: grid;
  justify-items: end;
  gap: 4px;
  color: var(--soft);
  font: 500 10.5px/1 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
  transform: translateX(-100%);
}

.reel-lead b {
  color: var(--fg-2);
  font-weight: 500;
}

/* one day: its mark, and under it how much of that nine you read */
.reel-day {
  position: relative;
  flex: none;
  width: var(--pitch);
  height: 100%;
}

.reel-m {
  position: absolute;
  left: 50%;
  bottom: 20px;
  width: 20.5px;
  height: 28px;
  margin-left: -10.25px;
  transform: scale(var(--s, 1));
  transform-origin: 50% 100%;
  transition: transform .22s cubic-bezier(.2, .7, .2, 1);
}

.reel-m svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.reel-day rect {
  fill: var(--fg);
  transition: opacity .2s;
}

.reel-day .off {
  opacity: .13;
}

.reel-day .on {
  opacity: .5;
}

.reel-day.is-done .on {
  opacity: .78;
}

.reel-day.is-hot .on {
  opacity: .95;
}

.reel-day.is-sel .on {
  opacity: 1;
}

.reel-day.is-sel .on.t {
  fill: var(--tail);
}

.reel-day.is-sel .off {
  opacity: .24;
}

/* tomorrow: the 9 in outline */
.reel-day.is-ghost rect {
  fill: none;
  stroke: var(--fg);
  stroke-width: 2.4;
  stroke-dasharray: 4 3;
  opacity: .22;
}

.reel-r {
  position: absolute;
  left: 50%;
  bottom: 11px;
  width: 20px;
  height: 2px;
  margin-left: -10px;
  background: var(--line);
  transition: opacity .3s;
}

.reel-r::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(var(--r, 0) * 100%);
  background: var(--fg);
  opacity: .55;
  transition: width .3s cubic-bezier(.2, .7, .2, 1);
}

.reel-day.is-done .reel-r::after {
  opacity: 1;
}

body.reel-lens-read .reel-r {
  opacity: 0;
}

.reel-mo {
  position: absolute;
  top: 3px;
  left: 4px;
  color: var(--soft);
  font: 500 9.5px/1 var(--mono);
  letter-spacing: .08em;
}

.reel-day.is-month::before {
  content: "";
  position: absolute;
  left: 0;
  top: 2px;
  bottom: 8px;
  width: 1px;
  background: var(--line);
}

/* the playhead: viewfinder corners around the day in the middle */
.reel-playhead {
  --c: var(--ph);
  position: absolute;
  left: 50%;
  bottom: 13px;
  width: 48px;
  height: 59px;
  margin-left: -24px;
  pointer-events: none;
  background:
    linear-gradient(var(--c), var(--c)) 0 0 / 9px 2px no-repeat,
    linear-gradient(var(--c), var(--c)) 0 0 / 2px 9px no-repeat,
    linear-gradient(var(--c), var(--c)) 100% 0 / 9px 2px no-repeat,
    linear-gradient(var(--c), var(--c)) 100% 0 / 2px 9px no-repeat,
    linear-gradient(var(--c), var(--c)) 0 100% / 9px 2px no-repeat,
    linear-gradient(var(--c), var(--c)) 0 100% / 2px 9px no-repeat,
    linear-gradient(var(--c), var(--c)) 100% 100% / 9px 2px no-repeat,
    linear-gradient(var(--c), var(--c)) 100% 100% / 2px 9px no-repeat;
  transition: transform .25s cubic-bezier(.2, .7, .2, 1);
}

.reel.is-moving .reel-playhead {
  transform: scale(1.08, 1.04);
}

.reel-hint {
  position: absolute;
  left: calc(50% + 72px);
  bottom: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--soft);
  font: 500 10.5px/1 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  pointer-events: none;
  transition: opacity .4s, transform .4s cubic-bezier(.2, .7, .2, 1);
}

.reel-hint i {
  font-style: normal;
  animation: reel-nudge 1.6s var(--ease) infinite;
}

@keyframes reel-nudge {
  50% {
    transform: translateX(-5px);
  }
}

.reel-hint.is-gone {
  opacity: 0;
  transform: translateX(10px);
}

/* what's under the pointer */
.reel-tip {
  position: fixed;
  bottom: 0;
  left: 0;
  z-index: 6;
  width: max-content;
  max-width: 270px;
  padding: 11px 13px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--sheet);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .35);
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 4px);
  transition: opacity .15s, transform .2s cubic-bezier(.2, .7, .2, 1);
}

.reel-tip.is-on {
  opacity: 1;
  transform: translate(-50%, 0);
}

.reel-tip-k {
  color: var(--soft);
  font: 500 10px/1.3 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.reel-tip-h {
  margin-top: 6px;
  font: 400 15px/1.3 var(--serif);
  text-wrap: pretty;
}

.reel-tip-r {
  margin-top: 8px;
  color: var(--fg-2);
  font: 500 10px/1.3 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* tablets and phones: the page scrolls, and makes room at the bottom for the reel */
@media (max-width: 860px),
(max-height: 520px) {
  body.reel-open .front {
    height: auto;
    padding-bottom: calc(var(--reel-h, 140px) + 16px);
  }

  .reel-bar {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
    padding: 0 16px;
  }

  .reel-stat {
    display: none;
  }
}

@media (max-width: 600px) {

  /* on a phone the readout is just the date; the counter above has the rest */
  .reel-bin,
  .reel-sep,
  .reel-what,
  .reel-wd {
    display: none;
  }

  .reel-hint {
    left: calc(50% + 50px);
  }

  .reel-btn[data-hold="1"] {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {

  body.reel-moving .front,
  .reel,
  .reel-m,
  .reel-hint,
  .reel-tip {
    transition: none;
  }

  .reel-hint i {
    animation: none;
  }
}

/* ---------- loader and notices ---------- */

.screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
}

.loader-in {
  display: grid;
  justify-items: center;
  gap: 22px;
  width: min(440px, 100%);
}

.loader-mark {
  height: 120px;
  width: auto;
}

.lb {
  --on: var(--newsprint);
  fill: var(--bit-off);
  animation: pick 3.6s var(--ease) infinite both;
  animation-delay: calc(var(--k) * .18s);
}

.lb.t {
  --on: var(--marker);
}

:root[data-theme="paper"] .lb {
  --on: var(--press);
}

@keyframes pick {

  0%,
  6% {
    fill: var(--bit-off);
  }

  12%,
  80% {
    fill: var(--on);
  }

  88%,
  100% {
    fill: var(--bit-off);
  }
}

.screen h2 {
  font: 400 32px/1.05 var(--serif);
  letter-spacing: -.015em;
  text-align: center;
}

.steps {
  display: grid;
  gap: 6px;
  width: 100%;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--soft);
  font-size: 12px;
}

.steps li {
  display: flex;
  gap: 10px;
}

.steps li::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  margin-top: 5px;
  background: var(--bit-off);
}

.steps li.ok {
  color: var(--fg-2);
}

.steps li.ok::before {
  background: var(--fg);
}

.steps li.now {
  color: var(--fg);
}

.steps li.now::before {
  background: var(--marker);
  animation: blink 1s steps(2) infinite;
}

.steps li.err {
  color: var(--soft);
}

.steps li.err::before {
  background: none;
  box-shadow: inset 0 0 0 1px var(--soft);
}

.steps .n {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

@keyframes blink {
  50% {
    opacity: .2;
  }
}

.notice-in {
  display: grid;
  justify-items: center;
  gap: 16px;
  max-width: 520px;
  text-align: center;
}

.notice-in p {
  color: var(--fg-2);
}

.notice-in .row {
  display: flex;
  gap: 8px;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 38px;
  padding: 0 18px;
  border: 1px solid var(--fg);
  border-radius: 999px;
  background: none;
  color: var(--fg);
  font: 500 11.5px/1 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition: background .2s, color .2s, border-color .2s;
}

.btn:hover {
  background: var(--fg);
  color: var(--bg);
}

.btn--mark {
  border-color: var(--marker);
  background: var(--marker);
  color: var(--press);
}

.btn--mark:hover {
  background: none;
  color: var(--accent-text);
}

:root[data-theme="paper"] .btn--mark:hover {
  border-color: var(--press);
  background: var(--press);
  color: var(--marker);
}

.btn--quiet {
  border-color: var(--line-strong);
  color: var(--fg-2);
}

.iconbtn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-left: auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: none;
  color: var(--fg-2);
  font: 400 17px/1 var(--mono);
}

.iconbtn:hover {
  border-color: var(--line-strong);
  color: var(--fg);
}

.link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--soft);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: .2em;
}

.link:hover {
  color: var(--fg);
}

/* ---------- sheets ---------- */

.sheet {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(580px, 100vw);
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--line);
  background: var(--sheet);
  color: var(--fg);
  overflow: hidden;
}

.sheet[open] {
  display: flex;
  flex-direction: column;
  animation: slide .32s var(--ease);
}

.sheet::backdrop {
  background: rgba(8, 8, 7, .55);
  backdrop-filter: blur(2px);
}

:root[data-theme="paper"] .sheet::backdrop {
  background: rgba(17, 18, 16, .25);
}

@keyframes slide {
  from {
    transform: translateX(40px);
    opacity: 0;
  }
}

.sheet-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
}

.sheet-head h2 {
  font: 400 26px/1 var(--serif);
  letter-spacing: -.015em;
}

.sheet-body {
  flex: 1;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 24px;
}

.sheet-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--line);
}

.sheet-foot .note {
  margin-right: auto;
  color: var(--soft);
  font-size: 11.5px;
}

/* story details */
.story-sheet .sheet-body {
  display: grid;
  gap: 18px;
  align-content: start;
}

.story-sheet .fp-meta {
  padding: 0;
}

.story-sheet .media {
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: 3px;
  background: var(--bit-off);
}

.story-sheet .media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.story-sheet h3 {
  font: 450 34px/1.06 var(--serif);
  letter-spacing: -.02em;
  text-wrap: balance;
}

.story-sheet .sum {
  color: var(--fg-2);
  font: 400 18px/1.45 var(--serif);
}

.story-sheet .why {
  font: 400 18px/1.45 var(--serif);
}

.story-sheet .why mark {
  padding: var(--hl-pad) .1em;
  margin: 0 -.1em;
  background: linear-gradient(var(--hl), var(--hl)) no-repeat 0 var(--hl-y) / 100% var(--hl-h);
  color: var(--hl-fg);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.scores {
  display: grid;
  gap: 8px;
  padding: 16px 0;
  border-block: 1px solid var(--line);
}

.score {
  display: grid;
  grid-template-columns: 8.5em auto 1fr;
  align-items: center;
  gap: 14px;
  font-size: 12px;
}

.score .label {
  font-size: 10.5px;
}

.score-bits {
  display: flex;
  gap: 3px;
}

.score-bits i {
  width: 10px;
  height: 10px;
  background: var(--bit-off);
}

.score-bits i.on {
  background: var(--fg);
}

.score b {
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.sources {
  display: grid;
}

.sources a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}

.sources a:hover .src-name {
  text-decoration: underline;
  text-underline-offset: .2em;
}

.src-name {
  color: var(--fg);
}

.src-sig {
  color: var(--soft);
  font-variant-numeric: tabular-nums;
}

.picked-by {
  color: var(--soft);
  font-size: 11.5px;
}

/* more like this, less like this */
.rate {
  display: grid;
  gap: 12px;
}

.rate-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rate-btn {
  gap: 8px;
}

.rate-btn span {
  font-size: 14px;
}

.rate-btn[aria-pressed="true"] {
  border-color: var(--fg);
  background: var(--fg);
  color: var(--bg);
}

.rate-why {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.rate-why .label {
  margin-right: 4px;
}

.rate-chip {
  padding: 5px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: none;
  color: var(--fg-2);
  font: 400 15px/1.2 var(--serif);
}

.rate-chip:hover {
  border-color: var(--fg);
  color: var(--fg);
}

.rate-chip[aria-pressed="true"] {
  border-color: var(--marker);
  background: var(--marker);
  color: var(--press);
}

.rate-note {
  color: var(--soft);
  font-size: 11.5px;
}

/* settings */
.form {
  display: grid;
  gap: 34px;
}

.fs {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  border: 0;
}

.fs legend {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
  padding: 0;
  color: var(--accent-text);
  font: 500 11px/1.2 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.fs legend .pip rect {
  fill: currentColor;
}

.fs .hint {
  color: var(--soft);
  font-size: 12px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px 5px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font: 400 15px/1.2 var(--serif);
}

.chip button {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--soft);
  font: 14px/1 var(--mono);
}

.chip button:hover {
  background: var(--line);
  color: var(--fg);
}

.field {
  display: grid;
  gap: 6px;
}

.field>span {
  color: var(--soft);
  font-size: 11.5px;
}

.input {
  width: 100%;
  min-height: 38px;
  padding: 8px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: transparent;
  font: 400 13px/1.3 var(--mono);
}

.input:focus {
  border-color: var(--fg);
  outline: none;
}

.input::placeholder {
  color: var(--soft);
  opacity: .8;
}

/* what the editor has learned: prose, one point per line */
.note-input {
  min-height: 8em;
  resize: vertical;
  font: 400 16px/1.45 var(--serif);
}

.row2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

.inline {
  display: flex;
  align-items: center;
  gap: 8px;
}

.inline .input {
  flex: 1;
}

/* checkboxes and radios are bits: dark when off, lit when on */
.check {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 3px 12px;
  align-items: start;
  cursor: pointer;
}

.check input {
  appearance: none;
  width: 14px;
  height: 14px;
  margin: 3px 0 0;
  border: 1px solid var(--line-strong);
  background: transparent;
  cursor: pointer;
  transition: background .15s;
}

.check input:checked {
  border-color: var(--fg);
  background: var(--fg);
}

.check input[type="radio"]:checked {
  box-shadow: inset 0 0 0 2px var(--sheet);
}

.check b {
  font: 400 17px/1.3 var(--serif);
}

.check small {
  grid-column: 2;
  color: var(--soft);
  font-size: 12px;
}

.providers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.providers label {
  position: relative;
}

.providers input {
  position: absolute;
  opacity: 0;
}

.providers span {
  display: grid;
  gap: 2px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 3px;
  font: 400 15px/1.2 var(--serif);
  cursor: pointer;
}

.providers small {
  color: var(--soft);
  font: 10px/1.2 var(--mono);
  letter-spacing: .04em;
}

.providers input:checked+span {
  border-color: var(--fg);
  box-shadow: inset 0 0 0 1px var(--fg);
}

.providers input:focus-visible+span {
  outline: 2px solid var(--marker);
  outline-offset: 2px;
}

.keynote {
  color: var(--soft);
  font-size: 11.5px;
}

.keynote.ok {
  color: var(--fg);
}

.keynote.bad {
  color: var(--fg);
  text-decoration: underline wavy var(--soft);
  text-underline-offset: .3em;
}

.feeds {
  display: grid;
  gap: 6px;
}

.feed {
  display: grid;
  grid-template-columns: auto minmax(0, .7fr) minmax(0, 1.3fr) auto;
  align-items: center;
  gap: 8px;
}

.feed .check input {
  margin: 0;
}

.cats {
  display: grid;
  gap: 6px;
}

.cat-row {
  display: grid;
  grid-template-columns: minmax(0, .6fr) minmax(0, 1.4fr);
  gap: 8px;
}

.iconx {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: none;
  color: var(--soft);
}

.iconx:hover {
  border-color: var(--line-strong);
  color: var(--fg);
}

::view-transition-group(*) {
  animation-duration: .45s;
  animation-timing-function: var(--ease);
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: .01ms !important;
    transition-delay: 0s !important;
  }

  .lb {
    fill: var(--on);
  }
}

/* ---------- signing in ---------- */

.signin-in {
  display: grid;
  justify-items: center;
  gap: 18px;
  width: min(380px, 100%);
  text-align: center;
}

.signin-mark svg {
  display: block;
  height: 64px;
  width: auto;
}

.signin-wm {
  font-size: clamp(36px, 9vw, 48px);
}

.signin-lede {
  max-width: 30ch;
  color: var(--fg-2);
  font: 400 17px/1.4 var(--serif);
}

.signin-form {
  display: grid;
  gap: 12px;
  width: 100%;
  margin-top: 6px;
  text-align: left;
}

.signin-form .btn,
.signin-alt .btn {
  width: 100%;
}

.signin-sent {
  color: var(--fg-2);
  font: 400 15px/1.45 var(--serif);
  text-align: center;
}

.code-input {
  font-size: 22px;
  letter-spacing: .35em;
  text-align: center;
}

.signin-links {
  display: flex;
  justify-content: center;
  gap: 18px;
  font: 400 11.5px/1.4 var(--mono);
}

.signin-alt {
  display: grid;
  justify-items: center;
  gap: 12px;
  width: 100%;
  color: var(--soft);
  font: 400 11.5px/1 var(--mono);
}

.signin-note {
  min-height: 1.5em;
  color: var(--soft);
  font: 400 12px/1.5 var(--mono);
}

.signin-note.bad {
  color: var(--fg);
  text-decoration: underline wavy var(--soft);
  text-underline-offset: .3em;
}

/* the passkey offer after the first sign-in */
.offer {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 20;
  display: grid;
  gap: 14px;
  width: min(440px, calc(100% - 32px));
  padding: 18px 20px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--sheet);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .35);
  transform: translateX(-50%);
  font: 400 15px/1.45 var(--serif);
}

.offer b {
  font-weight: 560;
}

.offer .row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* the account section in settings */
.passkey-list {
  display: grid;
  gap: 6px;
  margin: 4px 0 10px;
}

.passkey-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 3px;
  font: 400 12px/1.4 var(--mono);
}

.passkey-row span {
  flex: 1;
  min-width: 0;
}

.passkey-row small {
  color: var(--soft);
}

.account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.danger {
  margin-top: 10px;
  color: var(--soft);
  font: 400 11.5px/1.5 var(--mono);
}

.danger summary {
  cursor: pointer;
}

.danger[open] {
  display: grid;
  gap: 10px;
}

.turnstile:empty {
  display: none;
}

/* links in the masthead's nav look like its buttons */
.fp-nav a {
  color: var(--soft);
  text-decoration: none;
}

.fp-nav a:hover {
  color: var(--fg);
}

.finale-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.finale-actions .btn {
  margin-top: calc(var(--u, 120px) * .18);
}

.signin-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
  font: 400 11.5px/1.4 var(--mono);
}

/* ---------- settings: tabs, interests ---------- */

.tabs {
  display: flex;
  gap: 22px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
}

.tabs button {
  margin-bottom: -1px;
  padding: 12px 0 11px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--soft);
  font: 500 11.5px/1 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.tabs button:hover {
  color: var(--fg);
}

.tabs button[aria-selected="true"] {
  border-bottom-color: var(--tail);
  color: var(--fg);
}

.fs legend .count {
  margin-left: auto;
  color: var(--soft);
  letter-spacing: .04em;
}

.interests {
  display: grid;
  gap: 6px;
}

.interest {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr) auto;
  gap: 6px;
  align-items: center;
}

.interest [data-i="label"] {
  font: 400 15px/1.2 var(--serif);
}

@media (max-width: 560px) {
  .interest {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .interest [data-i="hint"] {
    grid-column: 1;
  }

  .interest .iconx {
    grid-row: 1;
    grid-column: 2;
  }
}

.suggest {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.suggest>span {
  margin-right: 4px;
  color: var(--soft);
  font: 400 11px/1 var(--mono);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.chip--add {
  padding: 5px 12px;
  background: none;
  color: var(--fg-2);
  cursor: pointer;
}

.chip--add::before {
  content: "+ ";
  color: var(--soft);
}

.chip--add:hover {
  border-color: var(--fg);
  color: var(--fg);
}

.keyline {
  font: 400 12px/1.5 var(--mono);
}

/* ---------- welcome ---------- */

.screen--scroll {
  overflow: auto;
  place-items: start center;
}

.welcome-in {
  display: grid;
  justify-items: center;
  gap: 18px;
  width: min(600px, 100%);
  margin: auto 0;
  padding: 32px 0;
  text-align: center;
}

.welcome-in h2 {
  font: 400 clamp(28px, 6vw, 38px)/1.1 var(--serif);
  letter-spacing: -.015em;
}

.welcome-step,
.welcome-note {
  color: var(--soft);
  font: 400 11.5px/1.5 var(--mono);
  letter-spacing: .04em;
}

.welcome-step {
  letter-spacing: .1em;
  text-transform: uppercase;
}

.welcome-lede {
  max-width: 46ch;
  color: var(--fg-2);
  font: 400 17px/1.45 var(--serif);
}

.welcome-error {
  min-height: 1.4em;
  color: var(--fg);
  font: 400 12px/1.5 var(--mono);
  text-decoration: underline wavy var(--soft);
  text-underline-offset: .3em;
}

.welcome-error:empty {
  min-height: 0;
}

.welcome-in>.input {
  width: min(420px, 100%);
}

.welcome-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.btn:disabled {
  opacity: .4;
  pointer-events: none;
}

.pick {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.pick-chip {
  padding: 9px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: none;
  color: var(--fg-2);
  font: 400 16px/1.2 var(--serif);
  cursor: pointer;
}

.pick-chip:hover {
  border-color: var(--fg);
  color: var(--fg);
}

.pick-chip[aria-pressed="true"] {
  border-color: var(--marker);
  background: var(--marker);
  color: var(--press);
}

.providers--welcome {
  width: min(520px, 100%);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  text-align: left;
}

/* a short note at the bottom of the page */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 30;
  max-width: calc(100% - 32px);
  padding: 12px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--sheet);
  box-shadow: 0 12px 36px rgba(0, 0, 0, .3);
  font: 400 15px/1.4 var(--serif);
  transform: translateX(-50%);
}

/* short panes (the AI tab) keep their rows at the top instead of stretching to fill the sheet */
.form,
.fs,
.providers {
  align-content: start;
}

.ai-error {
  display: grid;
  gap: 10px;
  margin-top: 6px;
}

/* ---------- assistants over MCP ---------- */

/* "Let Claude use your ninebits?" */
.connect-in {
  width: min(440px, 100%);
  margin: auto 0;
  padding: 32px 0;
}

.connect-in h2 {
  font: 400 clamp(26px, 6vw, 34px)/1.1 var(--serif);
  letter-spacing: -.015em;
}

.connect-site {
  margin-top: -8px;
  color: var(--soft);
  font: 400 12px/1.4 var(--mono);
}

.connect-list {
  display: grid;
  gap: 8px;
  width: 100%;
  padding: 16px 0;
  border-block: 1px solid var(--line);
  list-style: none;
  color: var(--fg-2);
  font: 400 16px/1.4 var(--serif);
  text-align: left;
}

/* each line gets a lit bit */
.connect-list li {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
}

.connect-list li::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--fg);
}

.connect-not,
.connect-who {
  color: var(--soft);
  font: 400 12px/1.5 var(--mono);
}

.connect-who b {
  color: var(--fg);
  font-weight: 500;
}

.welcome-wide {
  max-width: 52ch;
}

/* Settings → AI → Assistants */
.mono {
  font-family: var(--mono);
  font-size: 12px;
}

.howto {
  display: grid;
  gap: 10px;
  color: var(--soft);
  font: 400 12px/1.55 var(--mono);
}

.howto summary {
  color: var(--fg-2);
  cursor: pointer;
}

.howto ul {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  padding-left: 1.2em;
}

.howto b {
  color: var(--fg);
  font-weight: 500;
}

.howto code {
  color: var(--fg);
  overflow-wrap: anywhere;
}

#token-note .inline {
  margin-bottom: 6px;
}

/* ---------- text pages: /about and /privacy ---------- */

.doc { max-width: 680px; margin: 0 auto; padding: 48px 16px 96px; }
.doc .wm { font-size: 30px; margin-bottom: 40px; }
.doc .wm a { color: inherit; }
.doc h1:not(.wm) { font: 400 40px/1.1 var(--serif); letter-spacing: -.015em; margin-bottom: 8px; }
.doc .date { color: var(--soft); margin-bottom: 32px; }
.doc h2 { font: 400 24px/1.2 var(--serif); margin: 40px 0 12px; }
.doc p, .doc li, .doc td { font: 400 17px/1.55 var(--serif); color: var(--fg-2); }
.doc p + p { margin-top: 12px; }
.doc ul { padding-left: 1.2em; display: grid; gap: 8px; }
.doc b { color: var(--fg); font-weight: 560; }
.doc a { color: var(--fg); text-underline-offset: .2em; }
.doc code { font: 400 14px var(--mono); }
.doc .short { border-left: 3px solid var(--tail); padding-left: 16px; }
.doc table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.doc th { text-align: left; font: 500 11px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--soft); padding: 8px 12px 8px 0; border-bottom: 1px solid var(--line-strong); }
.doc td { vertical-align: top; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); font-size: 15.5px; }
.doc td:first-child { color: var(--fg); white-space: nowrap; }
@media (max-width: 600px) { .doc td:first-child { white-space: normal; } .doc table, .doc tbody, .doc tr, .doc td { display: block; } .doc thead { display: none; } .doc td { border: 0; padding: 2px 0; } .doc tr { border-bottom: 1px solid var(--line); padding: 10px 0; } }
