/* ============================================================
   INTELLICAMP — appearance system
   Drawer UI, mood presets, cursor shapes + stackable effects,
   texture, radius, motion levels. Loaded last.
   ============================================================ */

/* radius is driven by the panel slider */
:root { --r: 14; }
:root { --radius: calc(var(--r) * 1px); --radius-lg: calc(var(--r) * 1.6px); }

/* ---------- 1. Launcher tab ---------- */
@keyframes tp-breathe {
  0%, 100% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0.45); }
  60% { box-shadow: 0 0 0 12px rgba(var(--accent-rgb), 0); }
}

.tp__tab {
  position: fixed;
  top: 50%;
  right: 0;
  translate: 0 -50%;
  z-index: 9000;
  width: 44px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 12px 0 0 12px;
  background: var(--glass-2);
  border: 1px solid var(--line);
  border-right: 0;
  color: var(--accent-ink);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  animation: tp-breathe 3.4s ease-out infinite;
  transition: width 0.35s var(--ease), background 0.3s ease;
}

.tp__tab:hover { width: 54px; background: var(--ink-3); }
.tp__tab svg { transition: transform 0.6s var(--ease); }
.tp__tab:hover svg { transform: rotate(90deg); }
body.tp-open .tp__tab { opacity: 0; pointer-events: none; }

/* ---------- 2. Drawer ---------- */
.tp {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 9500;
  width: min(360px, 90vw);
  display: flex;
  flex-direction: column;
  background: var(--ink-2);
  border-left: 1px solid var(--line);
  box-shadow: -30px 0 70px -40px var(--shadow-strong);
  transform: translateX(101%);
  transition: transform 0.5s var(--ease);
  overscroll-behavior: contain;
}

body.tp-open .tp { transform: none; }

/* The page stays fully live while the drawer is open: no dimming and
   no pointer blocking, so every hover animation and true colour is
   visible while you change settings. Click-outside closes via JS. */
.tp__scrim {
  position: fixed;
  inset: 0;
  z-index: 9400;
  pointer-events: none;
  background: none;
}

.tp__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--line-soft);
  flex-shrink: 0;
}

.tp__head h3 {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-ink);
}

.tp__close {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid var(--line);
  color: var(--muted);
  transition: color 0.25s ease, border-color 0.25s ease, transform 0.4s var(--ease);
}

.tp__close:hover { color: var(--accent-ink); border-color: var(--accent-ink); transform: rotate(90deg); }

.tp__body {
  padding: 1.2rem 1.25rem;
  display: grid;
  gap: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.tp__group h4 {
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 0.65rem;
}

.tp__hint {
  font-size: 0.7rem;
  color: var(--muted-3);
  margin-top: 0.5rem;
  line-height: 1.45;
}

/* ---------- 3. Segmented control ---------- */
.tp__seg {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 10px;
  background: var(--ink);
  border: 1px solid var(--line-soft);
}

.tp__seg--wrap {
  grid-auto-flow: row;
  grid-template-columns: repeat(4, 1fr);
}

.tp__seg button {
  padding: 0.5rem 0.25rem;
  border-radius: 7px;
  font-size: 0.72rem;
  font-weight: 600;
  font-family: var(--font-display);
  color: var(--muted);
  transition: background 0.3s var(--ease), color 0.25s ease;
}

.tp__seg button:hover { color: var(--paper); }
.tp__seg button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.tp__seg--icons button { font-size: 0.95rem; line-height: 1.1; padding: 0.5rem 0.2rem; }

/* ---------- 4. Moods ---------- */
.tp__moods { display: grid; gap: 6px; }

.tp__mood {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--ink);
  text-align: left;
  transition: border-color 0.3s ease, transform 0.35s var(--ease), background 0.3s ease;
}

.tp__mood:hover { border-color: var(--line); transform: translateX(3px); }
.tp__mood[aria-pressed="true"] { border-color: var(--accent-ink); background: var(--ink-3); }

.tp__dots { display: flex; flex-shrink: 0; }

.tp__dots i {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  margin-right: -4px;
  box-shadow: 0 0 0 1.5px var(--ink);
}

.tp__mood b {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--paper);
  flex: 1;
}

.tp__mood em {
  font-style: normal;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-3);
}

