@import url('https://fonts.googleapis.com/css2?family=Dancing+Script:wght@600;700&display=swap');

/* ═════════════════════════════════════════════════════════════════════
   Liquid Glass Lens Button
   Folder: 2026-09-16-liquid-glass-lens-button-in-css-svg
   Typography: Dancing Script Calligraphy Style
   ═════════════════════════════════════════════════════════════════════ */

.env-portfolio-header {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding: 0 1rem;
  padding-bottom: 0;
  margin: 0;
  z-index: 2500;
  pointer-events: none;
  flex-shrink: 0;
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.7, 0.3, 1);
  animation: envRiseBottom 0.9s 0.2s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}

.env-portfolio-header > * {
  pointer-events: auto;
}

#envelope-intro.opening .env-portfolio-header {
  opacity: 0;
  transform: translateY(28px);
  pointer-events: none;
}

/* Base Liquid Glass Lens Box */
.liquid-glass-btn.box {
  --w: clamp(230px, 22vw, 280px);
  --h: clamp(50px, 5.5vh, 58px);
  --r: 9999px;
  --tr: 18%;
  z-index: 500;
  position: relative;
  width: var(--w);
  height: var(--h);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 0.85rem 0 1.25rem;
  border-radius: var(--r);
  border: 1px double rgba(255, 255, 255, 0.24);
  text-decoration: none;

  box-shadow:
    inset 2px -2px 1px -1px rgba(255, 255, 255, 0.75),
    inset -2px 2px 1px -1px rgba(255, 255, 255, 0.75),
    inset 6px -6px 1px -6px rgba(255, 255, 255, 0.4),
    inset -6px 6px 1px -6px rgba(255, 255, 255, 0.4),
    inset 0 0 4px rgba(255, 255, 255, 0.15),
    0 8px 24px rgba(0, 0, 0, 0.45),
    0 0 18px rgba(255, 182, 193, 0.18);

  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(10px) saturate(1.4);
  -webkit-backdrop-filter: blur(10px) saturate(1.4);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.28s ease, background 0.28s ease;
}

/* Liquid lens deep refraction layer */
.liquid-glass-btn.box:before {
  content: "";
  position: absolute;
  z-index: 1;
  top: 35%;
  left: 50%;
  transform: translateX(-50%);
  width: calc(var(--w) - 14px);
  height: calc(var(--h) - 14px);
  border-radius: var(--r);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.25);
  filter: blur(6px);
  pointer-events: none;
}

/* Specular liquid lens reflection highlight */
.liquid-glass-btn.box:after {
  z-index: 501;
  content: "";
  position: absolute;
  inset: 0;
  width: var(--w);
  height: var(--h);
  border-radius: var(--r);
  filter: blur(6px);
  background: linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.65) 0%,
    transparent var(--tr),
    transparent calc(100% - var(--tr)),
    rgba(255, 255, 255, 0.65) 100%
  );
  pointer-events: none;
}

/* Inner rim overlay */
.liquid-glass-btn .circle-overlay {
  position: absolute;
  inset: 3px;
  width: calc(var(--w) - 8px);
  height: calc(var(--h) - 8px);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--r);
  filter: blur(0.5px);
  pointer-events: none;
}

/* Dancing Script Calligraphy Text */
.liquid-glass-btn .text {
  position: relative;
  z-index: 502;
  font-family: 'Dancing Script', cursive;
  font-size: clamp(21px, 2.2vw, 25px);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff4ea;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7), 0 0 12px rgba(255, 235, 215, 0.35);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
  line-height: 1;
  white-space: nowrap;
  transition: color 0.25s ease, text-shadow 0.25s ease;
}

/* Interactive Lens Arrow Icon */
.liquid-glass-btn .btn-icon {
  position: relative;
  z-index: 502;
  width: 36px;
  height: 36px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg, #912242 0%, #bd3860 100%);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), 0 0 10px rgba(225, 45, 95, 0.35);
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.25s ease;
  flex-shrink: 0;
}

.liquid-glass-btn .btn-icon .svg {
  width: 13px;
  height: 13px;
  fill: #ffffff;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
  transition: transform 0.25s ease;
}

/* Hover, Focus & Active States */
.liquid-glass-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-3px);
  box-shadow:
    inset 2px -2px 1px -1px rgba(255, 255, 255, 0.9),
    inset -2px 2px 1px -1px rgba(255, 255, 255, 0.9),
    inset 6px -6px 1px -6px rgba(255, 255, 255, 0.55),
    inset -6px 6px 1px -6px rgba(255, 255, 255, 0.55),
    0 12px 32px rgba(0, 0, 0, 0.55),
    0 0 24px rgba(255, 64, 129, 0.38);
}

