/* ==========================================================================
   Liquid glass layer for ranranli.net
   Loaded after style.css; everything here can be removed by deleting the
   <link> to this file and restoring the old <nav> block.
   ========================================================================== */

:root {
    --lg-tint: rgba(255, 255, 255, 0.075);
    --lg-tint-strong: rgba(255, 255, 255, 0.14);
    --lg-edge: rgba(255, 255, 255, 0.2);
    --lg-edge-soft: rgba(255, 255, 255, 0.09);
    --lg-highlight: rgba(255, 255, 255, 0.42);
    --lg-shadow: 0 18px 50px rgba(5, 10, 25, 0.32);
    --lg-blur: 20px;
    --lg-ease-spring: cubic-bezier(0.32, 1.32, 0.48, 1);
    --lg-ink: #0f172a;
}

/* --------------------------------------------------------------------------
   Shared glass recipe
   -------------------------------------------------------------------------- */
.glass-surface,
.glass-panel,
.glass-nav {
    position: relative;
    background:
        linear-gradient(180deg, var(--lg-tint-strong), var(--lg-tint) 42%, rgba(255, 255, 255, 0.04));
    -webkit-backdrop-filter: blur(var(--lg-blur)) saturate(175%);
    backdrop-filter: blur(var(--lg-blur)) saturate(175%);
    border: 1px solid var(--lg-edge-soft);
    border-top-color: var(--lg-edge);
    box-shadow:
        inset 0 1px 0 var(--lg-highlight),
        inset 0 -1px 1px rgba(255, 255, 255, 0.06),
        inset 0 0 0 0.5px rgba(255, 255, 255, 0.06),
        var(--lg-shadow);
}

/* specular sheen: a soft light catching the upper-left rim */
.glass-panel::before,
.glass-nav::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background:
        radial-gradient(120% 70% at 12% -20%, rgba(255, 255, 255, 0.22), transparent 55%),
        radial-gradient(80% 60% at 100% 120%, rgba(147, 197, 253, 0.1), transparent 60%);
    mix-blend-mode: screen;
}

/* Chromium only: real refraction of what sits behind the glass */
html.lg-refract .glass-nav {
    -webkit-backdrop-filter: blur(3px) url(#lg-refraction) blur(10px) saturate(180%);
    backdrop-filter: blur(3px) url(#lg-refraction) blur(10px) saturate(180%);
}

/* --------------------------------------------------------------------------
   Navigation: floating capsule with a sliding white thumb
   -------------------------------------------------------------------------- */
.glass-nav-wrap {
    position: sticky;
    top: 14px;
    z-index: 50;
    display: flex;
    justify-content: center;
    padding: 0 12px;
    pointer-events: none;
}

.glass-nav {
    pointer-events: auto;
    /* a smoky base keeps white labels readable over light figures */
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.05)),
        rgba(22, 30, 48, 0.42);
    max-width: 100%;
    border-radius: 999px;
    padding: 6px;
    text-transform: none;
}

.glass-nav-track {
    position: relative;
    display: flex;
    align-items: center;
    gap: 2px;
    overflow-x: auto;
    scrollbar-width: none;
    border-radius: 999px;
}
.glass-nav-track::-webkit-scrollbar { display: none; }

