/*
Theme Name: Velina Design Studio
Theme URI: https://velinadesign.com
Author: realmofevil
Description: High-performance, bespoke cinematic theme. Zero bloat, WCAG 2.1 AA compliant. Cinematic Studio Aura Enterprise Edition.
Version: 1.0.0
Text Domain: aura
*/

/* https://gwfh.mranftl.com/fonts/cormorant-garamond?subsets=cyrillic,latin */
@font-face {
  font-display: swap;
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 400;
  src: url('./fonts/cormorant-garamond-v21-cyrillic_latin-regular.woff2') format('woff2');
}
/* https://gwfh.mranftl.com/fonts/manrope?subsets=cyrillic,latin */
@font-face {
  font-display: swap;
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 500;
  src: url('./fonts/manrope-v20-cyrillic_latin-500.woff2') format('woff2');
}

:root {
  --color-bg-base: #060607;
  --color-text-main: #F5F5F3;
  --color-text-muted: #A0A0A2;
  --color-accent: #C5A059;
  --font-serif: 'Cormorant Garamond', serif;
  --font-sans: 'Manrope', sans-serif;
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }

body {
  background-color: var(--color-bg-base);
  color: var(--color-text-main);
  font-family: var(--font-sans);
  font-feature-settings: "locl" 1; 
  margin: 0;
  -webkit-font-smoothing: antialiased;
  cursor: none; /* Custom cursor */
  overflow: hidden; /* Home page lock */
}

/* Page Transitions */
body.page-transitioning { opacity: 0; transition: opacity 0.6s ease; }

/* Custom Cursor */
.custom-cursor {
  position: fixed; top: 0; left: 0; width: 12px; height: 12px;
  background-color: var(--color-text-main); border-radius: 50%;
  pointer-events: none; z-index: 9999; mix-blend-mode: difference;
  transform: translate(-50%, -50%); transition: width 0.2s ease, height 0.2s ease;
}
.custom-cursor.hovering { width: 48px; height: 48px; background-color: transparent; border: 1px solid var(--color-text-main); }

/* Ambient Background */
.ambient-bg {
  position: fixed; inset: -10%; width: 120vw; height: 120vh;
  background-size: cover; background-position: center;
  filter: blur(60px) brightness(0.25) saturate(1.2);
  transform: scale(1.1); transition: background-image 1s ease-in-out, filter 1s ease;
  z-index: 0; pointer-events: none;
}
.noise-overlay {
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  opacity: 0.04; z-index: 1; pointer-events: none;
}

/* App Layout */
.portfolio-experience {
  position: relative; z-index: 10; display: flex; flex-direction: column;
  height: 100dvh; width: 100vw; padding: 24px;
}
.site-header { display: flex; justify-content: space-between; align-items: center; padding-bottom: 24px; flex-shrink: 0; }
.brand { font-family: var(--font-serif); font-size: clamp(1.25rem, 2vw, 1.5rem); text-transform: uppercase; letter-spacing: 0.25em; }

/* Accordion Native Flex Grid */
.horizontal-accordion {
  display: flex; flex-direction: row; flex: 1; gap: 8px; width: 100%;
  overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none;
}
.horizontal-accordion::-webkit-scrollbar { display: none; }

.accordion-card {
  position: relative; flex: 1; min-width: 80px; height: 100%; border-radius: 8px;
  overflow: hidden; transition: flex 0.9s var(--ease-spring), min-width 0.9s var(--ease-spring);
  scroll-snap-align: start; cursor: none;
}
.accordion-card.active { flex: 8; min-width: 75vw; }
/* .accordion-card:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; } */
.accordion-card:focus-visible {
  outline: 2px solid var(--color-text-main);
  outline-offset: -2px;
  box-shadow: 0 0 24px rgba(255, 255, 255, 0.35);
}

/* Card Internals */
.card-image-wrapper { position: absolute; inset: 0; width: 100%; height: 100%; overflow: hidden; }
.card-image {
  width: 100%; height: 100%; background-size: cover; background-position: center;
  transform: scale(1.15); filter: grayscale(60%) brightness(0.6);
  transition: transform 1.2s var(--ease-spring), filter 0.9s ease;
}
.accordion-card.active .card-image { transform: scale(1); filter: grayscale(0%) brightness(1); }
.accordion-card:not(.active):hover .card-image { filter: grayscale(30%) brightness(0.8); transform: scale(1.08); }

.card-overlay {
  position: absolute; inset: 0; background: linear-gradient(to top, rgba(6,6,7,0.95) 0%, rgba(6,6,7,0.4) 30%, transparent 100%);
  opacity: 0.6; transition: opacity 0.9s ease;
}
.accordion-card.active .card-overlay { opacity: 1; }

.card-title-vertical {
  position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%) rotate(-180deg);
  writing-mode: vertical-rl; font-family: var(--font-serif); font-size: 1.25rem;
  letter-spacing: 0.1em; color: var(--color-text-muted); white-space: nowrap; transition: opacity 0.4s ease;
}
.accordion-card.active .card-title-vertical { opacity: 0; }

.card-content {
  position: absolute; bottom: 0; left: 0; width: 100%; padding: 32px;
  display: flex; flex-direction: column; gap: 8px; opacity: 0;
  transform: translateY(24px) scale(0.98); transition: opacity 0.4s ease, transform 0.9s var(--ease-spring); pointer-events: none;
}
.accordion-card.active .card-content { opacity: 1; transform: translateY(0) scale(1); transition-delay: 0.2s; pointer-events: auto; }

