/*
  Siragusa HQ — the Study tools page (/study-tools/). Loaded only by that page, after site.css.
  Colours only through the tokens in tokens.css (BD-003). Type: Newsreader and Archivo (BD-004).
  Motion (BD-005e, draft until both founders agree): the home page's network behind the whole page
  (body.hq-hf, site.css and home-field.js) and the study pages' mind drawing beside the opening text, where
  /courses/ has its bulb (study-mind.js). One Pause motion control, fixed to the screen (study-tools.js).
  The drawing is Grok's, traced by Siragusa HQ (R-0010); its credit line is at the foot of the page.
*/

/* ---------- Hero ---------- */
.hq-sx-hero {
  position: relative;
  isolation: isolate;
  padding: clamp(36px, 6vw, 72px) 0 clamp(56px, 7vw, 96px);
  overflow: hidden;
}
.hq-sx-hero::before {
  content: "";
  position: absolute;
  inset: 22% -24% -12% 6%;
  z-index: -1;
  background:
    radial-gradient(44% 42% at 58% 58%, rgb(var(--hq-violet-rgb) / 0.2), transparent 72%),
    radial-gradient(26% 30% at 90% 86%, rgb(var(--hq-blue-rgb) / 0.16), transparent 70%);
}
.hq-sx-hero__text { max-width: 780px; }
.hq-sx-title {
  margin: 20px 0 0;
  font-family: var(--hq-font-display);
  font-weight: 350;
  font-size: clamp(2.7rem, 1.05rem + 5.2vw, 6rem);
  line-height: 0.98;
  letter-spacing: -0.024em;
  max-width: 12ch;
  text-wrap: balance;
}
.hq-sx-hero .hq-pagehead__lede { max-width: 58ch; margin-top: 26px; }

/* ---------- The mind drawing beside the opening text ----------
   The same drawing, lighting and sparks as the study pages' mastheads (BD-005d, D-049). These rules mirror
   the .st-mind rules in study.css, which this page doesn't load; keep the two in step. From 900 px it stands
   in the free space right of the text, centred on it, as the bulb does on /courses/. Below 900 px it's the
   study pages' faint image behind the words, its core placed in clear space by the script. */
