/* ============================================================
   FIVATION — Readiness Tools (TRL / IRL self-assessment)
   Shared styling. Builds on design-system.css + main.css.
   ============================================================ */

/* ---------------- Tool hero ---------------- */
.tool-hero {
  position: relative;
  background: var(--ink);
  color: var(--cream-text);
  padding: clamp(7rem, 11vw, 9rem) 0 clamp(2.5rem, 5vw, 3.5rem);
  overflow: hidden;
}
.tool-hero::before {
  content: "";
  position: absolute;
  top: 30%; right: -8%;
  width: 540px; height: 540px;
  background: radial-gradient(circle, var(--gold-glow), transparent 64%);
  pointer-events: none;
}
.tool-hero .container { position: relative; }
.tool-back {
  display: flex; align-items: center; gap: 0.45rem;
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--cream-muted); text-decoration: none; margin-bottom: 1.75rem;
  transition: color 0.18s;
}
.tool-back:hover { color: var(--gold-bright); }
.tool-back .icon { width: 0.9rem; height: 0.9rem; }
.tool-title { font-size: clamp(2.3rem, 5vw, 3.4rem); color: var(--cream-text); margin-bottom: 1rem; letter-spacing: -0.015em; }
.tool-title em { font-style: italic; color: var(--gold-bright); }
.tool-subtitle { font-size: 1.15rem; line-height: 1.55; color: var(--cream-muted); max-width: 62ch; margin-bottom: 1.75rem; }
.tool-meta { display: flex; gap: 1.75rem; flex-wrap: wrap; padding-top: 1.5rem; border-top: 1px solid var(--ink-3); }
.tool-meta .tm { display: flex; align-items: baseline; gap: 0.5rem; }
.tool-meta .tm-k { font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold-bright); }
.tool-meta .tm-v { color: var(--cream-text); font-size: 0.95rem; }

/* ---------------- Section scaffold ---------------- */
.tool-section { padding: clamp(3.5rem, 6vw, 5rem) 0; }
.tool-section.alt { background: var(--paper-2); border-top: 1px solid var(--paper-3); border-bottom: 1px solid var(--paper-3); }
.tool-head { max-width: 720px; margin-bottom: 2.5rem; }
.tool-head.centered { margin-left: auto; margin-right: auto; text-align: center; }
.tool-head h2 { margin: 0.9rem 0 0.6rem; }
.tool-head .lede { font-size: 1.1rem; color: var(--ink-muted); line-height: 1.6; }

/* ---------------- Level reference list ---------------- */
.levels-list { display: flex; flex-direction: column; gap: 0.6rem; }
.level-row {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 1.1rem;
  align-items: center;
  padding: 1rem 1.25rem;
  background: var(--paper);
  border: 1px solid var(--paper-3);
  border-radius: var(--radius);
  border-left: 3px solid var(--cream-muted);
}
.level-row .lv-badge {
  width: 44px; height: 44px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--paper-2); border: 1px solid var(--paper-3);
  font-family: var(--font-mono); font-weight: 700; font-size: 1rem; color: var(--ink-text);
  line-height: 1;
}
.level-row .lv-badge small { font-size: 0.5rem; letter-spacing: 0.08em; color: var(--ink-muted); margin-top: 1px; }
.level-row .lv-name { font-family: var(--font-serif); font-size: 1.15rem; font-weight: 500; margin-bottom: 0.1rem; }
.level-row .lv-desc { font-size: 0.9rem; color: var(--ink-muted); line-height: 1.5; }
/* phase tinting low→high */
.level-row[data-band="early"] { border-left-color: var(--cream-muted); }
.level-row[data-band="mid"] { border-left-color: hsl(var(--warning)); }
.level-row[data-band="late"] { border-left-color: var(--gold); }
.band-label { font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold-deep); margin: 1.5rem 0 0.6rem; }
.band-label:first-child { margin-top: 0; }

