@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,500;0,600;1,500&family=Inter:wght@400;500;600&family=Noto+Sans+Kannada:wght@400;600&display=swap");

:root {
  --bg: #fbf7f1;
  --paper: #ffffff;
  --ink: #3a2e28;
  --muted: #8a7a70;
  --line: #ece3d8;
  --gold: #c08a3e;
  --gold-soft: #f3e4c8;
  --rose: #e9b9a9;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Inter", "Noto Sans Kannada", system-ui, sans-serif;
  --radius: 18px;
  --shadow: 0 10px 30px -12px rgba(80, 50, 30, 0.25);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased;
}
img, video { max-width: 100%; display: block; }
a { color: var(--gold); }
button { font: inherit; cursor: pointer; }
.wrap { max-width: 720px; margin: 0 auto; padding: 0 20px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0; }
h2 { font-size: 2rem; text-align: center; margin-bottom: 6px; }
.sub { text-align: center; color: var(--muted); margin: 0 0 28px; }
section { padding: 56px 0; }
.hidden { display: none !important; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px; justify-content: center;
  border: 0; border-radius: 999px; padding: 14px 26px;
  background: var(--ink); color: #fff; font-weight: 500; text-decoration: none;
  box-shadow: var(--shadow); transition: transform .15s ease;
}
.btn:active { transform: scale(.97); }
.btn.gold { background: var(--gold); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); box-shadow: none; }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 92vh; display: grid; place-items: end center; overflow: hidden; color: #fff; text-align: center; }
.hero .bg { position: absolute; inset: 0; background-size: cover; background-position: center; transform: scale(1.06); animation: breathe 18s ease-in-out infinite alternate; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,12,8,.05) 20%, rgba(20,12,8,.75) 85%); }
.hero .inner { position: relative; z-index: 1; padding: 0 22px 56px; max-width: 640px; }
.hero .kicker { letter-spacing: .25em; text-transform: uppercase; font-size: .72rem; opacity: .85; }
.hero h1 { font-size: clamp(2.6rem, 9vw, 4rem); margin: 10px 0 4px; }
.hero .nick { font-family: var(--serif); font-style: italic; font-size: 1.3rem; opacity: .9; }
.hero .dates { margin: 14px 0 4px; font-size: 1.02rem; }
.hero .span { font-family: var(--serif); font-size: 1.2rem; color: var(--gold-soft); }
.hero .tag { margin: 16px auto 26px; opacity: .92; max-width: 460px; }
.hero .actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero .btn.ghost { color: #fff; border-color: rgba(255,255,255,.5); }
@keyframes breathe { to { transform: scale(1.14); } }

/* ---------- Life journey timeline ---------- */
.journey { position: relative; }
.journey::before { content: ""; position: absolute; left: 19px; top: 0; bottom: 0; width: 2px; background: linear-gradient(var(--gold-soft), var(--gold), var(--gold-soft)); }
.group { position: relative; margin: 34px 0 14px 52px; font-family: var(--serif); font-size: 1.35rem; color: var(--gold); }
.group::before { content: ""; position: absolute; left: -40px; top: 7px; width: 16px; height: 16px; border-radius: 50%; background: var(--bg); border: 3px solid var(--gold); }
/* month strip + photo grids */
.ages { position: sticky; top: 0; z-index: 5; display: flex; gap: 8px; overflow-x: auto; padding: 10px 2px; margin: 0 -4px 6px; background: var(--bg); scrollbar-width: none; }
.ages::-webkit-scrollbar { display: none; }
.ages a { flex: none; padding: 6px 12px; border-radius: 999px; background: #f2ece5; color: var(--muted); font-size: .82rem; font-weight: 600; text-decoration: none; }
.ages a.on { background: var(--gold); color: #fff; }
.age-group { scroll-margin-top: 60px; }
.group .count { font-family: var(--sans, inherit); font-size: .8rem; color: var(--muted); margin-left: 6px; }
.mgrid { margin-left: 52px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; border-radius: 14px; overflow: hidden; }
@media (min-width: 700px) { .mgrid { grid-template-columns: repeat(4, 1fr); } }
.tile { position: relative; aspect-ratio: 1; padding: 0; border: 0; background: #e9e2d9; cursor: pointer; overflow: hidden; }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.tile:active img { transform: scale(.96); }
.tile .vt { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; font-size: 11px; display: grid; place-items: center; padding-left: 2px; }
.tile .tt { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 6px 5px; font-size: .7rem; color: #fff; text-align: left; background: linear-gradient(transparent, rgba(0,0,0,.6)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.moment { margin: 0 0 22px 52px; background: var(--paper); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.moment .media { position: relative; aspect-ratio: 4/5; background: #eee; cursor: pointer; overflow: hidden; }
.moment .media img, .moment .media video { width: 100%; height: 100%; object-fit: cover; }
.moment .play { position: absolute; inset: 0; display: grid; place-items: center; }
.moment .play span { width: 64px; height: 64px; border-radius: 50%; background: rgba(255,255,255,.88); display: grid; place-items: center; font-size: 22px; padding-left: 5px; box-shadow: var(--shadow); }
.moment .body { padding: 16px 18px 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.chip { font-size: .78rem; padding: 4px 10px; border-radius: 999px; background: var(--gold-soft); color: #7a5420; font-weight: 600; }
.chip.date { background: #f2ece5; color: var(--muted); font-weight: 500; }
.chip.sample { background: #fde8e3; color: #a24c35; }
.moment h3 { font-size: 1.45rem; margin-bottom: 4px; }
.moment p { margin: 0; color: #5c4d45; }

/* ---------- Lamp ---------- */
.hero .blessing { margin: 10px 0 18px; font-family: var(--serif); font-style: italic; font-size: 1.05rem; opacity: .9; }
.emoji-art { width: 120px; height: 120px; margin: 10px auto 0; display: grid; place-items: center; font-size: 64px; border-radius: 50%; background: radial-gradient(#ffe7b3, transparent 70%); }
.lamp-sec { background: linear-gradient(#fbf7f1, #f6ead6); text-align: center; }
.deepa { width: 120px; height: 140px; margin: 0 auto 10px; position: relative; }
.deepa .flame { transform-origin: 60px 62px; animation: flicker 1.8s ease-in-out infinite; opacity: .15; transition: opacity .8s; }
.deepa.lit .flame { opacity: 1; }
.deepa .glow { opacity: 0; transition: opacity 1s; }
.deepa.lit .glow { opacity: 1; animation: glow 3s ease-in-out infinite; }
@keyframes flicker { 0%,100% { transform: scale(1) rotate(-1deg); } 50% { transform: scale(1.06, .95) rotate(2deg); } }
@keyframes glow { 50% { opacity: .65; } }
.lamp-count { font-family: var(--serif); font-size: 1.3rem; margin: 6px 0 18px; }

/* ---------- Letters / cards ---------- */
.card { background: var(--paper); border-radius: var(--radius); padding: 22px 22px 18px; box-shadow: var(--shadow); margin-bottom: 18px; }
.letter { font-family: var(--serif); font-size: 1.22rem; line-height: 1.55; white-space: pre-line; }
.letter .from { font-family: var(--sans); font-size: .85rem; color: var(--muted); margin-top: 12px; }
.ideas { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 20px; }
.ideas div { background: var(--paper); border: 1px dashed var(--line); border-radius: 14px; padding: 12px; font-size: .9rem; text-align: center; }

/* ---------- Forms ---------- */
form.card { display: grid; gap: 12px; }
input, textarea, select {
  width: 100%; font: inherit; color: var(--ink); background: #fffdf9;
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
}
textarea { min-height: 110px; resize: vertical; }
label { font-size: .85rem; color: var(--muted); display: grid; gap: 6px; }
.note { font-size: .85rem; color: var(--muted); text-align: center; }

footer { text-align: center; padding: 40px 20px 60px; color: var(--muted); font-size: .85rem; }
footer .brand { font-family: var(--serif); font-size: 1.4rem; color: var(--ink); }

/* ---------- Rewind theatre ---------- */
.theatre { position: fixed; inset: 0; z-index: 50; background: #0d0907; color: #fff; display: flex; flex-direction: column; overflow: hidden; }
.theatre .stage { position: relative; flex: 1; overflow: hidden; }
.theatre .blur { position: absolute; inset: -40px; background-size: cover; background-position: center; filter: blur(30px) brightness(.45); transition: background-image .6s; }
.theatre .frame { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; transition: opacity .7s ease; }
.theatre .frame.on { opacity: 1; }
.theatre .frame img, .theatre .frame video { max-width: 100%; max-height: 100%; object-fit: contain; }
.theatre .frame.on img { animation: kenburns 9s ease-out forwards; }
@keyframes kenburns { from { transform: scale(1.0); } to { transform: scale(1.08); } }
.theatre .vignette { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at center, transparent 45%, rgba(0,0,0,.65)); }
.theatre .grain { position: absolute; inset: -50%; pointer-events: none; opacity: .09;
  background-image: repeating-radial-gradient(circle at 17% 32%, #fff 0 1px, transparent 1px 3px);
  animation: grain .5s steps(4) infinite; }
@keyframes grain { 25% { transform: translate(3%, -2%); } 50% { transform: translate(-2%, 3%); } 75% { transform: translate(2%, 2%); } }
/* VHS-style streaks while rewinding */
.theatre .streaks { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .2s;
  background: repeating-linear-gradient(180deg, transparent 0 22px, rgba(255,255,255,.18) 22px 24px, transparent 24px 60px); }
.theatre.seeking .streaks { opacity: 1; animation: streak .25s linear infinite; }
.theatre.seeking.rev .streaks { animation-direction: reverse; }
@keyframes streak { to { background-position: 0 60px; } }
.theatre .rewind-badge { position: absolute; top: 16px; left: 16px; font: 600 .8rem/1 var(--sans); letter-spacing: .15em; padding: 7px 10px; border-radius: 6px; background: rgba(0,0,0,.45); }
.theatre .close { z-index: 3; position: absolute; top: 12px; right: 12px; width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(0,0,0,.45); color: #fff; font-size: 20px; }
.theatre .unmute { position: absolute; top: 12px; right: 62px; height: 42px; border-radius: 21px; border: 0; padding: 0 14px; background: rgba(0,0,0,.45); color: #fff; font-size: .85rem; }

.theatre .info { padding: 18px 22px 8px; background: linear-gradient(transparent, rgba(0,0,0,.4)); text-align: center; }
.theatre .age { font-family: var(--serif); font-size: clamp(1.7rem, 7vw, 2.6rem); color: #f3d9a8; font-variant-numeric: tabular-nums; min-height: 1.2em; }
.theatre .tdate { font-size: .9rem; opacity: .75; margin-top: 2px; font-variant-numeric: tabular-nums; }
.theatre .ttitle { font-family: var(--serif); font-size: 1.35rem; margin-top: 10px; }
.theatre .tcap { font-size: .92rem; opacity: .8; max-width: 520px; margin: 4px auto 0; min-height: 1.4em; }

.theatre .bar { padding: 8px 22px 6px; }
.track { position: relative; height: 26px; }
.track input[type=range] { position: absolute; inset: 0; width: 100%; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; padding: 0; border: 0; }
.track input[type=range]::-webkit-slider-runnable-track { height: 4px; background: rgba(255,255,255,.25); border-radius: 2px; }
.track input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #f3d9a8; margin-top: -7px; box-shadow: 0 0 0 4px rgba(243,217,168,.25); }
.track input[type=range]::-moz-range-track { height: 4px; background: rgba(255,255,255,.25); }
.track input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #f3d9a8; border: 0; }
.track .marks { position: absolute; left: 9px; right: 9px; top: 6px; height: 14px; pointer-events: none; }
.track .marks i { position: absolute; width: 2px; height: 14px; background: rgba(255,255,255,.5); transform: translateX(-1px); border-radius: 1px; }
.track .marks i.v { background: #e9b9a9; }
.ends { display: flex; justify-content: space-between; font-size: .72rem; opacity: .6; margin-top: 2px; }

.controls { display: flex; justify-content: center; align-items: center; gap: 14px; padding: 8px 0 calc(16px + env(safe-area-inset-bottom)); }
.controls button { border: 0; background: rgba(255,255,255,.1); color: #fff; width: 50px; height: 50px; border-radius: 50%; font-size: 18px; }
.controls .main { width: 64px; height: 64px; background: #f3d9a8; color: #2b1d14; font-size: 22px; }
.controls .dir { width: auto; padding: 0 16px; border-radius: 25px; font-size: .82rem; letter-spacing: .05em; }

.ending { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; background: rgba(13,9,7,.82); opacity: 0; pointer-events: none; transition: opacity 1s; }
.ending.on { opacity: 1; pointer-events: auto; }
.ending h3 { font-size: 2.2rem; color: #f3d9a8; }
.ending p { opacity: .85; }

/* ---------- Portal home ---------- */
.portal-hero { text-align: center; padding: 80px 20px 30px; }
.portal-hero h1 { font-size: clamp(2.8rem, 10vw, 4.4rem); }
.portal-hero p { color: var(--muted); max-width: 480px; margin: 12px auto 26px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.mcard { display: block; text-decoration: none; color: inherit; background: var(--paper); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.mcard .img { aspect-ratio: 4/5; background-size: cover; background-position: center; }
.mcard .b { padding: 14px 16px 16px; }
.mcard h3 { font-size: 1.4rem; }
.mcard small { color: var(--muted); }
