/* Landing page chapters: how it works, the video, the course deck, daily habit, about and join. */

/* ---------- How it works: the six step kinds, grouped as the app groups them ---------- */

.stage-map {
  display: grid;
  gap: 32px;
  margin-top: clamp(48px, 6vw, 80px);
}

/* A real heading for its group, at the lead size, not a small kicker. */
.stage-group-title {
  margin-bottom: 14px;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.01em;
}

.stage-bar {
  display: flex;
  gap: 6px;
}

.stage {
  flex: var(--steps) 1 0;
  min-width: 12%;
}

.stage-block {
  display: block;
  height: clamp(140px, 22vh, 220px);
  padding: 18px 20px;
  border-radius: var(--radius);
  background: var(--seg);
  color: var(--seg-ink, #ffffff);
  font-size: var(--t-h3);
  font-weight: 900;
  line-height: 1.1;
}

.stage p {
  max-width: 22ch;
  margin-top: 16px;
  padding-right: 12px;
  font-size: var(--t-body);
  line-height: 1.45;
}

.stage-note {
  max-width: 52em;
  margin-top: 40px;
  color: var(--soft);
  font-size: var(--t-small);
}

@media (min-width: 900px) {
  .stage-map {
    grid-template-columns: 4fr 2fr;
    gap: 6px;
  }
}

@media (max-width: 899px) {
  .stage-bar {
    flex-direction: column;
  }

  .stage {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 120px;
    padding: 16px 18px 18px;
    border-radius: var(--radius);
    background: var(--seg);
    color: var(--seg-ink, #ffffff);
  }

  .stage-block {
    height: auto;
    padding: 0;
    background: none;
    font-size: 22px;
  }

  .stage p {
    max-width: 40ch;
    margin-top: 10px;
    padding: 0;
    font-size: 16px;
  }
}

/* ---------- The real app: the 30-second recording ---------- */

.film-head {
  display: grid;
  gap: 24px;
  align-items: end;
}

.film-head h2 {
  max-width: 12em;
}

.film-frame {
  margin-top: clamp(40px, 5vw, 64px);
  border-radius: var(--radius);
  background: #0b1114;
  overflow: hidden;
}

.film-frame video {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
}

@media (min-width: 1024px) {
  .film-head {
    grid-template-columns: repeat(12, 1fr);
    gap: var(--gap);
  }

  .film-head h2 {
    grid-column: 1 / span 7;
  }
}

/* ---------- Course: unit cards that fold into spines ---------- */

.course-head {
  max-width: 900px;
}

.deck {
  display: grid;
  gap: 12px;
  margin-top: clamp(40px, 5vw, 64px);
}

.unit-card {
  display: flex;
  flex-direction: column;
  min-height: 300px;
  padding: 28px 30px;
  border-radius: var(--radius);
  background: var(--unit);
  color: #ffffff;
}

.unit-body {
  display: flex;
  flex: 1;
  flex-direction: column;
}

.unit-card h3 {
  font-size: var(--t-h3);
}

.spine {
  display: none;
}

.unit-card p {
  max-width: 34ch;
  margin-top: 12px;
}

.unit-lessons {
  margin-top: auto;
  padding-top: 28px;
  font-weight: 800;
}

.unit-card .unit-n {
  margin-top: 6px;
  font-size: var(--t-small);
  font-weight: 900;
}

.deck-foot {
  margin-top: 40px;
  font-size: var(--t-body);
}

@media (min-width: 700px) {
  .deck {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Cards waiting off to the right are clipped at the screen edge; clip (not hidden) keeps the pin sticky. */
#course {
  overflow-x: clip;
}

/* Pinned on large screens: js/deck.js adds .deck-live and drives each card's position. */
.deck-live {
  height: calc(100svh + 150svh);
}

.deck-live .course-stage {
  position: sticky;
  top: var(--header-h);
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: calc(100svh - var(--header-h));
  padding-block: 32px;
}

.deck-live .deck {
  position: relative;
  display: block;
  height: 360px;
  margin-top: 48px;
}

.deck-live .unit-card {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--card-w);
  height: 100%;
  min-height: 0;
  will-change: transform, clip-path;
}

.deck-live .unit-card.folded {
  cursor: pointer;
}

/* As a card folds, its body fades and its title appears along the spine, like a book on a shelf. */
.deck-live .unit-body {
  opacity: var(--body, 1);
}

.deck-live .unit-card.veiled .unit-body {
  visibility: hidden;
}

.deck-live .spine {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  width: var(--spine-w);
  height: 100%;
  padding: 28px 0;
  overflow: hidden;
  font-size: 20px;
  font-weight: 900;
  line-height: var(--spine-w);
  white-space: nowrap;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  opacity: var(--spine, 0);
  visibility: hidden;
  pointer-events: none;
}

.deck-live .unit-card.spined .spine {
  visibility: visible;
}

/* ---------- Daily habit: close-ups of real app parts on a board ---------- */

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

.tile {
  --tile-pad: 20px;
  position: relative;
  container-type: inline-size;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 250px;
  padding: var(--tile-pad);
  border-radius: var(--radius);
  background: var(--tile);
  color: var(--tile-ink, #ffffff);
  overflow: hidden;
}

.tile > b {
  margin-top: auto;
}

.tile-head {
  min-height: 0;
  padding-block: 28px;
}

.tile-big {
  min-height: 330px;
}

@media (min-width: 600px) and (max-width: 899px) {
  .board {
    grid-template-columns: repeat(2, 1fr);
  }

  .tile-head,
  .tile-big {
    grid-column: 1 / -1;
  }
}

.tile b {
  position: relative;
  display: block;
  font-size: var(--t-body);
  font-weight: 900;
  line-height: 1.25;
}

.tile span.line {
  position: relative;
  display: block;
  max-width: 34ch;
  font-size: var(--t-small);
  line-height: 1.4;
}

/* One placement rule. An in-flow close-up starts at the tile's top-left padding corner and is sized
   so its --span (its width in em) fills the tile, up to --zoom-max; it is never cropped. A mark
   is centred in the space above the tile's text. */
.closeup {
  position: relative;
  align-self: flex-start;
  margin-bottom: 12px;
  font-size: min(var(--zoom-max), calc(100cqi / var(--span)));
  line-height: 1;
  pointer-events: none;
}

.closeup-mark {
  --mark: min(44cqi, 160px);
  align-self: center;
  width: var(--mark);
  height: var(--mark);
  margin-block: auto;
  font-size: var(--mark);
}

.streak-week {
  --zoom-max: 88px;
  display: flex;
  gap: 0.22em;
}

.streak-day {
  display: grid;
  justify-items: center;
  gap: 0.12em;
  font-size: 1em;
}

.streak-day i {
  display: grid;
  place-items: center;
  width: 1em;
  height: 1em;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: transparent;
}

.streak-day.done i {
  background: var(--flame);
  color: #ffffff;
}

.streak-day.shield i {
  background: var(--sky);
  color: var(--night);
}

.streak-day .icon {
  width: 0.56em;
  height: 0.56em;
}

.streak-day small {
  font-size: 0.24em;
  font-weight: 900;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25em;
  padding: 0.25em 0.5em;
  border-radius: 0.3em;
  font-weight: 900;
  white-space: nowrap;
}

.chip .icon {
  width: 0.8em;
  height: 0.8em;
}

.xp-chip,
.notquite {
  --zoom-max: 56px;
}

.xp-chip .chip {
  background: var(--gold);
  color: var(--ink);
}

.notquite .chip {
  background: var(--amber);
  color: var(--ink);
}

.review-mark {
  color: rgba(255, 255, 255, 0.92);
}

.review-mark .icon {
  stroke-width: 2.6;
}

.bounty-row {
  --zoom-max: 44px;
}

.bounty-row .chip {
  background: var(--night-raised);
  color: var(--night-ink);
}

.bounty-row .icon {
  color: var(--lime);
}

.shield-mark {
  color: var(--blue);
}

.sets-row {
  --zoom-max: 44px;
  display: flex;
  gap: 0.3em;
}

.sets-row .chip {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.sets-row .chip-xp {
  background: var(--gold);
  color: var(--ink);
}

@media (min-width: 900px) {
  .board {
    grid-template-columns: repeat(12, 1fr);
    grid-auto-rows: minmax(104px, auto);
    gap: 8px;
  }

  .tile {
    --tile-pad: 24px;
    min-height: 0;
  }

  .tile-tall .closeup-mark {
    --mark: min(72cqi, 220px);
  }

  .tile-head {
    grid-column: 1 / span 6;
    grid-row: 1 / span 2;
  }

  .tile-head h2 {
    font-size: var(--t-h2);
  }

  .tile-big {
    grid-column: 7 / span 6;
    grid-row: 1 / span 4;
  }

  .tile-a {
    grid-column: 1 / span 3;
    grid-row: 3 / span 2;
  }

  .tile-b {
    grid-column: 4 / span 3;
    grid-row: 3 / span 2;
  }

  .tile-c {
    grid-column: 1 / span 3;
    grid-row: 5 / span 4;
  }

  .tile-d {
    grid-column: 4 / span 6;
    grid-row: 5 / span 2;
  }

  .tile-e {
    grid-column: 10 / span 3;
    grid-row: 5 / span 4;
  }

  .tile-f {
    grid-column: 4 / span 6;
    grid-row: 7 / span 2;
  }
}

/* ---------- About: an inset night panel. Who builds it, why to trust it, who it's for ---------- */

.about {
  padding: 8px;
}

@media (min-width: 700px) {
  .about {
    padding: 20px;
  }
}

.about-panel {
  position: relative;
  display: grid;
  gap: clamp(20px, 2.4vw, 32px);
  padding: clamp(24px, 3vw, 40px);
  border-radius: var(--radius);
  background: var(--night);
  color: var(--night-ink);
  overflow: hidden;
  --focus: var(--sky);
}

.about-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--gap);
  align-items: start;
}

.about-panel h2 {
  max-width: 11em;
  font-size: clamp(32px, 3.6vw, 52px);
}

.about-intro p {
  max-width: 62em;
  margin-top: 14px;
  color: #c9d5dd;
}

.about-intro a,
.promise-link a {
  color: var(--night-ink);
  font-weight: 900;
}

.nodi {
  width: clamp(72px, 10vw, 120px);
  height: auto;
  border-radius: 22%;
}

/* Phones: Nodi sits above the headline so the intro keeps the full width. */
@media (max-width: 479px) {
  .about-head {
    grid-template-columns: 1fr;
  }

  .nodi {
    order: -1;
    width: 72px;
  }
}

.promise,
.about-blocks {
  display: grid;
  gap: var(--gap);
}

.promise-tile {
  padding: clamp(18px, 2vw, 24px);
  border-radius: var(--radius);
  background: var(--night-raised);
}

.promise-tile h3,
.about-blocks h3 {
  margin-bottom: 14px;
}

.point-list b {
  color: var(--night-ink);
  font-weight: 900;
}

.promise-link {
  margin-top: 18px;
  color: #c9d5dd;
}

@media (min-width: 900px) {
  .promise,
  .about-blocks {
    grid-template-columns: repeat(2, 1fr);
  }
}

.fit-list {
  display: grid;
  gap: 10px;
}

.fit-list li {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 10px;
  color: #c9d5dd;
  font-size: var(--t-body);
}

.fit-list .icon {
  width: 20px;
  height: 20px;
  margin-top: 4px;
}

.fit-yes .icon {
  color: var(--lime);
}

.fit-no .icon {
  color: var(--amber);
}

/* ---------- Follow: social channels as large pill links ---------- */

.follow {
  padding-block: clamp(40px, 5vw, 64px);
}

.follow-grid {
  display: grid;
  gap: clamp(16px, 3vw, 40px);
  align-items: center;
}

.follow-copy h2 {
  font-size: clamp(32px, 3.6vw, 52px);
  line-height: 1;
}

.follow-copy .lead {
  margin-top: 12px;
  font-size: 18px;
}

.follow-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.follow-list a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
  transition: background-color 160ms, color 160ms;
}

.follow-list a:hover {
  background: var(--ink);
  color: var(--gold);
}

.follow-list .icon {
  width: 18px;
  height: 18px;
}

@media (min-width: 1024px) {
  .follow-grid {
    grid-template-columns: 5fr 7fr;
  }
}
