@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Source+Serif+4:ital,opsz,wght@0,8..60,200..900;1,8..60,200..900&display=swap');
:root{
  /* Base colors (unchanged) */
  --primary-color: #11121a;
  --boxbackground-color: #383941;
  --hover-color: #4e4f5a;
  --text-color: #a0a0a5;
  --cap-text-color: #7d9aa2; 

  /* IMPORTANTLINE - Fallback hue */
  --page-hue: 220; /* Default blue fallback */

  
  /* Drift amounts (adjustable) */
  --drift-amount: 17; /* degrees to shift */
  

  /* Main hue family */
  --accent-color: hsl(var(--page-hue), 84%, 62%);
  --active-navsection: hsl(var(--page-hue), 70%, 35%);
  --tipLinkColor: hsl(var(--page-hue), 60%, 77%);
  
  /* Drift colors */
  --drift-color-warm: hsl(calc(var(--page-hue) + var(--drift-amount)), 80%, 65%);
  --drift-color-cool: hsl(calc(var(--page-hue) - var(--drift-amount)), 80%, 65%);
}


*{
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html{
  font-family: Poppins, 'Segoe UI', sans-serif;
  color: var(--text-color);
  scroll-behavior: smooth; /*For bookmark links*/
  background-color: var(--primary-color); /* fills viewport beyond centered body */
}
body{
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--primary-color);
  max-width: 1100px;   /* cap width on very wide screens */
  margin: 0 auto;      /* center within viewport */
}
main{
  padding: min(5em, 7%);
}
main p{
  margin-top: .35em;
}


main a {  
color: rgb(124, 130, 190);
font-weight: 600;
text-decoration: underline;
padding: 0rem 0rem;
}

main a:visited {  
color: rgb(98, 94, 131);
font-weight: 600;
text-decoration: underline;
padding: 0rem 0rem;
}

main a:hover {
color: rgb(173, 177, 182);
font-weight: 700;
text-decoration-line: var(--primary-color);
text-transform:var(--primary-color);
transition: background-color 0.3s ease;
padding: 0rem 0rem;
}

main a:active {  
color: rgb(212, 189, 189);
font-weight: 600;
text-decoration: underline;
padding: 0rem 0rem;
}
.skip-link {
  opacity: 0;
  pointer-events: none;
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1000;
  background-color: var(--accent-color); 
  color: #ffffff; 
  padding: 12px 24px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  font-size: 1rem;
  transition: opacity 0.3s ease;
}

.skip-link:focus {
  opacity: 1; 
  pointer-events: auto; 
  outline: 3px solid #ffffff; 
}

/* MAIN Article Styles */
.article-header {
  text-align: center;
  margin-bottom: 2em;
  padding-bottom: 0.2em;
  padding-top: 0.6em;
  margin: .4em 0 .4em 0;
}

.article-date {
  color: var(--accent-color);
  font-weight: 500;
  margin-bottom: 0.5em;
}

.article-subtitle {
  color: var(--text-color);
  font-size: 1.2em;
  margin-bottom: 1em;
}

.article-intro {
  font-size: 1.2em;
  margin-bottom: 1em;
  line-height: 1.6;
  color: var(--text-color);
  font-weight: 300; 
  font-style: italic;
  font-size: .9em;
}
.section-header, h2{
  padding-bottom: 0.2em;
  padding-top: 0.6em;
  margin: .4em 0 .4em 0;
  /* color: rgb(78, 204, 53); */
}

.section-header, h3{
  color: var(--accent-color);
  font-size: 1.3em;
  font-weight: 600;
  margin: .3em 0 .3em 0;
  border-bottom: 0px solid var(--hover-color);
  padding-bottom: 0.1em;
  padding-top: 0.1em;
}


.section-header-related {
  color: var(--text-color);
  font-size: 1.3em;
  font-weight: 600;
  margin: 0em 0 0em 0;
  padding-bottom: 0em;
}

