/* ------------------------------------------------------------------
   Paper & ink. One accent: saffron (the robe). Vermilion only for ✗.
------------------------------------------------------------------- */
:root {
  --paper: #FAF7EF;
  --ink: #2A2824;
  --pencil: #8B8577;
  --saffron: #B97A1E;
  --vermilion: #A8432F;
  --wash-sila: #F2E7CF;
  --wash-samadhi: #E7EAF0;
  --wash-panna: #EDEAE0;
  --wash-weathered: rgba(176, 137, 74, 0.38);  /* aged saffron */
  --wash-cracked:   rgba(168, 74, 60, 0.42);   /* faded rust  */
  --hair: #DCD6C6;
  --max: 660px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Karla", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.55;
}
a { color: inherit; }
:focus-visible { outline: 2px dashed var(--saffron); outline-offset: 3px; border-radius: 2px; }

.page { max-width: 900px; margin: 0 auto; padding: 22px 18px 90px; }
.page--narrow { max-width: var(--max); }

/* ---------------- hand elements ---------------- */
.hand-note, .tri-pali, .tri-dev, .home-title, .title, .h-label, .crumb-label,
.gate-q, .x-mark, .check, .group-role, .eyebrow, .h-xhint {
  font-family: "Kalam", "Karla", cursive;
}

.hand-note { color: var(--pencil); font-size: 15px; margin: 4px 0 2px; }
.home-title { font-weight: 700; font-size: clamp(26px, 5vw, 38px); line-height: 1.15; margin: 6px 0 4px; }
.home-sub { display: block; font-weight: 300; font-size: .52em; color: var(--pencil); margin-top: 4px; }

/* ---------------- house svg ---------------- */
.house-wrap { margin: 6px auto 8px; }
.house { width: 100%; height: auto; display: block; }
.h-ink { fill: none; stroke: var(--ink); stroke-linecap: round; }
.h-hit { stroke: none; transition: fill .25s ease; }
.h-node { cursor: pointer; text-decoration: none; }
.h-node:hover .h-ink, .h-node:focus-visible .h-ink { stroke: var(--saffron); }
.h-node:hover .h-label, .h-node:focus-visible .h-label { fill: var(--saffron); }
.h-node.is-current .h-ink { stroke: var(--saffron); stroke-width: 4; }
.h-label { fill: var(--ink); font-size: 19px; font-weight: 700; paint-order: stroke; stroke: var(--paper); stroke-width: 7px; stroke-linejoin: round; }
.h-label-en { font-size: 13.5px; font-weight: 300; fill: var(--pencil); font-family: "Karla", sans-serif; letter-spacing: .04em; paint-order: stroke; stroke: var(--paper); stroke-width: 5px; stroke-linejoin: round; }
.h-xhint { fill: var(--vermilion); font-size: 13.5px; opacity: .85; }

.h-thread { fill: none; stroke: var(--saffron); stroke-width: 3.5; stroke-dasharray: 2 9; stroke-linecap: round; opacity: .9; }
.h-thread-dot { fill: var(--paper); stroke: var(--saffron); stroke-width: 3; }
.h-thread-origin { fill: var(--saffron); }

.house--mini { max-width: 250px; }
.house--mini .h-ink { stroke: var(--pencil); }
.house--mini .is-current .h-ink { stroke: var(--saffron); }

/* ---------------- lenses ---------------- */
.lens { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 2px; }
.lens-btn {
  font: 15px "Kalam", cursive; color: var(--pencil);
  background: none; border: 1.5px solid transparent; border-radius: 3px;
  padding: 3px 12px; cursor: pointer;
}
.lens-btn.is-on { color: var(--ink); border-color: var(--ink); border-style: solid; box-shadow: 2px 2px 0 var(--hair); }
.lens-btn:hover { color: var(--ink); }
.lens-caption { text-align: center; color: var(--pencil); font-size: 14.5px; margin: 8px 0 0; }

/* ---------------- group cards ---------------- */
.group-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 34px; }
.group-card {
  text-decoration: none; padding: 14px 14px 16px;
  border: 1.5px solid var(--ink); border-radius: 4px 7px 5px 6px / 6px 4px 7px 5px;
  box-shadow: 3px 3px 0 var(--hair);
  display: flex; flex-direction: column; gap: 6px;
  transition: transform .15s ease, box-shadow .15s ease;
}
.group-card:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--hair); }
.group-card--sila { background: var(--wash-sila); }
.group-card--samadhi { background: var(--wash-samadhi); }
.group-card--panna { background: var(--wash-panna); }
/* the mirror — a full-width invitation BAND under the house, not a grid card.
   The one active/personal thing on a page of reading-doors, so it reads as a
   different kind of element entirely: a ruled strip, the house in miniature. */
