/* ══════════════════════════════════════════
   VISUAR LABS BY A21 — Main Stylesheet
   File: assets/css/style.css
══════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --accent:     #233a44;
  --highlight:  #faaf40;
  --charcoal:   #1a1a1a;
  --bg:         #f4f5f4;
  --white:      #ffffff;
  --gray:       #6b7280;
  --gray-light: #9ca3af;
  --border:     #e5e7eb;
  --text:       #374151;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  background: var(--white);
  color: var(--text);
  font-weight: 400;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ══════════════════════════════════════════
   HEADER
══════════════════════════════════════════ */
header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 52px;
  transition: background 0.3s ease, box-shadow 0.3s ease, padding 0.3s ease;
}

header.scrolled {
  background: var(--white);
  box-shadow: 0 1px 0 var(--border), 0 4px 16px rgba(0,0,0,0.06);
  padding: 14px 52px;
}

.logo {
  display: flex;
  align-items: center;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.25s;
  flex-shrink: 0;
}

.logo img {
  height: 44px;
  width: 44px;
  object-fit: contain;
  display: block;
}

.logo:hover { opacity: 0.75; }

nav { display: flex; gap: 40px; }

nav a {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  text-transform: uppercase;
  transition: color 0.25s;
  position: relative;
}

nav a::after {
  content: '';
  position: absolute;
  bottom: -3px; left: 0;
  width: 0; height: 1px;
  background: var(--highlight);
  transition: width 0.25s ease;
}

nav a:hover { color: var(--white); }
nav a:hover::after { width: 100%; }
header.scrolled nav a { color: var(--gray); }
header.scrolled nav a:hover { color: var(--accent); }
header.scrolled nav a:hover::after { width: 100%; }

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--white);
  transition: background 0.3s, transform 0.3s, opacity 0.3s;
}

header.scrolled .hamburger span { background: var(--charcoal); }
.hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.mobile-nav {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--white);
  z-index: 199;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 44px;
}

.mobile-nav.open { display: flex; }

.mobile-nav a {
  font-size: 30px;
  font-weight: 300;
  letter-spacing: 0.08em;
  color: var(--charcoal);
  text-decoration: none;
  text-transform: uppercase;
  transition: color 0.25s;
}

.mobile-nav a:hover { color: var(--highlight); }

/* ══════════════════════════════════════════
   HERO
══════════════════════════════════════════ */
#hero {
  position: relative;
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(155deg, #1e3340 0%, #142530 45%, #1a2e39 100%);
}

/* Perspective grid drawn by JS canvas — heroPerspectiveGrid() in main.js */
#hero-grid {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.5;
}

#hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: rgba(255,255,255,0.07);
}

.hero-stripe {
  position: absolute;
  bottom: 0; left: 0; width: 100%;
  height: 3px;
  background: linear-gradient(90deg, transparent 0%, var(--highlight) 40%, transparent 100%);
  opacity: 0.35;
}

.hero-inner {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 24px;
}

.hero-eyebrow {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.28em;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
  margin-bottom: 40px;
  opacity: 0;
  transform: translateY(12px);
  animation: fadeUp 0.8s ease 0.3s forwards;
}

.hero-word {
  font-size: clamp(48px, 9vw, 140px);
  font-weight: 300;
  letter-spacing: 0.04em;
  color: var(--white);
  line-height: 1;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 1s ease 0.05s forwards;
}

.hero-sub {
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.34);
  margin-top: 36px;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
  line-height: 2;
  opacity: 0;
  transform: translateY(12px);
  animation: fadeUp 0.8s ease 0.55s forwards;
}

@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

.hero-word.fade-out {
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.hero-word.fade-in {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.scroll-hint {
  position: absolute;
  bottom: 44px; left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  opacity: 0;
  animation: fadeUp 0.8s ease 1.1s forwards;
}

.scroll-hint span {
  font-size: 9px;
  letter-spacing: 0.3em;
  color: rgba(255,255,255,0.2);
  text-transform: uppercase;
}

.scroll-line {
  width: 1px;
  height: 32px;
  background: linear-gradient(to bottom, rgba(250,175,64,0.4), transparent);
  animation: scrollPulse 2.2s ease infinite 1.5s;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; }
  50%       { opacity: 0.9; }
}

/* ══════════════════════════════════════════
   SHARED SECTION ELEMENTS
══════════════════════════════════════════ */
section { padding: 120px 52px; }

.section-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.35em;
  color: var(--highlight);
  text-transform: uppercase;
  margin-bottom: 14px;
}

.section-title {
  font-size: clamp(36px, 5vw, 72px);
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--charcoal);
  text-transform: uppercase;
  line-height: 1.05;
}

.section-sub {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.18em;
  color: var(--gray);
  text-transform: uppercase;
  padding-bottom: 8px;
}

/* ══════════════════════════════════════════
   LAB (ABOUT)
══════════════════════════════════════════ */
#lab {
  background: var(--white);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: start;
}

