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

@font-face {
  font-family: "Fredoka";
  src: url("assets/fonts/Fredoka-SemiBold.ttf") format("truetype");
  font-style: normal;
  font-weight: 600;
  font-display: block;
}

@page {
  size: 4.5in 8in;
  margin: 0;
}

:root {
  --navy: #174A7E;
  --ink: #164069;
  --warm: #FBF6EF;
  --turquoise: #D2F9F6;
  --yellow: #F2B705;
  --white: #FFFFFF;
  --muted: #52718D;
  --line: #CBE9E5;
  --screen-scale: 1;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  background: #DDE8EA;
}

body {
  width: min(432px, 100%);
  margin: 0 auto;
  background: transparent;
  color: var(--ink);
  font-family: "Fredoka", sans-serif;
  font-size: 22px;
  font-weight: 400;
  line-height: 1.42;
  zoom: var(--screen-scale);
}

@media screen and (max-width: 431px) {
  body {
    width: 432px;
    margin-left: 8px;
    margin-right: 8px;
  }
}

a {
  color: inherit;
}

a:focus-visible {
  outline: 4px solid var(--yellow);
  outline-offset: 3px;
}

.book {
  display: grid;
  gap: 18px;
  padding: 12px 0;
}

.page {
  position: relative;
  width: 432px;
  height: 768px;
  padding: 24px 24px 38px;
  overflow: hidden;
  break-after: page;
  page-break-after: always;
  background: var(--warm);
}

.page:last-child {
  break-after: auto;
  page-break-after: auto;
}

.page-inner {
  position: relative;
  height: 100%;
}

.folio {
  position: absolute;
  right: 24px;
  bottom: 12px;
  left: 24px;
  display: flex;
  justify-content: space-between;
  color: var(--navy);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.04em;
  opacity: 0.66;
}

h1,
h2,
p,
blockquote,
ol,
dl,
dd {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  color: var(--navy);
  font-size: 32px;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

h2 {
  margin-bottom: 6px;
  color: var(--navy);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.15;
}

p,
li {
  font-size: 22px;
  line-height: 1.4;
}

p {
  margin-bottom: 12px;
}

.eyebrow {
  margin-bottom: 7px;
  color: var(--navy);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: 0.04em;
}

.lede {
  font-size: 24px;
  line-height: 1.36;
}

.page-head {
  margin-bottom: 13px;
}

.page-head.compact {
  margin-bottom: 9px;
}

.page-head h1 {
  margin-bottom: 0;
}

.scene {
  width: 100%;
  margin: 0 0 14px;
  overflow: hidden;
  border-radius: 20px;
  background: var(--turquoise);
}

.scene img {
  display: block;
  width: 100%;
  height: auto;
}

#p34 .scene {
  width: 84%;
  margin-right: auto;
  margin-left: auto;
}

.scene-bleed {
  width: calc(100% + 48px);
  margin-left: -24px;
  border-radius: 0;
}

/* Cover */
.page-cover {
  padding: 0;
  background: var(--navy);
  color: var(--white);
}

.cover-art {
  position: absolute;
  inset: 0;
  margin: 0;
}

.cover-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.page-cover::before {
  position: absolute;
  inset: 0 0 auto;
  z-index: 1;
  height: 49%;
  content: "";
  background: linear-gradient(180deg, rgba(13, 48, 91, 0.98) 0%, rgba(13, 48, 91, 0.86) 58%, rgba(13, 48, 91, 0) 100%);
}

.cover-copy {
  position: absolute;
  z-index: 2;
  top: 30px;
  right: 24px;
  left: 24px;
}

.cover-copy .eyebrow {
  margin-bottom: 13px;
  color: var(--turquoise);
}

.cover-copy h1 {
  margin-bottom: 16px;
  color: var(--white);
  font-size: 55px;
  line-height: 0.96;
}

.cover-copy h1 span,
.cover-copy h1 strong {
  display: block;
}

.cover-copy h1 span {
  margin-bottom: 9px;
  font-size: 29px;
  font-weight: 400;
  line-height: 1.08;
}

