/* The public website at coursecount.app. Every colour, size, radius and curve is a token from
   design/system/tokens.css, under the same name; only the ones the site uses are copied here.
   The one difference is the display face: the site tries Inter Tight in place of the design
   system's Plus Jakarta Sans, because it reads better at large sizes on the web. */

@font-face {
  font-family: "Inter Tight";
  font-weight: 800;
  font-display: swap;
  src: url("/assets/inter-tight-800-e2c0e837.woff2") format("woff2");
}

@font-face {
  font-family: "Outfit";
  font-weight: 700;
  font-display: swap;
  src: url("/assets/outfit-700-655d51db.woff2") format("woff2");
}

:root {
  --green: #1F5C3A;
  --deep: #163F28;
  --flag: #E9C46A;
  --hole: #0B0B0B;
  --paper: #F3F6F2;
  --card: #FFFFFF;
  --track: #DCE7DF;
  --ink: #1A1A1A;
  --ink-2: #56675C;
  --line: #E1E8E2;
  --tint: #1F5C3A;
  --tint-bg: #DDEBE1;
  --chip: #E8EFE9;
  --arc: #1F5C3A;
  --on: #FFFFFF;
  --on-2: #CFE3D5;
  --error: #B3261E;
  /* The error colour on green grounds, where the light theme's red is too dark to read. */
  --error-on-green: #FF8A80;

  --font-display: "Inter Tight", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-num: "Outfit", "Inter Tight", ui-sans-serif, system-ui, sans-serif;
  /* Only the big headings are drawn in, and only a little: Inter Tight is already tightly
     spaced, and heavy letters crowd each other. Smaller headings, buttons and chips keep the
     font's own spacing, because any tighter at those sizes makes them hard to read. */
  --track-display: -0.015em;
  --font-body: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;

  --space-half: 2px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;

  --radius-input: 16px;
  --radius-button: 18px;
  --radius-tile: 24px;
  --radius-card: 28px;
  --radius-full: 999px;

  --shadow-card: 0 1px 2px rgba(22, 63, 40, .06), 0 10px 28px rgba(22, 63, 40, .09);
  --ease-spring: cubic-bezier(.3, 1.35, .5, 1);
  --ease-bouncy: cubic-bezier(.34, 1.6, .5, 1);
  --ease-snappy: cubic-bezier(.2, .9, .3, 1);

  /* The site's own measures: the widest the page gets, and its side gutter for bare text. */
  --page: 1080px;
  --gutter: var(--space-5);
  /* A full-width band's side padding, so its contents line up with the page's. */
  --edge: max(var(--gutter), (100% - var(--page)) / 2 + var(--gutter));
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0D1210;
    --card: #161E19;
    --track: #26352B;
    --ink: #EEF3EF;
    --ink-2: #A5B6AA;
    --line: #24312A;
    --tint: #7FD49A;
    --tint-bg: #1B3325;
    --chip: #1E2922;
    --arc: #4CC26F;
    --error: #FF8A80;
    --shadow-card: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px rgba(0, 0, 0, .38);
  }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.45 var(--font-body);
  -webkit-font-smoothing: antialiased;
}

p {
  margin: 0;
  text-wrap: pretty;
}

a {
  color: var(--tint);
  text-underline-offset: 0.15em;
}

:focus-visible {
  outline: 3px solid var(--tint);
  outline-offset: 3px;
  border-radius: 4px;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Only a keyboard brings it into view, at the top left. */
.skip {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-input);
  background: var(--card);
  font-weight: 700;
  z-index: 1;
}

.skip:focus {
  top: var(--space-4);
}

/* The mark: green arcs on paper, white on deep green, bright on black, a black hole. */
.mark__arc {
  fill: none;
  stroke: var(--arc);
  stroke-linecap: round;
}

.mark__hole {
  fill: var(--hole);
}

@media (prefers-color-scheme: dark) {
  .mark__hole {
    fill: #646464;
  }
}

