/* ============================================
   Taisei Growth Record
   Design system shared with Wedding Gallery
   ============================================ */

:root {
  --gold: #c9a96e;
  --gold-light: #e8d5a8;
  --gold-dark: #8b7340;
  --ivory: #faf7f0;
  --ivory-warm: #f5efe3;
  --rose: #d4a5a5;
  --rose-light: #f0dada;
  --brown: #3a2e26;
  --brown-light: #5c4a3a;
  --text: #2c2420;
  --text-light: #7a6e64;
  --white: #ffffff;
  --shadow: rgba(58, 46, 38, 0.08);
  --shadow-heavy: rgba(58, 46, 38, 0.15);

  --font-display: 'Great Vibes', cursive;
  --font-serif: 'Cormorant Garamond', serif;
  --font-body: 'Noto Sans JP', sans-serif;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--ivory);
  line-height: 1.6;
  overflow-x: hidden;
}


/* ============================================
   HERO
   ============================================ */

.hero {
  position: relative;
  height: 100vh;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 30% 40%, rgba(201, 169, 110, 0.15) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 60%, rgba(212, 165, 165, 0.12) 0%, transparent 60%),
    linear-gradient(160deg, #faf7f0 0%, #f5efe3 50%, #faf7f0 100%);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 80%, rgba(201, 169, 110, 0.06) 0%, transparent 40%),
    radial-gradient(circle at 80% 20%, rgba(212, 165, 165, 0.06) 0%, transparent 40%);
}

.hero-content {
  position: relative;
  text-align: center;
  animation: heroFadeIn 1.5s ease-out;
}

@keyframes heroFadeIn {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-pre {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 300;
  font-size: 1.1rem;
  letter-spacing: 0.15em;
  color: var(--gold);
  margin-bottom: 15px;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(3.5rem, 10vw, 6rem);
  color: var(--brown);
  line-height: 1.1;
  margin-bottom: 10px;
}

.hero-name {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 1.4rem;
  color: var(--text-light);
  letter-spacing: 0.5em;
  margin-bottom: 30px;
}

.hero-age {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.age-date {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: 1rem;
  color: var(--gold-dark);
  letter-spacing: 0.25em;
}

.age-counter {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: 1.1rem;
  color: var(--text-light);
  letter-spacing: 0.1em;
}

.hero-scroll {
  position: absolute;
  bottom: -120px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  opacity: 0.5;
  animation: scrollBounce 2s ease-in-out infinite;
}

.hero-scroll span {
  font-family: var(--font-serif);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-light);
}

.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--gold), transparent);
}

@keyframes scrollBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}


/* ============================================
   NAVIGATION
   ============================================ */

.gallery-nav {
  position: relative;
  background: var(--white);
  border-bottom: 1px solid rgba(201, 169, 110, 0.15);
  z-index: 100;
  transition: box-shadow 0.3s;
}

.gallery-nav.sticky {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  box-shadow: 0 2px 20px var(--shadow);
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from { transform: translateY(-100%); }
  to { transform: translateY(0); }
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  height: 56px;
  gap: 16px;
}

.nav-brand {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--gold-dark);
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.nav-links::-webkit-scrollbar {
  display: none;
}

.nav-link {
  text-decoration: none;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 300;
  color: var(--text-light);
  padding: 6px 12px;
  border-radius: 2px;
  transition: all 0.3s;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--gold-dark);
  background: rgba(201, 169, 110, 0.08);
}

.nav-link.active {
  color: var(--gold-dark);
  background: rgba(201, 169, 110, 0.12);
  font-weight: 400;
}

.nav-spacer {
  height: 56px;
  display: none;
}


/* ============================================
   LOADING / EMPTY STATE
   ============================================ */

.loading {
  text-align: center;
  padding: 100px 20px;
  color: var(--text-light);
}

.loading-spinner {
  width: 36px;
  height: 36px;
  border: 2px solid var(--gold-light);
  border-top-color: var(--gold);
  border-radius: 50%;
  margin: 0 auto 16px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading p {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 300;
}

.empty-state {
  text-align: center;
  padding: 120px 20px;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.4;
}

.empty-text {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  color: var(--brown);
  margin-bottom: 8px;
}

.empty-sub {
  font-size: 0.85rem;
  color: var(--text-light);
  font-weight: 300;
}

.upload-link-btn {
  display: inline-block;
  margin-top: 20px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--white);
  background: var(--gold);
  text-decoration: none;
  padding: 10px 24px;
  border-radius: 4px;
  transition: background 0.3s;
}

.upload-link-btn:hover {
  background: var(--gold-dark);
}


/* ============================================
   GALLERY SECTIONS
   ============================================ */

.gallery-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

.month-section {
  padding: 70px 0 30px;
}

