/* Qualifications and Skills: slot reel of headings + list, in the Citron / Cement / Mahogany scheme */
.quals-page {
  --q-bg: var(--paper); --q-ink: var(--ink);
  background: var(--q-bg); color: var(--q-ink);
  transition: background-color .9s var(--ease-out), color .9s var(--ease-out);
}
.quals {
  position: relative; min-height: 100svh; overflow: hidden;
  padding: calc(var(--nav-h) + 4px) var(--gutter) 24px;
  display: grid; grid-template-rows: auto auto 1fr auto;
}
.q-kicker { margin: 8px 0 0; font-family: "KC Mono", monospace; font-weight: 700; font-size: 11px; text-transform: uppercase; }

.q-grid {
  position: relative; z-index: 1; align-self: center;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(24px, 5vw, 96px); align-items: center;
  width: min(100%, 1400px); margin: 0 auto;
}

/* ---------- the reel ---------- */
.q-reel {
  position: relative; height: min(62svh, 560px); perspective: 900px; cursor: ns-resize;
  touch-action: none; user-select: none; -webkit-user-select: none; outline: none;
  mask-image: linear-gradient(180deg, transparent, #000 22%, #000 78%, transparent);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 22%, #000 78%, transparent);
}
.q-reel:focus-visible { outline: 1px dashed currentColor; outline-offset: 6px; }
.q-drum { position: absolute; inset: 0; transform-style: preserve-3d; }
.q-face {
  position: absolute; left: 50%; top: 50%; max-width: 100%;
  padding: .12em .32em .16em; border: 0; background: transparent; color: inherit; cursor: pointer;
  font-family: "KC Sans", sans-serif; font-weight: 500; font-size: clamp(26px, 3.3vw, 54px); line-height: 1.02; letter-spacing: -.035em;
  text-align: center; text-wrap: balance; width: max-content; max-width: min(92%, 12em);
  backface-visibility: hidden; transition: background-color .35s var(--ease-out), color .35s var(--ease-out);
}
.q-face.is-centre { font-weight: 500; }
/* pointing at a heading shows its own colour, like a paint chip */
.q-face.is-hover { background: var(--c); color: var(--ink); }
/* the heading the page is already coloured by gets an outline instead, so the chip never vanishes into the page */
.is-coloured .q-face.is-hover.is-current { background: transparent; color: inherit; box-shadow: inset 0 0 0 1px currentColor; }
.q-swatch {
  position: absolute; left: 50%; bottom: 4%; transform: translateX(-50%); margin: 0;
  display: flex; gap: 14px; font-family: "KC Mono", monospace; font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em;
  opacity: .55; transition: opacity .3s;
}
.q-swatch.on { opacity: 1; }
/* ---------- the list ---------- */
.q-list { list-style: none; margin: 0; padding: 0; }
.q-list li {
  display: grid; grid-template-columns: 3.4em 1fr; column-gap: 8px; padding: 12px 0;
  border-top: 1px solid color-mix(in srgb, currentColor 16%, transparent);
  opacity: 0; transform: translateY(14px); animation: q-in .7s var(--ease-out) forwards; animation-delay: calc(var(--k) * 55ms);
  outline-offset: 4px;
}
.q-list li:last-child { border-bottom: 1px solid color-mix(in srgb, currentColor 16%, transparent); }
@keyframes q-in { to { opacity: 1; transform: none; } }
.q-list.is-leaving li { animation: none; opacity: 0; transform: translateY(-8px); transition: opacity .2s, transform .2s; }
.q-n { grid-row: span 2; padding-top: .55em; font-family: "KC Mono", monospace; font-size: 11px; opacity: .6; }
.q-t { font-family: "KC Sans", sans-serif; font-weight: 500; font-size: clamp(22px, 2.5vw, 40px); line-height: 1.05; letter-spacing: -.03em; text-wrap: balance; }
.q-d { margin-top: 6px; font-family: "KC Mono", monospace; font-size: 11px; line-height: 1.4; text-transform: uppercase; opacity: .7; }
.q-list li.has-cert { cursor: zoom-in; }
@media (hover: hover) {
  .q-list li.has-cert .q-t { transition: transform .4s var(--ease-out); }
  .q-list li.has-cert:hover .q-t { transform: translateX(10px); }
}

/* certificate peeking beside the pointer */
.q-peek {
  position: fixed; left: 0; top: 0; z-index: 30; width: 150px; height: 120px; pointer-events: none;
  background: center / contain no-repeat; filter: drop-shadow(0 12px 22px rgba(0,0,0,.28));
  opacity: 0; transition: opacity .25s;
}
.q-peek.on { opacity: 1; }

/* ---------- footer ---------- */
.q-foot {
  position: relative; z-index: 1; display: flex; gap: clamp(24px, 4vw, 56px); align-items: flex-end;
  font-family: "KC Mono", monospace; font-weight: 700; font-size: 10.5px; text-transform: uppercase; letter-spacing: .02em;
}
.q-foot p { margin: 0; display: grid; gap: 3px; }
.q-foot p span { font-weight: 400; opacity: .55; }
.q-foot p { margin-right: auto; }
.q-sound { margin-left: auto; background: none; border: 1px solid currentColor; border-radius: 999px; padding: 6px 12px; color: inherit; font: inherit; cursor: pointer; }

/* ---------- full-screen certificate ---------- */
.q-viewer {
  position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  padding: calc(var(--nav-h) + 10px) 16px max(20px, env(safe-area-inset-bottom));
  background: rgba(24, 20, 17, .9); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  opacity: 0; transition: opacity .3s var(--ease-out); overflow-y: auto; overscroll-behavior: contain;
}
.q-viewer.open { opacity: 1; }
.q-viewer[hidden] { display: none; }
.q-viewer-sheets { display: flex; gap: 16px; justify-content: center; align-items: center; max-width: 100%; }
.q-viewer-sheets img { display: block; max-height: calc(100svh - var(--nav-h) - 110px); max-width: min(100%, 1100px); box-shadow: 0 30px 80px -20px rgba(0,0,0,.6); }
.q-viewer[data-count="2"] .q-viewer-sheets img { max-width: calc(50% - 8px); }
.q-viewer-title { margin: 0; color: #f3eee6; font-family: "KC Serif", "Times New Roman", serif; font-size: 17px; text-align: center; }
.q-viewer-close { position: fixed; top: calc(var(--nav-h) + 4px + env(safe-area-inset-top)); right: var(--gutter); background: none; border: 0; color: #f3eee6; font-family: "KC Mono", monospace; font-size: 12px; cursor: pointer; padding: 8px; }

@media (max-width: 760px) {
  .quals { padding-bottom: 20px; grid-template-rows: auto auto auto 1fr auto; }
  .q-grid { grid-template-columns: 1fr; gap: 8px; align-self: start; }
  .q-reel { height: 36svh; }
  .q-face { font-size: clamp(24px, 8vw, 34px); }
  .q-t { font-size: clamp(20px, 6vw, 26px); }
  .q-foot { margin-top: 28px; flex-wrap: wrap; gap: 16px 24px; }
  .q-viewer[data-count="2"] .q-viewer-sheets { flex-direction: column; }
  .q-viewer[data-count="2"] .q-viewer-sheets img { max-width: 100%; max-height: none; }
  .q-viewer { justify-content: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .q-list li { animation: none; opacity: 1; transform: none; }
}
.quals-page .topbar { mix-blend-mode: normal; color: var(--q-ink); transition: color .9s var(--ease-out); }
