/* Open Facilitation Library — openfac.org landing
   Coheres with wiki.openfac.org: Schibsted Grotesk + Source Sans + IBM Plex Mono,
   warm neutrals, slate-blue structure, single sage-green accent. */

:root {
  --bg: oklch(0.98 0.002 70);
  --surface: oklch(0.964 0.004 70);
  --surface-slate: oklch(0.955 0.012 245);
  --ink: oklch(0.28 0.004 70);
  --muted: oklch(0.5 0.006 70);
  --hairline: oklch(0.9 0.004 70);
  --hairline-soft: oklch(0.93 0.003 70);
  --slate: oklch(0.42 0.05 245);
  --sage: oklch(0.74 0.04 165);
  --sage-ink: oklch(0.52 0.05 165);

  --measure: 60ch;

  --step-eyebrow: 0.78rem;
  --step-body: 1.0625rem;
  --step-lead: clamp(1.15rem, 1rem + 0.7vw, 1.4rem);
  --step-h3: clamp(1.2rem, 1.05rem + 0.6vw, 1.5rem);
  --step-h2: clamp(1.6rem, 1.2rem + 1.6vw, 2.4rem);
  --step-display: clamp(2.6rem, 1.6rem + 4.4vw, 5rem);

  --pad-x: clamp(1.25rem, 0.5rem + 4vw, 6rem);
  --gap-section: clamp(4.5rem, 3rem + 7vw, 9rem);

  --serif: "Source Sans 3", "Source Sans Pro", system-ui, sans-serif;
  --grotesk: "Schibsted Grotesk", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: var(--step-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--sage-ink); text-decoration: none; }
a:focus-visible { outline: 2px solid var(--slate); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3 { font-family: var(--grotesk); font-weight: 600; line-height: 1.08; letter-spacing: -0.018em; margin: 0; }

.eyebrow {
  font-family: var(--mono);
  font-size: var(--step-eyebrow);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--slate);
}

/* Shell ------------------------------------------------------------ */
.wrap { max-width: 78rem; margin-inline: auto; padding-inline: var(--pad-x); }

.topbar {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1.5rem; padding-block: 1.6rem; flex-wrap: wrap;
}
.wordmark {
  font-family: var(--grotesk); font-weight: 700; font-size: 1.05rem;
  letter-spacing: -0.01em; color: var(--ink);
}
.wordmark span { color: var(--sage-ink); }
.topnav { display: flex; gap: 1.6rem; font-size: 0.95rem; }
.topnav a { color: var(--muted); }
.topnav a:hover { color: var(--ink); }
.topnav a[aria-current="page"] { color: var(--ink); }

/* Hero ------------------------------------------------------------- */
.hero { padding-top: clamp(3rem, 1rem + 7vw, 7rem); padding-bottom: var(--gap-section); }
.hero h1 {
  font-size: var(--step-display);
  max-width: 16ch;
  margin-top: 1.4rem;
}
.hero .lead {
  font-size: var(--step-lead);
  color: var(--muted);
  max-width: 46ch;
  margin-top: 1.6rem;
}
.actions { display: flex; gap: 0.9rem 1.4rem; flex-wrap: wrap; align-items: center; margin-top: 2.4rem; }
.btn {
  font-family: var(--grotesk); font-weight: 600; font-size: 0.98rem;
  padding: 0.72rem 1.3rem; border-radius: 7px;
  background: var(--ink); color: var(--bg);
  border: 1px solid var(--ink); transition: background 160ms, transform 160ms;
}
.btn:hover { background: oklch(0.36 0.04 165); border-color: oklch(0.36 0.04 165); }
.link-arrow { font-family: var(--grotesk); font-weight: 600; font-size: 0.98rem; color: var(--ink); }
.link-arrow::after { content: " \2192"; color: var(--sage-ink); transition: margin-left 160ms; display: inline-block; }
.link-arrow:hover::after { margin-left: 0.2em; }

