/* ============================================================
   ADKline.Design — demo-paper-shaders.css
   Page-specific styles for /en/demo-paper-shaders.php

   Deliberately unminified, and self-contained: it repeats the
   demo chrome (stage + dark code window) from demo-web-tech.css
   rather than depending on it, so either page can be edited
   without breaking the other.
   Read it alongside js/demos/demo-paper-shaders.js.
   ============================================================ */


/* ------------------------------------------------------------
   1. Page furniture
   ------------------------------------------------------------ */

/* Deep links from the intro chips land clear of the fixed navbar */
#demo-paper-shaders section[id] {
	scroll-margin-top: 5.5rem;
}

#demo-paper-shaders .badge-teal {
	font-size: 0.95rem;
	padding: 0.55rem 0.95rem;
}

/* main.min.css only defines badge-teal for the light theme */
[data-bs-theme="dark"] #demo-paper-shaders .badge-teal {
	color: #6fd6d0;
	background-color: rgba(111, 214, 208, 0.14);
}

/* Back-pill to the demos listing: the arrow nudges left on hover */
.demo-back .bi-arrow-left {
	display: inline-block;
	transition: translate 0.2s ease;
}

.demo-back:hover .bi-arrow-left {
	translate: -3px 0;
}

/* Bootstrap's range track uses --bs-secondary-bg, which in dark
   mode almost matches the card it sits on. -webkit- and -moz-
   track selectors must stay in separate rules: a browser drops
   the whole rule when it can't parse a selector */
[data-bs-theme="dark"] #demo-paper-shaders .form-range::-webkit-slider-runnable-track {
	background-color: rgba(255, 255, 255, 0.22);
}

[data-bs-theme="dark"] #demo-paper-shaders .form-range::-moz-range-track {
	background-color: rgba(255, 255, 255, 0.22);
}

/* Inline "not supported" notice */
.demo-unsupported {
	font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
	font-size: 0.72rem;
}


/* ------------------------------------------------------------
   2. The shader stage
      ShaderMount prepends its own <canvas> to this element and
      sizes it with a ResizeObserver, so the box only has to
      declare its own dimensions. It stays dark in both themes:
      the heatmap gradient is designed against black.
   ------------------------------------------------------------ */
.heat-stage {
	position: relative;
	aspect-ratio: 4 / 3;
	border: 1px solid var(--bs-border-color);
	border-radius: 0.75rem;
	overflow: hidden;
	background-color: #000;
}

