@font-face {
  font-family: "Silkscreen";
  src: url("assets/fonts/Silkscreen-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Silkscreen";
  src: url("assets/fonts/Silkscreen-Bold.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("assets/fonts/AtkinsonHyperlegible-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("assets/fonts/AtkinsonHyperlegible-Bold.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  --cream: #dad3c3;
  --navy: #22202a;
  --gold: #c8a032;
  --fur: #928b7e;
  --stripe: #58544d;
  --white: #ffffff;
  --display: "Silkscreen", monospace;
  --body: "Atkinson Hyperlegible", sans-serif;
  color-scheme: light;
}

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

html {
  background: var(--cream);
  color: var(--navy);
  font-family: var(--body);
  font-size: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--cream);
  color: var(--navy);
  font-size: 18px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: -100px;
  left: 12px;
  width: auto;
}

.skip-link:focus {
  top: 54px;
}

img,
canvas,
video {
  display: block;
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

a {
  color: inherit;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  color: var(--navy);
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.15;
}

h4 {
  color: var(--navy);
  font-family: var(--body);
  font-weight: 700;
  line-height: 1.3;
}

h1 {
  max-width: 11ch;
  margin-bottom: 28px;
  font-size: 56px;
}

h2 {
  margin-bottom: 22px;
  font-size: 28px;
}

h3 {
  font-size: 20px;
}

h4 {
  margin-bottom: 12px;
  font-size: 20px;
}

.menu-bar {
  position: sticky;
  z-index: 20;
  top: 0;
  height: 44px;
  border-bottom: 1px solid var(--navy);
  background: var(--stripe);
  color: var(--white);
  font-size: 15px;
  line-height: 1;
}

.menu-bar__inner {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  width: min(100% - 32px, 1040px);
  height: 44px;
  margin-inline: auto;
}

.menu-bar a {
  color: var(--white);
  text-decoration: none;
}

.menu-bar a:hover {
  color: var(--cream);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.menu-bar__brand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
}

.menu-bar__brand img {
  width: 20px;
  height: 20px;
  image-rendering: auto;
}

.menu-bar__links {
  display: flex;
  gap: 28px;
  margin-left: 54px;
}

.hero {
  display: flex;
  align-items: center;
  min-height: calc(100svh - 44px);
}

.hero__inner {
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 100px;
  width: min(100% - 48px, 1040px);
  margin-inline: auto;
  padding: 40px 0;
}

.hero__copy {
  position: relative;
  z-index: 2;
  flex: 0 1 620px;
  max-width: 620px;
}

.hero__copy > p {
  max-width: 66ch;
}

.download-row {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-top: 34px;
}

.pixel-button {
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  padding: 11px 18px;
  border: 1px solid var(--white);
  background: var(--gold);
  box-shadow: inset 0 0 0 1px var(--navy), 3px 3px 0 var(--stripe);
  color: var(--navy);
  font-family: var(--display);
  font-size: 20px;
  line-height: 1.15;
  text-align: center;
  text-decoration: none;
}

.pixel-button:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.pixel-button:active {
  transform: translate(1px, 1px);
  box-shadow: inset 0 0 0 1px var(--navy), 2px 2px 0 var(--stripe);
}

.pixel-button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  box-shadow: inset 0 0 0 1px var(--navy), 3px 3px 0 var(--stripe);
}

.mobile-label {
  display: none;
}

.download-facts {
  margin: 0;
  color: var(--fur);
  font-size: 15px;
  line-height: 1.45;
}

.copy-status:empty {
  min-height: 0;
  margin: 0;
}

.copy-status {
  margin: 12px 0 0;
  color: var(--fur);
  font-size: 15px;
}

/* The charity aside. Quiet on purpose: the download stays the one gold thing in
   the hero, so the ask is a caption plus a link, and the heart is the only accent.
   The heart is his own heart prop recoloured to his collar gold, drawn at 2x. */
.chip-in {
  max-width: 46ch;
  margin-top: 30px;
}

.chip-in p {
  margin: 0 0 8px;
  color: var(--fur);
  font-size: 15px;
  line-height: 1.45;
}

.chip-in__link,
.footer__chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--navy);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

.chip-in__link img,
.footer__chip img {
  width: 18px;
  height: 18px;
  flex: none;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
}

.rumi-stage {
  --px: 8px;
  position: relative;
  z-index: 1;
  flex: none;
  width: calc(35 * var(--px));
  height: calc(40 * var(--px));
  margin-bottom: 48px;
  cursor: grab;
  touch-action: none;
}

.rumi-stage:active {
  cursor: grabbing;
}

#rumi-canvas,
#heart-layer {
  position: absolute;
  top: calc(-7 * var(--px));
  left: calc(-7 * var(--px));
  width: calc(50 * var(--px));
  height: calc(50 * var(--px));
}