/* Full width, so the home page's deep green runs behind it to the edges. */
.masthead {
  padding: var(--space-5) var(--edge) 0;
}

.home .masthead {
  background: var(--deep);
}

.home .brand {
  color: var(--on);
}

.home .mark__arc {
  stroke: var(--on);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  color: var(--ink);
  text-decoration: none;
}

.brand__name {
  font: 800 22px/1 var(--font-display);
}

/* Type: the display face at 800 for the words you look at, tight; the system font to read. */
.hero__title,
.section-title,
.closer__title,
.prose h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: var(--track-display);
  text-wrap: balance;
}

.eyebrow {
  margin-bottom: var(--space-3);
  color: var(--tint);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 16px;
  text-transform: uppercase;
}

.lead {
  max-width: 30em;
  margin-top: var(--space-4);
  color: var(--ink-2);
  font-size: 19px;
  line-height: 1.4;
}

/* The hero, on deep green: the two questions, the promise and the form, then two screens from
   the app fanned out, running off the bottom edge. */
.hero {
  display: grid;
  gap: var(--space-10);
  padding: var(--space-10) var(--edge) 0;
  overflow: clip;
}

.hero__text {
  max-width: 34em;
  padding-bottom: var(--space-2);
}

/* Each question on a line of its own. */
.hero__title {
  font-size: clamp(44px, 12vw, 76px);
  line-height: 1.02;
}

.hero__title span {
  display: block;
}

.hero__phones {
  position: relative;
  height: 460px;
  margin-bottom: -2px;
}

.hero__phones .screen {
  position: absolute;
  width: 240px;
  top: 0;
}

.screen--front {
  left: 50%;
  translate: -30% 0;
  rotate: 3deg;
  z-index: 1;
}

.screen--back {
  left: 50%;
  translate: -85% 40px;
  rotate: -6deg;
  opacity: 0.92;
}

.section-title {
  margin-bottom: var(--space-3);
  font-size: clamp(32px, 8.5vw, 48px);
  line-height: 1.02;
}

/* The form: one field and a button that says what happens. */
.signup {
  max-width: 34em;
  margin-top: var(--space-8);
  text-align: left;
  scroll-margin-top: var(--space-8);
}

.signup__label {
  display: block;
  margin-bottom: var(--space-2);
  font-size: 15px;
  font-weight: 600;
}

.signup__row {
  display: grid;
  gap: var(--space-3);
}

.signup__input {
  width: 100%;
  height: 54px;
  padding: 0 var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-input);
  background: var(--card);
  color: var(--ink);
  font: 17px var(--font-body);
  box-shadow: var(--shadow-card);
}

.signup__input:focus-visible {
  outline-offset: 0;
  border-radius: var(--radius-input);
}

.signup__input[aria-invalid="true"] {
  border-color: var(--error);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 0 var(--space-5);
  border: 0;
  border-radius: var(--radius-button);
  background: var(--green);
  color: var(--on);
  font: 800 17px/1 var(--font-display);
  text-decoration: none;
  cursor: pointer;
  transition: scale 0.45s var(--ease-bouncy), background-color 0.15s;
}

.button:hover {
  background: var(--deep);
}

.button:active {
  scale: 0.96;
  transition-duration: 0.1s;
}

.button:focus-visible {
  border-radius: var(--radius-button);
}

.signup__error {
  margin-bottom: var(--space-2);
  color: var(--error);
  font-weight: 600;
}

.signup__consent {
  margin-top: var(--space-3);
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.4;
}

.signup__done {
  padding: var(--space-5);
  border-radius: var(--radius-card);
  background: var(--green);
  color: var(--on-2);
  box-shadow: var(--shadow-card);
}

.signup__done-title {
  margin-bottom: var(--space-1);
  color: var(--on);
  font: 800 24px/1.1 var(--font-display);
}

/* Kept out of sight and out of reach; only bots fill it in. */
.signup__trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

