/* Gelasio (OFL, see fonts/OFL.txt) is metric-compatible with Georgia, so
   the fallback swap is quiet. It has no Cyrillic: ru/uk fall back per glyph. */
@font-face {
  font-family: "Gelasio";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/gelasio-latin-400-normal.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;
}
@font-face {
  font-family: "Gelasio";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/gelasio-latin-600-normal.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;
}
@font-face {
  font-family: "Gelasio";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/gelasio-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
    U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Gelasio";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/gelasio-latin-ext-600-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
    U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: light;

  --paper: #fbf8f2;
  --paper-deep: #f5f0e6;
  --card: #ffffff;
  --ink: #1f2a44;
  --ink-soft: #3a4560;
  --muted: #646b7d;
  --faint: #8d93a3;
  --line: #ece6d9;
  --field-line: #d6cebe;
  --amber: #f2b84b;
  --amber-wash: #fff6e0;
  --badge-bg: #fbe9c2;
  --badge-ink: #7a5710;
  --error: #a3352b;

  --serif: "Gelasio", Georgia, "Noto Serif", "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Noto Sans", sans-serif;

  --gutter: 16px;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(31 42 68 / 0.04),
    0 14px 36px -18px rgb(31 42 68 / 0.18);
}

@media (min-width: 640px) {
  :root {
    --gutter: 32px;
  }
}

*,
*::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-soft);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.2;
  text-wrap: balance;
}

p {
  margin: 0;
}

