/* ==========================================================================
   V2 Homepage - Editorial Gallery Design
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400&display=swap');

/* Design Tokens */
:root {
  --home-bg: #252424;
  --home-bg-elevated: #2e2d2d;
  --home-text: #f0eeeb;
  --home-text-muted: #b5b2ad;
  --home-accent: #c4b693;
  --home-accent-light: rgba(196, 182, 147, 0.15);
  --home-border: rgba(255, 255, 255, 0.12);

  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Montserrat', -apple-system, sans-serif;

  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
}

/* Base */
#home-page {
  background: var(--home-bg);
  color: var(--home-text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */

.hero-section {
  position: relative;
  height: 100vh;
  height: 100svh; /* Small viewport height - always fits without scrolling */
  min-height: 500px;
  max-height: 100svh;
  display: flex;
  flex-direction: column;
  overflow: visible;
}

.hero-background {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.hero-bg-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 30% 40%;
  filter: grayscale(30%) brightness(0.55);
  transform: scale(1.05);
  animation: heroImageReveal 2s var(--ease-out-expo) forwards;
}

@keyframes heroImageReveal {
  from {
    transform: scale(1.15);
    filter: grayscale(100%) brightness(0.3);
  }
  to {
    transform: scale(1.05);
    filter: grayscale(30%) brightness(0.55);
  }
}

.hero-gradient {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg,
      rgba(37, 36, 36, 0.15) 0%,
      rgba(37, 36, 36, 0) 30%,
      rgba(37, 36, 36, 0.4) 75%,
      rgba(37, 36, 36, 1) 100%
    );
}

/* Navigation in Hero */
.hero-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 0 2vw;
  transition: background 0.4s ease, backdrop-filter 0.4s ease;
}

.hero-nav.nav-scrolled {
  background: rgba(37, 36, 36, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

#home-page .hero-nav .navbar {
  background: transparent !important;
  box-shadow: none;
  height: 70px;
  margin-bottom: 0;
}

#home-page .hero-nav .navbar-nav {
  border: none;
}

#home-page .hero-nav .navbar-dark .navbar-nav .nav-link {
  color: rgba(255, 255, 255, 0.85);
  transition: color 0.3s ease;
}

#home-page .hero-nav .navbar-dark .navbar-nav .nav-link:hover {
  color: white;
}

#home-page .hero-nav #navbar-logo-symbol-container {
  display: none;
}

/* Hero Content */
.hero-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  z-index: 10;
  padding: 80px 20px 0;
  text-align: center;
  width: 100%;
}

.hero-logo-container {
  opacity: 0;
  animation: fadeInUp 1.2s var(--ease-out-expo) 0.3s forwards;
}

.hero-logo {
  max-width: min(500px, 80vw);
  height: auto;
  filter: drop-shadow(0 10px 40px rgba(0, 0, 0, 0.5));
}

.hero-tagline {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.8vw, 1.6rem);
  font-weight: 400;
  font-style: italic;
  color: #d4b896;
  letter-spacing: 0.04em;
  margin: 30px auto 0;
  opacity: 0;
  animation: fadeInUp 1s var(--ease-out-expo) 0.6s forwards;
  width: 100%;
  max-width: 600px;
}

#home-page.localize-hebrew .hero-tagline {
  font-family: 'Alef', serif;
  font-style: normal;
  letter-spacing: 0.02em;
}

/* Scroll Indicator */
.scroll-indicator {
  position: absolute;
  bottom: calc(40px + env(safe-area-inset-bottom, 0px));
  left: 0;
  right: 0;
  margin: 0 auto;
  width: fit-content;
  z-index: 10;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: #d4b896;
  opacity: 0;
  animation: fadeIn 1s ease 1.2s forwards;
  transition: color 0.3s ease, transform 0.3s ease;
}

.scroll-indicator:hover {
  color: #e8cba8;
  transform: translateY(3px);
}

.scroll-text {
  font-family: var(--font-body);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 500;
}

#home-page.localize-hebrew .scroll-text {
  font-family: 'Alef', serif;
  letter-spacing: 0.1em;
}

.scroll-arrow {
  display: block;
  width: 1px;
  height: 50px;
  background: linear-gradient(180deg, #d4b896, transparent);
  position: relative;
  animation: scrollPulse 2s ease-in-out infinite;
}

.scroll-arrow::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 8px;
  height: 8px;
  border-right: 1px solid #d4b896;
  border-bottom: 1px solid #d4b896;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.5; transform: scaleY(1); }
  50% { opacity: 1; transform: scaleY(1.1); }
}