.tp__mood--save { justify-content: center; color: var(--accent-ink); font-size: 0.78rem; font-weight: 600; }

/* ---------- 5. Swatches ---------- */
.tp__swatches { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.tp__sw {
  width: 29px;
  height: 29px;
  border-radius: 50%;
  background: var(--sw);
  border: 2px solid transparent;
  box-shadow: 0 0 0 1px var(--line);
  transition: transform 0.35s var(--ease), box-shadow 0.3s ease;
}

.tp__sw:hover { transform: scale(1.16); }

.tp__sw[aria-pressed="true"] {
  border-color: var(--ink-2);
  box-shadow: 0 0 0 2px var(--sw);
  transform: scale(1.12);
}

.tp__custom {
  position: relative;
  width: 29px;
  height: 29px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 0 0 1px var(--line);
  background: conic-gradient(#ff7a59, #ffd166, #c6f24e, #6ee7f0, #8b5cf6, #ff9ecd, #ff7a59);
  transition: transform 0.35s var(--ease);
}

.tp__custom:hover { transform: scale(1.16); }

.tp__custom input {
  position: absolute;
  inset: -8px;
  width: calc(100% + 16px);
  height: calc(100% + 16px);
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
  opacity: 0;
}

/* ---------- 6. Toggle rows ---------- */
.tp__checks { display: grid; gap: 4px; }

.tp__check {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.48rem 0.6rem;
  border-radius: 9px;
  font-size: 0.78rem;
  color: var(--muted);
  border: 1px solid transparent;
  text-align: left;
  transition: color 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.tp__check:hover { color: var(--paper); background: var(--ink); }

.tp__box {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  border-radius: 5px;
  border: 1.5px solid var(--line);
  display: grid;
  place-items: center;
  transition: background 0.25s ease, border-color 0.25s ease;
}

.tp__box::after {
  content: "";
  width: 8px;
  height: 4px;
  border-left: 2px solid var(--on-accent);
  border-bottom: 2px solid var(--on-accent);
  transform: rotate(-45deg) scale(0);
  transition: transform 0.3s var(--ease);
  margin-top: -2px;
}

.tp__check[aria-pressed="true"] { color: var(--paper); }
.tp__check[aria-pressed="true"] .tp__box { background: var(--accent); border-color: var(--accent); }
.tp__check[aria-pressed="true"] .tp__box::after { transform: rotate(-45deg) scale(1); }

/* ---------- 7. Range ---------- */
.tp__range { display: flex; align-items: center; gap: 0.7rem; }

.tp__range input {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 3px;
  border-radius: 2px;
  background: var(--line);
  cursor: pointer;
}

.tp__range input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--accent);
  border: 0;
  cursor: pointer;
}

.tp__range input::-moz-range-thumb {
  width: 15px;
  height: 15px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}

.tp__range output {
  font-family: var(--font-display);
  font-size: 0.72rem;
  color: var(--muted);
  min-width: 34px;
  text-align: right;
}

/* ---------- 8. Footer ---------- */
.tp__foot {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 0.9rem 1.25rem;
  border-top: 1px solid var(--line-soft);
  flex-shrink: 0;
}

.tp__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 0.9rem;
  border-radius: 9px;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid var(--line);
  color: var(--paper);
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.tp__btn--primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.tp__btn:hover { border-color: var(--accent-ink); color: var(--accent-ink); }
.tp__btn--primary:hover { background: transparent; }

.tp__toast {
  position: absolute;
  left: 50%;
  bottom: 78px;
  translate: -50% 0;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 0.73rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, translate 0.4s var(--ease);
}

.tp__toast.show { opacity: 1; translate: -50% -6px; }

/* ---------- 9. Cursor: base shapes ---------- */
.cur,
.cur__dot {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 99998;
  border-radius: 50%;
  will-change: transform;
}

.cur {
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  border: 1.5px solid var(--cursor-c);
  transition: width 0.3s var(--ease), height 0.3s var(--ease),
    margin 0.3s var(--ease), background 0.3s var(--ease), opacity 0.25s ease;
}

.cur__dot {
  width: 5px;
  height: 5px;
  margin: -2.5px 0 0 -2.5px;
  background: var(--cursor-c);
}

body.cursor-grow .cur {
  width: 74px;
  height: 74px;
  margin: -37px 0 0 -37px;
  background: rgba(var(--cursor-rgb), 0.14);
}

:root[data-cursor="dot"] .cur { opacity: 0; }
:root[data-cursor="dot"] .cur__dot { width: 16px; height: 16px; margin: -8px 0 0 -8px; }

:root[data-cursor="square"] .cur { border-radius: 4px; }
:root[data-cursor="square"] .cur__dot { border-radius: 1px; }

:root[data-cursor="cross"] .cur {
  border: 0;
  border-radius: 0;
  width: 26px;
  height: 26px;
  margin: -13px 0 0 -13px;
  background:
    linear-gradient(var(--cursor-c), var(--cursor-c)) center/100% 1.5px no-repeat,
    linear-gradient(var(--cursor-c), var(--cursor-c)) center/1.5px 100% no-repeat;
}

:root[data-cursor="cross"] .cur__dot { opacity: 0; }

:root[data-cursor="blob"] .cur {
  border: 0;
  width: 58px;
  height: 58px;
  margin: -29px 0 0 -29px;
  background: radial-gradient(circle, rgba(var(--cursor-rgb), 0.55), transparent 70%);
  filter: blur(6px);
}

:root[data-cursor="blob"] .cur__dot { opacity: 0; }

:root[data-cursor="lens"] .cur {
  width: 62px;
  height: 62px;
  margin: -31px 0 0 -31px;
  border-width: 2px;
  -webkit-backdrop-filter: invert(1) hue-rotate(180deg);
  backdrop-filter: invert(1) hue-rotate(180deg);
}

:root[data-cursor="lens"] .cur__dot { opacity: 0; }

:root[data-cursor="native"] .cur,
:root[data-cursor="native"] .cur__dot,
:root[data-cursor="native"] .cur__trail,
:root[data-cursor="native"] .cur__label { display: none; }

/* ---------- 10. Cursor: stackable effects ---------- */
.cur__trail i {
  position: fixed;
  top: 0;
  left: 0;
  width: 7px;
  height: 7px;
  margin: -3.5px 0 0 -3.5px;
  border-radius: 50%;
  background: var(--cursor-c);
  pointer-events: none;
  z-index: 99997;
  will-change: transform, opacity;
}

.cur__trail { display: none; }
body.fx-trail .cur__trail { display: block; }

body.fx-glow .cur {
  box-shadow: 0 0 22px 6px rgba(var(--cursor-rgb), 0.35);
}

body.fx-invert .cur,
body.fx-invert .cur__dot { mix-blend-mode: difference; }

.cur-ripple {
  position: fixed;
  top: 0;
  left: 0;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border-radius: 50%;
  border: 2px solid var(--cursor-c);
  pointer-events: none;
  z-index: 99996;
  animation: cur-ripple 0.65s var(--ease) forwards;
}

@keyframes cur-ripple {
  to { transform: scale(4.5); opacity: 0; }
}

.cur__label {
  position: fixed;
  top: 0;
  left: 0;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  background: var(--cursor-c);
  color: var(--on-accent);
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
  pointer-events: none;
  z-index: 99999;
  opacity: 0;
  transform: translate(14px, 14px) scale(0.85);
  transition: opacity 0.25s ease, transform 0.35s var(--ease);
}

.cur__label.show { opacity: 1; transform: translate(14px, 14px) scale(1); }
.cur__label { display: none; }
body.fx-label .cur__label { display: block; }

/* hide every custom layer when the system cursor is chosen */
:root[data-cursor="native"] .cur-ripple { display: none; }

/* ---------- 10b. Cursor companion ---------- */
/* The layer is only shown once a character is picked, so the default
   state costs nothing — no element, no paint, no rAF loop. */
.pet-layer {
  position: fixed;
  inset: 0;
  display: none;
  pointer-events: none;
  z-index: 99995;
}

.pet-layer.is-on { display: block; }

.pet {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  will-change: transform;
}

/* .pet is a zero-size anchor, so this needs a stated size — without one it
   shrink-wraps to nothing and the global `img, svg, video { max-width: 100% }`
   reset in style.css resolves to 100% of zero, collapsing the character. */
.pet__body {
  position: absolute;
  top: 0;
  left: 0;
  width: 58px;
  height: 40px;
  translate: -50% -50%;
  display: block;
  line-height: 0;
  filter: drop-shadow(0 5px 9px rgba(0, 0, 0, 0.45));
  will-change: transform;
}

/* a beat after the pointer stops, the companion eases down a little */
.pet.is-idle .pet__body { transition: filter 0.4s ease; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.35)); }

