/* The colours and type of the design canvas: ink, yellow, Atkinson Hyperlegible. */

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

@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("/assets/fonts/AtkinsonHyperlegible-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --yellow: #ffd60a;
  --yellow-hover: #ffe04d;
  --ink: #14161a;
  --ink-surface: #1e2127;
  --on-ink: #ffffff;
  --on-ink-secondary: #c8ccd2;
  --background: #ffffff;
  --surface: #f3f4f6;
  --text: #14161a;
  --secondary-text: #474d57;
  --border: #c9cdd3;
  --error: #b3261e;
  --success: #1e7b34;
  --content-width: 72rem;
  --radius: 24px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #14161a;
    --surface: #1e2127;
    --text: #ffffff;
    --secondary-text: #c8ccd2;
    --border: #3a3f47;
    --error: #ff8a80;
    --success: #30d158;
  }
}

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

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

@media (max-width: 40rem) {
  html {
    font-size: 118.75%;
  }
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: "Atkinson Hyperlegible", system-ui, sans-serif;
  line-height: 1.55;
}

h1,
h2,
h3 {
  line-height: 1.15;
  margin: 0 0 0.6em;
}

h1 {
  font-size: clamp(2.1rem, 5vw, 3.2rem);
}

h2 {
  font-size: clamp(1.7rem, 3.6vw, 2.3rem);
}

h3 {
  font-size: 1.3rem;
}

p,
ul,
ol {
  margin: 0 0 1em;
}

a {
  color: inherit;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 0.16em;
}

:focus-visible {
  outline: 4px solid var(--yellow);
  outline-offset: 3px;
  box-shadow: 0 0 0 7px var(--ink);
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -10rem;
  z-index: 10;
  padding: 0.6rem 1rem;
  background: var(--yellow);
  color: var(--ink);
  font-weight: 700;
  border-radius: 12px;
}

.skip-link:focus {
  top: 1rem;
}

.container {
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Header, on ink like the hero below it. */

.site-header {
  background: var(--ink);
  color: var(--on-ink);
}

.site-header .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--on-ink);
  font-size: 1.5rem;
  font-weight: 700;
  text-decoration: none;
}

.brand img {
  width: 3.2rem;
  height: auto;
}

.language-switcher ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.language-switcher a {
  display: inline-block;
  min-height: 44px;
  padding: 0.35rem 0.75rem;
  border: 2px solid transparent;
  border-radius: 999px;
  color: var(--on-ink);
  font-weight: 700;
  text-decoration: none;
}

.language-switcher a:hover {
  border-color: var(--on-ink-secondary);
}

.language-switcher a[aria-current="page"] {
  border-color: var(--yellow);
}

/* The suggestion of another language, on the English home page only. */

.language-suggestion {
  background: var(--yellow);
  color: var(--ink);
}

.language-suggestion[hidden] {
  display: none;
}

.language-suggestion .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.language-suggestion p {
  margin: 0;
  font-weight: 700;
}

.language-suggestion a {
  font-weight: 700;
}

.language-suggestion button {
  margin-left: auto;
  min-width: 44px;
  min-height: 44px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  padding: 0 1rem;
  cursor: pointer;
}

/* Hero. */

.hero {
  background: var(--ink);
  color: var(--on-ink);
  padding: 2.5rem 0 4rem;
}

.hero .container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  align-items: center;
}

@media (min-width: 60rem) {
  .hero .container {
    grid-template-columns: 1.05fr 1fr;
  }
}

.hero h1 {
  margin-bottom: 0.5em;
}

.hero h1 em {
  color: var(--yellow);
  font-style: normal;
}

.hero .lead {
  font-size: 1.2rem;
  color: var(--on-ink-secondary);
  max-width: 36rem;
}

.hero .lead strong {
  color: var(--on-ink);
}

.hero-illustration svg {
  display: block;
  width: 100%;
  height: auto;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3.2rem;
  padding: 0.6rem 1.5rem;
  border: 3px solid var(--yellow);
  border-radius: 16px;
  background: var(--yellow);
  color: var(--ink);
  font: inherit;
  font-size: 1.1rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.button:hover {
  background: var(--yellow-hover);
  border-color: var(--yellow-hover);
}

.button-secondary {
  background: transparent;
  color: inherit;
}

.button-secondary:hover {
  background: rgba(255, 214, 10, 0.12);
  border-color: var(--yellow);
}

/* Sections. */

.section {
  padding: 4rem 0;
}

.section-alternate {
  background: var(--surface);
}

.section-intro {
  max-width: 42rem;
  color: var(--secondary-text);
  font-size: 1.1rem;
}

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1.5rem;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  counter-increment: step;
  padding: 1.75rem;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--on-ink);
  border: 3px solid var(--yellow);
}

.steps li::before {
  content: counter(step);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  margin-bottom: 1rem;
  border-radius: 50%;
  background: var(--yellow);
  color: var(--ink);
  font-size: 1.5rem;
  font-weight: 700;
}