#rumi-canvas {
  /* The stage is narrower than the sprite, so the shared max-width would squash him. */
  max-width: none;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
}

#heart-layer {
  overflow: visible;
  pointer-events: none;
}

.heart {
  position: absolute;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
  pointer-events: none;
}

.rumi-hint {
  position: absolute;
  top: 100%;
  left: calc(15 * var(--px));
  margin: 6px 0 0;
  transform: translateX(-50%);
  color: var(--fur);
  font-size: 14px;
  font-style: italic;
  transition: opacity 400ms ease;
}

.rumi-stage.is-petted .rumi-hint {
  opacity: 0;
}

.section {
  padding: 112px 0;
}

.content-grid {
  width: min(100% - 48px, 1040px);
  margin-inline: auto;
}

.section-intro {
  max-width: 660px;
  margin-bottom: 78px;
}

.section-intro p,
.about__copy p {
  max-width: 66ch;
}

.feature-group + .feature-group {
  margin-top: 128px;
}

/* No rule under the group name: it sits alone at the left margin, well clear of
   the group above and tight to the entries below, so proximity does the work. */
.feature-group > h3 {
  margin-bottom: 40px;
}

.menu-shot {
  max-width: 460px;
  margin: 0 0 78px;
}

.menu-shot figcaption {
  margin-top: 12px;
  color: var(--fur);
  font-size: 15px;
}

.feature {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
  align-items: center;
}

.feature + .feature {
  margin-top: 64px;
}

.clip-window,
.pixel-panel {
  border: 1px solid var(--white);
  background: var(--navy);
  box-shadow: inset 0 0 0 1px var(--navy), 3px 3px 0 var(--stripe);
  color: var(--cream);
}

.clip-window {
  position: relative;
  grid-column: span 5;
  width: 100%;
  aspect-ratio: 4 / 3;
  min-height: 220px;
  overflow: hidden;
}

.clip-media {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  display: none;
  max-width: 100%;
  max-height: 100%;
  transform: translate(-50%, -50%);
  image-rendering: crisp-edges;
  image-rendering: pixelated;
}

.clip-window.has-media .clip-media {
  display: block;
}

.clip-window.has-media .clip-still {
  display: none;
}

.clip-still {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 150px;
  height: 150px;
  transform: translate(-50%, -50%);
  image-rendering: crisp-edges;
  image-rendering: pixelated;
}

.feature__copy {
  grid-column: 7 / span 6;
  max-width: 580px;
}

.feature__copy > p {
  max-width: 64ch;
  margin-bottom: 12px;
}

.how {
  color: var(--fur);
  font-size: 15px;
}

.how strong,
.small-habits strong {
  color: var(--navy);
}

.small-habits {
  margin-top: 30px;
}

.small-habits p {
  margin-bottom: 10px;
  color: var(--fur);
  font-size: 15px;
}

.steps {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin: 0 0 40px;
  padding: 0;
  list-style: none;
}

.steps li {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 18px;
  min-height: 184px;
  padding: 26px;
}

.steps h3 {
  margin-bottom: 10px;
  color: var(--cream);
  font-family: var(--body);
  font-weight: 700;
  line-height: 1.3;
}

.steps p {
  margin-bottom: 0;
  color: var(--cream);
}

.step-number {
  color: var(--gold);
  font-family: var(--display);
  font-size: 28px;
  line-height: 1;
}

.system-note {
  max-width: 66ch;
  margin: 0 0 28px;
  color: var(--fur);
  font-size: 15px;
}

.about__grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
  align-items: center;
}

.about__copy {
  grid-column: span 7;
}

.about__portrait {
  position: relative;
  grid-column: 9 / span 4;
  aspect-ratio: 3 / 4;
  overflow: hidden;
}

.about__portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portrait-still {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 200px;
  height: 200px;
  transform: translate(-50%, -50%);
  image-rendering: crisp-edges;
  image-rendering: pixelated;
}