.liquid-glass-btn:hover .text {
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8), 0 0 16px rgba(255, 182, 193, 0.7);
}

.liquid-glass-btn:hover .btn-icon {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5), 0 0 16px rgba(255, 64, 129, 0.6);
}

.liquid-glass-btn:hover .btn-icon .svg {
  transform: translateX(1.5px);
}

.liquid-glass-btn:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.6);
  outline-offset: 3px;
}

.liquid-glass-btn:active {
  transform: scale(0.96) translateY(0);
  box-shadow:
    inset 2px -2px 1px -1px rgba(255, 255, 255, 0.7),
    inset -2px 2px 1px -1px rgba(255, 255, 255, 0.7),
    0 4px 12px rgba(0, 0, 0, 0.4);
}

.liquid-glass-btn:active .btn-icon {
  transform: scale(0.94);
}

/* ═════════════════════════════════════════════════════════════════════
   Fox (Nick) & Foxy (Judy) Romantic Companions
   ═════════════════════════════════════════════════════════════════════ */
.env-fox-companion {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  flex-shrink: 0;
  z-index: 105;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.5s ease;
}

.env-fox-companion .fox-char-img {
  display: block;
  width: auto;
  height: 100%;
  object-fit: contain;
  pointer-events: auto;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.7)) drop-shadow(0 0 16px rgba(202, 164, 106, 0.22));
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.35s ease;
}

.env-fox-companion:hover .fox-char-img {
  filter: drop-shadow(0 14px 26px rgba(0, 0, 0, 0.82)) drop-shadow(0 0 24px rgba(226, 135, 159, 0.45));
}

@keyframes foxBreatheNick {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-4px) rotate(0.8deg); }
}

@keyframes foxBreatheJudy {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-3.5px) rotate(-0.8deg); }
}

.env-fox-companion.fox-twinkle .fox-char-img {
  animation: foxTwinkleAnim 0.75s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes foxTwinkleAnim {
  0% { transform: translateY(0) scale(1); }
  35% { transform: translateY(-10px) scale(1.08) rotate(-1.5deg); filter: drop-shadow(0 16px 28px rgba(255,215,0,0.65)) drop-shadow(0 0 22px rgba(226,135,159,0.85)); }
  70% { transform: translateY(-3px) scale(1.03) rotate(0.8deg); }
  100% { transform: translateY(0) scale(1) rotate(0deg); }
}

/* ═════════════════════════════════════════════════════════════════════
   Desktop View (min-width: 769px)
   - Same exact alignment as mobile: pinned directly at bottom of webpage
   - Fox on left of portfolio button, Foxy on right of it, watching each other
   - Pictures sit flush at the bottom edge (bottom: 0)
   ═════════════════════════════════════════════════════════════════════ */
@media (min-width: 769px) {
  .env-portfolio-header {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: clamp(1.2rem, 2.6vw, 3rem);
    padding: 0 1.5rem;
    padding-bottom: 0; /* Ensures pictures sit flush at the bottom edge */
    margin: 0;
    z-index: 2500;
    pointer-events: none;
    animation: envRiseBottom 0.9s 0.2s cubic-bezier(0.2, 0.7, 0.3, 1) both;
  }

  .env-portfolio-header > * {
    pointer-events: auto;
  }

  #envelope-intro .env-wrap {
    margin-top: auto;
    margin-bottom: auto;
    padding-bottom: clamp(140px, 20vh, 230px); /* Clearance so envelope is never blocked */
  }

  .env-fox-companion {
    position: relative;
    bottom: 0;
    left: auto;
    right: auto;
    margin: 0;
    margin-bottom: 0;
    padding-bottom: 0;
    height: clamp(140px, 19vh, 220px);
    z-index: 105;
    flex-shrink: 0;
    display: flex;
    align-items: flex-end;
    line-height: 0;
  }

  .env-fox-companion .fox-char-img {
    vertical-align: bottom;
    margin-bottom: 0;
    line-height: 0;
  }

  .env-fox-companion.fox-nick {
    order: 1;
    transform-origin: bottom center;
    animation: foxBreatheNick 4.8s 1.2s ease-in-out infinite alternate;
  }

  .env-portfolio-header .liquid-glass-btn.box {
    order: 2;
    flex-shrink: 1;
    align-self: flex-end;
    margin-bottom: clamp(18px, 2.5vh, 32px);
  }

  .env-fox-companion.fox-judy {
    order: 3;
    transform-origin: bottom center;
    animation: foxBreatheJudy 4.5s 1.3s ease-in-out infinite alternate;
  }

  .env-fox-companion.fox-nick:hover {
    transform: translateY(-8px) scale(1.05) rotate(1deg);
  }

  .env-fox-companion.fox-judy:hover {
    transform: translateY(-8px) scale(1.05) rotate(-1deg);
  }

  #envelope-intro.opening .env-portfolio-header {
    opacity: 0;
    transform: translateY(32px);
    pointer-events: none;
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.7, 0.3, 1);
  }

  #envelope-intro.opening .env-fox-companion {
    opacity: 0;
    transform: translateY(32px) scale(0.92);
    pointer-events: none;
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.7, 0.3, 1);
  }
}

