/* Plática, inside the Subtle Path frame (shared.css). Colours are the app's own
   (Theme.swift): canvas and ink, with talavera blue as the one accent. Headings use the
   system serif, as the app does: New York on Apple devices. */

:root {
  --paper: #fbf7f0;
  --surface: #fff;
  --ink: #1f1a16;
  --slate: #6b6158;
  --rule: #e6ddd0;
  --route: #1d58a6;
  --route-hover: #174a8c;
  --on-route: #fff;
  --shoal: #f2ece2;
  --talavera: #1d58a6;
  --peach: #f5e5d9;
  --bugambilia: #b82e70;
  --serif: ui-serif, "New York", "Iowan Old Style", Georgia, serif;
  --gutter: 2.5rem;
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    --paper: #121110;
    --surface: #1f1d1b;
    --ink: #f5efe6;
    --slate: #a89e93;
    --rule: #3a3632;
    --route: #7eb4ea;
    --route-hover: #a3cbf2;
    --on-route: #0e1a2b;
    --shoal: #2a2724;
    --talavera: #7eb4ea;
    --peach: #2f2621;
    --bugambilia: #ee7ab0;
  }
}

:root:where([data-theme="dark"]) {
  --paper: #121110;
  --surface: #1f1d1b;
  --ink: #f5efe6;
  --slate: #a89e93;
  --rule: #3a3632;
  --route: #7eb4ea;
  --route-hover: #a3cbf2;
  --on-route: #0e1a2b;
  --shoal: #2a2724;
  --talavera: #7eb4ea;
  --peach: #2f2621;
  --bugambilia: #ee7ab0;
}

body {
  line-height: 1.6;
}

.mast,
main {
  max-width: 1240px;
  margin-inline: auto;
}

main > section {
  margin-inline: var(--gutter);
  padding-block: clamp(3.5rem, 8vw, 6rem);
}

main > section + section {
  border-top: 1px solid var(--rule);
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.01em;
}

img {
  max-width: 100%;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
  margin-top: 2rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Hero */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 19rem);
  gap: clamp(2.5rem, 6vw, 6rem);
  align-items: center;
  padding-block: clamp(3rem, 6vw, 5rem);
}

.appname {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin: 0 0 2rem;
  font-size: 1.6rem;
  font-weight: 650;
  letter-spacing: -0.015em;
}

.appname img {
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: 22.5%;
  box-shadow: 0 0 0 1px #1f1a1614;
}

.appname-gloss {
  display: block;
  margin-top: 0.2rem;
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--slate);
}

.hero h1 {
  max-width: 11em;
  margin: 0;
  font-size: clamp(2.75rem, 5.4vw, 4.6rem);
  line-height: 1.04;
  text-wrap: balance;
}

.hero .lede {
  max-width: 31em;
  margin: 1.75rem 0 0;
  font-size: 1.15rem;
  line-height: 1.6;
  color: var(--slate);
  text-wrap: pretty;
}

/* A plain rounded frame, not a drawing of a particular phone */
.phone {
  margin: 0;
  width: min(100%, 17rem);
}

.phone img {
  display: block;
  width: 100%;
  height: auto;
  border: 7px solid #1f1a16;
  border-radius: 2.6rem;
  background: var(--shoal);
  box-shadow: 0 30px 50px -30px #1f1a1699;
}

.phone--hero {
  width: 100%;
  justify-self: end;
}

/* Each screenshot comes in the app's light and dark appearance; show the one that matches */
.shot-dark {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) .shot-dark { display: block; }
  :root:where(:not([data-theme="light"])) .shot-light { display: none; }
}

:root[data-theme="dark"] .shot-dark { display: block; }
:root[data-theme="dark"] .shot-light { display: none; }
:root[data-theme="light"] .shot-dark { display: none; }
:root[data-theme="light"] .shot-light { display: block; }

.phone img.shot-dark {
  border-color: #000;
}

/* One band of the app's talavera tile */
.talavera {
  display: block;
  width: calc(100% - 2 * var(--gutter));
  max-width: calc(1240px - 2 * var(--gutter));
  height: 48px;
  margin-inline: auto;
  color: var(--talavera);
}

/* Packs: the app's pathway, six stages of six packs, a stage to a row */

.section-copy {
  max-width: 40rem;
}

.section-copy h2,
.status h2 {
  margin: 0;
  font-size: clamp(2rem, 3.6vw, 2.9rem);
  line-height: 1.1;
  text-wrap: balance;
}

.section-copy p,
.status p {
  margin: 1rem 0 0;
  font-size: 1.05rem;
  text-wrap: pretty;
}

.pathway {
  display: grid;
  gap: clamp(3rem, 6vw, 4.5rem);
  margin: 3.5rem 0 0;
  padding: 0;
  list-style: none;
}

/* the stage number set like the lesson steps' numerals, beside its title and checkpoint */
.stage-head {
  display: grid;
  grid-template-columns: 2.75rem minmax(0, 1fr);
  column-gap: 0.5rem;
  max-width: 46rem;
}

.stage-num {
  grid-row: span 2;
  margin: 0;
  font-family: var(--serif);
  font-size: 3rem;
  font-style: italic;
  font-weight: 500;
  line-height: 1;
  color: var(--talavera);
}

.stage-head h3 {
  margin: 0.2rem 0 0;
  font-size: 1.6rem;
  line-height: 1.2;
}

.level {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--talavera) 12%, transparent);
  color: var(--talavera);
  font-family: Atkinson, system-ui, sans-serif;
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  vertical-align: 0.3em;
}

.stage-check {
  margin: 0.4rem 0 0;
  color: var(--slate);
  text-wrap: pretty;
}

.stage-check b {
  color: var(--ink);
  font-weight: 650;
}