@media (min-width: 560px) {
  .signup__row {
    grid-template-columns: 1fr auto;
  }
}

/* A screen from the app's design, in a drawn phone. */
.screen {
  width: min(100%, 260px);
  padding: 8px;
  border-radius: 44px;
  background: var(--hole);
  box-shadow: var(--shadow-share);
}

.screen__image {
  width: 100%;
  border-radius: 36px;
}

/* On the dark page, a hairline keeps the black frame from melting into it. */
@media (prefers-color-scheme: dark) {
  .screen {
    box-shadow: var(--shadow-share), 0 0 0 1px var(--line);
  }
}

/* Each benefit: a heading, a line, its points, and the screen that shows it. */
.feature {
  display: grid;
  gap: var(--space-8);
  justify-items: center;
  max-width: var(--page);
  margin: 0 auto;
  padding: var(--space-10) var(--gutter);
}

.feature__text {
  justify-self: stretch;
  max-width: 34em;
}

.feature__text > p {
  color: var(--ink-2);
  font-size: 18px;
}

.share-card {
  width: min(100%, 260px);
  border-radius: var(--radius-tile);
  box-shadow: var(--shadow-share);
}

/* The ten levels as chips; the last is an achievement, so it carries the flag. */
.levels {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: var(--space-5) 0 0;
  padding: 0;
  list-style: none;
}

.levels__level {
  display: inline-flex;
  align-items: baseline;
  gap: var(--space-2);
  min-height: 40px;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  background: var(--chip);
  font: 800 15px/1.6 var(--font-display);
}

.levels__count {
  color: var(--tint);
  font: 700 17px/1 var(--font-num);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}

.levels__level:last-child {
  background: var(--flag);
  color: var(--deep);
}

.levels__level:last-child .levels__count {
  color: var(--deep);
}

/* Each point with a small tick, the app's own mark for done. */
.checks {
  display: grid;
  gap: var(--space-3);
  margin: var(--space-5) 0 0;
  padding: 0;
  list-style: none;
}

.checks li {
  position: relative;
  padding-left: var(--space-8);
  font-weight: 600;
}

.checks li::before,
.checks li::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0.1em;
  width: 22px;
  height: 22px;
}

.checks li::before {
  border-radius: var(--radius-full);
  background: var(--tint-bg);
}

/* The tick is a mask filled with the tint, so it follows the theme. */
.checks li::after {
  background: var(--tint);
  mask: url("/assets/website/check-f9f0a919.svg") center / 14px 14px no-repeat;
}

/* The smaller things, three short paragraphs. */
.extras {
  max-width: var(--page);
  margin: 0 auto;
  padding: var(--space-10) var(--gutter);
}

.extras__list {
  display: grid;
  gap: var(--space-6);
  margin: var(--space-6) 0 0;
  padding: 0;
  list-style: none;
}

.extra {
  padding-top: var(--space-4);
  border-top: 2px solid var(--line);
}

.extra__title {
  margin: 0 0 var(--space-2);
  font: 800 20px/1.15 var(--font-display);
}

.extra p {
  color: var(--ink-2);
}

/* Planned, but not in the first version. */
.later {
  display: inline-block;
  margin-left: var(--space-1);
  padding: var(--space-half) var(--space-2);
  border-radius: var(--radius-full);
  background: var(--chip);
  color: var(--ink-2);
  font: 700 12px/16px var(--font-body);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: 0.2em;
}

@media (min-width: 560px) {
  .extras__list {
    grid-template-columns: 1fr 1fr;
  }
}

/* A few questions, each opening in place with the browser's own disclosure. */
.faq {
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 var(--gutter) var(--space-10);
}

.faq .section-title {
  margin-bottom: var(--space-4);
}

.faq__item {
  max-width: 760px;
  border-top: 2px solid var(--line);
}

.faq__item:last-child {
  border-bottom: 2px solid var(--line);
}

