/* ========= VARIABLES ========= */
:root {
  /* Animation control - Adjust this to control border pulse frequency */
  --pulse-frequency: 2s;          /* Lower = faster pulse, Higher = slower pulse */
  
  /* CRT Scanlines */
  --crt-scanline-opacity: 0.4;   /* scanline brightness */
  --crt-scanline-thickness: 2px;  /* line thickness */
  --crt-scanline-spacing: 1px;    /* spacing between lines */

  /* Flicker effect */
  --crt-flicker-speed: .3s;
  
  /* CRT effect variables */
  --crt-flicker-opacity-min: 8;
  --crt-flicker-opacity-max: 15;

  /* Vignette corners */
  --crt-vignette-opacity: 1.2;
  --crt-vignette-size: 60%;

  /* Overall screen glow/color pop */
  --crt-glow-contrast: 1.2;
  --crt-glow-brightness: 1.3;
  --crt-glow-saturation: 1.7;

  /* Slight wobble distortion */
  --crt-distort-strength: 0.4deg;
  --crt-rotate-speed: 300s;   /* rotating background speed */
  
  /* Frame overlay color settings */
  --frame-overlay-color: magenta;    /* Change this to any color you want */
  --frame-overlay-opacity: 0.6;      /* Adjust opacity (0.0 = invisible, 1.0 = fully opaque) */
  
  /* Metallic properties for frame overlay */
  --metallic-shine-intensity: 0.4;   /* How shiny the metallic effect is (0.0 - 1.0) */
  --metallic-gradient-angle: 45deg;  /* Angle of the metallic shine gradient */

  /* ========= DESIGN TOKENS ========= */
  /* Colors */
  --color-bg-panel: rgba(100, 52, 150, 0.54);
  --color-text: #ffffff;
  --color-accent: #e06fea;

  /* Shadows */
  --shadow-glow: 
    0 0 5px #000000,
    0 0 10px rgb(234, 7, 237),
    0 0 15px rgb(130, 8, 8),
    0 0 20px rgb(255, 0, 208);

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;

  /* Durations */
  --duration-fast: 0.3s;
  --duration-pulse: var(--pulse-frequency);
}

/* Cleaned nav container (removed corrupted block) */
.nav-boxes {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Utility: shared glowing border with pulse */
.glow-pulse {
  position: relative;
}
.glow-pulse::before {
  content: "";
  position: absolute;
  inset: -3px; /* bleed slightly outside border radius */
  border-radius: inherit;
  background: radial-gradient(closest-side, rgba(224,111,234,0.6), rgba(224,111,234,0.15) 60%, transparent 70%);
  filter: blur(6px);
  opacity: 0.75;
  transition: opacity var(--duration-fast) ease;
  pointer-events: none;
  z-index: -1;
  animation: glowOpacity var(--duration-pulse) ease-in-out infinite;
}
@keyframes glowOpacity {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 0.9; }
}

/* Apply the glow to core components */
.header-box,
.scroll-window,
.slideshow,
.about-text-box,
.nav-box {
  border: 2px solid var(--color-accent);
  /* Replace heavy multi-layer shadows with offloaded glow */
  box-shadow: 0 0 8px rgba(224,111,234,0.35);
  animation: flickerBorder var(--pulse-frequency) infinite;
}

/* Pause animations on hover for readability */
.header-box:hover,
.scroll-window:hover,
.slideshow:hover,
.about-text-box:hover,
.nav-box:hover {
  animation-play-state: paused;
}

/* Accessibility: reduce motion preference disables pulsing/rotation/wobble */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Primary nav-box style with glow */
.nav-box {
  flex: 0 0 auto;
  min-width: 200px;
  max-width: 300px;
  padding: 0.3rem;
  font-size: 1rem;
  background: var(--color-bg-panel);
  color: var(--color-text);
  border-radius: var(--radius-lg);
  text-align: center;
  box-sizing: border-box;
  white-space: nowrap;
}

/* Nav list semantics */
.nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px; /* replaces <br> spacing */
}
.nav-list li a { display: inline-block; }

/* Center text utility replacing inline style */
.center-text { text-align: center; }

