/* Self-hosted EB Garamond (SIL OFL, public/fonts/OFL.txt): the LEARNable Labs face, with no
   request to a font service. One variable file covers weights 400-700; the pages use no italics. */
@font-face {
  font-family: 'EB Garamond';
  src: url('/fonts/eb-garamond-latin.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
:root {
  --paper: #f5f1e8;
  --card: #fbf9f4;
  --ink: #2a2a2a;
  --muted: #5f5a52; /* 6.1:1 on paper */
  --green: #00693e; /* Dartmouth green: 6.8:1 under white text */
  --green-dark: #004f2e;
  --line: #e2dccf;
  --field: #8a8174; /* input borders: 3.8:1 on white */
  --serif: 'EB Garamond', Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --gutter: 40px;
  --content: min(1120px, 100% - 2 * var(--gutter)); /* one left edge for every section */
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 30px;
}
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.55;
}
a {
  color: inherit;
  text-decoration: none;
}
a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 4px;
}
button,
input {
  font: inherit;
}
button,
a.button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.12;
  margin: 0;
}
em,
i {
  font-style: normal; /* upright throughout */
}
/* A quiet sentence above a heading, never a tracked capital label. */
.eyebrow {
  font-size: 19px;
  color: var(--muted);
  margin: 0 0 12px;
}
.quiet {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--muted);
}

/* ── Header ─────────────────────────────────────────── */
.site-header {
  width: var(--content);
  margin: auto;
  padding: 26px 0;
  display: flex;
  flex-wrap: wrap; /* on the narrowest screens the links drop to a second row, never off-screen */
  align-items: center;
  justify-content: space-between;
  gap: 10px 30px;
}
.brand {
  font-size: 30px;
  letter-spacing: -0.3px;
  white-space: nowrap;
  flex-shrink: 0;
}
/* The spark (#262), from the page's green. */
.brand .brand-mark {
  width: 44px;
  height: 44px;
  fill: var(--green);
  vertical-align: middle;
  margin: -6px 12px 0 0;
}
.brand span {
  color: var(--green);
  font-weight: 600;
}
.site-header nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 17px;
}
.site-header nav a {
  white-space: nowrap;
}
.site-header nav a:not(.button):hover,
.text-link:hover,
.auth-links a:hover,
footer a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ── Buttons and links ──────────────────────────────── */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid var(--green);
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  padding: 13px 22px;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
  transition: background 0.15s;
}
.button:hover {
  background: var(--green-dark);
  border-color: var(--green-dark);
}
.button.small {
  padding: 9px 16px;
  font-size: 16px;
}
.button.secondary {
  background: transparent;
  color: var(--green);
  margin: 32px 0 0;
}
.button.secondary:hover {
  background: #e6efe9;
}
.text-link,
.quiet a {
  color: var(--green);
  text-decoration: underline; /* a link is not told apart by colour alone (green on ink is 2.1:1) */
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

/* ── Hero: the logo and the promise on the left, a lesson to try on the right ── */
.hero {
  width: var(--content);
  margin: auto;
  padding: 32px 0 96px;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 64px;
  align-items: center;
}
h1 {
  font-size: clamp(46px, 5.6vw, 78px);
  letter-spacing: -1px;
  line-height: 1.04;
}
.hero-description {
  font-size: 21px;
  max-width: 540px;
  color: var(--muted);
  line-height: 1.6;
  margin: 26px 0 32px;
}
.hero h1 em,
.steps h3 {
  color: var(--green);
}
.actions {
  display: flex;
  gap: 26px;
  align-items: center;
  flex-wrap: wrap;
}
.hero .quiet {
  margin: 20px 0 0;
}

/* ── The example lesson ─────────────────────────────── */
.lesson-preview {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 30px 32px 32px;
}
.preview-top {
  font-size: 16px;
  color: var(--muted);
  margin: 0 0 10px;
}
.lesson-preview h2 {
  font-size: 40px;
  line-height: 1.1;
  letter-spacing: -0.5px;
}
.conversation {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  line-height: 1.55;
  margin-top: 22px;
}
.conversation p {
  margin: 0;
}
.tutor-dot {
  flex-shrink: 0;
  display: inline-flex;
  width: 26px;
  height: 26px;
  margin-top: 1px;
  align-items: center;
  justify-content: center;
  background: var(--green);
  color: #fff;
  border-radius: 50%;
  font-size: 13px;
}
.sample-answer {
  width: fit-content;
  max-width: calc(100% - 40px); /* the visitor's reply sits right, as a chat bubble, not a field */
  margin: 18px 0 18px auto;
  padding: 10px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px 12px 2px 12px;
}
#demo-thread .sample-answer,
#demo-thread p {
  overflow-wrap: anywhere;
}
.demo-form {
  display: flex;
  gap: 8px;
  margin: 22px 0 0 40px;
}
.demo-form input {
  min-width: 0;
  padding: 10px 13px;
}
.demo-next {
  margin: 22px 0 0 40px;
}

