/*
 * Portfolio liquid glass adaptation of Witters Amand's "Liquid Glass Apple"
 * https://codepen.io/wprod/pen/raVpwJL (MIT)
 *
 * Each material is composed from three independent layers:
 * backdrop refraction, translucent tint, and an optical edge highlight.
 * Content, motion and layout remain owned by portfolio.css.
 */
:root {
  --lg-demo-overlay: rgba(246, 252, 255, .19);
  --lg-demo-reflection: rgba(255, 255, 255, .32);
  --lg-demo-rim: rgba(255, 255, 255, .94);
  --lg-demo-depth: rgba(32, 79, 108, .16);
}
:root[data-theme="dark"] {
  --lg-demo-overlay: rgba(32, 44, 53, .29);
  --lg-demo-reflection: rgba(225, 244, 255, .075);
  --lg-demo-rim: rgba(231, 248, 255, .40);
  --lg-demo-depth: rgba(0, 0, 0, .37);
}

/* Remove the original opaque card wash so background can pass through the glass. */
.liquid-demo {
  isolation: isolate;
  background: transparent;
  border-color: rgba(255, 255, 255, .68);
  box-shadow:
    0 11px 30px var(--lg-demo-depth),
    0 2px 9px rgba(24, 64, 89, .045),
    inset 0 1px 0 var(--lg-demo-rim);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
:root[data-theme="dark"] .liquid-demo { border-color: rgba(225, 243, 255, .24); }

/* Three explicit layers, matching the demo's glass-filter, overlay, specular. */
.liquid-demo > .lg-glass-filter,
.liquid-demo > .lg-glass-overlay,
.liquid-demo > .lg-glass-specular {
  position: absolute;
  inset: 0;
  display: block;
  border-radius: inherit;
  pointer-events: none;
}
.liquid-demo > .lg-glass-filter {
  z-index: 0;
  -webkit-backdrop-filter: blur(8px) saturate(142%) brightness(1.055);
  backdrop-filter: blur(8px) saturate(142%) brightness(1.055);
}
.liquid-demo > .lg-glass-overlay {
  z-index: 1;
  background:
    linear-gradient(130deg, var(--lg-demo-reflection), transparent 53%),
    var(--lg-demo-overlay);
}
.liquid-demo > .lg-glass-specular {
  z-index: 2;
  box-shadow:
    inset 1px 1px 0 var(--lg-demo-rim),
    inset -1px -1px 0 rgba(255, 255, 255, .16),
    inset 0 0 8px rgba(255, 255, 255, .21),
    inset 0 -12px 19px -20px rgba(41, 101, 130, .24);
}
:root[data-theme="dark"] .liquid-demo > .lg-glass-specular {
  box-shadow:
    inset 1px 1px 0 var(--lg-demo-rim),
    inset -1px -1px 0 rgba(0, 0, 0, .47),
    inset 0 0 7px rgba(221, 244, 255, .10);
}

/* AI submenu: reuse the same three GlassSurface layers, but keep the
 * compact popover genuinely translucent. The header's opaque submenu tint
 * previously hid the backdrop even though its glass layers were present.
 * Avoid applying backdrop blur to the outer menu, which would create a nested
 * backdrop root and prevent the inner refraction layer from seeing the page. */
.site-header .ai-subnav.liquid-demo {
  background: transparent;
  box-shadow:
    0 17px 38px rgba(21, 53, 76, .18),
    0 4px 12px rgba(22, 56, 81, .09),
    inset 0 1px 0 var(--lg-demo-rim);
}
.site-header .ai-subnav.liquid-demo > .lg-glass-filter {
  -webkit-backdrop-filter: blur(14px) saturate(165%) brightness(1.04);
  backdrop-filter: blur(14px) saturate(165%) brightness(1.04);
}
.site-header .ai-subnav.liquid-demo > .lg-glass-overlay {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .39), rgba(222, 244, 255, .10) 53%, rgba(125, 182, 214, .12)),
    rgba(239, 250, 255, .07);
}
.site-header .ai-subnav.liquid-demo > .lg-glass-specular {
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, .92),
    inset -1px -1px 0 rgba(165, 204, 226, .31),
    inset 0 0 12px rgba(255, 255, 255, .20);
}
:root[data-theme="dark"] .site-header .ai-subnav.liquid-demo {
  box-shadow: 0 17px 38px rgba(0, 0, 0, .36),
              0 4px 12px rgba(0, 0, 0, .19),
              inset 0 1px 0 rgba(225, 248, 255, .30);
}
:root[data-theme="dark"] .site-header .ai-subnav.liquid-demo > .lg-glass-overlay {
  background:
    linear-gradient(140deg, rgba(228, 246, 255, .12), rgba(63, 101, 125, .09) 48%, rgba(12, 25, 36, .19)),
    rgba(18, 35, 46, .16);
}
:root[data-theme="dark"] .site-header .ai-subnav.liquid-demo > .lg-glass-specular {
  box-shadow:
    inset 1px 1px 0 rgba(220, 246, 255, .30),
    inset -1px -1px 0 rgba(0, 0, 0, .29),
    inset 0 0 10px rgba(190, 229, 250, .08);
}

/* Optical edge refraction is deliberately restricted to compact, reusable controls.
 * Broad bento panels keep standard blur to avoid large filtered repaint areas. */