/* special Boxed Area  */

/* SUPPOEDLY NOT USED  '.area-details' class and it's style  */
.area-details {
  background-color: var(--boxbackground-color);
  padding: 1.5em;
  margin: 1.5em 0;
  border-left: 4px solid var(--drift-color-warm);
}

.area-details h3 {
  color: var(--drift-color-warm);
  color: orange;
  margin-bottom: 1em;
}


/* Image Styles */
figure {
  margin: 1.5em auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

figure img {
  width: 100%;
  max-width: 440px;
/* background-color: rgb(163, 219, 53); /* Temporary background for visibility */
  height: auto;
  display: block;
  margin: 0 auto;
}

figure.single-images { /* For ONE IMAGE that displays CENTERED and a little larger */
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 2em auto;
  max-width: 100%;
}

figure.single-images img {
  max-width: 460px;
  width: 100%;
  height: auto;
}

figure.single-images figcaption {
  max-width: 440px;
  text-align: center;
}

/* Here is a new CLASS to help display SOMETHING EXTRA with certain images  */
figure.single-plus { /* PLUS SOMETHING EXTRA ~~ for ONE image, centered, larger */
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 2em auto;
  max-width: 100%;
}

/* Container for the main image and extra images side by side */
figure.single-plus .image-container {
  display: flex;
  align-items: flex-start;
  gap: 20px; /* Space between main image and extra images */
  justify-content: center;
}


figure.single-plus { /* was just '.img' -- removed unused .main-image */
  display: block;
/* max-width: 520px;
  width: 100%;
  height: auto; */
  flex-shrink: 0; /* Prevent shrinking */
}

figure.single-plus img {
  width: 100%;
  height: auto;
  display: block;
}

/* style extra images */

/* Container for the extra small images */
figure.single-plus .extra-images {
  display: flex;
  flex-direction: column;
  gap: 10px; /* Space between extra images */
  margin-top: 0;
}

/* Individual extra image styling */
figure.single-plus .extra-image {
  width: 65px; /* Adjust size as needed */
  height: 65px;
  border: 2px solid var(--accent-color);
  border-radius: 6px;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease;
  background-color: var(--boxbackground-color);
  cursor: pointer;
}

figure.single-plus .extra-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

figure.single-plus .extra-image:hover {
  transform: scale(1.05);
  border-color: var(--drift-color-warm);
}

figure.single-plus figcaption {
  max-width: 440px;
  text-align: center;
  max-width: 520px; /* Match main image max-width */
  margin-top: 0.5em;
}

/* end of new CLASSES to help display SOMETHING EXTRA with certain images  */

/* other image configs */

figure.dual-images { /* For TWO images */
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1em;
  margin: 1.5em 0; /* Standard margin */
  max-width: 100%; /* Remove width restriction */
}

/* Update 2026-08-13: mismatched-aspect-ratio photos (one landscape, one portrait) were
   rendering at very different heights side by side. Cap max-height instead of forcing
   a fixed box -- each image scales down by its own aspect ratio (no crop, no zoom).
   A portrait photo naturally ends up narrower than a landscape one under the same cap;
   that's expected, not a bug. */
figure.dual-images img {
  width: auto;
  height: auto;
  max-height: 280px;
  max-width: 100%;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

figure.dual-images figcaption {
  grid-column: 1 / -1; /* Span across both columns */
  margin-top: 0.5em;
}

figure.multi-images { 
  display: grid;
  grid-template-columns: 1fr 1fr 1fr; 
  gap: 0.7em;
  margin: 1.5em 0; /* Standard margin */
  max-width: 100%; /* Remove width restriction */
}

figure.multi-images figcaption {
  grid-column: 1 / -1; /* Span across all columns */
  margin-top: 0.5em;
}

figure a {
  display: block;
  transition: opacity 0.2s ease;
}

figure a:hover {
  opacity: 0.8;
  transform: translateY(-4px) scale(1.03);
  transition: transform 0.2s ease;
}


/* Figcaption - SIMPLIFIED */
figcaption {
  font-style: italic;
  color: var(--cap-text-color);
  margin-top: 0.5em;
  text-align: center;
  font-size: 0.8em;
  width: 100%; /* Take full width of parent */
  box-sizing: border-box;
}


/* Floating images - ADD clear utility */
.float-left {
  float: left;
  margin: 0 1.5em 1em 0; 
  max-width: 275px;
  /* background-color: rgb(205, 156, 50);  */ 
  padding: 10px 10px 0 10px; 
  clear: left;
}

.float-right {
  float: right;
  margin: 0 0 1em 1.5em;
  max-width: 275px;
  /* background-color: rgb(239, 77, 218); */
  padding: 10px 10px 0 10px;
  clear: right;
}

/* ADD this clear utility class */
.clear-both {
  clear: both;
}


/* BOX & CONTATINER Styles --hover-color  */

/* NOT USED  'box' class and it's style  */
.box {
  background-color: var(--boxbackground-color);  
  border: 1px solid var(--hover-color);  
  padding: 1.5em;
/* margin: 2em 0; */
  color: var(--text-color);
  clear: both; /* Clear any floats */
} 

/* NOT USED  'container' class and it's style  */
.container {
  background-color: var(--boxbackground-color); /* Fix: was var(pink) */
  border: 1px solid var(--hover-color); /* Simpler border */
  padding: 1.5em;
  margin: 2em 0;
  color: var(--text-color);
  clear: both; /* Clear any floats */
}


/* Tab Styles */
.tab-container {
  margin: 0em 0em;
}

.tab-buttons {
  display: flex;
  border-bottom: 2px solid var(--hover-color);
  margin-bottom: 0em;
}

.tab-button {
  background: none;
  border: none;
  color: var(--text-color);
  padding: 1em 1.5em;
  cursor: pointer;
  transition: all 150ms ease;
  border-bottom: 3px solid transparent;
  font-family: inherit;
}

.tab-button:hover {
  background-color: var(--hover-color);
}

.tab-button.active {
  color: var(--drift-color-cool);
  border-bottom-color: var(--drift-color-cool);
}

.tab-content {
  display: none;
  background-color: var(--boxbackground-color);
  padding: 0.1em 1.5em 2em 1.5em  ;
  border-radius: 0px;
  margin-top: 0;
  margin-bottom: 7em;
}
.tab-content h3 {
  color: var(--drift-color-cool);
  margin-top: 1em;
  margin-bottom: .07em;
}

.tab-content.active {
  display: block;
}



/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 1.5em; 
  right: 1em; 
  background-color: var(--hover-color);
  color: var(--text-color);
  text-decoration: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5em;
  font-weight: bold;
  transition: all 0.3s ease;
  border: 1px solid var(--accent-color);
  opacity: 0.7;
  z-index: 100;
}

.back-to-top:hover {
  background-color: var(--accent-color);
  color: #ffffff;
  opacity: 1;
  transform: translateY(-2px);
}



/* Tooltip Styles */
.tooltip {
  position: relative;
  cursor: help;
  text-decoration: underline;
  text-decoration-style: dotted;
  color: var(--tipLinkColor);
}

.tooltip .tooltip-content {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--hover-color);
  color: var(--text-color);
  text-align: center;
  padding: 1em;
  border-radius: 6px;
  width: 300px;
  z-index: 1000;
  border: 1px solid var(--tipLinkColor);
  transition: opacity 0.3s, visibility 0.3s;
  font-size: 0.9em;
  line-height: 1.4;
}