/* ── The method ─────────────────────────────────────── */
.how-section,
.catalog-section {
  width: var(--content);
  margin: auto;
  padding: 84px 0;
  border-top: 1px solid var(--line);
}
.section-heading {
  max-width: 760px;
}
.section-heading h2,
.catalog-heading h2 {
  font-size: clamp(32px, 4vw, 42px);
  line-height: 1.18;
  letter-spacing: -0.5px;
  margin-bottom: 18px;
}
.section-heading > p:last-child,
.catalog-heading p {
  color: var(--muted);
  font-size: 19px;
  margin: 0;
}
.steps {
  margin-top: 52px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 44px;
}
.steps h3 {
  font-size: 25px;
}
.steps p {
  font-size: 17px;
  color: var(--muted);
  line-height: 1.6;
}
.disclosure {
  margin: 44px 0 0;
  color: var(--muted);
  font-size: 16px;
}

/* ── The topic library ──────────────────────────────── */
.catalog-heading {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  align-items: end;
}
.search-label {
  width: 340px;
  max-width: 100%;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.search-label span {
  display: block;
  margin-bottom: 7px;
}
input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--field);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  outline: none;
}
input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px #00693e26;
}
#catalog-status {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--muted);
  margin: 28px 0 14px;
}
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: 44px;
}
/* The library reads as an index: a title and its length on one line, the first lessons on demand. */
.catalog-card {
  border-top: 1px solid var(--line);
  padding: 14px 0 16px;
  align-self: start;
}
.catalog-card summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}
.catalog-card summary:hover h3,
.catalog-card[open] h3 {
  color: var(--green);
}
.catalog-card summary::-webkit-details-marker {
  display: none;
}
.catalog-card h3 {
  font-size: 21px;
  line-height: 1.25;
}
.catalog-card summary span {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 16px;
}
.catalog-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.catalog-before {
  font-size: 17px;
  line-height: 1.5;
  margin: 10px 0 0;
}
.catalog-card ol {
  font-size: 17px;
  line-height: 1.5;
  padding: 6px 0 0 20px;
  margin: 0 0 8px;
  color: var(--muted);
}
.catalog-card li {
  margin: 6px 0;
}
.catalog-card .text-link {
  font-size: 16px;
}
#show-more:not([hidden]) {
  display: flex;
}

/* ── Closing and footer ─────────────────────────────── */
.closing {
  width: var(--content);
  margin: auto;
  padding: 90px 0 100px;
  border-top: 1px solid var(--line);
}
/* Privacy and other plain-text pages: the page's left edge, a reading measure. */
.legal {
  width: var(--content);
  margin: auto;
  padding: 44px 0 90px;
}
.legal > * {
  max-width: 680px;
}
.legal h1 {
  font-size: clamp(36px, 5vw, 52px);
  margin-bottom: 18px;
}
.legal h2 {
  font-size: 26px;
  margin: 40px 0 10px;
}
.legal p,
.legal li {
  color: var(--muted);
  line-height: 1.6;
  font-size: 18px;
}
.legal p.quiet {
  font-size: 14px;
}
.legal ul {
  padding-left: 20px;
}
.legal li {
  margin-bottom: 10px;
}
.legal a {
  color: var(--green);
  text-decoration: underline;
}
.closing h2 {
  font-size: clamp(32px, 4vw, 44px);
  line-height: 1.2;
  margin: 0 0 32px;
}
.closing p {
  color: var(--muted);
  font-size: 17px;
  margin: 22px 0 0;
}
footer {
  width: var(--content);
  margin: auto;
  padding: 28px 0 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  font-size: 16px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}
footer .brand {
  font-size: 22px;
  color: var(--ink);
}
.footer-links {
  display: flex;
  gap: 24px;
}

