*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --font-display: "bebas-neue-pro", sans-serif;
  --font-body: 'Inter', sans-serif;
  --gutter: clamp(1rem, 1.35vw, 1.45rem);
  --chamfer-size: clamp(20px, 2vw, 28px);
  --sidebar-width: clamp(260px, 22vw, 320px); 
}

body, html {
  background-color: #f7f7f7; font-family: var(--font-body); color: #111111;
  min-height: 100vh; display: flex; flex-direction: column;
  -webkit-font-smoothing: antialiased; overflow-x: clip; 
  cursor: none !important; scroll-behavior: smooth;
}
body { padding-right: var(--sidebar-width); }

* { cursor: none !important; }
input, textarea { cursor: text !important; }

/* --- SEPARATED CURSOR: Tracking dot --- */
#custom-cursor {
  position: fixed; top: 0; left: 0;
  width: 8px; height: 8px; 
  background-color: #111111;
  pointer-events: none; 
  z-index: 99999; 
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
  transform: translate(calc(var(--x, 0px) - 50%), calc(var(--y, 0px) - 50%));
  transition: width 0.2s cubic-bezier(0.2, 1, 0.2, 1), height 0.2s cubic-bezier(0.2, 1, 0.2, 1), clip-path 0.2s cubic-bezier(0.2, 1, 0.2, 1), opacity 0.2s;
  will-change: transform, width, height;
}
#custom-cursor.hover-active {
  width: 20px; height: 20px; 
  clip-path: polygon(5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%, 0 5px);
}

/* --- SEPARATED CURSOR: Image preview container --- */
#cursor-image {
  position: fixed; top: 0; left: 0;
  width: 0px; height: 0px; 
  background-size: cover; background-position: center;
  background-image: var(--cursor-bg, none);
  pointer-events: none; 
  z-index: 99998; 
  clip-path: polygon(15px 0, 100% 0, 100% calc(100% - 15px), calc(100% - 15px) 100%, 0 100%, 0 15px);
  transform: translate(calc(var(--x, 0px) + 4px), calc(var(--y, 0px) - 4px - 100%));
  transition: width 0.3s cubic-bezier(0.2, 1, 0.2, 1), height 0.3s cubic-bezier(0.2, 1, 0.2, 1), opacity 0.2s;
  will-change: transform, width, height;
}
#cursor-image.hover-image-active {
  width: 180px; height: 180px; 
}

/* CINEMATIC PAGE TRANSITION OVERLAY */
#page-transition-overlay {
  position: fixed; inset: 0; background-color: #f7f7f7;
  z-index: 10001; pointer-events: none; 
  opacity: 1; transition: opacity 0.8s cubic-bezier(0.65, 0, 0.35, 1);
}
#page-transition-overlay.loaded { opacity: 0; }

