html[data-direction] {
  color-scheme: dark;
  --direction-ground: #08090a;
  --direction-surface: #111317;
  --direction-ink: #f1f0ee;
  --direction-muted: #b7b8bd;
  --direction-accent: #c7efe4;
  --thread-start: #a3dcd1;
  --thread-end: #e4ba9b;
  --direction-glow: #1b302d;
  --direction-hero: url("./directions/filament.webp");
  --field-cool: #315257;
  --field-warm: #5d4439;
  --field-image-opacity: .48;
  --field-blur: 19px;
}

html[data-direction="french-touch"] {
  --direction-ground: #141116;
  --direction-surface: #201a24;
  --direction-ink: #f4eef2;
  --direction-muted: #c8bdc8;
  --direction-accent: #ecc0e1;
  --thread-start: #edbbdf;
  --thread-end: #dfc69f;
  --direction-glow: #322134;
  --direction-hero: url("./directions/french-touch.webp");
  --direction-font: "VLGE Amp", "Archivo", var(--c-font-sans);
  --field-cool: #394541;
  --field-warm: #664757;
  --field-image-opacity: .32;
  --field-blur: 38px;
}

html[data-direction="thermal"] {
  --direction-ground: #121222;
  --direction-surface: #201f39;
  --direction-ink: #f3f1ff;
  --direction-muted: #cbc8e8;
  --direction-accent: #c6bcff;
  --thread-start: #c6bcff;
  --thread-end: #d3e99e;
  --direction-glow: #30295f;
  --direction-hero: url("./directions/thermal.webp");
  --field-cool: #304b6c;
  --field-warm: #544179;
  --field-image-opacity: .53;
  --field-blur: 21px;
}

html[data-direction="airbrush"] {
  --direction-ground: #11182a;
  --direction-surface: #1c2539;
  --direction-ink: #f7f2f5;
  --direction-muted: #c7ccdf;
  --direction-accent: #ffc2a0;
  --thread-start: #b4d9f4;
  --thread-end: #ffae83;
  --direction-glow: #422d47;
  --direction-hero: url("./directions/airbrush.webp");
  --field-cool: #354e73;
  --field-warm: #734153;
  --field-image-opacity: .52;
  --field-blur: 30px;
}

html[data-direction="pulse"] {
  color-scheme: light;
  --direction-ground: #f3eee4;
  --direction-surface: #fffbf3;
  --direction-ink: #201815;
  --direction-muted: #64524a;
  --direction-accent: #a22316;
  --thread-start: #a22316;
  --thread-end: #784527;
  --direction-glow: #e7d5c8;
  --direction-hero: url("./directions/pulse.webp");
  --field-cool: #f9e7d8;
  --field-warm: #eeb5a1;
  --field-image-opacity: .23;
  --field-blur: 34px;
  --field-blend: multiply;
}

html[data-direction="spectrum"] {
  --direction-ground: #080911;
  --direction-surface: #131524;
  --direction-ink: #f5f4fb;
  --direction-muted: #bdc1db;
  --direction-accent: #aabaff;
  --thread-start: #aabaff;
  --thread-end: #f1ae92;
  --direction-glow: #1d2040;
  --direction-hero: url("./directions/spectrum.webp");
  --field-cool: #354475;
  --field-warm: #663950;
  --field-image-opacity: .51;
  --field-blur: 15px;
}

/* Bridge the art direction to the same roles used by the website components. */
html[data-direction] .vds[data-product="vlge-web"] {
  --nav-item-radius: var(--c-radius-s);
}

html[data-direction] .vds,
html[data-direction] .vds :is(.tone-light, .tone-dark) {
  --s-ground: var(--direction-ground);
  --s-surface: var(--direction-surface);
  --s-text: var(--direction-ink);
  --s-text-muted: var(--direction-muted);
  --s-text-faint: var(--direction-muted);
  --bg: var(--s-ground);
  --bg-2: var(--s-surface);
  --bg-3: color-mix(in srgb, var(--s-surface) 75%, var(--s-ground));
  --bg-4: color-mix(in srgb, var(--s-text) 8%, var(--s-surface));
  --accent: color-mix(in srgb, var(--direction-accent) 56%, var(--s-text));
  --accent-deep: var(--accent);
  --ink: var(--s-text);
  --ink-2: var(--s-text-muted);
  --ink-3: var(--s-text-faint);
  --line: var(--s-line);
  --line-2: var(--s-line-strong);
  --line-3: var(--s-control-edge);
  --midnight: var(--s-text);
  --haze: var(--s-ground);
  color: var(--ink);
}