/* max-width must be cleared explicitly: the reset in style.css would
   otherwise clamp it. overflow stays visible so a wide leg swing or a
   stretch frame can draw outside the box. */
.pet-svg {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  overflow: visible;
}

/* every animated part pivots inside its own box, so the joint sits where
   the limb meets the body rather than at the SVG origin */
.pet-svg .rig,
.pet-svg .pet-tail,
.pet-svg .pet-eye,
.pet-svg .pet-wing { transform-box: fill-box; }

.rig { transform-origin: 50% 100%; }

/* ---- tail ---- */
/* Follow-through: delayed by about a seventh of a beat so it lags the body
   rather than moving in lockstep. That lag is what reads as hand-animated. */
.pet-tail {
  transform-origin: 6% 88%;
  animation: pet-sway calc(var(--gait, 300ms) * 3) ease-in-out infinite;
  animation-delay: calc(var(--gait, 300ms) * 0.14);
}

@keyframes pet-sway {
  0%, 100% { rotate: -13deg; }
  50% { rotate: 15deg; }
}

/* ---- blink ---- */
.pet-eye {
  transform-origin: 50% 50%;
  animation: pet-blink 4.2s ease-in-out infinite;
}

@keyframes pet-blink {
  0%, 92%, 100% { scale: 1 1; }
  96% { scale: 1 0.1; }
}

