/* ============ Keva Garg Memorial ============ */
:root {
  --bg: #0d0f1a;
  --bg2: #12141f;
  --ink: #f5efe0;
  --muted: #cfc4ae;
  --dim: #8a8272;
  --gold: #c9a96a;
  --gold-soft: #b8a888;
  --line: rgba(201, 169, 106, 0.25);
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Inter', system-ui, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.7;
  overflow-x: hidden;
}

/* ---------- Nav ---------- */
#nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem 2rem;
  background: linear-gradient(to bottom, rgba(13,15,26,.85), transparent);
  transition: background .4s ease;
}
#nav.solid { background: rgba(13,15,26,.96); border-bottom: 1px solid rgba(201,169,106,.15); }
#nav .brand {
  font-family: var(--serif); font-size: 1.4rem; color: var(--ink);
  text-decoration: none; letter-spacing: .04em;
}
#nav .links { display: flex; gap: 1.6rem; }
#nav .links a {
  color: var(--muted); text-decoration: none; font-size: .82rem;
  letter-spacing: .14em; text-transform: uppercase;
  transition: color .3s;
}
#nav .links a:hover { color: var(--gold); }
@media (max-width: 640px) { #nav .links { display: none; } }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  text-align: center; overflow: hidden;
  background: radial-gradient(ellipse at 50% 35%, #1a1d30 0%, var(--bg) 65%);
}
.hero-bg { position: absolute; inset: 0; }
.hero-bg .hb {
  position: absolute; inset: 0;
  background-size: cover; background-position: center 25%;
  opacity: 0; transition: opacity 2.5s ease;
  animation: kenburns 24s ease-in-out infinite alternate;
}
.hero-bg .hb.on { opacity: 1; }
@keyframes kenburns {
  from { transform: scale(1); }
  to { transform: scale(1.12); }
}
.hero-veil {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at center, rgba(13,15,26,.25) 0%, rgba(13,15,26,.88) 100%),
    linear-gradient(to bottom, rgba(13,15,26,.55), rgba(13,15,26,.35) 40%, rgba(13,15,26,.92));
}
.hero-inner { position: relative; z-index: 2; padding: 6rem 1.5rem 4rem; max-width: 800px; }

.eyebrow {
  font-size: .78rem; letter-spacing: .45em; text-transform: uppercase;
  color: var(--gold-soft); margin-bottom: 1.4rem; font-weight: 400;
}
.hero h1 {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(3rem, 9vw, 5.5rem); line-height: 1.05; color: var(--ink);
  text-shadow: 0 2px 30px rgba(0,0,0,.6);
}
.dates {
  margin-top: 1rem; font-family: var(--serif); font-size: 1.25rem;
  letter-spacing: .12em; color: var(--muted);
}
.divider {
  display: flex; align-items: center; justify-content: center;
  gap: 1rem; margin: 1.8rem auto; max-width: 280px;
}
.divider::before, .divider::after {
  content: ''; flex: 1; height: 1px;
}
.divider::before { background: linear-gradient(90deg, transparent, var(--gold-soft)); }
.divider::after { background: linear-gradient(90deg, var(--gold-soft), transparent); }
.divider span { color: var(--gold); font-size: 1rem; }
.tagline {
  font-family: var(--serif); font-style: italic;
  font-size: clamp(1.15rem, 3vw, 1.5rem); color: var(--muted);
}
.scroll-cue {
  display: inline-block; margin-top: 3rem; width: 26px; height: 44px;
  border: 1.5px solid var(--gold-soft); border-radius: 14px; position: relative;
}
.scroll-cue span {
  position: absolute; top: 8px; left: 50%; width: 4px; height: 9px;
  margin-left: -2px; border-radius: 2px; background: var(--gold);
  animation: cue 2s ease-in-out infinite;
}
@keyframes cue { 0%,100% { transform: translateY(0); opacity: 1; } 50% { transform: translateY(12px); opacity: .2; } }

/* ---------- Sections ---------- */
.section { padding: 6rem 1.5rem; }
.section.alt { background: var(--bg2); }
.wrap { max-width: 1100px; margin: 0 auto; }
.wrap.narrow { max-width: 760px; }
.wrap.center { text-align: center; }
.section h2 {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(2rem, 5vw, 3rem); text-align: center; color: var(--ink);
}
.section .eyebrow { text-align: center; }
.section-sub { text-align: center; color: var(--muted); font-family: var(--serif); font-size: 1.2rem; font-style: italic; margin-bottom: 2.5rem; }
.prose p { margin-bottom: 1.4rem; color: #ddd5c2; font-size: 1.06rem; }
.prose p em { color: var(--gold); }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .9s ease, transform .9s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ---------- Slideshow ---------- */
.slideshow {
  position: relative; max-width: 900px; margin: 0 auto;
  aspect-ratio: 16 / 10; border-radius: 10px; overflow: hidden;
  background: #080910; border: 1px solid rgba(201,169,106,.18);
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.slides, .slides .slide { position: absolute; inset: 0; }
.slides .slide {
  width: 100%; height: 100%; object-fit: contain; background: #080910;
  opacity: 0; transition: opacity 1.4s ease; cursor: zoom-in;
}
.slides .slide.on { opacity: 1; }
.slide-empty {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  text-align: center; color: var(--dim); font-family: var(--serif); font-size: 1.25rem; font-style: italic; padding: 2rem;
}
.s-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid rgba(201,169,106,.4); background: rgba(13,15,26,.55);
  color: var(--ink); font-size: 1.5rem; cursor: pointer; z-index: 3;
  transition: background .3s;
}
.s-btn:hover { background: rgba(201,169,106,.25); }
.s-btn.prev { left: 14px; } .s-btn.next { right: 14px; }
.s-bar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
  display: flex; align-items: center; gap: 1rem;
  padding: .7rem 1.1rem;
  background: linear-gradient(to top, rgba(8,9,16,.85), transparent);
}
.play-btn {
  border: 1px solid rgba(201,169,106,.4); background: transparent; color: var(--ink);
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: .8rem;
}
.counter { font-size: .85rem; letter-spacing: .15em; color: var(--muted); }
.dots { display: flex; gap: .45rem; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; max-width: 60%; }
.dots button {
  width: 9px; height: 9px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(245,239,224,.25); transition: background .3s; padding: 0;
}
.dots button.on { background: var(--gold); }
.hint { text-align: center; color: var(--dim); font-size: .85rem; margin-top: 1.2rem; letter-spacing: .06em; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 100; background: rgba(5,6,10,.94);
  display: flex; align-items: center; justify-content: center; flex-direction: column;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 92vw; max-height: 84vh; border-radius: 6px; box-shadow: 0 30px 80px rgba(0,0,0,.7); }
