/* AO Tracker. One typeface (Archivo, wide and heavy for numbers), three colors. */

@font-face {
  font-family: "Archivo";
  src: url("/fonts/archivo-var-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

:root {
  --yellow: #ffd60a;
  --black: #000;
  --white: #fff;

  --bg: var(--white);
  --fg: var(--black);
  --mute: #595959;
  --line: #dcdcdc;
  --block-bg: var(--black);
  --block-fg: var(--white);
  --block-mute: #b5b5b5;
  --good: #0a6b33;
  --bad: #b3261e;

  --pad: clamp(20px, 5vw, 56px);
  --radius: 16px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--black);
    --fg: var(--white);
    --mute: #b0b0b0;
    --line: #333;
    --block-bg: #1b1b1b;
    --block-mute: #b5b5b5;
    --good: #5fd08c;
    --bad: #ff8a80;
  }
}

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

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.125rem;
  font-weight: 450;
  line-height: 1.5;
}

h1, h2, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
a { color: inherit; }

.wrap {
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: var(--pad);
}

.skip {
  position: absolute;
  left: 12px;
  top: -80px;
  z-index: 10;
  padding: 10px 16px;
  background: var(--black);
  color: var(--white);
  border-radius: 999px;
  font-weight: 700;
}
.skip:focus { top: 12px; }

:focus-visible {
  outline: 3px solid var(--fg);
  outline-offset: 3px;
  border-radius: 6px;
}
.hero :focus-visible { outline-color: var(--black); }
.goals :focus-visible { outline-color: var(--yellow); }

/* ---------- hero: this month ---------- */

.hero {
  background: var(--yellow);
  color: var(--black);
  padding-block: 22px clamp(40px, 7vw, 80px);
  overflow: hidden;
}

.bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 20px;
}
.mark {
  font-weight: 850;
  font-stretch: 112%;
  font-size: 1.15rem;
  text-decoration: none;
  letter-spacing: -0.01em;
}
.tabs { display: flex; gap: 8px; }
.tabs a {
  padding: 5px 16px;
  border: 2px solid var(--black);
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
}
.tabs a[aria-current="page"] { background: var(--black); color: var(--yellow); }
.stamp { margin-left: auto; font-size: 1rem; font-weight: 550; }

.late {
  margin-top: 18px;
  padding: 12px 16px;
  background: var(--black);
  color: var(--white);
  border-radius: 12px;
  font-weight: 600;
}

.hero-body { padding-top: clamp(28px, 6vw, 64px); }
.loading { font-size: 1.5rem; font-weight: 700; }

.who {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 18px;
}
.who h1 {
  font-size: clamp(1.7rem, 3.4vw, 2.4rem);
  font-weight: 850;
  font-stretch: 112%;
  line-height: 1.1;
  letter-spacing: -0.015em;
}
.who a { font-weight: 600; text-underline-offset: 3px; }

.count {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 0 clamp(14px, 2.5vw, 34px);
  margin-top: clamp(10px, 2vw, 22px);
}
.numeral {
  font-size: clamp(8.5rem, 27vw, 19rem);
  font-weight: 900;
  font-stretch: 125%;
  line-height: 0.78;
  letter-spacing: -0.045em;
  margin-left: -0.04em;
  padding-bottom: 0.04em;
}
.count-words {
  font-size: clamp(1.7rem, 4.6vw, 3.5rem);
  font-weight: 850;
  font-stretch: 112%;
  line-height: 1.02;
  letter-spacing: -0.02em;
  padding-bottom: 0.14em;
}
.count-words span { display: block; }