.assess-invite {
  display: flex; align-items: center; gap: 16px;
  width: 100%; margin: 30px 0 6px; padding: 15px 6px;
  text-decoration: none; color: var(--ink);
  border-top: 1.5px solid var(--saffron);
  border-bottom: 1.5px solid var(--saffron);
  background: rgba(185, 122, 30, .06);
  transition: background .15s ease;
}
.assess-invite:hover { background: rgba(185, 122, 30, .11); }
.assess-invite-glyph { flex: none; color: var(--saffron); display: flex; align-items: center; }
.assess-invite-body { flex: 1 1 auto; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.assess-invite-eyebrow {
  font-family: "Karla", sans-serif; text-transform: uppercase;
  letter-spacing: .14em; font-size: 11px; font-weight: 700; color: var(--saffron);
}
.assess-invite-title { font-family: "Kalam", cursive; font-size: 20px; font-weight: 700; color: var(--ink); line-height: 1.15; }
.assess-invite-sub { font-family: "Karla", sans-serif; font-size: 13.5px; color: var(--pencil); }
.assess-invite-go {
  flex: none; font-family: "Kalam", cursive; font-weight: 700; font-size: 15.5px;
  color: var(--saffron); white-space: nowrap; border-bottom: 2px solid transparent;
}
.assess-invite:hover .assess-invite-go { border-bottom-color: var(--saffron); }
@media (max-width: 480px) {
  .assess-invite { flex-wrap: wrap; gap: 8px 14px; }
  .assess-invite-go { margin-left: 54px; }
}

/* deep-dive result readout — your own answers reflected back */
.assess-readout-lead {
  font-family: "Karla", sans-serif; font-size: 12.5px; text-transform: uppercase;
  letter-spacing: .1em; color: var(--pencil); margin: 22px 0 9px;
}
.assess-readout { list-style: none; padding: 0; margin: 0 0 6px; display: flex; flex-direction: column; gap: 9px; }
.assess-readout-item { display: flex; align-items: flex-start; gap: 11px; }
.ro-mark { flex: none; width: 11px; height: 11px; margin-top: 5px; border-radius: 50%; border: 1.5px solid var(--pencil); }
.ro-mark--sound { background: #cadaC8; border-color: #93ab92; }
.ro-mark--weathered { background: var(--wash-weathered); border-color: var(--saffron); }
.ro-mark--cracked { background: var(--wash-cracked); border-color: #a84a3c; }
.ro-mark--na { background: transparent; border-style: dashed; }
.ro-text { font-family: "Karla", sans-serif; font-size: 15px; color: var(--ink); line-height: 1.35; }
.ro-text--cracked { color: #8f3a2e; }
.ro-text--na { color: var(--pencil); }
.group-role { color: var(--pencil); font-size: 14px; }
.group-ess { font-size: 14.5px; color: var(--ink); }

.colophon { text-align: center; color: var(--pencil); font-size: 13.5px; margin-top: 44px; }
.credit { text-align: center; color: var(--pencil); font-size: 12px; margin-top: 10px; opacity: .85; }
.credit b { color: var(--ink); font-weight: 600; }

/* ---------------- trilingual lockup ---------------- */
.tri { display: inline-flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.tri-pali { font-weight: 700; }
.tri-dev { color: var(--pencil); font-weight: 400; }
.tri-en { font-size: .72em; color: var(--pencil); font-weight: 300; letter-spacing: .05em; }
.tri--big { gap: 12px; }
.tri--big .tri-pali { font-size: clamp(30px, 6vw, 42px); }
.tri--big .tri-dev { font-size: clamp(20px, 4vw, 27px); }
.tri--big .tri-en { font-size: 16px; }
.tri--quiz { flex-direction: column; align-items: center; gap: 2px; }
.tri--quiz .tri-en { font-size: clamp(26px, 5vw, 36px); color: var(--ink); font-weight: 700; letter-spacing: 0; }
.tri--quiz .tri-pali { font-size: 15px; color: var(--pencil); font-weight: 400; }

/* ---------------- concept pages ---------------- */
.crumb { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.crumb-back { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--pencil); }
.crumb-back:hover { color: var(--saffron); }
.crumb-house { width: 52px; height: auto; }
.crumb-part { stroke: var(--hair); fill: none; }
.crumb-part.is-hot { stroke: var(--saffron); }
.crumb-label { font-size: 15px; }
.crumb-trail { font-size: 13.5px; color: var(--pencil); }
.crumb-trail a { color: var(--pencil); text-decoration: none; }
.crumb-trail a:hover { color: var(--saffron); }
.crumb-trail b { color: var(--ink); font-weight: 700; }
.crumb-sep { margin: 0 6px; }

.eyebrow { color: var(--pencil); font-size: 15px; margin: 0 0 2px; }
.eyebrow a { text-decoration: none; color: var(--pencil); border-bottom: 1px dashed var(--hair); }
.eyebrow a:hover { color: var(--saffron); }
.title { margin: 0 0 10px; line-height: 1.1; }
.samma-link { text-decoration: none; border-bottom: 2px dotted var(--hair); }
.samma-link:hover { color: var(--saffron); border-bottom-color: var(--saffron); }
.essence { font-size: 20px; line-height: 1.45; margin: 0 0 14px; }
.body-text { color: #4A463E; margin: 0 0 10px; }
.margin-note { color: var(--pencil); font-size: 14.5px; font-style: italic; border-left: 2px solid var(--hair); padding-left: 12px; }

/* ✗ lists — the sketch's own idiom */
.x-list { list-style: none; padding: 0; margin: 18px 0; display: grid; gap: 8px; }
.x-item a {
  display: flex; align-items: baseline; gap: 10px; text-decoration: none;
  border: 1.5px solid var(--ink); border-radius: 5px 3px 6px 4px / 4px 6px 3px 5px;
  padding: 9px 14px; box-shadow: 2px 2px 0 var(--hair);
  transition: transform .15s ease;
}
.x-item a:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--hair); }
.x-item > .x-mark, .x-item { color: var(--ink); }
.x-item { display: flex; gap: 10px; align-items: baseline; }
.x-mark { color: var(--vermilion); font-weight: 700; }
.x-go { margin-left: auto; color: var(--pencil); }
.x-note { color: var(--pencil); font-size: 14.5px; }
.x-list--subtle .x-item { border: none; padding: 2px 0; }

.antidote { border: 1.5px dashed var(--pencil); border-radius: 4px; padding: 10px 14px; margin: 20px 0 0; }
.check { color: var(--saffron); font-weight: 700; margin-right: 6px; }

.reflect { margin-top: 26px; color: var(--ink); font-family: "Kalam", cursive; font-size: 18px; }
.reflect::before { content: "☞ "; color: var(--saffron); }
.leaf-mirror { margin-top: 14px; font-size: 15px; }

/* gates */
.gates { list-style: none; counter-reset: gate; padding: 0; margin: 18px 0; display: grid; gap: 10px; }
.gate {
  counter-increment: gate; display: flex; align-items: baseline; gap: 12px;
  border-bottom: 1.5px solid var(--hair); padding-bottom: 9px;
}
.gate::before { content: counter(gate); font-family: "Kalam", cursive; color: var(--pencil); font-size: 15px; min-width: 16px; }
.gate-q { font-size: 19px; }
.gate-fail { margin-left: auto; font-size: 13.5px; color: var(--pencil); text-decoration: none; border-bottom: 1px dashed var(--hair); white-space: nowrap; }
.gate-fail:hover { color: var(--vermilion); }

/* children */
.child-list { display: grid; gap: 10px; margin-top: 26px; }
.child-link {
  text-decoration: none; padding: 12px 15px;
  border: 1.5px solid var(--ink); border-radius: 6px 4px 5px 7px / 4px 7px 4px 6px;
  box-shadow: 2px 2px 0 var(--hair); display: block;
  transition: transform .15s ease;
}
.child-link:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--hair); }
.child-ess { display: block; color: var(--pencil); font-size: 14.5px; margin-top: 3px; }

/* threads */
.section-h { font-family: "Kalam", cursive; font-size: 20px; margin: 40px 0 10px; border-bottom: 1.5px solid var(--hair); padding-bottom: 5px; }
.threads { display: flex; gap: 20px; align-items: flex-start; }
.thread-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; flex: 1; }
.thread-item a { text-decoration: none; display: block; }
.thread-item b { font-family: "Kalam", cursive; }
.thread-item a:hover b { color: var(--saffron); }
.thread-why { display: block; color: var(--pencil); font-size: 14.5px; }

/* ---------------- responsive & motion ---------------- */
@media (max-width: 640px) {
  .group-row { grid-template-columns: 1fr; }
  .threads { flex-direction: column; }
  .house--mini { max-width: 210px; }
  .h-label { font-size: 23px; }
  .h-label-en { font-size: 16px; }
  .h-xhint { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------------- other maps & cta ---------------- */
.maps-h { font-family: "Kalam", cursive; font-size: 18px; color: var(--pencil); font-weight: 400; text-align: center; margin: 44px 0 12px; }
.group-row--maps { grid-template-columns: repeat(2, 1fr); margin-top: 0; max-width: 640px; margin-left: auto; margin-right: auto; }
.group-card--map { background: transparent; border-style: dashed; }
.cta-wrap { margin: 24px 0 8px; }
.cta {
  font-family: "Kalam", cursive; font-size: 19px; text-decoration: none;
  border: 1.5px solid var(--ink); border-radius: 6px 4px 7px 5px / 4px 6px 4px 7px;
  padding: 9px 20px; box-shadow: 3px 3px 0 var(--hair); display: inline-block;
  transition: transform .15s ease;
}
.cta:hover { transform: translate(-1px,-1px); box-shadow: 4px 4px 0 var(--hair); color: var(--saffron); }
@media (max-width: 640px) { .group-row--maps { grid-template-columns: 1fr; } }

/* ---------------- rasa bridge (return-to-app bar) ----------------
   Fixed, opaque paper bar pinned to the bottom. The page reserves 90px of
   bottom padding, so real content clears it; an opaque background means it
   can never visually collide with the top-left title or the breadcrumbs.
   Safe-area insets keep it clear of the home indicator on notched phones. */
.rasa-bridge {
  position: fixed;
  right: calc(16px + env(safe-area-inset-right, 0px));
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 50;
  display: flex;
}
.rasa-bridge a {
  font-family: "Kalam", "Karla", cursive;
  font-size: 15px;
  line-height: 1.2;
  color: var(--ink);
  text-decoration: none;
  background: var(--paper);
  border: 1.5px solid var(--hair);
  border-radius: 999px;
  padding: 6px 14px;
  box-shadow: 0 2px 8px rgba(42, 40, 36, 0.08);
  transition: color 0.15s ease, border-color 0.15s ease;
}
.rasa-bridge a:hover { color: var(--saffron); border-color: var(--saffron); }

/* --- assessment: house health ------------------------------------ */
/* Assumes the default (structure) lens, whose h-hit fill is transparent.
   These rules outrank the inline fill attr, so a grouping/visibility lens
   wash would be overridden if health is ever combined with one — the
   assessment result only ever renders on the structure lens. */
/* weathered: a warm saffron wash. cracked: a deeper rust wash + a penned
   fracture (below) — the two states must read apart at a glance. */
.h-node.is-weathered .h-hit { fill: var(--wash-weathered); }
.h-node.is-cracked   .h-hit { fill: var(--wash-cracked); }
/* the cracked wash gets a faint rust edge so it reads heavier than weathered */
.h-node.is-cracked   .h-ink { stroke: rgba(140, 54, 42, 0.9); }
/* sound: no tint — a sound part looks like the house as drawn */
.h-crack {
  fill: none;
  stroke: rgba(140, 54, 42, 0.95);
  stroke-width: 2.6;
  stroke-linecap: round;
  pointer-events: none;
}

/* --- assessment: walk & result ----------------------------------- */
.page--assess { text-align: center; }
.cta--btn { border: none; background: none; font: inherit; cursor: pointer; }
.assess-progress { font-family: var(--hand, "Kalam", cursive); letter-spacing: .04em; opacity: .7; margin-bottom: 1.5rem; }
.assess-progress span { opacity: .6; }
.assess-statement { font-size: 1.4rem; line-height: 1.5; margin: 1.2rem auto 2rem; max-width: 32ch; }
.assess-statement:focus { outline: none; }
/* headings are focused programmatically (tabIndex -1) for screen readers only —
   they're not keyboard-tabbable, so suppress the stray focus ring. */
.page--assess .title:focus, .page--assess .assess-read:focus { outline: none; }
.assess-choices { display: flex; flex-direction: column; gap: .6rem; max-width: 22rem; margin: 0 auto; }
.assess-choice { padding: .8rem 1rem; border: 1.5px solid rgba(60,44,30,.35); border-radius: 2px; background: transparent; font: inherit; cursor: pointer; transition: background .15s, border-color .15s; }
.assess-choice:hover, .assess-choice:focus-visible { background: rgba(176,137,74,.12); border-color: rgba(60,44,30,.6); }
/* the previously chosen option, shown on back-nav */
.assess-choice.is-picked { border-color: var(--saffron); border-width: 2px; background: rgba(185,122,30,.14); box-shadow: 2px 2px 0 var(--hair); }
.assess-back { margin-top: 1.5rem; border: none; background: none; font: inherit; opacity: .6; cursor: pointer; }
.assess-back:hover { opacity: 1; }
.assess-read { font-size: 1.2rem; margin: 1.5rem auto .5rem; max-width: 34ch; }
.assess-doors { display: flex; gap: 1.2rem; justify-content: center; margin-bottom: 2rem; flex-wrap: wrap; }
.assess-legend { display: flex; gap: 1rem; justify-content: center; font-size: .85rem; opacity: .8; margin: 1rem 0; }
.lg::before { content: ""; display: inline-block; width: .7em; height: .7em; margin-right: .35em; border-radius: 1px; vertical-align: baseline; }
.lg--sound::before { background: rgba(60,44,30,.25); }
.lg--weathered::before { background: var(--wash-weathered); }
.lg--cracked::before { background: var(--wash-cracked); }
.assess-chips { display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; margin: 1rem 0; }
.assess-chip { font-size: .85rem; padding: .3rem .7rem; border: 1px solid rgba(60,44,30,.25); border-radius: 2px; text-decoration: none; }

/* --- result: parts that want tending (a calm list, not an alarm) --- */
.assess-tending { list-style: none; padding: 0; margin: .5rem auto 1.5rem; max-width: 34ch; text-align: left; }
.assess-tending-item { padding: .55rem .2rem; line-height: 1.5; border-bottom: 1px solid var(--hair); }
.assess-tending-item:last-child { border-bottom: none; }
.assess-tending-item a { color: var(--saffron); text-decoration: none; white-space: nowrap; }
.assess-tending-item a:hover { text-decoration: underline; }
/* small color cue matching the legend swatches */
.tending-name { font-weight: 700; padding: 0 .15em; border-radius: 1px; }
.tending-name.is-weathered { background: var(--wash-weathered); }
.tending-name.is-cracked { background: var(--wash-cracked); }
/* result rows: the three doors as quiet chips (spec: discoverability) */
.tending-doors { display: inline-flex; flex-wrap: wrap; gap: 8px; margin-left: 10px; vertical-align: middle; }
.assess-tending-item .door-chip { display: inline-block; padding: 4px 12px; border: 1px solid rgba(0,0,0,.14); border-radius: 999px; font-size: .85rem; color: var(--saffron); text-decoration: none; transition: border-color .15s; }
.assess-tending-item .door-chip:hover { border-color: var(--saffron); text-decoration: none; }
.assess-doors-note { font-size: .9rem; color: var(--pencil); margin: 10px auto 0; max-width: 52ch; }
.assess-doors-note b { color: inherit; font-weight: 700; }
/* the "you set aside" note — muted, secondary */
.assess-note { font-size: .95rem; color: var(--pencil); max-width: 34ch; margin: .5rem auto 1rem; }
/* the mend panel — per-limb practice cards */
.mend-list { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 12px; }
.mend-card-link { display: block; padding: 14px 18px; border: 1px solid rgba(0,0,0,.14); border-radius: 10px; text-decoration: none; color: inherit; background: rgba(255,255,255,.5); transition: border-color .15s; }
.mend-card-link:hover { border-color: var(--saffron); }
.mend-card-title { display: block; font-weight: 700; }
.mend-card-line { display: block; color: var(--pencil); font-size: 14px; margin-top: 2px; }
.mend-card-go { display: block; color: var(--saffron); font-size: 13px; margin-top: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
@media (prefers-reduced-motion: reduce) { .assess-choice { transition: none; } }