.tooltip .tooltip-content::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: var(--tipLinkColor) transparent transparent transparent;
}

.tooltip:hover .tooltip-content {
  visibility: visible;
  opacity: 1;
}

.tooltip-content img {
  max-width: 235px;
  max-height: 175px;
  height: auto;
  margin-bottom: 0.5em;
  border-radius: 4px;
}

 
/* . . . . . . Lightbox Styles  . . . . . . . .*/

.lightbox {
  display: none;
  position: fixed;
  z-index: 9000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(2px);
}

.lightbox:target {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 2em;
}

.lightbox-content {
  max-width: 90%;
  max-height: 80%;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.lightbox-caption {
  color: var(--text-color);
  text-align: center;
  margin-top: 1em;
  max-width: 600px;
  font-style: italic;
  line-height: 1.4;
  background-color: rgba(17, 18, 26, 0.8);
  padding: .5em;
  border-radius: 5px;
  border: 1px solid var(--hover-color);
}

.lightbox-filename {
  color: var(--text-color);
  text-align: center;
  margin-top: 0.5em;
  font-size: 1em;
  font-style: normal;
  font-family: monospace;
  opacity: 0.6;
  word-break: break-all;
  max-width: 600px;
}

.lightbox-counter {
  color: var(--text-color);
  text-align: center;
  margin-top: 0.3em;
  font-size: 0.75em;
  font-style: italic;
}

.lightbox .close {
  position: absolute;
  top: 1em;
  right: 1em;
  color: var(--text-color);
  font-size: 2em;
  font-weight: bold;
  text-decoration: none;
  z-index: 1001;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(17, 18, 26, 0.8);
  border-radius: 50%;
  border: 2px solid var(--hover-color);
  transition: all 0.3s ease;
}

.lightbox .close:hover {
  background-color: var(--accent-color);
  color: white;
  transform: scale(1.1);
}

/* Navigation arrows */
.lightbox .nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-color);
  font-size: 2em;
  font-weight: bold;
  text-decoration: none;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(17, 18, 26, 0.8);
  border-radius: 50%;
  border: 2px solid var(--hover-color);
  transition: all 0.3s ease;
  z-index: 1001;
}

