
:root { --wash: 0,0,0; --washA: 0; }
:root[data-theme="light"] { --wash: 245,244,238; --washA: 0.82; }


.fullscreen { background: transparent; }
.fullscreen h2 { text-shadow: 0 0 18px var(--sc, transparent); }

#scene {
  position: fixed; inset: 0; z-index: -1;
  opacity: 0; pointer-events: none;
  transition: opacity 0.8s ease;
}
#scene.on { opacity: 1; }
#scene > * { position: absolute; inset: 0; }
.sc-base  { background: var(--bg); }            
.sc-layers { }
.sc-bg    { opacity: 0; transition: opacity 0.9s ease; }
.sc-bg.on { opacity: 1; }
.sc-wash  { background: rgb(var(--wash)); opacity: var(--washA); }   
#sceneFx  { width: 100%; height: 100%; transition: opacity 0.35s ease; }
#sceneFx.out { opacity: 0; }

.sc-x { pointer-events: none; }
.sc-trees { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 38vh; fill: #02060a; }
.sc-rec {
  position: absolute; top: calc(env(safe-area-inset-top, 0px) + 14px); right: 16px;
  font-size: 12px; letter-spacing: 0.2em; color: #ff4d4d;
  animation: scRec 1.2s steps(2) infinite;
}
@keyframes scRec { 50% { opacity: 0.25; } }


body[data-scene="whitegirl"] #dynamicContent h2 { animation: scFlick 3.2s infinite; }
body[data-scene="fanomaly"]  #dynamicContent h2 { animation: scJit 6s infinite; }
@keyframes scFlick { 0%,100%,41%,47%,69%,73% { opacity: 1; } 43% { opacity: 0.2; } 45% { opacity: 0.8; } 71% { opacity: 0.5; } }
@keyframes scJit   { 0%,92%,100% { transform: none; } 94% { transform: translate(-3px,1px); } 96% { transform: translate(3px,-1px); } }


#scDark {
  position: fixed; inset: 0; z-index: 4; pointer-events: none;
  background: #000; opacity: 0; transition: opacity 0.5s ease;
  -webkit-mask: radial-gradient(circle 120px at var(--x, 50%) var(--y, 45%), transparent 0, transparent 35%, #000 100%);
          mask: radial-gradient(circle 120px at var(--x, 50%) var(--y, 45%), transparent 0, transparent 35%, #000 100%);
}
#scDark.on { opacity: 0.94; }
.fl-btn {
  position: fixed; right: 14px; bottom: max(14px, env(safe-area-inset-bottom)); z-index: 6;
  width: 44px; height: 44px; display: none; align-items: center; justify-content: center;
  font-size: 20px; line-height: 1;
  background: rgba(var(--surface), 0.55); border: 1px solid var(--border); color: inherit;
  cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.fl-btn.show { display: flex; }
.fl-btn.on { border-color: var(--sc); box-shadow: 0 0 12px var(--sc); }

@media (prefers-reduced-motion: reduce) {
  .sc-rec, #dynamicContent h2 { animation: none !important; }
}


.actionBtn { position: relative; overflow: hidden; min-height: 84px; }
.actionBtn > .actionIcon {
  position: absolute; left: 0; top: 0; bottom: 0; width: 60%; height: auto;
  -webkit-mask-image: linear-gradient(90deg, #000 0%, rgba(0,0,0,.85) 35%, transparent 100%);
          mask-image: linear-gradient(90deg, #000 0%, rgba(0,0,0,.85) 35%, transparent 100%);
}
.actionBtn > .actionIcon img { width: 100%; height: 100%; object-fit: cover; object-position: left center; opacity: .85; }
.actionBtn > .actionContent { position: relative; z-index: 1; margin-left: auto; }


#mainNav .actionList { display: grid; grid-template-columns: repeat(4, 1fr); max-width: none; gap: 8px; }
#mainNav .actionBtn {
  min-width: 0; min-height: 176px; padding: 0;
  flex-direction: column; justify-content: flex-end; align-items: stretch; text-align: left;
}
#mainNav .actionBtn > .actionIcon {
  width: 100%;
  background: linear-gradient(160deg, rgba(var(--c), .5), rgba(var(--c), .05) 70%);   /* пока нет картинки */
  -webkit-mask-image: none; mask-image: none;
}
#mainNav .actionBtn > .actionIcon img { opacity: 1; object-position: center; }
#mainNav .actionBtn::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, rgb(var(--surface)) 0%, rgba(var(--surface), .78) 30%, transparent 72%);
}
#mainNav .actionBtn > .actionContent { padding: 10px 8px 12px; margin: 0; }
#mainNav .actionTitle { font-size: clamp(.58rem, 2.9vw, .8rem); letter-spacing: .03em; }
#mainNav .actionDesc  { font-size: .55rem; }


:root[data-theme="light"] #dynamicContent ::placeholder { color: rgba(var(--fg), .45) !important; }


@media (max-width: 340px) {
  #mainNav .actionList { grid-template-columns: repeat(2, 1fr); }
}


.grain { transition: opacity 0.6s ease; }
body[data-scene]:not([data-scene="home"]) .grain { opacity: 0; }

.amb-btn {
  position: fixed; left: 14px; bottom: max(14px, env(safe-area-inset-bottom)); z-index: 6;
  width: 44px; height: 44px; display: none; align-items: center; justify-content: center;
  background: rgba(var(--surface), 0.55); border: 1px solid var(--border); color: inherit;
  cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.amb-btn.show { display: flex; }
.amb-btn:not(.off) { border-color: var(--sc); box-shadow: 0 0 10px var(--sc); }
.amb-btn .ic { width: 22px; height: 22px; display: block; }


.sc-forest { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 58vh; }
.sc-forest .far { filter: drop-shadow(0 0 4px rgba(255, 150, 70, .34)); }
.sc-forest .mid { filter: drop-shadow(0 0 6px rgba(255, 140, 60, .26)); }
.sc-trees { filter: drop-shadow(0 0 7px rgba(255, 150, 70, .30)); }

body[data-dark] {
  color-scheme: dark;
  --fg: 255,255,255; --surface: 8,8,14; --bg: #05050a; --accent: #ff0000;
  --ok: #88ff88; --warn: rgba(255,120,120,0.85); --code-bg: #000;
  --wash: 0,0,0; --washA: 0; --grain-opacity: 0.12;
  --glow-red: 255,40,40; --glow-gray: 200,200,200; --glow-blue: 180,210,255; --glow-orange: 255,190,130; --glow-aqua: 140,220,210;
  --border: rgba(var(--fg), 0.18); --border-soft: rgba(var(--fg), 0.08); --text: rgba(var(--fg), 0.87);
}


#dynamicPage.view-menu #dynamicContent { border: 0; padding: 0; margin-top: 0; }
#dynamicPage.view-menu > h2,
#dynamicPage.view-menu > .back[data-back] { display: none; }


.logo { font-size: clamp(1.6rem, 7vw, 2.4rem); }