/* ---- wings ---- */
/* fliers keep beating even while hovering, otherwise they'd drop */
.pet-wing--near,
.pet-wing--far {
  transform-origin: 2% 92%;
  animation: pet-flap var(--gait, 300ms) ease-in-out infinite;
}

.pet-wing--far { animation-delay: -40ms; }

/* Amplitude is per species, injected on the <svg> as --up / --dn. A gull
   sweeps 72° and a hummingbird only 42°, off the same two keyframes. */
@keyframes pet-flap {
  0%, 100% { rotate: calc(var(--up, 62deg) * -1); }
  50% { rotate: var(--dn, 52deg); }
}

/* a butterfly claps shut rather than sweeping, so scale rather than rotate */
.pet-wing--up {
  transform-origin: 50% 100%;
  animation: pet-clap var(--gait, 300ms) ease-in-out infinite;
}

.pet-wing--dn {
  transform-origin: 50% 0%;
  animation: pet-clap var(--gait, 300ms) ease-in-out infinite;
}

/* how far shut the wings clap, per species */
@keyframes pet-clap {
  0%, 100% { scale: 1.08 1.05; }
  50% { scale: var(--sx, 0.6) var(--sy, 0.14); }
}

.pet-mark {
  position: absolute;
  pointer-events: none;
  will-change: transform, opacity;
}

/* a shed wing scale, drifting down and rocking as it falls */
.pet-mark--petal {
  width: 6px;
  height: 8px;
  margin: -4px 0 0 -3px;
  border-radius: 60% 60% 55% 55% / 70% 70% 40% 40%;
  background: rgba(var(--pet-rgb, var(--cursor-rgb)), 0.6);
  animation: pet-petal 1.7s ease-in forwards;
}

@keyframes pet-petal {
  from { transform: rotate(var(--rot, 0deg)) translate(0, 0); opacity: 0.75; }
  50% { transform: rotate(calc(var(--rot, 0deg) + 55deg)) translate(7px, 20px); opacity: 0.45; }
  to { transform: rotate(calc(var(--rot, 0deg) - 40deg)) translate(-5px, 44px); opacity: 0; }
}

.pet-mark--spark {
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: var(--pet-c, var(--cursor-c));
  box-shadow: 0 0 10px 2px rgba(var(--pet-rgb, var(--cursor-rgb)), 0.55);
  animation: pet-spark 1s ease-out forwards;
}

@keyframes pet-spark {
  from { transform: scale(1); opacity: 0.9; }
  to { transform: translateY(-18px) scale(0.2); opacity: 0; }
}