@supports (filter: url("#portfolioLensFilter")) {
  .liquid-demo.site-header > .lg-glass-filter,
  .liquid-demo.github-cta > .lg-glass-filter,
  .liquid-demo.theme-toggle > .lg-glass-filter,
  .liquid-demo.lang > .lg-glass-filter,
  .liquid-demo.hero-cta:not(.hero-cta-dark) > .lg-glass-filter {
    filter: url("#portfolioLensFilter");
  }
}

/* Original semantic children always float above all three optical layers. */
:root[data-theme="dark"] .liquid-demo:not(.hero-cta-dark) { background: transparent; }
/* The header glass layers already inherit its rounded border. Keeping the
 * header itself clipped would cut off the AI submenu, regardless of z-index. */
.site-header.liquid-demo {
  overflow: visible;
}
.site-header.liquid-demo > .nav,
.site-footer.liquid-demo > .footer-row,
.project.liquid-demo > :not(.lg-glass-filter):not(.lg-glass-overlay):not(.lg-glass-specular),
.principle.liquid-demo > :not(.lg-glass-filter):not(.lg-glass-overlay):not(.lg-glass-specular) {
  z-index: 3;
}
.site-header.liquid-demo > .nav,
.site-footer.liquid-demo > .footer-row { position: relative; }
.project.liquid-demo > .lg-glass-filter,
.project.liquid-demo > .lg-glass-overlay,
.project.liquid-demo > .lg-glass-specular {
  position: absolute; /* override existing .project > * position rule */
}
.project.liquid-demo::after { z-index: 2; }
.project.liquid-demo > .lg-glass-filter { -webkit-backdrop-filter: blur(11px) saturate(135%); backdrop-filter: blur(11px) saturate(135%); }
.project.liquid-demo > .lg-glass-overlay { background: linear-gradient(145deg, var(--lg-demo-reflection), transparent 64%), var(--lg-demo-overlay); }
.project.liquid-demo::before { z-index: 2; }
.principle.liquid-demo {
  overflow: hidden;
  transition: box-shadow .25s ease, border-color .25s ease;
}
.principle.liquid-demo > .lg-glass-filter { -webkit-backdrop-filter: blur(10px) saturate(130%); backdrop-filter: blur(10px) saturate(130%); }
.principle.liquid-demo > :not(.lg-glass-filter):not(.lg-glass-overlay):not(.lg-glass-specular) { position: relative; z-index: 3; }
.principle.liquid-demo > .principle-icon,
.principle.liquid-demo > .principle-no { position: absolute; }
.site-footer.liquid-demo { border-left: 0; border-right: 0; border-bottom: 0; }

/* Keep nav and action hit targets intact; the optic layers are passive. */
.liquid-demo.github-cta,
.liquid-demo.theme-toggle,
.liquid-demo.lang,
.liquid-demo.hero-cta:not(.hero-cta-dark) {
  position: relative;
  overflow: hidden;
}
.liquid-demo.github-cta > :not(.lg-glass-filter):not(.lg-glass-overlay):not(.lg-glass-specular),
.liquid-demo.theme-toggle > :not(.lg-glass-filter):not(.lg-glass-overlay):not(.lg-glass-specular),
.liquid-demo.lang > :not(.lg-glass-filter):not(.lg-glass-overlay):not(.lg-glass-specular),
.liquid-demo.hero-cta:not(.hero-cta-dark) > :not(.lg-glass-filter):not(.lg-glass-overlay):not(.lg-glass-specular) {
  position: relative;
  z-index: 3;
}
.liquid-demo.github-cta:hover,
.liquid-demo.hero-cta:not(.hero-cta-dark):hover,
.liquid-demo.theme-toggle:hover {
  box-shadow: 0 15px 30px var(--lg-demo-depth), inset 0 1px 0 var(--lg-demo-rim);
}
.liquid-demo.github-cta:active,
.liquid-demo.hero-cta:not(.hero-cta-dark):active,
.liquid-demo.theme-toggle:active { transform: scale(.985); }