/* ========= FONT ========= */
@font-face {
  font-family: 'Vulf Mono';
  src: url('fonts/VulfMono-Regular.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Vulf Sans';
  src: url('fonts/VulfSans-Regular.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}


/* ========= BASE BODY ========= */
html, body {
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
}



body {
  position: relative;
  overflow: hidden;
  padding-bottom: 50px;
  text-align: center;
  font-family: 'Vulf Mono', monospace;
  margin: 0px;
  min-height: 100%;

  filter: contrast(var(--crt-glow-contrast))
          brightness(var(--crt-glow-brightness))
          saturate(var(--crt-glow-saturation));

  animation: crtWobble 9s ease-in-out infinite;
}


/* ========= ROTATING BACKGROUND ========= */
body {
  background-color: black; 
}

body::before {
  content: "";
  position: fixed;
  top: 50%;
  left: 75%;
  width: 200%;
  height: 300%;
  background-image: url('images/background.png');
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  transform: translate(-50%, -50%);
  z-index: -2;
  animation: rotateBg var(--crt-rotate-speed) linear infinite;
}

@keyframes rotateBg {
  from {
    transform: translate(-50%, -55%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}


/* ========= CRT EFFECT OVERLAY ========= */
body::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;

  background: 
    radial-gradient(circle, rgba(0,0,0,var(--crt-vignette-opacity)) 0%, transparent var(--crt-vignette-size)),
    repeating-linear-gradient(
      0deg,
      rgba(255,255,255,var(--crt-scanline-opacity)),
      rgba(255,255,255,var(--crt-scanline-opacity)) var(--crt-scanline-thickness),
      transparent var(--crt-scanline-thickness),
      transparent calc(var(--crt-scanline-thickness) + var(--crt-scanline-spacing))
    );

  mix-blend-mode: screen;
  animation: flicker var(--crt-flicker-speed) infinite;
}




@keyframes flicker {
  0%   { opacity: var(--crt-flicker-opacity-min); }
  50%  { opacity: var(--crt-flicker-opacity-max); }
  100% { opacity: var(--crt-flicker-opacity-min); }
}

@keyframes crtWobble {
  from { transform: rotate(-var(--crt-distort-strength)); }
  to   { transform: rotate(var(--crt-distort-strength)); }
}


/* ========= TEXT BOXES ========= */
.header-box{
    background: var(--color-bg-panel);  
    padding: 1px 15px;
    border-radius: var(--radius-sm);
    max-width: calc(100% - 20px);
    width: fit-content;
    text-align: center;
    margin: 25px auto 10px auto;
    font-family: Vulf Sans;
    font-weight: bolder;
    align-items: center;
    color: var(--color-accent);
    text-shadow:
    -1px -1px 0 #000,
     1px -1px 0 #000,
    -3px  3px 0 #000,
     0px  0px 0 #000;
    outline: #000000;
}

.header-box h1 {
  color:#e06fea;
  text-align: center;
  text-shadow: 0 0 8px #000000, 0 0 12px rgb(0, 0, 0), 0 0 16px rgb(255, 255, 255);
  animation: flickerLight 3s infinite;
  margin: 4px 0;  /* Reduced from browser default ~16px to 4px top/bottom */
}

@keyframes flickerLight {
  0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% {
    opacity: 1;
    text-shadow:
      0 0 5px #000000,
      0 0 10px rgb(234, 7, 237),
      0 0 15px rgb(130, 8, 8),
      0 0 20px rgb(255, 0, 208);
    transform: translate(0, 0);
  }

  20%, 24%, 55% {
    opacity: 0.4;
    text-shadow: none;
    transform: translate(1px, -1px);
  }

  22%, 26%, 53% {
    opacity: 0.1;
    text-shadow: 0 0 2px rgb(0, 255, 26);
    transform: translate(-1px, 1px);
  }

  50% {
    opacity: 0.8;
    text-shadow: 0 0 10px rgb(211, 26, 26);
  }
}

/* ✨ Smooth sine wave pulse for borders ✨ */
@keyframes flickerBorder {
  0% {
    border-color: var(--color-accent);
    box-shadow: 0 0 8px rgba(224,111,234,0.35);
  }

  25% {
    border-color: rgba(224, 111, 234, 0.9);
    box-shadow: 0 0 14px rgba(224,111,234,0.45);
  }

  50% {
    border-color: rgba(224, 111, 234, 0.7);
    box-shadow: 0 0 22px rgba(224,111,234,0.55);
  }

  75% {
    border-color: rgba(224, 111, 234, 0.9);
    box-shadow: 0 0 14px rgba(224,111,234,0.45);
  }

  100% {
    border-color: var(--color-accent);
    box-shadow: 0 0 8px rgba(224,111,234,0.35);
  }
}




.nav-boxes a {
  color: rgb(0, 247, 255);
  text-decoration: none;
  text-shadow: 0 0 5px rgb(255, 0, 208), 0 0 10px #0ff;
  transition: text-shadow var(--duration-fast) ease, color var(--duration-fast) ease, transform var(--duration-fast) ease, opacity var(--duration-fast) ease, filter var(--duration-fast) ease, box-shadow var(--duration-fast) ease, background var(--duration-fast) ease, border var(--duration-fast) ease;
  display: inline-block;
  padding: 4px 8px;
  margin: 1px;
  background: var(--color-bg-panel);
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  white-space: nowrap;
}

.nav-boxes a:hover {
  color: rgb(255, 0, 217);
  text-shadow: 0 0 8px #0ff, 0 0 16px #0ff, 0 0 24px #0ff;
  /* Individual button hover effects */
  transform: scale(1.05);
  opacity: 0.9;
  filter: drop-shadow(0 0 15px rgba(224, 111, 234, 0.8)) brightness(1.1);
  box-shadow: 
    0 4px 12px rgba(0,0,0,0.2),
    0 0 20px rgba(224, 111, 234, 0.6),
    inset 0 0 20px rgba(224, 111, 234, 0.1);
  background: rgba(150, 52, 200, 0.9);
  border: 2px solid rgba(224, 111, 234, 0.7);
}



.about-box{
    flex: 1;
    background: var(--color-bg-panel);
    padding: var(--space-1);
    border-radius: var(--radius-sm);
    max-width: 600px;
    text-align: center;
    margin: 16px auto;
    font-family: Vulf Mono;
    font-weight: lighter;
    align-items: center;
}

.about-box h2{
    font-family: Vulf Sans;
    font-weight: bolder;
       color: var(--color-accent);
      text-shadow:
    -1px -1px 0 #000,  /* top left */
     1px -1px 0 #000,  /* top right */
    -3px  3px 0 #000,  /* bottom left */
     0px  0px 0 #000;  /* bottom right */
    outline: #000000;
}


.about-box p{
    font-size: smaller;
    color:#ffffff;

}


/* ========= SRCOLL WINDOWS ========= */



.scroll-window {
  width: 80%;
  max-width: 2000px;
  /* ✨ DESKTOP BOTTOM MARGIN CONTROLS ✨ */
  height: 700px;
  max-height: 700px;
  margin: 8px auto 50px auto;
  /* End of desktop bottom margin controls */
  min-height: 200px;
  padding: 10px;
  overflow-y: auto;
  background: var(--color-bg-panel);
  border-radius: var(--radius-sm);
  color: rgb(193, 193, 193);
  font-family: 'Vulf Mono', monospace;
  font-size: small;
  box-sizing: border-box;
}

.scroll-window h1{
  font-size: x-large;        /* Increased from large to x-large */
  font-family: Vulf Sans;
       color:#e06fea;
      text-shadow:
    -1px -1px 0 #000,  /* top left */
     1px -1px 0 #000,  /* top right */
    -3px  3px 0 #000,  /* bottom left */
     0px  0px 0 #000;  /* bottom right */
    outline: #000000;

}

.scroll-window p{
  font-family: Vulf Sans;
  font-size: medium;
  text-align: left;
   text-shadow:
    -1px -1px 0 #000,  
     1px -1px 0 #000,
    -1px  1px 0 #000,
     1px  1px 0 #000;
}

.scroll-window p2{
  text-align: left;
}

.job-title{
  font-family: Vulf Sans;
  font-size: large;
text-align: left;
color:#ffffff;
 text-shadow:
    -1px -1px 0 #000,  
     1px -1px 0 #000,
    -1px  1px 0 #000,
     1px  1px 0 #000;

}

/* ========= SOCIAL LINKS ========= */
.social-links {
  text-align: center;
  margin: 20px 0;
}

.social-links a {
  color: rgb(0, 247, 255);
  text-decoration: none;
  text-shadow: 0 0 5px rgb(255, 0, 208), 0 0 10px #0ff;
  transition: text-shadow var(--duration-fast) ease, color var(--duration-fast) ease, transform var(--duration-fast) ease, opacity var(--duration-fast) ease, filter var(--duration-fast) ease, box-shadow var(--duration-fast) ease, background var(--duration-fast) ease, border var(--duration-fast) ease;
  display: inline-block;
  padding: 4px 8px;
  margin: 2px;
  background: var(--color-bg-panel);
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  white-space: nowrap;
}

.social-links a:hover {
  color: rgb(255, 0, 217);
  text-shadow: 0 0 8px #0ff, 0 0 16px #0ff, 0 0 24px #0ff;
  
  /* Same hover effects as nav links */
  transform: scale(1.05);
  opacity: 0.9;
  filter: drop-shadow(0 0 15px rgba(224, 111, 234, 0.8)) brightness(1.1);
  box-shadow: 
    0 4px 12px rgba(0,0,0,0.2),
    0 0 20px rgba(224, 111, 234, 0.6),
    inset 0 0 20px rgba(224, 111, 234, 0.1);
  background: rgba(150, 52, 200, 0.9);
  border: 2px solid rgba(224, 111, 234, 0.7);
}

.social-links-vertical {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  height: 450px;              /* Match slideshow height */
  width: 120px;
}

.social-links-vertical h3 {
  color: var(--color-accent);
  font-family: 'Vulf Sans', sans-serif;
  font-size: medium;
  margin: 0 0 10px 0;
  padding: 8px;
  text-align: center;
  text-shadow:
    -1px -1px 0 #000,  
     1px -1px 0 #000,
    -1px  1px 0 #000,
     1px  1px 0 #000;
}

.social-links-vertical a {
  color: rgb(0, 247, 255);
  text-decoration: none;
  text-shadow: 0 0 5px rgb(255, 0, 208), 0 0 10px #0ff;
  transition: text-shadow 0.3s ease, color 0.3s ease, transform 0.3s ease, opacity 0.3s ease, filter 0.3s ease, box-shadow 0.3s ease, background 0.3s ease, border 0.3s ease;
  
  /* Same button styling as nav links */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 8px;
  margin: 4px 0;
  background: var(--color-bg-panel);
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  white-space: nowrap;
}

/* ========= EMBEDS ========= */


.spotify-embed {
  margin: 4px auto;
  border-radius: 12px;
  width: 100%;
  height: 200px;
}
.spotify-embed {
  margin: 2px 0; /* Controls spacing around iframes */
}

.youtube-embed{
  border-radius: 10px;
  width: 500px;
  height:300px;
}

/* ========= SLIDESHOW ========= */
.content-container {
  display: flex;
  gap: 60px;
  align-items: flex-start;
  justify-content: center;
  margin: 16px auto;
  width: 100%;
  max-width: 1000px;
}

.bio-weather-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex: 1;
  max-width: 350px;
}

.slideshow-social-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
}

.slideshow {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 600px;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius-lg);
  position: relative;
}

.about-text-box {
  width: 100%;
  max-width: 350px;
  background: var(--color-bg-panel);
  padding: 15px;
  border-radius: var(--radius-md);
  color: rgb(193, 193, 193);
  font-family: 'Vulf Mono', monospace;
  font-size: small;
  text-align: left;
  overflow-y: auto;
  height: 450px;
}

.about-text-box p {
  font-family: 'Vulf Sans', sans-serif;
  font-size: medium;
  text-shadow:
    -1px -1px 0 #000,  
     1px -1px 0 #000,
    -1px  1px 0 #000,
     1px  1px 0 #000;
  margin: 8px 0;
}

.social-links-vertical {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  height: 450px;              /* Match slideshow height */
  width: 120px;
}

.social-links-vertical h3 {
  color: var(--color-accent);
  font-family: 'Vulf Sans', sans-serif;
  font-size: medium;
  margin: 0 0 10px 0;
  padding: 8px;
  text-align: center;
  text-shadow:
    -1px -1px 0 #000,  
     1px -1px 0 #000,
    -1px  1px 0 #000,
     1px  1px 0 #000;
}

.social-links-vertical a {
  color: rgb(0, 247, 255);
  text-decoration: none;
  text-shadow: 0 0 5px rgb(255, 0, 208), 0 0 10px #0ff;
  transition: text-shadow 0.3s ease, color 0.3s ease, transform 0.3s ease, opacity 0.3s ease, filter 0.3s ease, box-shadow 0.3s ease, background 0.3s ease, border 0.3s ease;
  
  /* Same button styling as nav links */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 8px;
  margin: 4px 0;
  background: var(--color-bg-panel);
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  white-space: nowrap;
}

.slideshow img {
  width: 100%;   /* or 100% to fill the container */
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  transition: opacity 1s ease-in-out;
  border-radius: 8px;
}


.slideshow img.visible {
  opacity: 1;
}

.friend-boxes {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* Four equal-width columns on desktop */
  gap: 16px;
  justify-content: center;
  padding: 20px;
  max-width: 1000px; /* Increased max-width to accommodate 4 columns */
  margin: auto;
}

.friend-link {
  text-decoration: none; /* Remove underline from links */
  display: block; /* Make the entire container clickable */
  transition: transform 0.3s ease, opacity 0.3s ease, filter 0.3s ease;
}

.friend-link:hover {
  transform: scale(1.05); /* Slight zoom on hover */
  opacity: 0.9;
  filter: drop-shadow(0 0 15px rgba(224, 111, 234, 0.8)) brightness(1.1);
}

.friend-container {
  border-radius: 20px;
  text-align: center;
  font-size: larger;
  padding: 10px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  background: rgba(100, 52, 150, 0.8);
  transition: box-shadow 0.3s ease, background 0.3s ease, border 0.3s ease;
  border: 2px solid transparent;
}

.friend-link:hover .friend-container {
  box-shadow: 
    0 4px 12px rgba(0,0,0,0.2),
    0 0 20px rgba(224, 111, 234, 0.6),
    inset 0 0 20px rgba(224, 111, 234, 0.1);
  background: rgba(150, 52, 200, 0.9);
  border: 2px solid rgba(224, 111, 234, 0.7);
}

.friend-name {
  color: rgb(0, 247, 255);
  text-shadow: 0 0 5px rgb(255, 0, 208), 0 0 10px #0ff;
  font-family: 'Vulf Sans', sans-serif;
  font-weight: bold;
  margin-top: 8px;
}

.friend-image {
  max-width: 100%;
  height: auto;
  max-height: 150px;
  border-radius: 3px;
  object-fit: cover;
}

/* ========= PHOTO ALBUM STYLES ========= */
.photo-gallery {
  columns: 3;
  column-gap: 30px;
  padding: 20px;
  margin-top: 20px;
}

.framed-photo {
  position: relative;
  display: inline-block;
  margin-bottom: 30px;
  break-inside: avoid;
  transition: transform 0.3s ease;
  width: 100%;
  overflow: hidden;
}

.framed-photo:hover {
  transform: scale(1.05) rotate(0deg) !important;
}

.framed-photo img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
  position: relative;
  z-index: 4; /* Above the colored overlay so photos show on top */
  /* Clip the photo to show only in the center area where the frame is transparent */
  clip-path: inset(15% 15% 15% 15%);
}

