/* ============================================
   Masakazu & Yuka Wedding Gallery
   Color Palette: Gold, Ivory, Rose, Deep Brown
   ============================================ */

: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;
}

/* ============================================
   LOGIN PAGE
   ============================================ */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(201, 169, 110, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(212, 165, 165, 0.08) 0%, transparent 50%),
    var(--ivory);
  padding: 20px;
  position: relative;
  overflow: hidden;
}

/* Floating petals */
.petals-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.petal {
  position: absolute;
  top: -20px;
  width: 12px;
  height: 12px;
  background: var(--rose-light);
  border-radius: 50% 0 50% 50%;
  animation: petalFall linear forwards;
  transform-origin: center;
}

@keyframes petalFall {
  0% {
    transform: translateY(0) translateX(0) rotate(0deg) scale(1);
    opacity: var(--opacity, 0.5);
  }
  100% {
    transform: translateY(100vh) translateX(var(--drift, 80px)) rotate(720deg) scale(0.3);
    opacity: 0;
  }
}

.login-wrapper {
  position: relative;
  z-index: 1;
}

.login-card {
  background: var(--white);
  border-radius: 2px;
  box-shadow:
    0 4px 30px var(--shadow),
    0 1px 3px var(--shadow);
  max-width: 440px;
  width: 100%;
  position: relative;
  transition: transform 0.8s cubic-bezier(0.23, 1, 0.32, 1), opacity 0.8s;
}

.login-card.success {
  transform: scale(0.95) translateY(-10px);
  opacity: 0;
}

.login-ornament {
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold-light), var(--gold), var(--gold-light), transparent);
}

.login-content {
  padding: 50px 40px;
  text-align: center;
}

.login-subtitle {
  font-family: var(--font-serif);
  font-weight: 300;
  font-style: italic;
  font-size: 0.95rem;
  color: var(--text-light);
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}

.login-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 2.8rem;
  color: var(--brown);
  line-height: 1.3;
  margin-bottom: 8px;
}

.name-script {
  display: inline-block;
}

.amp {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 300;
  font-size: 1.6rem;
  color: var(--gold);
  margin: 0 8px;
}

.login-date {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: 1.1rem;
  color: var(--gold-dark);
  letter-spacing: 0.2em;
}

.login-divider {
  margin: 30px 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-light));
}

.login-divider::after {
  background: linear-gradient(90deg, var(--gold-light), transparent);
}

.divider-leaf {
  color: var(--gold-light);
  font-size: 1rem;
  margin: 0 15px;
}

.login-form {
  max-width: 300px;
  margin: 0 auto;
}

.login-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 12px;
  letter-spacing: 0.05em;
}

.input-wrapper {
  display: flex;
  border: 1px solid var(--gold-light);
  border-radius: 2px;
  overflow: hidden;
  transition: border-color 0.3s;
}

.input-wrapper:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 169, 110, 0.1);
}

.login-input {
  flex: 1;
  padding: 14px 16px;
  border: none;
  background: transparent;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text);
  outline: none;
  letter-spacing: 0.15em;
}

.login-input::placeholder {
  color: var(--gold-light);
  letter-spacing: 0.3em;
}

.login-btn {
  width: 48px;
  border: none;
  background: var(--gold);
  color: var(--white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s;
}

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

.login-hint {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-top: 12px;
  opacity: 0.7;
}

.login-error {
  font-size: 0.8rem;
  color: #c0392b;
  margin-top: 10px;
  animation: fadeIn 0.3s;
}

.shake {
  animation: shake 0.4s;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}


/* ============================================
   GALLERY PAGE - HERO
   ============================================ */

.hero {
  position: relative;
  height: 100vh;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background:
    linear-gradient(180deg,
      rgba(58, 46, 38, 0.2) 0%,
      rgba(58, 46, 38, 0.35) 50%,
      rgba(58, 46, 38, 0.55) 100%
    ),
    url('../photos/full/wedding-030.jpg') center 30%/cover no-repeat;
  background-attachment: fixed;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at center, transparent 30%, rgba(58, 46, 38, 0.2) 100%);
}

.hero-content {
  position: relative;
  text-align: center;
  color: var(--white);
  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;
  margin-bottom: 15px;
  opacity: 0.9;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(3rem, 8vw, 5.5rem);
  line-height: 1.2;
  margin-bottom: 15px;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.2);
}

.hero-title .amp {
  color: var(--gold-light);
  font-size: clamp(1.5rem, 4vw, 2.5rem);
}

.hero-date {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: 1.3rem;
  letter-spacing: 0.3em;
  opacity: 0.85;
}

.hero-scroll {
  position: absolute;
  bottom: -120px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  opacity: 0.6;
  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;
}

.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--white), 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;
  justify-content: space-between;
  height: 56px;
}

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

.nav-links {
  display: flex;
  gap: 4px;
}

.nav-link {
  text-decoration: none;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 300;
  color: var(--text-light);
  padding: 8px 14px;
  border-radius: 2px;
  transition: all 0.3s;
  letter-spacing: 0.05em;
}

.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;
}

/* Toggle button */
.nav-toggle {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--white);
  background: var(--gold);
  border: none;
  padding: 5px 14px;
  border-radius: 20px;
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: all 0.3s;
  margin-left: 8px;
  white-space: nowrap;
}

.nav-toggle:hover {
  background: var(--gold-dark);
}

.nav-toggle.is-curated {
  background: var(--brown);
}


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

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

.gallery-section {
  padding: 80px 0 40px;
}

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

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

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

.section-title {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  color: var(--brown);
  margin-bottom: 8px;
  letter-spacing: 0.05em;
}

.section-subtitle {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 0.9rem;
  color: var(--text-light);
  letter-spacing: 0.1em;
}

.section-line {
  width: 60px;
  height: 1px;
  background: var(--gold);
  margin: 20px auto 0;
}


/* ============================================
   PHOTO GRID (CSS Grid - chronological order)
   ============================================ */

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

.photo-item {
  position: relative;
  overflow: hidden;
  border-radius: 3px;
  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);
}

/* Hidden items in curated mode */
.photo-item.hidden-curated {
  display: none;
}

.photo-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(58, 46, 38, 0.15) 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.05);
}

.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;
}


/* ============================================
   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;
}

@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-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;
}


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

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

@media (max-width: 768px) {
  .login-content {
    padding: 40px 28px;
  }

  .login-title {
    font-size: 2.2rem;
  }

  /* Mobile: disable background-attachment fixed (iOS doesn't support it) */
  .hero {
    background-attachment: scroll;
  }

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

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

  .nav-links {
    gap: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

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

  .nav-link {
    padding: 6px 10px;
    font-size: 0.7rem;
    white-space: nowrap;
  }

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

  .nav-toggle {
    font-size: 0.65rem;
    padding: 4px 10px;
  }

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

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

  .section-header {
    margin-bottom: 30px;
  }

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

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

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

  .hero {
    min-height: 100svh;
  }

  .hero-title {
    font-size: 2.5rem;
  }

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

  .hero-date {
    font-size: 1rem;
    letter-spacing: 0.2em;
  }

  .nav-brand {
    display: none;
  }

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

  .section-title {
    font-size: 1.6rem;
  }

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