/* Small screens: avoid stacked background sampling across many cards. */
@media (max-width: 760px) {
  .project.liquid-demo > .lg-glass-filter,
  .principle.liquid-demo > .lg-glass-filter {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: rgba(249, 252, 255, .65);
  }
  :root[data-theme="dark"] .project.liquid-demo > .lg-glass-filter,
  :root[data-theme="dark"] .principle.liquid-demo > .lg-glass-filter { background: rgba(27, 39, 48, .67); }
  .liquid-demo.site-header > .lg-glass-filter { filter: none; }
}
/* Fully opaque fallbacks when backdrop sampling is not supported. */
@supports not ((-webkit-backdrop-filter: blur(2px)) or (backdrop-filter: blur(2px))) {
  .liquid-demo > .lg-glass-filter { filter: none; }
  .liquid-demo > .lg-glass-overlay { background: rgba(248, 252, 255, .96); }
  :root[data-theme="dark"] .liquid-demo > .lg-glass-overlay { background: rgba(31, 43, 52, .96); }
}
/* Respect system preferences and keep text readable in high-contrast modes. */
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .liquid-demo > .lg-glass-filter { filter: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .liquid-demo > .lg-glass-overlay { background: #f5f9fc; }
  :root[data-theme="dark"] .liquid-demo > .lg-glass-overlay { background: #202d35; }
  .liquid-demo > .lg-glass-specular { box-shadow: none; }
  .liquid-demo { border-color: #8497a4; }
}
@media (forced-colors: active) {
  .liquid-demo > .lg-glass-filter,
  .liquid-demo > .lg-glass-overlay,
  .liquid-demo > .lg-glass-specular { display: none; }
  .liquid-demo { background: Canvas; border-color: CanvasText; box-shadow: none; }
}
@media (prefers-reduced-motion: reduce) {
  .liquid-demo { transition: none; }
}

/* Navigation: convex glass selection.
 * Keep the existing JS indicator geometry and spring-like slide transition;
 * only replace the former opaque black/white active material.
 */
.site-header .nav-links .nav-indicator {
  overflow: hidden;
  isolation: isolate;
  border: 1px solid rgba(255, 255, 255, .82);
  background:
    linear-gradient(160deg,
      rgba(255, 255, 255, .72) 0%,
      rgba(255, 255, 255, .37) 41%,
      rgba(231, 246, 252, .18) 76%,
      rgba(255, 255, 255, .33) 100%);
  box-shadow:
    0 4px 12px rgba(30, 78, 101, .15),
    0 1px 3px rgba(30, 78, 101, .075),
    inset 0 1px 0 rgba(255, 255, 255, .98),
    inset 0 -1px 0 rgba(74, 125, 152, .17);
  -webkit-backdrop-filter: blur(12px) saturate(155%);
  backdrop-filter: blur(12px) saturate(155%);
}
.site-header .nav-links .nav-indicator::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background:
    linear-gradient(155deg, rgba(255, 255, 255, .58), transparent 50%),
    linear-gradient(0deg, rgba(255, 255, 255, .12), transparent 48%);
  pointer-events: none;
}
.site-header .nav-links .nav-indicator::after {
  content: "";
  position: absolute;
  left: 20%;
  right: 20%;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .92), transparent);
  pointer-events: none;
}
.site-header .nav-pill.active {
  color: #173240;
  font-weight: 730;
}
.site-header .nav-pill.active > span {
  background: #168aab;
  box-shadow: 0 0 0 2px rgba(22, 138, 171, .12);
  opacity: 1;
}
/* The AI label and disclosure chevron share one continuous selection glass.
 * The JS indicator follows the outer group, not the anchor's narrower box. */