/* Generic section -------------------------------------------------- */
section { padding-block: 0; }
.block { padding-bottom: var(--gap-section); }
.block > .eyebrow { display: block; margin-bottom: 1rem; }
.block h2 { font-size: var(--step-h2); max-width: 22ch; }
#what { max-width: 32ch; }
.prose { max-width: var(--measure); color: var(--ink); margin-top: 1.4rem; font-size: var(--step-lead); line-height: 1.55; }
.prose.muted { color: var(--muted); }

/* Architecture: the method spec and its two halves ----------------- */
.halves {
  margin-top: 2.4rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}
.half { padding: clamp(1.5rem, 1rem + 1.2vw, 2.1rem) clamp(1.2rem, 2vw, 2.4rem) clamp(1.5rem, 1rem + 1.2vw, 2.1rem) 0; }
.half + .half { border-left: 1px solid var(--hairline); padding-left: clamp(1.4rem, 2.5vw, 2.6rem); }
.half h3 { font-size: var(--step-h3); display: flex; align-items: baseline; gap: 0.6rem; }
.half h3::before {
  content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%;
  background: var(--sage); transform: translateY(-0.1em);
}
.half p { margin: 0.7rem 0 0; color: var(--muted); }
.commons {
  margin-top: 1.8rem;
  font-family: var(--grotesk);
  font-weight: 500;
  font-size: var(--step-lead);
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--ink);
  max-width: 44ch;
}
.reference { margin-top: 1.8rem; font-size: var(--step-body); line-height: 1.6; }
.reference b { color: var(--ink); font-weight: 600; }
@media (max-width: 38rem) {
  .halves { grid-template-columns: 1fr; }
  .half { padding-right: 0; }
  .half + .half { border-left: 0; border-top: 1px solid var(--hairline); padding-left: 0; }
}

/* Harmonica band --------------------------------------------------- */
.band { background: var(--surface-slate); border-block: 1px solid var(--hairline); }
.band .inner { padding-block: var(--gap-section); }
.band h2 { font-size: var(--step-h2); max-width: 20ch; }
.band .prose { max-width: 64ch; }
.band .pill {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.04em;
  color: var(--slate); margin-top: 1.8rem;
}
.band .pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--sage); }
.band .pill a { color: var(--slate); text-decoration: underline; text-decoration-color: var(--sage); text-underline-offset: 3px; }
.band .pill a:hover { color: var(--ink); }

/* Get involved ----------------------------------------------------- */
.routes { margin-top: 2.4rem; display: grid; gap: 0; border-top: 1px solid var(--hairline); }
.route {
  display: grid; grid-template-columns: minmax(8rem, 12rem) minmax(0, 1fr);
  gap: 0.4rem clamp(1rem, 3vw, 3rem);
  padding-block: 1.5rem; border-bottom: 1px solid var(--hairline); align-items: baseline;
}
.route h3 { font-size: var(--step-h3); }
.route p { margin: 0; color: var(--muted); }
.route p a { font-weight: 600; }
.route .note { font-size: 0.85rem; color: var(--muted); font-style: italic; }
@media (max-width: 34rem) { .route { grid-template-columns: 1fr; gap: 0.3rem; } }

/* Footer ----------------------------------------------------------- */
footer { border-top: 1px solid var(--hairline); padding-block: 2.6rem 3.4rem; }
.foot {
  display: flex; justify-content: space-between; gap: 1.5rem 2rem; flex-wrap: wrap;
  align-items: baseline; font-size: 0.9rem; color: var(--muted);
}
.foot nav { display: flex; gap: 1.4rem; flex-wrap: wrap; }
.foot nav a { color: var(--muted); }
.foot nav a:hover { color: var(--ink); }
.foot .lic { font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.02em; }

/* Entrance motion -------------------------------------------------- */
.rise { opacity: 0; transform: translateY(14px); animation: rise 720ms cubic-bezier(0.22, 1, 0.36, 1) forwards; }
.rise:nth-child(2) { animation-delay: 70ms; }
.rise:nth-child(3) { animation-delay: 140ms; }
@keyframes rise { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .rise { opacity: 1; transform: none; animation: none; }
}