.pet-mark--feather {
  width: 7px;
  height: 12px;
  margin: -6px 0 0 -3.5px;
  border-radius: 60% 60% 60% 60% / 80% 80% 30% 30%;
  background: rgba(var(--pet-rgb, var(--cursor-rgb)), 0.55);
  animation: pet-feather 1.7s ease-in forwards;
}

/* drifts down and rocks side to side, the way a feather actually falls */
@keyframes pet-feather {
  from { transform: rotate(var(--rot, 0deg)) translate(0, 0); opacity: 0.8; }
  50% { transform: rotate(calc(var(--rot, 0deg) + 40deg)) translate(9px, 26px); opacity: 0.5; }
  to { transform: rotate(calc(var(--rot, 0deg) - 30deg)) translate(-7px, 54px); opacity: 0; }
}

/* ---- companion picker ---- */
/* Three across, because eight species need room and four butterflies
   would be indistinguishable as emoji — these are the real drawings. */
.tp__seg--pets {
  display: grid;
  /* must be stated: the base .tp__seg flows by column, which would spill
     these into nine implicit columns and burst the drawer */
  grid-auto-flow: row;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  border-radius: 10px;
  background: var(--ink);
  border: 1px solid var(--line-soft);
}

.tp__seg--pets button {
  display: grid;
  place-items: center;
  min-height: 48px;
  padding: 5px 2px;
  border-radius: 7px;
  font-family: var(--font-display);
  font-size: 0.9rem;
  color: var(--muted);
  transition: background 0.3s var(--ease), color 0.25s ease;
}

.tp__seg--pets button:hover { background: var(--ink-3); }
.tp__seg--pets button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }

.tp__pet-ico { display: block; line-height: 0; }
.tp__pet-ico svg { display: block; width: 44px; height: 30px; max-width: none; overflow: hidden; }

/* Icons are static. A mid-flap pose reads as a broken drawing at 42px, and
   letting the animation run lets a wingtip escape into the next button —
   the drawn silhouette identifies the species perfectly well on its own. */
.tp__pet-ico .pet-wing,
.tp__pet-ico .pet-tail,
.tp__pet-ico .pet-eye { animation: none; }

.tp__checks--tight { margin-top: 6px; }

/* ---------- 11. Texture ---------- */
.tex {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 8000;
  display: none;
}

:root[data-grain="1"] .tex--grain,
:root[data-grid="1"] .tex--grid { display: block; }

@keyframes grain-shift {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-2%, 1%); }
  50% { transform: translate(1%, -2%); }
  75% { transform: translate(2%, 2%); }
}

.tex--grain {
  inset: -6%;
  opacity: 0.055;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain-shift 1.2s steps(3) infinite;
}