/* ---------------- TRL ladder (interactive) ---------------- */
.assess-layout { display: grid; grid-template-columns: 1fr 360px; gap: 2.5rem; align-items: start; }
.ladder { display: flex; flex-direction: column; gap: 0.55rem; }
.rung {
  display: grid;
  grid-template-columns: 30px 48px 1fr;
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.2rem;
  background: var(--paper);
  border: 1px solid var(--paper-3);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, transform 0.12s;
  text-align: left;
  width: 100%;
  font-family: inherit;
}
.rung:hover { border-color: rgba(199,154,59,0.5); }
.rung .rung-check {
  width: 24px; height: 24px; border-radius: 6px;
  border: 1.5px solid var(--paper-3);
  display: flex; align-items: center; justify-content: center;
  color: transparent; transition: all 0.15s; flex-shrink: 0;
}
.rung .rung-check .icon { width: 0.95rem; height: 0.95rem; }
.rung .rung-num { font-family: var(--font-mono); font-weight: 700; font-size: 1.05rem; color: var(--ink-muted); }
.rung .rung-name { display: block; font-family: var(--font-serif); font-size: 1.1rem; font-weight: 500; margin-bottom: 0.15rem; }
.rung .rung-evidence { display: block; font-size: 0.85rem; color: var(--ink-muted); line-height: 1.45; }
/* achieved state */
.rung.achieved { background: var(--gold-glow); border-color: rgba(199,154,59,0.55); }
.rung.achieved .rung-check { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.rung.achieved .rung-num { color: var(--gold-deep); }
.rung.current { box-shadow: 0 0 0 2px var(--gold); }
/* checked but blocked by an unmet lower level */
.rung.checked .rung-check { background: var(--paper-2); border-color: var(--cream-muted); color: var(--ink-muted); }
.rung.checked .rung-check .icon { opacity: 0.55; }

/* result rail (sticky) */
.result-rail { position: sticky; top: 84px; }
.result-card {
  background: var(--ink); color: var(--cream-text);
  border-radius: var(--radius); padding: 1.9rem;
  box-shadow: var(--shadow-lg);
  overflow: hidden; position: relative;
}
.result-card::before {
  content: ""; position: absolute; top: -40%; left: 50%; transform: translateX(-50%);
  width: 320px; height: 320px; background: radial-gradient(circle, var(--gold-glow), transparent 65%);
}
.result-card > * { position: relative; }
.result-eyebrow { font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold-bright); }
.result-level { font-family: var(--font-serif); font-size: 3.4rem; font-weight: 500; line-height: 1; color: var(--cream-text); margin: 0.5rem 0; }
.result-level .rl-of { font-size: 1.4rem; color: var(--cream-muted); }
.result-name { font-family: var(--font-serif); font-style: italic; font-size: 1.3rem; color: var(--gold-bright); margin-bottom: 0.85rem; }
.result-desc { font-size: 0.92rem; color: var(--cream-muted); line-height: 1.55; margin-bottom: 1.1rem; }
.result-meter { height: 8px; border-radius: 999px; background: var(--ink-3); overflow: hidden; margin-bottom: 0.5rem; }
.result-meter span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-bright)); transition: width 0.5s cubic-bezier(.2,.7,.2,1); }
.result-scale { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--cream-muted); }
.result-next {
  margin-top: 1.25rem; padding-top: 1.1rem; border-top: 1px solid var(--ink-3);
}
.result-next h4 { font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold-bright); font-weight: 400; margin-bottom: 0.5rem; }
.result-next p { font-size: 0.88rem; color: var(--cream-muted); line-height: 1.5; }
.result-actions { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 1.25rem; }
.result-empty { font-size: 0.92rem; color: var(--cream-muted); line-height: 1.55; }

/* ---------------- IRL dimensions ---------------- */
.dims { display: flex; flex-direction: column; gap: 1.25rem; }
.dim-q {
  background: var(--paper); border: 1px solid var(--paper-3); border-radius: var(--radius);
  padding: 1.6rem 1.75rem;
}
.dim-q .dim-head { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 0.35rem; }
.dim-q .dim-tag { font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold-deep); background: var(--gold-glow); border: 1px solid rgba(199,154,59,0.35); padding: 0.15rem 0.5rem; border-radius: 999px; }
.dim-q h3 { font-size: 1.25rem; font-weight: 500; }
.dim-q .dim-sub { font-size: 0.9rem; color: var(--ink-muted); margin-bottom: 1.1rem; }
.dim-options { display: flex; flex-direction: column; gap: 0.5rem; }
.dim-option {
  display: flex; align-items: flex-start; gap: 0.75rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--paper-3); border-radius: var(--radius);
  background: var(--paper-2); cursor: pointer; text-align: left; width: 100%;
  font-family: inherit; font-size: 0.92rem; color: var(--ink-text);
  transition: border-color 0.15s, background 0.15s;
}
.dim-option:hover { border-color: var(--gold); }
.dim-option.selected { border-color: var(--gold); background: var(--gold-glow); }
.dim-option .opt-rank {
  flex-shrink: 0; width: 1.5rem; height: 1.5rem; border-radius: 50%;
  background: var(--paper); border: 1px solid var(--paper-3);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 0.72rem; font-weight: 700; color: var(--ink-muted);
}
.dim-option.selected .opt-rank { background: var(--gold); border-color: var(--gold); color: var(--ink); }

