/* ==========================================================================
   Heart Mind Habits — color schemes
   Grounded Radiance is the default (also in site.css :root). Each scheme
   overrides the same tokens on <html data-scheme="…">. fx.js sets the
   attribute before first paint; the Colors menu (site.js) switches it live.

   Brand colours (the logo): coral #E27F6D (heart), sage #8EB9A5 (mind),
   gold #DBB66F (habits), forest #152F2B, ivory #F7F2E8.
   Dark schemes: deep page, light text, an ivory "dawn" band for contrast.
   Light schemes: light page, dark text; the dawn band turns deep, and
   heroes stay a deep island with light text so the emblem glows.
   ========================================================================== */

/* ---------- Dark ---------- */

[data-scheme="radiance"] {   /* Grounded Radiance: forest, ivory, coral, sage, gold */
  --ink: #0e201d; --night: #132a26; --deep: #1a3631; --plum: #224540;
  --mist: #f7f2e8; --soft: #d9d3c4; --muted: #a2b2a9;
  --lime: #E8826F; --lime-deep: #d06a57; --accent-rgb: 232 130 111; --on-accent: #2a0f09;
  --aqua: #8EB9A5; --rose: #f0a597; --gold: #DBB66F;
  --line: rgba(247, 242, 232, 0.12); --line-strong: rgba(247, 242, 232, 0.22);
  --bg-rgb: 14 32 29; --glow-a: 142 185 165; --glow-b: 219 182 111; --glow-c: 226 127 109;
  --panel: rgba(19, 42, 38, 0.95); --hero-tint: #12302a;
  --dawn: #f7f2e8; --dawn-ink: #152F2B; --dawn-soft: #44564f; --dawn-line: rgba(21, 47, 43, 0.14);
  --dawn-muted: #5f6f69; --dawn-g1: #b4523f; --dawn-g2: #8a6418; --dawn-g3: #2f6f5e; --dawn-accent: #b4523f;
  --dawn-glow-a: 226 127 109; --dawn-glow-b: 219 182 111;
  --water-pond: #0b1a18; --water-sky: #2a4d45; --water-deep: #0d2a26; --water-clear: #4f8f7c;
}

[data-scheme="alchemy"] {    /* Modern Alchemy: plum, cream, rose, teal, brass */
  --ink: #1a1322; --night: #211829; --deep: #2b2036; --plum: #3a2b47;
  --mist: #f7f3ec; --soft: #ddd2dc; --muted: #a99bae;
  --lime: #D97984; --lime-deep: #c0606b; --accent-rgb: 217 121 132; --on-accent: #2a0c12;
  --aqua: #68ADA5; --rose: #eba3ab; --gold: #D2AE71;
  --line: rgba(247, 243, 236, 0.12); --line-strong: rgba(247, 243, 236, 0.22);
  --bg-rgb: 26 19 34; --glow-a: 104 173 165; --glow-b: 210 174 113; --glow-c: 217 121 132;
  --panel: rgba(33, 24, 41, 0.95); --hero-tint: #2a1f35;
  --dawn: #f7f3ec; --dawn-ink: #251B30; --dawn-soft: #574a60; --dawn-line: rgba(37, 27, 48, 0.14);
  --dawn-muted: #6f6278; --dawn-g1: #a8434f; --dawn-g2: #85621f; --dawn-g3: #2b6e66; --dawn-accent: #a8434f;
  --dawn-glow-a: 217 121 132; --dawn-glow-b: 210 174 113;
  --water-pond: #140e1a; --water-sky: #3a2b47; --water-deep: #1f2a3a; --water-clear: #4f8f88;
}

/* ---------- Light ---------- */

