:root {
  --accent-color: #222222;
  --surface-color: rgba(0, 0, 0, 0.08);
  --surface-light-color:rgba(255, 255, 255, 0.2);
  --overlay-color: rgba(255, 255, 255, 0.5);
  color: var(--accent-color);
  --form-accent: rgb(51,122,183);
  /* keyboard focus outlines (≥3:1 against the theme background) */
  --focus-ring: var(--form-accent);
  --form-surface: rgba(255, 255, 255, 0.3);
  --form-success: rgb(53, 134, 99);
  /* dark enough for outlines and the error icon (≥3:1, WCAG 1.4.11); white text on it ≥4.5:1 */
  --form-error: rgb(200, 45, 45);
  color-scheme: light dark;

  /* Content tokens */
  --text-muted: color-mix(in srgb, var(--accent-color) 68%, transparent);
  --line-color: color-mix(in srgb, var(--accent-color) 14%, transparent);
  /* experience timeline line and dots: the theme's blue */
  --timeline-accent: var(--form-accent);
  /* inline links in running text: the theme's blue */
  --link-color: var(--form-accent);
  /* Skill level badges: ordinal scale in a single hue (indigo), identical
     in light and dark. Hierarchy = amount of fill:
     solid → strong tint → soft tint → dashed outline.
     Tints are translucent and text uses the theme color, so they adapt
     to each theme without inverting the scale. */
  --lvl-dominio-bg: #4f46e5;
  --lvl-dominio-fg: #ffffff;
  --lvl-dominio-border: #4f46e5;

  --lvl-buen-manejo-bg: rgba(99, 102, 241, 0.6);
  --lvl-buen-manejo-fg: var(--accent-color);
  --lvl-buen-manejo-border: rgba(99, 102, 241, 0.6);

  --lvl-funcional-bg: rgba(99, 102, 241, 0.12);
  --lvl-funcional-fg: var(--accent-color);
  --lvl-funcional-border: rgba(99, 102, 241, 0.6);

  --lvl-exploracion-bg: transparent;
  --lvl-exploracion-fg: var(--accent-color);
  --lvl-exploracion-border: #6366f1;
}

.dark {
  --accent-color: rgb(220, 220, 220);
  --surface-color: rgba(255, 255, 255, 0.08);
  --surface-light-color: var(--surface-color);
  --overlay-color: rgba(0, 0, 0, 0.2);
  color: var(--accent-color);
  /* deep green, the dark theme's own accent (was rgb(30, 75, 55): a touch
     lighter and more saturated so it reads less muddy on the glass) */
  --form-accent: rgb(32, 86, 62);
  /* the original light red reads better on the dark background */
  --form-error: rgb(255, 91, 91);
  /* the accent's green (same hue), lighter: --form-accent itself is too dark
     for a ring on the dark background */
  --focus-ring: rgb(107, 199, 158);
  --form-surface: rgba(255, 255, 255, 0.15);
  color-scheme: dark;

  /* Content tokens */
  --text-muted: color-mix(in srgb, var(--accent-color) 62%, transparent);
  --line-color: color-mix(in srgb, var(--accent-color) 12%, transparent);
  /* the light green of the focus ring: --form-accent is too dark here */
  --timeline-accent: var(--focus-ring);
  /* inline links: the light green, --form-accent is too dark here */
  --link-color: var(--focus-ring);}

.dark .glass {
  background: rgba(0, 0, 0, 0.33);
  outline: 2.5px solid rgba(255, 255, 255, 0.02);
  outline-offset: -1.5px;
}

/* Endless hue shift: only without reduced motion, and paused while off
   screen (.is-offscreen, js/ui/offscreen-pause.js). The dark tint stays
   static under reduced motion (first keyframe). */
.dark .glass-intense {
  filter: hue-rotate(-80deg) saturate(0.95) brightness(0.95);
}

@media (prefers-reduced-motion: no-preference) {
  .glass-intense {
    animation: hueShift 10s ease-in-out infinite;
  }

  .dark .glass-intense {
    animation: hueShiftDark 10s ease-in-out infinite;
  }
}

/* endless animations pause off screen (js/ui/offscreen-pause.js) */
.is-offscreen,
.is-offscreen::before,
.is-offscreen::after,
.is-offscreen * {
  animation-play-state: paused !important;
}

@keyframes hueShift {
  0% {
    filter: hue-rotate(-30deg);
  }
  50% {
    filter: hue-rotate(0deg);
  }
  100% {
    filter: hue-rotate(-30deg);
  }
}

@keyframes hueShiftDark {
  0% {
    filter: hue-rotate(-80deg) saturate(0.95) brightness(0.95);
  }
  50% {
    filter: hue-rotate(-50deg) saturate(0.95) brightness(0.95);
  }
  100% {
    filter: hue-rotate(-80deg) saturate(0.95) brightness(0.95);
  }
}

.dark .glass {
  &::before {
    background: radial-gradient(
      circle,
      rgba(0, 255, 119, 0.35),
      transparent 70%
    );
  }
  &::after {
    background: radial-gradient(
      circle,
      rgba(132, 0, 255, 0.28),
      transparent 70%
    );
  }
}
