/* ============================================================
   Ian Aman — Chaos Assessment (page-specific styles)
   Builds on styles.css design tokens
   ============================================================ */
:root {
  --red: #cf4636;
  --amber: #c4912b;
  --green: #3f9b6d;
}

.chaos {
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
}
.chaos__wrap { width: 100%; max-width: 820px; margin: 0 auto; padding-inline: var(--pad); }
.chaos__wrap--narrow { max-width: 620px; }

.chaos__title {
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 600;
  line-height: 1.03;
  letter-spacing: -0.03em;
  margin: 0.4rem 0 1.2rem;
}
.chaos__sub {
  font-size: var(--f-lead);
  color: #4a4a4f;
  line-height: 1.5;
  max-width: 56ch;
}

/* ---------- intro ---------- */
.chaos__intro {
  padding: clamp(7rem, 15vw, 10rem) 0 clamp(4rem, 8vw, 6rem);
  text-align: center;
}
.chaos__intro .eyebrow { text-align: center; }
.chaos__intro .chaos__sub { margin-inline: auto; }
.chaos__logo {
  height: 64px; width: auto; display: block; margin: 0 auto 1.6rem;
  filter: brightness(0); opacity: 0.88;
}
.chaos__chips {
  list-style: none;
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 0.6rem;
  margin: 2.2rem auto;
  max-width: 720px;
}
.chaos__chips li {
  font-size: 0.92rem;
  color: #3a3a3f;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.10);
  border-radius: 980px;
  padding: 0.5em 1em;
}
.chaos__meta { margin-top: 1.4rem; color: var(--muted); font-size: 0.95rem; }