.site-header .nav-group:has(.nav-pill.active) .nav-submenu-trigger {
  color: #173240;
  /* Match the active link's color easing during light/dark theme changes. */
  transition: color .32s cubic-bezier(.16,1,.3,1);
}
/* The pre-JS fallback must also cover BOTH controls, not just the link. */
.site-header .nav-links:not(.nav-ready) .nav-pill.active {
  background: rgba(255, 255, 255, .52);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .7);
}
.site-header .nav-links:not(.nav-ready) .nav-group:has(.nav-pill.active) {
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, .52);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .7);
}
.site-header .nav-links:not(.nav-ready) .nav-group .nav-pill.active {
  background: transparent;
  box-shadow: none;
}
:root[data-theme="dark"] .site-header .nav-links .nav-indicator {
  border-color: rgba(227, 244, 255, .39);
  background:
    linear-gradient(153deg,
      rgba(213, 237, 249, .26) 0%,
      rgba(133, 180, 205, .13) 48%,
      rgba(129, 174, 193, .08) 78%,
      rgba(195, 231, 245, .13) 100%);
  box-shadow:
    0 5px 15px rgba(0, 0, 0, .22),
    inset 0 1px 0 rgba(247, 254, 255, .40),
    inset 0 -1px 0 rgba(0, 0, 0, .28);
}
:root[data-theme="dark"] .site-header .nav-links .nav-indicator::before {
  background: linear-gradient(150deg, rgba(237, 250, 255, .21), transparent 58%);
}
:root[data-theme="dark"] .site-header .nav-pill.active { color: #f1fbff; }
:root[data-theme="dark"] .site-header .nav-pill.active > span {
  background: #68cadb;
  box-shadow: 0 0 0 2px rgba(104, 202, 219, .12);
}
:root[data-theme="dark"] .site-header .nav-group:has(.nav-pill.active) .nav-submenu-trigger { color: #f1fbff; }
:root[data-theme="dark"] .site-header .nav-links:not(.nav-ready) .nav-pill.active,
:root[data-theme="dark"] .site-header .nav-links:not(.nav-ready) .nav-group:has(.nav-pill.active) {
  background: rgba(194, 227, 242, .18);
  box-shadow: inset 0 0 0 1px rgba(227, 244, 255, .26);
}
:root[data-theme="dark"] .site-header .nav-links:not(.nav-ready) .nav-group .nav-pill.active {
  background: transparent;
  box-shadow: none;
}
/* Accessibility overrides retain the same contrast and forced-color semantics. */
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .site-header .nav-links .nav-indicator {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: #f5f9fc;
    border-color: #526b7d;
    box-shadow: none;
  }
  :root[data-theme="dark"] .site-header .nav-links .nav-indicator {
    background: #263a45;
    border-color: #c6e1f0;
    box-shadow: none;
  }
  .site-header .nav-links .nav-indicator::before,
  .site-header .nav-links .nav-indicator::after { display: none; }
}
@media (forced-colors: active) {
  .site-header .nav-links .nav-indicator {
    background: Highlight;
    border-color: Highlight;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .site-header .nav-pill.active { color: HighlightText; }
  .site-header .nav-group:has(.nav-pill.active) .nav-submenu-trigger { color: HighlightText; }
  .site-header .nav-pill.active > span { background: HighlightText; box-shadow: none; }
  .site-header .nav-links:not(.nav-ready) .nav-pill.active,
  .site-header .nav-links:not(.nav-ready) .nav-group:has(.nav-pill.active) {
    background: Highlight;
    box-shadow: none;
  }
  .site-header .nav-links:not(.nav-ready) .nav-group .nav-pill.active { background: transparent; }
}
/* Optical glass clarity study v4: moderate frost for text contrast.
   Keep the Demo-derived refractive edge and cached Hero WebP; increase only
   interior blur/tint and typography contrast. No image or script changes. */
#projects {
  position: relative;
  isolation: isolate;
  background:
    linear-gradient(rgba(14, 32, 40, .065), rgba(14, 32, 40, .08)),
    url("/assets/licat-hero.webp") center 54% / cover no-repeat,
    linear-gradient(155deg, #b6c7cf, #d4dbdc 50%, #c5c9c7);
}
#projects > .shell { position: relative; z-index: 1; }
#projects .project.liquid-demo {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .86);
  box-shadow:
    0 14px 27px rgba(22, 52, 67, .17),
    inset 0 1px 0 rgba(255, 255, 255, .95),
    inset 0 -1px 0 rgba(74, 99, 107, .19);
}
#projects .project.liquid-demo > .lg-glass-filter {
  -webkit-backdrop-filter: blur(2.35px) saturate(125%) brightness(1.015);
  backdrop-filter: blur(2.35px) saturate(125%) brightness(1.015);
  filter: url("#portfolioCardLensFilter");
}
#projects .project.liquid-demo > .lg-glass-overlay {
  background: rgba(250, 253, 255, .12);
}
#projects .project.liquid-demo > .lg-glass-specular {
  box-shadow:
    inset 1px 1px 1px rgba(255, 255, 255, .97),
    inset -1px -1px 0 rgba(255, 255, 255, .62),
    inset 5px 5px 11px -9px rgba(255, 255, 255, .87),
    inset -5px -8px 15px -14px rgba(27, 65, 87, .48);
}
#projects .project.liquid-demo::before {
  background: none;
}
#projects .project.liquid-demo:hover {
  border-color: #fff;
  box-shadow: 0 17px 36px rgba(22, 52, 67, .21), inset 0 1px 0 #fff;
}
:root[data-theme="dark"] #projects {
  background:
    linear-gradient(rgba(0, 12, 18, .56), rgba(0, 12, 18, .64)),
    url("/assets/licat-hero.webp") center 54% / cover no-repeat,
    linear-gradient(150deg, #1d2b33, #303b40 52%, #2a3131);
}
:root[data-theme="dark"] #projects .project.liquid-demo {
  background: transparent;
  border-color: rgba(231, 244, 251, .40);
  box-shadow:
    0 14px 26px rgba(0,0,0,.28),
    inset 0 1px 0 rgba(238,250,255,.36);
}
:root[data-theme="dark"] #projects .project.liquid-demo > .lg-glass-filter {
  -webkit-backdrop-filter: blur(2.1px) saturate(127%) brightness(1);
  backdrop-filter: blur(2.1px) saturate(127%) brightness(1);
}
:root[data-theme="dark"] #projects .project.liquid-demo > .lg-glass-overlay {
  background: rgba(8, 24, 32, .11);
}
:root[data-theme="dark"] #projects .project.liquid-demo > .lg-glass-specular {
  box-shadow:
    inset 1px 1px 1px rgba(245, 251, 255, .70),
    inset -1px -1px 0 rgba(204, 227, 236, .26),
    inset 4px 5px 11px -9px rgba(245, 251, 255, .32),
    inset -5px -8px 14px -13px rgba(0, 10, 18, .55);
}
/* Typography must remain readable when glass overlaps bright scenery. */
#projects .project p { color: #425563; }
#projects .project-meta { color: #526575; }
:root[data-theme="dark"] #projects .project p,
:root[data-theme="dark"] #projects .project-meta {
  color: rgba(235, 246, 251, .94);
}
/* Use a low-cost, lighter blur for touch devices. The expensive SVG distortion is
   omitted on narrow screens; the strong specular rim still reads as glass. */
@media (max-width: 760px) {
  #projects .project.liquid-demo > .lg-glass-filter {
    filter: none;
    background: none;
    -webkit-backdrop-filter: blur(1.8px) saturate(125%);
    backdrop-filter: blur(1.8px) saturate(125%);
  }
  :root[data-theme="dark"] #projects .project.liquid-demo > .lg-glass-filter {
    filter: none;
    background: none;
    -webkit-backdrop-filter: blur(1.8px) saturate(125%);
    backdrop-filter: blur(1.8px) saturate(125%);
  }
}
/* Stable, solid fallbacks for accessibility or older browsers. */
@supports not ((-webkit-backdrop-filter: blur(2px)) or (backdrop-filter: blur(2px))) {
  #projects .project.liquid-demo > .lg-glass-filter { filter:none; }
  #projects .project.liquid-demo > .lg-glass-overlay { background:rgba(242,248,251,.95); }
  :root[data-theme="dark"] #projects .project.liquid-demo > .lg-glass-overlay { background:rgba(23,37,46,.95); }
}
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  #projects .project.liquid-demo > .lg-glass-filter {
    -webkit-backdrop-filter:none; backdrop-filter:none; filter:none;
  }
  #projects .project.liquid-demo > .lg-glass-overlay { background: #f5f9fc; }
  :root[data-theme="dark"] #projects .project.liquid-demo > .lg-glass-overlay { background: #202d35; }
}
@media (forced-colors: active) {
  #projects, :root[data-theme="dark"] #projects { background:Canvas; }
  #projects .project.liquid-demo > .lg-glass-filter { -webkit-backdrop-filter:none; backdrop-filter:none; filter:none; }
  #projects .project.liquid-demo > .lg-glass-overlay { background: Canvas; }
  #projects .project.liquid-demo > .lg-glass-specular { box-shadow:none; }
  #projects .project.liquid-demo { border-color:CanvasText; box-shadow:none; }
}

