
:root[data-theme="light"] {
  color-scheme: light;
  --fg:            14,14,22;
  --surface:       250,249,244;
  --bg:            #f5f4ee;
  --accent:        #d3001f;
  --ok:            #12823a;
  --warn:          rgba(190,30,40,0.9);
  --code-bg:       rgba(14,14,22,0.06);
  --video-filter:  brightness(1.8) saturate(0.9) blur(2px);
  --video-opacity: 0.14; 
  --grain-opacity: 0.32; 
  --border:        rgba(14,14,22,0.32);
  --border-soft:   rgba(14,14,22,0.14);
  --glow-red:      200,20,40;
  --glow-gray:     70,70,80;
  --glow-blue:     40,90,170;
  --glow-orange:   190,95,20;
  --glow-aqua:     15,120,115;
}

:root[data-theme="light"] .bg-video {
  filter: var(--video-filter) !important;
  opacity: var(--video-opacity) !important;
}

:root[data-theme="light"] .about,
:root[data-theme="light"] .socials a,
:root[data-theme="light"] .hud {
  text-shadow: 0 0 10px rgba(var(--surface), 0.95), 0 0 3px rgba(var(--surface), 0.8);
}
:root[data-theme="light"] .logo {
  text-shadow: 0 0 26px var(--accent), 0 0 12px rgba(var(--surface), 0.9);
}


:root[data-theme="light"] [style*="color:#fff"],
:root[data-theme="light"] [style*="color: #fff"],
:root[data-theme="light"] [style*="color:white"],
:root[data-theme="light"] [style*="color: white"] {
  color: rgb(var(--fg)) !important;
}

.theme-anim, .theme-anim *, .theme-anim *::before, .theme-anim *::after {
  transition-property: background-color, color, border-color, box-shadow, text-shadow,
                       fill, stroke, filter, opacity, transform !important;
  transition-duration: 0.4s !important;
  transition-timing-function: ease !important;
  transition-delay: 0s !important;
}

.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: max(14px, env(safe-area-inset-top)) 14px 0;
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s ease;
  animation: topIn 0.8s ease 0.2s backwards;
}
.topbar > * { pointer-events: auto; }
.topbar.is-hidden { opacity: 0; transform: translateY(-8px); }
.topbar.is-hidden > * { pointer-events: none; }
@keyframes topIn { from { opacity: 0; transform: translateY(-8px); } }

#home.center { padding-top: 72px; }

.ic { display: block; flex-shrink: 0; }

.mbtn {
  position: relative;
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0;
  background: none; border: none; border-radius: 0;
  color: rgba(var(--fg), 0.7);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: color 0.2s ease, background 0.2s ease;
}
.mbtn:hover  { color: rgb(var(--fg)); background: rgba(var(--fg), 0.08); }
.mbtn:active { background: rgba(var(--fg), 0.14); }
.mbtn .ic { width: 21px; height: 21px; }

.mood, .navbtn {
  --c: var(--glow-gray);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 0;
  transition: box-shadow 0.25s ease, border-color 0.25s ease, background 0.25s ease, color 0.2s ease;
}

@media (hover: hover) {
  .mood:hover, .navbtn:hover {
    background: rgba(var(--c), 0.05);
    border-color: rgba(var(--c), 0.55);
    box-shadow:
      0 0 10px rgba(var(--c), 0.35),
      0 0 28px rgba(var(--c), 0.18),
      inset 0 0 10px rgba(var(--c), 0.10);
  }
}
.navbtn:active {
  border-color: rgba(var(--c), 0.7);
  box-shadow: 0 0 8px rgba(var(--c), 0.4), inset 0 0 12px rgba(var(--c), 0.18);
}
.mood { padding: 2px; } 
.mood-row { display: flex; gap: 2px; }
.navbtn {
  width: auto; height: 44px;
  padding: 0 14px 0 12px;
  gap: 8px;
  border-radius: 0;
  font: inherit;
}
.navbtn-label {
  font-size: 12px;
  letter-spacing: 0.22em;
  line-height: 1;
  padding-top: 1px; 
}
.navbtn .ic { width: 22px; height: 22px; }


.theme-btn .ic {
  position: absolute; inset: 0; margin: auto;
  opacity: 0;
  transform: rotate(-120deg) scale(0.4);
  transition: opacity 0.25s ease, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}
html[data-theme-mode="auto"]  .theme-btn .t-auto,
html[data-theme-mode="light"] .theme-btn .t-light,
html[data-theme-mode="dark"]  .theme-btn .t-dark { opacity: 1; transform: none; }


#mainNav.active .actionBtn {
  animation: navDrop 0.6s ease backwards;
  animation-delay: calc(var(--i, 0) * 0.2s);
}
@keyframes navDrop { from { opacity: 0; transform: translateY(14px); } }
#mainNav .actionIcon .emoji { font-size: 2.4rem; line-height: 1; }

@media (prefers-reduced-motion: reduce) {
  #mainNav.active .actionBtn { animation: none; }
  .topbar { animation: none; }
  .theme-btn .ic { transition: none; }
}