/* Frame overlay showing the actual frame design */
.framed-photo::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('images/frame.jpeg');
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: center;
  pointer-events: none;
  z-index: 0; /* Behind the photo so frame doesn't cover the image */
}

/* Colored overlay on top of the frame */
.framed-photo::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    /* Metallic shine gradient overlay */
    linear-gradient(
      var(--metallic-gradient-angle),
      transparent 20%,
      rgba(255, 255, 255, var(--metallic-shine-intensity)) 40%,
      rgba(255, 255, 255, calc(var(--metallic-shine-intensity) * 0.6)) 45%,
      rgba(255, 255, 255, calc(var(--metallic-shine-intensity) * 0.3)) 50%,
      rgba(255, 255, 255, calc(var(--metallic-shine-intensity) * 0.6)) 55%,
      rgba(255, 255, 255, var(--metallic-shine-intensity)) 60%,
      transparent 80%
    ),
    /* Base color layer */
    var(--frame-overlay-color);
  opacity: var(--frame-overlay-opacity);
  pointer-events: none;
  z-index: 3; /* Above everything to overlay the color */
  mix-blend-mode: multiply; /* Blends nicely with the frame underneath */
  filter: 
    contrast(1.2) 
    brightness(1.1) 
    saturate(1.3);
  /* Subtle animation for living metallic effect */
  animation: metallicShimmer 4s ease-in-out infinite alternate;
}