.hq-sx-head { position: relative; isolation: isolate; --text-w: min(620px, calc(100% - 270px)); }
.hq-sx-mind { position: absolute; z-index: -1; pointer-events: none; aspect-ratio: 1204 / 1004; }
.hq-sx-mind .st-mind__art { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.hq-sx-mind .st-mind__fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hq-sx-mind .m-glow { stroke: var(--hq-warm); stroke-width: 14; opacity: 0.045; }
.hq-sx-mind .m-line { stroke: var(--hq-light); stroke-width: 3.2; opacity: 0.62; }
.hq-sx-mind .m-litglow { stroke: var(--hq-warm); stroke-width: 16; opacity: 0.13; }
.hq-sx-mind .m-lit { stroke: var(--hq-warm); stroke-width: 4.2; opacity: 0.95; }
.hq-sx-mind .m-node { fill-opacity: 0.85; }
.hq-sx-mind .m-blue { fill: var(--hq-signal-blue); }
.hq-sx-mind .m-violet { fill: var(--hq-signal-violet); }
.hq-sx-mind .m-warm { fill: var(--hq-warm); fill-opacity: 0.95; }
.hq-sx-mind .m-core, .hq-sx-mind .m-halo1, .hq-sx-mind .m-halo2 { fill: var(--hq-coral); }
.hq-sx-mind .m-halo1 { fill-opacity: 0.22; }
.hq-sx-mind .m-halo2 { fill-opacity: 0.14; }
.hq-sx-mind .m-ray { stroke: var(--hq-warm); stroke-width: 3.4; stroke-opacity: 0.75; }
.hq-sx-mind .m-spark { fill: var(--hq-light); fill-opacity: 0.8; }
@media (min-width: 900px) {
  .hq-sx-head .hq-sx-hero__text { max-width: var(--text-w); }
  .hq-sx-mind {
    --mind-w: clamp(220px, calc(100% - var(--text-w) - 60px), 430px);
    left: calc(var(--text-w) + 40px + (100% - var(--text-w) - 40px - var(--mind-w)) / 2);
    top: 50%;
    width: var(--mind-w);
    transform: translateY(-50%);
  }
}
@media (max-width: 899.98px) {
  .hq-sx-mind { left: var(--mind-x, 54%); top: var(--mind-y, 24%); width: 46%; }
  .hq-sx-mind .m-body { opacity: 0.36; }
  .hq-sx-mind .m-corewrap { opacity: 0.8; }
  .hq-sx-mind.no-core .m-corewrap { display: none; }
}
/* Once per visit (shared with the study pages), about 3 seconds: the outline fades in, the pathway lights
   toward the core, then the core blooms. The last frame is the still. */
.hq-sx-mind.is-lighting .st-mind__art { will-change: opacity; animation: hq-sx-mind-fade 500ms var(--hq-ease-standard) both; }
.hq-sx-mind.is-lighting .m-lit path { stroke-dasharray: 1; animation: hq-sx-mind-trace 650ms var(--hq-ease-standard) both; }
.hq-sx-mind.is-lighting .m-litglow path { animation: hq-sx-mind-fade 650ms var(--hq-ease-standard) both; }
.hq-sx-mind.is-lighting .m-warm { animation: hq-sx-mind-node 420ms var(--hq-ease-enter) both; }
.hq-sx-mind.is-lighting .m-body .s1 { animation-delay: 450ms; }
.hq-sx-mind.is-lighting .m-body .s2 { animation-delay: 800ms; }
.hq-sx-mind.is-lighting .m-body .s3 { animation-delay: 1150ms; }
.hq-sx-mind.is-lighting .m-body .s4 { animation-delay: 1500ms; }
.hq-sx-mind.is-lighting .m-body .s5 { animation-delay: 1850ms; }
.hq-sx-mind.is-lighting .m-coreset { animation: hq-sx-mind-fade 500ms var(--hq-ease-standard) 2200ms both; }
.hq-sx-mind.is-lighting .m-halo1,
.hq-sx-mind.is-lighting .m-halo2 { transform-box: fill-box; transform-origin: center; animation: hq-sx-mind-bloom 900ms var(--hq-ease-enter) 2200ms both; }
.hq-sx-mind.is-lighting .m-ray { stroke-dasharray: 1; animation: hq-sx-mind-trace 500ms var(--hq-ease-enter) 2450ms both; }
.hq-sx-mind.is-lighting .m-spark { transform-box: fill-box; transform-origin: center; animation: hq-sx-mind-spark 650ms var(--hq-ease-enter) 2450ms both; }
@keyframes hq-sx-mind-fade { from { opacity: 0; } }
@keyframes hq-sx-mind-trace { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes hq-sx-mind-node { from { opacity: 0.35; fill: var(--hq-light); } }
@keyframes hq-sx-mind-bloom { from { opacity: 0; transform: scale(0.4); } }
@keyframes hq-sx-mind-spark { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) {
  .hq-sx-mind, .hq-sx-mind * { animation: none !important; }
  .hq-sx-mind .st-mind__fx { display: none; }
}
@media print {
  .hq-sx-mind, .hq-hf-field { display: none; }
}

/* The stage: the study area on a computer, with a phone standing in front of it. Positions are
   percentages of the stage width, so the composition keeps its shape at every size. */
.hq-sx-stage {
  position: relative;
  margin-top: clamp(52px, 7vw, 100px);
  padding: 0 5% 17% 0;
}
.hq-sx-desk,
.hq-sx-shot {
  margin: 0;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgb(var(--hq-light-rgb) / 0.15);
  background: var(--hq-base);
  box-shadow:
    0 1px 0 rgb(var(--hq-light-rgb) / 0.06) inset,
    0 40px 90px -36px rgb(0 0 0 / 0.75),
    0 24px 140px -60px rgb(var(--hq-violet-rgb) / 0.55);
}
.hq-sx-desk img,
.hq-sx-shot img { width: 100%; }

/* The address bar: a real address on this site, so the picture says where the tool lives. */
.hq-sx-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 14px;
  border-bottom: 1px solid rgb(var(--hq-light-rgb) / 0.1);
  background: rgb(var(--hq-light-rgb) / 0.045);
  font-size: 0.74rem;
  letter-spacing: 0.02em;
  color: rgb(var(--hq-light-rgb) / 0.62);
  white-space: nowrap;
  overflow: hidden;
}
.hq-sx-bar span { overflow: hidden; text-overflow: ellipsis; }
.hq-sx-lock {
  flex: none;
  width: 10px;
  height: 12px;
}
.hq-sx-lock rect { fill: rgb(var(--hq-warm-rgb) / 0.8); }
.hq-sx-lock path { fill: none; stroke: rgb(var(--hq-warm-rgb) / 0.8); stroke-width: 1.5; }

.hq-sx-phone {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 23%;
  margin: 0;
  padding: 0.75%;
  border-radius: clamp(18px, 2.9vw, 38px);
  background: linear-gradient(155deg,
    rgb(var(--hq-light-rgb) / 0.22) 0%,
    rgb(var(--hq-light-rgb) / 0.06) 38%,
    rgb(var(--hq-light-rgb) / 0.03) 62%,
    rgb(var(--hq-light-rgb) / 0.14) 100%);
  box-shadow:
    0 0 0 1px rgb(var(--hq-light-rgb) / 0.12),
    0 50px 90px -30px rgb(0 0 0 / 0.8),
    0 0 90px -24px rgb(var(--hq-blue-rgb) / 0.4);
}
.hq-sx-phone picture,
.hq-sx-phone img {
  display: block;
  width: 100%;
  border-radius: clamp(14px, 2.3vw, 31px);
}

/* ---------- The sequence ---------- */
.hq-sx-flow__head { display: grid; gap: 22px; max-width: 860px; }
.hq-sx-flow__head .hq-h2 { margin: 0; }
.hq-sx-intro,
.hq-sx-lead {
  margin: 0;
  max-width: 58ch;
  font-size: clamp(1.05rem, 1rem + 0.25vw, 1.18rem);
  line-height: 1.55;
  color: rgb(var(--hq-light-rgb) / 0.84);
}
.hq-sx-steps {
  margin: clamp(40px, 6vw, 72px) 0 0;
  padding: 0;
  list-style: none;
}
.hq-sx-step {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 6vw, 88px);
  align-items: center;
  padding: clamp(44px, 6vw, 84px) 0;
  border-top: 1px solid rgb(var(--hq-light-rgb) / 0.08);
}
.hq-sx-step:last-child { padding-bottom: 0; }
.hq-sx-step:nth-child(even) .hq-sx-step__text { order: 2; }
.hq-sx-step__text { max-width: 48ch; }
.hq-sx-step__text p { margin: 16px 0 0; color: rgb(var(--hq-light-rgb) / 0.82); }

