/* ==========================================================================
   Liquid Glass layer on top of app.css (body.lg, set in layouts/main.php)
   Apple-style translucent material: blur + saturation, a bright specular
   rim, soft inner glow, capsule shapes, and a floating detached nav bar.
   ========================================================================== */

.lg {
    --glass-bg: rgba(255, 255, 255, .22);
    --glass-bg-strong: rgba(255, 255, 255, .38);
    --glass-blur: blur(22px) saturate(190%);
    --glass-rim:
        inset 0 1px 0 rgba(255, 255, 255, .85),      /* top highlight */
        inset 0 -1px 0 rgba(255, 255, 255, .25),     /* bottom catch-light */
        inset 1px 0 0 rgba(255, 255, 255, .35),
        inset -1px 0 0 rgba(255, 255, 255, .35),
        inset 0 0 24px rgba(255, 255, 255, .18);     /* inner glow */
    --glass-drop: 0 10px 40px -10px rgba(20, 20, 40, .28), 0 2px 6px rgba(20, 20, 40, .06);
    --line: rgba(13, 13, 13, .10);
    --tint: transparent;
    background: #f4f1ea;
}

/* Colourful wallpaper behind everything so the glass has something to refract */
.lg::before {
    content: ""; position: fixed; inset: -10vmax; z-index: -10; pointer-events: none;
    background:
        radial-gradient(40vmax 40vmax at 15% 20%, rgba(255, 210, 31, .75), transparent 60%),
        radial-gradient(35vmax 35vmax at 85% 15%, rgba(255, 140, 90, .45), transparent 60%),
        radial-gradient(45vmax 45vmax at 75% 80%, rgba(110, 170, 255, .45), transparent 60%),
        radial-gradient(35vmax 35vmax at 20% 85%, rgba(190, 130, 255, .35), transparent 60%);
    filter: blur(20px);
    animation: lg-drift 30s ease-in-out infinite alternate;
}
@keyframes lg-drift {
    to { transform: translate3d(3vmax, -2vmax, 0) rotate(8deg) scale(1.05); }
}

/* Reusable glass recipe */
.lg .site-header__inner,
.lg .project-card,
.lg .stats,
.lg .chips li,
.lg .social a,
.lg .btn--ghost,
.lg .btn--primary,
.lg .slider__dots,
.lg .slider__slide figcaption,
.lg .wwdc__item figcaption,
.lg .timeline__item,
.lg .press,
.lg .mini-card,
.lg .pager__link,
.lg .cta__inner {
    background: var(--glass-bg);
    -webkit-backdrop-filter: var(--glass-blur);
            backdrop-filter: var(--glass-blur);
    box-shadow: var(--glass-rim), var(--glass-drop);
    border: 0;
}

/* ---------- Floating nav capsule ---------- */
.lg .site-header {
    background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none;
    border: 0 !important; padding-top: 14px;
}
.lg .site-header__inner {
    height: 60px; border-radius: 999px; padding: 0 10px 0 24px;
    max-width: calc(var(--container) - 2 * var(--gutter));
    width: calc(100% - 2 * var(--gutter));
    /* Thicker glass than the content panels: the nav floats over busy screenshots and photos,
       so it needs a heavy blur and a mostly-opaque fill to keep the links readable. */
    background: rgba(255, 255, 255, .72);
    -webkit-backdrop-filter: blur(30px) saturate(180%); backdrop-filter: blur(30px) saturate(180%);
}
.lg .site-nav ul a { padding: 8px 14px; border-radius: 999px; color: var(--text); transition: background-color .2s ease; }
.lg .site-nav ul a:hover,
.lg .site-nav ul a[aria-current="page"] { box-shadow: none; background: rgba(255, 255, 255, .55); }
.lg .site-nav ul { gap: 4px; }
.lg .site-nav .btn--dark { background: rgba(13, 13, 13, .82); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25); }
@media (max-width: 820px) {
    .lg .site-header__inner { padding: 0 8px 0 20px; }
    /* The menu sits inside the glass nav bar, and a nested backdrop-filter can't blur the page,
       so it uses thick (near-opaque) glass and the page behind gets its own blurred scrim. */
    .lg .site-nav {
        top: 72px; left: 0; right: 0; border-radius: 28px; border: 0; padding: 12px 12px 14px;
        background: linear-gradient(180deg, rgba(255, 255, 255, .94), rgba(250, 248, 242, .9));
        box-shadow: var(--glass-rim), 0 24px 60px -12px rgba(20, 20, 40, .35);
        transform-origin: top right;
        animation: lg-menu-in .28s cubic-bezier(.2, .9, .3, 1.2);
    }
    .lg .site-nav ul a { border-bottom: 0; padding: 12px 16px; font-size: 18px; font-weight: 600; color: var(--text); }
    .lg .site-nav ul a:active { background: rgba(13, 13, 13, .06); }
    .lg .site-nav .btn { margin-top: 4px; padding: 14px; font-size: 16px; }

    .lg .site-header:has(.site-nav.is-open)::before {
        content: ""; position: fixed; inset: 0; z-index: -1;
        background: rgba(244, 241, 234, .45);
        -webkit-backdrop-filter: blur(14px) saturate(150%); backdrop-filter: blur(14px) saturate(150%);
        animation: lg-fade .2s ease;
    }
}
@keyframes lg-menu-in { from { opacity: 0; transform: scale(.92) translateY(-6px); } }
@keyframes lg-fade { from { opacity: 0; } }
@media (max-width: 820px) {
}