@keyframes metallicShimmer {
  0% {
    filter: 
      contrast(1.2) 
      brightness(1.1) 
      saturate(1.3) 
      hue-rotate(0deg);
  }
  100% {
    filter: 
      contrast(1.3) 
      brightness(1.2) 
      saturate(1.4) 
      hue-rotate(5deg);
  }
}

/* Automatic random variations for all photos using pseudo-random calculations */
.framed-photo:nth-child(3n+1) {
  transform: scale(calc(0.85 + (0.3 * var(--photo-variation, 0.5)))) rotate(calc(-3deg + (6deg * var(--photo-rotation, 0.5))));
}

.framed-photo:nth-child(3n+2) {
  transform: scale(calc(0.9 + (0.25 * var(--photo-variation, 0.7)))) rotate(calc(-2deg + (4deg * var(--photo-rotation, 0.3))));
}

.framed-photo:nth-child(3n+3) {
  transform: scale(calc(0.88 + (0.27 * var(--photo-variation, 0.6)))) rotate(calc(-1deg + (2deg * var(--photo-rotation, 0.8))));
}

/* More specific variations using prime number patterns for better randomness */
.framed-photo:nth-child(5n+1) { --photo-variation: 0.2; --photo-rotation: 0.8; }
.framed-photo:nth-child(5n+2) { --photo-variation: 0.9; --photo-rotation: 0.1; }
.framed-photo:nth-child(5n+3) { --photo-variation: 0.6; --photo-rotation: 0.9; }
.framed-photo:nth-child(5n+4) { --photo-variation: 0.3; --photo-rotation: 0.4; }
.framed-photo:nth-child(5n+5) { --photo-variation: 0.8; --photo-rotation: 0.7; }

