/* SG Systems Industry Challenges — engine UI.
 * Mobile first: the primary arrival is a phone, one-handed, from LinkedIn.
 */

.q-root { position: relative; z-index: 1; }

/* ---------------------------------------------------------------- intro */

.q-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.6rem;
  margin: 1.4rem 0;
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
}

.q-meta b { font-family: var(--display); color: var(--fg); }

.q-hook {
  font-family: var(--display);
  text-transform: uppercase;
  font-size: clamp(1.2rem, 3vw, 2rem);
  line-height: 1.05;
  margin: 1.6rem 0;
}

.q-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 1.8rem; }
.q-actions .sg-btn { min-width: 12rem; }

/* ------------------------------------------------------------- progress */

.q-progress { margin-bottom: 2rem; }

.q-progress-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 0.7rem;
}

.q-progress-track { height: 2px; background: var(--line); position: relative; }

.q-progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--fg);
  transition: width 0.35s ease;
}

/* ------------------------------------------------------------- question */

.q-text {
  font-size: clamp(1.15rem, 2.6vw, 1.6rem);
  line-height: 1.35;
  margin-bottom: 1.6rem;
  max-width: 44rem;
}

.q-options { list-style: none; display: grid; gap: 0.7rem; max-width: 44rem; }

.q-option {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  width: 100%;
  text-align: left;
  font: inherit;
  color: var(--fg);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  padding: 1rem 1.1rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  text-shadow: none;
}

.q-option:hover:not(:disabled) { border-color: var(--fg); }
.q-option:disabled { cursor: default; }

.q-option .q-key {
  font-family: var(--display);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  border: 1px solid var(--faint);
  border-radius: 0.4rem;
  padding: 0.15em 0.5em;
  flex: none;
  margin-top: 0.1em;
}

.q-option.picked { border-color: var(--fg); background: rgba(255, 255, 255, 0.06); }
.q-option.correct { border-color: var(--fg); background: rgba(255, 255, 255, 0.12); }
.q-option.correct .q-key { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.q-option.wrong { border-color: var(--faint); opacity: 0.55; }
.q-option.wrong .q-key { text-decoration: line-through; }
.q-option.muted { opacity: 0.4; }

/* ------------------------------------------------------------- feedback */

.q-feedback {
  margin-top: 1.4rem;
  max-width: 44rem;
  border-left: 1px solid var(--fg);
  padding: 0.2rem 0 0.2rem 1.2rem;
}

.q-verdict {
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.q-feedback p { color: var(--dim); }
.q-feedback .sg-link { margin-top: 0.9rem; }

/* --------------------------------------------------------------- result */

.q-score-row {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(1.5rem, 6vw, 4rem);
  align-items: flex-end;
  margin: 1.2rem 0 2rem;
}

.q-score b {
  display: block;
  font-family: var(--display);
  font-size: clamp(2.6rem, 9vw, 5.5rem);
  line-height: 0.9;
}

.q-score span {
  display: block;
  margin-top: 0.6em;
  font-size: 0.7rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--dim);
}

.q-level {
  font-family: var(--display);
  text-transform: uppercase;
  font-size: clamp(1.4rem, 4vw, 2.4rem);
  letter-spacing: 0.02em;
}

.q-estimate {
  display: inline-block;
  margin-top: 0.6rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.5em 1.1em;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
}

.q-bands { display: grid; gap: 0.8rem; max-width: 34rem; margin: 2rem 0; }

.q-band {
  display: grid;
  grid-template-columns: 8.5rem 1fr 3rem;
  align-items: center;
  gap: 1rem;
  border-top: 1px solid var(--line);
  padding-top: 0.7rem;
}

.q-band-name {
  font-family: var(--display);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
}

.q-band-track { height: 3px; background: var(--line); position: relative; }
.q-band-fill { position: absolute; inset: 0 auto 0 0; background: var(--fg); }
.q-band-count { font-family: var(--display); font-size: 0.85rem; text-align: right; }

.q-canvas { display: block; width: 100%; max-width: 34rem; height: auto; margin: 1.5rem 0 2rem; }

/* --------------------------------------------------------------- review */

.q-review { display: grid; gap: 1.6rem; margin-top: 2rem; }

.q-review-item { border-top: 1px solid var(--line); padding-top: 1rem; }

.q-review-q {
  font-size: 1.02rem;
  margin-bottom: 0.7rem;
}

.q-review-line { font-size: 0.9rem; color: var(--dim); }
.q-review-line b { font-family: var(--display); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg); }
.q-review-item .q-feedback { margin-top: 0.8rem; }