.stage-packs {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 2rem 1.25rem;
  margin: 1.75rem 0 0;
  padding: 0;
  list-style: none;
}

.pack img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 12px;
  background: var(--shoal);
}

.pack h4 {
  margin: 0.8rem 0 0;
  font-family: var(--serif);
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.25;
  text-wrap: balance;
}

.pack p {
  margin: 0.3rem 0 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--slate);
  text-wrap: pretty;
}

/* How a lesson works: a sequence, numbered */

.steps {
  display: grid;
  gap: clamp(3.5rem, 7vw, 5.5rem);
  margin: 3.5rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.step {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2.5rem clamp(2.5rem, 6vw, 5rem);
  align-items: center;
  counter-increment: step;
}

.step-copy {
  max-width: 27rem;
}

.step > figure {
  justify-self: center;
}

/* alternate sides, so the eye zigzags down the sequence */
.step:nth-child(even) .step-copy {
  order: 2;
}

.step-copy::before {
  content: counter(step);
  display: block;
  margin-bottom: 0.5rem;
  font-family: var(--serif);
  font-size: 3rem;
  font-style: italic;
  font-weight: 500;
  line-height: 1;
  color: var(--talavera);
}

.step h3 {
  margin: 0;
  font-size: 1.6rem;
  line-height: 1.2;
}

.step-copy p {
  margin: 0.75rem 0 0;
  color: var(--slate);
}


/* A dialogue from a pack, set as type rather than as a screenshot */
.dialogue {
  width: min(100%, 36rem);
  margin: 0;
  padding: 1.75rem 2rem 2rem;
  border: 1px solid var(--rule);
  border-radius: 24px;
  background: var(--surface);
}

.dialogue figcaption {
  font-size: 0.875rem;
  color: var(--slate);
}

.dialogue ol {
  display: grid;
  gap: 1.25rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.dialogue li {
  padding-left: 1rem;
  border-left: 3px solid var(--rule);
}

.dialogue li.you {
  border-left-color: var(--talavera);
}

.dialogue .who {
  font-size: 0.8rem;
  font-weight: 650;
  color: var(--slate);
}

.dialogue .es {
  margin: 0.15rem 0 0;
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.3;
}

.dialogue .en {
  margin: 0.3rem 0 0;
  font-size: 0.925rem;
  color: var(--slate);
}

.register {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--talavera) 12%, transparent);
  color: var(--talavera);
  font-size: 0.75rem;
  font-weight: 650;
}

/* A role-play: the app's "real conversation" card, on its peach wash */
.roleplay {
  width: min(100%, 34rem);
  margin: 0;
  padding: 1.75rem 2rem 2rem;
  border-radius: 24px;
  background: var(--peach);
}

.roleplay figcaption {
  font-size: 0.875rem;
  color: var(--slate);
}

.roleplay blockquote {
  margin: 1.25rem 0 0;
}

.roleplay .es {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 600;
  line-height: 1.25;
  text-wrap: balance;
}

.roleplay .en {
  margin: 0.4rem 0 0;
  color: var(--slate);
}

.roleplay-goals {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid color-mix(in srgb, var(--ink) 12%, transparent);
}

.roleplay h4 {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 650;
}

.roleplay ul {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
}

.roleplay li::marker {
  color: var(--bugambilia);
}

.roleplay-twist {
  margin: 1rem 0 0;
  font-size: 0.925rem;
  color: var(--slate);
}

.roleplay-twist b {
  color: var(--ink);
  font-weight: 650;
}

/* A pack's mission, with the app's own section titles */
.mission {
  width: min(100%, 34rem);
  margin: 0;
  padding: 1.75rem 2rem 2rem;
  border: 1px solid var(--rule);
  border-radius: 24px;
  background: var(--surface);
}

.mission figcaption {
  font-size: 0.875rem;
  color: var(--slate);
}

.mission-part {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
}

.mission h4 {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--talavera);
}

.mission-part p {
  margin: 0.5rem 0 0;
}

.dimensions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
}

.dimensions li {
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  background: var(--shoal);
  font-size: 0.875rem;
}

/* Details */

.details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem clamp(2rem, 4vw, 3.5rem);
}

.details h3 {
  margin: 0;
  font-size: 1.3rem;
}

.details p {
  margin: 0.6rem 0 0;
  color: var(--slate);
}

.status > * {
  max-width: 44rem;
}

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  width: min(calc(100% - 2 * var(--gutter)), calc(1240px - 2 * var(--gutter)));
  margin-inline: auto;
  padding-block: 2rem 3rem;
  border-top: 1px solid var(--rule);
  font-size: 0.875rem;
  color: var(--slate);
}

@media (max-width: 75rem) {
  .stage-packs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2rem 1.5rem;
  }
}

@media (max-width: 64rem) {
  .details {
    grid-template-columns: minmax(0, 1fr);
    max-width: 40rem;
  }
}

@media (max-width: 52rem) {
  .hero,
  .step {
    grid-template-columns: minmax(0, 1fr);
  }

  .step:nth-child(even) .step-copy {
    order: 0;
  }

  .step > figure {
    justify-self: start;
  }

  .phone--hero {
    width: min(100%, 16rem);
    justify-self: start;
  }
}

@media (max-width: 850px) {
  :root {
    --gutter: 1.5rem;
  }
}

@media (max-width: 40rem) {
  .stage-packs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.75rem 1rem;
  }

  .stage-head {
    grid-template-columns: 2.25rem minmax(0, 1fr);
  }

  .stage-num {
    font-size: 2.5rem;
  }

  .stage-head h3 {
    font-size: 1.4rem;
  }

  .dialogue,
  .mission {
    padding: 1.25rem 1.25rem 1.5rem;
  }
}
