/* ════════════════════════════════════════════════════════════════════
   learn.channelstricks.com — component layer (Editorial Ink)
   Depends on: /assets/editorial-ink.css (tokens) + /assets/fonts/fonts.css,
   loaded first, and class="surface-learn" on <body> (sets --second = ochre).

   This file NEVER redefines a brand token or uses a raw hex — semantic
   tokens only. The brand token block is vendored byte-identical in
   editorial-ink.css; keep component styling here so `diff` on that file
   stays clean (home.'s zero-drift rule).

   Vermilion (--accent) is spent on exactly two things per page: the
   wordmark stop (inside the SVG) and the one primary CTA (Send a spark).
   Everything else that's interactive or highlighted uses ochre (--second).
   ════════════════════════════════════════════════════════════════════ */

/* ── base ─────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }
/* Paper lives on <html> so the fixed Inkstream canvas (z-index:-1) shows
   through the transparent <body>; opaque cards occlude it over text. With
   JS off, the canvas is absent and the paper ground still renders. */
html { -webkit-text-size-adjust: 100%; background: var(--paper); }
body {
  margin: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;      /* learn's dial: airier long-form */
  line-height: 1.7;
}

/* content pages use <main>; the index uses <div class="wrap"> */
main { max-width: 42rem; margin: 0 auto; padding: 1rem 1.15rem 4rem; }
.wrap { max-width: 44rem; margin: 0 auto; padding: 1.5rem 1.15rem 4rem; }

a { color: var(--second); text-underline-offset: 3px; }
a:focus-visible,
button:focus-visible,
summary:focus-visible,
.wordmark:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

h1, h2 { font-family: var(--font-display); font-weight: 400; line-height: 1.2; color: var(--ink); }
h2 { font-size: var(--text-title); margin: 1.8rem 0 0.6rem; }
p { margin: 0.7rem 0; }
strong { font-weight: 600; }

/* mono micro-label, used for kickers/dates/section labels/meta */
.label,
.masthead .date,
.recap .label,
.whyfor .label,
.tldr .label,
ul.links li .kind,
.hood dt {
  font-family: var(--font-mono);
  font-size: var(--text-label);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--muted);
}

/* ── masthead ─────────────────────────────────────────────────────── */
header.masthead {
  padding: 0.4rem 0 1rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.4rem;
}
.wordmark { display: inline-block; line-height: 0; }
.wordmark img { width: auto; display: block; }
main .masthead .wordmark img { height: clamp(1.35rem, 4.5vw, 1.75rem); }   /* logo size */
.wrap .masthead .wordmark img { height: clamp(2.2rem, 7vw, 3rem); }        /* index hero */

.masthead h1 { font-size: var(--text-masthead); margin: 0.8rem 0 0.4rem; }
.masthead .date {
  margin: 0.2rem 0 0;
  text-transform: none;           /* the date line carries a prose clause */
  letter-spacing: 0;
  font-size: 0.85rem;
}

/* the index masthead treats the wordmark as the one serif gesture, so its
   descriptive <h1> is a quiet tagline, not a second hero */
.wrap .masthead h1 {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  color: var(--muted);
  margin: 0.7rem 0 0.15rem;
}
.wrap .masthead .tagline { color: var(--muted); margin: 0; }
.count { color: var(--muted); font-family: var(--font-mono); font-size: 0.85rem;
  letter-spacing: var(--tracking-label); text-transform: uppercase; margin: 1.2rem 0 0.8rem; }

/* sample/prototype marker (template only) */
.proto-badge {
  display: inline-block; margin-top: 0.7rem;
  background: var(--wash); color: var(--muted);
  border: 1px dashed var(--line); border-radius: 999px;
  padding: 0.15rem 0.75rem;
  font-family: var(--font-mono); font-size: 0.72rem;
  letter-spacing: var(--tracking-label); text-transform: uppercase;
}

/* ── TL;DR ────────────────────────────────────────────────────────── */
.tldr {
  background: var(--wash);
  border-left: 4px solid var(--second);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1rem 1.2rem;
  margin: 1.4rem 0 1.4rem;
}
.tldr .label { display: block; margin-bottom: 0.35rem; color: var(--second); }

/* ── why you'd want this ──────────────────────────────────────────── */
.whyfor {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem 1.2rem 1rem;
  margin: 0 0 1.6rem;
}
.whyfor .label { display: block; margin: 0 0 0.3rem; }
.whyfor ul { margin: 0.3rem 0 0; padding-left: 1.2rem; }
.whyfor li { margin: 0.4rem 0; }

/* ── recap ribbon ─────────────────────────────────────────────────── */
.recap {
  background: var(--wash);
  border-radius: var(--radius);
  padding: 0.9rem 1.2rem;
  margin: 0 0 1.6rem;
}
.recap .label { display: block; margin: 0 0 0.3rem; color: var(--second); }
.recap p { margin: 0.3rem 0; color: var(--muted); }

/* ── topic sections (the move / under the hood / make it yours / etc.) ─ */
section.topic {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.3rem 1.3rem;
  margin: 1.3rem 0;
}
section.topic h2 { margin-top: 0.2rem; }
ol.steps { padding-left: 1.3rem; margin: 0.6rem 0; }
ol.steps li { margin: 0.55rem 0; }