/* ── Sign in ────────────────────────────────────────── */
.auth-layout {
  max-width: 1060px;
  margin: 48px auto 100px;
  padding: 0 35px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 80px;
}
.auth-layout aside h1 {
  font-size: 54px;
}
.auth-layout aside h1 em {
  color: var(--green);
}
.auth-layout aside > p:not(.eyebrow) {
  font-size: 19px;
  color: var(--muted);
  margin: 24px 0;
  line-height: 1.6;
}
.auth-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 34px;
}
.auth-card h2 {
  font-size: 32px;
}
#auth-title .brand-accent {
  color: var(--green);
}
.auth-card > p:not(.eyebrow):not(.quiet) {
  color: var(--muted);
  font-size: 17px;
}
.auth-card label {
  display: block;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  margin: 20px 0 7px;
}
.auth-card .button {
  width: 100%;
  margin-top: 16px;
}
.auth-card .quiet {
  margin-top: 8px;
  font-size: 12px;
}
.auth-links {
  margin-top: 22px;
  font-size: 17px;
  color: var(--green);
}
.auth-links p {
  margin: 14px 0;
}
.auth-links a {
  text-decoration: underline;
  text-underline-offset: 3px;
}
#auth-status {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--green);
  line-height: 1.6;
  overflow-wrap: anywhere;
}
/* #160: after an account is deleted. Rendered but empty until filled, so a screen reader
   hears it arrive; lined up with the hero's gutters. */
.notice:not(:empty) {
  width: var(--content);
  margin: 24px auto 0;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: 10px;
  color: var(--ink);
  font-size: 15px;
}
@media (max-width: 720px) {
  .notice:not(:empty) {
    width: var(--content);
  }
}
[hidden] {
  display: none !important;
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 44px;
  }
}
@media (max-width: 960px) {
  .steps {
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
  }
  .catalog-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .auth-layout {
    gap: 40px;
  }
}
@media (max-width: 720px) {
  :root {
    --gutter: 22px;
  }
  .site-header {
    padding: 20px 0;
    gap: 14px;
  }
  .brand {
    font-size: 25px;
  }
  .brand .brand-mark {
    width: 34px;
    height: 34px;
    margin-right: 10px;
  }
  .site-header nav {
    gap: 16px;
    font-size: 16px;
  }
  .site-header nav a[href='#how-it-works'],
  .site-header nav a[href='#topics'] {
    display: none;
  }
  .hero {
    padding: 18px 0 60px;
  }
  .hero-description {
    font-size: 19px;
  }
  .actions {
    gap: 16px;
  }
  .lesson-preview {
    padding: 22px 20px 24px;
  }
  .lesson-preview h2 {
    font-size: 32px;
  }
  .how-section,
  .catalog-section {
    padding: 56px 0;
  }
  .steps {
    grid-template-columns: 1fr;
    gap: 26px;
    margin-top: 34px;
  }
  .catalog-heading {
    display: block;
  }
  .search-label {
    display: block;
    width: 100%;
    margin-top: 24px;
  }
  .catalog-grid {
    grid-template-columns: 1fr;
  }
  .catalog-card h3 {
    font-size: 20px;
  }
  .closing {
    padding: 64px 0 72px;
  }
  footer {
    padding: 24px 0 32px;
    flex-wrap: wrap;
  }
  footer > span:not(.footer-links) {
    display: none;
  }
  .auth-layout {
    grid-template-columns: 1fr;
    margin: 12px auto 60px;
    padding: 0 20px;
    gap: 22px;
  }
  .auth-layout aside h1 {
    font-size: clamp(34px, 9.5vw, 42px);
  }
  .auth-layout aside > p:not(.eyebrow) {
    display: none;
  }
  .auth-card {
    padding: 24px;
  }
  .auth-page .site-header .text-link {
    font-size: 16px;
    max-width: 160px;
  }
  .auth-explore-detail {
    display: none;
  }
}
@media (max-width: 420px) {
  .site-header {
    gap: 10px;
  }
  .site-header nav {
    gap: 12px;
  }
  .site-header nav .button {
    padding: 8px 12px;
  }
  .site-header nav .button span {
    display: none; /* the decorative arrow */
  }
  .site-header .brand {
    font-size: 23px;
  }
}
/* 320px (small phones, or 400% zoom): the header still fits on one line. */
@media (max-width: 380px) {
  :root {
    --gutter: 16px;
  }
  .site-header {
    padding: 18px 0;
    gap: 8px;
  }
  .site-header .brand {
    font-size: 20px;
  }
  .brand .brand-mark {
    width: 28px;
    height: 28px;
    margin-right: 6px;
  }
  .catalog-grid {
    grid-template-columns: 1fr; /* long titles don't fit two columns at 320px */
  }
  .site-header nav {
    gap: 8px;
    font-size: 15px;
  }
  .site-header nav .button {
    padding: 7px 9px;
    font-size: 14px;
    gap: 6px;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .button {
    transition: none;
  }
}
