/* Your own rules. This file loads after Tailwind and daisyUI, so it wins a tie.
 * Reach for a utility class first; write CSS here when no utility can do it. */

/* ============================================================ PALETTE
 *
 * "…"
 *
 * Name the mood in a sentence — "a chalkboard menu in a room that smells like
 * bread" — then list your colors and the job each one does. This block is what
 * you check later decisions against.
 *
 *   primary   #______   the action color: the button, number one, the marks
 *   base-100  #______   the page ground
 *   base-200  #______   cards and sections that step forward from the ground
 *   base-300  #______   the footer, and the photo slots
 */

/* Redeclare the theme's colors here to make them yours. Change `retro` to the
 * theme on <html>. Measure both: white on your primary, and your primary as
 * text on the page. Each needs 4.5:1. */
[data-theme='retro'] {
  /* --color-primary: #______; */
  /* --color-primary-content: #______; */
}

/* ============================================================ TYPE
 *
 * Two faces at most: one for headings, one for body. The Google Fonts <link>
 * goes in the <head>, above this file.
 */
/*
body { font-family: '______', system-ui, sans-serif; }
h1, h2, h3 { font-family: '______', system-ui, sans-serif; }
*/

/* ============================================================ SHARED BITS */

/* Base-content, not primary: many themes' primary is a pastel meant for fills,
 * and it fails contrast as small text. Measure before you change it. */
.eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-base-content);
  margin-bottom: 0.5rem;
}

.section-title {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.section-support {
  color: var(--color-base-content);
  max-width: 46ch;
}

/* Read aloud, not shown: the big 06 is hidden from screen readers, so each
 * heading carries its rank in words. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* The skip link: off-screen until a keyboard user tabs to it. */
.skip {
  position: absolute;
  left: 0.5rem;
  top: -4rem;
  z-index: 60;
  padding: 0.6rem 1rem;
  border-radius: 0.5rem;
  background: var(--color-primary);
  color: var(--color-primary-content);
  font-weight: 600;
  transition: top 0.15s ease;
}

.skip:focus {
  top: 0.5rem;
}

/* ============================================================ THE NAVBAR */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--color-base-100);
  border-bottom: 1px solid color-mix(in oklab, var(--color-base-content) 12%, transparent);
  transition: background 0.3s ease, border-color 0.3s ease, backdrop-filter 0.3s ease;
}

/* See-through over the hero only when js/reveal.js is running. */
.is-nav-ready .site-nav:not(.is-stuck) {
  background: transparent;
  border-bottom-color: transparent;
}

.is-nav-ready .site-nav.is-stuck {
  background: color-mix(in oklab, var(--color-base-100) 88%, transparent);
  backdrop-filter: blur(10px);
}