/* Until the shader mounts, a faint pulse stands in for it */
.heat-stage:not([data-paper-shader])::after {
	content: "";
	position: absolute;
	inset: 0;
	background: radial-gradient(ellipse at 50% 60%, #2f63e7 0%, transparent 60%);
	opacity: 0.35;
	animation: heat-wait 2.4s ease-in-out infinite;
}

@keyframes heat-wait {
	50% { opacity: 0.1; }
}

@media (prefers-reduced-motion: reduce) {
	.heat-stage:not([data-paper-shader])::after {
		animation: none;
	}
}


/* ------------------------------------------------------------
   3. Preset / reset pills
   ------------------------------------------------------------ */
.heat-preset {
	border: 1px solid var(--bs-border-color);
	border-radius: 999px;
	padding: 0.3rem 0.9rem;
	background-color: transparent;
	color: var(--bs-body-color);
	font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
	font-size: 0.72rem;
	transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.heat-preset:hover {
	border-color: #2A5F62;
	color: #2A5F62;
}

.heat-preset.active {
	border-color: #2A5F62;
	background-color: #2A5F62;
	color: #fff;
}

[data-bs-theme="dark"] .heat-preset:hover {
	border-color: #6fd6d0;
	color: #6fd6d0;
}

[data-bs-theme="dark"] .heat-preset.active {
	border-color: #6fd6d0;
	background-color: rgba(111, 214, 208, 0.18);
	color: #6fd6d0;
}


/* ------------------------------------------------------------
   4. Uniform controls
      Three fieldsets side by side on wide screens, stacked
      below. Each one is a plain flex column of labelled ranges.
   ------------------------------------------------------------ */
.heat-controls {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
	gap: 1.75rem 2.25rem;
}

.heat-group {
	min-width: 0;   /* let the grid track shrink below content width */
	border: 0;
	margin: 0;
	padding: 0;
}

.heat-group legend {
	float: none;     /* Bootstrap Reboot makes legends full-width floats */
	width: auto;
	margin-bottom: 0.9rem;
	padding: 0;
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: #2A5F62;
}

[data-bs-theme="dark"] .heat-group legend {
	color: #6fd6d0;
}

.heat-ctl {
	margin-bottom: 0.75rem;
}

.heat-ctl label {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.5rem;
	margin-bottom: 0.15rem;
	font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
	font-size: 0.72rem;
	color: var(--bs-secondary-color);
}

.heat-ctl output {
	font-weight: 700;
	color: var(--bs-body-color);
	font-variant-numeric: tabular-nums;
}

.heat-ctl .form-range {
	height: 1.1rem;
}

.heat-ctl .form-select {
	font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
	font-size: 0.75rem;
}


/* ------------------------------------------------------------
   5. Gradient stops
      One row per colour: a native swatch, its hex, and a remove
      button. The list is rebuilt by the JS whenever it changes.
   ------------------------------------------------------------ */
.heat-colors {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}

.heat-swatch {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.heat-swatch .form-control-color {
	flex: 0 0 auto;
	width: 2.1rem;
	height: 1.7rem;
	padding: 0.15rem;
}

.heat-swatch code {
	flex: 1 1 auto;
	font-size: 0.72rem;
	color: var(--bs-secondary-color);
}

.heat-swatch .heat-color-drop {
	flex: 0 0 auto;
	border: 0;
	border-radius: 0.3rem;
	padding: 0 0.35rem;
	line-height: 1.4;
	background-color: transparent;
	color: var(--bs-secondary-color);
	font-size: 0.8rem;
}

.heat-swatch .heat-color-drop:hover:not(:disabled) {
	background-color: rgba(220, 53, 69, 0.12);
	color: #dc3545;
}

.heat-swatch .heat-color-drop:disabled {
	opacity: 0.25;
}


/* ------------------------------------------------------------
   6. The code window
      Always dark, in both site themes, the way an editor would
      be. Its body is written by the JS on every change.
   ------------------------------------------------------------ */
.demo-code {
	display: flex;
	flex-direction: column;
	height: 100%;
	border: 1px solid rgba(255, 255, 255, 0.09);
	border-radius: 0.75rem;
	overflow: hidden;
	background-color: #1c2128;
	font-size: 0.78rem;
}

.demo-code-header {
	display: flex;
	align-items: center;
	gap: 0.7rem;
	padding: 0.55rem 1rem;
	background-color: #14181d;
	border-bottom: 1px solid rgba(255, 255, 255, 0.07);
	font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
	font-size: 0.68rem;
	letter-spacing: 0.06em;
	color: #8b949e;
}

/* Faux window buttons */
.demo-code-dots {
	display: inline-flex;
	gap: 0.35rem;
}

.demo-code-dots i {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background-color: #444c56;
}

.demo-code-dots i:nth-child(1) { background-color: #e5534b; }
.demo-code-dots i:nth-child(2) { background-color: #d4a72c; }
.demo-code-dots i:nth-child(3) { background-color: #57ab5a; }

.demo-code-copy {
	margin-left: auto;
	border: 1px solid rgba(255, 255, 255, 0.14);
	border-radius: 0.3rem;
	padding: 0.1rem 0.5rem;
	background-color: transparent;
	color: #8b949e;
	font-family: inherit;
	font-size: 0.65rem;
	letter-spacing: 0.06em;
	transition: color 0.15s ease, border-color 0.15s ease;
}

.demo-code-copy:hover {
	border-color: #6fd6d0;
	color: #6fd6d0;
}

.demo-code pre {
	flex: 1;
	margin: 0;
	padding: 1rem 1.1rem;
	overflow: auto;
	max-height: 460px;
	color: #adbac7;
	font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
	font-size: inherit;
	line-height: 1.65;
	tab-size: 2;
}

.demo-code pre code {
	color: inherit;
	font-family: inherit;
	white-space: pre;
}

/* Minimal hand-rolled token colours (GitHub-dark-ish) */
.demo-code .tok-c { color: #768390; font-style: italic; }  /* comment  */
.demo-code .tok-p { color: #6cb6ff; }                      /* property */
.demo-code .tok-k { color: #f47067; }                      /* keyword  */
.demo-code .tok-s { color: #96d0ff; }                      /* string   */
.demo-code .tok-f { color: #dcbdfb; }                      /* function */

/* Values the JS rewrites while you interact */
.demo-code .live {
	color: #6fd6d0;
	font-weight: 700;
	border-radius: 0.25em;
}

.demo-code .live.flash {
	animation: demo-live-flash 0.7s ease-out;
}

@keyframes demo-live-flash {
	from { background-color: rgba(111, 214, 208, 0.35); }
	to   { background-color: transparent; }
}

@media (prefers-reduced-motion: reduce) {
	.demo-code .live.flash {
		animation: none;
	}
}