[data-tone="light"] {
  color-scheme: light;
  --text-shadow-rgb: 255 255 255;   /* light behind dark text */
  --spectrum: linear-gradient(90deg, #c4553f, #d4824e, #b88a2c, #7a8f45, #3f7f6a, #2f6f78, #a3566a);
}

/* dark bands inside a light scheme (light text): the shadow goes dark again */
[data-tone="light"] .section.dawn, [data-scheme="harvest"] .page-hero { --text-shadow-rgb: 0 0 0; }


[data-scheme="ivory"] {      /* Ivory Morning: ivory page, forest text, deep coral; the hero stays forest */
  --ink: #F7F2E8; --night: #efe8da; --deep: #e6ddcb; --plum: #dcd2bd;
  --mist: #152F2B; --soft: #3c4f49; --muted: #5d6c66;
  --lime: #B4523F; --lime-deep: #964230; --accent-rgb: 180 82 63; --on-accent: #ffffff;
  --aqua: #2f6f5e; --rose: #b4523f; --gold: #8a6418;
  --fg-rgb: 21 47 43; --bg-rgb: 247 242 232;
  --line: rgba(21, 47, 43, 0.12); --line-strong: rgba(21, 47, 43, 0.24); --veil: rgba(21, 47, 43, 0.06);
  --shadow: rgba(21, 47, 43, 0.2); --panel: rgba(255, 252, 246, 0.97);
  --glow-a: 142 185 165; --glow-b: 219 182 111; --glow-c: 226 127 109;
  --dawn: #152F2B; --dawn-ink: #F7F2E8; --dawn-soft: #cfd9d2; --dawn-line: rgba(255, 255, 255, 0.16);
  --dawn-muted: #a2b5ac; --dawn-card: rgba(255, 255, 255, 0.06);
  --dawn-g1: #E27F6D; --dawn-g2: #DBB66F; --dawn-g3: #8EB9A5; --dawn-accent: #E8826F;
  --dawn-glow-a: 226 127 109; --dawn-glow-b: 219 182 111;
  /* the hero island */
  --i-ink: #152F2B; --i-night: #1f3f39; --i-deep: #1a3631; --i-mist: #fbf7ef; --i-soft: #e3ddd0; --i-muted: #c9d3cc;
  --i-bg-rgb: 21 47 43; --i-accent: #E8826F; --i-accent-rgb: 232 130 111; --i-on-accent: #2a0f09; --i-hero-tint: #2a4a43;
  --water-pond: #dcd3c0; --water-sky: #f7f2e8; --water-deep: #2a4a43; --water-clear: #8EB9A5; --water-vig: 0.9;
}

[data-scheme="current"] {    /* Creative Current: cloud page, navy text, clear blue; apricot and mint on the navy */
  --ink: #F8F8F4; --night: #eff0ea; --deep: #e5e7e0; --plum: #d9dce0;
  --mist: #192537; --soft: #3a4658; --muted: #5a6578;
  --lime: #4459B8; --lime-deep: #34479a; --accent-rgb: 68 89 184; --on-accent: #ffffff;
  --aqua: #2c8a7d; --rose: #b8573a; --gold: #8a6418;
  --fg-rgb: 25 37 55; --bg-rgb: 248 248 244;
  --line: rgba(25, 37, 55, 0.12); --line-strong: rgba(25, 37, 55, 0.24); --veil: rgba(25, 37, 55, 0.06);
  --shadow: rgba(25, 37, 55, 0.18); --panel: rgba(255, 255, 252, 0.97);
  --glow-a: 99 121 205; --glow-b: 119 197 185; --glow-c: 240 166 120;
  --dawn: #192537; --dawn-ink: #F8F8F4; --dawn-soft: #d0d7e2; --dawn-line: rgba(255, 255, 255, 0.16);
  --dawn-muted: #a3aec0; --dawn-card: rgba(255, 255, 255, 0.06);
  --dawn-g1: #F0A678; --dawn-g2: #77C5B9; --dawn-g3: #9aa9ee; --dawn-accent: #F0A678;
  --dawn-glow-a: 99 121 205; --dawn-glow-b: 240 166 120;
  --i-ink: #192537; --i-night: #26344b; --i-deep: #1f2c40; --i-mist: #fbfbf7; --i-soft: #dde2ea; --i-muted: #c3cbd8;
  --i-bg-rgb: 25 37 55; --i-accent: #F0A678; --i-accent-rgb: 240 166 120; --i-on-accent: #2a1206; --i-hero-tint: #2c3b55;
  --water-pond: #d7dbe3; --water-sky: #f8f8f4; --water-deep: #26344b; --water-clear: #77C5B9; --water-vig: 0.9;
}

[data-scheme="harvest"] {    /* page-only (a campaign page): soft cream, deep olive text, terracotta, muted gold */
  --ink: #f6efe3; --night: #efe6d6; --deep: #e7dcc8; --plum: #dccfb6;
  --mist: #26301f; --soft: #4a5240; --muted: #6a6a58;
  --lime: #9c4527; --lime-deep: #7f361d; --accent-rgb: 156 69 39; --on-accent: #ffffff;
  --aqua: #4f6b3a; --rose: #9c4527; --gold: #8d6a24;
  --fg-rgb: 38 48 31; --bg-rgb: 246 239 227;
  --line: rgba(38, 48, 31, 0.13); --line-strong: rgba(38, 48, 31, 0.25); --veil: rgba(38, 48, 31, 0.06);
  --shadow: rgba(38, 48, 31, 0.2); --panel: rgba(251, 247, 240, 0.97);
  --glow-a: 196 160 96; --glow-b: 150 170 110; --glow-c: 214 150 110;
  --dawn: #2b3a22; --dawn-ink: #f6efe3; --dawn-soft: #ddd5c0; --dawn-line: rgba(255, 255, 255, 0.16);
  --dawn-muted: #b9b49c; --dawn-card: rgba(255, 255, 255, 0.06);
  --dawn-g1: #e2b86a; --dawn-g2: #e8a07c; --dawn-g3: #c9d29a; --dawn-accent: #e2b86a;
  --dawn-glow-a: 226 184 106; --dawn-glow-b: 232 160 124;
  /* olive page top with cream text and gold */
  --i-ink: #2b3a22; --i-night: #55603f; --i-deep: #3e4a30; --i-mist: #fbf7ef; --i-soft: #ece4d2; --i-muted: #ddd5c0;
  --i-bg-rgb: 43 58 34; --i-accent: #e2b86a; --i-accent-rgb: 226 184 106; --i-on-accent: #2b2008; --i-hero-tint: #7c8466;
  --water-pond: #5f6a4c; --water-sky: #e9dcc0; --water-deep: #2b3a22; --water-clear: #c9b27a; --water-vig: 0.82;
}


/* Light schemes: heroes and media stay a mid-tone island with light text */
[data-tone="light"] :is(.hero, .page-hero, .site-header:not(.is-scrolled), .video, .art, .wave-figure) {
  color-scheme: dark;
  color: var(--i-soft);
  --ink: var(--i-ink); --night: var(--i-night); --deep: var(--i-deep); --plum: var(--i-deep);
  --mist: var(--i-mist); --soft: var(--i-soft); --muted: var(--i-muted);
  --lime: var(--i-accent); --lime-deep: var(--i-accent); --accent-rgb: var(--i-accent-rgb); --on-accent: var(--i-on-accent);
  --rose: #f0a597; --gold: #DBB66F; --aqua: #8EB9A5;
  --fg-rgb: 255 255 255; --bg-rgb: var(--i-bg-rgb);
  --line: rgba(255, 255, 255, 0.16); --line-strong: rgba(255, 255, 255, 0.3); --veil: rgba(255, 255, 255, 0.1);
  --panel: rgb(var(--i-bg-rgb) / 0.96); --shadow: rgba(0, 0, 0, 0.5);
  --hero-tint: var(--i-hero-tint);
}
/* a subpage's page top in a light scheme is a dark island with light words, fading into the light page below.
   On a phone the words wrap, so the page top grows and its last lines (buttons, tags) used to sit in that light
   fade, faint. The fade now only covers the empty space under the last line, and the tags and outline buttons
   get a soft backing in the island's own color, so they read over the bright parts of the moving light too. */
[data-tone="light"] .page-hero::after { height: clamp(48px, 8vw, 104px); }
[data-tone="light"] .page-hero .tag { background: rgb(var(--i-bg-rgb) / 0.42); border-color: rgba(255, 255, 255, 0.28); color: var(--i-mist); }
[data-tone="light"] .page-hero .btn.ghost { --b-bg: rgb(var(--i-bg-rgb) / 0.38); --b-fg: var(--i-mist); }

/* lighter scrims over the daybreak water */
[data-tone="light"] .hero::after {
  background: linear-gradient(180deg, transparent, rgb(var(--bg-rgb) / 0.35) 45%, rgb(var(--bg-rgb) / 0.78));
}
[data-tone="light"] .hero h1 { text-shadow: 0 4px 40px rgb(var(--bg-rgb) / 0.55); }
[data-tone="light"] :is(.hero-hint, .hero-status, .hero .eyebrow, .hero-lede) {
  color: var(--soft);
  text-shadow: 0 1px 10px rgb(var(--bg-rgb) / 0.6);
}
[data-tone="light"] .ambient-fallback {
  background:
    radial-gradient(60% 70% at 78% 30%, rgb(var(--glow-a) / 0.45), transparent 70%),
    radial-gradient(50% 60% at 20% 80%, rgb(var(--glow-b) / 0.3), transparent 70%),
    linear-gradient(180deg, var(--i-hero-tint), var(--i-night));
}
/* light schemes: the emblem behind the bands is drawn darker to show on a light background */
[data-tone="light"] .cta-band > .emblem-bg { mix-blend-mode: multiply; filter: saturate(1.4) brightness(.8); }

/* ---------- Colors menu ---------- */
.nav-colors .nav-visuals-btn .swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: conic-gradient(var(--sw-a, #07070f) 0 50%, var(--sw-b, #a6d65a) 50% 100%);
}
.colors-menu { width: 360px; }
.colors-menu .group {
  margin: 8px 10px 2px;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}
.colors-menu .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.visuals-menu.colors-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 30px 9px 10px;
}
.colors-menu .chip {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background:
    radial-gradient(circle at 50% 50%, var(--c3) 0 22%, transparent 23%),
    conic-gradient(var(--c1) 0 50%, var(--c2) 50% 100%);
}
.visuals-menu.colors-menu button b { font-size: 0.86rem; white-space: nowrap; }
.visuals-menu.colors-menu button[aria-pressed="true"]::after { right: 12px; }

@media (min-width: 1001px) and (max-width: 1180px) {
  .nav-colors .nav-visuals-btn .label { display: none; }
}

.nav-colors .now { display: none; }

@media (max-width: 1000px) {
  .nav { overflow-y: auto; justify-content: safe center; padding: var(--header-h) 0 28px; }
  .nav-colors { order: 11; margin-top: 18px; gap: 6px; }
  .nav-colors .nav-visuals-btn .swatch { display: none; }
  .colors-menu {
    width: min(92vw, 360px);
    flex-wrap: wrap;
    justify-content: center;
    border-radius: 22px;
    padding: 8px;
  }
  .colors-menu .group { display: none; }
  .colors-menu .grid { display: contents; }
  .visuals-menu.colors-menu button { padding: 4px; border-radius: 50%; }
  .visuals-menu.colors-menu button b { display: none; }
  .colors-menu .chip { width: 34px; height: 34px; }
  .visuals-menu.colors-menu button[aria-pressed="true"] { background: transparent; }
  .visuals-menu.colors-menu button[aria-pressed="true"] .chip { box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px var(--mist); }
  .nav-colors .now { display: block; margin: 0; font-size: 0.85rem; color: var(--soft); }
}

/* Thankful Harvest: the colored italic in terracotta and gold (light on the olive page top) */
[data-scheme="harvest"] .accent-italic { background-image: linear-gradient(100deg, #9c4527, #a8742a 55%, #6b7a3a); }
[data-scheme="harvest"] :is(.page-hero, .section.dawn) .accent-italic { background-image: linear-gradient(100deg, #eaa580, #e2b86a 55%, #f1dca6); }