html[data-direction] body.vds {
  background: radial-gradient(ellipse at 95% 10%, var(--direction-glow), transparent 56%) fixed, var(--s-ground);
}

/* Carry the selected artwork into the reading surface below the hero. */
.direction-field {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  isolation: isolate;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 98% 26%, var(--field-warm), transparent 62%),
    radial-gradient(ellipse at 2% 90%, var(--field-cool), transparent 72%);
  transition: opacity 420ms ease;
}
.direction-field.is-under-hero { opacity: .4; }
.direction-field::before {
  content: "";
  position: absolute;
  inset: -48px;
  background: var(--direction-hero) 67% center / cover no-repeat;
  filter: blur(var(--field-blur));
  opacity: var(--field-image-opacity);
  mix-blend-mode: var(--field-blend, screen);
  mask-image: radial-gradient(ellipse at 72% 54%, #000 8%, rgb(0 0 0 / .76) 40%, transparent 75%);
}
html[data-direction="spectrum"] .direction-field::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(180deg, transparent 0 5px, rgb(167 185 255 / .075) 5px 6px);
  mask-image: radial-gradient(ellipse at 83% 55%, #000, transparent 66%);
}

html[data-direction] body.vds::after {
  background: url("./directions/grain.png") repeat;
  mix-blend-mode: soft-light;
  opacity: .21;
}

html[data-direction="thermal"] body.vds::after { opacity: .53; }
html[data-direction="airbrush"] body.vds::after { opacity: .42; }

/* The existing Daylight light/dark palettes provide the glass and shadow roles. */
html[data-theme="dark"][data-direction] .vds {
  --p-glass-fill: linear-gradient(150deg,
    color-mix(in srgb, var(--s-surface) 68%, transparent),
    color-mix(in srgb, var(--s-surface) 36%, transparent));
}
html[data-theme="dark"][data-direction] .vds :is(.nav__links a, .nav__panel a, .salon__crumb) {
  border-color: var(--s-glass-edge);
}
html[data-theme="dark"][data-direction] .vds :is(.nav__links a, .nav__panel a, .salon__crumb):not(.on, :hover) {
  background: linear-gradient(160deg,
    color-mix(in srgb, var(--s-surface) 62%, transparent),
    color-mix(in srgb, var(--s-surface) 16%, transparent) 78%);
}
html[data-theme="dark"][data-direction] .vds :is(.nav > a:first-child, .salon__top > a:first-child, .sf__brand) img {
  filter: brightness(0) invert(1);
}

html[data-theme="dark"][data-direction] .pg-home .press { --press-logo-filter: brightness(0) invert(1); }

/* Carry the two ends of the connector into the cards and their icons. */
html[data-direction] .vds .haves__col {
  --haves-accent: var(--thread-start);
  --haves-row: color-mix(in srgb, var(--s-surface) 92%, var(--haves-accent));
}
html[data-direction] .vds .haves__col--train { --haves-accent: var(--thread-end); }
html[data-direction] .vds .haves__col li {
  background: color-mix(in srgb, var(--haves-row) 88%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--haves-accent) 17%, transparent);
}
html[data-direction] .vds .haves__col li:has(> a):is(:hover, :focus-within) {
  background: color-mix(in srgb, var(--haves-row) 88%, var(--haves-accent));
}
html[data-direction] .vds .haves__col svg { stroke: var(--haves-accent); }

/* The original grid, point-cloud canvas and mobile hero order stay in place. */
html[data-direction] .pg-home #scene { z-index: 2; }
html[data-direction] .pg-home .direction-scene {
  position: absolute;
  inset: 0;
  isolation: isolate;
}
html[data-direction] .pg-home #fx {
  z-index: 2;
}
html[data-direction][data-file-review] .pg-home .direction-scene::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: url("./directions/daylight-world-desktop.webp") center / 100% 100% no-repeat;
  mask-image: linear-gradient(90deg, transparent 28%, rgb(0 0 0 / .24) 52%, #000 73%);
}

