/* styles.css - Version 8 (Exclusion Video Card) */

/* Fonts */
@font-face {
  font-family: 'MARY';
  src: url('fonts/Executive-Regular.woff2') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'MARY';
  src: url('fonts/Executive-Light.woff2') format('opentype');
  font-weight: 300;
  font-style: light;
  font-display: swap;
}

/* Reset & Base */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'MARY', sans-serif;
  background-color: #f1f1f1;
  color: #111;
  line-height: 1.6;
  font-size: 16px;
  overflow-x: hidden;
  position: relative;
}

/* Layout */
.hero {
  position: fixed;
  width: 100%;
  padding: 2rem 12.5vw;
  z-index: 10;
  display: block;
  font-size: 2rem; /* Base Size */
  pointer-events: none;
  mix-blend-mode: exclusion; 
  color: #f1f1f1;
  transition: font-size 0.2s ease; /* Smooth resizing */
}

/* Header Elements */
.image-counter, .close-all {
  z-index: 10;
}

.close-all {
  cursor: pointer;
  pointer-events: auto;
}

.intro-text {
  pointer-events: none;
  orphans: 2;
  widows: 2;
  transition: all 0.3s ease;
  width: 100%;
  margin: 0 auto;
  white-space: normal;
}

.intro-text .filter-row .filter:not(:last-child)::after {
  content: ", ";
}

.intro-text .link-row {
  display: inline;
}

.intro-text a {
  color: #f1f1f1;
  pointer-events: auto;
  text-decoration: none;
}

/* Selective underlining */
.underline-text {
  text-decoration: underline;
}

/* --- GLOW EFFECTS --- */
.filter,
.intro-text .close-all,
.intro-text a {
  cursor: pointer;
  pointer-events: auto;
  transition: color 0.2s ease, text-shadow 0.2s ease; 
}