/* Glass text legibility: narrow optical separation from uneven scenery.
 * Avoid broad halos or text outlines that make the interface look luminous.
 * Restrict changes to the Demo's scenic projects section only. */
#projects .project h3 {
  text-shadow:
    0 1px 1px rgba(255, 255, 255, .88),
    0 0 2px rgba(255, 255, 255, .54);
}
#projects .project p,
#projects .project-meta,
#projects .section-note {
  text-shadow:
    0 1px 1px rgba(255, 255, 255, .95),
    0 0 3px rgba(255, 255, 255, .64);
}
:root[data-theme="dark"] #projects .project h3 {
  text-shadow:
    0 1px 2px rgba(0, 12, 20, .86),
    0 0 3px rgba(0, 12, 20, .58);
}
:root[data-theme="dark"] #projects .project p,
:root[data-theme="dark"] #projects .project-meta,
:root[data-theme="dark"] #projects .section-note {
  text-shadow:
    0 1px 2px rgba(0, 12, 20, .94),
    0 0 3px rgba(0, 12, 20, .68);
}
/* When OS contrast features are enabled, use the solid contrast materials,
 * not simulated edge shadows. */
@media (prefers-contrast: more), (forced-colors: active) {
  #projects .project h3,
  #projects .project p,
  #projects .project-meta,
  #projects .section-note { text-shadow: none; }
}

/* Demo material rollout: apply the accepted moderate frost and narrow
 * text separation beyond projects, without changing the production homepage.
 * Hero controls, timeline milestones, principles, and footer use optical
 * layers with contrast-safe fallbacks; the filled primary CTA stays filled. */

/* Hero's existing resource list is one restrained glass slab, not three
 * competing floating cards. The existing link hit targets remain intact. */
.hero-resources.liquid-demo {
  overflow: hidden;
  padding: .25rem .875rem;
  border: 1px solid rgba(255, 255, 255, .76);
  border-radius: 1.125rem;
  box-shadow: 0 12px 28px rgba(24, 61, 83, .14), inset 0 1px 0 rgba(255, 255, 255, .91);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.hero-resources.liquid-demo > .lg-glass-filter {
  -webkit-backdrop-filter: blur(2.35px) saturate(125%);
  backdrop-filter: blur(2.35px) saturate(125%);
  filter: url("#portfolioLensFilter");
}
.hero-resources.liquid-demo > .lg-glass-overlay {
  background: rgba(250, 253, 255, .15);
}
.hero-resources.liquid-demo > .lg-glass-specular {
  box-shadow: inset 1px 1px 1px rgba(255,255,255,.95),
              inset -1px -1px 0 rgba(255,255,255,.60),
              inset -4px -7px 12px -11px rgba(30,70,94,.39);
}
.hero-resources.liquid-demo > .hero-resource {
  position: relative;
  z-index: 3;
  border-bottom-color: rgba(27, 67, 88, .20);
  text-shadow: 0 1px 1px rgba(255,255,255,.85), 0 0 2px rgba(255,255,255,.52);
}
.hero-resources.liquid-demo > .hero-resource:last-child { border-bottom: 0; }
.hero-resources.liquid-demo > .hero-resource:focus-visible {
  outline: 2px solid #168aab;
  outline-offset: -2px;
  border-radius: .375rem;
}
:root[data-theme="dark"] .hero-resources.liquid-demo {
  border-color: rgba(231, 244, 251, .34);
  box-shadow: 0 12px 28px rgba(0,0,0,.26), inset 0 1px 0 rgba(238,250,255,.24);
}
:root[data-theme="dark"] .hero-resources.liquid-demo > .lg-glass-filter {
  -webkit-backdrop-filter: blur(2.1px) saturate(127%);
  backdrop-filter: blur(2.1px) saturate(127%);
}
:root[data-theme="dark"] .hero-resources.liquid-demo > .lg-glass-overlay {
  background: rgba(8, 24, 32, .19);
}
:root[data-theme="dark"] .hero-resources.liquid-demo > .hero-resource {
  border-bottom-color: rgba(231, 244, 251, .13);
  text-shadow: 0 1px 2px rgba(0, 10, 18, .89), 0 0 3px rgba(0,10,18,.64);
}
:root[data-theme="dark"] .hero-resources.liquid-demo > .hero-resource:last-child { border-bottom: 0; }

/* Journey: preserve the timeline line/dots and reversible motion. A glass
 * surface wraps only the milestone copy, with no change to the dot geometry. */
#journey {
  background:
    radial-gradient(ellipse 43% 65% at 6% 35%, rgba(88, 147, 166, .20), transparent 80%),
    radial-gradient(ellipse 44% 65% at 94% 75%, rgba(184, 156, 126, .17), transparent 80%),
    linear-gradient(145deg, #dce7e9, #e7ebeb 51%, #e8e5e0);
}
#journey > .shell, #principles > .shell { position: relative; z-index: 1; }
#journey .phase-glass.liquid-demo {
  /* Scope the absolute glass layers to this one card, not .phase above it. */
  position: relative;
  min-height: 12.5rem;
  padding: 1.125rem 1.25rem;
  border: 1px solid rgba(255,255,255,.77);
  border-radius: 1.125rem;
  box-shadow: 0 12px 27px rgba(30,68,87,.11), inset 0 1px 0 rgba(255,255,255,.92);
  overflow: hidden;
}
#journey .phase-glass > .lg-glass-filter {
  -webkit-backdrop-filter: blur(2.35px) saturate(125%);
  backdrop-filter: blur(2.35px) saturate(125%);
  /* Large low-contrast milestones do not need SVG displacement.
     This avoids a secondary distorted rim inside each card. */
  filter: none;
}
#journey .phase-glass > .lg-glass-overlay { background: rgba(250,253,255,.12); }
#journey .phase-glass > .lg-glass-specular {
  box-shadow: inset 1px 1px 1px rgba(255,255,255,.97),
              inset -1px -1px 0 rgba(255,255,255,.62),
              inset -5px -7px 15px -13px rgba(30,70,94,.34);
}
#journey .phase-glass > :not(.lg-glass-filter):not(.lg-glass-overlay):not(.lg-glass-specular) {
  position: relative;
  z-index: 3;
}
#journey .phase h3 { color: #1b303c; }
#journey .phase p { color: #475c68; }
#journey .phase time { color: #446777; }
#journey .phase-glass h3,
#journey .phase-glass p,
#journey .phase-glass time,
#journey .section-note { text-shadow: 0 1px 1px rgba(255,255,255,.90), 0 0 2px rgba(255,255,255,.47); }