.direction-emphasis { color: var(--direction-accent); }

html[data-direction] .vds .vds-btn--primary,
html[data-direction] .vds .vds-btn--primary:hover {
  background: linear-gradient(148deg,
    color-mix(in srgb, var(--direction-accent) 21%, var(--s-glass-strong)),
    var(--s-glass));
  border-color: var(--s-control-edge);
  color: var(--s-text);
  box-shadow: var(--s-shadow-control);
}
html[data-direction] .vds :is(.nav__cta, .nav .nav__toggle) {
  border-radius: var(--p-radius-control);
}

.direction-art {
  --art-opacity: .64;
  position: absolute;
  z-index: 1;
  inset: 7% 0 3% 20%;
  overflow: hidden;
  pointer-events: none;
  opacity: var(--art-opacity);
  mask-image: radial-gradient(ellipse at 68% 51%, #000 13%, rgb(0 0 0 / .85) 34%, transparent 73%);
  mix-blend-mode: screen;
}

.direction-art::before,
.direction-light {
  position: absolute;
  inset: 0;
}
.direction-art::before {
  content: "";
  background: var(--direction-hero) center / cover no-repeat;
  animation: direction-drift 19s ease-in-out infinite alternate;
}
.direction-light {
  mix-blend-mode: screen;
  background: linear-gradient(103deg, transparent 36%, rgb(255 248 216 / .14) 49%, transparent 59%);
  background-size: 230% 100%;
  animation: direction-reflection 14s ease-in-out infinite alternate;
}

@keyframes direction-drift {
  from { transform: scale(1); }
  to { transform: scale(1.055) translateY(-1%); }
}
@keyframes direction-reflection {
  from { background-position: 95% 0; opacity: .12; }
  60% { opacity: .75; }
  to { background-position: 0 0; opacity: .34; }
}

html[data-direction="french-touch"] .direction-art {
  --art-opacity: .59;
  inset: 4% 0 1% 33%;
  mix-blend-mode: normal;
}
html[data-direction="french-touch"] .direction-art::before { background-position: 43% 51%; }
@media (min-width: 821px) {
  html[data-direction="french-touch"] .pg-home #heroLayer h1 { font-family: var(--direction-font); }
}

html[data-direction="thermal"] .direction-art {
  --art-opacity: .55;
  inset-inline-start: 12%;
}
html[data-direction="thermal"] .direction-light {
  background-image: linear-gradient(103deg, transparent 36%, rgb(197 231 122 / .19) 49%, transparent 60%);
}

html[data-direction="airbrush"] .direction-art {
  --art-opacity: .86;
  inset: 4% 0 1% 27%;
  mix-blend-mode: normal;
}
html[data-direction="airbrush"] .direction-art::before { background-position: 65% 46%; }
html[data-direction="airbrush"] .direction-light {
  background-image: linear-gradient(112deg, transparent 31%, rgb(119 184 255 / .19) 43%,
    rgb(255 147 113 / .19) 51%, transparent 63%);
}
html[data-direction="airbrush"] .pg-home #fx,
html[data-direction="airbrush"][data-file-review] .pg-home .direction-scene::before {
  opacity: .78;
  filter: saturate(.7);
}

html[data-direction="pulse"] .direction-art {
  --art-opacity: .62;
  inset: 9% 0 4% 39%;
  mix-blend-mode: multiply;
}
html[data-direction="pulse"] .direction-art::before { background-position: 58% 50%; }

html[data-direction="spectrum"] .direction-art {
  --art-opacity: .69;
  inset-inline-start: 22%;
}
html[data-direction="spectrum"] .direction-art::before { background-position: 67% center; }
html[data-direction="spectrum"] .direction-light {
  background-image: repeating-linear-gradient(0deg, transparent 0 4px, rgb(160 180 255 / .14) 5px, transparent 6px 11px);
  mask-image: radial-gradient(ellipse at 64% 57%, #000 2%, transparent 63%);
  animation-duration: 7s;
}

html[data-direction] .style-picker {
  position: fixed;
  left: 16px;
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 82;
  width: max-content;
  max-width: calc(100vw - 32px);
  color: var(--s-text);
  font-size: .82rem;
}
.style-picker > summary,
.style-picker__list {
  background: var(--s-glass-strong);
  border: 1px solid var(--s-line-strong);
  border-radius: 4px;
  backdrop-filter: var(--control-frost);
  box-shadow: 0 8px 26px rgb(0 0 0 / .2);
}
.style-picker > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 7px 12px;
  cursor: pointer;
  list-style: none;
}
.style-picker > summary::-webkit-details-marker { display: none; }
.style-picker > summary::after { content: "▴"; color: var(--direction-accent); }
.style-picker[open] > summary::after { content: "▾"; }
.style-picker > summary span { color: var(--s-text-muted); }
.style-picker > summary strong { font-weight: 650; }
.style-picker__list {
  position: absolute;
  inset: auto auto calc(100% + 7px) 0;
  display: grid;
  gap: 2px;
  width: max-content;
  min-width: max(100%, 178px);
  max-height: calc(100svh - 86px);
  overflow: auto;
  padding: 5px;
}
.style-picker__list a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 6px 12px;
  border: 1px solid transparent;
  border-radius: 2px;
}
.style-picker__list a:is(:hover, [aria-current]) {
  background: var(--s-control);
  border-color: var(--s-line);
}
.style-picker__list a[aria-current] { font-weight: 670; }
.style-picker__list a.style-picker__out { border-top-color: var(--s-line); color: var(--s-text-muted); }
.style-picker__group {
  margin: 8px 12px 2px;
  color: var(--s-text-muted);
  font-size: .72rem;
  font-weight: 600;
}
.style-picker__modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  padding: 2px;
  border-radius: 9px;
  background: color-mix(in srgb, var(--s-text) 9%, transparent);
}
.style-picker__modes button {
  min-height: 32px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--s-text);
  font: inherit;
  font-weight: 590;
  cursor: pointer;
}
.style-picker__modes button[aria-pressed="true"] {
  background: var(--s-control);
  box-shadow: 0 3px 8px rgb(0 0 0 / .12), 0 0 0 .5px rgb(0 0 0 / .04);
}
.style-picker__modes button:disabled { opacity: .4; cursor: not-allowed; }

