/* Centre Channel — Editorial stylesheet (white ground)
 *
 * Long-form pages on the shop chrome: Thoughts (the library), articles in
 * /insights, the Diagnostic trigger pages, About, Privacy and 404.
 * Loaded after design/tokens.css and assets/shop.css. Consumes the same
 * tokens through the aliases shop.css declares on :root (--ink, --brass,
 * --stone, --charcoal, --mist, --display, --headline, --text-serif, --body).
 *
 * The web3 (dark) class names the pages were written against are mapped
 * here to white-ground equivalents so the markup stays as it was. Classes
 * that only carried a dark effect (bloom glows, reveal fades, centre line,
 * ambient video) are neutralised.
 */

/* ---------- Layout: one left rail, prose capped per element ---------- */
main { flex: 1 0 auto; }
main > section { position: relative; padding: clamp(2.5rem, 5vw, 4rem) 0; }
main > section.hero { padding: clamp(2.5rem, 5vw, 4rem) 0 clamp(2rem, 4vw, 3rem); }
.section-divide { border-top: 1px solid var(--stone); }
.wrap { padding: 0 var(--gutter); }
.wrap > * { max-width: 46rem; }
.wrap > .split { max-width: 72rem; }
.narrow > article { max-width: 46rem; }

/* Dark-only effects, switched off */
.reveal, .reveal.lit { background: transparent; transition: none; }
.bloom::before, .centre-line::after, .hero-media::after { content: none; display: none; }
.hero-media { display: none; }
.topbar { display: none; }
.hidden { display: none; }

/* ---------- Type ---------- */
.wrap h1 {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(2.25rem, 4vw, 3.5rem); line-height: 1.06; letter-spacing: -0.01em;
  color: var(--ink);
}
.wrap h2 { font-family: var(--headline); font-weight: 400; font-size: clamp(1.5rem, 2.6vw, 2rem); line-height: 1.15; color: var(--ink); }
.wrap h3 { font-family: var(--headline); font-weight: 400; font-size: 1.25rem; line-height: 1.25; color: var(--ink); }
.wrap p, .wrap li { font-size: 1.0625rem; line-height: 1.7; color: var(--charcoal); }
.wrap p + p { margin-top: 1.1em; }
.wrap h1 + p, .wrap h2 + p, .wrap h3 + p { margin-top: 1.25rem; }
.wrap h1 + .lede { margin-top: 1.5rem; }
.wrap strong { font-weight: 500; color: var(--ink); }
.wrap em { font-family: var(--text-serif); font-style: italic; font-size: 1.06em; color: var(--ink); }

.eyebrow { display: block; margin-bottom: 1rem; }
.eyebrow a { color: inherit; border-bottom: 1px solid currentColor; }
.eyebrow a:hover { color: var(--ink); }
.lede { font-size: 1.25rem; line-height: 1.5; color: var(--charcoal); }
.muted { color: var(--charcoal); }
.hero .muted, .art-date {
  font-size: var(--label); font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--charcoal); line-height: 1.5;
}
.statement {
  font-family: var(--headline); font-weight: 400; font-style: italic;
  font-size: clamp(1.375rem, 2.4vw, 1.75rem); line-height: 1.35; color: var(--ink);
}

/* Links in prose: underlined by a hairline, nothing else */
.wrap p a, .wrap li a, .wrap figcaption a, .quote a {
  color: var(--ink); border-bottom: 1px solid var(--brass);
}
.wrap p a:hover, .wrap li a:hover, .wrap figcaption a:hover { color: var(--brass-dark); border-bottom-color: var(--brass-dark); }

/* ---------- Buttons ---------- */
.btn, .btn.btn-primary, .btn.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem;
  min-height: 48px; padding: 0 1.75rem; border: 1px solid var(--ink);
  font-family: var(--body); font-size: var(--label); font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--ink); background: transparent; text-align: center; cursor: pointer;
}
.btn.btn-primary { background: var(--ink); color: var(--white); }
.btn.btn-primary:hover { background: var(--charcoal); border-color: var(--charcoal); color: var(--white); }
.btn.btn-ghost:hover { color: var(--brass-dark); border-color: var(--brass-dark); }
.btn[disabled] { opacity: 0.5; cursor: default; }
.cta-row { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 2rem; }

