/* ===================================
   COMPONENTS - Logo, Items, Buttons, Viewers (Optimized)
   FixedT VERSION 4.2
   =================================== */

/* Logo */
.logo-container {
  margin-bottom: 0;
  display: block;
  width: 3rem;
  height: 1.5rem;
  position: relative;
  cursor: pointer;
  mix-blend-mode: difference;
  isolation: isolate;
  outline: none;
  border: none;
}

.logo-circles {
  position: relative;
  width: 100%;
  height: 100%;
  outline: none;
  border: none;
}

.circle {
  position: absolute;
  transition: transform var(--transition-medium);
  width: 0;
  height: 0;
  top: 50%;
  border-style: solid;
  outline: none;
}

.circle-1 {
  left: 0;
  transform: translate(0, -50%);
  border-width: 0 0.7rem 1.2rem 0.7rem;
  border-color: transparent transparent #ffffff transparent;
}

.circle-2 {
  left: 0.8rem;
  transform: translate(0, -50%) rotate(180deg);
  border-width: 0 0.7rem 1.2rem 0.7rem;
  border-color: transparent transparent #ffffff transparent;
}

.logo-container:hover .circle-1 {
  transform: translate(-0.5rem, -50%);
}

.logo-container:hover .circle-2 {
  transform: translate(0.5rem, -50%) rotate(180deg);
}

/* Canvas Items - OPTIMIZED with CSS Containment */
.item {
  position: absolute;
  overflow: hidden;
  background-color: var(--color-bg);
  cursor: pointer;
  border-radius: var(--border-radius, 0px);
  contain: layout style paint;
}

.item-image-container {
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: relative;
}

/* OPTIMIZED: Reduced vignette blur */
.item-image-container::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  box-shadow: inset 0 0 var(--vignette-size, 0px) rgba(0, 0, 0, 0.5);
  z-index: 1;
}

.item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  transition: transform 0.3s ease;
  transform: translate3d(0, 0, 0);
}

.item:hover img {
  transform: scale(var(--hover-scale, 1.05)) translate3d(0, 0, 0);
}

/* Item Captions */
.item-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 10px;
  z-index: 2;
}

.item-name {
  font-family: var(--font-primary);
  color: var(--color-text);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: -0.03em;
  margin-bottom: 2px;
  position: relative;
  overflow: hidden;
  height: 16px;
}

.item-number {
  font-family: var(--font-mono);
  color: var(--color-dim);
  font-size: 10px;
  font-weight: 400;
  position: relative;
  overflow: hidden;
  height: 14px;
}

/* Preloader - OPTIMIZED */
.preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--color-bg);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preloader-content {
  text-align: center;
  width: 100%;
  max-width: 890px;
  padding: 0 20px;
}

.preloader-text {
  font-family: var(--font-primary);
  font-size: 48px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--color-text);
  margin-bottom: 30px;
  text-transform: uppercase;
}

.preloader-progress {
  width: 100%;
  height: 1px;
  background-color: rgba(255, 255, 255, 0.2);
  overflow: hidden;
  position: relative;
}

.preloader-progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  width: 0%;
  height: 100%;
  background-color: var(--color-text);
}

/* Image Viewer - OPTIMIZED with CSS Containment */
.image-viewer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10001;
  opacity: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5vh 5vw;
  gap: 2rem;
  contain: layout style;
}

.image-viewer.active {
  opacity: 1;
  pointer-events: auto;
}

.viewer-project-title {
  position: absolute;
  top: 35%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10003;
  font-family: var(--font-primary);
  font-size: clamp(21px, 4vw, 42px);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  color: #ffffff;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  max-width: 30%;
  line-height: 1.2;
}

.image-viewer-content {
  max-width: 80%;
  max-height: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.viewer-image {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  pointer-events: auto;
  transform: translate3d(0, 0, 0);
}

/* View Project Button */
.view-project-btn {
  position: absolute;
  bottom: 4.5rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 32px;
  background-color: var(--color-text);
  color: var(--color-bg);
  border: none;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-primary);
  text-decoration: none;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  z-index: 10003;
}

.view-project-btn:hover {
  background-color: var(--color-bg);
  color: var(--color-text);
  outline: 2px solid var(--color-text);
}