.month-header {
  text-align: center;
  margin-bottom: 40px;
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

.month-header.revealed {
  opacity: 1;
  transform: translateY(0);
}

.month-age {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: 0.85rem;
  color: var(--gold);
  letter-spacing: 0.2em;
  display: block;
  margin-bottom: 8px;
}

.month-title {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  color: var(--brown);
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.month-count {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 0.8rem;
  color: var(--text-light);
  letter-spacing: 0.05em;
}

.month-line {
  width: 50px;
  height: 1px;
  background: var(--gold);
  margin: 16px auto 0;
}


/* ============================================
   PHOTO GRID
   ============================================ */

.photo-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.photo-item {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  cursor: pointer;
  background: var(--ivory-warm);
  aspect-ratio: 1;
  opacity: 0;
  transform: translateY(15px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.photo-item.revealed {
  opacity: 1;
  transform: translateY(0);
}

.photo-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(58, 46, 38, 0.2) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}

.photo-item:hover::after {
  opacity: 1;
}

.photo-item:hover .photo-img {
  transform: scale(1.06);
}

.photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1), opacity 0.5s;
  opacity: 0;
}

.photo-img.loaded {
  opacity: 1;
}

.photo-date-badge {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(58, 46, 38, 0.65);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 300;
  padding: 2px 8px;
  border-radius: 2px;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  z-index: 1;
}

.photo-item:hover .photo-date-badge {
  opacity: 1;
}


/* ============================================
   LIGHTBOX
   ============================================ */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: lbFadeIn 0.3s;
}

.lightbox[hidden] {
  display: none;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 16, 12, 0.92);
  backdrop-filter: blur(8px);
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 2px;
  opacity: 0;
  transition: opacity 0.4s;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
}

.lightbox-img.lb-loaded {
  opacity: 1;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  z-index: 10;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 2rem;
  cursor: pointer;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.3s;
}

.lightbox-close:hover {
  color: var(--white);
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--white);
}

.lightbox-counter {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.5);
  font-family: var(--font-serif);
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  z-index: 10;
}

.lightbox-age {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.5);
  font-family: var(--font-serif);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  z-index: 10;
  white-space: nowrap;
}

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


/* ============================================
   FOOTER
   ============================================ */

.gallery-footer {
  background: var(--brown);
  color: var(--ivory);
  text-align: center;
  padding: 60px 20px;
  margin-top: 40px;
}

.footer-content {
  max-width: 600px;
  margin: 0 auto;
}

.footer-script {
  font-family: var(--font-display);
  font-size: 2.2rem;
  color: var(--gold-light);
  margin-bottom: 8px;
}

.footer-date {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: 1rem;
  letter-spacing: 0.3em;
  color: rgba(250, 247, 240, 0.6);
  margin-bottom: 20px;
}

.footer-thanks {
  font-family: var(--font-serif);
  font-weight: 300;
  font-style: italic;
  font-size: 0.9rem;
  color: rgba(250, 247, 240, 0.4);
  letter-spacing: 0.1em;
  margin-bottom: 20px;
}

.footer-link {
  display: inline-block;
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: 0.85rem;
  color: var(--gold-light);
  text-decoration: none;
  letter-spacing: 0.1em;
  padding: 8px 20px;
  border: 1px solid rgba(201, 169, 110, 0.3);
  border-radius: 2px;
  transition: all 0.3s;
}

.footer-link:hover {
  background: rgba(201, 169, 110, 0.1);
  border-color: var(--gold-light);
}


/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
  .photo-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 768px) {
  .hero {
    min-height: 100svh;
  }

  .nav-inner {
    padding: 0 10px;
    height: 48px;
  }

  .nav-brand {
    font-size: 1.2rem;
  }

  .nav-link {
    padding: 5px 8px;
    font-size: 0.7rem;
  }

  .nav-spacer {
    height: 48px;
  }

  .photo-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
  }

  .gallery-main {
    padding: 0 10px;
  }

  .month-section {
    padding: 50px 0 20px;
  }

  .month-header {
    margin-bottom: 25px;
  }

  .lightbox-prev,
  .lightbox-next {
    width: 36px;
    height: 36px;
  }

  .lightbox-prev { left: 10px; }
  .lightbox-next { right: 10px; }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 3rem;
  }

  .hero-name {
    font-size: 1.1rem;
    letter-spacing: 0.3em;
  }

  .hero-pre {
    font-size: 0.9rem;
  }

  .nav-brand {
    display: none;
  }

  .nav-inner {
    justify-content: center;
  }

  .photo-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 3px;
  }

  .month-title {
    font-size: 1.4rem;
  }

  .lightbox-prev { left: 6px; }
  .lightbox-next { right: 6px; }
}