/* Principles: the original three cards already contain the optical layers.
 * Replace their white wash with the approved project-glass clarity/frost. */
#principles {
  background:
    radial-gradient(ellipse 45% 65% at 96% 22%, rgba(99,156,173,.22), transparent 80%),
    radial-gradient(ellipse 44% 66% at 10% 82%, rgba(185,157,128,.15), transparent 79%),
    linear-gradient(150deg, #e9e9e6, #dce8e9 56%, #e5e8e6);
}
#principles .principle.liquid-demo {
  border: 1px solid rgba(255,255,255,.77);
  box-shadow: 0 12px 28px rgba(30,68,87,.12), inset 0 1px 0 rgba(255,255,255,.94);
}
#principles .principle.liquid-demo > .lg-glass-filter {
  -webkit-backdrop-filter: blur(2.35px) saturate(125%);
  backdrop-filter: blur(2.35px) saturate(125%);
  filter: url("#portfolioCardLensFilter");
}
#principles .principle.liquid-demo > .lg-glass-overlay { background: rgba(250,253,255,.12); }
#principles .principle.liquid-demo > .lg-glass-specular {
  box-shadow: inset 1px 1px 1px rgba(255,255,255,.97),
              inset -1px -1px 0 rgba(255,255,255,.62),
              inset 4px 4px 12px -10px rgba(255,255,255,.88),
              inset -5px -7px 15px -13px rgba(30,70,94,.35);
}
/* Earlier base CSS had a high-specificity direct-child rule that accidentally
 * made the positioned number and icon relative. Restore the intended layout. */
#principles .principle.liquid-demo > .principle-icon,
#principles .principle.liquid-demo > .principle-no {
  position: absolute;
  z-index: 4;
}
#principles .principle h3 { color: #1b303c; }
#principles .principle p { color: #475c68; }
#principles .principle h3,
#principles .principle p,
#principles .section-note { text-shadow: 0 1px 1px rgba(255,255,255,.90), 0 0 2px rgba(255,255,255,.48); }

/* Footer stays a single translucent strip. Text shadows here are subtler
 * because it has no mountain photograph directly behind the copy. */