.lightbox .nav-arrow:hover {
  background-color: var(--accent-color);
  color: white;
  transform: translateY(-50%) scale(1.1);
}

.lightbox .nav-prev {
  left: 2em;
}

.lightbox .nav-next {
  right: 2em;
}

/* ATTENTION PLEASE THIS IS THE NEW CODE THAT I ADDEDED>>>> START  */
.lightbox:target {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 2em;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    /* scroll-behavior: auto !important; */
  }


/* Prevent scroll when lightbox is open */
/* body:has(.lightbox:target) { */
    /* overflow: hidden; */
    /* position: fixed; */
    /* width: 100%; */
/* } */

/* ATTENTION PLEASE THIS IS THE NEW CODE THAT I ADDEDED>>>> END  */


/* Hide navigation arrows on first/last images */
/* #lightbox-1 .nav-prev,
#lightbox-10 .nav-next {
  display: none;
} */


/* --- ------------------------------------------- */
/* -------------- Responsive Styles -------------- */ 
/* --- ------------------------------------------- */ 
@media screen and (max-width: 700px) {
  

  /* Mobile minor float image adjust styles */
  .float-left,
  .float-right {
    float: none;
    display: block;
    margin: 1em auto;
    max-width: 90%;
    clear: both;
  }


  /* Mobile tab styles */
  .tab-buttons {
    flex-direction: column;
  }
  
  .tab-button {
    padding: 0.8em 1em;
    text-align: left;
  }

/* LIGHTBOX Mobile responsive adjustments */
 
  .lightbox:target {
    padding: 1em;
  }
  
  .lightbox-content {
    max-width: 95%;
    max-height: 70%;
  }
  
  .lightbox .close {
    top: 1em;
    right: 1em;
    width: 40px;
    height: 40px;
    font-size: 1.5em;
  }
  
  .lightbox .nav-arrow {
    width: 50px;
    height: 50px;
    font-size: 1.5em;
  }
  
  .lightbox .nav-prev {
    left: 1em;
  }
  
  .lightbox .nav-next {
    right: 1em;
  }
  
  .lightbox-caption {
    font-size: 0.9em;
    padding: 0.8em;
    margin-top: 0.8em;
  }

  .lightbox-filename {
    font-size: 0.85em;
  }

  .lightbox-counter {
    font-size: 0.7em;
  }

  figure.single-plus .image-container {
    flex-direction: column;
    align-items: center;
    gap: 15px;
  }
  
  figure.single-plus .extra-images {
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
  }
  
  figure.single-plus .extra-image {
    width: 70px;
    height: 70px;
    margin: 5px;
  }

}

