/* Style of the landing site, web/pages/: the home page, the grade chart, the
   pyramid calculator and the guide. It follows the app's look: rounded cards
   on a light background, a floating black bar, pills, and the logo's lime
   for actions and filled slots. */

/* DM Sans, the app's font (SIL Open Font License 1.1), self-hosted from
   Google Fonts so the page makes no third-party requests. */
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/fonts/dm-sans-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/fonts/dm-sans-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* The app's colours (k_colors.dart): the logo's lime, black and white, and
   grey for other fills. The lime is only used at full strength. */
:root {
  --lime: #d6e81e;
  --black: #0a0a0a;
  --paper: #f5f5f5;
  --white: #fff;
  --grey: #e3e3e3;
  /* Secondary text: the app's black at 60%, on paper or grey. */
  --muted: #5c5c5c;
  --muted-on-black: #a8a8a8;
  /* Empty slots: the app's black at 10%. */
  --empty: rgba(10, 10, 10, 0.1);
  /* Between the edges of the page and its panels. */
  --gutter: clamp(10px, 2vw, 24px);
  --panel-radius: clamp(24px, 4vw, 40px);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* Keeps the targets of the header's links clear of it. */
  scroll-padding-top: 100px;
}

body {
  margin: 0;
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  font-size: 18px;
  line-height: 1.6;
  color: var(--black);
  background: var(--paper);
}

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

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:focus-visible,
summary:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 3px;
  border-radius: 6px;
}

h1,
h2,
h3 {
  font-weight: 700;
  letter-spacing: -0.02em;
}

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

/* An outlined pill, like the info bubbles of the app's home cards. */
.eyebrow {
  display: inline-block;
  margin: 0;
  padding: 3px 12px;
  border: 1.5px solid currentColor;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
}

/* The coloured blocks are cards inset from the page's edges, like the app's,
   rather than bands across it. */
.hero,
.page-hero,
.section-ink,
.section-white,
.cta,
.site-footer {
  margin-inline: max(var(--gutter), calc((100% - 1360px) / 2));
  border-radius: var(--panel-radius);
}

:is(.section-ink, .section-white, .cta) + :is(.section-ink, .section-white, .cta) {
  margin-top: var(--gutter);
}

/* Header: a floating black bar, like the app's navigation bar, with the
   join button in lime. */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  padding-top: var(--gutter);
  /* Only the bar takes clicks, not the space around it. */
  pointer-events: none;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: none;
  min-height: 60px;
  margin-inline: max(var(--gutter), calc((100% - 1160px) / 2));
  padding: 8px 8px 8px 22px;
  border-radius: 999px;
  background: var(--black);
  color: var(--white);
  box-shadow: 0 8px 24px rgba(10, 10, 10, 0.18);
  pointer-events: auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand svg {
  width: 28px;
  height: 28px;
}

/* Lime on black, like the logo. */
.site-header .brand svg,
.site-footer .brand svg {
  color: var(--lime);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 16px;
  font-weight: 500;
}

.header-nav a {
  text-decoration: none;
}

.header-nav a:hover {
  color: var(--lime);
}

.header-nav .header-join {
  padding: 10px 20px;
  border-radius: 999px;
  background: var(--lime);
  color: var(--black);
  font-weight: 700;
  line-height: 1.2;
}

.header-nav .header-join:hover {
  color: var(--black);
  background: #c3d41a;
}

@media (max-width: 559px) {
  .header-nav .section-link {
    display: none;
  }

  .site-header .wrap {
    min-height: 56px;
    padding-left: 16px;
  }

  .header-nav {
    gap: 14px;
    font-size: 15px;
  }

  .header-nav .header-join {
    padding: 9px 14px;
  }
}

@media (max-width: 359px) {
  .brand {
    gap: 8px;
    font-size: 19px;
  }

  .brand svg {
    width: 24px;
    height: 24px;
  }
}

/* Hero */

.hero {
  overflow: hidden;
  margin-top: var(--gutter);
  background: var(--lime);
}

.hero-grid {
  display: grid;
  gap: 48px;
  padding-top: clamp(36px, 6vw, 64px);
}