.steps p {
  margin: 0;
  color: var(--on-ink-secondary);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.card {
  padding: 1.75rem;
  border-radius: var(--radius);
  background: var(--background);
  border: 2px solid var(--border);
}

.card ul {
  padding-left: 1.2em;
}

.card li + li {
  margin-top: 0.4em;
}

.card > :last-child {
  margin-bottom: 0;
}

.plain-list {
  max-width: 46rem;
  padding-left: 1.2em;
}

.plain-list li + li {
  margin-top: 0.6em;
}

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.facts .card h3 {
  margin-bottom: 0.4em;
}

/* The private beta: the request form and the downloads. */

.beta {
  background: var(--ink);
  color: var(--on-ink);
}

.beta .section-intro {
  color: var(--on-ink-secondary);
}

.beta-grid {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  gap: 2rem;
  margin-top: 2rem;
}

@media (min-width: 60rem) {
  .beta-grid {
    grid-template-columns: 1.1fr 1fr;
  }
}

.panel {
  padding: 1.75rem;
  border: 3px solid var(--yellow);
  border-radius: var(--radius);
  background: var(--ink-surface);
}

.panel > :last-child {
  margin-bottom: 0;
}

.panel p {
  color: var(--on-ink-secondary);
}

.beta-form label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 700;
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.beta-form input[type="email"] {
  flex: 1 1 14rem;
  min-height: 3.2rem;
  padding: 0.5rem 0.9rem;
  border: 3px solid var(--on-ink-secondary);
  border-radius: 16px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-size: 1.1rem;
}

.beta-form input[type="email"]:focus-visible {
  border-color: var(--yellow);
}

.beta-form .button {
  flex: 0 0 auto;
}

.beta-form .button[disabled] {
  opacity: 0.6;
  cursor: progress;
}

.form-note {
  margin-top: 1rem;
  font-size: 0.9rem;
}

.form-message {
  margin: 1rem 0 0;
  padding: 1rem 1.25rem;
  border-radius: 16px;
  font-weight: 700;
}

.form-message[hidden] {
  display: none;
}

.form-message:focus {
  outline: none;
  box-shadow: none;
}

.panel .form-message-success {
  background: #30d158;
  color: var(--ink);
}

.panel .form-message-error {
  background: #ffdad6;
  color: #410002;
}

.downloads {
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

.downloads li + li {
  margin-top: 0.75rem;
}

.downloads a {
  display: flex;
  flex-direction: column;
  padding: 0.9rem 1.2rem;
  border: 2px solid var(--on-ink-secondary);
  border-radius: 16px;
  color: var(--on-ink);
  text-decoration: none;
}

.downloads a:hover {
  border-color: var(--yellow);
}

.downloads strong {
  font-size: 1.1rem;
}

.downloads span {
  color: var(--on-ink-secondary);
  font-size: 0.9rem;
}

/* Long text: the privacy policy. */

.prose {
  max-width: 46rem;
  padding-top: 3rem;
  padding-bottom: 4rem;
}

.prose h2 {
  margin-top: 2.2em;
  font-size: 1.6rem;
}

.prose h3 {
  margin-top: 1.6em;
}

.prose ul {
  padding-left: 1.2em;
}

.prose li + li {
  margin-top: 0.4em;
}

.draft-note {
  margin-bottom: 2rem;
  padding: 1rem 1.25rem;
  border: 3px solid var(--ink);
  border-radius: 16px;
  background: var(--yellow);
  color: var(--ink);
  font-weight: 700;
}

.updated {
  color: var(--secondary-text);
}

/* Footer. */

.site-footer {
  border-top: 2px solid #3a3f47;
  background: var(--ink);
  color: var(--on-ink-secondary);
  padding: 2.5rem 0;
  font-size: 0.95rem;
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: center;
  justify-content: space-between;
}

.site-footer a {
  color: var(--on-ink);
}

.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer p {
  margin: 0;
}

/* The page that is not there. */

.not-found {
  min-height: 70vh;
  display: flex;
  align-items: center;
  background: var(--ink);
  color: var(--on-ink);
  padding: 3rem 0;
}

.not-found-page {
  background: var(--ink);
}

.not-found h1,
.not-found h2 {
  font-size: clamp(1.7rem, 3.6vw, 2.3rem);
}

.not-found img {
  width: 12rem;
  height: auto;
  margin-bottom: 1.5rem;
}

.not-found section + section {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 2px solid #3a3f47;
}

.not-found p {
  color: var(--on-ink-secondary);
}

/* In dark mode the ink sections would merge with the page: a line parts them. */
@media (prefers-color-scheme: dark) {
  .hero {
    border-bottom: 2px solid var(--border);
  }

  .beta {
    border-top: 2px solid var(--border);
  }
}

@media (max-width: 40rem) {
  .steps li,
  .card,
  .panel {
    padding: 1.25rem;
  }

  .section {
    padding: 3rem 0;
  }
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}