.q-toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%);
  background: var(--fg);
  color: var(--bg);
  font-family: var(--display);
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  padding: 0.8em 1.4em;
  border-radius: 999px;
  z-index: 200;
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}

.q-toast.on { opacity: 1; }

@media (max-width: 720px) {
  .q-band { grid-template-columns: 7rem 1fr 2.6rem; gap: 0.7rem; }
  .q-actions .sg-btn { width: 100%; }
}

/* ------------------------------------------------- readability scrims --- */

.q-progress, .q-text, .q-feedback, .q-meta, .q-hook,
.q-score-row, .q-bands, .q-review-item, .q-review-q, .q-review-line {
  position: relative;
}

.q-progress::before, .q-text::before, .q-feedback::before, .q-meta::before,
.q-hook::before, .q-score-row::before, .q-bands::before,
.q-review-item::before, .q-review-q::before, .q-review-line::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -0.9rem -1.4rem;
  pointer-events: none;
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  -webkit-mask-image: radial-gradient(ellipse 100% 100% at 50% 50%, #000 55%, transparent 99%);
  mask-image: radial-gradient(ellipse 100% 100% at 50% 50%, #000 55%, transparent 99%);
}

/* answer options read as frosted cards rather than transparent outlines */
.q-option {
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  background: rgba(5, 5, 5, 0.45);
}

.q-option.picked, .q-option.correct { background: rgba(255, 255, 255, 0.12); }
.q-option.wrong { background: rgba(5, 5, 5, 0.55); }

.q-estimate {
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  background: rgba(5, 5, 5, 0.45);
}

/* ----------------------------------------------------- static page head */

.q-head { margin-bottom: 2.2rem; }
.q-head .sg-lead { max-width: 44rem; }
.q-head .q-meta { margin: 1.1rem 0 0; }

@media (max-width: 720px) {
  /* on a phone the question must be reachable without a long scroll */
  .q-head { margin-bottom: 1.6rem; }
  .q-head h1 { font-size: clamp(1.9rem, 8vw, 2.6rem); }
  .q-head .sg-lead { font-size: 0.94rem; }
}

/* knowledge rank sits beside score and level as its own idea */
.q-rank { font-family: var(--display); text-transform: uppercase; font-size: clamp(1.2rem, 3.2vw, 2rem); }
.q-estimate b { font-family: var(--display); color: var(--fg); }

.q-band-name em {
  display: block;
  font-family: var(--body);
  font-style: normal;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  color: var(--faint);
  margin-top: 0.25em;
}

.q-share-hint { margin-top: 1rem; max-width: 40rem; }

/* ------------------------------------------------ shared-result banner */

.q-banner {
  border-left: 1px solid var(--fg);
  padding-left: 1.4rem;
  margin-bottom: 2.5rem;
}

.q-banner h1 { font-size: clamp(2rem, 6vw, 3.4rem); }
.q-banner-rank { color: var(--dim); font-size: 0.5em; }

/* The engine moves focus to each new question so a screen reader announces
   it. Chrome then paints its focus ring, which looks to a mouse user like
   the question got selected — so the ring is kept only for keyboard focus. */
.q-text[tabindex="-1"]:focus,
.sg-display[tabindex="-1"]:focus {
  outline: none;
}

.q-text[tabindex="-1"]:focus-visible,
.sg-display[tabindex="-1"]:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 6px;
}