.hero h1 {
  margin: 16px 0 20px;
  font-size: clamp(40px, 8.5vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.035em;
}

.lead {
  max-width: 32em;
  margin: 0 0 28px;
  font-size: clamp(18px, 2.2vw, 21px);
}

.note {
  margin: 14px 0 0;
  font-size: 15px;
}

/* Phones whose bottom is cut by the end of the hero, under the pyramid and
   above the screenshot's "Back to my pyramid" button. */
.hero-phone {
  --phone: min(260px, 54vw);
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

.hero-phone .phone {
  width: var(--phone);
  aspect-ratio: 3 / 5;
  border: 10px solid var(--black);
  border-bottom: 0;
  border-radius: 44px 44px 0 0;
  overflow: hidden;
  background: var(--black);
  box-shadow: 0 30px 60px rgba(10, 10, 10, 0.25);
}

.hero-phone .phone img {
  width: 100%;
  border-radius: 34px 34px 0 0;
}

@media (min-width: 900px) {
  .hero-grid {
    grid-template-columns: 1.15fr 0.85fr;
    align-items: end;
  }

  .hero-text {
    padding-bottom: 96px;
  }

  .hero-phone {
    --phone: 290px;
  }
}

/* The join button, to the web app's sign in, and the store badges, rendered
   by LandingRoute: pills, black like the app's main buttons. */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.join-button,
.store-badge {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  min-width: 148px;
  min-height: 60px;
  padding: 8px 26px;
  border-radius: 999px;
  background: var(--black);
  color: var(--white);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-align: left;
  text-decoration: none;
}

/* Lime on black, like the app's sign in button. */
.join-button {
  color: var(--lime);
}

.join-button small,
.store-badge small {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--white);
  opacity: 0.75;
}

.join-button:hover,
a.store-badge:hover {
  background: #262626;
}

.store-badge.is-soon {
  background: transparent;
  color: var(--black);
  box-shadow: inset 0 0 0 1.5px var(--black);
}

.store-badge.is-soon small {
  color: var(--black);
}

/* The store's logo, then the two lines of text. */
.store-badge {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding-left: 22px;
}

.store-badge svg {
  flex: none;
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.store-badge span {
  display: flex;
  flex-direction: column;
}

/* On a phone the join button gets its own row, above the two badges, which
   share the next one. */
@media (max-width: 559px) {
  .join-button {
    flex-basis: 100%;
    align-items: center;
    text-align: center;
  }

  .store-badge {
    flex: 1 1 0;
    min-width: 0;
    justify-content: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 16px;
  }

  .store-badge svg {
    width: 18px;
    height: 18px;
  }
}

/* Sections */

.section {
  padding: clamp(64px, 10vw, 112px) 0;
}

.section h2 {
  margin: 16px 0 20px;
  font-size: clamp(32px, 5.5vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.section h3 {
  margin: 0 0 8px;
  font-size: 21px;
  line-height: 1.25;
}

.section p {
  margin: 0 0 16px;
}

.intro {
  max-width: 40em;
}

.split {
  display: grid;
  gap: 48px;
  align-items: center;
}

@media (min-width: 900px) {
  .split {
    grid-template-columns: 1fr 1fr;
    gap: 80px;
  }

  .split.reverse > :first-child {
    order: 2;
  }
}

.section-white {
  background: var(--white);
}

/* Black, like the journal's card. */
.section-ink {
  background: var(--black);
  color: var(--white);
}

/* Pyramid diagram, decorative: the text explains it. Drawn like the app's
   PyramidDiagram: on white, the grade on the left, a card per slot (lime
   with a black border once filled), and the count on the right. */

.diagram {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 32px 12px;
  border-radius: 28px;
  background: var(--white);
}

.diagram-row {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  gap: 8px;
  align-items: center;
}

.diagram-row .grade {
  font-size: 15px;
  font-weight: 700;
  text-align: right;
}

.slots {
  display: flex;
  justify-content: center;
  gap: clamp(3px, 0.8vw, 6px);
}

/* Shaped like the send cards. */
.slot {
  --width: clamp(22px, 6.2vw, 44px);
  width: var(--width);
  aspect-ratio: 235 / 337;
  /* A fifth of the width, as round in both directions. */
  border-radius: 20% / 13.95%;
  background: var(--empty);
}

.slot.filled {
  border: max(1.5px, calc(var(--width) * 0.08)) solid var(--black);
  background: var(--lime);
}

/* The goal, still to send. */
.slot.goal {
  border: 2px solid var(--black);
  background: transparent;
}

.diagram .count {
  font-size: 14px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* The shapes: grey cards, like the app's home cards. */

.shapes {
  display: grid;
  gap: 10px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.shapes li {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 2px 16px;
  align-items: center;
  padding: 16px 20px;
  border-radius: 22px;
  background: var(--grey);
}

.shapes .rows {
  grid-row: span 2;
  padding: 6px 0;
  border: 1.5px solid var(--black);
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: center;
  white-space: nowrap;
}

.shapes .info {
  font-size: 16px;
  line-height: 1.4;
  color: var(--muted);
}

/* Steps */

.steps {
  display: grid;
  gap: 12px;
  margin: 40px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  padding: 28px;
  border-radius: 22px;
  background: #1c1c1c;
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 20px;
  border-radius: 50%;
  background: var(--lime);
  color: var(--black);
  font-size: 20px;
  font-weight: 700;
}

.steps p {
  margin: 0;
  font-size: 17px;
  color: var(--muted-on-black);
}

@media (min-width: 900px) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Features */

/* A black check on a lime disc, like the app's joined check. */
.checks {
  display: grid;
  gap: 12px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.checks li {
  position: relative;
  padding-left: 36px;
}

.checks li::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--lime) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='%230A0A0A' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat;
}

.shot {
  --phone: min(250px, 50vw);
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0;
  padding: 40px 0;
  border-radius: var(--panel-radius);
  background: var(--grey);
}

.shot .phone {
  width: var(--phone);
  border: 10px solid var(--black);
  border-radius: 44px;
  overflow: hidden;
  background: var(--black);
  box-shadow: 0 24px 48px rgba(10, 10, 10, 0.18);
}

.shot .phone img {
  border-radius: 34px;
}

/* A second screen behind the main one, smaller and to its left. */
.phone.back {
  width: calc(var(--phone) * 0.86);
  margin-right: calc(var(--phone) * -0.3);
}

.phone:not(.back) {
  position: relative;
}

/* Plans, grey cards like the paywall's. */

.plans {
  display: grid;
  gap: 12px;
  margin-top: 40px;
}

.plan {
  padding: 28px;
  border-radius: 22px;
  background: var(--grey);
}

.plan h3 {
  font-size: 24px;
}

.plan .checks {
  margin-top: 16px;
  font-size: 17px;
}

.section .plans-note {
  margin: 24px 0 0;
  font-size: 15px;
  color: var(--muted);
}

@media (min-width: 900px) {
  .plans {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* FAQ: a grey card per question. */

.faq {
  display: grid;
  gap: 10px;
  max-width: 800px;
  margin-top: 32px;
}

.faq details {
  padding: 0 24px;
  border-radius: 22px;
  background: var(--grey);
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0;
  cursor: pointer;
  list-style: none;
}

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

.faq summary::after {
  content: '+';
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--white);
  font-size: 24px;
  font-weight: 500;
  line-height: 1;
  transition: transform 0.2s;
}

.faq details[open] summary::after {
  transform: rotate(45deg);
}

.faq summary h3 {
  margin: 0;
  font-size: 19px;
}

.faq details p {
  margin: 0 0 22px;
  color: var(--muted);
}

/* Header of the pages other than the home page */

.page-hero {
  margin-top: var(--gutter);
  padding: clamp(36px, 6vw, 64px) 0 clamp(48px, 8vw, 80px);
  background: var(--lime);
}

.page-hero h1 {
  margin: 16px 0 16px;
  font-size: clamp(36px, 7vw, 60px);
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.page-hero .lead {
  margin: 0;
}

/* Grade conversion chart */

.charts {
  display: grid;
  gap: 64px;
  align-items: start;
}

.charts h2 {
  font-size: clamp(28px, 4vw, 36px);
}

.grade-table {
  width: 100%;
  margin-top: 24px;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 22px;
  overflow: hidden;
  background: var(--white);
  font-variant-numeric: tabular-nums;
}

.grade-table th,
.grade-table td {
  width: 50%;
  padding: 10px 22px;
  text-align: left;
}

.grade-table th {
  padding-top: 14px;
  padding-bottom: 14px;
  background: var(--black);
  color: var(--white);
  font-size: 15px;
  font-weight: 700;
}

.grade-table td {
  font-weight: 600;
}

.grade-table tbody tr:nth-child(even) {
  background: var(--grey);
}

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

/* Pyramid calculator, and the pyramid in the guide */

.calculator {
  display: grid;
  gap: 32px;
  padding: clamp(20px, 4vw, 40px);
  border-radius: var(--panel-radius);
  background: var(--white);
}

.calculator-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 14px;
  align-content: start;
}

.field.wide {
  grid-column: 1 / -1;
}

/* Like the questions of the app's forms. */
.field label {
  display: block;
  margin-bottom: 8px;
  font-size: 16px;
  font-weight: 700;
}

/* Grey and borderless, like the app's fields. */
.field select {
  width: 100%;
  padding: 13px 40px 13px 16px;
  border: 0;
  border-radius: 10px;
  background: var(--grey) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%230A0A0A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") right 16px center / 12px no-repeat;
  color: var(--black);
  font: inherit;
  font-size: 17px;
  font-weight: 600;
  appearance: none;
  cursor: pointer;
}

.field select:focus-visible {
  outline: 3px solid var(--black);
  outline-offset: 2px;
}

.calculator .diagram {
  background: var(--paper);
}

.diagram.calc .diagram-row {
  grid-template-columns: 52px 1fr 40px;
}

/* The slots and the gaps shrink to fit the bottom row, whose number of slots
   is --cols. */
.diagram.calc .slots {
  --gap: min(3px, calc(40px / var(--cols)));
  gap: var(--gap);
}

.diagram.calc .slot {
  width: min(36px, calc((100% - (var(--cols) - 1) * var(--gap)) / var(--cols)));
}

.diagram.calc .slot.goal {
  border-width: min(2px, calc(20px / var(--cols)));
}

.pyramid-total {
  margin: 20px 0 4px;
  font-size: 22px;
  font-weight: 700;
}

.pyramid-list {
  margin: 0;
  color: var(--muted);
}

.calculator-cta {
  margin-top: 32px;
}

.calculator-cta p {
  margin: 0 0 16px;
  font-weight: 600;
}

@media (min-width: 900px) {
  .calculator {
    grid-template-columns: 320px 1fr;
  }

  .calculator-form {
    grid-template-columns: 1fr;
  }
}

/* Guides and the text under the tools */

/* A readable column, lined up with the page's header. */
.prose > * {
  max-width: 760px;
}

.section .prose h2 {
  margin: 48px 0 12px;
  font-size: clamp(26px, 4vw, 34px);
}

.section .prose h2:first-child {
  margin-top: 0;
}

.prose ul {
  margin: 0 0 16px;
  padding-left: 22px;
}

.prose li {
  margin-bottom: 10px;
}

.prose a,
.more a {
  font-weight: 600;
}

.example {
  margin: 28px 0;
}

.example figcaption {
  margin-top: 12px;
  font-size: 16px;
  color: var(--muted);
  text-align: center;
}

.byline {
  margin: 20px 0 0;
  font-size: 15px;
  font-weight: 500;
}

.section .more {
  margin-top: 24px;
}

/* Final call to action */

.cta {
  background: var(--lime);
  text-align: center;
}

.cta p {
  max-width: 30em;
  margin: 0 auto 28px;
  font-size: clamp(18px, 2.2vw, 21px);
}

.cta .actions {
  justify-content: center;
}

/* Footer, a black card at the bottom like the app's navigation bar. */

.site-footer {
  margin-block: var(--gutter);
  padding: 48px 0;
  background: var(--black);
  color: var(--muted-on-black);
  font-size: 15px;
}

.site-footer .brand {
  color: var(--white);
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 24px 0 12px;
}

.site-footer nav + nav {
  margin-top: 0;
}

.site-footer a:hover {
  color: var(--white);
}

.site-footer p {
  margin: 0;
}

@media (prefers-reduced-motion: reduce) {
  .faq summary::after {
    transition: none;
  }
}