/* ---------- Buttons: glass capsules ---------- */
.lg .btn { transition: transform .25s cubic-bezier(.2, .9, .3, 1.4), background-color .2s ease, box-shadow .2s ease; }
.lg .btn:hover { transform: translateY(-1px) scale(1.03); }
.lg .btn:active { transform: scale(.97); }
.lg .btn--primary { background: rgba(255, 210, 31, .72); }
.lg .btn--primary:hover { background: rgba(255, 210, 31, .9); }
.lg .btn--ghost { color: var(--text); }
.lg .btn--ghost:hover { background: var(--glass-bg-strong); color: var(--text); }

/* ---------- Hero ---------- */
.lg .hero { overflow: visible; overflow-x: clip; }
.lg .hero::after { opacity: .5; }
.lg .hero__photo::before {
    background: rgba(255, 255, 255, .25); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
    box-shadow: var(--glass-rim);
}
.lg .slider__track { border-radius: 34px; box-shadow: var(--glass-rim), var(--glass-drop); }
/* Photo captions and slider dots: dark-tinted glass so they stay visible on any photo */
.lg .slider__dots,
.lg .slider__slide figcaption,
.lg .wwdc__item figcaption {
    background: rgba(13, 13, 13, .62); color: #fff;
    -webkit-backdrop-filter: blur(16px) saturate(160%); backdrop-filter: blur(16px) saturate(160%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), inset 0 0 0 1px rgba(255, 255, 255, .08), 0 4px 14px rgba(0, 0, 0, .25);
}
.lg .slider__dot { background: rgba(255, 255, 255, .7); }
.lg .slider__dot[aria-current="true"] { background: var(--accent); }

/* Each stat centred in its column, with equal padding all round */
.lg .stats { border-top: 0; border-radius: 28px; padding: 28px 0; }
.lg .stats > div,
.lg .stats > div + div { padding: 4px 16px; align-items: center; text-align: center; }
.lg .stats > div + div { border-left-color: rgba(13, 13, 13, .08); }
@media (max-width: 860px) {
    .lg .stats { row-gap: 24px; padding: 24px 0; }
    .lg .stats > div:nth-child(3) { border-left: 0; }
}

.lg .press { border-top: 0; border-radius: 999px; padding: 14px 28px; }
@media (max-width: 600px) { .lg .press { border-radius: 24px; } }

.lg .social a { color: var(--text); }
.lg .social a:hover { background: var(--glass-bg-strong); color: var(--text); }

/* ---------- Sections ---------- */
.lg .section--tint { background: transparent; }
.lg .chips li { background: rgba(255, 255, 255, .3); color: var(--text); }
.lg .skills { border-top-color: rgba(255, 255, 255, .55); }

.lg .about__media img { border-radius: 28px; box-shadow: var(--glass-drop); }

.lg .project-card { border-radius: 30px; transition: transform .35s cubic-bezier(.2, .9, .3, 1.2), box-shadow .3s ease; }
.lg .project-card:hover { transform: translateY(-6px) scale(1.01); box-shadow: var(--glass-rim), 0 24px 60px -16px rgba(20, 20, 40, .35); }
.lg .project-card__media { background: radial-gradient(120% 90% at 50% 0%, rgba(255, 246, 204, .6) 0%, transparent 70%); }