.site-footer.liquid-demo > .lg-glass-filter {
  -webkit-backdrop-filter: blur(2.35px) saturate(125%);
  backdrop-filter: blur(2.35px) saturate(125%);
}
.site-footer.liquid-demo > .lg-glass-overlay {
  background: rgba(250,253,255,.12);
}
.site-footer.liquid-demo > .lg-glass-specular {
  box-shadow: inset 0 1px 0 rgba(255,255,255,.87);
}
.site-footer .footer-row {
  text-shadow: 0 1px 1px rgba(255,255,255,.66);
}
.site-footer a:focus-visible { outline: 2px solid #168aab; outline-offset: 5px; border-radius: .1875rem; }

/* Dark-mode geometry remains identical; only material + text contrast change. */
:root[data-theme="dark"] #journey {
  background:
    radial-gradient(ellipse 45% 70% at 7% 25%, rgba(87,142,157,.17), transparent 80%),
    linear-gradient(145deg, #1c292f, #233036 53%, #2c3131);
}
:root[data-theme="dark"] #principles {
  background:
    radial-gradient(ellipse 45% 70% at 93% 30%, rgba(92,142,157,.16), transparent 80%),
    linear-gradient(145deg, #252d31, #1c2a30 56%, #202b30);
}
:root[data-theme="dark"] #journey .phase-glass.liquid-demo,
:root[data-theme="dark"] #principles .principle.liquid-demo {
  border-color: rgba(231,244,251,.34);
  box-shadow: 0 12px 28px rgba(0,0,0,.24), inset 0 1px 0 rgba(238,250,255,.26);
}
:root[data-theme="dark"] #journey .phase-glass > .lg-glass-filter,
:root[data-theme="dark"] #principles .principle.liquid-demo > .lg-glass-filter {
  -webkit-backdrop-filter: blur(2.1px) saturate(127%);
  backdrop-filter: blur(2.1px) saturate(127%);
}
:root[data-theme="dark"] #journey .phase-glass > .lg-glass-overlay,
:root[data-theme="dark"] #principles .principle.liquid-demo > .lg-glass-overlay,
:root[data-theme="dark"] .site-footer.liquid-demo > .lg-glass-overlay {
  background: rgba(8,24,32,.11);
}
:root[data-theme="dark"] #journey .phase-glass > .lg-glass-specular,
:root[data-theme="dark"] #principles .principle.liquid-demo > .lg-glass-specular {
  box-shadow: inset 1px 1px 1px rgba(245,251,255,.57),
              inset -1px -1px 0 rgba(204,227,236,.20),
              inset -5px -7px 15px -13px rgba(0,8,14,.55);
}
:root[data-theme="dark"] #journey .phase h3,
:root[data-theme="dark"] #principles .principle h3 { color: #f5f7fa; }
:root[data-theme="dark"] #journey .phase p,
:root[data-theme="dark"] #principles .principle p { color: rgba(235,246,251,.92); }
:root[data-theme="dark"] #journey .phase time { color: rgba(196,226,238,.86); }
:root[data-theme="dark"] #journey .phase-glass h3,
:root[data-theme="dark"] #journey .phase-glass p,
:root[data-theme="dark"] #journey .phase-glass time,
:root[data-theme="dark"] #journey .section-note,
:root[data-theme="dark"] #principles .principle h3,
:root[data-theme="dark"] #principles .principle p,
:root[data-theme="dark"] #principles .section-note,
:root[data-theme="dark"] .site-footer .footer-row {
  text-shadow: 0 1px 2px rgba(0,12,20,.88), 0 0 3px rgba(0,12,20,.58);
}
:root[data-theme="dark"] .site-footer.liquid-demo > .lg-glass-filter {
  -webkit-backdrop-filter: blur(2.1px) saturate(127%);
  backdrop-filter: blur(2.1px) saturate(127%);
}

/* Mobile phones never run the expensive SVG refraction over long content. */
@media (max-width: 760px) {
  .hero-resources.liquid-demo > .lg-glass-filter,
  #journey .phase-glass > .lg-glass-filter,
  #principles .principle.liquid-demo > .lg-glass-filter {
    filter: none;
    -webkit-backdrop-filter: blur(1.8px) saturate(125%);
    backdrop-filter: blur(1.8px) saturate(125%);
    background: transparent;
  }
  #journey .phase-glass.liquid-demo { min-height: 0; }
  .hero-resources.liquid-demo { padding: 0 .625rem; }
}

/* Accessibility: disable decorative shadows and sampling when a solid
 * material is requested; preserve touch, focus and forced-colors semantics. */
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .hero-resources.liquid-demo > .lg-glass-filter,
  #journey .phase-glass > .lg-glass-filter,
  #principles .principle.liquid-demo > .lg-glass-filter {
    filter: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .hero-resources.liquid-demo > .lg-glass-overlay,
  #journey .phase-glass > .lg-glass-overlay,
  #principles .principle.liquid-demo > .lg-glass-overlay { background: #f5f9fc; }
  :root[data-theme="dark"] .hero-resources.liquid-demo > .lg-glass-overlay,
  :root[data-theme="dark"] #journey .phase-glass > .lg-glass-overlay,
  :root[data-theme="dark"] #principles .principle.liquid-demo > .lg-glass-overlay { background: #202d35; }
  .hero-resources.liquid-demo .hero-resource,
  #journey .phase-glass h3,
  #journey .phase-glass p,
  #journey .phase-glass time,
  #journey .section-note,
  #principles .principle h3,
  #principles .principle p,
  #principles .section-note,
  .site-footer .footer-row { text-shadow: none; }
}
@media (forced-colors: active) {
  #journey, #principles,
  :root[data-theme="dark"] #journey,
  :root[data-theme="dark"] #principles { background: Canvas; }
  .hero-resources.liquid-demo,
  #journey .phase-glass.liquid-demo,
  #principles .principle.liquid-demo { background: Canvas; border-color: CanvasText; box-shadow: none; }
  .hero-resources.liquid-demo > .lg-glass-filter,
  #journey .phase-glass > .lg-glass-filter,
  #principles .principle.liquid-demo > .lg-glass-filter { display: none; }
  .hero-resources.liquid-demo > .lg-glass-overlay,
  #journey .phase-glass > .lg-glass-overlay,
  #principles .principle.liquid-demo > .lg-glass-overlay { display: none; }
}

