/* ============================================================================
 * Fluente — section-bound scroll palettes (tier-2 design layer)
 * ============================================================================
 *
 * Six retokenisation palettes applied to :root via JS when the user scrolls
 * into a section with [data-palette]. The scroll switcher is in
 * /landing/palette-switcher.js; the palette HUD markup is in the landing
 * page template. Both pieces are verbatim from the Aioras_65 design handoff
 * at project/sites/fluente-academy-2026-05-19/site/index.html.
 *
 * Lives under public/ so the colour-boundary gate accepts the palette
 * tier (matches the TreeGenes / treegenes-extras / treegenes-content
 * pattern). The hex values are not product theming surfaces — they ARE
 * the design-time scroll palette tokens.
 * ============================================================================ */

:root[data-pal='parchment'] {
  --navy: #fdfbf7;
  --navy-rich: #f5efe3;
  --navy-card: #ffffff;
  --navy-soft: #faf6ec;
  --navy-line: #e2d8c4;
  --navy-line-2: #cfc2a7;
  --bone: #0d1b2a;
  --bone-dim: #4a5568;
  --bone-mute: #8b7e64;
  --coral: #d85a33;
  --coral-bright: #e8704a;
  --coral-deep: #a8421f;
  --coral-soft: rgb(216 90 51 / 0.1);
  --coral-line: rgb(216 90 51 / 0.32);
  --brass: #8b6a2f;
  --brass-soft: rgb(139 106 47 / 0.1);
}
:root[data-pal='linen'] {
  --navy: #f4f2ec;
  --navy-rich: #ebe7dd;
  --navy-card: #fbfaf6;
  --navy-soft: #f0ede2;
  --navy-line: #d8d2c0;
  --navy-line-2: #c1b89f;
  --bone: #1f252e;
  --bone-dim: #52596a;
  --bone-mute: #7a7263;
  --coral: #b85f3a;
  --coral-bright: #cc7048;
  --coral-deep: #8c4524;
  --coral-soft: rgb(184 95 58 / 0.1);
  --coral-line: rgb(184 95 58 / 0.3);
  --brass: #6e5524;
  --brass-soft: rgb(110 85 36 / 0.1);
}
:root[data-pal='slate'] {
  --navy: #e8eaec;
  --navy-rich: #dddfe3;
  --navy-card: #f2f3f5;
  --navy-soft: #e3e5e8;
  --navy-line: #c4c8cd;
  --navy-line-2: #a8aeb5;
  --bone: #1a2535;
  --bone-dim: #475061;
  --bone-mute: #6f778a;
  --coral: #8b5a3d;
  --coral-bright: #9d6845;
  --coral-deep: #5e3924;
  --coral-soft: rgb(139 90 61 / 0.1);
  --coral-line: rgb(139 90 61 / 0.3);
  --brass: #4a5061;
  --brass-soft: rgb(74 80 97 / 0.1);
}
:root[data-pal='moss'] {
  --navy: #ece9da;
  --navy-rich: #e0ddcb;
  --navy-card: #f6f4e8;
  --navy-soft: #e6e3d1;
  --navy-line: #c9c5af;
  --navy-line-2: #aaa68d;
  --bone: #1f2d24;
  --bone-dim: #4a5849;
  --bone-mute: #7a7e66;
  --coral: #6f8047;
  --coral-bright: #809255;
  --coral-deep: #4d5b2d;
  --coral-soft: rgb(111 128 71 / 0.1);
  --coral-line: rgb(111 128 71 / 0.3);
  --brass: #7c6a2f;
  --brass-soft: rgb(124 106 47 / 0.1);
}
:root[data-pal='dusk'] {
  --navy: #f7ebe0;
  --navy-rich: #efdfce;
  --navy-card: #fcf4eb;
  --navy-soft: #f2e2d1;
  --navy-line: #e0cbb1;
  --navy-line-2: #c8ac8b;
  --bone: #3d1f12;
  --bone-dim: #6e4429;
  --bone-mute: #9c6f4a;
  --coral: #c44a2a;
  --coral-bright: #d8593b;
  --coral-deep: #933417;
  --coral-soft: rgb(196 74 42 / 0.1);
  --coral-line: rgb(196 74 42 / 0.32);
  --brass: #a66a28;
  --brass-soft: rgb(166 106 40 / 0.1);
}
:root[data-pal='oxford'] {
  --navy: #e4dcc4;
  --navy-rich: #d8cfb2;
  --navy-card: #efe8d4;
  --navy-soft: #dbd2ba;
  --navy-line: #bfb496;
  --navy-line-2: #9c9077;
  --bone: #0a1422;
  --bone-dim: #2f3d52;
  --bone-mute: #5c6b7e;
  --coral: #8b6a2f;
  --coral-bright: #a07f3f;
  --coral-deep: #5c461d;
  --coral-soft: rgb(139 106 47 / 0.1);
  --coral-line: rgb(139 106 47 / 0.3);
  --brass: #8b6a2f;
  --brass-soft: rgb(139 106 47 / 0.12);
}

/* Smooth retokenisation across palette switches */
html {
  transition: background-color 700ms ease;
}
body,
section,
div,
span,
p,
h1,
h2,
h3,
h4,
button,
a,
input,
pre,
nav,
article,
aside,
header,
footer {
  transition:
    background-color 700ms ease,
    border-color 700ms ease,
    color 500ms ease;
}

/* === Palette HUD (fixed bottom-right) =========================== */
.pal-hud {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 200;
  background: color-mix(in srgb, var(--navy-card) 92%, transparent);
  border: 1px solid var(--navy-line-2);
  padding: 10px 12px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
  box-shadow: 0 10px 28px rgb(13 27 42 / 0.18);
  font-family: var(--mono);
}
.pal-hud .swatch {
  display: flex;
  gap: 0;
  height: 22px;
  width: 56px;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--navy-line);
}
.pal-hud .swatch span {
  flex: 1;
  transition: background 700ms ease;
}
.pal-hud .info {
  flex: 1;
  min-width: 0;
}
.pal-hud .lbl {
  font-size: 9px;
  color: var(--bone-mute);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1;
  margin-bottom: 3px;
}
.pal-hud .name {
  font-family: var(--serif);
  font-size: 14px;
  color: var(--bone);
  font-style: italic;
  line-height: 1.1;
}
.pal-hud .lock {
  background: transparent;
  border: 1px solid var(--navy-line-2);
  color: var(--bone-dim);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 5px 9px;
  cursor: pointer;
  flex-shrink: 0;
  transition:
    color 120ms,
    border-color 120ms;
}
.pal-hud .lock:hover,
.pal-hud .lock.locked {
  color: var(--coral);
  border-color: var(--coral);
}
@media (max-width: 720px) {
  .pal-hud {
    display: none;
  }
}