/* New CSS for Photo Shuffle */

/* The main container for the photo stack. */
.photo-stack-container {
    position: relative;
    width: 300px; /* Fixed width for the photo */
    height: 300px; /* Fixed height for the photo */
    cursor: pointer;
    -webkit-perspective: 1000px; /* For 3D transformations */
    perspective: 1000px;
    margin: 2rem auto; /* Center the container */
    /* Allow clicks to go through to the actual photo elements */
    pointer-events: none; /* lets child photos handle the events */
}

/* Styling for individual photos. */
.photo {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #fff;
    background-size: cover;
    background-position: center;
    border-radius: 1px;
    border: 8px solid #e9e7e7; /* White border to mimic photo paper */ 
    border-bottom: 37px solid #e2e2e1; 
    
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1), 0 10px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease-out; /* Smoother reset after animation */
    will-change: transform, z-index; /* Performance optimization for animations */
    /* Ensure photos can be interacted with inside the container */
    pointer-events: auto;
    animation-play-state: running;
}

.photo-stack-container.borderless .photo {
  border: none;
  box-shadow: none;
}

.photo-stack-container.grabbing {
  cursor: grabbing;
}

/* IMPORTANT: Removed nth-child background-image and transform here.
   These are now managed dynamically by JavaScript to ensure correct display
   regardless of DOM order after shuffling.
*/

/* The `animating` class temporarily disables transition to allow keyframes full control. */
.photo.animating {
    transition: none; /* Disable transition during the main animation */
}

/* ---------------------------------------------------- */
/* --- DYNAMIC SHUFFLE ANIMATIONS --- */
/* Each keyframe defines a unique, "messy" path for the photo
 * to travel before it appears to go to the back of the stack.
 * The `forwards` fill-mode means it stays at the 100% state
 * until the class is removed.
 * Z-index removed from keyframes as it's now managed by JS.
 */

 @keyframes zoom-hold {
  0% {
    transform: scale(1) rotateZ(var(--initial-rotation, 0deg));
  }
  75% {
    transform: scale(1.22) rotateZ(2deg);
  }
  100% {
    transform: scale(1.12) rotateZ(0deg);
  }
}


.photo.zooming-in {
  animation: zoom-hold 2.6s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
  z-index: 1000; /* keep above stack during zoom */
  animation-delay: 0s; /* <- add this line */
}


/* Shuffle 1: Arc to the right, then angles back sharply. (Second half sped up) */
@keyframes shuffle-to-back-1 {
    0% { transform: rotate(-8deg); }
    25% { transform: translateX(220px) translateY(-30px) rotate(50deg) scale(1.15) rotateX(15deg); box-shadow: 0 25px 40px rgba(0, 0, 0, 0.35); }
    76% { transform: translateX(120px) translateY(90px) rotate(-20deg) rotateX(55deg) rotateY(-35deg) rotateZ(10deg); box-shadow: 0 8px 15px rgba(0,0,0,0.15);}
    92% { transform: translateX(-60px) translateY(50px) rotate(-15deg) scale(0.9) rotateX(60deg) rotateY(-30deg) rotateZ(0deg);}
    100% { transform: translateX(-60px) translateY(50px) rotate(-15deg) scale(0.9) rotateX(60deg) rotateY(-30deg) rotateZ(0deg);} /* Ensure final state is held */
}