.lab-right {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.lab-body {
  font-size: clamp(18px, 1.8vw, 24px);
  font-weight: 300;
  line-height: 1.65;
  color: var(--charcoal);
  max-width: 520px;
}

.lab-divider {
  width: 32px;
  height: 2px;
  background: var(--highlight);
}

.lab-detail {
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--gray);
  line-height: 1.9;
  max-width: 440px;
}

/* ══════════════════════════════════════════
   CAPABILITIES (SERVICES)
══════════════════════════════════════════ */
#capabilities {
  background: var(--bg);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.capabilities-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 80px;
}

.services-grid { display: grid; grid-template-columns: 1fr; }

.service-item {
  padding: 52px 0;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 32px;
  align-items: start;
}

.service-item:last-child { border-bottom: none; }

.service-number {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: var(--gray-light);
  padding-top: 5px;
}

.service-name {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--charcoal);
  margin-bottom: 14px;
  text-transform: uppercase;
}

.service-desc {
  font-size: 14px;
  font-weight: 400;
  color: var(--gray);
  line-height: 1.85;
  max-width: 600px;
}

/* ══════════════════════════════════════════
   VISUALS — HEADER & INTRO
══════════════════════════════════════════ */
#visuals { background: var(--white); }

.visuals-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 24px;
}

.visuals-intro {
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--gray);
  line-height: 1.85;
  max-width: 640px;
  margin-bottom: 40px;
}

/* ══════════════════════════════════════════
   VISUALS — FILTERS
══════════════════════════════════════════ */
.visuals-filters {
  display: flex;
  align-items: center;
  margin-bottom: 48px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.filter-btn {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gray);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 14px 24px;
  cursor: pointer;
  transition: color 0.25s, border-color 0.25s;
  margin-bottom: -1px;
  white-space: nowrap;
}

.filter-btn:hover { color: var(--charcoal); }
.filter-btn.active { color: var(--accent); border-bottom-color: var(--highlight); }

/* ══════════════════════════════════════════
   VISUALS — GRID (4 per row)
══════════════════════════════════════════ */
.visuals-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.visual-item {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 4 / 3;
}

.visual-item.hidden { display: none; }

.visual-item img.thumb {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.55s ease, filter 0.45s ease;
}

.visual-item:hover img.thumb {
  transform: scale(1.05);
  filter: brightness(0.42);
}

.visual-item .overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 18px 16px;
  pointer-events: none;
}

.overlay-content {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.visual-item:hover .overlay-content { opacity: 1; transform: translateY(0); }

.zoom-icon {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.75);
  width: 40px; height: 40px;
  border: 1.5px solid rgba(255,255,255,0.5);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity 0.35s ease, transform 0.35s ease;
  pointer-events: none;
}

.zoom-icon svg {
  width: 15px; height: 15px;
  stroke: rgba(255,255,255,0.9);
  fill: none; stroke-width: 1.5; stroke-linecap: round;
}

.visual-item:hover .zoom-icon { opacity: 1; transform: translate(-50%, -50%) scale(1); }

.ov-title {
  font-size: 13px; font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--white);
  text-transform: uppercase;
  line-height: 1; margin-bottom: 4px;
}

.ov-type {
  font-size: 10px; font-weight: 400;
  letter-spacing: 0.14em;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
}

/* ══════════════════════════════════════════
   VISUALS — PAGINATION
══════════════════════════════════════════ */
.visuals-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 52px;
}

.page-btn {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 300;
  color: var(--gray);
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  line-height: 1;
}

.page-btn:hover { color: var(--accent); border-color: var(--accent); }
.page-btn:disabled { opacity: 0.25; cursor: not-allowed; pointer-events: none; }

.page-count {
  font-size: 11px; font-weight: 400;
  letter-spacing: 0.2em;
  color: var(--gray-light);
  min-width: 40px; text-align: center;
}

/* ══════════════════════════════════════════
   LIGHTBOX — MULTI-IMAGE
══════════════════════════════════════════ */
#lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  flex-direction: column;
}

#lightbox.active { display: flex; }

.lb-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 12, 16, 0.97);
  animation: lbFadeIn 0.28s ease;
}

@keyframes lbFadeIn { from { opacity: 0; } to { opacity: 1; } }

.lb-close {
  position: absolute;
  top: 20px; right: 24px;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  z-index: 10;
}

.lb-close:hover { background: rgba(250,175,64,0.12); border-color: rgba(250,175,64,0.3); }

.lb-close svg {
  width: 12px; height: 12px;
  stroke: rgba(255,255,255,0.75);
  fill: none; stroke-width: 1.5; stroke-linecap: round;
}

.lb-counter {
  position: absolute;
  top: 26px; left: 50%;
  transform: translateX(-50%);
  font-size: 11px; font-weight: 400;
  letter-spacing: 0.22em;
  color: rgba(255,255,255,0.22);
  z-index: 10; white-space: nowrap;
}