/* When in the course each step happens. Set in the display face, not as another caps label,
   because it reads as a time, not a category. */
.hq-sx-when {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  font-family: var(--hq-font-display);
  font-size: 1.22rem;
  font-weight: 420;
  color: var(--hq-warm);
}
.hq-sx-step__text .hq-sx-when { margin: 0; color: var(--hq-warm); }
.hq-sx-when::before {
  content: "";
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1px solid var(--hq-warm);
  box-shadow: 0 0 0 4px rgb(var(--hq-warm-rgb) / 0.12);
}
.hq-sx-step__title {
  margin: 14px 0 0;
  font-family: var(--hq-font-display);
  font-weight: 400;
  font-size: clamp(1.7rem, 1.2rem + 1.4vw, 2.35rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

/* Two screens from the same step: the main one, and a second standing in front of its corner. */
.hq-sx-pair {
  position: relative;
  padding: 0 0 16% 0;
}
.hq-sx-pair > .hq-sx-shot:first-child { width: 84%; }
.hq-sx-shot--side {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 50%;
  border-color: rgb(var(--hq-light-rgb) / 0.22);
  box-shadow:
    0 0 0 6px rgb(var(--hq-base-rgb) / 0.9),
    0 40px 80px -30px rgb(0 0 0 / 0.85);
}
.hq-sx-step:nth-child(even) .hq-sx-pair > .hq-sx-shot:first-child { margin-left: auto; }
.hq-sx-step:nth-child(even) .hq-sx-shot--side { right: auto; left: 0; }
.hq-sx-caption {
  margin: 18px 0 0;
  font-size: 0.86rem;
  color: rgb(var(--hq-light-rgb) / 0.66);
}

/* ---------- Study areas so far ---------- */
.hq-sx-areas {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 clamp(28px, 4vw, 56px);
  margin: 0;
  padding: 0;
  list-style: none;
}
.hq-sx-area {
  display: grid;
  grid-template-columns: 5.6rem minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  padding: 24px 0;
  border-top: 1px solid rgb(var(--hq-light-rgb) / 0.1);
}
.hq-sx-area__num {
  display: grid;
  gap: 4px;
  margin: 0;
  font-family: var(--hq-font-display);
  font-size: 2.1rem;
  font-weight: 380;
  line-height: 1;
  color: var(--hq-warm);
  font-variant-numeric: lining-nums;
}
.hq-sx-area__kind {
  font-family: var(--hq-font-text);
  font-size: 0.7rem;
  font-weight: 560;
  font-stretch: 115%;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgb(var(--hq-light-rgb) / 0.66);
}
.hq-sx-area__title {
  margin: 2px 0 0;
  font-family: var(--hq-font-display);
  font-size: 1.32rem;
  font-weight: 430;
  line-height: 1.2;
}
.hq-sx-area p:not(.hq-sx-area__num) {
  margin: 8px 0 0;
  font-size: 0.98rem;
  color: rgb(var(--hq-light-rgb) / 0.78);
}
.hq-sx-next { margin-top: 28px; }

/* ---------- Conference sessions ---------- */
.hq-sx-talk {
  background: linear-gradient(180deg, rgb(var(--hq-light-rgb) / 0.02), transparent 70%);
}
.hq-sx-talk__grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(36px, 6vw, 88px);
  align-items: center;
}
.hq-sx-talk__text .hq-sx-lead { margin-top: 22px; }
.hq-sx-talk__list-title { margin: 34px 0 12px; }
.hq-sx-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.hq-sx-list li {
  position: relative;
  padding: 9px 0 9px 20px;
  border-bottom: 1px solid rgb(var(--hq-light-rgb) / 0.08);
  font-size: 0.96rem;
  line-height: 1.4;
  color: rgb(var(--hq-light-rgb) / 0.88);
}
.hq-sx-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: calc(9px + 0.62em);
  width: 9px;
  height: 1px;
  background: var(--hq-warm);
}
.hq-sx-talk .hq-actions { margin-top: 30px; }

