/* ============================================================
   Solon — platform styles (catalog, terms, privacy, 404)
   Same "paper, ink & copper" tokens as the course design system.
   ============================================================ */

:root {
  --paper:    #faf6ee;
  --paper-2:  #f1eadb;
  --card:     #fffdf7;
  --ink:      #1d2a3a;
  --ink-2:    #46546b;
  --ink-3:    #8b93a3;
  --line:     #ddd3c0;
  --line-2:   #e9e2d3;
  --accent:   #b45f2a;
  --accent-2: #8a4720;
  --accent-soft: #f3e2d3;
  --gold:     #c39a3f;
  --ok:       #3e7d54;
  --shadow:   0 1px 2px rgba(29,42,58,.06), 0 8px 24px rgba(29,42,58,.07);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: "Avenir Next", "Avenir", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #161c27; --paper-2: #11161f; --card: #1d2532;
    --ink: #e9e3d3; --ink-2: #b9b3a2; --ink-3: #7d8492;
    --line: #333e50; --line-2: #29323f;
    --accent: #d98d52; --accent-2: #e8a76f; --accent-soft: #38302a;
    --gold: #d3ac5c; --ok: #7cb98f;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
  }
}
:root[data-theme="light"] {
  --paper: #faf6ee; --paper-2: #f1eadb; --card: #fffdf7;
  --ink: #1d2a3a; --ink-2: #46546b; --ink-3: #8b93a3;
  --line: #ddd3c0; --line-2: #e9e2d3;
  --accent: #b45f2a; --accent-2: #8a4720; --accent-soft: #f3e2d3;
  --gold: #c39a3f; --ok: #3e7d54;
  --shadow: 0 1px 2px rgba(29,42,58,.06), 0 8px 24px rgba(29,42,58,.07);
}
:root[data-theme="dark"] {
  --paper: #161c27; --paper-2: #11161f; --card: #1d2532;
  --ink: #e9e3d3; --ink-2: #b9b3a2; --ink-3: #7d8492;
  --line: #333e50; --line-2: #29323f;
  --accent: #d98d52; --accent-2: #e8a76f; --accent-soft: #38302a;
  --gold: #d3ac5c; --ok: #7cb98f;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--serif); font-size: 17px; line-height: 1.68;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 28px 80px; }
.narrow { max-width: 760px; }

a { color: var(--accent-2); text-underline-offset: 2px; }
a:hover { color: var(--accent); }
h1 { font-size: 2.6rem; line-height: 1.12; font-weight: 600; letter-spacing: -.01em; margin: .2em 0 .4em; }
h2 { font-size: 1.5rem; font-weight: 600; margin: 2.4em 0 .8em; }
h3 { font-size: 1.1rem; font-weight: 600; margin: 1.6em 0 .5em; }
p { margin: 0 0 1.05em; }
.kicker {
  font-family: var(--sans); font-size: 12px; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase; color: var(--accent); margin: 0 0 10px;
}
.lede { font-size: 1.18rem; line-height: 1.6; color: var(--ink-2); }
.sec-n { color: var(--accent); font-family: var(--mono); font-size: .8em; margin-right: .55em; font-weight: 500; }

/* ---------- header ---------- */
.site-head {
  display: flex; align-items: center; gap: 14px;
  padding: 26px 0 18px; margin-bottom: 10px;
}
.logo { display: flex; align-items: center; gap: 13px; text-decoration: none; color: var(--ink); }
.logo .wordmark {
  font-family: var(--serif); font-size: 26px; font-weight: 700; letter-spacing: .22em;
  text-transform: uppercase;
}
.logo .tag { font-family: var(--sans); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); display: block; margin-top: 1px; }
.head-links { margin-left: auto; font-family: var(--sans); font-size: 14px; font-weight: 600; display: flex; gap: 20px; }
.head-links a { text-decoration: none; color: var(--ink-2); }
.head-links a:hover { color: var(--accent); }