.tex--grid {
  opacity: 0.5;
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(90% 70% at 50% 40%, #000 30%, transparent 85%);
  -webkit-mask-image: radial-gradient(90% 70% at 50% 40%, #000 30%, transparent 85%);
}

/* ---------- 12. Motion levels ---------- */
:root[data-motion="reduced"] .orb,
:root[data-motion="reduced"] .hero__glow,
:root[data-motion="reduced"] .tex--grain { animation: none; }

:root[data-motion="reduced"] .card,
:root[data-motion="reduced"] .quote,
:root[data-motion="reduced"] .work__canvas,
:root[data-motion="reduced"] .work__body,
:root[data-motion="reduced"] .wm-l,
:root[data-motion="reduced"] [data-skew] { transform: none !important; }

:root[data-motion="reduced"] [data-reveal] { filter: none !important; }
/* the platform grid's running edge-light is motion, not decoration */
:root[data-motion="reduced"] #platform .edge-light { animation: none !important; }
:root[data-motion="reduced"] .cur__trail { display: none !important; }

/* the companion stays, but stops littering the page */
:root[data-motion="reduced"] .pet-mark { display: none !important; }

:root[data-motion="off"] *,
:root[data-motion="off"] *::before,
:root[data-motion="off"] *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
  transform: none !important;
}

:root[data-motion="off"] [data-reveal] {
  opacity: 1 !important;
  filter: none !important;
  clip-path: none !important;
}

/* the team role wipe and avatar ring are not [data-reveal] themselves, so
   they need naming or they'd stay stuck in their pre-animation state */
:root[data-motion="off"] .person__role { clip-path: none !important; }
:root[data-motion="off"] .person__ring circle { stroke-dashoffset: 0 !important; }

:root[data-motion="off"] .cur,
:root[data-motion="off"] .cur__dot,
:root[data-motion="off"] .cur__trail,
:root[data-motion="off"] .cur__label,
:root[data-motion="off"] .pet-layer { display: none !important; }

:root[data-motion="off"] .char,
:root[data-motion="off"] .reveal-word > i { opacity: 1 !important; }
:root[data-motion="off"] .marquee__track { animation: none !important; }

/* ---------- 13. Small screens ---------- */
@media (max-width: 640px) {
  .tp { width: 100vw; }
  .tp__tab { top: auto; bottom: 84px; }
}

@media (hover: none), (max-width: 1023px) {
  .cur, .cur__dot, .cur__trail, .cur__label, .pet-layer { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  .tp__tab { animation: none; }
  .tex--grain { animation: none; }
}

/* ============================================================
   BUTTON HOVER
   Six treatments, chosen from the appearance drawer and applied
   as data-btnfx on the root. Selectors are :root[data-btnfx] .btn
   so they outrank page-level rules like .svc-hero .btn wherever
   a feature page has its own opinion.
   ============================================================ */

/* shared scaffolding, inert until an effect asks for it */
.btn { position: relative; overflow: hidden; isolation: isolate; }

.btn__roll { display: inline-block; position: relative; overflow: hidden; vertical-align: bottom; line-height: 1.35; }
.btn__roll > span { display: block; transition: transform 0.46s cubic-bezier(0.62, 0.03, 0.2, 1); }
.btn__roll > span:last-child { position: absolute; inset: 0; transform: translateY(105%); }

.btn__ring {
  position: absolute; inset: 0; border-radius: inherit;
  border: 1px solid currentColor; opacity: 0; pointer-events: none; z-index: -1;
}

/* ---------- fill — the original: a solid pane sweeps up ---------- */
:root[data-btnfx="fill"] .btn::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--paper); transform: translateY(101%);
  transition: transform 0.45s var(--ease);
}
:root[data-btnfx="fill"] .btn:hover::after { transform: translateY(0); }
/* the pane is --paper, so the label has to become --ink to be read against it.
   style.css only did this for .btn--ghost; on a solid button the label kept
   --on-accent, which collides with the pane in the light theme (both #0d0f12)
   and again in dark whenever the chosen accent is dark enough that
   --on-accent computes to white. --ink contrasts with --paper by definition. */
:root[data-btnfx="fill"] .btn:hover,
:root[data-btnfx="fill"] .btn--ghost:hover { color: var(--ink); }

/* ---------- roll — the label turns over ---------- */
:root[data-btnfx="roll"] .btn:hover .btn__roll > span:first-child,
:root[data-btnfx="roll"] .btn:focus-visible .btn__roll > span:first-child { transform: translateY(-105%); }
:root[data-btnfx="roll"] .btn:hover .btn__roll > span:last-child,
:root[data-btnfx="roll"] .btn:focus-visible .btn__roll > span:last-child { transform: translateY(0); }
:root[data-btnfx="roll"] .btn::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: -70%; width: 45%;
  z-index: -1; transform: skewX(-20deg);
  background: linear-gradient(90deg, transparent, currentColor, transparent); opacity: 0.2;
  transition: left 0.6s var(--ease-io);
}
:root[data-btnfx="roll"] .btn:hover::before { left: 130%; }

/* ---------- sheen — a light crosses the face, nothing else moves ---------- */
:root[data-btnfx="sheen"] .btn::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: -70%; width: 55%;
  z-index: -1; transform: skewX(-22deg);
  background: linear-gradient(90deg, transparent, currentColor, transparent); opacity: 0.28;
  transition: left 0.7s var(--ease-io);
}
:root[data-btnfx="sheen"] .btn:hover::before { left: 140%; }
:root[data-btnfx="sheen"] .btn:hover { border-color: var(--accent-ink); }