/* ---------- For coordinators ---------- */
.hq-sx-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 clamp(28px, 4vw, 52px);
  margin: clamp(36px, 5vw, 56px) 0 0;
}
.hq-sx-facts > div {
  padding: 22px 0 24px;
  border-top: 1px solid rgb(var(--hq-light-rgb) / 0.1);
}
.hq-sx-facts dt {
  font-family: var(--hq-font-display);
  font-size: 1.3rem;
  font-weight: 430;
  line-height: 1.2;
}
.hq-sx-facts dd {
  margin: 10px 0 0;
  font-size: 0.98rem;
  color: rgb(var(--hq-light-rgb) / 0.78);
}
.hq-sx-preview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px 48px;
  align-items: center;
  margin-top: clamp(36px, 5vw, 56px);
}
.hq-sx-preview__title {
  margin: 0;
  font-family: var(--hq-font-display);
  font-size: clamp(1.6rem, 1.2rem + 1.2vw, 2.2rem);
  font-weight: 400;
  line-height: 1.15;
}
.hq-sx-preview p { margin: 10px 0 0; max-width: 52ch; color: rgb(var(--hq-light-rgb) / 0.84); }
.hq-sx-preview__actions { display: grid; justify-items: start; }
.hq-sx-preview__actions .hq-note { margin-top: 12px; max-width: 34ch; font-size: 0.86rem; }
.hq-sx-fine { margin-top: 40px; max-width: 72ch; font-size: 0.84rem; }

/* ---------- Smaller screens ---------- */
@media (max-width: 960px) {
  .hq-sx-step,
  .hq-sx-talk__grid { grid-template-columns: minmax(0, 1fr); }
  .hq-sx-step:nth-child(even) .hq-sx-step__text { order: 0; }
  .hq-sx-step__text,
  .hq-sx-talk__text { max-width: 62ch; }
  .hq-sx-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .hq-sx-areas { grid-template-columns: minmax(0, 1fr); }
  .hq-sx-preview { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  /* On a phone the phone screen is the one people can read, so it grows and the computer recedes. */
  .hq-sx-stage { padding: 0 9% 52% 0; }
  .hq-sx-phone { width: 42%; padding: 1.3%; }
  .hq-sx-bar { height: 28px; font-size: 0.68rem; padding: 0 10px; }
  .hq-sx-pair { padding-bottom: 22%; }
  .hq-sx-pair > .hq-sx-shot:first-child { width: 88%; }
  .hq-sx-shot--side { width: 58%; }
  .hq-sx-facts { grid-template-columns: minmax(0, 1fr); }
  .hq-sx-list { grid-template-columns: minmax(0, 1fr); }
  /* The course number and its kind sit on one line above the title, so a long kind never crowds it. */
  .hq-sx-area { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .hq-sx-area__num { display: flex; align-items: baseline; gap: 12px; font-size: 1.7rem; }
}

/* Windows high contrast and other forced colours: keep the frames visible as plain outlines. */
@media (forced-colors: active) {
  .hq-sx-desk, .hq-sx-shot, .hq-sx-phone { border: 1px solid CanvasText; box-shadow: none; }
  .hq-sx-mind { display: none; }
}