/* ---------- header auth ---------- */
.auth-wrap { position: relative; margin-left: 18px; }
button.auth-toggle {
  font-family: var(--sans); font-size: 13px; font-weight: 700; cursor: pointer;
  padding: 7px 16px; border-radius: 100px;
  border: 1.5px solid var(--accent); background: none; color: var(--accent-2);
  max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
button.auth-toggle:hover { background: var(--accent-soft); }
button.auth-toggle.signed { border-color: var(--line); color: var(--ink-2); }
.auth-panel {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 40;
  width: 260px; padding: 14px 16px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); display: grid; gap: 8px;
}
.auth-panel input {
  width: 100%; font-family: var(--sans); font-size: 13px; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 10px;
}
.auth-panel input:focus { outline: none; border-color: var(--accent); }
.auth-row { display: flex; gap: 6px; }
.btn-sm {
  font-family: var(--sans); font-size: 12px; font-weight: 700; cursor: pointer;
  flex: 1; padding: 7px 10px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--paper); color: var(--ink-2);
}
.btn-sm:hover { border-color: var(--accent); color: var(--accent-2); }
.auth-line { margin: 0; font-family: var(--sans); font-size: 11.5px; line-height: 1.5; color: var(--ink-3); overflow-wrap: break-word; }
.auth-line b { color: var(--ink-2); }
.prog-ok { color: var(--ok); font-weight: 700; }
@media (max-width: 640px) {
  .site-head { flex-wrap: wrap; }
  .auth-wrap { margin-left: auto; }
}

/* ---------- hero ---------- */
.hero { text-align: center; padding: 40px 0 26px; }
.hero h1 { font-size: 3rem; }
@media (max-width: 640px) { .hero h1 { font-size: 2.1rem; } }
.hero .lede { max-width: 640px; margin: 0 auto 24px; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin: 20px 0 12px; }
.btn {
  display: inline-block; font-family: var(--sans); font-weight: 700; font-size: 14.5px;
  background: var(--accent); color: #fdf9f2; border: none; cursor: pointer;
  padding: 11px 24px; border-radius: 100px; text-decoration: none; box-shadow: var(--shadow);
}
.btn:hover { background: var(--accent-2); color: #fdf9f2; }
.btn.secondary { background: var(--card); color: var(--ink); border: 1.5px solid var(--line); }
.btn.secondary:hover { border-color: var(--accent); color: var(--accent-2); background: var(--card); }
.chips { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.chip {
  font-family: var(--sans); font-size: 11.5px; font-weight: 600; letter-spacing: .04em;
  color: var(--ink-2); background: var(--paper-2); border: 1px solid var(--line-2);
  border-radius: 100px; padding: 3px 11px;
}

/* ---------- catalog ---------- */
.cat-title {
  font-family: var(--sans); font-size: 12.5px; font-weight: 700; letter-spacing: .16em;
  text-transform: uppercase; color: var(--ink-3);
  margin: 44px 0 14px; display: flex; align-items: center; gap: 14px;
}
.cat-title::after { content: ""; flex: 1; border-top: 1px solid var(--line-2); }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 900px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid { grid-template-columns: 1fr; } }
a.course-card {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--card); border: 1px solid var(--line-2); border-radius: 16px;
  padding: 20px 22px 16px; text-decoration: none; color: var(--ink);
  box-shadow: var(--shadow); position: relative;
}
a.course-card:hover { border-color: var(--accent); }
.course-card h3 { margin: 2px 0 0; font-size: 1.14rem; line-height: 1.3; }
.course-card p { font-family: var(--sans); font-size: 14px; line-height: 1.55; color: var(--ink-2); margin: 0; }
.course-card .meta { font-family: var(--sans); font-size: 12px; color: var(--ink-3); margin-top: auto; padding-top: 8px; }
.badge {
  align-self: flex-start; font-family: var(--sans); font-size: 10.5px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; border-radius: 100px; padding: 3px 10px;
}
.badge.live { color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); }
.badge.soon { color: var(--ink-3); background: var(--paper-2); border: 1px solid var(--line-2); }
.course-card.soon { opacity: .85; }
.course-card .emb { position: absolute; top: 16px; right: 16px; opacity: .9; }

/* ---------- boxes (terms/privacy/placeholders) ---------- */
.box {
  margin: 1.5em 0; padding: 16px 20px 13px;
  background: var(--card); border: 1px solid var(--line-2);
  border-left: 3px solid var(--accent); border-radius: 0 12px 12px 0; box-shadow: var(--shadow);
}
.box-tag {
  font-family: var(--sans); font-size: 10.5px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin: 0 0 .5em;
}
ul.checklist { list-style: none; padding-left: .2em; }
ul.checklist li { padding-left: 1.6em; position: relative; margin-bottom: .55em; }
ul.checklist li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--ok); font-weight: 700; font-family: var(--sans); }