.lg .timeline { border-left: 0; display: grid; gap: 14px; }
.lg .timeline__item { padding: 18px 22px 18px 44px; border-radius: 22px; }
.lg .timeline__item::before { left: 20px; top: 24px; background: rgba(255, 255, 255, .7); border-color: var(--text); }

/* Dark community band becomes smoky glass */
.lg .section--dark {
    background: rgba(13, 13, 13, .78);
    backdrop-filter: blur(30px) saturate(160%); -webkit-backdrop-filter: blur(30px) saturate(160%);
    margin: 0 var(--gutter); border-radius: 44px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), inset 0 0 0 1px rgba(255, 255, 255, .06), 0 30px 80px -30px rgba(0, 0, 0, .5);
}
.lg .section--dark .btn--primary { color: var(--on-accent); }
.lg .wwdc__item { border-radius: 26px; }
@media (max-width: 760px) {
    .lg .wwdc__item figcaption { background: none; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
}

/* ---------- CTA: glass slab over the photo slideshow ---------- */
.lg .cta { background: transparent; margin-top: clamp(48px, 7vw, 96px); }
.lg .cta__backdrop::after { opacity: .35; }
.lg .cta__inner {
    width: calc(100% - 2 * var(--gutter)); max-width: none; margin: clamp(48px, 7vw, 88px) var(--gutter); border-radius: 44px;
    padding: clamp(48px, 7vw, 96px) clamp(24px, 6vw, 80px);
    background: rgba(255, 255, 255, .28);
}
.lg .cta .btn--primary { background: rgba(13, 13, 13, .85); color: #ffd21f; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), var(--glass-drop); }

.lg .site-footer { background: rgba(13, 13, 13, .9); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }

@media (prefers-reduced-transparency: reduce) {
    .lg .site-header__inner, .lg .project-card, .lg .stats, .lg .press, .lg .timeline__item, .lg .cta__inner {
        background: rgba(255, 255, 255, .92);
    }
}
@media (prefers-reduced-motion: reduce) { .lg::before { animation: none; } }

/* ---------- Inner pages ---------- */
.lg .mini-card { border-radius: 30px; }
.lg .browser { border: 0; border-radius: 18px; box-shadow: var(--glass-rim); }
.lg .pager__link { border-radius: 22px; }
.lg .pager__link:hover { background: var(--glass-bg-strong); }
.lg .screens { background: radial-gradient(120% 90% at 50% 0%, rgba(255, 246, 204, .6) 0%, rgba(255, 255, 255, .18) 70%); box-shadow: var(--glass-rim); border-radius: 32px; }

/* ---------- Sliders ----------
   Solid backing so the glass wallpaper never shows through a slide, and a crossfade
   where the new slide fades in on top while the old one stays fully visible underneath
   (no half-transparent "ghost" frame mid-transition). */
/* isolation keeps the slides' z-index inside the track, so the dots stay on top */
.lg .slider__track { background: #ece9e1; isolation: isolate; }
.lg .slider--landscape .slider__track { background: #1a1a1a; }
.lg .browser { background: #fff; }
.lg .slider__slide { transition: opacity .7s ease .7s; z-index: 0; }
.lg .slider__slide.is-active { transition-delay: 0s; z-index: 1; }
.lg .slider--browser .slider__track { border-radius: 0; box-shadow: none; }

/* ---------- Text links with arrows: glass capsule buttons ---------- */
.lg .link-arrow,
.lg .back-link {
    display: flex; align-items: center; gap: .4em; width: fit-content;
    padding: 10px 18px; border: 0; border-radius: 999px;
    font-size: 15px; font-weight: 600; line-height: 1; color: var(--text); text-decoration: none;
    background: var(--glass-bg);
    -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
    box-shadow: var(--glass-rim), var(--glass-drop);
    transition: transform .25s cubic-bezier(.2, .9, .3, 1.4), background-color .2s ease;
}
.lg .link-arrow:hover,
.lg .back-link:hover { background: var(--glass-bg-strong); color: var(--text); transform: translateY(-1px) scale(1.03); }
.lg .link-arrow:active,
.lg .back-link:active { transform: scale(.97); }