/* ---------- ring — a hoop pushes out of the edge ---------- */
:root[data-btnfx="ring"] .btn { overflow: visible; }
:root[data-btnfx="ring"] .btn:hover .btn__ring { animation: btnfx-ring 0.72s var(--ease) forwards; }
@keyframes btnfx-ring {
  0%   { opacity: 0.55; transform: scale(1); }
  100% { opacity: 0;    transform: scale(1.24); }
}
:root[data-btnfx="ring"] .btn:hover { border-color: var(--accent-ink); }

/* ---------- glow — the button lights from within ---------- */
:root[data-btnfx="glow"] .btn { transition: box-shadow 0.4s ease, transform 0.35s var(--ease), border-color 0.35s ease; }
:root[data-btnfx="glow"] .btn:hover {
  box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.55),
              0 0 30px -4px rgba(var(--accent-rgb), 0.65),
              inset 0 0 24px -12px rgba(var(--accent-rgb), 0.95);
  border-color: var(--accent-ink);
}
:root[data-btnfx="glow"] .btn--ghost:hover { background: rgba(var(--accent-rgb), 0.08); }

/* ---------- simple — the default. Colour and border, nothing else.
   Every other treatment on a .btn is switched off here by name: the lift
   from style.css, the arrow nudge, the magnetic pull that feature.js adds
   as .mag, and the roll clone. Only the paint changes. ---------- */
:root[data-btnfx="flat"] .btn::after,
:root[data-btnfx="flat"] .btn::before { display: none; }

:root[data-btnfx="flat"] .btn {
  transition: background-color 0.25s linear, color 0.25s linear,
              border-color 0.3s ease, box-shadow 0.35s ease;
}

/* the spark: a halo and a 1px rim, with the button held completely still */
:root[data-btnfx="flat"] .btn:hover,
:root[data-btnfx="flat"] .btn:focus-visible {
  box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.45),
              0 6px 26px -6px rgba(var(--accent-rgb), 0.6);
}

:root[data-btnfx="flat"] .btn--ghost:hover,
:root[data-btnfx="flat"] .btn--ghost:focus-visible {
  color: var(--paper);
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.07);
}

/* these two outrank .btn:hover (0,2,0) and .mag / .mag:hover (0,1,0 / 0,2,0),
   so no !important is needed to hold the button still */
:root[data-btnfx="flat"] .btn,
:root[data-btnfx="flat"] .btn:hover { transform: none; }
:root[data-btnfx="flat"] .btn svg,
:root[data-btnfx="flat"] .btn:hover svg { transform: none; transition: none; }
:root[data-btnfx="flat"] .btn__roll > span { transition: none; }

/* Solid: the face takes --accent-ink and the label takes --ink. theme.js
   fits --accent-ink to 4.5:1 against --ink for the active theme, so this
   pair is contrast-safe by construction for any accent in any theme.
   The inset ring reads as a border without changing the button's box. */
:root[data-btnfx="flat"] .btn:hover {
  background: var(--accent-ink);
  color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--ink);
}

/* Ghost already carries a real border, so it just changes colour. */
:root[data-btnfx="flat"] .btn--ghost:hover {
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--paper);
  border-color: var(--accent-ink);
  box-shadow: none;
}

@media (prefers-reduced-motion: reduce) {
  .btn__roll > span { transition: none; }
  .btn__roll > span:last-child { display: none; }
  :root[data-btnfx] .btn::before,
  :root[data-btnfx] .btn::after { transition: none; }
  :root[data-btnfx="ring"] .btn { overflow: visible; }
:root[data-btnfx="ring"] .btn:hover .btn__ring { animation: none; }
}

/* style.css defines a global .btn::after fill sweep. It is the "fill"
   option now, so every other choice has to stand it down — otherwise
   the pane sweeps up underneath whichever effect was selected. */
:root[data-btnfx]:not([data-btnfx="fill"]) .btn::after { display: none; }
/* ...and with no pane behind it, .btn--ghost:hover's colour: var(--ink) would
   paint the label in the page background colour. Hold every variant at its own
   resting --btn-fg, which is contrast-checked against the button face already. */
:root[data-btnfx]:not([data-btnfx="fill"]) .btn:hover,
:root[data-btnfx]:not([data-btnfx="fill"]) .btn--ghost:hover { color: var(--btn-fg); }