.faq__item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: 56px;
  padding: var(--space-3) 0;
  font: 800 19px/1.2 var(--font-display);
  cursor: pointer;
  list-style: none;
}

.faq__item summary::-webkit-details-marker {
  display: none;
}

/* A plus that turns into a minus when the answer is open. */
.faq__item summary::after {
  content: "+";
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--chip);
  color: var(--tint);
  font: 700 22px/32px var(--font-body);
  text-align: center;
}

.faq__item[open] summary::after {
  content: "\2212";
}

.faq__item p {
  max-width: 34em;
  padding-bottom: var(--space-4);
  color: var(--ink-2);
}

/* Deep green bands, the hero and the closer: white and mint words, and a white button. */
.on-deep {
  background: var(--deep);
  color: var(--on-2);
}

.on-deep .eyebrow {
  color: var(--bright);
}

.on-deep .hero__title,
.on-deep .closer__title,
.on-deep .signup__label,
.on-deep .signup__consent a {
  color: var(--on);
}

.on-deep .lead,
.on-deep .signup__consent {
  color: var(--on-2);
}

.on-deep .signup__error {
  color: var(--error-on-green);
}

.on-deep .button {
  background: var(--on);
  color: var(--green);
}

.on-deep .button:hover {
  background: var(--on-2);
}

.closer {
  padding: var(--space-10) var(--gutter);
  text-align: center;
}

.closer > * {
  max-width: 34em;
  margin-left: auto;
  margin-right: auto;
}

.closer .signup {
  text-align: left;
}

.closer__title {
  margin-bottom: var(--space-3);
  font-size: clamp(40px, 11vw, 64px);
  line-height: 1;
}

.closer__note {
  margin-top: var(--space-8);
  font-size: 14px;
}

.footer {
  max-width: var(--page);
  margin: 0 auto;
  padding: var(--space-8) var(--gutter) var(--space-10);
  color: var(--ink-2);
  font-size: 14px;
}

/* The privacy note and the page for a wrong address: something to read. */
.prose {
  max-width: 40em;
  margin: 0 auto;
  padding: var(--space-8) var(--gutter) var(--space-10);
}

.prose h1 {
  margin-bottom: var(--space-6);
  font-size: clamp(34px, 9vw, 52px);
  line-height: 1;
}

.prose h2 {
  margin: var(--space-8) 0 var(--space-2);
  font: 800 22px/1.15 var(--font-display);
}

.prose p,
.prose ul {
  margin: 0 0 var(--space-3);
}

/* Says a page's words aren't approved yet, so a reader doesn't take them as final. */
.prose__draft {
  display: inline-block;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  background: var(--tint-bg);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}

.prose__updated {
  margin-top: var(--space-8);
  color: var(--ink-2);
  font-size: 14px;
}

/* Wider screens: the hero's words beside its screens, and each benefit beside its screen,
   alternating sides. */
@media (min-width: 860px) {
  :root {
    --gutter: var(--space-8);
  }

  .hero {
    grid-template-columns: 1.1fr 1fr;
    align-items: end;
    padding-top: calc(var(--space-10) * 1.5);
  }

  .hero__text {
    align-self: center;
    padding-bottom: calc(var(--space-10) * 1.5);
  }

  .hero__phones {
    height: 560px;
  }

  .hero__phones .screen {
    width: 280px;
  }

  .feature {
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: calc(var(--space-10) * 2);
    padding-top: calc(var(--space-10) * 1.5);
    padding-bottom: calc(var(--space-10) * 1.5);
  }

  .feature:nth-of-type(odd) .feature__text {
    order: 1;
  }

  .screen,
  .share-card {
    width: 280px;
  }

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

  .closer {
    padding-top: calc(var(--space-10) * 2);
    padding-bottom: calc(var(--space-10) * 2);
  }
}

@media (prefers-reduced-motion: reduce) {
  .button {
    transition: background-color 0.15s ease-out;
  }

  .button:active {
    scale: none;
  }
}