/* ---------- buttons specific ---------- */
.btn--ghost-ink {
  background: transparent;
  color: var(--ink);
  border: 1px solid rgba(0,0,0,0.22);
}
.btn--ghost-ink:hover { background: rgba(0,0,0,0.05); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---------- quiz ---------- */
.chaos__quiz { padding: clamp(6rem, 12vw, 8rem) 0 clamp(4rem, 8vw, 6rem); }
.progress { margin-bottom: clamp(2rem, 4vw, 3rem); }
.progress__meta {
  display: flex; justify-content: space-between;
  font-size: 0.9rem; color: var(--muted);
  margin-bottom: 0.7rem; letter-spacing: 0.02em;
}
.progress__track { height: 6px; background: rgba(0,0,0,0.10); border-radius: 980px; overflow: hidden; }
.progress__bar { display: block; height: 100%; width: 0; background: var(--ink); border-radius: 980px; transition: width 0.5s var(--ease); }

.domain__head { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 1.8rem; }
.domain__emoji { font-size: 2rem; }
.domain__name { font-size: clamp(1.7rem, 3.6vw, 2.4rem); font-weight: 600; letter-spacing: -0.02em; }

.qlist { display: flex; flex-direction: column; gap: 1rem; }
.q {
  border: 1px solid rgba(0,0,0,0.10);
  border-radius: 18px;
  background: #fff;
  padding: clamp(1.2rem, 3vw, 1.8rem);
  margin: 0;
}
.q__text {
  font-size: 1.12rem; font-weight: 500; line-height: 1.4;
  color: var(--ink); margin-bottom: 1.1rem; padding: 0;
}
.q__scale { display: flex; gap: 0.5rem; }
.q__opt {
  flex: 1 1 0;
  font: inherit; font-size: 0.86rem; font-weight: 500;
  color: #3a3a3f;
  background: #f5f5f7;
  border: 1px solid rgba(0,0,0,0.10);
  border-radius: 12px;
  padding: 0.85em 0.4em;
  cursor: pointer;
  text-align: center;
  line-height: 1.25;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.q__opt:hover { border-color: rgba(0,0,0,0.35); }
.q__opt.is-selected {
  background: var(--ink); color: #fff; border-color: var(--ink);
  transform: translateY(-1px);
}

.quiz__nav {
  display: flex; justify-content: space-between; gap: 1rem;
  margin-top: clamp(2rem, 4vw, 3rem);
}
.quiz__nav .btn { min-width: 150px; }

/* ---------- gate ---------- */
.chaos__gate { padding: clamp(7rem, 14vw, 10rem) 0; text-align: center; }
.chaos__gate .eyebrow { text-align: center; }
.chaos__gate .chaos__sub { margin: 0 auto 2rem; }
.gate__form { max-width: 540px; margin: 0 auto; }
.gate__field { display: flex; gap: 0.7rem; flex-wrap: wrap; justify-content: center; }
.gate__field input {
  flex: 1 1 240px; min-width: 0;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.16);
  border-radius: 980px;
  padding: 1.05em 1.5em;
  color: var(--ink); font: inherit; font-size: 1rem;
  transition: border-color 0.3s;
}
.gate__field input:focus { outline: none; border-color: var(--ink); }
.gate__note { margin-top: 1rem; color: var(--muted); font-size: 0.88rem; }

/* ---------- results ---------- */
.chaos__results { padding: clamp(6rem, 12vw, 9rem) 0 clamp(4rem, 8vw, 6rem); }
.chaos__results .eyebrow { margin-bottom: 1.5rem; }
.result__index { text-align: center; margin-bottom: clamp(3rem, 6vw, 4.5rem); }
.index { display: inline-flex; align-items: baseline; gap: 0.3rem; }
.index__num { font-size: clamp(5rem, 16vw, 9rem); font-weight: 700; line-height: 0.9; letter-spacing: -0.04em; }
.index__of { font-size: 1.4rem; font-weight: 500; color: var(--muted); }
.index--red .index__num { color: var(--red); }
.index--amber .index__num { color: var(--amber); }
.index--green .index__num { color: var(--green); }
.index__band {
  font-size: 1.1rem; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; margin-top: 0.6rem;
}
.index__band--red { color: var(--red); }
.index__band--amber { color: var(--amber); }
.index__band--green { color: var(--green); }
.index__hint { color: var(--muted); font-size: 0.95rem; margin-top: 0.5rem; }

.result__block { margin-bottom: clamp(2.5rem, 5vw, 3.5rem); }
.result__h { font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 600; letter-spacing: -0.02em; }
.result__sub { color: var(--muted); margin: 0.3rem 0 1.4rem; }

.zones { list-style: none; display: flex; flex-direction: column; gap: 0.6rem; }
.zone {
  display: flex; align-items: center; gap: 0.8rem;
  background: #fff; border: 1px solid rgba(0,0,0,0.10);
  border-radius: 14px; padding: 1rem 1.3rem;
  font-size: 1.1rem; font-weight: 500;
}
.zone__emoji { font-size: 1.3rem; }
.zone__name { flex: 1; }
.zone__score { font-weight: 700; font-variant-numeric: tabular-nums; }

.dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot--red { background: var(--red); }
.dot--amber { background: var(--amber); }
.dot--green { background: var(--green); }

.bar { margin-bottom: 1.1rem; }
.bar__top { display: flex; justify-content: space-between; margin-bottom: 0.45rem; font-size: 1rem; }
.bar__name { font-weight: 500; }
.bar__val { font-weight: 700; font-variant-numeric: tabular-nums; }
.bar__track { height: 10px; background: rgba(0,0,0,0.08); border-radius: 980px; overflow: hidden; }
.bar__fill { display: block; height: 100%; border-radius: 980px; transition: width 0.9s var(--ease); }
.bar__fill--red { background: var(--red); }
.bar__fill--amber { background: var(--amber); }
.bar__fill--green { background: var(--green); }

.legend { display: flex; flex-wrap: wrap; gap: 1.4rem; margin-top: 1.5rem; color: var(--muted); font-size: 0.88rem; }
.legend span { display: inline-flex; align-items: center; gap: 0.4rem; }

.result__cta { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; margin: clamp(2.5rem, 5vw, 3.5rem) 0; }
.result__card { background: #fff; border: 1px solid rgba(0,0,0,0.10); border-radius: 18px; padding: 1.8rem; }
.result__card h4 { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 0.6rem; }
.result__card p { color: #4a4a4f; font-size: 1rem; line-height: 1.5; margin-bottom: 1rem; }

/* ---------- responsive ---------- */
@media (max-width: 620px) {
  .q__scale { flex-direction: column; }
  .q__opt { text-align: left; padding: 0.9em 1.1em; }
  .quiz__nav .btn { min-width: 0; flex: 1; }
  .result__cta { grid-template-columns: 1fr; }
  .gate__field { flex-direction: column; }
}