.framed-photo:nth-child(7n+1) { --photo-variation: 0.4; --photo-rotation: 0.2; }
.framed-photo:nth-child(7n+2) { --photo-variation: 0.7; --photo-rotation: 0.8; }
.framed-photo:nth-child(7n+3) { --photo-variation: 0.1; --photo-rotation: 0.5; }
.framed-photo:nth-child(7n+4) { --photo-variation: 0.9; --photo-rotation: 0.3; }
.framed-photo:nth-child(7n+5) { --photo-variation: 0.5; --photo-rotation: 0.9; }
.framed-photo:nth-child(7n+6) { --photo-variation: 0.2; --photo-rotation: 0.1; }
.framed-photo:nth-child(7n+7) { --photo-variation: 0.8; --photo-rotation: 0.6; }

/* REVERT: Remove previous photo-album specific hover/disable overrides to restore frames */
/* Removed empty ruleset for photo-gallery revert */
/* Restore photo album frame behavior */
body[data-page="photo-album"] .photo-gallery .framed-photo { position: relative; overflow: visible; }
body[data-page="photo-album"] .photo-gallery .framed-photo img { clip-path: inset(15% 15% 15% 15%); z-index:4; }
/* Ensure frame pseudo stays below image */
body[data-page="photo-album"] .photo-gallery .framed-photo::before { z-index:3; }
/* Remove any previous force resets */
body[data-page="photo-album"] .photo-gallery .framed-photo:hover { transform: none; }

