/* Track My Poops website. Windows 98 + MS Paint, same as the app. */

@font-face {
  font-family: "Pixelify Sans";
  src: url("fonts/PixelifySans-Medium.woff2") format("woff2");
  font-weight: 400 600;
  font-display: swap;
}
@font-face {
  font-family: "Pixelify Sans";
  src: url("fonts/PixelifySans-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Comic Neue";
  src: url("fonts/ComicNeue-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Comic Neue";
  src: url("fonts/ComicNeue-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --face: #c0c0c0;
  --light: #dfdfdf;
  --hi: #ffffff;
  --shadow: #808080;
  --dark: #000000;
  --navy: #000080;
  --title-end: #1084d0;
  --desktop: #008080;
  --link: #0000ee;
  --tip: #ffffe1;
  --pixel: "Pixelify Sans", "Trebuchet MS", system-ui, sans-serif;
  --comic: "Comic Neue", "Comic Sans MS", "Chalkboard SE", cursive, sans-serif;

  /* Win98 bevels, 2px per pixel like the app */
  --raised: inset -2px -2px 0 var(--dark), inset 2px 2px 0 var(--light), inset -4px -4px 0 var(--shadow), inset 4px 4px 0 var(--hi);
  --button: inset -2px -2px 0 var(--dark), inset 2px 2px 0 var(--hi), inset -4px -4px 0 var(--shadow), inset 4px 4px 0 var(--light);
  --pressed: inset 2px 2px 0 var(--dark), inset -2px -2px 0 var(--hi), inset 4px 4px 0 var(--shadow), inset -4px -4px 0 var(--light);
  --sunken: inset 2px 2px 0 var(--shadow), inset -2px -2px 0 var(--hi), inset 4px 4px 0 var(--dark), inset -4px -4px 0 var(--light);
  --field: inset 2px 2px 0 var(--shadow), inset -2px -2px 0 var(--hi);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--desktop);
}

body {
  margin: 0;
  background: var(--desktop);
  color: #000;
  font: 18px/1.55 var(--comic);
}

img {
  max-width: 100%;
}

.px {
  image-rendering: pixelated;
}

a {
  color: var(--link);
}
a:visited {
  color: #551a8b;
}
a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 2px dotted #000;
  outline-offset: 2px;
}

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 16px;
  top: 8px;
  z-index: 10;
  background: var(--tip);
  padding: 6px 10px;
  border: 2px solid #000;
}

/* ---------- desktop + window ---------- */

.desktop {
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px 16px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.window {
  width: 100%;
  max-width: 880px;
  background: var(--face);
  padding: 6px;
  box-shadow: var(--raised);
}

.title-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 3px 3px 3px 6px;
  background: linear-gradient(90deg, var(--navy), var(--title-end));
  color: #fff;
  font: 700 18px/1.2 var(--pixel);
}
.title-bar .app-icon {
  width: 24px;
  height: 24px;
  flex: none;
}
.title-bar .title {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
  font: inherit;
}
.title-bar .controls {
  display: flex;
  gap: 2px;
  flex: none;
}
.tb-btn {
  width: 34px;
  height: 30px;
  display: grid;
  place-items: center;
  background: var(--face);
  box-shadow: var(--button);
}
.tb-btn + .tb-btn.close {
  margin-left: 4px;
}
.tb-btn img {
  width: 16px;
  height: 14px;
}
.tb-btn img.max {
  width: 18px;
  height: 18px;
}
a.tb-btn:active {
  box-shadow: var(--pressed);
}

/* menu bar doubles as the site nav */
.menu-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 4px 0;
  font: 500 19px/1.2 var(--pixel);
}
.menu-bar a {
  color: #000;
  text-decoration: none;
  padding: 5px 12px 6px;
}
.menu-bar a u {
  text-underline-offset: 3px;
}
.menu-bar a:hover,
.menu-bar a:focus-visible {
  background: var(--navy);
  color: #fff;
  outline: none;
}
.menu-bar a[aria-current="page"] {
  box-shadow: var(--field);
}
.menu-bar a[aria-current="page"]:hover {
  box-shadow: none;
}

.canvas {
  background: #fff;
  padding: 4px;
  box-shadow: var(--sunken);
}
.canvas-inner {
  padding: 22px 24px 28px;
}

.status-bar {
  display: flex;
  gap: 4px;
  margin-top: 4px;
  font: 500 15px/1.3 var(--pixel);
}
.status-bar > * {
  padding: 5px 8px;
  box-shadow: var(--field);
  margin: 0;
}
.status-bar > :first-child {
  flex: 1;
  min-width: 0;
}
.status-bar a {
  color: #000;
}