/* ---------- Lists, proof rows, quotes, cards ---------- */
.plain-list { list-style: none; margin-top: 1.25rem; }
.plain-list li { position: relative; padding: 0.5rem 0 0.5rem 1.5rem; }
.plain-list li::before {
  content: ""; position: absolute; left: 0; top: 1.25rem;
  width: 5px; height: 5px; border-radius: 50%; background: var(--brass);
}
.plain-list li a em { color: var(--ink); }

.proof-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem; align-items: baseline;
  padding: 0.9rem 0; border-top: 1px solid var(--stone);
}
.proof-row:last-child { border-bottom: 1px solid var(--stone); }
.wrap .proof-row p { margin: 0; font-size: 0.9375rem; }
.proof-row .result { font-family: var(--text-serif); font-size: 1.0625rem; color: var(--ink); white-space: nowrap; }
@media (max-width: 640px) { .proof-row { grid-template-columns: 1fr; gap: 0.25rem; } .proof-row .result { white-space: normal; } }

.quote { border-left: 1px solid var(--brass); padding: 0.25rem 0 0.25rem 1.25rem; margin-top: 2rem; }
.quote p { font-family: var(--headline); font-weight: 400; font-style: italic; font-size: 1.25rem; line-height: 1.45; color: var(--ink); }
.quote cite { display: block; margin-top: 0.75rem; font-style: normal; font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--charcoal); }

.grid { display: flex; flex-direction: column; margin-top: 2rem; border-top: 1px solid var(--stone); }
.card { padding: 1.75rem 0; border-bottom: 1px solid var(--stone); }
.card .tag {
  display: block; margin-bottom: 0.75rem;
  font-size: var(--label); font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; color: var(--brass-dark);
}
.card h3 { margin-bottom: 0.75rem; }
.tag { font-size: var(--label); font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; color: var(--brass-dark); }

.refs { margin-top: 1.5rem; }
.form-note { margin-top: 1.25rem; font-size: 0.8125rem; color: var(--charcoal); }

/* Photography */
.photo { margin: 0; overflow: hidden; background: var(--mist); }
.photo img { display: block; width: 100%; height: auto; object-fit: cover; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

/* ---------- Articles (/insights) ---------- */
.article-hero h1 { max-width: 46rem; }
.art-date { margin-top: 1.5rem; }
article h2 { font-size: clamp(1.375rem, 2.2vw, 1.75rem); margin: 2.5rem 0 1rem; }
article h3 { font-size: 1.1875rem; margin: 2rem 0 0.6rem; }
article h2 + p, article h3 + p { margin-top: 0; }
article .quote { margin: 2.25rem 0; }
article .plain-list { margin-bottom: 1.4rem; }
article ul:not(.plain-list), article ol { padding-left: 1.25rem; margin: 1rem 0 1.4rem; }
figure.diagram { margin: 2.5rem 0; padding: 1.75rem 1.5rem 1.25rem; border: 1px solid var(--stone); background: var(--mist); }
figure.diagram svg { width: 100%; height: auto; display: block; }
figure.diagram figcaption { margin-top: 1.25rem; font-size: 0.8125rem; line-height: 1.55; color: var(--charcoal); }
.diagram-label { font-family: var(--body); font-size: 10.5px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; fill: var(--charcoal); }

/* Signal glyph vocabulary inside diagrams (hairline, node) */
.g-line { fill: none; stroke: var(--brass-dark); stroke-width: 2; stroke-linecap: round; }
.g-dotted { stroke-dasharray: 1 8; }
.g-faint { opacity: 0.35; }
.g-node { fill: var(--brass); }
.g-dim { opacity: 0.55; }
.g-hollow { fill: none; stroke: var(--brass-dark); stroke-width: 1.5; }

/* ---------- Thoughts: the library ---------- */
.library-bar { margin-top: 2rem; }
#lib-search {
  width: 100%; min-height: 44px; background: transparent; border: 0; border-radius: 0;
  border-bottom: 1px solid var(--stone);
  color: var(--ink); font-family: var(--text-serif); font-style: italic;
  font-size: clamp(1.125rem, 1.8vw, 1.375rem); line-height: 1.3; padding: 0.5rem 0.2rem 0.75rem 2.1rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b8976a' stroke-width='1'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-4.35-4.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: left 0.1rem center; background-size: 1.25rem;
  -webkit-appearance: none; appearance: none;
}
#lib-search:focus { outline: none; border-bottom-color: var(--brass-dark); }
#lib-search::placeholder { color: var(--charcoal); opacity: 0.6; font-style: italic; }
#lib-search::-webkit-search-cancel-button { -webkit-appearance: none; }
.lib-meta-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: 1rem; }
.lib-count { font-size: var(--label); font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; color: var(--charcoal); white-space: nowrap; }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  min-height: 44px; padding: 0 14px; border: 1px solid var(--stone); border-radius: 0; background: transparent;
  font-family: var(--body); font-size: 0.625rem; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink);
  cursor: pointer;
}
.chip:hover { border-color: var(--ink); }
.chip.active { background: var(--ink); color: var(--white); border-color: var(--ink); }

