/*
 * VocabGecko marketing site: plain CSS, system fonts, no libraries, no JavaScript.
 * Tokens match web/src/styles.css (the app), so the site and the app look like one product.
 * Rules shared with the app: prose is 20px or more, every button and link-button is at least 48px tall,
 * and text and focus rings meet WCAG AA contrast. Mobile first, with one breakpoint at 900px.
 */

:root {
  --bg: #fff8ec;
  --surface: #ffffff;
  --ink: #1f2340; /* on --bg: about 14:1 */
  --ink-soft: #444a70; /* on --bg: about 8:1 */
  --primary: #2f3bbd; /* white text on it: about 8.5:1; on --bg: about 8:1 */
  --primary-ink: #ffffff;
  --line: #d9cfbd;

  /* tile colours: dark text on all of them is well above 7:1 */
  --tile-1: #ffd9a0; /* peach */
  --tile-2: #bfe8ff; /* sky */
  --tile-3: #cdf2c2; /* mint */
  --tile-4: #ffc9de;
  --tile-5: #e3d4ff;
  --sun: #ffd36e; /* highlight behind key words; the only token the app does not define */

  --radius: 20px;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  display: flex;
  flex-direction: column;
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.25rem; /* 20px */
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

main {
  flex: 1;
}

img,
svg {
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3 {
  margin: 0 0 0.75rem;
  font-weight: 900;
  line-height: 1.1;
}

h1 {
  font-size: 2.5rem; /* 40px on a phone */
  letter-spacing: -0.02em;
}

h2 {
  font-size: 1.75rem; /* 28px */
}

h3 {
  font-size: 1.375rem;
}

p,
ul,
ol {
  margin: 0 0 1.25rem;
}

a {
  color: var(--primary);
  text-underline-offset: 4px;
}

:focus-visible {
  outline: 4px solid var(--ink);
  outline-offset: 3px;
}

/* ---- layout ---- */

.wrap {
  max-width: 72rem;
  margin: 0 auto;
  padding-right: 1rem; /* 16px gutter */
  padding-left: 1rem;
}

.prose {
  max-width: 44rem;
}

.band {
  padding: 2rem 0;
  border-top: 2px solid var(--ink);
}

.band.white {
  background: var(--surface);
}

.skip {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 10;
}

.skip:focus {
  left: 1rem;
  top: 1rem;
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 1rem;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

/* ---- header ---- */

.site-header {
  border-bottom: 2px solid var(--ink);
}

.bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.75rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 48px;
  margin-right: auto;
  color: var(--ink);
  font-size: 1.25rem;
  font-weight: 900;
  text-decoration: none;
}

/* On a phone the brand and the call to action share the first row and the links wrap below them. */
.links {
  display: flex;
  flex-wrap: wrap;
  flex-basis: 100%;
  order: 3;
}

.cta {
  order: 2;
}

.links a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 0.625rem;
  color: var(--ink);
  font-size: 1.125rem;
  font-weight: 600;
  text-decoration: none;
}

.links a:hover,
.links a[aria-current='page'],
.links a[href='/app/'] {
  text-decoration: underline;
  text-underline-offset: 6px;
}

.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  margin: 0;
  padding: 0.25rem 0;
  list-style: none;
  font-size: 1.125rem;
}

.crumbs li {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  color: var(--ink-soft);
}

.crumbs li + li::before {
  content: '/';
  margin: 0 0.5rem;
}

.crumbs a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
}

/* ---- buttons ---- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.625rem 1.5rem;
  border: 2px solid var(--ink);
  border-radius: 16px;
  background: var(--primary);
  box-shadow: 0 4px 0 var(--ink);
  color: var(--primary-ink);
  font-size: 1.125rem;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
}

/* The mockup's small button was 40px tall; every tap target here is at least 48px. */
.btn.sm {
  min-height: 48px;
  padding: 0.25rem 1rem;
  border-radius: 12px;
  box-shadow: 0 3px 0 var(--ink);
}

.btn:hover {
  transform: translateY(1px);
  box-shadow: 0 3px 0 var(--ink);
}

/* ---- components from the approved mockup ---- */