/* the MS Paint colour box */
.palette {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 6px;
}
.palette .current {
  position: relative;
  width: 46px;
  height: 46px;
  flex: none;
  background: var(--face);
  box-shadow: var(--sunken);
}
.palette .current span {
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid var(--face);
  box-shadow: 0 0 0 2px var(--shadow);
}
.palette .current .fg {
  left: 7px;
  top: 7px;
  background: #804000;
  z-index: 1;
}
.palette .current .bg {
  right: 7px;
  bottom: 7px;
  background: #fff;
}
.palette .swatches {
  display: grid;
  grid-template-columns: repeat(14, 1fr);
  gap: 3px;
  flex: 1;
  max-width: 560px;
}
.palette .swatches span {
  aspect-ratio: 1;
  min-width: 0;
  box-shadow: var(--field);
  border: 2px solid transparent;
  background-clip: padding-box;
}

/* ---------- buttons, boxes ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px 12px;
  background: var(--face);
  color: #000 !important;
  font: 700 18px/1.2 var(--pixel);
  text-decoration: none;
  border: 0;
  box-shadow: var(--button);
  cursor: pointer;
}
.btn:active {
  box-shadow: var(--pressed);
}
.btn img {
  width: 32px;
  height: 32px;
}
.btn[aria-disabled="true"] {
  cursor: default;
}

.tip {
  background: var(--tip);
  border: 2px solid #000;
  padding: 14px 18px;
}

.groupbox {
  position: relative;
  border: 2px solid var(--shadow);
  box-shadow: 2px 2px 0 var(--hi), inset 2px 2px 0 var(--hi);
  padding: 22px 18px 16px;
  margin: 28px 0 0;
}
.groupbox > .legend {
  position: absolute;
  top: -14px;
  left: 12px;
  background: #fff;
  padding: 0 6px;
  font: 700 18px/1.4 var(--pixel);
  margin: 0;
}

/* ---------- home page ---------- */

.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px 20px;
}
.hero .logo {
  width: 294px;
  height: auto;
  display: block;
}
.hero h1 {
  margin: 0;
}
.hero .tagline {
  font: 700 22px/1.3 var(--pixel);
  color: var(--navy);
  margin: 14px 0 0;
}
.hero .art {
  position: relative;
  width: 214px;
  height: 230px;
}
.hero .art .sun {
  position: absolute;
  right: -10px;
  top: -14px;
  width: 114px;
}
.mascot {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 214px;
  height: 194px;
}
.mascot img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.mascot .wave {
  animation: wave 1.1s steps(1, end) infinite;
}
@keyframes wave {
  0% {
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 1;
  }
}

.pitch {
  font-size: 21px;
  margin: 22px 0 0;
  max-width: 36em;
}
.cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  margin: 24px 0 6px;
}
.cta .note {
  font: 500 16px/1.3 var(--pixel);
  color: #404040;
}

.cards {
  list-style: none;
  padding: 0;
  margin: 34px 0 0;
  display: grid;
  gap: 18px;
}
.card {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 4px 16px;
  align-items: start;
  padding: 14px 18px 16px;
  border: 4px solid #000;
  box-shadow: 4px 4px 0 #000;
}
.card img {
  width: 48px;
  height: 48px;
  grid-row: span 2;
  margin-top: 2px;
}
.card h3 {
  margin: 0;
  font: 700 23px/1.25 var(--comic);
}
.card p {
  margin: 0;
}
.card.yellow {
  background: #ffff00;
}
.card.cyan {
  background: #00ffff;
}
.card.green {
  background: #00ff00;
}
.card.pink {
  background: #ff80c0;
}
.card.orange {
  background: #ff8040;
}
.card.purple {
  background: #8080ff;
}
.card.paper {
  background: #ffff80;
}

.shots-title,
.section-title {
  font: 700 24px/1.3 var(--pixel);
  margin: 40px 0 14px;
}
.shots {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 4px 4px 14px;
  margin: 0 -4px;
  list-style: none;
}
.shots li {
  flex: 0 0 auto;
  scroll-snap-align: start;
  margin: 0;
}
.shots figure {
  margin: 0;
}
.shots img {
  display: block;
  width: 214px;
  height: auto;
  border: 2px solid #000;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.35);
}
.shots figcaption {
  font: 500 16px/1.3 var(--pixel);
  margin-top: 8px;
  max-width: 214px;
}