/* IRL result */
.irl-result { display: grid; grid-template-columns: 380px 1fr; gap: 2.5rem; align-items: start; }
.radar-wrap { background: var(--paper); border: 1px solid var(--paper-3); border-radius: var(--radius); padding: 1.5rem; }
.radar-wrap svg { display: block; width: 100%; height: auto; }
.dim-bars { display: flex; flex-direction: column; gap: 1rem; }
.dim-bar-row { }
.dim-bar-row .dbr-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.35rem; }
.dim-bar-row .dbr-name { font-weight: 600; font-size: 0.95rem; }
.dim-bar-row .dbr-score { font-family: var(--font-mono); font-size: 0.8rem; color: var(--gold-deep); }
.dim-bar-track { height: 9px; border-radius: 999px; background: var(--paper-2); border: 1px solid var(--paper-3); overflow: hidden; }
.dim-bar-fill { height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-bright)); border-radius: 999px; transition: width 0.6s cubic-bezier(.2,.7,.2,1); }
.dim-bar-row.weak .dbr-score { color: hsl(var(--destructive)); }

.irl-verdict {
  background: var(--ink); color: var(--cream-text);
  border-radius: var(--radius); padding: 2rem; margin-top: 2rem;
  border-left: 4px solid var(--gold);
}
.irl-verdict .iv-stage { font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold-bright); }
.irl-verdict h3 { color: var(--cream-text); margin: 0.4rem 0 0.6rem; font-size: 1.8rem; }
.irl-verdict h3 em { font-style: italic; color: var(--gold-bright); }
.irl-verdict p { color: var(--cream-muted); line-height: 1.6; }
.irl-verdict .iv-focus { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--ink-3); font-size: 0.92rem; color: var(--cream-muted); }
.irl-verdict .iv-focus strong { color: var(--gold-bright); font-weight: 600; }
.irl-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 1.25rem; }

.assess-hint { font-family: var(--font-mono); font-size: 0.78rem; color: var(--ink-muted); margin-bottom: 1.5rem; }
.hidden { display: none !important; }

/* ---------------- Cross-tool footer band ---------------- */
.tool-crosslink { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-top: 1rem; }
.xlink-card {
  display: flex; flex-direction: column; gap: 0.5rem;
  background: var(--paper); border: 1px solid var(--paper-3); border-radius: var(--radius);
  padding: 1.5rem 1.6rem; text-decoration: none; color: inherit;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.xlink-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: rgba(199,154,59,0.45); }
.xlink-card .xl-k { font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold-deep); }
.xlink-card .xl-t { font-family: var(--font-serif); font-size: 1.3rem; font-weight: 500; }
.xlink-card .xl-d { font-size: 0.9rem; color: var(--ink-muted); line-height: 1.5; }
.xlink-card .xl-go { font-size: 0.85rem; font-weight: 600; color: var(--gold-deep); margin-top: 0.25rem; }

/* ---------------- Footer (tools) ---------------- */
.footer { background: var(--ink); border-top: 1px solid var(--ink-3); padding: 3rem 0 1.75rem; }
.footer .footer-bottom { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.footer .footer-bottom p, .footer .footer-bottom a { color: var(--cream-muted); font-size: 0.8rem; text-decoration: none; }
.footer .footer-bottom a:hover { color: var(--gold-bright); }
.footer-logo { display: inline-flex; align-items: center; gap: 0.7rem; }
.footer-logo .logo-img { height: 28px; width: auto; }
.footer-logo .logo-word { font-family: var(--font-serif); font-size: 1.25rem; font-weight: 600; color: var(--cream-text); }

/* ---------------- Responsive ---------------- */
@media (max-width: 920px) {
  .assess-layout { grid-template-columns: 1fr; }
  .result-rail { position: static; }
  .irl-result { grid-template-columns: 1fr; }
  .radar-wrap { max-width: 420px; margin: 0 auto; }
}
@media (max-width: 560px) {
  .level-row { grid-template-columns: 44px 1fr; }
  .rung { grid-template-columns: 24px 36px 1fr; gap: 0.7rem; padding: 0.9rem 1rem; }
  .tool-crosslink { grid-template-columns: 1fr; }
  .tool-meta { gap: 1.1rem; }
}