/* ==========================================================================
   Galleries Section
   ========================================================================== */

.galleries-section {
  padding: 100px 5vw 80px;
  position: relative;
  background: #252424;
}

.galleries-header {
  text-align: center;
  margin-bottom: 60px;
}

.galleries-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 300;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--home-text);
  margin: 0 0 20px;
}

#home-page.localize-hebrew .galleries-title {
  font-family: 'Alef', serif;
  letter-spacing: 0.08em;
}

.galleries-line {
  width: 60px;
  height: 1px;
  background: var(--home-accent);
  margin: 0 auto;
}

/* Portfolio Grid */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  max-width: 1400px;
  margin: 0 auto;
}

@media (max-width: 991px) {
  .portfolio-grid {
    grid-template-columns: 1fr;
    gap: 40px;
    max-width: 600px;
  }
}

/* Portfolio Card */
.portfolio-card {
  opacity: 0;
  transform: translateY(40px);
  animation: cardReveal 0.8s var(--ease-out-expo) var(--delay, 0s) forwards;
}

@keyframes cardReveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.portfolio-card a {
  display: block;
  text-decoration: none;
  color: inherit;
}

.portfolio-card-image {
  position: relative;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--home-bg-elevated);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  transition: box-shadow 0.4s ease, transform 0.4s var(--ease-out-expo);
}

.portfolio-card:hover .portfolio-card-image {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  transform: translateY(-4px);
}

.portfolio-card-image .placeholder-image {
  position: absolute;
  inset: 0;
  background: var(--home-bg-elevated);
  width: 100%;
  height: 100%;
  padding: 0;
}

.portfolio-card.image-loaded .placeholder-image {
  display: none;
}

.portfolio-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease-out-expo), filter 0.4s ease;
  display: none;
}

.portfolio-card.image-loaded .portfolio-img {
  display: block;
}

.portfolio-card:hover .portfolio-img {
  transform: scale(1.04);
  filter: brightness(1.08);
}

/* Caption Below - Centered */
.portfolio-card-caption {
  padding: 20px 0 0;
  text-align: center;
}

.portfolio-card-label {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--home-text-muted);
  transition: color 0.3s ease;
}

.portfolio-card:hover .portfolio-card-label {
  color: var(--home-text);
}

#home-page.localize-hebrew .portfolio-card-label {
  font-family: 'Alef', serif;
  letter-spacing: 0;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.home-footer {
  padding: 60px 5vw 40px;
  background: var(--home-bg);
}

.footer-content {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

.footer-line {
  width: 40px;
  height: 1px;
  background: var(--home-border);
  margin: 0 auto 30px;
}

.footer-dedication {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-style: italic;
  color: var(--home-text-muted);
  margin: 0 0 10px;
  line-height: 1.6;
}

#home-page.localize-hebrew .footer-dedication {
  font-family: 'Alef', serif;
  font-style: normal;
}

.footer-credit {
  font-family: var(--font-body);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--home-text-muted);
  opacity: 0.7;
  margin: 0;
}

#home-page.localize-hebrew .footer-credit {
  font-family: 'Alef', serif;
  letter-spacing: 0.08em;
}

/* ==========================================================================
   Animations
   ========================================================================== */

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
  .hero-section {
    min-height: 500px;
  }

  .hero-content {
    padding-top: 60px;
  }

  .hero-tagline {
    margin-top: 20px;
    padding: 0 20px;
  }

  .scroll-indicator {
    bottom: calc(30px + env(safe-area-inset-bottom, 0px));
  }

  .galleries-section {
    padding: 60px 5vw;
  }

  .galleries-header {
    margin-bottom: 40px;
  }

  .portfolio-card-caption {
    padding: 16px 0 0;
  }

  .portfolio-card-label {
    font-size: 1.5rem;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .hero-bg-image {
    animation: none;
    transform: scale(1.05);
    filter: grayscale(30%) brightness(0.55);
  }

  .hero-logo-container,
  .hero-tagline,
  .scroll-indicator,
  .portfolio-card {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .scroll-arrow {
    animation: none;
  }
}

/* Hide old elements that might conflict */
#home-page #index-hero-header,
#home-page #weird-container-for-footer,
#home-page #content-container,
#home-page #portfolio-links-container,
#home-page #footer-ornament-container,
#home-page .kudos {
  display: none;
}