.site-nav-inner {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-nav-brand {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.site-nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

/* On a phone only the button shows, so the nav never wraps. */
.site-nav-links > a:not(.btn) {
  display: none;
  font-weight: 500;
}

.site-nav-links > a:not(.btn):hover {
  color: var(--color-primary);
}

@media (min-width: 48rem) {
  .site-nav-links > a:not(.btn) {
    display: inline;
  }
}

/* ============================================================ THE HERO */

.hero-stage {
  position: relative;
  min-height: 78vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 9rem 1.5rem 7rem;
  overflow: hidden;
  margin-top: -4rem; /* slides the hero up under the sticky navbar */
}

/* Three radial gradients on a linear one, in your theme's colors. Move the
 * percentages to move the glows. Swap it for a photo you may use. */
.hero-mesh {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-color: var(--color-base-200);
  background-image:
    radial-gradient(at 18% 22%, color-mix(in oklch, var(--color-primary) 45%, transparent) 0px, transparent 55%),
    radial-gradient(at 82% 18%, color-mix(in oklch, var(--color-secondary) 40%, transparent) 0px, transparent 50%),
    radial-gradient(at 60% 88%, color-mix(in oklch, var(--color-accent) 35%, transparent) 0px, transparent 55%),
    linear-gradient(165deg, var(--color-base-100), var(--color-base-200));
}

.hero-body {
  position: relative;
  z-index: 1;
  max-width: 52rem;
}

.hero-badge {
  margin-bottom: 1.5rem;
  background: color-mix(in oklab, var(--color-base-100) 80%, transparent);
  border-color: color-mix(in oklab, var(--color-base-content) 20%, transparent);
}

.hero-title {
  font-size: clamp(2.25rem, 7vw, 4.5rem);
  font-weight: 900;
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
  text-wrap: balance; /* even lines at every width; no <br> needed */
}

/* The highlighter behind [your subject]. `clone` repeats it on every line when
 * the phrase wraps. */
.hero-mark {
  background-image: linear-gradient(to top, color-mix(in oklch, var(--color-primary) 40%, transparent) 32%, transparent 32%);
  padding-inline: 0.15em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.hero-support {
  font-size: 1.125rem;
  color: var(--color-base-content);
  max-width: 40rem;
  margin: 0 auto 2rem;
}

.hero-cue {
  position: absolute;
  bottom: 2rem;
  z-index: 1;
  width: 1.6rem;
  height: 2.6rem;
  border: 2px solid color-mix(in oklab, var(--color-base-content) 40%, transparent);
  border-radius: 1rem;
  display: flex;
  justify-content: center;
  padding-top: 0.4rem;
}

.hero-cue-dot {
  width: 0.3rem;
  height: 0.55rem;
  border-radius: 1rem;
  background: var(--color-base-content);
  animation: cue 1.8s ease-in-out infinite;
}

@keyframes cue {
  0%, 100% { transform: translateY(0); opacity: 0.9; }
  50% { transform: translateY(0.5rem); opacity: 0.3; }
}

/* ============================================================ THE LIST */

.list-wrap {
  max-width: 72rem;
  margin: 0 auto;
  padding: 5rem 1.5rem;
}

.list-head {
  margin-bottom: 3rem;
}

.list-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
}

/* Two columns: 02 is alone on its row, so it sits centered. */
@media (min-width: 48rem) {
  .list-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .entry:nth-child(5) {
    grid-column: 1 / -1;
    justify-self: center;
    width: calc(50% - 0.75rem);
  }
}

/* Three across: six narrow tracks, each card spans two, and 03 and 02 start
 * one track in so they center under the three above. */
@media (min-width: 64rem) {
  .list-grid {
    grid-template-columns: repeat(6, 1fr);
  }

  .entry {
    grid-column: span 2;
  }

  .entry:nth-child(4) {
    grid-column: 2 / span 2;
  }

  .entry:nth-child(5) {
    grid-column: 4 / span 2;
    justify-self: stretch;
    width: auto;
  }
}

.entry-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 1rem;
  background: var(--color-base-200);
  border: 1px solid color-mix(in oklab, var(--color-base-content) 10%, transparent);
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}

/* The lift: up, a shadow, and the border warming. All three, or none. */
.entry-card:hover,
.entry-card:focus-within {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px -18px color-mix(in oklab, var(--color-base-content) 55%, transparent);
  border-color: color-mix(in oklab, var(--color-primary) 55%, transparent);
}

/* ---------------------------------------------------------- the photo slot */

/* 4:3 keeps the grid tidy. Photos of any size get cropped to fit. */
.shot {
  position: relative;
  margin: 0;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--color-base-300);
}

.shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.entry-card:hover .shot img {
  transform: scale(1.05);
}

/* The caption slides up over the photo on hover. Keep the dark gradient: it
 * keeps white text at 6.8:1 or better over any photo. A contrast checker that
 * cannot see gradients will report about 1.6:1 here; it is wrong. */
.shot-cap {
  position: absolute;
  inset: auto 0 0 0;
  padding: 1.5rem 1rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  text-align: left;
  background: linear-gradient(to top, rgb(0 0 0 / 0.82), rgb(0 0 0 / 0.55) 60%, transparent);
  transform: translateY(101%);
  transition: transform 0.35s ease;
}

.entry-card:hover .shot-cap,
.entry-card:focus-within .shot-cap {
  transform: translateY(0);
}

/* ---------------------------------------------------------------- the body */

/* The right padding keeps the words out from under the big rank numeral. */
.entry-body {
  position: relative;
  padding: 1.5rem;
  padding-right: 5.5rem;
  flex: 1;
}