.hl {
  padding: 0 0.25em;
  border-radius: 12px;
  background: var(--sun);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.lede {
  max-width: 32rem;
  margin: 1rem 0 1.5rem;
  font-size: 1.25rem;
  line-height: 1.45;
}

.small {
  margin-top: 0.75rem;
  color: var(--ink-soft);
  font-size: 1.25rem; /* running text: 20px */
}

.hero {
  display: grid;
  gap: 1.75rem;
  align-items: center;
  padding-top: 1.5rem;
  padding-bottom: 2rem;
}

.device {
  padding: 0.875rem;
  border: 3px solid var(--ink);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: 0 8px 0 var(--ink);
}

.wordcard {
  padding: 1rem;
  border: 2px solid var(--ink);
  border-radius: 18px;
  background: var(--tile-2);
  text-align: center;
}

.pic {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 110px;
  border: 2px dashed var(--ink);
  border-radius: 14px;
  background: var(--surface);
  font-size: 3rem;
}

.word {
  margin: 0.625rem 0 0.25rem;
  font-size: 1.75rem;
  font-weight: 900;
}

.def {
  margin: 0;
}

.streak {
  display: flex;
  justify-content: space-between;
  margin-top: 0.625rem;
  font-size: 1.125rem;
  font-weight: 800;
}

.steps,
.cards {
  display: grid;
  gap: 1rem;
  margin: 1.125rem 0 1.5rem;
  padding: 0;
  list-style: none;
}

.step,
.card {
  padding: 1.125rem;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 0 5px 0 var(--ink);
  line-height: 1.4;
}

.num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-bottom: 0.625rem;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 1.25rem;
  font-weight: 900;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  margin: 1rem 0 1.25rem;
  padding: 0;
  list-style: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0.25rem 1rem;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--surface);
  font-size: 1.125rem;
  font-weight: 700;
}

.tile-peach {
  background: var(--tile-1);
}

.tile-sky {
  background: var(--tile-2);
}

.tile-mint {
  background: var(--tile-3);
}

.tile-pink {
  background: var(--tile-4);
}

.tile-lilac {
  background: var(--tile-5);
}

/* ---- home page ---- */

.answer {
  max-width: 44rem;
}

.card h3 {
  margin-bottom: 0.5rem;
}

.card p {
  margin-bottom: 0;
}

/* A link that stands apart from running text without being a call to action (those are .btn). */
.more {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  font-weight: 800;
}

.demo {
  display: grid;
  gap: 1.75rem;
  align-items: center;
}

.demo-figure {
  margin: 0;
}

.demo-figure figcaption {
  margin-top: 1.25rem;
  color: var(--ink-soft);
  font-weight: 700;
  text-align: center;
}

/* A static iPad: a dark bezel around a practice question. Not interactive, so it has no buttons. */
.ipad {
  max-width: 34rem;
  margin: 0 auto;
  padding: 0.875rem;
  border-radius: 32px;
  background: var(--ink);
  box-shadow: 0 8px 0 var(--line);
}

.screen {
  padding: 1.125rem;
  border-radius: 18px;
  background: var(--bg);
}

.progress {
  height: 14px;
  margin-bottom: 1rem;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--surface);
  overflow: hidden;
}

.progress span {
  display: block;
  width: 60%;
  height: 100%;
  background: var(--primary);
}

.q {
  margin: 0 0 1rem;
  font-size: 1.375rem;
  font-weight: 800;
  line-height: 1.25;
}

.opts {
  display: grid;
  gap: 0.625rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

.opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 0.25rem 1rem;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: var(--surface);
  font-size: 1.125rem;
  font-weight: 700;
}

.opt.right {
  background: var(--tile-3);
}

.demo-ok {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 900;
}

.faq-list {
  display: grid;
  gap: 1rem;
  margin: 1.125rem 0 1.25rem;
}

.faq-item {
  padding: 1.125rem;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 5px 0 var(--ink);
}

.faq-item h3 {
  margin-bottom: 0.5rem;
}

.faq-item p {
  margin-bottom: 0;
}

.cta-band {
  background: var(--tile-2);
}

.cta-band .prose {
  margin: 0 auto;
  text-align: center;
}

/* ---- guide, explainer, science and FAQ pages ---- */

/* A page with several question sections in one column (the FAQ) keeps room between them. */
.prose h2:not(:first-child) {
  margin-top: 2rem;
}

.prose ul:not(.related):not(.choices),
.prose ol {
  padding-left: 1.5rem;
}

.prose li {
  margin-bottom: 0.5rem;
}

dfn {
  font-style: normal;
  font-weight: 800;
}

.vocabulary-selection {
  margin: 2rem 0;
}

.vocabulary-entry {
  padding: 1.25rem 0;
  border-bottom: 1px solid currentColor;
  break-inside: avoid;
}

.vocabulary-entry dt {
  font-size: 24px;
  font-weight: 700;
}

.vocabulary-entry dd {
  margin: 0;
}

