/* ===== AMBIENT READING — "Clear" glass (owner's choice, 4 Nov 2026) =====
   See-through panels: the living background stays sharp behind them, lightly dimmed for reading,
   with a bright light-catching rim and a thick-glass bevel instead of the old dark frost.
   Loaded on every page by tools/make.py. `html:root body` lifts these rules above each page's own styles. */
:root{
  --clear-fill:linear-gradient(160deg,rgba(255,255,255,.11),rgba(255,255,255,.03) 42%,rgba(255,255,255,.06));
  --clear-filter:blur(4px) saturate(1.7) brightness(.78);
  --clear-rim:linear-gradient(135deg,rgba(255,255,255,.85),rgba(255,255,255,.18) 26%,rgba(255,255,255,.04) 52%,rgba(255,255,255,.22) 80%,rgba(255,255,255,.6));
  --clear-bevel:inset 2px 2px 5px rgba(255,255,255,.16),inset -2px -3px 8px rgba(0,0,0,.28),inset 0 0 22px rgba(0,0,0,.14);
  --clear-shadow:0 14px 40px rgba(0,0,0,.32);
  --clear-text-shadow:0 1px 2px rgba(0,0,0,.45);
}
/* the Sunroom is the one bright world: clear glass there is a light, milky pane */
body[data-world="sunroom"]{
  --clear-fill:linear-gradient(160deg,rgba(255,255,255,.55),rgba(255,255,255,.22) 45%,rgba(255,255,255,.34));
  --clear-filter:blur(4px) saturate(1.3) brightness(1.04);
  --clear-rim:linear-gradient(135deg,rgba(255,255,255,1),rgba(255,255,255,.4) 30%,rgba(42,38,32,.08) 55%,rgba(255,255,255,.5) 85%,rgba(255,255,255,.9));
  --clear-bevel:inset 2px 2px 5px rgba(255,255,255,.7),inset -2px -3px 8px rgba(42,38,32,.08);
  --clear-shadow:0 14px 40px rgba(60,45,20,.14);
  --clear-text-shadow:none;
}

/* page width: on big screens the content spans three-quarters of the screen (owner's request); smaller screens unchanged */
html:root body .wrap{max-width:max(1200px,75vw)}
html:root body .hero-window{width:min(100%,max(430px,24vw))}

html:root body :is(.nav-glass,.meter,.sound-btn,.cta-ghost,.embed,.pair,.step,.choose,.codex-card,.petal,.preset,.c-btn,
  .room,.result,.note,.mood-list li a,.matrix-wrap,.glyph-toast,.hidden-banner,.atlas-tooltip,.world-inner,.wheel-core){
  background:var(--clear-fill);
  -webkit-backdrop-filter:var(--clear-filter);backdrop-filter:var(--clear-filter);
  border-color:rgba(255,255,255,.07);
  box-shadow:var(--clear-bevel),var(--clear-shadow);
  text-shadow:var(--clear-text-shadow);
}
/* elements that weren't positioned yet need it for the rim (the floating ones already are) */
html:root body :is(.nav-glass,.sound-btn,.cta-ghost,.embed,.pair,.step,.choose,.codex-card,.preset,.c-btn,
  .room,.result,.note,.mood-list li a,.matrix-wrap,.hidden-banner,.world-inner){position:relative}
/* the light-catching rim: a 1px gradient ring, brightest at the top-left and bottom-right */
html:root body :is(.nav-glass,.meter,.sound-btn,.cta-ghost,.embed,.pair,.step,.choose,.codex-card,.petal,.preset,.c-btn,
  .room,.result,.note,.mood-list li a,.matrix-wrap,.glyph-toast,.hidden-banner,.atlas-tooltip,.world-inner,.wheel-core)::before{
  content:"";position:absolute;inset:0;border-radius:inherit;padding:1px;pointer-events:none;z-index:2;
  background:var(--clear-rim);opacity:.8;transition:opacity .5s var(--ease-liquid,ease);
  -webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);-webkit-mask-composite:xor;
  mask:linear-gradient(#000 0 0) content-box exclude,linear-gradient(#000 0 0);
}
html:root body :is(.cta-ghost,.pair,.choose,.codex-card,.petal,.preset,.c-btn,.mood-list li a,.sound-btn,.world):hover::before,
html:root body .world:hover .world-inner::before{opacity:1}
/* the header and pop-up notes float over moving text, so they blur a little more to keep their words readable */
html:root body :is(.nav-glass,.meter,.sound-btn,.glyph-toast,.atlas-tooltip){
  -webkit-backdrop-filter:blur(10px) saturate(1.7) brightness(.72);backdrop-filter:blur(10px) saturate(1.7) brightness(.72)}
html:root body[data-world="sunroom"] :is(.nav-glass,.meter,.sound-btn,.glyph-toast){
  -webkit-backdrop-filter:blur(10px) saturate(1.3) brightness(1.04);backdrop-filter:blur(10px) saturate(1.3) brightness(1.04)}
/* selected states keep their colour on top of the glass */
html:root body :is(.preset.active,.petal[aria-selected="true"]){background:var(--amber);color:var(--oil);text-shadow:none}
html:root body .sound-btn[aria-pressed="true"]{border-color:rgba(224,154,78,.45)}
/* world cards: the coloured ring behind the blob gives way to the clear rim */
html:root body .world{background:none}
/* the soundscape cover keeps its colour, but lets the world show through */
html:root body .embed-face{background-color:transparent}
/* the pairing table's sticky header must stay readable while rows slide under it */
html:root body .matrix thead th{background:rgba(8,7,12,.55);-webkit-backdrop-filter:blur(14px) saturate(1.4);backdrop-filter:blur(14px) saturate(1.4)}
html:root body[data-world="sunroom"] .matrix thead th{background:rgba(255,252,245,.7)}

/* people who ask their device for less transparency (on Windows: "Transparency effects" off) get frosted panels instead */
@media (prefers-reduced-transparency:reduce){
  :root{--clear-fill:linear-gradient(rgba(16,14,24,.82),rgba(16,14,24,.82));--clear-filter:blur(20px) saturate(1.2);--clear-text-shadow:none}
  body[data-world="sunroom"]{--clear-fill:linear-gradient(rgba(255,252,245,.9),rgba(255,252,245,.9));--clear-filter:blur(20px)}
  html:root body :is(.nav-glass,.meter,.sound-btn,.glyph-toast,.atlas-tooltip){-webkit-backdrop-filter:var(--clear-filter);backdrop-filter:var(--clear-filter)}
}
/* browsers without backdrop blur: a slightly deeper tint so text stays readable */
@supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))){
  html:root body :is(.nav-glass,.meter,.sound-btn,.cta-ghost,.embed,.pair,.step,.choose,.codex-card,.petal,.preset,.c-btn,
    .room,.result,.note,.mood-list li a,.matrix-wrap,.glyph-toast,.hidden-banner,.atlas-tooltip,.world-inner,.wheel-core){background:rgba(16,14,24,.62)}
}