@media (max-width: 820px) {
  .direction-field::before {
    background-position: 66% center;
    mask-image: radial-gradient(ellipse at 80% 56%, #000 5%, rgb(0 0 0 / .73) 39%, transparent 77%);
  }
  html[data-direction] .pg-home #heroLayer .direction-scene {
    position: relative;
    inset: auto;
    order: 3;
    height: 42svh;
    min-height: 280px;
    margin-top: 28px;
  }
  html[data-direction] .pg-home #heroLayer #fx {
    position: absolute;
    inset: 0;
    height: 100%;
    min-height: 0;
    margin: 0;
  }
  html[data-direction] .pg-home #heroLayer .direction-art {
    inset: 0;
    mask-image: radial-gradient(ellipse at 53% 49%, #000 17%, rgb(0 0 0 / .85) 37%, transparent 73%);
  }
  html[data-direction][data-file-review] .pg-home .direction-scene::before {
    background-image: url("./directions/daylight-world-mobile.webp");
    mask-image: none;
  }
  html[data-direction] .pg-home .style-picker {
    position: absolute;
    inset: 100% var(--m) auto auto;
  }
  .pg-home .style-picker__list { left: auto; right: 0; }
  .pg-home .style-picker > summary { min-height: 36px; }
}

html[data-direction-paused] .direction-art::before,
html[data-direction-paused] .direction-light,
.direction-art.is-offscreen::before,
.direction-art.is-offscreen .direction-light { animation-play-state: paused; }

@media (prefers-reduced-motion: reduce) {
  .direction-field { transition: none; }
  .direction-art::before, .direction-light { animation: none; }
}

html[data-file-review] .pg-home .sessions { visibility: hidden; }