/* The rank numeral: big, in the corner, behind the words. Keep it at 70% or
 * more; fainter and it fails contrast. */
.rank {
  position: absolute;
  top: -0.35rem;
  right: 0.75rem;
  font-size: 4rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums; /* 06 and 01 are the same width */
  color: color-mix(in oklab, var(--color-base-content) 70%, transparent);
  pointer-events: none;
  transition: color 0.35s ease;
}

.entry-card:hover .rank {
  color: var(--color-base-content);
}

.entry-title {
  position: relative;
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.entry-note {
  position: relative;
  color: var(--color-base-content);
}

/* -------------------------------------------------------------- number one */

@media (min-width: 48rem) {
  .rank {
    font-size: 5rem;
  }

  .entry-one {
    grid-column: 1 / -1;
  }

  .entry-one .entry-card {
    flex-direction: row;
  }

  .entry-one .shot {
    flex: 0 0 45%;
    aspect-ratio: auto;
  }

  .entry-one .entry-body {
    padding: 2.5rem;
    padding-right: 8.5rem;
    align-self: center;
  }

  .entry-one .rank {
    font-size: 7rem;
  }
}

.entry-one .entry-card {
  position: relative;
  background: var(--color-primary);
  color: var(--color-primary-content);
  border-color: transparent;
}

.entry-one .eyebrow,
.entry-one .entry-note {
  color: var(--color-primary-content);
}

.entry-one .entry-title {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
}

.entry-one .rank {
  color: color-mix(in oklab, var(--color-primary-content) 85%, transparent);
}

.entry-one .entry-card:hover .rank {
  color: var(--color-primary-content);
}

/* THE SWEEP: one band of light crosses number one, once, after its countdown.
 * Change the 0.45 for a brighter or fainter band. */
.is-reveal-ready .entry-one.is-in .entry-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgb(255 255 255 / 0.45) 50%, transparent 65%);
  transform: translateX(-100%);
  animation: sweep 1.1s ease-in-out 0.7s forwards;
  pointer-events: none;
}

@keyframes sweep {
  to { transform: translateX(100%); }
}

/* ============================================================ METHOD */

.method {
  background: var(--color-base-200);
  border-top: 1px solid color-mix(in oklab, var(--color-base-content) 10%, transparent);
}

.method-inner {
  max-width: 72rem;
  margin: 0 auto;
  padding: 5rem 1.5rem;
}

.method-cols {
  display: grid;
  gap: 2rem;
  margin-top: 2rem;
  grid-template-columns: 1fr;
}

@media (min-width: 48rem) {
  .method-cols {
    grid-template-columns: repeat(3, 1fr);
  }
}

.method-h {
  font-weight: 700;
  margin-bottom: 0.4rem;
}

/* ============================================================ THE FOOTER */

.site-foot {
  background: var(--color-base-300);
}

.site-foot-inner {
  max-width: 72rem;
  margin: 0 auto;
  padding: 3rem 1.5rem;
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr;
}

@media (min-width: 48rem) {
  .site-foot-inner {
    grid-template-columns: repeat(2, 1fr);
  }
}

.site-foot-title {
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.credits {
  font-size: 0.875rem;
  line-height: 1.7;
}

.credits a {
  text-decoration: underline;
}

/* ============================================================ THE REVEAL */

/* Hidden only once js/reveal.js has added .is-reveal-ready, so a page with no
 * script never hides anything. */
.is-reveal-ready [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.is-reveal-ready [data-reveal].is-in {
  opacity: 1;
  transform: none;
}

/* ============================================================ EVERYTHING ELSE */

/* Anchors land below the sticky navbar. Change the navbar's height, change this. */
:target {
  scroll-margin-top: 5rem;
}

html {
  scroll-behavior: smooth;
}

/* Reduced motion: nothing slides, bobs or fades. Keep this block, and add
 * every new animation to it. */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .hero-cue-dot {
    animation: none;
  }

  .entry-card,
  .shot img,
  .shot-cap,
  .rank {
    transition: none;
  }

  .entry-card:hover,
  .entry-card:hover .shot img {
    transform: none;
  }

  .is-reveal-ready [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .is-reveal-ready .entry-one.is-in .entry-card::after {
    display: none;
  }
}