.slots {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(8px, 1.2vw, 14px);
  margin-top: clamp(26px, 4vw, 44px);
}
.slot {
  position: relative;
  flex: 0 0 auto;
  width: clamp(62px, 9.4vw, 112px);
  aspect-ratio: 9 / 16;
  border-radius: 14px;
}
.slot-empty {
  display: grid;
  place-items: center;
  border: 3px dashed rgb(0 0 0 / 0.55);
  color: rgb(0 0 0 / 0.6);
  font-size: clamp(1.3rem, 2.6vw, 2rem);
  font-weight: 850;
  font-stretch: 112%;
}
.slot-filled a {
  position: absolute;
  inset: 0;
  display: block;
  border: 3px solid var(--black);
  border-radius: inherit;
  overflow: hidden;
  background: var(--black);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.slot-filled a:hover { transform: translate(-3px, -3px); box-shadow: 6px 6px 0 var(--black); }
.slot-filled img { width: 100%; height: 100%; object-fit: cover; }
.slot-day {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 3px 2px 4px;
  background: var(--black);
  color: var(--yellow);
  font-size: 0.85rem;
  font-weight: 750;
  line-height: 1.2;
  text-align: center;
}

.note {
  margin-top: clamp(20px, 3vw, 30px);
  font-size: clamp(1.25rem, 2.4vw, 1.6rem);
  font-weight: 750;
  line-height: 1.3;
  max-width: 34ch;
}
.newest { margin-top: 6px; font-size: 1.125rem; font-weight: 500; }

/* The one page-load moment: the count grows wide while the covers drop into their slots. */
@keyframes widen {
  from { font-stretch: 62%; opacity: 0; }
  25% { opacity: 1; }
  to { font-stretch: 125%; opacity: 1; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes slot-in {
  from { opacity: 0; transform: scale(0.82); }
  to { opacity: 1; transform: none; }
}
@keyframes drop {
  from { opacity: 0; transform: translateY(-46px) rotate(-7deg) scale(0.9); }
  60% { opacity: 1; }
  to { opacity: 1; transform: none; }
}
.play .numeral { animation: widen 1.1s var(--ease) both; }
.play .count-words { animation: rise 0.6s var(--ease) 0.35s both; }
.play .slot-empty { animation: slot-in 0.45s var(--ease) both; animation-delay: calc(0.45s + var(--i) * 55ms); }
.play .slot-filled { animation: drop 0.6s var(--ease) both; animation-delay: calc(0.55s + var(--i) * 110ms); }
.play .note, .play .newest { animation: rise 0.6s var(--ease) 1.1s both; }

/* ---------- shared section type ---------- */

main section { padding-block: clamp(48px, 8vw, 92px); }

h2 {
  font-size: clamp(2rem, 4.4vw, 3.1rem);
  font-weight: 850;
  font-stretch: 114%;
  line-height: 1.04;
  letter-spacing: -0.02em;
}
.lead {
  margin-top: 12px;
  max-width: 44ch;
  font-size: 1.25rem;
  color: var(--mute);
}

.plain-button {
  padding: 8px 18px;
  background: transparent;
  border: 2px solid var(--fg);
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.plain-button:hover { transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--fg); }
.plain-button:active { transform: none; box-shadow: none; }

/* ---------- what was agreed ---------- */

.rules { padding-bottom: 0; }
.rule-list { margin-top: 20px; display: grid; gap: 10px; max-width: 60ch; }
.rule-list li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  align-items: start;
  font-size: 1.25rem;
  font-weight: 550;
}
.rule-list svg { width: 26px; height: 26px; margin-top: 2px; }

/* ---------- month by month ---------- */

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 14px;
  margin-top: 30px;
}
.tile {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 190px;
  padding: 14px 16px 16px;
  text-align: left;
  background: var(--bg);
  border: 2px solid var(--fg);
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.tile:hover { transform: translate(-3px, -3px); box-shadow: 5px 5px 0 var(--fg); }
.tile:active { transform: none; box-shadow: none; }
.tile-name { font-size: 1rem; font-weight: 650; }
.tile-count {
  margin-top: 6px;
  font-size: 3.4rem;
  font-weight: 900;
  font-stretch: 122%;
  line-height: 0.95;
  letter-spacing: -0.03em;
}
.tile-of { font-size: 1rem; font-weight: 550; }
.dots { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 12px; }
.dot { width: 11px; height: 11px; border-radius: 50%; background: currentColor; }
.dot-open { background: transparent; border: 2px solid currentColor; opacity: 0.55; }
.dots-more { font-size: 0.85rem; font-weight: 700; line-height: 11px; }
.tile-status {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding-top: 12px;
  font-size: 1rem;
  font-weight: 750;
}
.tile-status svg { width: 20px; height: 20px; flex: none; }
.is-met .tile-status { color: var(--good); }
.is-missed .tile-status { color: var(--bad); }

.tile.is-now { background: var(--yellow); color: var(--black); border-color: var(--black); }
.tile.is-now .tile-status { color: var(--black); }
.tile[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.tile[aria-pressed="true"] .tile-status { color: inherit; }

#older { margin-top: 22px; }

/* ---------- bonus goals ---------- */

.goals { background: var(--block-bg); color: var(--block-fg); }
.goals .lead { color: var(--block-mute); }
.goal-list {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0 22px;
  margin-top: 46px;
}
.goal-list::before,
.goal-list::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 17px;
  height: 4px;
  border-radius: 2px;
  background: #444;
}
.goal-list::after {
  background: var(--yellow);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.4s var(--ease);
}
.goals.seen .goal-list::after { transform: scaleX(1); }

.goal { position: relative; z-index: 1; }
.goal button {
  display: block;
  width: 100%;
  padding: 0 0 6px;
  text-align: left;
  background: none;
  border: 0;
  color: inherit;
  cursor: pointer;
  border-radius: 10px;
}
.goal-star {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--yellow);
  color: var(--black);
  transform: scale(0);
  transition: transform 0.5s cubic-bezier(0.3, 1.6, 0.5, 1);
  transition-delay: calc(0.15s + var(--i) * 0.3s);
}
.goals.seen .goal-star { transform: scale(1); }
.goal-star svg { width: 22px; height: 22px; }
.goal-views {
  display: block;
  margin-top: 18px;
  font-size: clamp(1.7rem, 3.2vw, 2.5rem);
  font-weight: 900;
  font-stretch: 120%;
  line-height: 1;
  letter-spacing: -0.025em;
  color: var(--yellow);
}
.goal-unit { display: block; font-size: 1rem; font-weight: 550; color: var(--block-mute); }
.goal-prize {
  display: inline-block;
  margin-top: 14px;
  padding: 3px 12px;
  border: 2px solid var(--block-fg);
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 750;
}
.goal-made { display: block; margin-top: 14px; font-weight: 650; }
.goal-covers { display: flex; margin-top: 14px; padding-left: 10px; min-height: 76px; }
.goal-covers img {
  width: 43px;
  height: 76px;
  margin-left: -10px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid var(--block-fg);
  background: #1f1f1f;
  transition: transform 0.25s var(--ease);
  transition-delay: calc(var(--n) * 35ms);
}
.goal button:hover .goal-covers img { transform: translateY(-6px) rotate(-3deg); }
.goal button:hover .goal-views { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 5px; }
.goal button[aria-pressed="true"] .goal-prize { background: var(--yellow); color: var(--black); border-color: var(--yellow); }

/* ---------- all videos ---------- */

.controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px 24px;
  margin-top: 28px;
}
.sort {
  display: inline-flex;
  padding: 4px;
  border: 2px solid var(--fg);
  border-radius: 999px;
}
.sort button {
  padding: 6px 18px;
  background: transparent;
  border: 0;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
}
.sort button[aria-pressed="true"] { background: var(--fg); color: var(--bg); }
.filter { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; font-weight: 650; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 34px 22px;
  margin-top: 34px;
}
.card a { display: block; text-decoration: none; }
.cover {
  position: relative;
  display: block;
  aspect-ratio: 9 / 16;
  border-radius: 14px;
  overflow: hidden;
  background: #1f1f1f;
  /* A thin edge so covers with black or white bars keep their shape on any page color. */
  outline: 1px solid var(--line);
  outline-offset: -1px;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.cover img { width: 100%; height: 100%; object-fit: cover; }
.card a:hover .cover,
.card a:focus-visible .cover { transform: translate(-3px, -3px); box-shadow: 6px 6px 0 var(--fg); }
.badge {
  position: absolute;
  left: 8px;
  top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px 3px 6px;
  background: var(--yellow);
  color: var(--black);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 850;
}
.badge svg { width: 15px; height: 15px; }
.watch {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 6px;
  background: var(--yellow);
  color: var(--black);
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 800;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}
.watch svg { width: 16px; height: 16px; }
.card a:hover .watch,
.card a:focus-visible .watch { opacity: 1; transform: none; }
.views {
  display: block;
  margin-top: 12px;
  font-size: 1.3rem;
  font-weight: 850;
  font-stretch: 108%;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.gain { display: block; font-size: 1rem; font-weight: 650; }
.date { display: block; margin-top: 2px; font-size: 1rem; font-weight: 550; }
.title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  margin-top: 2px;
  font-size: 1rem;
  color: var(--mute);
}
.card.is-gone .cover img { filter: grayscale(1); opacity: 0.45; }
.card.is-gone .badge { background: var(--white); }
.empty { grid-column: 1 / -1; font-size: 1.25rem; font-weight: 650; }

::view-transition-group(*) { animation-duration: 0.45s; animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1); }

/* ---------- footer ---------- */

.foot { padding-block: 28px 44px; border-top: 2px solid var(--fg); }
.foot p { max-width: 62ch; font-size: 1rem; color: var(--mute); }

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

@media (max-width: 760px) {
  body { font-size: 1.0625rem; }
  .stamp { margin-left: 0; width: 100%; }
  .goal-list { grid-template-columns: 1fr; gap: 30px; padding-left: 58px; }
  .goal-list::before,
  .goal-list::after { left: 17px; right: auto; top: 0; bottom: 0; width: 4px; height: auto; }
  .goal-list::after { transform: scaleY(0); transform-origin: top; }
  .goals.seen .goal-list::after { transform: scaleY(1); }
  .goal-star { position: absolute; left: -58px; top: 0; }
  .goal-views { margin-top: 0; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 28px 14px; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .watch { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0s !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0s !important;
  }
}
