/* Trigonometric Functions: the chapter's content palette and scene styles (the kit is assets/xp/xp.css).
   Colour is only for the figure: each function owns one colour, the same as in the lite chapter's graphs
   (cos amber, sin blue, tan green, sec rose), so a segment, its wave and its swatch always match. Type stays bone. */
:root {
  --xp-cos: #e9b44c;    /* cos x: the shadow across */
  --xp-sin: #6fb3ef;    /* sin x: the shadow up */
  --xp-tan: #7cc68f;    /* tan x: along the touching line */
  --xp-sec: #ec8aa0;    /* sec x: the cutting line */
  --xp-cot: #5fc9c4;    /* cot x */
  --xp-csc: #b49cf5;    /* cosec x */
  --xp-rope: #e2785a;   /* the turn, and radians as rope */
  --xp-arc: #f2dca6;    /* the arc walked by P */
}

/* swatches beside neutral words: <i class="xs-sw" style="--c:var(--xp-sin)"></i>sin x */
.mx-sw { display: inline-block; width: 18px; height: 3px; border-radius: 2px; background: var(--c); vertical-align: middle; margin: 0 8px 2px 0; }

/* ---------- the proof stage: a pinned circle with an equation that builds under it ----------
   <section class="xp-scene xp-full xs-scrub mx-proof" data-scene="math1103-circle" data-keys="…" data-len="320">
     <div class="xp-stick"><div class="xp-canvas"></div><div class="xs-stagehead">…</div>
       <div class="mx-eq"><span class="mx-t" data-at=".2,2" data-seg="cos"><span>\( \cos^2 x \)</span><small>OM²</small></span> …</div>
       <div class="xp-cap" data-at="…">…</div></div></section>
   Each term is dim until its window, then bone; the circle lights the segments named in its data-seg.            */
.mx-proof .xp-canvas { position: absolute; left: 0; right: 0; top: calc(var(--xp-bar) + 118px); bottom: 34svh; height: auto; }
.mx-eq { position: absolute; z-index: 3; left: var(--xp-g); right: var(--xp-g); bottom: calc(clamp(24px, 6svh, 64px) + 78px); display: flex; flex-wrap: wrap; align-items: flex-start; gap: 4px 12px; font-size: clamp(1.35rem, 6vw, 2.6rem); line-height: 1.15; color: var(--bone); }
.mx-t { display: inline-grid; justify-items: center; gap: 6px; opacity: .2; transition: opacity .45s var(--xp-out); }
.mx-t.on { opacity: 1; }
.mx-t > small { font-size: 13px; line-height: 1.2; letter-spacing: .12em; text-transform: uppercase; color: var(--mix-3); font-weight: 500; white-space: nowrap; }
.mx-t > small .o { text-transform: none; letter-spacing: 0; }
.mx-t.op > small { visibility: hidden; }
.mx-proof .xp-cap { bottom: clamp(24px, 6svh, 64px); }
@media (min-width: 900px) {
  .mx-proof .xp-canvas { top: 0; bottom: 0; left: 38%; width: auto; height: auto; }
  .mx-eq { left: calc(var(--xp-g) + var(--xp-col) * .3); right: auto; max-width: 40%; bottom: auto; top: 46svh; }
  .mx-proof .xp-cap { left: calc(var(--xp-g) + var(--xp-col) * .3); max-width: 36%; }
  .mx-proof .xs-stagehead { right: auto; max-width: 40%; left: calc(var(--xp-g) + var(--xp-col) * .3); }
}
html.xp-reduced .mx-proof .xp-canvas, html:not(.xp-js) .mx-proof .xp-canvas { position: relative; top: auto; bottom: auto; height: 62svh; }
html.xp-reduced .mx-eq, html:not(.xp-js) .mx-eq { position: relative; inset: auto; margin: 12px var(--xp-g); max-width: none; }
html.xp-reduced .mx-t, html:not(.xp-js) .mx-t { opacity: 1; }

/* a circle module used as a plain figure inside a section (not pinned): it runs while it passes */
.mx-fig { position: relative; width: 100%; aspect-ratio: 1 / 1; max-height: 48svh; }
.mx-fig.wide { aspect-ratio: 16 / 9; }
.mx-fig > .xp-canvas { position: absolute; inset: 0; }
@media (max-width: 899px) { .mx-fig { max-height: 42svh; margin-inline: auto; } }

/* a picture-proof: a small sketch beside the lines of a derivation, each line pointing at its part */
.mx-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; counter-reset: mx; }
.mx-steps > li { counter-increment: mx; display: grid; grid-template-columns: 28px 1fr; gap: 0 10px; align-items: baseline; padding: 10px 0; border-top: 1px solid var(--hairline); font-size: var(--fs-read); line-height: 1.5; }
.mx-steps > li::before { content: counter(mx, decimal-leading-zero); font-size: 13px; letter-spacing: .1em; color: var(--mix-3); font-variant-numeric: tabular-nums; }
.mx-steps > li > small { grid-column: 2; display: block; font-size: 14px; color: var(--mix-3); margin-top: 2px; }

/* the hub's history rows sit a little higher on phones, under the circle */
@media (max-width: 899px) { .xp-hub .xp-model { height: 11.5rem; } }
/* "Trigonometric" is one long word: the hub title steps down so it never runs off a phone */
.xp-hub .xp-hub-title .xp-display { font-size: clamp(2.6rem, 12.6vw, 10.5rem); max-width: none; }
.xp-open .xp-display { overflow-wrap: anywhere; }

/* a circle scene inside a section's visual: the canvas fills its box */
[data-scene^="math1103"] > .xp-canvas { position: absolute; inset: 0; }
.xs-hero > .xs-vis[data-scene^="math1103"] { opacity: .9; }
/* a degree counter beside a pinned turn */
.mx-deg { position: absolute; z-index: 3; right: var(--xp-g); top: calc(var(--xp-bar) + 118px); margin: 0; font-size: clamp(2.4rem, 11vw, 5.5rem); line-height: 1; letter-spacing: -0.04em; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--bone); }
.mx-deg::after { content: "°"; }
@media (min-width: 900px) { .mx-deg { right: auto; left: calc(var(--xp-g) + var(--xp-col) * .3); top: 40svh; } }
html.xp-reduced .mx-deg, html:not(.xp-js) .mx-deg { position: relative; inset: auto; margin: 8px var(--xp-g); }

/* callouts pinned to the circle in a proof stage share the canvas's box (worker B) */
.mx-proof > .xp-stick > .xa-layer { top: calc(var(--xp-bar) + 118px); bottom: 34svh; }
@media (min-width: 900px) { .mx-proof > .xp-stick > .xa-layer { top: 0; bottom: 0; left: 38%; } }
html.xp-reduced .mx-proof > .xp-stick > .xa-layer, html:not(.xp-js) .mx-proof > .xp-stick > .xa-layer { display: none; }

/* maths terms are long: an equation term never breaks inside, and on phones its label goes under it */
.xs-eqrow > .xs-term > span:first-child .katex { white-space: nowrap; }
@media (max-width: 899px) {
  .xs-eqrow > .xs-term { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .xs-eqrow > .xs-term > .xs-tlab { padding-left: 14px; }
}
/* beside a big symbol a bar reads as a minus sign: there the swatch is a dot */
.xs-spec-sym .mx-sw { width: 12px; height: 12px; border-radius: 50%; margin: 0 10px 4px 0; }