.cover-copy h1 strong {
  font-weight: 600;
}

.cover-copy > p:last-child {
  max-width: 350px;
  margin-bottom: 0;
  color: var(--turquoise);
  font-size: 22px;
  line-height: 1.32;
}

.cover-footer {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 18px;
  background: rgba(23, 74, 126, 0.96);
  color: var(--white);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.15;
}

/* Contents */
.page-contents .scene {
  display: none;
}

.toc {
  display: grid;
  gap: 5px;
}

.toc a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 54px;
  gap: 12px;
  align-items: center;
  min-height: 56px;
  padding: 7px 0;
  border-top: 2px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}

.toc a:nth-child(3n + 1) {
  border-top-color: var(--navy);
}

.toc a:nth-child(3n + 2) {
  border-top-color: var(--yellow);
}

.toc-copy {
  display: block;
  min-width: 0;
}

.toc-copy strong {
  display: block;
  color: var(--navy);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.08;
}

.toc-copy small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.18;
}

.toc a {
  grid-template-columns: minmax(0, 1fr) 50px;
}

.toc-page {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 44px;
  border-radius: 12px;
  background: var(--turquoise);
  color: var(--navy);
  font-size: 22px;
  font-weight: 600;
}

/* Introduction and foundation */
.step-list,
.journey-list,
.reminder-list,
.source-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.step-list {
  display: grid;
  gap: 8px;
}

.step-list li {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  padding-top: 7px;
  border-top: 3px solid var(--navy);
}

.step-list li:nth-child(2) {
  border-top-color: var(--yellow);
}

.step-list li:nth-child(3) {
  border-top-color: var(--turquoise);
}

.step-list li > span {
  color: var(--muted);
  font-size: 21px;
  font-weight: 600;
}

.step-list h2 {
  margin-bottom: 2px;
  font-size: 21px;
}

.step-list p {
  margin: 0;
  font-size: 22px;
  line-height: 1.36;
}

.calm-note {
  margin-top: 12px;
  padding: 13px 16px;
  border-top: 5px solid var(--yellow);
  border-radius: 12px;
  background: var(--turquoise);
  color: var(--navy);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.32;
}

.math-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 70px;
  margin: 4px 0 12px;
  padding: 10px;
  border-radius: 16px;
  background: var(--white);
}

.block-row {
  display: grid;
  grid-template-columns: repeat(5, 18px);
  gap: 4px;
}

.count-block {
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 4px;
}

.count-block.ten {
  background: var(--navy);
}

.count-block.four {
  background: var(--yellow);
}

.math-strip > span {
  color: var(--navy);
  font-size: 34px;
  font-weight: 600;
}

.math-strip > strong {
  color: var(--navy);
  font-size: 38px;
}

.two-notes {
  display: grid;
  gap: 9px;
}

.two-notes section {
  padding-top: 8px;
  border-top: 3px solid var(--navy);
}

.two-notes section:last-child {
  border-top-color: var(--yellow);
}

.two-notes h2 {
  margin-bottom: 2px;
  font-size: 22px;
}

.two-notes p {
  margin-bottom: 0;
  font-size: 22px;
  line-height: 1.36;
}

.journey-list {
  display: grid;
  gap: 7px;
}

.journey-list li {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  align-items: center;
  min-height: 42px;
  padding: 4px 0;
  border-bottom: 2px solid var(--line);
}

.journey-list li span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--white);
  font-size: 20px;
  font-weight: 600;
}

/* Modules */
.module-head {
  margin-bottom: 9px;
}

.module-head.tight {
  margin-bottom: 7px;
}

.page-module-b .module-head h1 {
  font-size: 28px;
  line-height: 1.02;
}

.page-module-b .practice-scene {
  width: 84%;
  margin-top: 2px;
  margin-right: auto;
  margin-left: auto;
  border-radius: 20px;
}

.page-module-b .module-panel,
.page-module-b .say-panel {
  margin-top: 8px;
  padding-top: 9px;
  padding-bottom: 9px;
}