.lb-close {
  position: absolute; top: 18px; right: 22px; background: none; border: none;
  color: var(--ink); font-size: 1.6rem; cursor: pointer;
}
.lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--ink); font-size: 3rem; cursor: pointer; padding: 1rem;
}
.lb-prev { left: 8px; } .lb-next { right: 8px; }
.lb-count { margin-top: 1rem; color: var(--muted); letter-spacing: .2em; font-size: .85rem; }

/* ---------- Message cards ---------- */
.cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.4rem; margin-top: 1rem;
}
.card {
  background: rgba(201,169,106,.05); border: 1px solid var(--line);
  border-radius: 10px; padding: 2rem 1.8rem; position: relative;
  transition: transform .35s ease, border-color .35s ease;
}
.card:hover { transform: translateY(-5px); border-color: rgba(201,169,106,.5); }
.card::before {
  content: '“'; position: absolute; top: .4rem; left: 1.1rem;
  font-family: var(--serif); font-size: 3rem; color: rgba(201,169,106,.35);
}
.card p { font-family: var(--serif); font-size: 1.25rem; font-style: italic; color: #e6dcc6; }

/* ---------- Candle ---------- */
.candle-row {
  display: flex; flex-wrap: wrap; gap: 1.1rem; justify-content: center;
  min-height: 90px; margin: 2rem 0 1.5rem;
}
.flame-diya { text-align: center; animation: fadeUp .8s ease; }
.flame-diya .fl {
  font-size: 2.4rem; display: block;
  animation: flicker 2.6s ease-in-out infinite;
  filter: drop-shadow(0 0 14px rgba(255,180,90,.65));
}
@keyframes flicker {
  0%,100% { transform: scale(1) rotate(-1deg); opacity: .95; }
  30% { transform: scale(1.08) rotate(1.5deg); opacity: 1; }
  60% { transform: scale(.96) rotate(-1deg); opacity: .88; }
}
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.btn {
  font-family: var(--sans); font-size: .95rem; letter-spacing: .08em;
  color: var(--bg); background: var(--gold); border: none; border-radius: 999px;
  padding: .9rem 2.2rem; cursor: pointer; transition: transform .3s, box-shadow .3s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(201,169,106,.35); }
.candle-count { margin-top: 1.2rem; color: var(--muted); font-family: var(--serif); font-size: 1.15rem; font-style: italic; }

/* ---------- Footer ---------- */
footer { padding: 4.5rem 1.5rem 3rem; text-align: center; border-top: 1px solid rgba(201,169,106,.15); }
.f-name { font-family: var(--serif); font-size: 1.8rem; color: var(--ink); }
.f-dates { color: var(--muted); letter-spacing: .14em; margin-top: .4rem; font-size: .9rem; }
.f-line { font-family: var(--serif); font-style: italic; font-size: 1.2rem; color: var(--gold-soft); margin-top: .6rem; }
.f-src { margin-top: 1.6rem; font-size: .78rem; color: var(--dim); }
.f-src a { color: var(--gold-soft); }

@media (max-width: 640px) {
  .section { padding: 4rem 1.1rem; }
  .slideshow { aspect-ratio: 4 / 3; }
}

/* discourage casual image saving in gallery areas */
#gallery img, #heroBg, #lightbox img {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
#gallery img, #lightbox img {
  -webkit-user-drag: none;
}

/* fix: empty-state must respect [hidden]; hide dot nav (423 dots overflow the layout) */
.slide-empty[hidden] { display: none !important; }
.dots { display: none !important; }

/* ---------- Guestbook ---------- */
.guest-form { max-width: 640px; margin: 2.5rem auto 0; text-align: left; }
.g-row { margin-bottom: 1.1rem; }
.g-row label { display: block; margin-bottom: .4rem; font-size: .95rem; letter-spacing: .04em; }
.g-row input[type="text"], .g-row textarea {
  width: 100%; box-sizing: border-box;
  background: rgba(255,255,255,.04); border: 1px solid rgba(201,169,106,.25);
  border-radius: 8px; color: var(--ink); padding: .8rem 1rem;
  font: inherit; resize: vertical;
}
.g-row input:focus, .g-row textarea:focus { outline: none; border-color: rgba(201,169,106,.6); }
.hp { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.form-note { min-height: 1.4em; color: var(--gold); font-style: italic; }
.guest-card footer { color: var(--gold); font-style: italic; margin-top: .6rem; }