.about__portrait.has-photo .portrait-still {
  display: none;
}

footer {
  margin-top: 24px;
  background: var(--stripe);
  color: var(--white);
  font-size: 15px;
}

.footer__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  width: min(100% - 48px, 1040px);
  min-height: 84px;
  margin-inline: auto;
}

.footer__sig {
  justify-self: center;
}

.footer__links {
  display: flex;
  gap: 24px;
  justify-self: end;
}

.footer__chip {
  color: var(--white);
  font-weight: 400;
}

.footer__inner p {
  margin: 0;
}

.footer__inner a {
  color: var(--white);
  text-underline-offset: 4px;
}

@media (max-width: 960px) {
  .hero__inner {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 28px 0;
  }

  .hero__copy {
    flex: none;
    max-width: 660px;
  }

  .rumi-stage {
    --px: 6px;
    align-self: center;
    margin-top: 36px;
    margin-bottom: 8px;
  }

  .chip-in {
    margin-top: 22px;
  }
}

@media (max-width: 800px) {
  body {
    font-size: 17px;
  }

  h1 {
    max-width: 12ch;
    margin-bottom: 22px;
    font-size: 36px;
  }

  h2 {
    font-size: 22px;
  }

  h3,
  h4 {
    font-size: 18px;
  }

  .hero {
    min-height: calc(100svh - 36px);
  }

  .menu-bar,
  .menu-bar__inner {
    height: 36px;
  }

  .menu-bar__inner {
    width: min(100% - 16px, 1040px);
  }

  .menu-bar__links {
    gap: 14px;
    margin-left: 18px;
    font-size: 13px;
  }

  .pixel-button {
    font-size: 18px;
  }

  .download-facts,
  .copy-status,
  .chip-in p,
  .how,
  .small-habits p,
  .system-note,
  .rumi-hint {
    color: var(--stripe);
    font-size: 14px;
  }

  .copy-status {
    min-height: 1.45em;
  }

  .step-number {
    font-size: 22px;
  }

  .hero__inner,
  .content-grid {
    width: min(100% - 32px, 1040px);
  }

  .hero__copy {
    max-width: 610px;
  }

  .skip-link:focus {
    top: 46px;
  }

  .hero__copy > p {
    max-width: 36ch;
  }

  .download-row {
    display: block;
    margin-top: 28px;
  }

  .download-facts {
    margin-top: 15px;
  }

  .desktop-label {
    display: none;
  }

  .mobile-label {
    display: inline;
  }

  .section {
    padding: 80px 0;
  }

  .section-intro {
    margin-bottom: 56px;
  }

  .feature-group + .feature-group {
    margin-top: 96px;
  }

  .feature {
    display: block;
  }

  .feature + .feature {
    margin-top: 56px;
  }

  .clip-window {
    width: 100%;
    min-height: 0;
    margin-bottom: 28px;
  }

  .feature__copy {
    max-width: 660px;
  }

  .steps {
    grid-template-columns: 1fr;
  }

  .steps li {
    min-height: 0;
  }

  .about__grid {
    display: block;
  }

  .about__copy {
    margin-bottom: 48px;
  }

  .about__portrait {
    width: min(100%, 320px);
  }
}

@media (max-width: 400px) {
  .footer__inner {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 10px;
    padding: 22px 0;
    text-align: center;
  }

  .footer__links {
    justify-self: center;
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }
}

@media (max-width: 640px) {
  /* The strip is a Mac menu bar, and that reading only lands on a big screen.
     At phone size it is just site chrome, and it costs 36px of a short
     viewport, so the page starts on the headline instead. */
  .menu-bar {
    display: none;
  }

  .hero {
    min-height: 100svh;
  }

  .skip-link:focus {
    top: 12px;
  }
}

@media (max-width: 440px) {
  .menu-bar__brand span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .menu-bar__links {
    gap: 12px;
    margin-left: 10px;
  }

  .pixel-button {
    width: 100%;
  }

  .skip-link {
    width: auto;
  }

  .steps li {
    grid-template-columns: 36px 1fr;
    gap: 12px;
    padding: 21px 18px;
  }

  .footer__inner {
    width: min(100% - 32px, 1040px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .rumi-hint {
    transition: none;
  }

  /* Animated slots stay unloaded; the screenshots and sprite stills remain. */
  .clip-window.has-media .clip-media[data-animated] {
    display: none;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }
}