/* Calibrate tool --------------------------------------------------- */
.calib-intro { padding-block: clamp(2rem, 1rem + 3vw, 3.5rem) clamp(1.4rem, 1rem + 1.5vw, 2.4rem); }
.calib-intro h1 { font-size: clamp(2rem, 1.4rem + 2.4vw, 3rem); max-width: 14ch; margin-top: 0.7rem; }
.calib-intro .lead { max-width: 58ch; color: var(--muted); font-size: var(--step-lead); margin-top: 1.1rem; }
.rubric { margin-top: 1.5rem; max-width: 64ch; border: 1px solid var(--hairline); border-radius: 8px; background: var(--surface); }
.rubric summary { cursor: pointer; padding: 0.8rem 1rem; font-family: var(--grotesk); font-weight: 600; font-size: 0.95rem; color: var(--ink); }
.rubric p { margin: 0; padding: 0 1rem 1rem; color: var(--muted); }

.closes { list-style: none; margin: 0; padding: 0 0 7rem; display: grid; gap: clamp(1rem, 0.6rem + 1vw, 1.5rem); }
.jcard { border: 1px solid var(--hairline); border-radius: 12px; background: var(--bg); padding: clamp(1.1rem, 0.7rem + 1vw, 1.7rem); transition: border-color 180ms; }
.jcard.done { border-color: var(--sage); }
.jcard-head { display: flex; align-items: baseline; gap: 0.7rem; margin-bottom: 0.9rem; }
.jnum { font-family: var(--mono); font-size: 0.82rem; color: var(--sage-ink); }
.jtopic { font-family: var(--grotesk); font-weight: 600; font-size: 1.05rem; }
.jlang { font-family: var(--mono); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.ai-close { max-width: none; }
.ai-close p { margin: 0.5rem 0; }
.ai-close p:first-child { margin-top: 0; }
.t-head { font-family: var(--grotesk); font-weight: 600; margin-top: 1rem !important; }
.ai-close ul, .contrib ul { margin: 0.5rem 0; padding-left: 1.2rem; }
.ai-close li, .contrib li { margin: 0.3rem 0; }
.contrib-d { margin-top: 0.9rem; border-top: 1px solid var(--hairline-soft); padding-top: 0.8rem; }
.contrib-d summary { cursor: pointer; font-family: var(--mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); }
.contrib { margin-top: 0.7rem; color: var(--muted); }
.contrib p { margin: 0.4rem 0; }

.judge { display: flex; flex-wrap: wrap; align-items: center; gap: 0.55rem; margin-top: 1.2rem; }
.opt { font-family: var(--grotesk); font-weight: 600; font-size: 0.9rem; padding: 0.5rem 1.15rem; border: 1px solid var(--hairline); border-radius: 7px; background: var(--bg); color: var(--ink); cursor: pointer; transition: background 150ms, border-color 150ms, color 150ms; }
.opt:hover { border-color: var(--muted); }
.opt:focus-visible { outline: 2px solid var(--slate); outline-offset: 2px; }
.opt.on[data-r="Strong"] { background: var(--sage); border-color: var(--sage); color: oklch(0.25 0.03 165); }
.opt.on[data-r="Weak"] { background: var(--slate); border-color: var(--slate); color: var(--bg); }
.why { flex: 1; min-width: 12rem; font-family: var(--serif); font-size: 0.92rem; padding: 0.5rem 0.75rem; border: 1px solid var(--hairline); border-radius: 7px; background: var(--bg); color: var(--ink); }
.why:focus { outline: none; border-color: var(--slate); }
.why::placeholder { color: var(--muted); }

.submitbar { position: sticky; bottom: 0; background: var(--bg); border-top: 1px solid var(--hairline); }
.submitbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 0.85rem; }
.progress { font-size: 0.92rem; color: var(--muted); }
.progress strong { color: var(--ink); font-family: var(--grotesk); }