a {
  color: var(--ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-color: var(--amber);
  text-decoration-thickness: 2px;
}

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

/* Highlighter stroke over the lower part of the text, as in the logo. */
.highlight {
  background: linear-gradient(
    transparent 58%,
    var(--amber) 58%,
    var(--amber) 92%,
    transparent 92%
  );
  color: inherit;
  padding: 0 0.08em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* ---- Top bar ---- */

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 16px var(--gutter);
}

.brand {
  display: block;
  line-height: 0;
  border-radius: 6px;
}

.brand-logo {
  width: auto;
  height: 30px;
}

.lang-switcher ul {
  display: flex;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
  list-style: none;
}

.lang-switcher a {
  display: block;
  padding: 4px 5px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-decoration: none;
}

.lang-switcher a:hover {
  color: var(--ink);
  background: var(--paper-deep);
}

.lang-switcher a[aria-current="page"] {
  color: var(--ink);
  box-shadow: inset 0 -3px 0 var(--amber);
  border-radius: 6px 6px 2px 2px;
}

@media (min-width: 640px) {
  .topbar {
    padding-block: 22px;
  }
  .brand-logo {
    height: 38px;
  }
  .lang-switcher a {
    padding: 6px 9px;
  }
}

/* ---- Shared section frame ---- */

main > section {
  padding: 48px var(--gutter);
}

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

main > section > h2 {
  max-width: 26ch;
  margin: 0 auto 32px;
  font-size: clamp(1.5rem, 1.15rem + 1.5vw, 2.125rem);
  text-align: center;
}

@media (min-width: 640px) {
  main > section {
    padding-block: 80px;
  }
  main > section > h2 {
    margin-bottom: 44px;
  }
}

/* ---- Hero ---- */

.hero {
  text-align: center;
}

main > .hero {
  padding-top: 32px;
}

@media (min-width: 640px) {
  main > .hero {
    padding-top: 56px;
  }
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--badge-bg);
  color: var(--badge-ink);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.hero h1 {
  max-width: 17ch;
  margin: 0 auto;
  font-size: clamp(2.125rem, 1.3rem + 3.6vw, 3.5rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
}

.hero .lead {
  max-width: 34rem;
  margin: 20px auto 0;
  font-size: 1.125rem;
}

@media (min-width: 640px) {
  .hero .lead {
    font-size: 1.25rem;
  }
}

/* ---- Waitlist form ---- */

.waitlist-form,
.waitlist-thanks {
  max-width: 600px;
  margin: 32px auto 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  background: var(--card);
  box-shadow: var(--shadow);
  text-align: left;
}

.waitlist-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "email"
    "languages"
    "turnstile"
    "submit"
    "error"
    "note";
}

@media (min-width: 640px) {
  .waitlist-form,
  .waitlist-thanks {
    padding: 28px;
  }
  .waitlist-form {
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 12px;
    grid-template-areas:
      "email submit"
      "languages languages"
      "turnstile turnstile"
      "error error"
      "note note";
  }
}

.form-email {
  grid-area: email;
}

.form-languages {
  grid-area: languages;
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

@media (min-width: 520px) {
  .form-languages {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
}

.form-field label {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 0.875rem;
  font-weight: 600;
}

.form-optional {
  color: var(--muted);
  font-weight: 400;
}

.waitlist-form input,
.waitlist-form select {
  display: block;
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 11px 14px;
  border: 1px solid var(--field-line);
  border-radius: 10px;
  background-color: var(--card);
  color: var(--ink);
  /* 16px or more keeps iOS Safari from zooming into the field. */
  font: inherit;
  font-size: 1rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.waitlist-form input::placeholder {
  color: var(--faint);
}

.waitlist-form select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%231F2A44' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 15px center;
  text-overflow: ellipsis;
}

.waitlist-form input:hover,
.waitlist-form select:hover {
  border-color: var(--faint);
}

.waitlist-form input:focus-visible,
.waitlist-form select:focus-visible {
  border-color: var(--ink);
  border-radius: 10px;
  outline: none;
  box-shadow: 0 0 0 3px rgb(31 42 68 / 0.18);
}

.turnstile {
  grid-area: turnstile;
}

.turnstile:not(:empty) {
  margin-top: 14px;
}

.form-submit {
  grid-area: submit;
  align-self: end;
  min-height: 48px;
  margin-top: 18px;
  padding: 12px 22px;
  border: 0;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

@media (min-width: 640px) {
  .form-submit {
    margin-top: 0;
    white-space: nowrap;
  }
}

.form-submit:hover {
  background: #2c3a5c;
}

.form-submit:disabled {
  cursor: progress;
  opacity: 0.75;
}

.form-error {
  grid-area: error;
  margin-top: 14px;
  color: var(--error);
  font-size: 0.9375rem;
  font-weight: 500;
}

.form-error:empty {
  display: none;
}

.form-note {
  grid-area: note;
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.875rem;
  text-align: center;
}

.waitlist-thanks {
  border-left: 4px solid var(--amber);
  background: var(--amber-wash);
  text-align: center;
}

/* Focused only so screen readers announce it; the box is not a control. */
.waitlist-thanks:focus {
  outline: none;
}

.thanks-title {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.375rem;
  font-weight: 600;
  line-height: 1.3;
}

.thanks-text,
.thanks-follow {
  margin-top: 6px;
}

/* ---- Dictionary vs Defraze ---- */

.compare-columns {
  display: grid;
  gap: 16px;
  max-width: 960px;
  margin: 0 auto;
}

@media (min-width: 760px) {
  .compare-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
  }
}

.compare-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

@media (min-width: 640px) {
  .compare-card {
    padding: 28px;
  }
}

.compare-dictionary {
  background: var(--paper-deep);
  color: var(--faint);
}

.compare-defraze {
  background: var(--card);
  box-shadow: var(--shadow);
}

.compare-label {
  font-family: var(--sans);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.compare-dictionary .compare-label {
  color: var(--muted);
}

.compare-note {
  margin-top: 2px;
  font-size: 0.9375rem;
}

.compare-defraze .compare-note {
  color: var(--muted);
}

.example {
  margin: 20px 0 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.25rem;
  line-height: 1.5;
}

.compare-dictionary .example {
  color: var(--muted);
}

.example .term {
  text-decoration: underline dotted;
  text-underline-offset: 0.2em;
}

.dictionary-entry {
  margin-top: 18px;
  font-size: 0.9375rem;
  line-height: 1.5;
}

.dictionary-headword {
  color: var(--muted);
  font-family: var(--serif);
  font-weight: 600;
}

.dictionary-senses {
  margin: 6px 0 0;
  padding-left: 1.5em;
  /* Fades out to suggest the list goes on and on. */
  -webkit-mask-image: linear-gradient(#000 55%, transparent);
  mask-image: linear-gradient(#000 55%, transparent);
}

.dictionary-senses li + li {
  margin-top: 2px;
}

.dictionary-more {
  margin-top: -4px;
  font-size: 1.25rem;
  line-height: 1;
}

.meaning {
  margin-top: 20px;
  padding: 14px 16px;
  border-left: 4px solid var(--amber);
  border-radius: 0 10px 10px 0;
  background: var(--amber-wash);
  color: var(--ink);
}

.meaning b {
  font-family: var(--serif);
  font-weight: 600;
}

/* ---- How it works ---- */

.steps {
  display: grid;
  gap: 16px;
  max-width: 960px;
  margin: 0 auto;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

@media (min-width: 760px) {
  .steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
  }
}

.step {
  counter-increment: step;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}

/* The step number sits on a highlighter bar, echoing the logo mark. */
.step::before {
  content: counter(step);
  display: inline-block;
  margin-bottom: 10px;
  padding: 0 0.3em;
  background: linear-gradient(
    transparent 55%,
    var(--amber) 55%,
    var(--amber) 90%,
    transparent 90%
  );
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.2;
}

.step h3 {
  font-size: 1.25rem;
}

.step p {
  margin-top: 6px;
  font-size: 1rem;
}

/* ---- Closing ---- */

.closing {
  text-align: center;
}

main > .closing > h2 {
  max-width: 22ch;
  margin-bottom: 0;
  font-size: clamp(1.625rem, 1.2rem + 1.8vw, 2.375rem);
}

/* ---- Footer ---- */

.site-footer {
  padding: 32px var(--gutter) 40px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.875rem;
  text-align: center;
}

.footer-links {
  margin-top: 6px;
}

.footer-links a {
  color: var(--muted);
}

.footer-links a:hover {
  color: var(--ink);
}

/* ---- Privacy and 404 ---- */

main.privacy,
main.not-found {
  max-width: 680px;
  margin: 0 auto;
  padding: 32px var(--gutter) 64px;
}

main.privacy h1,
main.not-found h1 {
  font-size: clamp(2rem, 1.5rem + 2vw, 2.75rem);
}

main.privacy .lead {
  margin-top: 12px;
  font-size: 1.125rem;
}

main.privacy h2 {
  margin: 36px 0 10px;
  font-size: 1.375rem;
}

main.privacy p + p,
main.privacy ul + p {
  margin-top: 12px;
}

main.privacy ul {
  margin: 10px 0 0;
  padding-left: 1.3em;
}

.privacy-back {
  margin-top: 48px;
}

main.not-found {
  padding-block: 64px 96px;
  text-align: center;
}

main.not-found p {
  margin-top: 16px;
}

@media (min-width: 640px) {
  main.privacy {
    padding-top: 56px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}