/* Shuffle 2: Left swoop, then angles back with a deep tilt. (Second half sped up) */
@keyframes shuffle-to-back-2 {
    0% { transform: rotate(5deg); }
    25% { transform: translateX(-230px) translateY(-15px) rotate(-55deg) scale(1.15) rotateX(15deg); box-shadow: 0 25px 40px rgba(0, 0, 0, 0.35); }
    76% { transform: translateX(-140px) translateY(80px) rotate(25deg) rotateX(50deg) rotateY(50deg) rotateZ(-10deg); box-shadow: 0 8px 15px rgba(0,0,0,0.15);}
    92% { transform: translateX(50px) translateY(55px) rotate(10deg) scale(0.9) rotateX(55deg) rotateY(45deg) rotateZ(0deg);}
    100% { transform: translateX(50px) translateY(55px) rotate(10deg) scale(0.9) rotateX(55deg) rotateY(45deg) rotateZ(0deg);}
}

/* Shuffle 3: High, dramatic arc over the top, then angles back with a twist. (Second half sped up) */
@keyframes shuffle-to-back-3 {
    0% { transform: rotate(10deg); }
    25% { transform: translateX(80px) translateY(-200px) rotate(65deg) scale(1.2) rotateY(20deg); box-shadow: 0 30px 50px rgba(0, 0, 0, 0.4); }
    76% { transform: translateX(-100px) translateY(-120px) rotate(-30deg) rotateX(-35deg) rotateY(30deg) rotateZ(20deg); box-shadow: 0 8px 15px rgba(0,0,0,0.15);}
    92% { transform: translateX(-30px) translateY(40px) rotate(-10deg) scale(0.9) rotateX(-30deg) rotateY(25deg) rotateZ(0deg);}
    100% { transform: translateX(-30px) translateY(40px) rotate(-10deg) scale(0.9) rotateX(-30deg) rotateY(25deg) rotateZ(0deg);}
}

/* Shuffle 4: Quick diagonal flick and settle, angles back directly. (Second half sped up) */
@keyframes shuffle-to-back-4 {
    0% { transform: rotate(-3deg); }
    25% { transform: translateX(260px) translateY(15px) rotate(35deg) scale(1.1) rotateY(-15deg); box-shadow: 0 20px 30px rgba(0, 0, 0, 0.3); }
    76% { transform: translateX(120px) translateY(-60px) rotate(-10deg) rotateX(-25deg) rotateY(-40deg) rotateZ(-12deg); box-shadow: 0 8px 15px rgba(0,0,0,0.15);}
    92% { transform: translateX(40px) translateY(35px) rotate(5deg) scale(0.9) rotateX(-20deg) rotateY(-35deg) rotateZ(0deg);}
    100% { transform: translateX(40px) translateY(35px) rotate(5deg) scale(0.9) rotateX(-20deg) rotateY(-35deg) rotateZ(0deg);}
}

/* Shuffle 5: Spiral out and behind, with heavy angling. (Second half sped up) */
@keyframes shuffle-to-back-5 {
    0% { transform: rotate(7deg); }
    25% { transform: translateX(-190px) translateY(140px) rotate(80deg) scale(1.18) perspective(500px) rotateX(30deg); box-shadow: 0 28px 45px rgba(0, 0, 0, 0.4); }
    76% { transform: translateX(70px) translateY(170px) rotate(-40deg) perspective(500px) rotateX(60deg) rotateY(55deg) rotateZ(20deg); box-shadow: 0 8px 15px rgba(0,0,0,0.15);}
    92% { transform: translateX(-50px) translateY(20px) rotate(20deg) scale(0.9) perspective(500px) rotateX(50deg) rotateY(50deg) rotateZ(0deg);}
    100% { transform: translateX(-50px) translateY(20px) rotate(20deg) scale(0.9) perspective(500px) rotateX(50deg) rotateY(50deg) rotateZ(0deg);}
}