/* ---------- footer ---------- */
.site-foot {
  margin-top: 70px; padding-top: 20px; border-top: 1px solid var(--line-2);
  font-family: var(--sans); font-size: 13px; color: var(--ink-3); line-height: 1.6;
}
.site-foot a { color: var(--ink-3); }
.site-foot a:hover { color: var(--accent); }

/* ---------- header library menu (built by tools/build_catalogue.py) ----------
   A <details> element, so the menu opens and closes without JavaScript;
   shared/site.js only closes it on an outside click or Escape. The panel hangs
   from the right edge of the nav, which sits at the right of the header. */
.head-links { position: relative; align-items: center; }
details.nav-lib > summary {
  list-style: none; cursor: pointer; color: var(--ink-2);
  display: inline-flex; align-items: center; gap: 7px; user-select: none;
}
details.nav-lib > summary::-webkit-details-marker { display: none; }
details.nav-lib > summary::after {
  content: ""; width: 6px; height: 6px; margin-top: -3px;
  border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor;
  transform: rotate(45deg); transition: transform .15s ease, margin .15s ease;
}
details.nav-lib[open] > summary::after { transform: rotate(-135deg); margin-top: 3px; }
details.nav-lib > summary:hover, details.nav-lib[open] > summary { color: var(--accent); }
.nav-panel {
  position: absolute; right: 0; top: calc(100% + 14px); z-index: 50;
  width: min(620px, calc(100vw - 32px));
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 4px 20px;
  padding: 16px 16px 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow-lift, var(--shadow));
}
.nav-col { display: grid; align-content: start; gap: 1px; }
.head-links a.nav-cat {
  font-size: 10.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent-2); padding: 4px 10px 6px;
}
.head-links a.nav-cat:hover { color: var(--accent); }
.head-links a.nav-ed {
  display: grid; gap: 1px; padding: 7px 10px; border-radius: 10px;
  color: var(--ink); font-size: 14px; line-height: 1.3;
}
.head-links a.nav-ed small { font-size: 12px; font-weight: 500; color: var(--ink-3); }
.head-links a.nav-ed:hover { background: var(--paper-2); color: var(--accent-2); }
.nav-foot {
  grid-column: 1 / -1; margin: 8px 0 0; padding: 10px 10px 0;
  border-top: 1px solid var(--line-2); display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px;
}
@media (max-width: 640px) {
  /* phone: the logo takes the first line; menu and Sign in share the second */
  .site-head .head-links { order: 3; flex: 1; margin-left: 0; gap: 22px; }
  .site-head .auth-wrap { order: 4; }
  .nav-panel { left: 0; right: auto; width: calc(100vw - 56px); grid-template-columns: 1fr; }
}

/* ---------- home catalogue & practice-area pages ---------- */
.lib-intro { max-width: 64em; margin: -2px 0 16px; color: var(--ink-2); }
.lib-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.lib-filter button {
  font-family: var(--sans); font-size: 13px; font-weight: 700; cursor: pointer;
  padding: 7px 14px; border-radius: 100px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink-2);
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.lib-filter button span { font-weight: 600; color: var(--ink-3); margin-left: 3px; }
.lib-filter button:hover { border-color: var(--accent); color: var(--accent-2); }
.lib-filter button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-2); }
.lib-filter[hidden], .course-card[hidden] { display: none !important; }
.card-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card-cat {
  font-family: var(--sans); font-size: 10.5px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-3);
}
.lib-areas { font-family: var(--sans); font-size: 14px; color: var(--ink-2); margin: 18px 0 0; }

.soon-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 8px 32px; }
.soon-group h3 {
  font-family: var(--sans); font-size: 12px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-2); margin: 6px 0 8px;
}
.soon-group ul { list-style: none; margin: 0; padding: 0; }
.soon-group li { font-family: var(--sans); font-size: 13.5px; line-height: 1.45; margin: 0 0 10px; }
.soon-group li a { font-weight: 600; text-decoration: none; color: var(--ink); }
.soon-group li a:hover { color: var(--accent); }
.soon-group li span { display: block; color: var(--ink-3); }
.soon-groups.one { grid-template-columns: 1fr; max-width: 680px; }