/* Auth Gate */
.gate-wrapper { position: fixed; inset: 0; background: #f7f7f7; display: flex; justify-content: center; align-items: center; z-index: 999; padding: 1.5rem; }
.gate-wrapper.hidden { display: none; }
.gate-card { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 1.25rem; }
.gate-card h2 { font-family: var(--font-body); font-size: 0.85rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #666666; }
.gate-card input { width: 100%; padding: 0.85rem 1rem; border: 1px solid #dcdcdc; background: #ffffff; font-family: var(--font-body); font-size: 0.9rem; outline: none; }
.gate-card input:focus { border-color: #111111; }
.gate-card button { width: 100%; padding: 0.85rem; background: #111111; color: #ffffff; border: none; font-family: var(--font-body); font-weight: 700; font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; cursor: none; }
.error-msg { font-size: 0.75rem; color: #c5221f; display: none; }

/* CLIENT PERSONALIZATION POPUP */
.popup-wrapper {
  position: fixed; inset: 0; 
  background: rgba(247, 247, 247, 0.45); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: flex; justify-content: center; align-items: center; 
  z-index: 10002; opacity: 1; transition: opacity 0.5s ease;
}
.popup-wrapper.hidden { opacity: 0; pointer-events: none; }
.popup-card {
  background: #111111; color: #ffffff; padding: 3.5rem 3rem; width: 90%; max-width: 480px;
  position: relative; display: flex; flex-direction: column; 
  align-items: flex-start; text-align: left; 
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}
.popup-close-x {
  position: absolute; top: 1.2rem; right: 1.2rem; background: transparent; border: none; color: #777777;
  font-size: 1.5rem; font-weight: 300; line-height: 1; transition: color 0.2s ease, transform 0.2s ease;
}
.popup-close-x:hover { color: #ffffff; transform: scale(1.1); }
.popup-title { font-family: var(--font-display); font-weight: 500; font-size: 2.5rem; letter-spacing: 0.02em; margin-bottom: 1rem; color: #ffffff; }
.popup-message { font-family: var(--font-body); font-weight: 400; font-size: 0.85rem; line-height: 1.6; color: #b0b0b0; margin-bottom: 2.5rem; }
.popup-explore-btn {
  background: transparent; border: none; color: #ffffff; font-family: var(--font-body); font-weight: 700; font-size: 0.75rem; 
  letter-spacing: 0.08em; text-transform: uppercase; border-bottom: 1px dotted rgba(255,255,255,0.4);
  padding-bottom: 4px; transition: border-color 0.2s ease, color 0.2s ease;
}
.popup-explore-btn:hover { border-bottom-color: #ffffff; }

/* STICKY TOP NAV */
.site-header {
  position: sticky; top: 0; width: 100%; background: rgba(247, 247, 247, 0.96);
  backdrop-filter: blur(8px); z-index: 500; border-bottom: 2px solid #e0e0e0; 
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.site-header.nav-hidden { transform: translateY(-100%); }
.site-nav-container { 
  width: 100%; max-width: 1500px; margin: 0 auto; 
  padding: 1.25rem clamp(2rem, 4vw, 4rem); 
}

.top-nav { display: flex; gap: 2rem; align-items: baseline; flex-wrap: wrap; }
.nav-item-group { display: flex; align-items: baseline; position: relative; }
.nav-item-group > a { font-family: var(--font-display); font-size: 1.45rem; font-weight: 500; letter-spacing: 0.04em; text-decoration: none; color: #777777; transition: color 0.15s ease; }
.nav-item-group > a:hover, .nav-item-group > a.active { color: #111111; }

#content-feed { width: 100%; max-width: 1500px; margin: 0 auto; display: flex; flex-direction: column; padding: clamp(2rem, 4vw, 4rem) clamp(2rem, 4vw, 4rem) clamp(5rem, 8vw, 8rem); }

.block-kicker { font-family: var(--font-display); font-weight: 100; font-size: clamp(19pt, 1.85vw, 23pt); line-height: 1.2; letter-spacing: 0.02em; color: #111111; margin-bottom: 0.5rem; }
.block-headline { font-family: var(--font-display); font-weight: 500; font-size: clamp(28pt, 3.1vw, 36pt); line-height: 0.98; letter-spacing: -0.035em; color: #111111; max-width: 820px; }
.block-domain { font-family: var(--font-display); font-weight: 100; font-size: clamp(38pt, 3.7vw, 46pt); line-height: 1.1; letter-spacing: 0.02em; color: #111111; margin-bottom: 0.5rem; }
.block-domain-standstill { font-family: var(--font-display); font-weight: 500; font-size: clamp(56pt, 6.2vw, 72pt); line-height: 0.95; letter-spacing: -0.04em; color: #111111; max-width: 100%; }

.content-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gutter); align-items: stretch; }
.span-1 { grid-column: span 1; display: flex; flex-direction: column; min-height: 0; }
.span-2 { grid-column: span 2; display: flex; flex-direction: column; min-height: 0; }
.span-3 { grid-column: span 3; display: flex; flex-direction: column; min-height: 0; }
.multi-col-2 { columns: 2; column-gap: var(--gutter); width: 100%; column-fill: balance; }

.col-text p { font-family: var(--font-body); font-weight: 400; font-size: clamp(0.7rem, 0.76vw, 0.8rem); line-height: 1.48; color: #111111; text-align: justify; text-align-last: left; margin-bottom: 1.15rem; break-inside: avoid; }
.col-text p:last-child { margin-bottom: 0; }
.is-lead p:first-of-type { text-indent: 1.75rem; }
.project-trigger { font-weight: 700; border-bottom: 1px dotted transparent; transition: border-color 0.2s; }
.project-trigger:hover, .project-trigger.active { border-bottom-color: #111111; }

.visual-box { background-color: #e2e2e2; position: relative; overflow: hidden; width: 100%; }
.flex-stretch { flex: 1 1 0; min-height: 0; height: 100%; } 
.aspect-landscape { aspect-ratio: 1.86 / 1; flex: 0 0 auto; }
.aspect-panorama { aspect-ratio: 2.8 / 1; flex: 0 0 auto; }
.aspect-portrait { aspect-ratio: 1 / 1.16; flex: 0 0 auto; }
.aspect-square { aspect-ratio: 1 / 1; flex: 0 0 auto; }
.aspect-video { aspect-ratio: 16 / 9; flex: 0 0 auto; }

.chamfer-tl-br { clip-path: polygon(var(--chamfer-size) 0%, 100% 0%, 100% calc(100% - var(--chamfer-size)), calc(100% - var(--chamfer-size)) 100%, 0% 100%, 0% var(--chamfer-size)); }

.media-embed { width: 100%; height: 100%; object-fit: cover; border: none; }
.media-embed iframe { width: 100%; height: 100%; border: none; pointer-events: auto; }

.carousel-track { position: absolute; inset: 0; display: flex; width: 100%; height: 100%; } 
.carousel-slide { flex: 0 0 100%; width: 100%; height: 100%; overflow: hidden; position: relative; }

.carousel-slide img, .media-embed { width: 100%; height: 100%; object-fit: cover; transition: transform 2s cubic-bezier(0.16, 1, 0.3, 1); transform: scale(1); }
.visual-box.in-view .carousel-slide img, .visual-box.in-view .media-embed { transform: scale(1.05); }

.carousel-tag { position: absolute; bottom: 0.85rem; left: 0.85rem; font-family: var(--font-display); font-size: 1.25rem; font-weight: 500; color: #ffffff; mix-blend-mode: difference; background: transparent; padding: 0; pointer-events: none; z-index: 5; }

.carousel-click-zone { position: absolute; top: 0; bottom: 0; width: 50%; z-index: 10; }
.carousel-click-zone.left { left: 0; }
.carousel-click-zone.right { right: 0; }

.carousel-dots { position: absolute; bottom: 1rem; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; z-index: 12; }
.carousel-dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,0.4); transition: background 0.3s, transform 0.3s; }
.carousel-dot:hover { background: rgba(255,255,255,0.8); }
.carousel-dot.active { background: rgba(255,255,255,1); transform: scale(1.3); }

/* --- SIDEBAR & DROPDOWN FILTER ENGINE --- */
#global-sidebar { 
  position: fixed; top: 0; right: 0; width: var(--sidebar-width); height: 100vh; 
  border-left: 2px solid #e0e0e0; background: #ffffff; z-index: 100; overflow-y: auto; overflow-x: hidden; 
  padding-top: 0; 
  display: flex; flex-direction: column;
}
#global-sidebar::-webkit-scrollbar { width: 0; }
.sidebar-close { display: none; }

.sidebar-filter-header {
  padding: 1.45rem 1.2rem; 
  border-bottom: 2px solid #e0e0e0; 
  margin-bottom: 1rem;
  background: #ffffff;
  position: sticky; top: 0; z-index: 10;
}
.filter-toggle {
  font-family: var(--font-body); font-size: 0.85rem; font-weight: 700; color: #111111; 
  text-transform: uppercase; letter-spacing: 0.05em; display: flex; justify-content: space-between; align-items: center;
}
.filter-arrow {
  display: inline-block; transition: transform 0.3s ease; font-weight: 400; font-size: 1rem;
}
.sidebar-filter-header.open .filter-arrow {
  transform: rotate(180deg);
}

.filter-dropdown {
  max-height: 0; overflow: hidden; opacity: 0;
  display: flex; flex-direction: column; gap: 0.4rem;
  transition: max-height 0.4s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.3s ease, margin-top 0.4s ease;
}
.sidebar-filter-header.open .filter-dropdown {
  max-height: 250px; opacity: 1; margin-top: 1rem;
}

.filter-item {
  font-family: var(--font-display); 
  font-size: clamp(0.85rem, 1vw, 1.1rem); 
  font-weight: 700; color: #a0a0a0; 
  background: none; border: none; text-transform: uppercase; text-align: left;
  letter-spacing: 0.08em; 
  padding: 0; transition: color 0.2s;
  display: flex; align-items: center; gap: 0.5rem;
}
.filter-item::before {
  content: "—"; color: transparent; font-weight: 700; transition: color 0.2s;
}
.filter-item:hover { color: #111111; }
.filter-item:hover::before { color: #111111; }
.filter-item.active { 
  color: #111111; font-weight: 700; 
}
.filter-item.active::before { color: #111111; }

.index-item { display: flex; flex-direction: column; border-bottom: 1px solid #f0f0f0; transition: opacity 0.4s ease; }
.index-item.dimmed { opacity: 0.15; } 

.index-num { font-family: var(--font-display); font-size: 1.25rem; padding: 0.65rem 1.2rem; color: #777777; line-height: 1; transition: color 0.2s; text-align: left; }
.index-num:hover, .index-item.active .index-num { color: #111111; font-weight: 500; }

.meta-content-wrapper { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.4s cubic-bezier(0.25, 1, 0.5, 1); }
.index-item.active .meta-content-wrapper { grid-template-rows: 1fr; }
.meta-content { overflow: hidden; }
.meta-content-inner { display: flex; flex-direction: column; gap: 0.75rem; padding: 0 1.2rem 1.5rem 1.2rem; }

.meta-group { display: flex; flex-direction: column; gap: 0.25rem; }
.meta-label { font-family: var(--font-body); font-size: 0.55rem; font-weight: 700; text-transform: uppercase; color: #777777; border-bottom: 1px solid #d5d5d5; padding-bottom: 3px; margin-bottom: 2px; }
.meta-value { font-family: var(--font-body); font-size: 0.7rem; color: #111111; line-height: 1.35; white-space: pre-line; }

@media (max-width: 1024px) {
  body { padding-right: 60px; } 
  .content-grid-3 { display: flex; flex-direction: column; gap: var(--gutter); }
  .span-1, .span-2, .span-3 { width: 100% !important; margin: 0 !important; padding-top: 0 !important; gap: var(--gutter) !important; justify-content: flex-start !important; }
  .col-text { padding-top: 0 !important; margin-top: 0 !important; }
  .multi-col-2 { columns: 1; }
  .visual-box { width: 100% !important; margin: 0 !important; }
  .flex-stretch, .aspect-landscape, .aspect-panorama, .aspect-video { aspect-ratio: 1.25 / 1 !important; flex: none !important; }
  .aspect-portrait { aspect-ratio: 1 / 1.16 !important; flex: none !important; }
  .aspect-square { aspect-ratio: 1 / 1 !important; flex: none !important; }
  .mobile-reset-wrapper { margin: 0 !important; width: 100% !important; grid-column: 1 / -1 !important; }

  #global-sidebar { width: 60px; transform: translateX(0); padding-top: 0; background: rgba(255, 255, 255, 0.98); box-shadow: -2px 0 10px rgba(0,0,0,0.03); transition: width 0.4s cubic-bezier(0.25, 1, 0.5, 1); }
  #global-sidebar.mobile-open { width: 50vw; } 
  .sidebar-filter-header { display: none; } 
  #global-sidebar.mobile-open .sidebar-filter-header { display: block; }
  
  .index-num { text-align: center; padding: 0.85rem 0; }
  #global-sidebar.mobile-open .index-num { text-align: left; padding: 0.85rem 1.2rem; }
  .meta-content-inner { min-width: calc(50vw - 2.4rem); } 
  .index-item.active .meta-content-wrapper { grid-template-rows: 0fr; }
  #global-sidebar.mobile-open .index-item.active .meta-content-wrapper { grid-template-rows: 1fr; }
}