/* Shuffle 6: Zig-zag out, then angles back with a strong side push. (Second half sped up) */
@keyframes shuffle-to-back-6 {
    0% { transform: rotate(-12deg); }
    15% { transform: translateX(140px) translateY(-80px) rotate(45deg) scale(1.08); }
    45% { transform: translateX(290px) translateY(-30px) rotate(-20deg) scale(1.12); box-shadow: 0 25px 40px rgba(0, 0, 0, 0.35); }
    76% { transform: translateX(170px) translateY(130px) rotate(10deg) rotateX(35deg) rotateY(-30deg) rotateZ(-15deg); box-shadow: 0 8px 15px rgba(0,0,0,0.15);}
    92% { transform: translateX(-20px) translateY(60px) rotate(-10deg) scale(0.9) rotateX(30deg) rotateY(-25deg) rotateZ(0deg);}
    100% { transform: translateX(-20px) translateY(60px) rotate(-10deg) scale(0.9) rotateX(30deg) rotateY(-25deg) rotateZ(0deg);}
}

/* Shuffle 7: Looping path, angles back at the end with a forward tilt. (Second half sped up) */
@keyframes shuffle-to-back-7 {
    0% { transform: rotate(0deg); }
    20% { transform: translateX(-140px) translateY(-140px) rotate(60deg) scale(1.1); }
    50% { transform: translateX(240px) translateY(-100px) rotate(-30deg) scale(1.18); box-shadow: 0 30px 50px rgba(0, 0, 0, 0.4); }
    76% { transform: translateX(-70px) translateY(60px) rotate(15deg) rotateX(55deg) rotateY(35deg) rotateZ(12deg); box-shadow: 0 8px 15px rgba(0,0,0,0.15);}
    92% { transform: translateX(35px) translateY(25px) rotate(5deg) scale(0.9) rotateX(50deg) rotateY(30deg) rotateZ(0deg);}
    100% { transform: translateX(35px) translateY(25px) rotate(5deg) scale(0.9) rotateX(50deg) rotateY(30deg) rotateZ(0deg);}
}

/* Shuffle 8: More vertical, slight bounce, angles back with a deep side roll. (Second half sped up) */
@keyframes shuffle-to-back-8 {
    0% { transform: rotate(3deg); }
    20% { transform: translateX(30px) translateY(-220px) rotate(35deg) scale(1.15) rotateX(15deg); }
    50% { transform: translateX(120px) translateY(-140px) rotate(-20deg) scale(1.08); box-shadow: 0 25px 40px rgba(0, 0, 0, 0.35); }
    76% { transform: translateX(-40px) translateY(60px) rotate(10deg) rotateX(25deg) rotateY(-50deg) rotateZ(-15deg); box-shadow: 0 8px 15px rgba(0,0,0,0.15);}
    92% { transform: translateX(-15px) translateY(45px) rotate(-5deg) scale(0.9) rotateX(20deg) rotateY(-45deg) rotateZ(0deg);}
    100% { transform: translateX(-15px) translateY(45px) rotate(-5deg) scale(0.9) rotateX(20deg) rotateY(-45deg) rotateZ(0deg);}
}

