/* ============================================================================
   VRI — hero versions 3, 4 and 5, plus small revisions that apply site-wide.
   Additive stylesheet, loaded after site.css.
     1. palette and header revisions
     2. legibility: gold type over gold imagery (all versions)
     3. Version 1 (photograph): a lighter veil
     4. Version 2 (wheel): the new gold wheel
     5. The tree (Versions 3, 4, 5): placement, pocket, scroll zoom, phones
     6. Version 4: wheel behind the tree   7. Version 5: photograph behind the tree
     8. falling leaves
   ============================================================================ */

/* ---------- 1. palette and header revisions ---------- */
/* Brown now sits between chocolate and burgundy. */
:root[data-palette="brown"]{--wine-rgb:94,42,36;--deep-rgb:64,26,22;--ink2-rgb:40,15,12;--vellum-rgb:238,226,206;--paper-rgb:252,248,241;--onwine-rgb:246,237,222;--gold-rgb:160,120,44;--gold-lt-rgb:222,192,128;--cream:#f6efe2;--ink:#2b1c16;--soft:#67564c}

/* Header: its row may run wider than the page column, so brand, menu and tools never
   meet. Above 1800px the brand sits on one line with its tagline. */
.site-head .wrap{max-width:1480px;gap:2rem}
.site-head .brand{flex:0 1 auto;min-width:0}
.site-head .brand b{min-width:0;white-space:nowrap}
.site-head .nav{flex:0 0 auto}
.site-head .head-tools{flex:0 0 auto}
@media (max-width:1800px){.site-head .brand small{display:none}}
@media (max-width:1500px) and (min-width:1121px){
  .site-head .nav .top{padding:.9rem .5rem;letter-spacing:.1em;font-size:.78rem}
  .site-head .brand b{font-size:.95rem}
}
@media (max-width:1300px) and (min-width:1121px){
  .site-head .nav .top{padding:.9rem .38rem;letter-spacing:.08em;font-size:.74rem}
  .site-head .brand b{font-size:.9rem;white-space:normal;max-width:10.5em;line-height:1.15}
  .site-head .wrap{gap:1.2rem}
}
@media (max-width:1120px){
  .site-head .brand b{white-space:normal;max-width:11.5em;font-size:.9rem;letter-spacing:.07em;line-height:1.2}
  .site-head .wrap{gap:1rem}
}
@media (max-width:400px){.site-head .brand b{font-size:.82rem;max-width:10.5em}}

/* ---------- 2. legibility ---------- */
/* Gold type over gold imagery: a tight shadow at the letter edge, a soft one behind,
   and a quiet pool of shade behind the whole text block. */
.hero h1{text-shadow:0 1px 2px rgba(var(--ink2-rgb),.7),0 3px 14px rgba(var(--ink2-rgb),.55)}
.hero h1 em{
  color:color-mix(in srgb,var(--gold-lt) 72%,#fff6dc);
  text-shadow:0 1px 1px rgba(var(--ink2-rgb),.95),0 2px 5px rgba(var(--ink2-rgb),.9),0 6px 22px rgba(var(--ink2-rgb),.8),0 0 60px rgba(var(--ink2-rgb),.6);
}
.hero .astaught{text-shadow:0 1px 1px rgba(var(--ink2-rgb),.95),0 2px 5px rgba(var(--ink2-rgb),.85),0 4px 18px rgba(var(--ink2-rgb),.7)}
.hero .lead{text-shadow:0 1px 2px rgba(var(--ink2-rgb),.7),0 2px 10px rgba(var(--ink2-rgb),.5)}
.hero .wrap{position:relative}
.hero .wrap::before{content:"";position:absolute;z-index:-1;left:-14%;top:-6%;bottom:-6%;width:78%;pointer-events:none;
  background:radial-gradient(closest-side at 42% 42%,rgba(var(--ink2-rgb),.45),rgba(var(--ink2-rgb),.26) 48%,rgba(var(--ink2-rgb),.08) 76%,rgba(var(--ink2-rgb),0) 100%)}
@media (max-width:860px){
  .hero .wrap::before{left:-12%;width:124%;top:-4%;bottom:auto;height:78%;
    background:radial-gradient(closest-side at 50% 42%,rgba(var(--ink2-rgb),.55),rgba(var(--ink2-rgb),.3) 55%,rgba(var(--ink2-rgb),0) 100%)}
}

/* ---------- 3. Version 1: the photograph shows through more ---------- */
:root[data-version="1"] .hero::after{background:linear-gradient(95deg,rgba(var(--ink2-rgb),.86) 0%,rgba(var(--deep-rgb),.62) 32%,rgba(var(--deep-rgb),.18) 58%,rgba(var(--deep-rgb),0) 78%),linear-gradient(0deg,rgba(var(--ink2-rgb),.45) 0%,rgba(var(--ink2-rgb),0) 28%)}
:root[data-version="1"] .hero .wrap::before{background:radial-gradient(closest-side at 42% 42%,rgba(var(--ink2-rgb),.55),rgba(var(--ink2-rgb),.34) 48%,rgba(var(--ink2-rgb),.1) 78%,rgba(var(--ink2-rgb),0) 100%)}
@media (max-width:760px){
  :root[data-version="1"] .hero::after{background:linear-gradient(180deg,rgba(var(--ink2-rgb),.72) 0%,rgba(var(--deep-rgb),.5) 42%,rgba(var(--deep-rgb),.12) 70%,rgba(var(--ink2-rgb),.4) 100%)}
}

/* ---------- 4. Version 2: the gold wheel ---------- */
:root[data-version="2"] .hero .emblem{aspect-ratio:677/882;height:min(104%,600px);right:clamp(1rem,8vw,10rem)}
:root[data-version="2"] .hero .emblem img{filter:drop-shadow(0 30px 44px rgba(0,0,0,.5))}
:root[data-version="2"] .hero .emblem::before{height:118%}
:root[data-version="2"] .hero .emblem::after{height:150%}
@media (max-width:860px){:root[data-version="2"] .hero .emblem{right:-22%;height:88%;opacity:.34}}

/* ---------- 5. The tree: Versions 3, 4 and 5 ---------- */
.hero .tree,.hero .leaves{display:none}
:root:is([data-version="3"],[data-version="4"],[data-version="5"]) .hero .cap{display:none}
:root:is([data-version="3"],[data-version="4"]) .hero picture{display:none}
:root[data-version="3"] .hero .emblem{display:none}

/* ground: the palette's deep shade with a low, warm glow where the tree stands */
:root:is([data-version="3"],[data-version="4"]) .hero{
  background:
    radial-gradient(60% 75% at 74% 82%, rgba(var(--gold-lt-rgb),.17) 0%, rgba(var(--gold-lt-rgb),.06) 42%, rgba(var(--gold-lt-rgb),0) 72%),
    radial-gradient(40% 60% at 12% 30%, rgba(var(--wine-rgb),.55) 0%, rgba(var(--wine-rgb),0) 70%),
    linear-gradient(112deg, rgb(var(--ink2-rgb)) 0%, rgb(var(--deep-rgb)) 52%, rgb(var(--wine-rgb)) 135%);
}
:root:is([data-version="3"],[data-version="4"]) .hero::after{background:linear-gradient(95deg,rgba(var(--ink2-rgb),.82) 0%,rgba(var(--deep-rgb),.58) 28%,rgba(var(--deep-rgb),.22) 48%,rgba(var(--deep-rgb),0) 64%)}

/* the artwork: gold on transparency, full hero height, pinned bottom-right.
   Two masks, intersected: the canopy dissolves at the top edge, and a soft pocket is
   carved out around the text block so the headline sits on quiet ground. */
:root:is([data-version="3"],[data-version="4"],[data-version="5"]) .hero .tree{display:block;position:absolute;inset:0;z-index:-1;pointer-events:none;overflow:hidden}
:root:is([data-version="3"],[data-version="4"],[data-version="5"]) .hero .tree img{
  position:absolute;right:-6%;bottom:0;height:100%;width:auto;max-width:none;
  transform-origin:50% 78%;transform:scale(var(--tz,1));will-change:transform;
  -webkit-mask-image:linear-gradient(180deg,transparent 0,#000 18%,#000 100%),radial-gradient(ellipse 56% 54% at 22% 36%,transparent 0,transparent 44%,rgba(0,0,0,.4) 72%,#000 100%);
          mask-image:linear-gradient(180deg,transparent 0,#000 18%,#000 100%),radial-gradient(ellipse 56% 54% at 22% 36%,transparent 0,transparent 44%,rgba(0,0,0,.4) 72%,#000 100%);
  -webkit-mask-composite:source-in;mask-composite:intersect;
}
@media (max-width:1300px) and (min-width:861px){:root:is([data-version="3"],[data-version="4"],[data-version="5"]) .hero .tree img{height:auto;width:96%;right:-14%}}
@media (min-width:2000px){:root:is([data-version="3"],[data-version="4"],[data-version="5"]) .hero .tree img{right:calc((100% - 1900px) / 2 - 4rem)}}

/* which drawing: the soft key for Version 3, the solid key for 4 and 5 */
.hero .tree img.solid{display:none}
:root:is([data-version="4"],[data-version="5"]) .hero .tree img.soft{display:none}
:root:is([data-version="4"],[data-version="5"]) .hero .tree img.solid{display:block}

/* Version 4: the tree stands fully opaque in front of the wheel.
   Version 5: the solid drawing too (so the photograph never shows through the trunk),
   but with the same pocket around the text as Version 3.
   Both: the ground line drops to the hero's bottom edge so the meditator sits on the join. */
:root[data-version="4"] .hero .tree img{
  -webkit-mask-image:linear-gradient(180deg,transparent 0,#000 14%,#000 100%);
          mask-image:linear-gradient(180deg,transparent 0,#000 14%,#000 100%);
  -webkit-mask-composite:source-over;mask-composite:add;
}
:root:is([data-version="4"],[data-version="5"]) .hero .tree img{bottom:-13%}

/* text block */
:root:is([data-version="3"],[data-version="4"],[data-version="5"]) .hero .wrap{padding-block:clamp(4rem,10vw,7.5rem) clamp(5rem,12vw,9.5rem)}
:root:is([data-version="3"],[data-version="4"],[data-version="5"]) .hero h1{font-size:clamp(3rem,7.4vw,6.2rem);line-height:1.05}
:root:is([data-version="3"],[data-version="4"],[data-version="5"]) .hero .astaught{margin-top:-.5rem}
:root:is([data-version="3"],[data-version="4"],[data-version="5"]) .hero .lead{max-width:42ch}

/* phones: one composition. The text holds the upper part; the drawing is sized by width
   (three screens wide, anchored so the figure sits lower-left and the trunk at the right
   edge) and rises behind the copy, dissolving as it goes. */
@media (max-width:860px){
  :root:is([data-version="3"],[data-version="4"],[data-version="5"]) .hero .wrap{padding-top:clamp(2.2rem,7vw,3.4rem);padding-bottom:clamp(250px,74vw,360px)}
  :root:is([data-version="3"],[data-version="4"],[data-version="5"]) .hero h1{font-size:clamp(2.5rem,11.5vw,3.4rem);line-height:1.02}
  :root:is([data-version="3"],[data-version="4"],[data-version="5"]) .hero .astaught{font-size:clamp(1.1rem,4.8vw,1.4rem)}
  :root:is([data-version="3"],[data-version="4"],[data-version="5"]) .hero .lead{font-size:1rem;max-width:none}
  :root:is([data-version="3"],[data-version="4"],[data-version="5"]) .hero .tree img{
    right:auto;left:-134%;bottom:0;width:300%;height:auto;max-width:none;object-fit:fill;transform-origin:50% 86%;
    -webkit-mask-image:linear-gradient(180deg,transparent 0,rgba(0,0,0,.25) 34%,#000 58%,#000 100%);
            mask-image:linear-gradient(180deg,transparent 0,rgba(0,0,0,.25) 34%,#000 58%,#000 100%);
    -webkit-mask-composite:source-over;mask-composite:add;
  }
  :root:is([data-version="4"],[data-version="5"]) .hero .tree img{bottom:-9vw}
  :root:is([data-version="3"],[data-version="4"]) .hero::after{background:linear-gradient(180deg,rgba(var(--ink2-rgb),.5) 0%,rgba(var(--deep-rgb),.25) 40%,rgba(var(--deep-rgb),0) 62%)}
  :root[data-version="4"] .hero .turning{right:-34%;top:auto;bottom:-6%;transform:none;height:min(64%,420px);opacity:.3}
}
@media (max-width:480px){
  :root:is([data-version="3"],[data-version="4"],[data-version="5"]) .hero .tree img{width:320%;left:-146%}
}

/* phones, every version: tidy chrome */
@media (max-width:640px){
  .hero .ctas{display:grid;grid-template-columns:1fr;gap:.7rem;max-width:22rem}
  .hero .ctas .btn{width:100%}
  .demo{font-size:.68rem;letter-spacing:.09em;padding:.4rem .8rem;gap:.3rem .9rem}
  .demo>span:first-child{display:none}
  .versions,.palettes{flex-wrap:wrap;justify-content:center}
  .versions>span:first-child,.palettes>span:first-child{display:none}
  .versions button{padding:.22rem .55rem;white-space:nowrap}
  .palettes button{width:19px;height:19px}
  .facts{grid-template-columns:repeat(3,minmax(0,1fr));gap:.9rem}
  .facts strong{font-size:1.7rem}
  .facts span{font-size:.84rem}
  .motto.turning .wheel img{height:130px}
}

/* inner pages: a faint corner of the canopy in place of the pagoda photograph */
:root:is([data-version="3"],[data-version="4"],[data-version="5"]) .page-head::before{background:radial-gradient(50% 120% at 88% 50%,rgba(var(--gold-lt-rgb),.14),rgba(var(--gold-lt-rgb),0) 70%);opacity:1}
:root:is([data-version="3"],[data-version="4"],[data-version="5"]) .page-head::after{background:url("../img/hero-tree.webp") right -4rem bottom -2rem/auto 260% no-repeat;opacity:.22}
@media (max-width:860px){:root:is([data-version="3"],[data-version="4"],[data-version="5"]) .page-head::after{opacity:.14;background-size:auto 200%}}

/* ---------- 6. Version 4: the wheel behind the tree ---------- */
/* The turning wheel from the verse band, rendered three times larger, stands behind the
   trunk. It is the same twelve-frame turn, so it moves exactly like the small one. */
.hero .turning{display:none}
:root[data-version="4"] .hero .emblem{display:none}
:root[data-version="4"] .hero .turning{display:block;position:absolute;z-index:-2;right:clamp(5rem,15vw,17rem);top:48%;height:min(112%,720px);aspect-ratio:810/1265;transform:translateY(-50%);opacity:.38;pointer-events:none;filter:drop-shadow(0 20px 40px rgba(0,0,0,.35))}
:root[data-version="4"] .hero .turning img{width:100%;height:100%;object-fit:contain}
.hero .turning img.still{display:none}
@media (prefers-reduced-motion:reduce){.hero .turning img.moving{display:none}.hero .turning img.still{display:block}}
:root[data-version="4"] .hero .turning::before,:root[data-version="4"] .hero .turning::after{content:"";position:absolute;left:50%;top:50%;border-radius:50%;border:1px solid rgba(var(--gold-lt-rgb),.16);transform:translate(-50%,-50%);aspect-ratio:1}
:root[data-version="4"] .hero .turning::before{height:116%}
:root[data-version="4"] .hero .turning::after{height:146%;border-color:rgba(var(--gold-lt-rgb),.09)}
:root[data-version="4"] .hero .tree{z-index:-1}
@media (max-width:860px){:root[data-version="4"] .hero .turning{right:-26%;top:56%;height:78%;opacity:.3}}

/* ---------- 7. Version 5: the photograph behind the tree ---------- */
:root[data-version="5"] .hero .emblem{display:none}
:root[data-version="5"] .hero picture{display:block}
:root[data-version="5"] .hero::after{background:linear-gradient(95deg,rgba(var(--ink2-rgb),.9) 0%,rgba(var(--deep-rgb),.74) 36%,rgba(var(--deep-rgb),.5) 64%,rgba(var(--deep-rgb),.42) 100%),linear-gradient(0deg,rgba(var(--ink2-rgb),.55) 0%,rgba(var(--ink2-rgb),0) 40%)}
:root[data-version="5"] .hero .tree{z-index:0}
@media (max-width:760px){:root[data-version="5"] .hero::after{background:linear-gradient(180deg,rgba(var(--ink2-rgb),.8) 0%,rgba(var(--deep-rgb),.6) 45%,rgba(var(--deep-rgb),.5) 100%)}}

/* ---------- 8. falling leaves ---------- */
/* Each leaf is a column the full height of the hero; the inner element travels its own
   height, so the leaf always crosses the whole hero whatever size it is. */
:root:is([data-version="3"],[data-version="4"],[data-version="5"]) .hero .leaves{display:block;position:absolute;inset:0;z-index:1;pointer-events:none;overflow:hidden}
.leaf{position:absolute;top:0;left:var(--x);width:var(--s);height:100%;opacity:var(--o,.85)}
.leaf i{position:absolute;inset:0;animation:leaf-fall var(--d) linear var(--delay) infinite;will-change:transform}
.leaf svg{position:absolute;left:0;top:calc(var(--s) * -1.8);width:var(--s);height:calc(var(--s) * 1.5);fill:var(--gold-lt);animation:leaf-sway var(--sw) ease-in-out var(--delay) infinite alternate;transform-origin:50% 20%}
@keyframes leaf-fall{
  0%{transform:translate3d(0,0,0);opacity:0}
  8%{opacity:1}
  88%{opacity:1}
  100%{transform:translate3d(var(--drift),calc(100% + var(--s) * 3),0);opacity:0}
}
@keyframes leaf-sway{
  from{transform:translateX(calc(var(--s) * -.7)) rotate(-34deg)}
  to{transform:translateX(calc(var(--s) * .7)) rotate(28deg)}
}
@media (prefers-reduced-motion:reduce){.hero .leaves{display:none!important}}

/* the verse's second sentence takes its own line on wide screens */
.motto.turning p{max-width:none}
@media (max-width:640px){.motto.turning p br{display:none}}

/* Background toggle. White (the default) puts the top hero on white; the header bar; the bands below keep the chosen colour, with the chosen palette in the headings, buttons and accents. Colour restores the full coloured bands. The footer keeps its colour either way. */
.bgs{display:inline-flex;align-items:center;gap:.4rem}
.bgs button{font:inherit;letter-spacing:inherit;text-transform:inherit;color:inherit;background:transparent;border:1px solid rgba(0,0,0,.35);border-radius:999px;padding:.28rem .7rem;cursor:pointer}
.bgs button[aria-pressed="true"]{background:var(--wine-deep);color:var(--onwine);border-color:var(--wine-deep)}
@media (max-width:760px){.bgs{flex-wrap:wrap;justify-content:center}.bgs>span:first-child{display:none}.bgs button{padding:.22rem .55rem;white-space:nowrap}}

:root[data-bg="white"] body{background:#fff}
:root[data-bg="white"] :is(.hero,.page-head){
  --ink2-rgb:255,255,255; --deep-rgb:255,255,255;
  --onwine-rgb:var(--wine-rgb); --onwine:var(--ink); --onwine-soft:var(--soft);
  --gold-lt-rgb:var(--gold-rgb); --gold-lt:color-mix(in srgb,var(--gold) 88%,#000);
  --gold-text:color-mix(in srgb,var(--gold) 80%,#000); --soft-text:var(--soft);
  color:var(--ink);
}
:root[data-bg="white"] :is(.hero,.page-head){background:#fff !important}
:root[data-bg="white"] :is(.hero,.page-head){border-bottom:1px solid var(--gold-line)}
:root[data-bg="white"] :is(.hero,.page-head) :is(h1,h2,h3){color:var(--wine-deep);text-shadow:none !important}
:root[data-bg="white"] .hero h1 em,:root[data-bg="white"] .page-head h1 em{color:color-mix(in srgb,var(--gold) 92%,#000) !important;text-shadow:none !important}
:root[data-bg="white"] .hero :is(.astaught,.lead,.cap),:root[data-bg="white"] .page-head p{text-shadow:none !important}
:root[data-bg="white"] .hero .astaught{color:color-mix(in srgb,var(--gold) 80%,#000)}
:root[data-bg="white"] .hero .lead{color:var(--soft)}
:root[data-bg="white"] :is(.hero,.page-head) .btn.ghost{border-color:var(--gold);color:var(--wine-deep)}
:root[data-bg="white"] :is(.hero,.page-head) .btn.gold{background:var(--wine-deep);border-color:var(--wine-deep);color:#fff}
:root[data-bg="white"] :is(.hero,.page-head) .btn.gold:hover{background:var(--wine);border-color:var(--wine)}
:root[data-bg="white"]:is([data-version="1"],[data-version="5"]) .hero::after{background:linear-gradient(95deg,rgba(255,255,255,.96) 0%,rgba(255,255,255,.9) 36%,rgba(255,255,255,.55) 58%,rgba(255,255,255,0) 80%),linear-gradient(0deg,rgba(255,255,255,.5) 0%,rgba(255,255,255,0) 30%) !important}
@media (max-width:760px){:root[data-bg="white"]:is([data-version="1"],[data-version="5"]) .hero::after{background:linear-gradient(180deg,rgba(255,255,255,.92) 0%,rgba(255,255,255,.82) 55%,rgba(255,255,255,.6) 100%) !important}}
/* On the white hero the wheels get only a faint contact shadow, so no grey shows between the spokes. */
:root[data-bg="white"][data-version="2"] .hero .emblem img{filter:drop-shadow(0 4px 6px rgba(0,0,0,.08)) !important}
:root[data-bg="white"][data-version="4"] .hero .turning{filter:none !important}
/* White background, tree versions: a soft white halo lifts "Meditation" off the canopy */
:root[data-bg="white"]:is([data-version="3"],[data-version="4"],[data-version="5"]) .hero h1 em{color:color-mix(in srgb,var(--gold) 78%,#000) !important;text-shadow:0 0 2px #fff,0 0 3px #fff,0 0 10px #fff,0 0 22px #fff,0 0 40px rgba(255,255,255,.95) !important}
:root[data-bg="white"]:is([data-version="3"],[data-version="4"],[data-version="5"]) .hero .astaught{text-shadow:0 0 2px #fff,0 0 10px #fff,0 0 22px rgba(255,255,255,.9) !important}
/* White background, Version 4: the wheel fades out above the canopy so its rim never shows over the tree */
:root[data-bg="white"][data-version="4"] .hero .turning img{-webkit-mask-image:linear-gradient(180deg,transparent 0,transparent 22%,rgba(0,0,0,.5) 36%,#000 52%);mask-image:linear-gradient(180deg,transparent 0,transparent 22%,rgba(0,0,0,.5) 36%,#000 52%)}
:root[data-bg="white"][data-version="4"] .hero .turning::before,:root[data-bg="white"][data-version="4"] .hero .turning::after{display:none}

/* Locked burgundy preview: no toggles, so keep the preview note visible on phones. */
@media (max-width:760px){.demo>span:first-child{display:inline}}
