/* Shared portfolio theme toggle, including its existing sun/moon masks. */
.theme-toggle {
--icon-sun: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 2V4M12 20V22M4.93 4.93L6.34 6.34M17.66 17.66L19.07 19.07M2 12H4M20 12H22M6.34 17.66L4.93 19.07M19.07 4.93L17.66 6.34M16 12C16 14.2091 14.2091 16 12 16C9.79086 16 8 14.2091 8 12C8 9.79086 9.79086 8 12 8C14.2091 8 16 9.79086 16 12Z' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
--icon-moon: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20.985 12.4859C20.8912 14.2221 20.2966 15.8939 19.273 17.2993C18.2494 18.7047 16.8406 19.7836 15.217 20.4054C13.5933 21.0273 11.8243 21.1655 10.1237 20.8034C8.42318 20.4414 6.86392 19.5944 5.63442 18.3651C4.40493 17.1357 3.55785 15.5765 3.19558 13.876C2.83331 12.1755 2.97136 10.4065 3.59304 8.78273C4.21472 7.159 5.29342 5.7501 6.69874 4.72635C8.10406 3.70259 9.77583 3.10782 11.512 3.01391C11.917 2.99191 12.129 3.47391 11.914 3.81691C11.1949 4.96746 10.8869 6.32778 11.0405 7.67586C11.194 9.02394 11.7999 10.2802 12.7593 11.2396C13.7187 12.199 14.9749 12.8049 16.323 12.9584C17.6711 13.1119 19.0314 12.804 20.182 12.0849C20.526 11.8699 21.007 12.0809 20.985 12.4859Z' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
      .theme-toggle {
        position: fixed;
        top: 1rem;
        right: 1rem;
        z-index: 55;
        display: inline-flex;
        align-items: center;
        gap: 0.25rem;
        padding: 0.25rem;
        border: 1px solid var(--theme-toggle-border);
        border-radius: 999px;
        background: var(--theme-toggle-bg);
        box-shadow: 0 1.25rem 3rem rgba(0, 0, 0, 0.18);
        backdrop-filter: blur(18px);
      }

      .theme-toggle-button {
        position: relative;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 2.35rem;
        height: 2.35rem;
        border: 1px solid transparent;
        border-radius: 999px;
        background: transparent;
        color: var(--theme-icon-color);
        cursor: pointer;
        transition:
          background 180ms ease,
          border-color 180ms ease,
          transform 180ms var(--panel-ease),
          opacity 180ms ease;
      }

      .theme-toggle-button:hover,
      .theme-toggle-button:focus-visible {
        background: var(--theme-toggle-button-bg);
      }

      .theme-toggle-button:focus-visible {
        outline: 2px solid var(--cyan);
        outline-offset: 0.15rem;
      }

      .theme-toggle-button.is-active {
        background: var(--theme-toggle-active-bg);
        border-color: var(--theme-toggle-border);
      }

      .theme-toggle-button:active {
        transform: scale(0.94);
      }

      .theme-icon {
        display: block;
        width: 1.15rem;
        height: 1.15rem;
        background: var(--theme-icon-color);
        mask: var(--theme-icon) center / contain no-repeat;
        -webkit-mask: var(--theme-icon) center / contain no-repeat;
        pointer-events: none;
      }

      .theme-icon.is-moon {
        --theme-icon: var(--icon-moon);
      }

      .theme-icon.is-sun {
        --theme-icon: var(--icon-sun);
      }

@media(prefers-reduced-motion:reduce) { .theme-toggle-button { transition:none; } }
