/* ═══════════════════════════════════════════════════════════════
   homepage.css — Editorial Two-Column Homepage
   Dependencies: brand-tokens.css, colors.css, components.css (fadeUp)
   Used by: src/index.njk only
   ═══════════════════════════════════════════════════════════════ */

/* ══ EDITORIAL HOMEPAGE ══ */
.home { display: flex; min-height: 100vh; }

/* Left panel — identity + navigation */
.home-panel {
  flex: 0 0 380px;
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; justify-content: center;
  padding: var(--space-2xl) var(--space-2xl) var(--space-xl) var(--space-page);
  border-right: 1px solid var(--color-border);
  overflow-y: auto; overflow-x: hidden;
}
.home-panel::after {
  content: ''; position: absolute; right: -1px; top: 20%; height: 60%; width: 2px;
  background: linear-gradient(transparent, var(--color-accent), transparent); opacity: 0.4;
}

/* Brand */
.home-brand {
  font-family: var(--font-display); font-size: clamp(28px, 3.5vw, 40px);
  font-weight: var(--weight-medium); letter-spacing: -0.02em; line-height: 1.05;
  margin-bottom: var(--space-lg);
  opacity: 0; animation: fadeUp 1000ms var(--ease-out) 200ms forwards;
}
.home-sub {
  font-family: var(--font-meta); font-size: var(--text-micro);
  color: var(--color-text-muted); letter-spacing: var(--tracking-caps); text-transform: uppercase;
  margin-bottom: var(--space-xl);
  opacity: 0; animation: fadeUp 800ms var(--ease-out) 400ms forwards;
}
.home-tagline {
  font-family: var(--font-body); font-size: var(--text-body); font-weight: 300;
  color: var(--color-text-secondary); line-height: var(--leading-body);
  margin-bottom: var(--space-2xl);
  opacity: 0; animation: fadeUp 800ms var(--ease-out) 600ms forwards;
}

/* Site navigation in left panel */
.home-nav {
  display: flex; flex-direction: column; gap: var(--space-sm);
  margin-bottom: var(--space-2xl); padding-left: var(--space-md);
  border-left: 1px solid var(--color-border);
  opacity: 0; animation: fadeUp 800ms var(--ease-out) 800ms forwards;
}
.home-nav a {
  font-family: var(--font-meta); font-size: var(--text-small);
  color: var(--color-text-muted); text-decoration: none; letter-spacing: var(--tracking-wide);
  padding: var(--space-2xs) 0;
  transition: color var(--duration-med) var(--ease-out),
              padding-left var(--duration-med) var(--ease-out);
}
.home-nav a:hover { color: var(--color-text-primary); padding-left: var(--space-xs); }
.home-nav a.nav-active { color: var(--color-accent); }

/* Bottom section — meta + links */
.home-bottom {
  margin-top: auto;
  opacity: 0; animation: fadeUp 800ms var(--ease-out) 1000ms forwards;
}
.home-meta {
  font-family: var(--font-meta); font-size: var(--text-small);
  color: var(--color-text-faint); line-height: var(--leading-loose);
  margin-bottom: var(--space-lg);
}
.home-links { display: flex; gap: var(--space-md); }
.home-links a {
  font-family: var(--font-meta); font-size: var(--text-small);
  color: var(--color-text-muted); text-decoration: none;
  transition: color var(--duration-med) var(--ease-out);
}
.home-links a:hover { color: var(--color-accent); }

/* ══ RIGHT SIDE — GALLERY ══ */
.home-gallery {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: var(--space-xl); min-height: 100vh; position: relative;
}

/* Project info overlay on gallery */
.gallery-active-info {
  position: absolute; bottom: var(--space-2xl); left: var(--space-xl); right: var(--space-xl);
  text-align: center; pointer-events: none;
}
.gallery-active-title {
  font-family: var(--font-body); font-size: var(--text-h3);
  font-weight: var(--weight-bold); color: var(--color-text-primary);
  transition: all var(--duration-med) var(--ease-out);
}
.gallery-active-desc {
  font-family: var(--font-body); font-size: var(--text-meta);
  color: var(--color-text-secondary); margin-top: var(--space-2xs);
  line-height: var(--leading-body); transition: all var(--duration-med) var(--ease-out);
}
.gallery-active-tags { display: flex; gap: var(--space-xs); justify-content: center; margin-top: var(--space-xs); }
.gallery-active-tags span { font-family: var(--font-meta); font-size: var(--text-small); color: var(--color-text-muted); }

/* Vertical dots on right edge */
.gallery-dots-v {
  position: absolute; right: var(--space-lg); top: 50%;
  transform: translateY(-50%); display: flex; flex-direction: column; gap: var(--space-xs);
}
.gallery-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--color-text-faint);
  border: none; cursor: pointer; padding: 0; transition: all 300ms var(--ease-out);
}
.gallery-dot.active { background: var(--color-accent); height: 24px; border-radius: 4px; }
.gallery-dot:not(.active):hover { background: var(--color-text-muted); transform: scale(1.3); }