/* Neutralize hover on framed photos for photo album page only */
body[data-page="photo-album"] .framed-photo:hover { transform: none !important; }

/* ========= WEATHER WIDGET ========= */
.weather-widget {
  width: 100%;
  max-width: 350px;
  margin: 0;
  padding: var(--space-3);
  text-align: center;
  font-family: 'Vulf Sans', sans-serif;
  background: var(--color-bg-panel);
  border: 2px solid var(--color-accent);
  border-radius: var(--radius-md);
  box-shadow: 0 0 8px rgba(224,111,234,0.35);
  animation: flickerBorder var(--pulse-frequency) infinite;
}

.weather-widget:hover { animation-play-state: paused; }

.weather-loading {
  color: var(--color-text);
  font-size: 0.9rem;
  opacity: 0.8;
}

.weather-location {
  color: var(--color-accent);
  font-weight: bold;
  font-size: 1rem;
  margin-bottom: var(--space-1);
  text-shadow: 0 0 4px rgba(224,111,234,0.6);
}

.weather-temp {
  color: var(--color-text);
  font-size: 2.2rem;
  font-weight: bold;
  margin: var(--space-1) 0;
  text-shadow: 0 0 6px rgba(255,255,255,0.4);
  font-family: 'Vulf Mono', monospace;
}

