/* ==========================================================================
   Liquid glass look — layered on top of main.css.
   Remove the <link> to glass.css in includes/header.php to go back to the
   classic look (or add ?look=classic to any page URL to compare).
   ========================================================================== */

:root {
  --glass-tint: rgba(255, 255, 255, .07);
  --glass-tint-strong: rgba(255, 255, 255, .13);
  --glass-edge: rgba(255, 255, 255, .16);
  --glass-blur: blur(18px) saturate(180%);
  /* Light catching the top rim, a faint inner glow at the bottom, and a soft drop shadow */
  --glass-shine:
    inset 0 1px 0 rgba(255, 255, 255, .35),
    inset 0 -1px 0 rgba(255, 255, 255, .05),
    inset 0 0 20px rgba(255, 255, 255, .04),
    0 10px 30px rgba(0, 0, 0, .35);
}

/* A reusable glass surface. The blur lives on ::before so the element itself
   doesn't become a containing block for fixed children (the mobile menu). */
.glass, .nav-bar, .filter-btn, .lightbox.has-info .lightbox-info, .btn-ghost {
  position: relative; isolation: isolate;
}
.lightbox-close { isolation: isolate; }   /* stays absolutely positioned */
.glass::before, .nav-bar::before, .filter-btn::before, .lightbox-close::before,
.lightbox.has-info .lightbox-info::before, .btn-ghost::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, 0) 45%),
    var(--glass-tint);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--glass-shine);
  pointer-events: none;
}

/* ---------- Floating glass menu bar ---------- */
.site-header { position: sticky; top: 14px; z-index: 40; }
.nav-bar {
  margin-top: 14px; padding: 10px 26px 10px 14px; border-radius: 999px;
  max-width: min(1180px, calc(100% - 28px));
}
.nav-bar::before { background-color: rgba(10, 12, 11, .28); }   /* keeps menu text readable over bright thumbnails */
.logo { width: 58px; }
.site-nav a { font-size: 16px; }
.site-nav a::after { bottom: -4px; height: 2px; border-radius: 2px; }

@media (max-width: 900px) {
  .nav-bar { padding: 8px 14px 8px 10px; }
  .logo { width: 48px; }
  .menu-toggle {
    width: 44px; height: 44px; border-radius: 50%; font-size: 20px;
    background: var(--glass-tint-strong); box-shadow: var(--glass-shine);
  }
  /* Slide-out menu becomes a tall pane of glass instead of solid green */
  .site-nav {
    top: 10px; right: 10px; height: calc(100vh - 20px); border-radius: 28px;
    background: rgba(20, 24, 22, .55);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    backdrop-filter: blur(28px) saturate(180%);
    border: 1px solid var(--glass-edge); box-shadow: var(--glass-shine);
    transform: translateX(calc(100% + 20px));
  }
  .site-nav.open { transform: translateX(0); }
  .site-nav a.active, .site-nav a:hover { color: var(--mint); }
  .site-nav a::after { background: var(--mint); }
}

/* ---------- Portfolio filters: glass chips, the active one a bright mint lens ---------- */
.filter-btn { border-color: transparent; transition: color .3s, transform .3s; }
.filter-btn:hover { border-color: transparent; transform: translateY(-2px); }
.filter-btn.active { background: transparent; color: var(--mint); }
.filter-btn.active::before {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, 0) 50%),
    rgba(180, 248, 200, .16);
  border-color: rgba(180, 248, 200, .45);
  box-shadow: var(--glass-shine), 0 0 24px rgba(180, 248, 200, .18);
}

/* ---------- Buttons ---------- */
.btn { border-radius: 999px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 8px 24px rgba(0, 0, 0, .3); }
.btn-ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn-ghost:hover { background: transparent; border-color: transparent; color: #fff; }

/* ---------- Contact form: glass fields ---------- */
.field input, .field textarea {
  border: 1px solid var(--glass-edge); border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, 0) 50%),
    var(--glass-tint);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25);
  padding: 26px 16px 12px;
}
.field label { left: 17px; }
.field input:focus + label, .field input:not(:placeholder-shown) + label,
.field textarea:focus + label, .field textarea:not(:placeholder-shown) + label { top: 8px; }
.field input:focus, .field textarea:focus { border-color: rgba(180, 248, 200, .6); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 0 0 4px rgba(180, 248, 200, .12); }

/* ---------- Tool cards: a pane of glass ---------- */
.tool-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, 0) 40%), var(--glass-tint);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border-color: var(--glass-edge); border-radius: 24px; box-shadow: var(--glass-shine);
}

/* ---------- Video popup: glass close button and a glass panel over the live glow ---------- */
.lightbox-close {
  width: 52px; height: 52px; border-radius: 50%; font-size: 22px;
  display: grid; place-items: center; transition: transform .3s, color .3s;
}
.lightbox-close:hover { transform: scale(1.08); }
.lightbox.has-info .lightbox-info { padding: 20px 26px 22px; border-radius: 24px; }
.lightbox-credits { border-top-color: rgba(255, 255, 255, .14); }

/* ---------- Fallbacks ---------- */
/* Browsers without backdrop blur get a more solid tint so text stays readable */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root { --glass-tint: rgba(40, 44, 42, .85); --glass-tint-strong: rgba(50, 54, 52, .9); }
  .site-nav { background: rgba(20, 24, 22, .96); }
}
/* People who ask their system for less transparency get solid surfaces */
@media (prefers-reduced-transparency: reduce) {
  :root { --glass-tint: #222624; --glass-tint-strong: #2a2e2c; }
  .glass::before, .nav-bar::before, .filter-btn::before, .lightbox-close::before,
  .lightbox.has-info .lightbox-info::before, .btn-ghost::before, .field input, .field textarea, .site-nav {
    -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  .site-nav { background: #1c201e; }
}