/* ═════════════════════════════════════════════════════════════════════
   Mobile View (max-width: 768px)
   - Header is pinned directly at the bottom of the webpage
   - Fox pics sit flush at the bottom edge (bottom: 0)
   - Fox on left of portfolio button, Foxy on right of it, watching each other
   ═════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .env-portfolio-header {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: clamp(0.25rem, 1.8vw, 0.65rem);
    padding: 0 clamp(0.35rem, 1.8vw, 0.75rem);
    padding-bottom: 0; /* Ensures the pictures sit directly on the bottom edge */
    margin: 0;
    z-index: 2500;
    pointer-events: none;
    animation: envRiseBottom 0.9s 0.2s cubic-bezier(0.2, 0.7, 0.3, 1) both;
  }

  .env-portfolio-header > * {
    pointer-events: auto;
  }

  #envelope-intro.opening .env-portfolio-header {
    opacity: 0;
    transform: translateY(24px);
    pointer-events: none;
    transition: opacity 0.55s ease, transform 0.55s cubic-bezier(0.2, 0.7, 0.3, 1);
  }

  #envelope-intro .env-wrap {
    margin-top: auto;
    margin-bottom: auto;
    padding-bottom: clamp(100px, 15vh, 140px); /* Leave clearance for bottom bar */
  }

  .env-fox-companion {
    position: relative;
    bottom: 0;
    left: auto;
    right: auto;
    margin: 0;
    margin-bottom: 0;
    padding-bottom: 0;
    height: clamp(88px, 14vh, 130px);
    z-index: 105;
    flex-shrink: 0;
    display: flex;
    align-items: flex-end;
    line-height: 0;
  }

  .env-fox-companion .fox-char-img {
    vertical-align: bottom;
    margin-bottom: 0;
    line-height: 0;
  }

  .env-fox-companion.fox-nick {
    order: 1;
    transform-origin: bottom center;
    animation: foxBreatheNick 4.8s 1.2s ease-in-out infinite alternate;
  }

  .env-portfolio-header .liquid-glass-btn.box {
    order: 2;
    flex-shrink: 1;
    align-self: flex-end;
    margin-bottom: max(0.6rem, calc(0.35rem + env(safe-area-inset-bottom, 0px)));
  }

  .env-fox-companion.fox-judy {
    order: 3;
    transform-origin: bottom center;
    animation: foxBreatheJudy 4.5s 1.3s ease-in-out infinite alternate;
  }

  #envelope-intro.opening .env-fox-companion {
    opacity: 0;
    transform: translateY(22px) scale(0.92);
    pointer-events: none;
    transition: opacity 0.55s ease, transform 0.55s cubic-bezier(0.2, 0.7, 0.3, 1);
  }
}

@keyframes envRiseBottom {
  from {
    opacity: 0;
    transform: translateY(22px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 480px) {
  .liquid-glass-btn.box {
    --w: clamp(185px, 56vw, 225px);
    --h: 46px;
    padding: 0 0.6rem 0 0.95rem;
  }
  .liquid-glass-btn .text {
    font-size: 19px;
  }
  .liquid-glass-btn .btn-icon {
    width: 28px;
    height: 28px;
  }
  .env-fox-companion {
    height: clamp(75px, 12vh, 100px);
  }
}

@media (max-width: 360px) {
  .liquid-glass-btn.box {
    --w: 168px;
    --h: 42px;
    padding: 0 0.45rem 0 0.8rem;
  }
  .liquid-glass-btn .text {
    font-size: 16.5px;
  }
  .liquid-glass-btn .btn-icon {
    width: 24px;
    height: 24px;
  }
  .env-fox-companion {
    height: 68px;
  }
}

@media (max-height: 640px) and (min-width: 769px) {
  .env-portfolio-header {
    padding-top: 0.4rem;
    padding-bottom: 0.2rem;
  }
  .env-fox-companion {
    height: clamp(100px, 16vh, 135px);
  }
}