.crumbs { font-family: var(--sans); font-size: 13px; color: var(--ink-3); margin: 18px 0 0; }
.crumbs a { color: var(--ink-3); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.area-head { max-width: 760px; padding: 22px 0 4px; }
.area-head .lede { margin-bottom: 1em; }
ol.area-steps { max-width: 760px; margin: 0 0 26px; padding-left: 1.3em; }
ol.area-steps li { margin-bottom: .55em; }
ol.area-steps li::marker { color: var(--accent); font-family: var(--sans); font-weight: 700; }
ol.area-steps a { font-weight: 600; }
/* the header is sticky, so a jump to a catalogue anchor must stop below it */
#library, #forthcoming { scroll-margin-top: 96px; }

/* ---------- home: the pull quote and the three reasons ----------
   The long "Mind the gap" essay moved to about.html (sections 1–4). The home page
   keeps its first and last thought as a quote, so the library starts one scroll down. */
.gap-quote {
  max-width: 820px; margin: 10px auto 0; padding: 30px 36px 26px; text-align: center;
  background: var(--card); border: 1px solid var(--line-2); border-radius: 18px;
  box-shadow: var(--shadow); position: relative;
}
.gap-quote::before {
  content: ""; position: absolute; left: 50%; top: 0; width: 64px; height: 3px;
  transform: translateX(-50%); background: var(--accent); border-radius: 0 0 3px 3px;
}
.gap-quote .kicker { margin-bottom: 12px; }
.gap-quote blockquote { margin: 0; }
.gap-quote blockquote p {
  font-size: clamp(1.28rem, 1.1rem + .7vw, 1.6rem); line-height: 1.38; color: var(--ink);
  margin: 0 0 .5em; text-wrap: balance;
}
.gap-quote blockquote p.gap-answer {
  font-size: clamp(1.02rem, .98rem + .2vw, 1.12rem); line-height: 1.6; color: var(--ink-2); margin-bottom: .9em;
}
.gap-more { font-family: var(--sans); font-size: 14px; font-weight: 700; text-decoration: none; }
@media (max-width: 600px) { .gap-quote { padding: 26px 20px 22px; } }

.why-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 900px) { .why-grid { grid-template-columns: 1fr; } }
.why-card {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--card); border: 1px solid var(--line-2); border-radius: 16px;
  padding: 20px 22px 18px; box-shadow: var(--shadow);
}
.why-ic { color: var(--accent); line-height: 0; }
.why-card h3 { margin: 4px 0 0; font-size: 1.1rem; }
.why-card p { font-family: var(--sans); font-size: 14px; line-height: 1.55; color: var(--ink-2); margin: 0; }
.why-card a { font-family: var(--sans); font-size: 13.5px; font-weight: 700; text-decoration: none; margin-top: auto; padding-top: 6px; }
/* the home page links into about.html sections; stop them below the sticky header */
h2[id] { scroll-margin-top: 96px; }

/* ---------- glossary term pages (built by tools/build_terms.py) ---------- */
.term-head { max-width: 760px; padding: 18px 0 4px; }
.term-head .lede { color: var(--ink-2); }
.term-where { max-width: 760px; font-family: var(--sans); font-size: 14px; color: var(--ink-2); }
figure.term-quote {
  max-width: 760px; margin: 1.6em 0; padding: 16px 20px 14px;
  background: var(--card); border: 1px solid var(--accent); border-radius: 12px; box-shadow: var(--shadow);
}
figure.term-quote figcaption {
  font-family: var(--sans); font-size: 10.5px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--accent); margin-bottom: .6em;
}
figure.term-quote blockquote { margin: 0 0 .6em; font-size: 1.02rem; line-height: 1.6; }
figure.term-quote a { font-family: var(--sans); font-size: 13.5px; font-weight: 700; text-decoration: none; }
ul.term-related {
  list-style: none; padding: 0; margin: 0 0 1.6em; max-width: 760px;
  display: flex; flex-wrap: wrap; gap: 8px;
}
ul.term-related a {
  display: inline-block; font-family: var(--sans); font-size: 13.5px; font-weight: 600;
  text-decoration: none; color: var(--ink-2);
  border: 1px solid var(--line-2); background: var(--card); border-radius: 100px; padding: 5px 13px;
}
ul.term-related a:hover { border-color: var(--accent); color: var(--accent-2); }