.article-list { margin-top: 1.5rem; border-top: 1px solid var(--stone); }
.article-row {
  display: grid; grid-template-columns: 3rem minmax(0, 1fr); gap: 1rem; align-items: baseline;
  padding: 1.25rem 0; border-bottom: 1px solid var(--stone); color: var(--ink);
}
.article-row:hover { color: var(--ink); }
.art-index { font-family: var(--text-serif); font-size: 1.0625rem; line-height: 1.2; color: var(--brass); }
.article-row h3 { font-family: var(--headline); font-size: 1.375rem; line-height: 1.25; color: var(--ink); }
.article-row:hover h3, .article-row.picked h3 { color: var(--brass-dark); }
.article-row p { margin-top: 0.4rem; font-size: 0.9375rem; line-height: 1.55; color: var(--charcoal); max-width: 56ch; }
.art-meta { display: block; margin-top: 0.6rem; font-size: 0.625rem; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--charcoal); }
@media (max-width: 640px) { .article-row { grid-template-columns: 2.25rem minmax(0, 1fr); gap: 0.75rem; } .article-row h3 { font-size: 1.1875rem; } }
.catalogue-rows .article-row { grid-template-columns: 4.25rem minmax(0, 1fr); }
.catalogue-rows .art-index { white-space: nowrap; }
@media (max-width: 640px) { .catalogue-rows .article-row { grid-template-columns: 3.5rem minmax(0, 1fr); } }

.librarian { margin-top: 2rem; border-left: 1px solid var(--brass); padding: 0.25rem 0 0.25rem 1.25rem; }
.librarian-reply { font-family: var(--headline); font-style: italic; font-size: 1.25rem; line-height: 1.45; color: var(--ink); max-width: 48ch; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .btn, .chip, .article-row, .article-row h3, #lib-search { transition: none; }
}

/* ---------- The Clarity Index (/clarity) ---------- */
/* Focus mode: once the Index starts, the shop chrome steps back and the index bar takes over. */
.index-bar { display: none; }
body.index-live .announce, body.index-live .shop-header, body.index-live .shop-footer { display: none; }
body.index-live .index-bar {
  display: flex; justify-content: space-between; align-items: center;
  min-height: 60px; padding: 0 var(--gutter); border-bottom: 1px solid var(--stone);
}
.index-bar a { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; }
.index-bar-label { font-size: var(--label); font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase; color: var(--brass-dark); }

main > section.index-stage { min-height: calc(100dvh - 60px); display: flex; align-items: center; padding: 2rem 0; overflow: hidden; }
.index-stage .wrap { width: 100%; }
.index-stage.hidden, #index-landing.hidden, #shared-landing.hidden { display: none; }