/* Single pinned landscape behind the complete Demo.
 * Fixed pseudo-layer instead of background-attachment:fixed, which is
 * unreliable in iOS Safari. Reuse the existing 89 KB Hero WebP: no new asset.
 * The scene and its geometry do not animate or move with document scroll. */
body {
  position: relative;
  isolation: isolate;
  background: #d9e5e9;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;  /* older mobile browser fallback */
  height: 100svh; /* stable mobile viewport during address-bar collapse */
  z-index: 0;
  pointer-events: none;
  opacity: 1;
  filter: none;
  background:
    linear-gradient(rgba(230, 240, 245, .30), rgba(227, 237, 242, .29)),
    url("/assets/licat-hero.webp") 58% center / cover no-repeat;
}
body > main,
body > .site-footer {
  position: relative;
  z-index: 1;
}
/* The photo used to be cropped into the Hero's right-hand column.
 * Hide that duplicated view, keeping the element as an inert animation
 * target for the original motion JS (no JS edits needed). */
.hero-scene { display: none; }
.hero-wrap {
  background:
    radial-gradient(circle at 14% 22%, rgba(255,255,255,.33), transparent 33%),
    linear-gradient(180deg, rgba(228,238,243,.15), rgba(228,238,243,.04));
}
#projects {
  background: rgba(230, 239, 243, .07);
}
#journey {
  background:
    linear-gradient(145deg, rgba(220,232,237,.19), rgba(236,240,238,.22));
}
#principles {
  background:
    linear-gradient(150deg, rgba(231,238,240,.21), rgba(222,235,238,.17));
}
/* Scenic details vary behind the small Hero list; avoid washed-out links. */
.hero-resources.liquid-demo > .hero-resource { color: #294453; }
.hero-resources.liquid-demo > .hero-resource.active,
.hero-resources.liquid-demo > .hero-resource:hover { color: #102936; }
:root[data-theme="dark"] .hero-resources.liquid-demo > .hero-resource { color: #d5e4ec; }
:root[data-theme="dark"] .hero-resources.liquid-demo > .hero-resource.active,
:root[data-theme="dark"] .hero-resources.liquid-demo > .hero-resource:hover { color: #f5fbff; }
/* Keep typography legible while glass is over bright mountain/snow detail. */
#journey > .shell .section-note,
#principles > .shell .section-note,
#projects > .shell .section-note {
  color: #435969;
  text-shadow: 0 1px 1px rgba(255,255,255,.9), 0 0 3px rgba(255,255,255,.6);
}
:root[data-theme="dark"] body { background: #101c25; }
:root[data-theme="dark"] body::before {
  opacity: 1;
  filter: none;
  background:
    linear-gradient(rgba(8, 17, 24, .68), rgba(8, 19, 27, .70)),
    url("/assets/licat-hero.webp") 58% center / cover no-repeat;
}
:root[data-theme="dark"] .hero-wrap {
  background:
    radial-gradient(circle at 14% 22%, rgba(20,38,48,.28), transparent 33%),
    linear-gradient(180deg, rgba(9,20,27,.14), rgba(11,23,29,.04));
}
:root[data-theme="dark"] #projects { background: rgba(8,18,26,.08); }
:root[data-theme="dark"] #journey {
  background: linear-gradient(145deg, rgba(12,27,35,.20), rgba(17,28,33,.24));
}
:root[data-theme="dark"] #principles {
  background: linear-gradient(150deg, rgba(15,28,36,.24), rgba(10,24,31,.22));
}
:root[data-theme="dark"] #journey > .shell .section-note,
:root[data-theme="dark"] #principles > .shell .section-note,
:root[data-theme="dark"] #projects > .shell .section-note {
  color: rgba(234,244,249,.86);
  text-shadow: 0 1px 2px rgba(0,10,18,.94), 0 0 3px rgba(0,10,18,.7);
}
/* Opaque fallbacks should retain their contrast, not expose a busy photo. */
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  body::before { background: #e6edf0; }
  :root[data-theme="dark"] body::before { background: #17252d; }
  #journey,
  #principles,
  #projects { background: rgba(238,245,248,.96); }
  :root[data-theme="dark"] #journey,
  :root[data-theme="dark"] #principles,
  :root[data-theme="dark"] #projects { background: rgba(23,37,46,.96); }
}
@media (forced-colors: active) {
  body::before,
  :root[data-theme="dark"] body::before { background: Canvas; }
  .hero-wrap,
  #journey,
  #principles,
  #projects,
  :root[data-theme="dark"] .hero-wrap,
  :root[data-theme="dark"] #journey,
  :root[data-theme="dark"] #principles,
  :root[data-theme="dark"] #projects { background: Canvas; }
}

/* Performance: SVG displacement + backdrop blur on EVERY full-size project
 * slab forced costly repeated compositing while scrolling. Preserve all
 * approved tint, frosted backdrop and specular/rim optics at rest; reserve
 * high-cost refraction for the single card being deliberately inspected.
 * While a real scroll is active, never compute that interactive refraction.
 * The fallback without JS retains the hover behavior.
 */
@media (min-width: 761px) and (prefers-reduced-transparency: no-preference) and (prefers-contrast: no-preference) and (forced-colors: none) {
  #projects .project.liquid-demo > .lg-glass-filter {
    filter: none;
  }
  html:not(.portfolio-is-scrolling) #projects .project.liquid-demo:is(:hover, :focus-visible) > .lg-glass-filter {
    filter: url("#portfolioCardLensFilter");
  }
}