.project-category { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.3em; color: var(--color-accent); }
.project-title { font-family: var(--font-serif); font-size: clamp(2rem, 5vw, 4rem); font-weight: 300; margin-top: 16px; margin-bottom: 8px; line-height: 1.1; }
.meta-tag { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.15em; color: var(--color-text-muted); border: 1px solid rgba(160,160,162,0.3); padding: 6px 12px; border-radius: 2px; backdrop-filter: blur(4px); }
.stretched-link { position: absolute; inset: 0; z-index: 20; }



/* ==========================================================================
   1. Mobile UX Fixes (Tap Highlight & Stray Cursor)
   ========================================================================== */
/* Remove the gray tap highlight flash on mobile Safari/Chrome */
*, *::before, *::after {
  -webkit-tap-highlight-color: #ffffff30;
}

/* Hide the custom cursor by default (fixes the top-left dot on mobile) */
.custom-cursor {
  display: none;
}

/* Only render the custom cursor on devices with a physical mouse */
@media (pointer: fine) {
  .custom-cursor {
    display: block;
    position: fixed;
    top: 0; left: 0;
    width: 12px; height: 12px;
    background-color: var(--color-text-main);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: difference;
    transform: translate(-50%, -50%);
    transition: width 0.2s ease, height 0.2s ease;
  }
}

/* ==========================================================================
   2. 60fps Hardware Acceleration (Stuttering Fix)
   ========================================================================== */
.horizontal-accordion .accordion-card {
  /* Animate flex-grow instead of the 'flex' shorthand for smoother math */
  transition: flex-grow 0.9s var(--ease-spring), min-width 0.9s var(--ease-spring);
  
  /* Force the browser to hand this element to the GPU */
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  backface-visibility: hidden;
  perspective: 1000px;
  
  /* Tell the browser exactly what will change ahead of time */
  will-change: flex-grow, min-width;
}

.card-image {
  /* Hardware accelerate the image scaling/filtering */
  transform: scale(1.15) translateZ(0);
  will-change: transform, filter;
}

.accordion-card.active .card-image {
  transform: scale(1) translateZ(0);
}



/* ==========================================================================
   Single Portfolio Page Layout
   ========================================================================== */
body.single-portfolio-view {
  background-color: var(--color-bg-base);
  overflow-y: auto; /* Re-enable vertical scrolling for Gutenberg content */
  padding-bottom: 120px; /* Make room for the fixed filmstrip */
}

.single-site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
  background: linear-gradient(to bottom, rgba(6,6,7,0.95) 0%, transparent 100%);
  pointer-events: none; /* Let clicks pass through empty space */
}

.single-site-header a, 
.single-site-header .brand {
  pointer-events: auto;
}

.back-link {
  font-family: var(--font-sans);
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color 0.3s ease;
}

.back-link:hover {
  color: var(--color-text-main);
}

/* Project Hero */
.single-portfolio-content {
  /* max-width: 1200px; */
  margin: 0 auto;
  padding: 120px 24px 64px 24px;
}

.project-hero {
  text-align: center;
  /* margin-bottom: 64px; */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

/* Gutenberg Content Optimization */
.entry-content {
  font-family: var(--font-sans);
  color: var(--color-text-muted);
  font-size: 1.125rem;
  line-height: 1.6;
}

.entry-content p {
  max-width: 760px;
  margin: 0 auto 32px auto;
}

/* Align-Wide & Full Support for Images */
.entry-content .alignwide {
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

.entry-content img {
  border-radius: 4px;
  height: auto;
  width: 100%;
}

/* ==========================================================================
   WP Core Native Lightbox Overrides
   ========================================================================== */
.wp-lightbox-overlay {
  background: rgba(6, 6, 7, 0.95) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.wp-lightbox-overlay .close-button {
  color: var(--color-text-main) !important;
  transition: transform 0.3s ease;
}

.wp-lightbox-overlay .close-button:hover {
  transform: scale(1.1) rotate(90deg);
}

/* Grab cursor for drag-to-scroll track */
.filmstrip-track {
  cursor: grab;
}
.filmstrip-track:active {
  cursor: grabbing;
}

/* ==========================================================================
   Sticky Bottom Filmstrip
   ========================================================================== */
.fixed-filmstrip {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100px;
  background: linear-gradient(to top, rgba(6,6,7,0.95) 20%, rgba(6,6,7,0.4) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255,255,255,0.05);
  z-index: 100;
  display: flex;
  align-items: center;
  padding: 0 24px;
}

.filmstrip-track {
  display: flex;
  gap: 16px;
  width: 100%;
  overflow-x: auto;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
  scroll-behavior: smooth;
}

.filmstrip-track::-webkit-scrollbar {
  display: none;
}

.filmstrip-item {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  padding: 8px 16px 8px 8px;
  border-radius: 4px;
  text-decoration: none;
  opacity: 0.5;
  transition: opacity 0.3s ease, background-color 0.3s ease;
}

.filmstrip-item:hover {
  opacity: 0.8;
  background-color: rgba(255,255,255,0.03);
}

.filmstrip-item.active {
  opacity: 1;
  background-color: rgba(255,255,255,0.08);
  pointer-events: none; /* Already on this page */
}

.filmstrip-thumb {
  width: 72px;
  height: 48px;
  background-size: cover;
  background-position: center;
  border-radius: 2px;
}

.filmstrip-label {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--color-text-main);
  white-space: nowrap;
}

/* Mobile Tweaks */
@media (max-width: 768px) {
  .single-site-header, .portfolio-experience { padding: 16px; }
  .single-portfolio-content { padding-top: 100px; }
  .project-hero .project-title { font-size: 2.5rem; }
  .fixed-filmstrip { padding: 0 16px; }
}