.module-head h1 {
  margin-bottom: 0;
}

.module-takeaway {
  margin: 0 0 11px;
  padding: 0 0 8px;
  border-bottom: 4px solid var(--yellow);
  color: var(--navy);
  font-size: 29px;
  font-weight: 600;
  line-height: 1.12;
}

.module-panel {
  margin-top: 10px;
  padding: 11px 14px 12px;
  border-left: 6px solid var(--navy);
  border-radius: 12px;
  background: var(--white);
}

.module-panel.try {
  border-left-color: var(--yellow);
}

.module-panel.avoid {
  border-left-color: var(--turquoise);
  background: #F3FBF9;
}

.module-panel h2 {
  margin-bottom: 5px;
  font-size: 21px;
}

.module-panel p {
  margin: 0;
  font-size: 22px;
  line-height: 1.38;
}

.say-panel {
  margin-top: 10px;
  padding: 11px 14px 12px;
  border-radius: 12px;
  background: var(--turquoise);
}

.say-panel .eyebrow {
  margin-bottom: 4px;
  font-size: 20px;
}

.say-panel blockquote {
  margin: 0;
  color: var(--navy);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.25;
}

/* Myths, checks, reminders */
.myth-list,
.check-list {
  display: grid;
  gap: 9px;
}

#p34 .myth-list {
  gap: 6px;
}

.myth-list article {
  padding-top: 8px;
  border-top: 3px solid var(--yellow);
}

.myth-list article:first-child {
  border-top-color: var(--navy);
}

.tag {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tag.fact {
  margin-top: 7px;
  color: var(--navy);
}

.myth-list h2 {
  margin-bottom: 0;
  font-size: 22px;
}

.myth-list p:last-child {
  margin-bottom: 0;
  font-size: 22px;
  line-height: 1.38;
}

.check-list article {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 12px;
  align-items: start;
  padding-top: 9px;
  border-top: 3px solid var(--navy);
}

.check-list article:nth-child(2) {
  border-top-color: var(--yellow);
}

.check-list article > span {
  color: var(--navy);
  font-size: 28px;
  font-weight: 600;
  line-height: 1;
}

.check-list p {
  margin-bottom: 0;
  font-size: 22px;
  line-height: 1.38;
}

.check-list .tag {
  margin-bottom: 4px;
}

.check-list.triple {
  gap: 7px;
}

.check-list.triple article {
  padding-top: 6px;
}

.check-list.triple p {
  font-size: 22px;
  line-height: 1.32;
}

#p37 .calm-note {
  margin-top: 8px;
  margin-bottom: 3px;
}

.reminder-list {
  display: grid;
  gap: 8px;
}

.reminder-list li {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 2px solid var(--line);
}

.reminder-list li span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--white);
  font-size: 20px;
  font-weight: 600;
}

.reminder-list p {
  margin: 0;
  font-size: 22px;
  line-height: 1.38;
}

/* Reference aids */
.ten-frame {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
  width: 100%;
  margin: 6px 0 15px;
  padding: 12px;
  border: 5px solid var(--navy);
  border-radius: 18px;
  background: var(--white);
}

.ten-frame span {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  border: 3px solid var(--navy);
  border-radius: 50%;
  color: var(--muted);
  font-size: 20px;
  font-weight: 600;
}

.ten-frame .filled {
  border-color: var(--navy);
  background: var(--navy);
}

.fact-card,
.limit-card {
  margin-top: 12px;
  padding: 15px 16px;
  border-top: 6px solid var(--yellow);
  border-radius: 14px;
  background: var(--white);
}

.fact-card h2,
.limit-card h2 {
  font-size: 24px;
}

.fact-card p,
.limit-card p {
  font-size: 22px;
  line-height: 1.38;
}

.fact-card p:last-child,
.limit-card p:last-child {
  margin-bottom: 0;
}

.letter-note {
  padding-top: 9px;
  border-top: 2px solid var(--line);
  color: var(--muted);
  font-size: 20px;
  line-height: 1.32;
}