.view-project-btn:hover::after {
  width: 0;
}

/* Overlay */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--color-bg);
  pointer-events: none;
  opacity: 0;
  z-index: 9999;
}

.overlay.active {
  pointer-events: auto;
}

/* Page Vignette - OPTIMIZED */
.page-vignette-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9998;
}

/* OPTIMIZED: Reduced blur amounts */
.page-vignette {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  box-shadow: inset 0 0 150px rgba(0, 0, 0, 0.6);
}

.page-vignette-strong {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.4);
}

.page-vignette-extreme {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.3);
}

/* Index Page Vignette Effect */
body:not(.project-page) .page-vignette-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  box-shadow: inset 0 0 150px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  z-index: 1;
}

/* Hero Title Overlay */
.hero-title-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  text-align: center;
  width: 100%;
  padding: 0 2rem;
}

.hero-title-overlay h1 {
  font-size: clamp(36px, 6vw, 80px);
  font-weight: 600;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  color: #ffffff;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  margin: 0;
  line-height: 1;

}

/* Scroll Indicator */
.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  opacity: 1;
  animation: float 2s ease-in-out infinite;
}

.scroll-indicator p {
  font-family: var(--font-mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-weight: 500;
  color: #ffffff;
  text-shadow: 0 2px 15px rgba(0, 0, 0, 0.8);
}

.scroll-arrow {
  width: 2px;
  height: 40px;
  background: linear-gradient(to bottom, transparent, #ffffff);
  position: relative;
}

.scroll-arrow::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 8px;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  transform: translateX(-50%) rotate(45deg);
}

@keyframes float {
  0%, 100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(-10px);
  }
}

/* View Transition */
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

::view-transition-old(root) {
  z-index: 1;
}

::view-transition-new(root) {
  z-index: 9999;
  animation: reveal 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes reveal {
  from {
    clip-path: circle(0% at var(--x, 50%) var(--y, 50%));
  }
  to {
    clip-path: circle(150% at var(--x, 50%) var(--y, 50%));
  }
}

/* Dropdown Sections */
.header-dropdown {
  position: relative;
}

.dropdown-toggle {
  cursor: pointer;
  user-select: none;
  transition: opacity 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  position: relative;
}

.dropdown-toggle:hover {
  opacity: 0.7;
}

.dropdown-toggle::before {
  content: '+';
  font-size: 14px;
  font-weight: 600;
  margin-right: 0.015rem;
  transition: opacity 0.2s ease;
}

.header-dropdown.active .dropdown-toggle::before {
  content: '-';
}

.dropdown-toggle {
  text-indent: 0;
}

.dropdown-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  margin-top: 0.5rem;
}

.header-dropdown.active .dropdown-content {
  max-height: 500px;
}

.dropdown-content ul {
  padding-left: 0;
  list-style: none;
  margin: 0;
}

.dropdown-content li {
  margin-bottom: 0.5rem;
  opacity: 0.8;
}

.dropdown-content p {
  margin: 0 0 0.5rem 0;
  opacity: 0.8;
}

.social-section .dropdown-content {
  text-align: left;
}

.social-section .dropdown-content ul {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding-left: 0;
  margin: 0;
}

.social-section .dropdown-content li {
  width: 100%;
  text-align: left;
}

/* ================================
   MOBILE RESPONSIVE - CRITICAL
   ================================ */
@media (max-width: 768px) {
  .header-dropdown,
  .dropdown-toggle,
  .dropdown-content,
  .values-section,
  .location-section,
  .contact-section,
  .social-section {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
  }
  
  .scroll-indicator p {
    font-size: 11px;
  }
  
  .scroll-arrow {
    height: 30px;
  }
  
  .logo-container {
    margin-bottom: 0;
    width: 2.5rem;
    height: 1.25rem;
  }
  
  .circle-1,
  .circle-2 {
    border-width: 0 0.6rem 1rem 0.6rem;
  }
  
  .circle-2 {
    left: 0.7rem;
  }
  
  .viewer-project-title {
    font-size: clamp(18px, 5vw, 32px);
  }
  
  .view-project-btn {
    bottom: -1.25rem;
    padding: 10px 24px;
    font-size: 13px;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .view-project-btn {
    bottom: 3.75rem;
  }
}