:root {
    --bg-light: #ffffff;
    --text-light: #000000;
    --card-bg-light: #f4f4f4;
    --hover-light: #e0e0e0;

    --bg-dark: #0e0e0e;
    --text-dark: #ffffff;
    --card-bg-dark: #1a1a1a;
    --hover-dark: #222;

    --gold: #ffd700;
    --radius: 12px;
    --transition: all 0.3s ease;
}

[data-theme="dark"] {
    --bg: var(--bg-dark);
    --text: var(--text-dark);
    --card-bg: var(--card-bg-dark);
    --hover: var(--hover-dark);
}

[data-theme="light"] {
    --bg: var(--bg-light);
    --text: var(--text-light);
    --card-bg: var(--card-bg-light);
    --hover: var(--hover-light);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    transition: var(--transition);
}

.container {
    max-width: 480px;
    width: 100%;
    background-color: var(--card-bg);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    text-align: center;
    transition: var(--transition);
}

.avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1rem;
    border: 2px solid var(--gold);
}

h1 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.bio {
    font-size: 1rem;
    color: #888;
    margin-bottom: 1.5rem;
}

.links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.link {
    background-color: var(--hover);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--text);
    transition: var(--transition);
    font-weight: 500;
}

.link:hover {
    opacity: 0.8;
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.social-icons a {
    color: var(--text);
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

.social-icons a:hover {
    top: 10px;
}

.social-icons svg {
    width: 36px;
    height: 36px;
    fill: var(--text);
}

.footer {
    margin-top: 2rem;
    font-size: 0.8rem;
    color: #666;
}

.credit {
    margin-top: 0.75rem;
    font-size: 0.75rem;
    color: #777;
}

.credit a {
    color: var(--text);
    text-decoration: underline;
    transition: var(--transition);
    display: inline-block;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.theme-toggle {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
}

.theme-toggle:hover {
    opacity: 0.8;
}

/* Responsive adjustments for mobile */
@media (max-width: 400px) {
    body {
        padding: 1rem;
    }
    .container {
        padding: 1.5rem;
    }
    .avatar {
        width: 80px;
        height: 80px;
    }
    h1 {
        font-size: 1.5rem;
    }
    .bio {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }
    .links {
        margin-bottom: 1.5rem;
    }
    .link {
        padding: 0.6rem 0.8rem;
        font-size: 0.9rem;
    }
    .social-icons {
        gap: 0.8rem;
    }
    .social-icons a {
        width: 30px;
        height: 30px;
    }
    .social-icons svg {
        width: 30px;
        height: 30px;
    }
    .footer {
        margin-top: 1.5rem;
        font-size: 0.7rem;
    }
    .credit {
        margin-top: 0.5rem;
        font-size: 0.65rem;
    }
}

/* ============================================
   NEON APERTURE PANELS - LINK BUTTONS
   ============================================ */

/* Register --angle so browsers can interpolate it in keyframes */
@property --angle {
    syntax: "<angle>";
    initial-value: 0deg;
    inherits: false;
}

/* Rarity color palettes */
[data-rarity="common"] {
    --core: #8b9dc3;
    --accent: #5d6d7e;
    --glow: rgba(139, 157, 195, 0.25);
}

[data-rarity="uncommon"] {
    --core: #00ff88;
    --accent: #00cc6a;
    --glow: rgba(0, 255, 136, 0.3);
}

[data-rarity="rare"] {
    --core: #00d4ff;
    --accent: #0099cc;
    --glow: rgba(0, 212, 255, 0.35);
}

[data-rarity="epic"] {
    --core: #bf00ff;
    --accent: #9900cc;
    --glow: rgba(191, 0, 255, 0.35);
}

[data-rarity="legendary"] {
    --core: #ffaa00;
    --accent: #ff6600;
    --glow: rgba(255, 170, 0, 0.4);
}

[data-rarity="mythic"] {
    --core: #ff3366;
    --accent: #ff0033;
    --glow: rgba(255, 51, 102, 0.4);
}

/* Animation speed control */
.aperture {
    --speed: 3s;
    --thickness: 1px;
    --stroke-color: rgba(255, 255, 255, 0.08);
}

/* Link-in-bio aperture button */
.link.aperture {
    --border-radius-values: 14px;
    --thickness: 6px;

    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 60px;
    height: auto;
    padding: 1.2rem 1.4rem;
    margin: 0;
    border-radius: var(--border-radius-values);
    text-decoration: none;
    text-align: center;
    isolation: isolate;
    color: #fff;
    background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01)), #151515;
    border: none;
    box-shadow: 0 0 0 1px var(--stroke-color), inset 0 0 0 1px rgba(255,255,255,.04), 0 0 18px var(--glow), inset 0 20px 70px rgba(0,0,0,.55);
    transition: transform 0.25s ease, filter 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

/* Spinning gradient border — masked conic-gradient preserves border-radius */
.link.aperture::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: var(--thickness);
    background: conic-gradient(from var(--angle), var(--core) 8%, transparent 18% 70%, var(--accent) 78%, transparent 86% 100%);
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask-composite: exclude;
    pointer-events: none;
    animation: spin var(--speed) linear infinite;
}

/* Outer glow */
.link.aperture::after {
    content: "";
    position: absolute;
    inset: -12px;
    border-radius: inherit;
    background: conic-gradient(from var(--angle), var(--core), transparent, var(--accent));
    filter: blur(18px);
    opacity: .24;
    z-index: -1;
    pointer-events: none;
    animation: spin var(--speed) linear infinite;
}

.link.aperture:hover {
    transform: translateY(-2px);
    filter: brightness(1.08) saturate(1.15);
    box-shadow: 0 0 0 1px var(--stroke-color), inset 0 0 0 1px rgba(255,255,255,.06), 0 0 24px var(--glow), inset 0 20px 70px rgba(0,0,0,.45);
}

.link.aperture:focus-visible {
    outline: 2px solid rgba(255,255,255,0.8);
    outline-offset: 3px;
}

.link__label {
    position: relative;
    z-index: 2;
    display: inline-block;
}

/* Animation variants — target pseudo-elements */
.link.aperture.sweep::before,
.link.aperture.sweep::after {
    animation-direction: normal;
}

.link.aperture.ripple::before,
.link.aperture.ripple::after {
    animation-direction: reverse;
}

.link.aperture.steady::before {
    animation: none;
}

.link.aperture.steady::after {
    animation: bloom 3.2s ease-in-out infinite;
}

/* Keyframes */
@keyframes spin {
    from { --angle: 0deg; }
    to   { --angle: 360deg; }
}

@keyframes bloom {
    0%, 100% {
        opacity: 0.2;
        filter: blur(16px);
    }
    50% {
        opacity: 0.35;
        filter: blur(20px);
    }
}

/* JS fallback class — disables CSS animations so JS can drive --angle */
.js-spin-fallback .link.aperture::before,
.js-spin-fallback .link.aperture::after {
    animation: none !important;
}

.js-spin-fallback .link.aperture.steady::after {
    animation: bloom 3.2s ease-in-out infinite !important;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .link.aperture::before,
    .link.aperture::after {
        animation: none !important;
        transition: none !important;
    }
}
