:root {
  --accent: #8B5CF6;
  --accent-light: #A78BFA;
  --glass-blur: 16px;
  --cursor-dot-size: 7px;
  --cursor-ring-size: 32px;
}

/* A light glass surface keeps the existing black text readable. */
:where(.glass) { position: relative; border-radius: var(--radius-md); }
.glass {
  isolation: isolate;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background-color: rgba(255, 255, 255, 0.06);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(140%);
  backdrop-filter: blur(var(--glass-blur)) saturate(140%);
  box-shadow: 0 10px 30px rgba(139, 92, 246, 0.10);
}
.nav-pill.glass, .mini-site.glass, .game-card.glass,
.code-card.glass, .craft-card.glass { background-color: rgba(255, 255, 255, 0.88); }
.service-feature.glass { background-color: rgba(238, 232, 255, 0.82); }
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .glass { background-color: #f7f4ff; }
}
html[data-theme="dark"] .glass { border-color: var(--color-rule); background-color: oklch(20% 0.018 270 / 0.9); }
html[data-theme="dark"] .nav-pill.glass,
html[data-theme="dark"] .mini-site.glass,
html[data-theme="dark"] .game-card.glass,
html[data-theme="dark"] .code-card.glass,
html[data-theme="dark"] .craft-card.glass { background-color: oklch(21% 0.016 270 / 0.94); }
html[data-theme="dark"] .service-feature.glass { background-color: var(--color-pale-blue); }
@media (hover: hover) and (pointer: fine) {
  .glass::after {
    content: "";
    position: absolute;
    z-index: 3;
    inset: 0;
    border: 1px solid transparent;
    border-radius: inherit;
    background: radial-gradient(200px circle at var(--x, 50%) var(--y, 50%), rgba(167, 139, 250, 0.85), transparent 74%) border-box;
    -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
  }
  .glass:hover::after { opacity: 1; }
}
/* The source text stays in the DOM; JS only wraps visible words. */
[data-anim="words"] .anim-word { display: inline-block; will-change: transform, opacity; }
[data-anim="scramble"] { color: var(--accent); }
[data-anim="fade-up"].effect-fade-ready { opacity: 0; transform: translate3d(0, 18px, 0); will-change: transform, opacity; }
[data-anim="fade-up"].effect-fade-ready.effect-visible { opacity: 1; transform: translate3d(0, 0, 0); transition: opacity 650ms cubic-bezier(.16, 1, .3, 1), transform 650ms cubic-bezier(.16, 1, .3, 1); }

.cursor-dot, .cursor-ring {
  position: fixed;
  z-index: 1300;
  top: 0;
  left: 0;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  will-change: transform, opacity;
}
.cursor-dot { width: var(--cursor-dot-size); height: var(--cursor-dot-size); background: var(--accent); }
.cursor-ring { width: var(--cursor-ring-size); height: var(--cursor-ring-size); border: 1.5px solid var(--accent); box-shadow: 0 0 0 rgba(167, 139, 250, 0); }
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  html.cursor-active, html.cursor-active body, html.cursor-active a,
  html.cursor-active button, html.cursor-active [data-cursor="hover"] { cursor: none; }
  html.cursor-active input, html.cursor-active textarea,
  html.cursor-active select, html.cursor-active [contenteditable="true"] { cursor: text; }
  html.cursor-active .cursor-dot, html.cursor-active .cursor-ring { opacity: 1; }
  html.cursor-hover .cursor-ring { border-color: var(--accent-light); box-shadow: 0 0 18px rgba(167, 139, 250, 0.5); }
  html.cursor-text .cursor-dot, html.cursor-text .cursor-ring { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  [data-anim="fade-up"].effect-fade-ready { opacity: 1; transform: none; }
  [data-anim="words"] .anim-word { opacity: 1 !important; transform: none !important; }
  .cursor-dot, .cursor-ring { display: none; }
  .glass::after { display: none; }
}