.index-progress { display: flex; gap: 6px; margin: 2rem 0 1rem; }
.index-progress span { flex: 1; height: 2px; background: var(--stone); }
.index-progress span.done { background: var(--brass); }
.q-channel { font-size: var(--label); font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase; color: var(--brass-dark); }
.wrap .q-title { font-family: var(--headline); font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 400; margin: 0.8rem 0 2rem; line-height: 1.25; }
.q-options { display: grid; gap: 0.75rem; }
.q-option {
  text-align: left; width: 100%; min-height: 48px; background: var(--white); border: 1px solid var(--stone);
  color: var(--ink); font-family: var(--body); font-weight: 400; font-size: 1rem; line-height: 1.5;
  padding: 0.9rem 1.2rem; cursor: pointer;
}
.q-option:hover, .q-option.selected { border-color: var(--ink); }

.index-result .score { font-family: var(--display); font-size: clamp(4rem, 10vw, 6.5rem); font-weight: 400; line-height: 1; color: var(--ink); }
.score-max { font-family: var(--headline); font-size: 0.32em; color: var(--charcoal); margin-left: 0.35em; }
.index-result .persona { font-family: var(--headline); font-size: clamp(1.7rem, 4vw, 2.5rem); font-style: italic; color: var(--brass-dark); margin-top: 0.4rem; }
.index-result .band { font-size: var(--label); letter-spacing: 0.18em; text-transform: uppercase; color: var(--brass-dark); font-weight: 500; margin-top: 1.2rem; }
.result-head { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; max-width: 560px; }
.glyph-slot { flex: none; width: 108px; height: 108px; }
.glyph-slot svg { width: 100%; height: 100%; }
.glyph-slot .g-line { stroke: var(--brass-dark); stroke-width: 2.5; }
.glyph-slot .g-hollow { stroke-width: 2; }
@media (max-width: 640px) { .glyph-slot { width: 82px; height: 82px; } }

/* A score is a position: denominator, band scale, marker */
.scale { position: relative; max-width: 560px; margin-top: 2.2rem; height: 14px; }
.scale-track {
  position: absolute; inset: 5px 0;
  background: linear-gradient(90deg,
    rgba(184, 151, 106, 0.18) 0%, rgba(184, 151, 106, 0.18) 35%,
    rgba(184, 151, 106, 0.38) 35%, rgba(184, 151, 106, 0.38) 60%,
    rgba(184, 151, 106, 0.62) 60%, rgba(184, 151, 106, 0.62) 80%,
    rgba(184, 151, 106, 1) 80%, rgba(184, 151, 106, 1) 100%);
}
.scale-node {
  position: absolute; top: 50%; left: 0; transform: translate(-50%, -50%);
  width: 15px; height: 15px; border-radius: 50%; background: var(--brass);
  box-shadow: 0 0 0 3px var(--white);
}
.scale-labels { display: flex; max-width: 560px; margin-top: 0.7rem; }
.scale-labels span { font-size: 0.625rem; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 500; color: var(--charcoal); opacity: 0.55; }
.scale-labels span:nth-child(1) { width: 35%; }
.scale-labels span:nth-child(2) { width: 25%; }
.scale-labels span:nth-child(3) { width: 20%; }
.scale-labels span:nth-child(4) { width: 20%; text-align: right; }
.scale-labels span.active { color: var(--brass-dark); opacity: 1; }

.channel-bars { margin: 2.5rem 0; display: grid; gap: 1rem; max-width: 460px; }
.channel-bars .row { display: grid; grid-template-columns: 110px 1fr 62px; align-items: center; gap: 1rem; padding: 0; border: 0; font-size: 0.8125rem; color: var(--charcoal); }
.channel-bars .track { height: 3px; background: var(--mist); overflow: hidden; }
.channel-bars .fill { height: 100%; width: 0; background: var(--brass); }
@media (max-width: 420px) { .channel-bars .row { grid-template-columns: 90px 1fr 56px; gap: 0.75rem; } }