/* Main content area */
.lb-body {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 60px 0 0;
}

/* Main stage */
.lb-stage {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  min-height: 0;
  padding: 0 72px;
}

#lb-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  border-radius: 1px;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

#lb-img.out-left  { opacity: 0; transform: translateX(-40px); }
#lb-img.out-right { opacity: 0; transform: translateX(40px); }
#lb-img.in-left   { opacity: 0; transform: translateX(40px);  transition: none; }
#lb-img.in-right  { opacity: 0; transform: translateX(-40px); transition: none; }
#lb-img.in-active { opacity: 1; transform: translateX(0); transition: opacity 0.25s ease, transform 0.25s ease; }

/* Stage arrows — small, inside stage */
.stage-arrow {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
  z-index: 5;
  flex-shrink: 0;
}

.stage-arrow:hover {
  background: rgba(250,175,64,0.12);
  border-color: rgba(250,175,64,0.3);
  transform: translateY(-50%) scale(1.1);
}

.stage-arrow svg {
  width: 14px; height: 14px;
  stroke: rgba(255,255,255,0.7);
  fill: none; stroke-width: 1.5;
  stroke-linecap: round; stroke-linejoin: round;
}

#stage-prev { left: 16px; }
#stage-next { right: 16px; }

/* Caption */
.lb-caption {
  text-align: center;
  padding: 14px 0 16px;
  flex-shrink: 0;
}

.lb-caption-title {
  font-size: 13px; font-weight: 500;
  letter-spacing: 0.14em;
  color: rgba(255,255,255,0.82);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.lb-caption-meta {
  font-size: 10px; font-weight: 400;
  letter-spacing: 0.14em;
  color: rgba(255,255,255,0.28);
  text-transform: uppercase;
}

/* Thumbnail strip */
.lb-strip {
  flex-shrink: 0;
  padding: 12px 52px 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  justify-content: center;
}

.lb-strip::-webkit-scrollbar { display: none; }

.lb-thumb {
  width: 72px; height: 54px;
  object-fit: cover; object-position: center;
  display: block;
  flex-shrink: 0;
  border-radius: 2px;
  cursor: pointer;
  opacity: 0.35;
  border: 1.5px solid transparent;
  transition: opacity 0.2s, border-color 0.2s, transform 0.2s;
}

.lb-thumb:hover { opacity: 0.7; }
.lb-thumb.active { opacity: 1; border-color: var(--highlight); transform: scaleY(1.06); }

/* Zoom controls */
.lb-zoom-controls {
  position: absolute;
  bottom: 18px; left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 10;
}

.lb-zoom-btn {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.2s;
  color: rgba(255,255,255,0.45);
  font-size: 16px; font-weight: 300; line-height: 1;
  user-select: none;
}

.lb-zoom-btn:hover { background: rgba(250,175,64,0.12); color: rgba(255,255,255,0.85); }

.lb-zoom-level {
  font-size: 10px; letter-spacing: 0.14em;
  color: rgba(255,255,255,0.22);
  min-width: 36px; text-align: center;
}

.lb-zoom-reset {
  width: auto; padding: 0 9px;
  font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase;
}

/* ══════════════════════════════════════════
   FOOTER
══════════════════════════════════════════ */
footer {
  border-top: 1px solid var(--border);
  padding: 36px 52px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.foot-copy {
  font-size: 12px; font-weight: 400;
  letter-spacing: 0.04em; color: var(--gray);
}

.foot-copy a { color: var(--gray); text-decoration: none; transition: color 0.25s; }
.foot-copy a:hover { color: var(--highlight); }

.foot-email a {
  font-size: 12px; font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--gray);
  text-decoration: none;
  transition: color 0.25s;
}

.foot-email a:hover { color: var(--highlight); }

.foot-logo a {
  display: flex; align-items: center;
  text-decoration: none;
  transition: opacity 0.25s;
}

.foot-logo a:hover { opacity: 0.6; }

.foot-logo img {
  height: 32px; width: 32px;
  object-fit: contain; display: block;
}

/* ══════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════ */
@media (max-width: 1100px) {
  .visuals-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 960px) {
  section { padding: 88px 36px; }
  header, header.scrolled { padding: 18px 36px; }
  #lab { grid-template-columns: 1fr; gap: 44px; }
  .capabilities-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .service-item { grid-template-columns: 72px 1fr; }
  .visuals-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  footer { flex-direction: column; gap: 18px; text-align: center; }
  .foot-logo a { justify-content: center; }
  .lb-stage { padding: 0 52px; }
}

@media (max-width: 640px) {
  section { padding: 72px 20px; }
  header, header.scrolled { padding: 16px 20px; }
  nav { display: none; }
  .hamburger { display: flex; }
  .visuals-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .filter-btn { padding: 12px 14px; font-size: 10px; }
  .lb-stage { padding: 0 44px; }
  .lb-strip { padding: 10px 20px 16px; }
  .lb-thumb { width: 56px; height: 42px; }
}