.filter.active {
  color: var(--neon-color, #111);
  text-shadow: 0 0 5px var(--neon-color, transparent);
}

.filter.touch-active,
.intro-text .close-all.touch-active,
.intro-text a.touch-active {
  color: var(--neon-color, #111) !important;
  text-shadow: 0 0 5px var(--neon-color, transparent);
  transition: none; 
}

@media (hover: hover) {
  .filter:hover,
  .intro-text .close-all:hover,
  .intro-text a:hover {
    color: var(--neon-color, #111);
    text-shadow: 0 0 5px var(--neon-color, transparent);
  }
}

/* Compact mode specifics */
.intro-text[data-state="compact"] .full-static { display: none; }
.intro-text[data-state="compact"] .filter-row .filter:not(:last-child)::after { content: ", "; }
.intro-text[data-state="compact"] .static-always::after { content: ", "; }
.intro-text[data-state="compact"] .filter-row::after { content: ". "; }
.intro-text[data-state="compact"] .image-counter::after { content: " images shown, "; }
.intro-text[data-state="compact"] .close-all::after { content: ", "; }
.intro-text[data-state="compact"] .link-row a:first-child::after { content: ", "; }
.intro-text[data-state="compact"] .link-row::after { content: ". "; }

.intro-text .filter::after,
.intro-text .close-all::after,
.intro-text .link-row a::after,
.intro-text .link-row::after,
.intro-text .filter-row::after,
.intro-text .image-counter::after {
  text-decoration: none;
}

/* Footer */
.footer {
  display: grid;
  gap: 3rem;
  grid-template-columns: repeat(3, 1fr);
  max-width: 1920px;
  margin: 6rem auto 0;
  padding: 6rem 12.5vw 2rem;
  border-top: 1px solid #b3b3b3;
  font-size: .75rem;
  font-weight: 300;
  line-height: 1.6;
}

.footer-column a { color: #111; text-decoration: underline; }

.footer-credit {
  border-top: 1px solid #b3b3b3;
  padding-top: .75rem;
  padding-bottom: 2rem;
  padding-left: 12.5vw;
}

.footer-credit p {
  font-size: 0.7rem;
  color: #b3b3b3;
  font-weight: 300;
  margin: 0;
}

ul.dash-list { list-style: none; padding: 0; }
ul.dash-list li { position: relative; padding-left: 8px; }
ul.dash-list li::before {
  content: "\2011";
  position: absolute;
  left: 0px;
  color: #111;
}

/* Grid */
.project-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 8px;
  padding: 0 8px;
  position: relative;
  z-index: 1;
}

.spacer { height: 40vh; pointer-events: none; }

/* Image Wrappers */
.project-grid .image-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease, height 0.25s ease-out, width 0.25s ease-out, flex 0.25s ease-out;
  position: relative;
  will-change: transform;
}

.project-grid .image-wrapper.expanded {
  z-index: 2;
}

.project-grid .image-container {
  width: 100%;
  height: auto;
  transition: box-shadow 0.35s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s ease;
  box-shadow: 0 0 0 0px transparent;
}

.project-grid .image-wrapper.expanded:not(.loading) .image-container {
  box-shadow: 0 0 16px 12px var(--neon-border-color, transparent);
}

.project-grid .image-wrapper.loading .image-container {
  animation: pulsingGlow 0.75s ease-in-out infinite;
}

@keyframes pulsingGlow {
  0%, 100% {
    box-shadow: 0 0 2px 2px var(--neon-border-color, transparent);
    opacity: 0.75;
  }
  50% {
    box-shadow: 0 0 16px 8px var(--neon-border-color, transparent);
    opacity: 1;
  }
}

.project-grid img {
  display: block;
  object-fit: contain;
  width: 100%;
  height: auto;
  transition: height 0.3s ease;
}

.project-grid .thumbnail-img {
  cursor: pointer;
  touch-action: manipulation;
}

/* Animations */
@keyframes slideFadeIn {
  from { opacity: 0; transform: translateX(-50px); }
  to   { opacity: 1; transform: translateX(0); }
}
.project-grid .image-wrapper.animate-in { animation: slideFadeIn 0.25s ease-out forwards; }

@keyframes slideFadeOut {
  from {
    opacity: 1;
    transform: translateX(0);
    height: var(--start-height);
    width: var(--start-width);
    flex: 0 0 var(--start-width);
  }
  to   {
    opacity: 0;
    transform: translateX(50px);
    height: 0px;
    width: 0px;
    flex: 0 0 0px;
  }
}
.project-grid .image-wrapper.animate-out { animation: slideFadeOut 0.3s ease-out forwards; }


/* --- VIDEO PLACEHOLDER STYLES --- */

/* 1. Target the Wrapper */
.project-grid .image-wrapper.video-wrapper {
  cursor: pointer;
  z-index: 1;
  position: relative; /* Essential for absolute child */
  display: block; 
}

/* 2. Hover State for Wrapper */
.project-grid .image-wrapper.video-wrapper:hover {
  z-index: 100;
  /* Force hardware acceleration */
  transform: translateZ(0); 
  -webkit-transform: translateZ(0);
}

/* 3. The Inner Card */
.video-card, a.video-card {
  /* Absolute Positioning forces full size in Safari */
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  
  /* Box Model */
  box-sizing: border-box;
  background-color: #ffffff;
  border: 1px solid #111;
  
  /* Centering the TEXT inside */
  display: flex;
  align-items: center;
  justify-content: center;
  
  /* Transitions */
  transition: background-color 0.3s ease, box-shadow 0.3s ease, color 0.3s ease, border-color 0.3s ease, font-size 0.2s ease;
  
  /* Typography */
  font-family: 'MARY', sans-serif;
  font-size: 2rem; /* Base Size */
  
  /* COLORS & CONTRAST FIX */
  color: #000000 !important; /* Black text on White card = High Contrast */
  mix-blend-mode: normal;    /* Removed 'exclusion' to prevent white-on-white text issues */
  text-decoration: none !important;
  text-align: center;
  line-height: 1;
  
  /* Reset Safari Link behavior */
  -webkit-appearance: none;
  appearance: none;
}

/* 4. Hover State: Neon Glow */
.project-grid .image-wrapper.video-wrapper:hover .video-card,
.project-grid .image-wrapper.video-wrapper:hover a.video-card {
  background-color: var(--neon-border-color);
  box-shadow: 0 0 16px 8px var(--neon-border-color);
  border-color: var(--neon-border-color); 
  
  /* CONTRAST FIX: 
     Since the Neon colors (Lightness 65%) are bright, 
     Black text ensures the best readability/contrast. */
  color: #000000 !important;
  -webkit-text-fill-color: #000000;
}

/* --- RESPONSIVE TYPOGRAPHY (Hero & Video Card) --- */

@media (max-width: 1240px) {
  .hero { padding: 1.5rem 8rem; }
  .intro-text { font-size: 1.5rem; }
  .footer-credit {padding-left: 4rem; }
  .footer { padding: 6rem 4rem 2rem;}
}

@media (max-width: 767px) {
  .hero { 
    padding: 1.5rem 2rem; 
    gap: 2rem; 
    font-size: 1.5rem; /* Reduced for Mobile */
  }
  /* Match Video Card to Hero on Mobile */
  .video-card, a.video-card {
    font-size: 1.5rem;
  }
  
  .intro-text {font-size: 1.5rem; }
  .footer-credit {padding-left: 2rem; }
  .footer { grid-template-columns: 1fr; padding: 6rem 2rem 2rem; gap: 2rem; }
}

@media (max-width: 479px) {
  .hero {
    padding: 1.5rem 2rem; 
    font-size: 1.25rem; /* Further Reduced for small screens */
  }
  .video-card, a.video-card {
    font-size: 1.25rem;
  }

  .intro-text {font-size: 1rem;}
  .footer-credit {padding-left: 2rem; }
  .footer { padding-left: 2rem; padding-right: 2rem; }
}

@media only screen and (hover: none) and (pointer: coarse) {
  .hero { padding: 1.5rem 1rem; }
  .intro-text {font-size: 1.15rem; }
  .footer { padding: 1.5rem 1rem 2rem; gap: 2rem; }
  .footer-credit {padding-left: 1rem; }
  .project-grid .image-wrapper.expanded:not(.loading) .image-container {
    box-shadow: 0 0 12px 8px var(--neon-border-color, transparent);
  }
  .project-grid {padding: 0 1rem;  gap: 4px;}
}