.note-form { margin-top: 2.5rem; max-width: 480px; }
.note-form input[type="email"], .note-form .note-field {
  width: 100%; min-height: 48px; background: var(--white); border: 1px solid var(--ink); border-radius: 0;
  color: var(--ink); font-family: var(--body); font-size: 0.9375rem; padding: 0 14px; margin-bottom: 0.75rem;
  -webkit-appearance: none; appearance: none;
}
.note-form input::placeholder { color: var(--charcoal); opacity: 0.7; }
.note-form input[type="email"]:focus, .note-form .note-field:focus { outline: none; border-color: var(--brass-dark); }
.note-form .btn { width: 100%; }
.share-block { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--stone); max-width: 480px; }
.share-btn { display: inline-flex; align-items: center; gap: 0.6rem; }
.share-ico { width: 17px; height: 17px; color: var(--brass); flex: none; }

/* Motion: the Mark draws itself (reveal, never rotation); the result arrives in layers. */
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes markDraw { to { stroke-dashoffset: 0; } }
@keyframes markNode { to { opacity: 1; } }
@keyframes markNodeDim { to { opacity: 0.55; } }
@media (prefers-reduced-motion: no-preference) {
  .fade-in { animation: fadeUp 0.45s ease both; }
  .mark-draw path { stroke-dasharray: 100; stroke-dashoffset: 100; animation: markDraw 1.3s ease 0.15s forwards; }
  .mark-draw circle { opacity: 0; animation: markNode 0.45s ease 1.35s forwards; }
  .r-step { opacity: 0; }
  .r-step.in { animation: fadeUp 0.55s ease both; }
  .scale-node { transition: left 1.2s cubic-bezier(0.22, 1, 0.36, 1); }
  .channel-bars .fill { transition: width 0.9s cubic-bezier(0.22, 1, 0.36, 1); }
  .r-step .g-line:not(.g-dotted) { stroke-dasharray: 100; stroke-dashoffset: 100; }
  .r-step.in .g-line:not(.g-dotted) { animation: markDraw 0.9s ease 0.2s forwards; }
  .r-step .g-node, .r-step .g-hollow, .r-step .g-dotted { opacity: 0; }
  .r-step.in .g-node, .r-step.in .g-hollow, .r-step.in .g-dotted { animation: markNode 0.5s ease 0.9s forwards; }
  .r-step.in .g-node.g-dim { animation: markNodeDim 0.5s ease 0.9s forwards; }
}
/* Shared-result landing: the glyph arrives fully drawn */
#shared-landing .g-line { stroke-dasharray: none !important; stroke-dashoffset: 0 !important; }
#shared-landing .g-node, #shared-landing .g-hollow, #shared-landing .g-dotted { opacity: 1; }
#shared-landing .g-node.g-dim { opacity: 0.55; }

/* Compact fit for shorter desktop viewports */
@media (min-width: 861px) and (max-height: 900px) {
  .index-progress { margin: 1.2rem 0 0.8rem; }
  .wrap .q-title { font-size: clamp(1.35rem, 2.4vw, 1.8rem); margin: 0.6rem 0 1.4rem; }
  .q-option { padding: 0.75rem 1.1rem; font-size: 0.9375rem; }
  .q-options { gap: 0.6rem; }
  .index-result .score { font-size: clamp(2.6rem, 6.5vw, 4rem); }
  .index-result .persona { font-size: clamp(1.3rem, 2.6vw, 1.8rem); margin-top: 0.2rem; }
  .channel-bars { margin: 1.1rem 0; gap: 0.55rem; }
  .note-form { margin-top: 1rem; }
  .note-form h3 { font-size: 1.125rem; }
  .note-form input[type="email"], .note-form .note-field { min-height: 44px; margin-bottom: 0.6rem; }
  .index-result .band { margin-top: 0.5rem; }
  main > section.index-stage { padding: 1.25rem 0; }
  .share-block { margin-top: 1.6rem; padding-top: 1.2rem; }
  .share-block h3 { font-size: 1.125rem; }
}