.weather-desc {
  color: var(--color-text);
  font-size: 0.95rem;
  margin-bottom: var(--space-1);
  text-transform: capitalize;
}

.weather-feels-like {
  color: rgba(255,255,255,0.7);
  font-size: 0.8rem;
  font-style: italic;
}

@media (max-width: 768px) {
  .weather-widget { 
    width: 100%; 
    max-width: 100%; 
    font-size: 0.9rem; 
  }
  .weather-temp { font-size: 1.8rem; }
}

/* ========= MOBILE STYLES ========= */
@media (max-width: 768px) {
  /* Body adjustments */
  body {
    padding-top: 0;
  }

  /* Header box mobile */
  .header-box {
    max-width: 95%;
    padding: 1px 12px;         /* Match desktop ratios: 1px vertical, slightly less horizontal for mobile */
    margin: 20px auto 8px auto; /* Scaled down from desktop 25px to 20px top margin */
  }
  
  .header-box h1 {
    font-size: 6vw;
    margin: 3px 0;             /* Scaled down from desktop 4px to 3px */
  }

  /* Navigation mobile */
  .nav-boxes {
    flex-direction: row;       /* Keep horizontal layout */
    gap: 0.5rem;
    padding: 0 10px;
    margin: 4px auto;
    overflow-x: auto;          /* Allow horizontal scrolling */
    flex-wrap: nowrap;         /* Ensure no wrapping on mobile */
  }
  
  .nav-box {                  /* Only overrides from base */
    flex: 0 0 auto;            /* Prevent shrinking/growing */
    min-width: 120px;          /* Smaller minimum for mobile */
    max-width: 200px;          /* Smaller maximum for mobile */
    padding: 0.25rem;          /* Scaled down from desktop 0.3rem to 0.25rem */
    font-size: 0.9rem;
  }

  /* Content sections mobile - Force vertical stacking */
  .content-container {
    flex-direction: column;    /* Stack vertically instead of horizontally */
    align-items: center;       /* Center everything */
    gap: 15px;                 /* Slightly smaller gap for mobile */
  }

  .slideshow-social-container {
    order: 1;                  /* Slideshow container first */
    width: 100%;
  }

  .bio-weather-container {
    order: 2;                  /* Bio and weather container second */
    width: 100%;
    max-width: 100%;
  }

  .slideshow {
    width: 100%;
    max-width: 100%;
    aspect-ratio: 5/3;
    border-radius: 0px;
  }

  .about-text-box {
    width: 100%;               /* Full width on mobile */
    max-width: 100%;           /* Remove width restrictions for mobile */
    height: auto;              /* Let height be determined by content */
    margin: 0;
  }

  .social-links-vertical {
    width: 100%;               /* Full width on mobile */
    height: auto;              /* Match bio height */
  }

  .social-links-vertical a {
    padding: 8px 6px;          /* Smaller padding for mobile */
    margin: 2px 0;             /* Tighter spacing */
    font-size: 0.85rem;        /* Smaller text */
  }

  /* Content sections mobile */
  .about-box,
  .slideshow {
    margin: 4px auto;
  }

  /* Scroll windows mobile */
  .scroll-window {
    /* ✨ MOBILE BOTTOM MARGIN CONTROLS ✨ */
    /* Change these values to adjust how far the scroll box sits from the bottom on mobile */
    height: 550px;                     /* 📱 FIXED HEIGHT: Simple 550px height for mobile */
    max-height: 550px;                 /* 📱 FIXED MAX HEIGHT: Simple 550px max height */
    margin: 2px auto 30px auto;        /* 📱 EXTRA MARGIN: 30px additional space from screen edge */
    /* End of mobile bottom margin controls */
    
    width: 100%;
    max-width: 95%;
    min-height: 550px;              /* Reduced minimum for mobile */
  }

  /* YouTube embeds mobile */
  .youtube-embed {
    width: 400px;
    max-width: 100%;
    height: 250px;
  }

  /* Photo gallery mobile */
  .photo-gallery {
    columns: 1;
  }

  /* Friend boxes mobile - 2 columns instead of 4 */
  .friend-boxes {
    grid-template-columns: repeat(2, 1fr);
    max-width: 500px;
    gap: 12px;
    padding: 15px;
  }

  .friend-container {
    padding: 8px;
    font-size: medium;
  }

  .friend-image {
    max-height: 120px;
  }

  /* Disable colored overlay on mobile to prevent magenta tint */
  .framed-photo::after {
    opacity: 0 !important;
    animation: none !important;
  }
}