.follow .section-title {
  margin-bottom: 4px;
}
.follow-note {
  margin: 0;
}
.socials {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
}
.socials li {
  margin: 0;
}
.socials .btn {
  width: 100%;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px 14px 11px;
}
.socials .btn span {
  font: 500 15px/1.2 var(--pixel);
  color: #404040;
}

.note-small {
  font-size: 15px;
  color: #404040;
  margin: 26px 0 0;
}

.grass {
  height: 36px;
  margin: 26px -24px -28px;
  background: url("img/grass.png") repeat-x left bottom / 80px 36px;
  image-rendering: pixelated;
}

/* ---------- text pages ---------- */

.doc {
  max-width: 40em;
}
.doc-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 8px;
}
.doc-head img {
  width: 64px;
  height: 64px;
  flex: none;
}
.doc h1 {
  font: 700 32px/1.15 var(--pixel);
  color: var(--navy);
  margin: 0;
}
.doc .updated {
  font: 500 16px/1.3 var(--pixel);
  color: #404040;
  margin: 4px 0 0;
}
.doc h2 {
  font: 700 23px/1.25 var(--pixel);
  color: var(--navy);
  margin: 34px 0 8px;
  scroll-margin-top: 16px;
}
.doc h3 {
  font: 700 20px/1.3 var(--comic);
  margin: 22px 0 4px;
}
.doc p,
.doc ul,
.doc ol {
  margin: 8px 0 0;
}
.doc ul,
.doc ol {
  padding-left: 1.3em;
}
.doc li + li {
  margin-top: 4px;
}
.doc .tip {
  margin-top: 20px;
}
.doc .tip h2 {
  margin-top: 0;
}
.path {
  font: 500 0.92em/1 var(--pixel);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  background: #eeeeee;
  padding: 1px 5px;
  border: 1px solid #c0c0c0;
}

.topics {
  columns: 2 16em;
  column-gap: 28px;
  padding-left: 0 !important;
  list-style: none;
}
.topics li {
  break-inside: avoid;
  padding-left: 26px;
  background: url("img/icon-notes.png") no-repeat 0 5px / 18px 18px;
}

.faq h2 {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.faq h2 img {
  width: 28px;
  height: 28px;
  flex: none;
  margin-top: 1px;
}

.contact {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 20px;
  align-items: center;
}

/* ---------- small screens ---------- */

@media (max-width: 640px) {
  body {
    font-size: 17px;
  }
  .desktop {
    padding: 12px 8px 20px;
  }
  .canvas-inner {
    padding: 16px 14px 22px;
  }
  .grass {
    margin: 22px -14px -22px;
  }
  .title-bar {
    font-size: 16px;
  }
  .tb-btn {
    width: 30px;
    height: 27px;
  }
  .tb-btn.min,
  .tb-btn.max {
    display: none;
  }
  .menu-bar {
    font-size: 18px;
  }
  .menu-bar a {
    padding: 5px 9px 6px;
  }
  .hero {
    grid-template-columns: 1fr;
  }
  .hero .art {
    order: -1;
    justify-self: end;
    width: 160px;
    height: 160px;
    margin-bottom: -14px;
  }
  .hero .art .sun {
    width: 76px;
    right: -4px;
    top: -8px;
  }
  .mascot {
    width: 143px;
    height: 129px;
  }
  .hero .logo {
    width: 294px;
  }
  .pitch {
    font-size: 19px;
  }
  .doc h1 {
    font-size: 27px;
  }
  .doc-head img {
    width: 48px;
    height: 48px;
  }
  .palette .current {
    display: none;
  }
  .status-bar > :last-child:not(:first-child) {
    display: none;
  }
}

@media (min-width: 900px) {
  .hero .logo {
    width: 441px;
  }
  .cards {
    grid-template-columns: 1fr 1fr;
  }
  .cards .card.wide {
    grid-column: span 2;
  }
  .shots {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    overflow: visible;
  }
  .shots img {
    width: 100%;
  }
  .shots figcaption {
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mascot .wave {
    animation: none;
    opacity: 0;
  }
}

@media print {
  html,
  body {
    background: #fff;
  }
  .desktop {
    padding: 0;
  }
  .window {
    box-shadow: none;
    padding: 0;
  }
  .title-bar,
  .menu-bar,
  .status-bar,
  .palette {
    display: none;
  }
  .canvas {
    box-shadow: none;
  }
}