/* ── collapsibles ─────────────────────────────────────────────────── */
details {
  border: 1px solid var(--line);
  border-radius: 12px;
  margin: 0.9rem 0 0;
  background: var(--wash);
}
details summary {
  cursor: pointer;
  padding: 0.85rem 1rem;
  min-height: var(--tap-min);
  font-weight: 600;
  color: var(--second);
  list-style-position: inside;
}
details[open] summary { border-bottom: 1px solid var(--line); }
details .inner { padding: 0.6rem 1.1rem 1rem; }

/* ── try-it-now prompt block ──────────────────────────────────────── */
.prompt-block {
  border: 1.5px dashed var(--second);
  border-radius: var(--radius);
  background: var(--wash);
  padding: 1rem 1.1rem 1.1rem;
  margin: 1.1rem 0 0;
}
.prompt-block .head {
  display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap;
  margin-bottom: 0.6rem;
}
.prompt-block .head .title { font-weight: 600; }
.prompt-block pre {
  white-space: pre-wrap; word-break: break-word;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.8rem 0.9rem;
  margin: 0 0 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
}

/* ── buttons ──────────────────────────────────────────────────────── */
/* copy-prompt is a secondary action → ink pill */
.copy-btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  min-height: var(--tap-min);
  background: var(--ink); color: var(--paper);
  border: none; border-radius: 999px;
  padding: 0.55rem 1.15rem;
  font-family: var(--font-body); font-size: 0.95rem; font-weight: 600;
  cursor: pointer;
}
.copy-btn.copied { background: var(--second); color: var(--paper); }
.copy-btn.secondary { background: transparent; color: var(--second); border: 2px solid var(--second); }

/* ── cost tags: plain-word mono pills, no color coding ────────────── */
.cost {
  display: inline-block;
  background: var(--wash); color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 0.1rem 0.6rem;
  font-family: var(--font-mono); font-size: 0.72rem;
  letter-spacing: var(--tracking-label);
}

/* ── watch & listen links ─────────────────────────────────────────── */
ul.links { padding-left: 0; list-style: none; margin: 0.6rem 0 0; }
ul.links li {
  margin: 0.5rem 0; padding: 0.7rem 0.9rem;
  background: var(--wash); border: 1px solid var(--line); border-radius: 10px;
}
ul.links li .kind { display: block; margin-bottom: 0.15rem; }

/* ── under the hood ───────────────────────────────────────────────── */
.hood dl { margin: 0.4rem 0 0; }
.hood dt { margin-top: 0.9rem; }
.hood dd { margin: 0.25rem 0 0; }
.hood code, code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  background: var(--wash);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.1rem 0.4rem;
  word-break: break-word;
}

/* ── spark box (the one primary CTA → vermilion) ──────────────────── */
.spark {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem 1.3rem 1.4rem;
  margin: 2.2rem 0 0;
}
.spark h2 { margin-top: 0; }
.spark textarea {
  width: 100%; min-height: 5.5rem;
  font-family: inherit; font-size: 1rem; line-height: 1.5;
  border: 1px solid var(--line); border-radius: 10px;
  padding: 0.8rem 0.9rem;
  background: var(--paper); color: var(--ink);
  resize: vertical;
}
.spark textarea:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-color: transparent; }
.spark .actions { display: flex; gap: 0.7rem; flex-wrap: wrap; margin-top: 0.8rem; }
.spark .send-btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  min-height: var(--tap-min);
  background: var(--accent); color: var(--on-accent);
  border: none; border-radius: 999px;
  padding: 0.6rem 1.3rem;
  font-family: var(--font-body); font-size: 0.98rem; font-weight: 700;
  cursor: pointer; text-decoration: none;
}
.spark .hint { font-size: 0.88rem; color: var(--muted); margin: 0.7rem 0 0; }

/* ── index entry list ─────────────────────────────────────────────── */
.entries { list-style: none; margin: 0; padding: 0; }
.entry {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  padding: 0.25rem;
}
.entry-link {
  display: block;
  padding: 1rem 1.15rem;
  min-height: var(--tap-min);
  text-decoration: none; color: inherit;
  border-radius: 14px;
}
.entry-link:hover { background: var(--wash); }
.entry-title {
  display: block;
  font-family: var(--font-display); font-weight: 400;
  font-size: 1.5rem; line-height: 1.25;
  color: var(--ink);
}
.entry-link:hover .entry-title { color: var(--second); }
.entry-date {
  display: block; margin-top: 0.3rem;
  font-family: var(--font-mono); font-size: 0.82rem;
  letter-spacing: var(--tracking-label); text-transform: uppercase;
  color: var(--muted);
}
.desc { color: var(--muted); margin: 0 1.15rem 0.9rem; }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0 1.15rem 1rem; padding: 0; }
.tags li {
  font-family: var(--font-mono); font-size: 0.72rem;
  letter-spacing: var(--tracking-label);
  color: var(--muted); border: 1px solid var(--line);
  border-radius: 999px; padding: 0.15rem 0.6rem;
}
.empty { color: var(--muted); }

/* ── footer ───────────────────────────────────────────────────────── */
footer {
  margin-top: 3rem; padding-top: 1.2rem;
  border-top: 1px solid var(--line);
  color: var(--muted); font-size: 0.85rem;
}
footer .familymark { display: inline-block; line-height: 0; margin-bottom: 0.5rem; }
footer .familymark img { height: 1.1rem; width: auto; display: block; }

/* ── motion: settlements only, fully stilled for reduced-motion ───── */
@media (prefers-reduced-motion: no-preference) {
  .entry-link, details summary, .copy-btn, .spark .send-btn, .entry-title {
    transition: background 120ms var(--ease-settle), color 120ms var(--ease-settle);
  }
}