/* Tablet styles */
@media (max-width: 1024px) and (min-width: 769px) {
  .photo-gallery {
    columns: 2;
  }
}

/* Helper class: disable animations programmatically */
.no-anim *, .no-anim *::before, .no-anim *::after { animation: none !important; transition: none !important; }

/* Reusable panel class */
.panel {
  background: var(--color-bg-panel);
  border-radius: var(--radius-sm);
  color: var(--color-text);
}
.panel--lg { border-radius: var(--radius-lg); }
.panel--md { border-radius: var(--radius-md); }
.panel--pad-sm { padding: var(--space-1); }
.panel--pad-md { padding: var(--space-3); }
.panel--pad-lg { padding: var(--space-5); }

/* ========= POSTER RIBBON (two-row collage) ========= */
.poster-ribbon {
  display: grid;
  grid-template-rows: repeat(2, 1fr);
  grid-auto-flow: column;
  grid-auto-columns: minmax(160px, 1fr);
  gap: 0; /* edges touching */
  width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.poster-ribbon::-webkit-scrollbar { display: none; }
.poster-ribbon-item { position: relative; width: 100%; height: 100%; }
.poster-ribbon-item img { display:block; width:100%; height:100%; object-fit:cover; }
@media (max-width: 800px){
  .poster-ribbon { grid-auto-columns: minmax(120px, 1fr); }
}

/* Poster ribbon hover effect (scale & lift) */
.poster-ribbon { position: relative; }
.poster-ribbon-item { transition: transform .35s ease, box-shadow .35s ease; }
.poster-ribbon-item:hover { 
  transform: scale(1.35); 
  z-index: 20; 
  box-shadow: 0 8px 18px rgba(0,0,0,0.55), 0 0 10px rgba(224,111,234,0.5);
}

/* Poster ribbon hover refinement: show full image (no crop) */
.poster-ribbon-item { overflow: visible; }
.poster-ribbon-item img { transition: transform .35s ease, box-shadow .35s ease, filter .35s ease, object-fit .35s ease; }
.poster-ribbon-item:hover { transform: none; } /* remove parent scale to avoid clipping logic */
.poster-ribbon-item:hover img {
  transform: scale(1.35);
  object-fit: contain; /* show entire poster */
  background: rgba(0,0,0,0.85); /* optional backdrop around differing aspect */
  box-shadow: 0 10px 28px rgba(0,0,0,0.65), 0 0 14px rgba(224,111,234,0.55);
  border-radius: var(--radius-sm);
  z-index: 25;
  position: relative;
}

/* Ensure scaled image can extend beyond grid cell */
.poster-ribbon { overflow: visible; }