/* Gallery hint */
.gallery-hint {
  position: absolute; bottom: var(--space-md); right: var(--space-lg);
  font-family: var(--font-meta); font-size: var(--text-micro); color: var(--color-text-faint);
  letter-spacing: var(--tracking-caps); text-transform: uppercase;
  writing-mode: vertical-rl; text-orientation: mixed;
}

/* ══ 3D CARD GALLERY ══ */
.gallery-scene {
  perspective: 900px; width: 100%; max-width: 480px; height: 480px;
  position: relative; transform-style: preserve-3d; overflow: visible;
}
/* Large elliptical floor shadow under the stack */
.gallery-scene::after {
  content: ''; position: absolute;
  bottom: -15px; left: 8%; width: 84%; height: 60px;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0.2) 0%, transparent 65%);
  filter: blur(30px); z-index: 0;
}
.gallery-card {
  position: absolute; width: 100%; aspect-ratio: 3/2;
  overflow: hidden; cursor: pointer; border-radius: 18px;
  backface-visibility: hidden;
  transition: transform 450ms cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center bottom; will-change: transform;
  background: var(--dark-bg);
  /* Shadow for depth separation + subtle edge definition */
  box-shadow: 0 4px 16px rgba(0,0,0,0.15), 0 0 0 1px rgba(0,0,0,0.08);
}
.gallery-card.active {
  box-shadow: 0 20px 60px rgba(0,0,0,0.3), 0 8px 20px rgba(0,0,0,0.12),
              0 0 0 1px rgba(0,0,0,0.06);
}
.gallery-card img, .gallery-card .card-bg {
  width: 100%; height: 100%; object-fit: cover; display: block; position: absolute; inset: 0;
}
.gallery-card .card-overlay {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: var(--space-md) var(--space-lg);
  background: linear-gradient(transparent 0%, var(--color-overlay-dark) 100%);
  opacity: 0; transition: opacity 300ms var(--ease-out);
}
.gallery-card.active .card-overlay { opacity: 1; }
.gallery-card .card-overlay-title {
  font-family: var(--font-body); font-size: var(--text-meta); font-weight: var(--weight-bold); color: #fff;
}
.gallery-card .card-overlay-tags { display: flex; gap: var(--space-xs); }
.gallery-card .card-overlay-tags span {
  font-family: var(--font-meta); font-size: var(--text-small); color: var(--viz-text-muted);
}
.gallery-card .card-gradient-bar {
  position: absolute; bottom: 0; left: 0; right: 0; height: var(--indicator-bar-height);
  background: linear-gradient(90deg, var(--teal-400), var(--purple-400));
  transform: scaleX(0); transform-origin: left; transition: transform 500ms var(--ease-out);
}
.gallery-card.active .card-gradient-bar { transform: scaleX(1); }
.gallery-card.active { box-shadow: var(--shadow-card); }

/* ══ RESPONSIVE ══ */
@media (max-width: 1024px) {
  .home-panel { flex: 0 0 320px; padding: var(--space-lg) var(--space-lg) var(--space-md) var(--space-md); }
}
@media (max-width: 768px) {
  .home { flex-direction: column; }
  .home-panel {
    position: relative; top: auto; height: auto; flex: none; border-right: none;
    border-bottom: 1px solid var(--color-border); padding: var(--space-2xl) var(--space-page) var(--space-xl);
  }
  .home-panel::after { display: none; }
  .home-gallery { min-height: 70vh; padding: var(--space-xl) var(--space-page); }
  .gallery-dots-v {
    position: relative; right: auto; top: auto; transform: none;
    flex-direction: row; justify-content: center; margin-top: var(--space-md);
  }
  .gallery-dot.active { height: 8px; width: 24px; }
  .gallery-hint {
    position: relative; bottom: auto; right: auto; writing-mode: horizontal-tb;
    text-align: center; margin-top: var(--space-sm);
  }
  .gallery-active-info { position: relative; bottom: auto; left: auto; right: auto; margin-top: var(--space-md); }
}
@media (max-width: 520px) {
  .gallery-scene {
    perspective: none; height: auto; display: flex; flex-direction: column; gap: var(--space-md);
  }
  .gallery-card {
    position: relative; height: 200px; transform: none !important; opacity: 1 !important;
    pointer-events: auto !important; box-shadow: var(--shadow-md) !important;
  }
  .gallery-card .card-overlay { opacity: 1 !important; }
  .gallery-dots-v, .gallery-hint, .gallery-active-info { display: none; }
}