.practice-link {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0.5rem 0;
}

.practice-questions > li {
  padding: 1rem 0;
  break-inside: avoid;
}

.practice-questions ol > li {
  padding: 0.25rem 0;
}

.practice-answers {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 2px solid currentColor;
  scroll-margin-top: 2rem;
}

@media print {
  .site-header, .site-footer, .cta-band, .practice-link, .skip { display: none; }
  .band { padding: 1rem 0; background: white; }
  .practice-answers { break-before: page; }
  .practice-questions > li, .practice-answers li { break-inside: avoid; }
}

.terms {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 1rem;
  margin: 1.125rem 0 1.5rem;
}

.term {
  padding: 1.125rem;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--bg);
  box-shadow: 0 5px 0 var(--ink);
  line-height: 1.4;
}

.term dt {
  font-size: 1.375rem;
  font-weight: 900;
}

.term dd {
  margin: 0.25rem 0 0;
}

.example-q {
  font-weight: 800;
}

.example p + p,
.example ul + p {
  margin-top: 0.75rem;
}

.choices {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
}

.choices li {
  margin: 0;
  padding: 0.125rem 0.75rem;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--surface);
  font-size: 1.25rem; /* running text: 20px */
  font-weight: 700;
}

.related {
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.related li {
  margin-bottom: 0.25rem;
}

/* Standalone links: a 48px tap target, as .more. */
.related a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  font-weight: 800;
}

.refs li {
  margin-bottom: 1rem;
}

/* ---- join page ---- */

/* Rules that set `display` must not un-hide a message that carries the hidden attribute. */
[hidden] {
  display: none !important;
}

.join-form {
  max-width: 32rem;
}

.field {
  margin-bottom: 1.25rem;
}

.field label {
  display: block;
  margin-bottom: 0.375rem;
  font-weight: 800;
}

.field input,
.field select {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 0.5rem 0.875rem;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 1.25rem; /* 20px */
}

/* A checkbox and its label. The label is the tap target, so it is 48px tall; the box sits level with its first line. */
.check {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.check input {
  flex: none;
  width: 28px;
  height: 28px;
  margin: 10px 0 0;
  accent-color: var(--primary);
}

.check label {
  display: flex;
  align-items: center;
  min-height: 48px;
}

.note {
  margin: 0;
  color: var(--ink-soft);
}

.form-error {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border: 2px solid #b3261e;
  border-left-width: 8px;
  border-radius: 12px;
  background: var(--surface);
  font-weight: 700;
}

.join-form .btn {
  margin-top: 0.5rem;
  font-family: inherit;
  font-size: 1.25rem;
  cursor: pointer;
}

/* ---- legal pages ---- */

/* The "draft, waiting for a legal review" notice. It has a border and heavy text as well as a tint, so it is not told by colour alone. */
.draft-note {
  margin: 1.5rem 0 0;
  padding: 0.75rem 1rem;
  border: 2px solid var(--ink);
  border-left-width: 8px;
  border-radius: 12px;
  background: var(--tile-1);
}

/* ---- 404 ---- */

.notfound {
  padding: 3rem 0 4rem;
}

.mascot {
  display: block;
  margin-bottom: 1rem;
}

/* ---- footer ---- */

.site-footer {
  padding: 1.5rem 0 2.5rem;
  border-top: 2px solid var(--ink);
  background: var(--surface);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1rem;
  margin-bottom: 0.75rem;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  font-size: 1.125rem;
  font-weight: 600;
}

.independence {
  max-width: 44rem;
  margin: 0;
  color: var(--ink-soft);
}

/* ---- laptop and up ---- */

@media (min-width: 900px) {
  .wrap {
    padding-right: 1.75rem;
    padding-left: 1.75rem;
  }

  h1 {
    font-size: 3.375rem; /* 54px */
  }

  h2 {
    font-size: 2.125rem; /* 34px */
  }

  .links {
    flex-basis: auto;
    order: 0;
    margin-right: 0.25rem;
  }

  .cta {
    order: 0;
  }

  .band {
    padding: 2.5rem 0;
  }

  .hero {
    grid-template-columns: 1.1fr 0.9fr;
    gap: 1.75rem;
    padding-top: 2rem;
    padding-bottom: 2.5rem;
  }

  .device {
    transform: rotate(2deg);
  }

  .steps,
  .cards {
    grid-template-columns: repeat(3, 1fr);
  }

  .demo {
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
  }

  .opts {
    grid-template-columns: 1fr 1fr;
  }

  .faq-list {
    grid-template-columns: 1fr 1fr;
  }
}