/* Assign animations to classes with slightly varied durations */
.photo.shuffle-1 { animation: shuffle-to-back-1 0.56s cubic-bezier(0.42, 0, 0.58, 1) forwards; } /* 0.9 * 0.625 */
.photo.shuffle-2 { animation: shuffle-to-back-2 0.7s cubic-bezier(0.42, 0, 0.58, 1); } /* 1.0 * 0.625 */
.photo.shuffle-3 { animation: shuffle-to-back-3 0.48s cubic-bezier(0.42, 0, 0.58, 1) ; } /* 1.1 * 0.625 */
.photo.shuffle-4 { animation: shuffle-to-back-4 0.5s cubic-bezier(0.42, 0, 0.58, 1); } /* 0.8 * 0.625 */
.photo.shuffle-5 { animation: shuffle-to-back-5 0.45s cubic-bezier(0.42, 0, 0.58, 1); } /* 1.2 * 0.625 */
.photo.shuffle-6 { animation: shuffle-to-back-6 0.62s cubic-bezier(0.42, 0, 0.58, 1); } /* 1.0 * 0.625 */
.photo.shuffle-7 { animation: shuffle-to-back-7 0.41s cubic-bezier(0.42, 0, 0.58, 1); } /* 1.3 * 0.625 */
.photo.shuffle-8 { animation: shuffle-to-back-8 0.59s cubic-bezier(0.42, 0, 0.58, 1); } /* 0.95 * 0.625 */


/* ============================================================
   Story teaser cards — homepage index.html
   Uses --card-hue set inline per card via style="--card-hue: 260;"
   ============================================================ */
.story-teasers {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  margin: 2rem 0;
}
.story-teaser {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  border-left: 4px solid hsl(var(--card-hue), 84%, 62%);
  padding-left: 1.2rem;
}
.story-teaser-img {
  flex: 0 0 180px;
}
.story-teaser-img img {
  width: 180px;
  height: 130px;
  object-fit: cover;
  display: block;
  border: 2px solid hsl(var(--card-hue), 84%, 62%);
}
.story-teaser-text {
  flex: 1;
}
.story-teaser-label {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: hsl(var(--card-hue), 84%, 62%);
  margin-bottom: 0.3rem;
  font-weight: 600;
}
.story-teaser h3 {
  margin: 0 0 0.5rem 0;
}
.story-teaser h3 a {
  color: inherit;
  text-decoration: none;
}
.story-teaser h3 a:hover {
  color: hsl(var(--card-hue), 84%, 62%);
}
.story-teaser p {
  margin: 0 0 0.75rem 0;
  font-size: 0.95rem;
  line-height: 1.6;
}
.story-teaser-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: hsl(var(--card-hue), 84%, 62%);
  text-decoration: none;
  letter-spacing: 0.04em;
}
.story-teaser-link:hover {
  text-decoration: underline;
}
@media (max-width: 600px) {
  .story-teaser {
    flex-direction: column;
  }
  .story-teaser-img,
  .story-teaser-img img {
    width: 100%;
    height: 180px;
    flex: unset;
  }
}

/* Footer disclaimer — small, dim, centered */
footer {
  text-align: center;
  padding: 1.5rem 1rem;
  margin-top: 2rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.photo-disclaimer {
  font-size: 0.72rem;
  color: #5a5a66;
  letter-spacing: 0.02em;
  margin: 0;
}

/* ── Article page top-section consistency ── */

/* Brighter title */
.article-header h1 {
  color: #e8e8ec;
}

/* Tighten vertical space at top of articles */
.feature-article {
  padding-top: 0.5em;
}
nav-toc.section-tabs {
  margin: 0.4em 0 0.2em;
}
.article-header {
  margin-top: 0.2em;
}

/* Tone down section-jump buttons */
nav-toc.section-tabs button {
  background-color: #1e1f28;
  color: #6a6a76;
  border: 1px solid rgba(255,255,255,0.1);
  padding: 0.3em 0.9em;
  border-radius: 4px;
  font-size: 0.82rem;
  font-family: inherit;
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}
@media (hover: hover) {
  nav-toc.section-tabs button:hover {
    color: #c0c0c8;
    background-color: #2a2b36;
    border-color: rgba(255,255,255,0.2);
  }
}
nav-toc.section-tabs button:active {
  color: #c0c0c8;
  background-color: #2a2b36;
}