.glass-nav-thumb {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: linear-gradient(180deg, #ffffff, #eef2f8);
    box-shadow:
        0 6px 18px rgba(8, 14, 30, 0.28),
        inset 0 1px 0 #ffffff,
        inset 0 -1px 2px rgba(15, 23, 42, 0.08);
    opacity: 0;
    transform: translateX(0);
    transition:
        transform 460ms var(--lg-ease-spring),
        width 460ms var(--lg-ease-spring),
        opacity 200ms ease;
    pointer-events: none;
    z-index: 0;
}
.glass-nav-thumb.is-ready { opacity: 1; }
.glass-nav-thumb.no-anim { transition: none; }

.glass-nav-item {
    position: relative;
    z-index: 1;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 44px;
    padding: 0 17px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.005em;
    color: rgba(241, 245, 249, 0.86);
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(8, 14, 30, 0.45);
    transition: color 260ms ease, text-shadow 260ms ease;
}

.glass-nav-item:hover { color: #ffffff; }

.glass-nav-item.is-current,
.glass-nav-item.is-current:hover { color: var(--lg-ink); text-shadow: none; }

.glass-nav-item.glass-nav-brand {
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 14px;
    font-weight: 700;
}

.glass-nav-ext {
    font-size: 10px;
    opacity: 0.55;
    transform: translateY(-3px);
}

.glass-nav-sep {
    flex: 0 0 1px;
    align-self: center;
    height: 20px;
    margin: 0 4px;
    background: rgba(255, 255, 255, 0.18);
    position: relative;
    z-index: 1;
}

.glass-nav-item:focus-visible {
    outline: 2px solid #6ee7b7;
    outline-offset: -2px;
}

@media (max-width: 767px) {
    .glass-nav-wrap { top: 10px; padding: 0 10px; }
    .glass-nav { padding: 5px; }
    .glass-nav-item { height: 40px; padding: 0 14px; font-size: 14px; }
    /* fade only the side that has more to swipe to */
    .glass-nav-track.more-right {
        -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
        mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
    }
    .glass-nav-track.more-left {
        -webkit-mask-image: linear-gradient(90deg, transparent, #000 28px);
        mask-image: linear-gradient(90deg, transparent, #000 28px);
    }
    .glass-nav-track.more-left.more-right {
        -webkit-mask-image: linear-gradient(90deg, transparent, #000 28px, #000 calc(100% - 28px), transparent);
        mask-image: linear-gradient(90deg, transparent, #000 28px, #000 calc(100% - 28px), transparent);
    }
}

/* --------------------------------------------------------------------------
   Content panels
   -------------------------------------------------------------------------- */
.glass-panel {
    border-radius: 26px;
    padding: 28px 30px;
}

.glass-panel > * { position: relative; }

@media (max-width: 767px) {
    .glass-panel { padding: 22px 18px; border-radius: 22px; }
}

/* hero: glass ring round the portrait, glass buttons for the links */
.main-profile-panel img.rounded-full {
    padding: 6px;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.08) 45%, rgba(147, 197, 253, 0.25));
    box-shadow: 0 20px 50px rgba(5, 10, 25, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.main-profile-panel ul a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.05));
    -webkit-backdrop-filter: blur(14px) saturate(170%);
    backdrop-filter: blur(14px) saturate(170%);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 8px 20px rgba(5, 10, 25, 0.25);
    transition: transform 300ms var(--lg-ease-spring), background 200ms ease;
}
.main-profile-panel ul a:hover {
    transform: translateY(-2px) scale(1.06);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0.08));
}
.main-profile-panel ul a i { font-size: 22px !important; line-height: 1; }
.main-profile-panel ul.space-x-4 > * + * { margin-left: 0.75rem; }

/* Visualize gallery: rounded, slightly see-through tiles */
#Visualize .gallery { gap: 12px; }

#Visualize .image-container {
    background-color: rgba(255, 255, 255, 0.84);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 10px 26px rgba(5, 10, 25, 0.28);
    transition: transform 300ms var(--lg-ease-spring), background-color 200ms ease;
}

/* white in the figures takes on the tile's translucency */
#Visualize .image-container img {
    border-radius: 10px;
    mix-blend-mode: multiply;
}

#Visualize .image-container:hover {
    background-color: rgba(255, 255, 255, 0.94);
    transform: translateY(-2px);
}

/* Contact: lighter, more see-through glass */
#Contact .glass-panel {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015));
    -webkit-backdrop-filter: blur(10px) saturate(140%);
    backdrop-filter: blur(10px) saturate(140%);
    border-color: rgba(255, 255, 255, 0.06);
    border-top-color: rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 12px 32px rgba(5, 10, 25, 0.16);
}
#Contact .glass-panel::before { opacity: 0.4; }

/* footer: low-key dark slab with a hairline edge */
footer.glass-panel {
    background: rgba(12, 17, 30, 0.45);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 0;
    border-top: 0.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 22px 22px 0 0;
    box-shadow: none;
    padding: 20px 24px;
}
footer.glass-panel::before { display: none; }
footer.glass-panel p { font-size: 0.78rem; line-height: 1.6; color: rgba(203, 213, 225, 0.55); }
footer.glass-panel p.uppercase { letter-spacing: 0.12em; color: rgba(226, 232, 240, 0.65); }

@media (prefers-reduced-motion: reduce) {
    .glass-nav-thumb { transition: opacity 150ms ease; }
}

@media (prefers-reduced-transparency: reduce) {
    .glass-surface, .glass-panel, .glass-nav {
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
        background: rgba(30, 41, 59, 0.96);
    }
}