.math-callout {
  margin: 0 0 12px;
  color: var(--navy);
  font-size: 39px;
  font-weight: 600;
  line-height: 1.15;
}

.carton {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 8px 0 18px;
  padding: 15px;
  border: 5px solid var(--navy);
  border-radius: 22px;
  background: var(--white);
}

.carton span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 64px;
  border: 3px solid var(--navy);
  border-radius: 50%;
  color: var(--navy);
  font-size: 23px;
  font-weight: 600;
}

.carton span.covered {
  position: relative;
  color: var(--navy);
  background: var(--yellow);
}

.carton span.covered::after {
  position: absolute;
  right: 8px;
  bottom: 7px;
  left: 8px;
  height: 5px;
  border-radius: 4px;
  content: "";
  background: var(--navy);
  transform: rotate(-34deg);
}

.number-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 11px;
}

.number-card {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 148px;
  border: 4px solid var(--navy);
  border-radius: 18px;
  background: var(--white);
  color: var(--navy);
  font-size: 92px;
  font-weight: 600;
  line-height: 1;
}

.number-cards.five {
  grid-template-columns: repeat(3, 1fr);
}

.number-cards.five .number-card {
  min-height: 112px;
  font-size: 68px;
}

.equation-list {
  display: grid;
  gap: 7px;
  margin-bottom: 13px;
}

.equation-list > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  min-height: 58px;
  padding: 7px 13px;
  border-bottom: 2px solid var(--line);
  background: var(--white);
  color: var(--navy);
  font-size: 28px;
  font-weight: 600;
}

.equation-list strong {
  color: var(--navy);
  font-size: 30px;
}

.board-track {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 5px;
  margin-bottom: 14px;
}

.board-track span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 2px solid var(--navy);
  border-radius: 9px;
  background: var(--white);
  color: var(--navy);
  font-size: 22px;
  font-weight: 600;
}

.board-track span.milestone {
  background: var(--turquoise);
}

/* Glossary and sources */
.glossary-list {
  display: grid;
  gap: 5px;
}

.glossary-list dl {
  padding: 5px 0;
  border-top: 3px solid var(--line);
}

.glossary-list dl:nth-child(odd) {
  border-top-color: var(--navy);
}

.glossary-list dt {
  color: var(--navy);
  font-size: 23px;
  font-weight: 600;
  line-height: 1.15;
}

.glossary-list dd {
  margin: 3px 0 0;
  font-size: 22px;
  line-height: 1.38;
}

.page-intro .intro-scene {
  width: 82%;
  margin-right: auto;
  margin-left: auto;
}

.page-glossary .scene {
  width: 88%;
  margin-top: 10px;
  margin-right: auto;
  margin-left: auto;
}

#p53 .scene {
  display: none;
}

.source-list {
  display: grid;
  gap: 9px;
  counter-reset: source;
}

.source-list li {
  position: relative;
  padding: 7px 0 7px 45px;
  border-top: 2px solid var(--line);
}

.source-list li::before {
  position: absolute;
  top: 12px;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--white);
  counter-increment: source;
  content: counter(source, decimal-leading-zero);
  font-size: 15px;
  font-weight: 600;
}

.source-list p {
  margin: 0;
  font-size: 22px;
  line-height: 1.34;
}

.source-list a {
  color: var(--navy);
  text-decoration-color: var(--yellow);
  text-decoration-thickness: 3px;
}

.page-sources .scene {
  display: none;
}

.page-sources .limit-card {
  margin-top: 10px;
  padding: 11px 14px;
}

.page-sources .source-list {
  gap: 6px;
}

.limit-card {
  margin-top: 14px;
}

@media screen and (min-width: 465px) {
  .book {
    padding: 24px 0;
  }
}

@media print {
  html {
    background: var(--warm);
  }

  body {
    width: 432px;
    margin: 0;
    zoom: 1;
  }

  .book {
    display: block;
    padding: 0;
  }

  .page {
    margin: 0;
    box-shadow: none;
    break-after: page;
    page-break-after: always;
  }

  .page:last-child {
    break-after: auto;
    page-break-after: auto;
  }
}
