/* Lama waitlist. One accent (the button), ink on white, a serif only for headlines.
   System fonts on purpose: no font requests to other companies. */

:root {
  --paper: #ffffff;
  --ink: #161513;
  --muted: #5d5a55;
  --line: #dddad3;
  --field: #ffffff;
  --accent: #b9400f;
  --accent-ink: #ffffff;
  --sample: #f6f4ef;
  --error: #a3261b;
  --serif: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #131312;
    --ink: #efede8;
    --muted: #a9a59d;
    --line: #34322e;
    --field: #1b1a18;
    --accent: #f0733d;
    --accent-ink: #131312;
    --sample: #1c1b19;
    --error: #ff8f80;
  }
}

* { box-sizing: border-box; }

/* `hidden` must win over any display rule below (the form is hidden after a signup). */
[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.5 var(--sans);
}

a { color: inherit; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ------------------------------------------------------------------ frame */

.masthead,
.footer,
.layout,
.prose {
  width: 100%;
  max-width: 68rem;
  margin: 0 auto;
  padding-inline: 20px;
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 10px 0;
}

/* Language switch: two small text links, the current one in ink, the other muted. */
.lang-switch { display: flex; gap: 2px; margin-right: -10px; }

.lang-switch a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 8px;
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.lang-switch a:hover { color: var(--ink); }
.lang-switch a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-underline-offset: 0.3em; }

.wordmark {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 700;
  text-decoration: none;
}

.footer {
  padding-block: 32px 40px;
  font-size: 0.875rem;
  color: var(--muted);
}

/* ------------------------------------------------------------------ landing */

.layout {
  display: grid;
  gap: 40px;
  padding-block: 8px;
}

.intro { max-width: 34rem; }

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 600;
}

h1 {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: clamp(1.95rem, 7.8vw, 3.4rem);
  font-weight: 600;
  line-height: 1.07;
  letter-spacing: -0.005em;
  text-wrap: balance;
}

.pitch {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 1.06rem;
  text-wrap: pretty;
}

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

.signup { display: grid; gap: 16px; }

.field { margin: 0; padding: 0; border: 0; display: grid; gap: 6px; min-width: 0; }

.field > label,
legend {
  padding: 0;
  font-size: 0.95rem;
  font-weight: 600;
}

legend { margin-bottom: 4px; }

.optional {
  margin-left: 4px;
  font-weight: 400;
  color: var(--muted);
}

input[type="email"],
input[type="text"],
select {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--field);
  color: var(--ink);
  font: inherit;
}

select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  padding-right: 40px;
}

input:hover, select:hover { border-color: var(--muted); }

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

.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.choice { position: relative; }

.choice input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}

.choice span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-weight: 600;
}

.choice input:hover + span { border-color: var(--muted); }
.choice input:checked + span { border: 2px solid var(--ink); }
.choice input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.choices:has([aria-invalid="true"]) span { border-color: var(--error); }

.consent {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 10px;
  align-items: start;
  font-size: 0.95rem;
  cursor: pointer;
}

.consent input {
  width: 22px;
  height: 22px;
  margin: 1px 0 0;
  accent-color: var(--ink);
}

.consent input[aria-invalid="true"] { outline: 2px solid var(--error); outline-offset: 2px; }

.submit {
  min-height: 52px;
  border: 0;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.submit:hover { filter: brightness(0.94); }
.submit:disabled { cursor: progress; opacity: 0.7; }

.form-error {
  margin: 0;
  color: var(--error);
  font-weight: 600;
}

.fineprint {
  margin: 0;
  color: var(--muted);
  font-size: 0.875rem;
  text-wrap: pretty;
}

/* Honeypot: off-screen, not display:none (some bots skip hidden fields). */
.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.done { outline: none; }
.done h2 { margin: 0 0 8px; font-family: var(--serif); font-size: 1.6rem; font-weight: 600; }
.done p { margin: 0 0 12px; }

.nojs { color: var(--error); font-weight: 600; }

/* ------------------------------------------------------------------ the sample conversation */

.sample {
  align-self: start;
  padding: 20px;
  border-radius: var(--radius);
  background: var(--sample);
}

.sample-title {
  margin: 0 0 12px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted);
}

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

/* Clara on the left with her avatar, the learner on the right in a darker tint. */
.msg { display: flex; align-items: flex-end; gap: 8px; }
.msg.you { justify-content: flex-end; }

.avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 16%, var(--paper));
  color: var(--accent);
  font-family: var(--serif);
  font-size: 0.95rem;
  font-weight: 700;
}

.bubble {
  max-width: 85%;
  margin: 0;
  padding: 9px 13px;
  border-radius: 14px 14px 14px 4px;
  background: var(--paper);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.you .bubble {
  border-radius: 14px 14px 4px 14px;
  background: color-mix(in srgb, var(--ink) 8%, var(--sample));
}

.who {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}

/* The slip and its correction: a wavy underline on the mistake, a soft highlight on the fix. */
.slip {
  text-decoration: underline wavy var(--error);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

.fix {
  padding: 0 3px;
  margin: 0 -1px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: inherit;
  font-weight: 600;
}

.explain {
  display: block;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.875rem;
}

.sample-note {
  margin: 14px 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

@media (min-width: 900px) {
  .layout {
    grid-template-columns: minmax(0, 34rem) minmax(0, 24rem);
    justify-content: space-between;
    padding-block: 48px 16px;
  }

  .sample { margin-top: 140px; }
}

/* ------------------------------------------------------------------ privacy */

.prose { max-width: 42rem; padding-block: 16px; }
.prose h1 { font-size: clamp(2rem, 7vw, 2.8rem); }
.prose h2 { margin: 32px 0 8px; font-size: 1.1rem; }
.prose p, .prose li { text-wrap: pretty; }
.prose ul { padding-left: 1.2em; }
.prose li + li { margin-top: 6px; }
.lede { color: var(--muted); }

/* ------------------------------------------------------------------ link pages (confirm, unsubscribe) */

body:not(.landing):not(.document) {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
}

.card {
  width: 100%;
  max-width: 28rem;
  padding: 28px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.brand {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.2rem;
}

.card h1 { font-size: 1.7rem; }
.card p { margin: 0 0 20px; }

.card button {
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: var(--radius);
  padding: 12px 16px;
  font: inherit;
  font-weight: 650;
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
}

.card button.danger { background: var(--ink); color: var(--paper); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
