@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, .tile video { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; pointer-events: none; }
.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); }

/* ---------- Private page: access code ---------- */
.gate { max-width: 460px; margin: 0 auto; padding: 70px 20px 60px; text-align: center; }
.gate .kicker { letter-spacing: .3em; text-transform: uppercase; font-size: .75rem; color: var(--muted); }
.gate h1 { font-size: 2.6rem; margin: 6px 0 4px; }
.gate .card { text-align: left; margin-top: 18px; }
.gate .ask-btns { display: flex; gap: 10px; flex-wrap: wrap; }

/* "Who can see this page" choices */
.choice { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 2px solid var(--line); border-radius: 14px; margin-bottom: 10px; cursor: pointer; background: #fff; }
.choice.on { border-color: var(--gold); background: #fffaf2; }
.choice input { margin-top: 4px; width: auto; }
.private-fields { display: grid; gap: 4px; padding: 6px 2px 12px; }

/* ---------- Shared with him ---------- */
.since { background: linear-gradient(#fbf7f1, #f7efe3); }
.share { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; margin: 0 0 16px; }
.share img, .share video { width: 100%; border-radius: 12px; display: block; margin: 6px 0 8px; background: #000; max-height: 70vh; object-fit: contain; }
.share-text { margin: 4px 0 0; font-size: 1.05rem; line-height: 1.55; white-space: pre-wrap; }
.share .from { margin-top: 6px; color: var(--muted); font-style: italic; }

/* ---------- Birthday ---------- */
.bday-banner { display: flex; gap: 12px; align-items: center; text-align: left; background: rgba(255,255,255,.92); color: var(--ink); border-radius: 16px; padding: 12px 14px; margin: 0 auto 18px; max-width: 460px; box-shadow: var(--shadow); }
.bday-banner a { color: var(--gold); font-weight: 600; }
.bday-banner.soon { background: rgba(255,255,255,.8); }
.bday-cake { font-size: 2.2rem; animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-4px); } }

/* ---------- On this day ---------- */
.otd { display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; border: 0; background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 10px; margin: 0 0 18px; color: var(--ink); }
.otd img, .otd video { width: 84px; height: 84px; object-fit: cover; border-radius: 12px; flex: none; pointer-events: none; }
.otd-text strong { font-family: var(--serif); font-size: 1.2rem; color: var(--gold); }
.voice { display: flex; gap: 8px; align-items: center; background: #f6efe4; border-radius: 999px; padding: 6px 10px; margin: 6px 0 8px; }
.voice audio { width: 100%; height: 36px; }

/* ---------- Birthday film ---------- */
.bfilm { position: fixed; inset: 0; z-index: 60; background: #120d09; overflow: hidden; color: #fff; }
.bf-slide { position: absolute; inset: 0; background: center/cover no-repeat; opacity: 0; transform: scale(1.12); transition: opacity 1.4s ease; }
.bf-slide.on { opacity: 1; animation: kenburns 7s ease-out forwards; }
@keyframes kenburns { from { transform: scale(1.12) translate(1.5%, 1%); } to { transform: scale(1) translate(0, 0); } }
.bf-shade { position: absolute; inset: 0; background: linear-gradient(transparent 45%, rgba(0,0,0,.65)); }
.bf-text { position: absolute; left: 0; right: 0; bottom: 12%; text-align: center; padding: 0 24px; }
.bf-line { font-family: var(--serif); font-size: clamp(1.7rem, 7vw, 2.8rem); text-shadow: 0 2px 14px rgba(0,0,0,.6); opacity: 0; }
.bf-line.in { animation: rise 1.2s ease forwards; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.bf-balloons span { position: absolute; bottom: -60px; font-size: 2rem; animation: float linear infinite; opacity: .9; }
@keyframes float { from { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-55vh) rotate(6deg); } to { transform: translateY(-115vh) rotate(-6deg); } }
.bf-end { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; padding: 24px; background: rgba(18,12,8,.86); animation: rise 1s ease; z-index: 1; }
.bf-end h2 { color: #fff; font-size: clamp(1.8rem, 7vw, 2.6rem); margin: 6px 0 4px; }
.bf-end p { color: #f3e6d1; margin: 0 0 18px; }
.bf-cake { margin: 0 auto; font-size: 3rem; cursor: pointer; display: grid; gap: 6px; filter: grayscale(.6) brightness(.8); transition: filter .6s; }
.bf-cake span { font-size: .95rem; color: #f3e6d1; }
.bf-cake.lit { filter: none; animation: bob 2.4s ease-in-out infinite; }
.bf-close { position: absolute; top: 14px; right: 14px; z-index: 2; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(0,0,0,.45); color: #fff; font-size: 1.2rem; }
.bfilm .hidden { display: none; }

.bf-sheet { position: absolute; inset: 0; z-index: 3; background: rgba(0,0,0,.55); display: flex; align-items: flex-end; }
.bf-sheet-in { width: 100%; max-width: 520px; margin: 0 auto; background: #241910; border-radius: 18px 18px 0 0; padding: 18px; display: grid; gap: 10px; color: #fff; }
.bf-sheet-in .btn.ghost { color: #fff; border-color: rgba(255,255,255,.5); }
.bf-start { display: grid; place-content: center; text-align: center; background: radial-gradient(#3a2614, #120d09); }
.bf-start h2 { color: #fff; margin: 8px 0 18px; }

/* ---------- Page tabs ---------- */
body.has-ptabbar { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
.ptabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: space-around; background: rgba(255,255,255,.96);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: 0 -2px 14px rgba(0,0,0,.08); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
.ptabbar button { flex: 1; max-width: 140px; border: 0; background: none; display: grid; justify-items: center; gap: 2px; font-size: .74rem; color: var(--muted); padding: 4px 0; }
.ptabbar button span { font-size: 1.3rem; filter: grayscale(1); opacity: .65; }
.ptabbar button.on { color: var(--ink); font-weight: 600; }
.ptabbar button.on span { filter: none; opacity: 1; }
.pquick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pquick button { display: grid; justify-items: center; gap: 2px; padding: 18px 8px; border: 0; border-radius: 16px; background: var(--paper); box-shadow: var(--shadow); color: var(--ink); text-align: center; }
.pquick button span { font-size: 1.7rem; margin-bottom: 4px; }
.pquick button strong { font-size: .95rem; font-weight: 600; }
.pquick button small { color: var(--muted); font-size: .8rem; }
.pseg { display: flex; background: #f2ece5; border-radius: 12px; padding: 4px; margin: 18px 0 0; }
.pseg button { flex: 1; border: 0; background: none; border-radius: 9px; padding: 10px 6px; font-size: .92rem; color: var(--muted); }
.pseg button.on { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 4px rgba(0,0,0,.08); }

/* ---------- Life as a story ---------- */
.glance { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; background: var(--paper); border-radius: 16px; box-shadow: var(--shadow); padding: 14px 6px; margin: 0 0 8px; }
.glance strong { display: block; font-family: var(--serif); font-size: 1.35rem; line-height: 1.1; }
.glance span { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.chap-nav a { --c: var(--gold); }
.chap-nav a.on { background: var(--c); }
.story { position: relative; padding-left: 26px; }
.story::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 40px; width: 2px; background: linear-gradient(var(--gold-soft), var(--line)); }
.chapter { position: relative; margin: 30px 0 44px; scroll-margin-top: 64px; }
.chapter::before { content: ""; position: absolute; left: -26px; top: 4px; width: 16px; height: 16px; border-radius: 50%; background: var(--bg); border: 3px solid var(--c); }
.ch-eyebrow { font-size: .74rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--c, var(--gold)); }
.chapter h3 { font-size: 1.9rem; margin: 4px 0 2px; }
.ch-meta { color: var(--muted); font-size: .88rem; }
.ch-lines { font-family: var(--serif); font-style: italic; font-size: 1.05rem; line-height: 1.5; color: #5d4d3c; margin: 8px 0 0; max-width: 34em; }
.ch-bday { display: inline-block; margin-top: 10px; background: #fff3e0; color: #9a5b12; border-radius: 999px; padding: 6px 12px; font-size: .88rem; font-weight: 600; }
.collage { position: relative; display: grid; gap: 6px; margin-top: 14px; grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; aspect-ratio: 3 / 2.6; border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); }
.collage.n0 { grid-template-columns: 1fr; grid-template-rows: 1fr; aspect-ratio: 4 / 5; max-width: 420px; }
.collage.n1 { grid-template-rows: 1fr; aspect-ratio: 3 / 2.2; }
.collage .hero { grid-row: 1 / -1; }
.sp { position: relative; padding: 0; border: 0; background: #e9e2d9; overflow: hidden; cursor: pointer; min-height: 0; }
.sp img, .sp video { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.sp .vt { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; font-size: 11px; display: grid; place-items: center; padding-left: 2px; }
.ch-cap { position: absolute; left: 0; bottom: 0; width: calc(66.66% - 3px); padding: 34px 14px 12px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.62)); pointer-events: none; font-family: var(--serif); font-size: 1.2rem; line-height: 1.2; }
.collage.n0 .ch-cap { width: 100%; }
.ch-cap small { display: block; font-family: var(--sans); font-size: .76rem; opacity: .85; margin-top: 2px; }
.ch-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.ch-play { border: 0; border-radius: 999px; padding: 9px 16px; background: var(--c, var(--gold)); color: #fff; font-weight: 600; font-size: .9rem; }
.ch-foot .note { margin: 0; font-size: .82rem; }
.ch-more { margin-top: 10px; }
.ch-more summary { color: var(--muted); font-size: .88rem; cursor: pointer; list-style: none; }
.ch-more summary::before { content: "＋ "; }
.ch-more[open] summary::before { content: "－ "; }
.strip { display: flex; gap: 6px; overflow-x: auto; padding: 10px 0 4px; scrollbar-width: none; }
.strip .sp { flex: none; width: 92px; height: 116px; border-radius: 10px; }
.ch-end { position: relative; text-align: center; padding: 10px 0 20px; }
.ch-end::before { content: "✦"; position: absolute; left: -26px; top: 0; width: 16px; text-align: center; color: var(--gold); }
.ch-end p { font-family: var(--serif); font-size: 1.35rem; margin: 6px 0 16px; }
@media (min-width: 700px) { .chapter h3 { font-size: 2.2rem; } }

/* ---------- Gift shelf ---------- */
.shelf { background: linear-gradient(#f7eee2, #f1e3cf); border-radius: 18px; padding: 16px 14px 8px; box-shadow: inset 0 2px 10px rgba(120,80,40,.08); }
.shelf-row { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; align-items: end; min-height: 78px; padding-bottom: 12px; margin-bottom: 10px; }
.shelf-row::after { content: ""; position: absolute; left: -6px; right: -6px; bottom: 0; height: 10px; border-radius: 4px; background: linear-gradient(#c79a63, #a97b45); box-shadow: 0 4px 6px -2px rgba(90,55,20,.35); }
.gift { border: 0; background: none; padding: 0 0 2px; font-size: 2.6rem; line-height: 1; cursor: pointer; transition: transform .2s; }
.gift.on { transform: translateY(-6px) scale(1.08); }
.gift span { display: inline-block; filter: drop-shadow(0 4px 3px rgba(80,50,20,.25)); }
.shelf-empty { grid-column: 1 / -1; text-align: center; color: var(--muted); font-style: italic; margin: 0 0 6px; font-family: var(--serif); font-size: 1.1rem; }
.gift-note { display: flex; gap: 12px; align-items: flex-start; background: var(--paper); border-radius: 14px; box-shadow: var(--shadow); padding: 12px 14px; margin-top: 12px; text-align: left; }
.gift-note .gn-pic { font-size: 2rem; }
.gift-note p { margin: 6px 0 0; font-family: var(--serif); font-size: 1.1rem; }
.gsheet { position: fixed; inset: 0; z-index: 45; background: rgba(30,20,12,.5); display: flex; align-items: flex-end; justify-content: center; }
.gsheet-in { position: relative; width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; background: var(--bg); border-radius: 22px 22px 0 0; padding: 22px 18px calc(18px + env(safe-area-inset-bottom)); animation: up .25s ease; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.gsheet-in h3 { font-size: 1.7rem; text-align: center; }
.gsheet-in > .note { text-align: center; margin: 4px 0 14px; }
.gs-close { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: #efe6db; }
.gpick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.gpick button { display: grid; justify-items: center; gap: 4px; padding: 12px 4px; border: 2px solid transparent; border-radius: 14px; background: var(--paper); box-shadow: 0 2px 8px rgba(80,50,30,.08); font-size: .8rem; color: var(--ink); }
.gpick button span { font-size: 2rem; line-height: 1.1; }
.gpick button.on { border-color: var(--gold); background: #fff8ec; }
.gform label { display: block; text-align: left; }
.gform .btn { width: 100%; margin-top: 6px; }
.gform .btn:disabled { opacity: .55; }
.gdone { text-align: center; padding: 10px 0; }
.gdone h3 { margin-top: 14px; }
.gbox { position: relative; width: 120px; height: 110px; margin: 10px auto 0; }
.gbox .gpic { position: absolute; left: 0; right: 0; bottom: 6px; font-size: 4rem; animation: popup .9s .5s ease both; }
.gbox .lid { position: absolute; left: 10px; right: 10px; bottom: 0; height: 56px; border-radius: 8px; background: repeating-linear-gradient(90deg, #c8553d 0 44px, #e9c46a 44px 56px); animation: lidaway .6s .2s ease forwards; }
@keyframes lidaway { to { transform: translateY(30px) scaleY(.4); opacity: 0; } }
@keyframes popup { from { transform: translateY(30px) scale(.4); opacity: 0; } 70% { transform: translateY(-8px) scale(1.1); opacity: 1; } }

/* ---------- Today with him ---------- */
.today { border-radius: 20px; padding: 18px 18px 10px; box-shadow: var(--shadow); text-align: left; transition: background 1s; }
.today.tod-morning { background: linear-gradient(135deg, #fff7e6, #fde8c8); }
.today.tod-day { background: linear-gradient(135deg, #fffaf2, #f3ead9); }
.today.tod-evening { background: linear-gradient(135deg, #fdeee2, #f4d6c4); }
.today.tod-night { background: linear-gradient(135deg, #2d2a3e, #403856); color: #f3ecff; }
.today.tod-night .t-row { color: #f3ecff; border-color: rgba(255,255,255,.14); }
.today.tod-night .t-row em { color: #cfc6e6; }
.t-greet { font-family: var(--serif); font-size: 1.6rem; line-height: 1.2; }
.t-age { margin-top: 4px; font-size: .95rem; opacity: .85; }
.t-here { margin-top: 10px; font-size: .9rem; font-weight: 600; animation: breathe 3s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .6; } }
.t-row { display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left; background: none; border: 0; border-top: 1px solid rgba(120,80,40,.12); padding: 12px 0; margin-top: 10px; color: var(--ink); font-size: .93rem; line-height: 1.4; }
.t-row + .t-row { margin-top: 0; }
.t-row em { font-style: normal; color: var(--muted); font-size: .85rem; }
footer .care { max-width: 420px; margin: 0 auto 18px; font-size: .85rem; line-height: 1.5; }

.t-visit { border-top: 1px solid rgba(120,80,40,.12); margin-top: 10px; padding-top: 12px; }
.tod-night .t-visit { border-color: rgba(255,255,255,.14); }
.t-hi { border: 0; border-radius: 999px; padding: 10px 18px; background: rgba(255,255,255,.75); color: var(--ink); font-weight: 600; font-size: .95rem; box-shadow: 0 2px 8px rgba(80,50,30,.1); }
.t-been { font-weight: 600; font-size: .95rem; }
.t-who { margin-top: 6px; font-size: .88rem; opacity: .8; }
.t-ask { display: flex; gap: 8px; }
.t-ask input { flex: 1; margin: 0; }
.t-ask .btn { padding: 10px 16px; }

/* ---------- His tree ---------- */
.tree { max-width: 380px; margin: 0 auto; }
.tree svg { width: 100%; height: auto; display: block; overflow: visible; }
.tree .sway { animation: sway 7s ease-in-out infinite; }
@keyframes sway { 0%, 100% { transform: rotate(-0.8deg); } 50% { transform: rotate(0.8deg); } }
@media (prefers-reduced-motion: reduce) { .tree .sway { animation: none; } }
.tree-count { text-align: center; color: var(--muted); margin: 4px 0 0; }
.tree-count strong { color: var(--ink); font-family: var(--serif); font-size: 1.3rem; }

/* ---------- Drawing wall ---------- */
.fridge { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 14px; padding: 10px 4px; }
.art { position: relative; border: 0; padding: 8px 8px 10px; background: #fff; box-shadow: 0 6px 16px -6px rgba(60,40,20,.35); transform: rotate(var(--r)); text-align: left; cursor: pointer; }
.art img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; display: block; background: #f4efe8; }
.art.letter img { object-fit: contain; background: #fbf8f2; }
.art .tape { position: absolute; top: -9px; left: 50%; width: 54px; height: 18px; margin-left: -27px; background: rgba(240,220,170,.75); transform: rotate(-3deg); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.art-cap { display: block; font-size: .8rem; line-height: 1.35; margin-top: 6px; color: var(--ink); }
.art-cap em { font-style: normal; color: var(--muted); font-size: .74rem; }
.artview { position: fixed; inset: 0; z-index: 55; background: rgba(20,14,10,.92); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; }
.artview img { max-width: 100%; max-height: 78vh; object-fit: contain; border-radius: 6px; }
.artview-cap { color: #fff; text-align: center; margin-top: 12px; font-size: .95rem; }
.artview-cap em { font-style: normal; opacity: .75; font-size: .85rem; }
.artview button { position: absolute; top: 14px; right: 14px; width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(255,255,255,.15); color: #fff; font-size: 1.1rem; }

/* ---------- Stories ---------- */
.story-q { font-size: .78rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #9a6a2a; text-align: left; }
.card.story p { font-family: var(--serif); font-size: 1.2rem; margin: 6px 0 8px; text-align: left; white-space: pre-line; }
.sublabel-p { font-family: var(--sans); font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 18px 0 10px; text-align: left; }

/* ---------- His people ---------- */
.people { display: flex; gap: 14px; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: none; justify-content: flex-start; }
.people::-webkit-scrollbar { display: none; }
.person { flex: none; width: 74px; display: grid; justify-items: center; gap: 4px; border: 0; background: none; padding: 0; color: var(--ink); }
.person strong { font-size: .8rem; font-weight: 600; max-width: 74px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person small { font-size: .7rem; color: var(--muted); margin-top: -4px; }
.pface { width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center; font-size: 1.8rem; font-weight: 600; color: #fff;
  background: linear-gradient(135deg, hsl(var(--h) 55% 78%), hsl(calc(var(--h) + 30) 50% 66%)); box-shadow: 0 0 0 3px #fff, 0 4px 12px -4px rgba(60,40,20,.4); }
.pface.big { width: 84px; height: 84px; font-size: 2.4rem; margin-bottom: 8px; }
.plist { display: grid; gap: 8px; margin-top: 10px; }
.plist button { display: flex; gap: 12px; align-items: flex-start; text-align: left; border: 0; background: var(--paper); border-radius: 12px; padding: 12px; box-shadow: 0 2px 8px rgba(80,50,30,.06); color: var(--ink); font-size: .92rem; }
.plist button > span:first-child { font-size: 1.4rem; line-height: 1; }
.plist em { display: block; font-style: normal; color: var(--muted); font-size: .78rem; margin-top: 2px; }
/* ---------- Year of love slides in the birthday film ---------- */
.bf-slide.contain { background-size: contain !important; background-color: #fbf6ee; }
.bf-slide.love { display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, #6b4a2f, #2a1b12); }
.bf-love { text-align: center; padding: 24px; max-width: 520px; color: #fff; }
.bf-love small { display: block; font-size: .85rem; letter-spacing: .14em; text-transform: uppercase; opacity: .8; margin-bottom: 14px; }
.bf-love strong { font-family: var(--serif); font-size: 1.9rem; line-height: 1.35; font-weight: 600; }
.bf-love strong.q { font-size: 1.6rem; font-style: italic; }
.bf-love strong.gifts { font-size: 3rem; letter-spacing: .1em; }
.bf-love em { display: block; margin-top: 12px; font-style: normal; opacity: .85; }

.poweredby { text-decoration: none; color: inherit; font-family: var(--sans); font-size: .85rem; opacity: .8; border-bottom: 1px dotted currentColor; }
.poweredby:hover { opacity: 1; }

.hero-empty { font-family: var(--serif); font-size: 1.25rem; font-style: italic; opacity: .9; margin: 18px auto 0; max-width: 360px; }

/* ---------- Example page ---------- */
.demo-bar { position: sticky; top: 0; z-index: 40; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; justify-content: center; background: #fff1c9; color: #5a3d22; font-size: .86rem; padding: 9px 14px; text-align: center; box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.demo-bar a { font-weight: 700; color: #8e3f2c; white-space: nowrap; }
.demo-toast { position: fixed; left: 14px; right: 14px; bottom: 86px; z-index: 60; max-width: 460px; margin: 0 auto; background: #2f2620; color: #fff; border-radius: 16px; padding: 14px 16px; font-size: .92rem; line-height: 1.5; box-shadow: 0 12px 30px rgba(0,0,0,.3); opacity: 0; transform: translateY(16px); pointer-events: none; transition: .25s; }
.demo-toast.on { opacity: 1; transform: none; pointer-events: auto; }
.demo-toast a { color: #ffd166; font-weight: 700; }

/* Flowers beside the lamp */
.flower-row { margin: 22px auto 0; max-width: 360px; }
.flower-ask { font-family: var(--serif); font-style: italic; color: #7a6650; margin: 0 0 10px; }
.flower-btns { display: flex; justify-content: center; gap: 10px; }
.flower-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 72px; padding: 8px 4px 6px;
  background: #fffdf8; border: 1px solid #ecdcc2; border-radius: 16px; cursor: pointer; font: inherit; font-size: .78rem; color: #6b5a46;
  transition: transform .2s, box-shadow .2s, opacity .3s; }
.flower-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(140, 100, 50, .12); }
.flower-btn:disabled { opacity: .45; cursor: default; }
.flower-btn.chosen { opacity: 1; border-color: #d9a441; background: #fff6e2; }
.flower-btn.pop svg { animation: flowerpop .6s ease-out; }
@keyframes flowerpop { 0% { transform: scale(1); } 40% { transform: scale(1.35) rotate(-8deg); } 100% { transform: scale(1); } }
.flower-count { min-height: 1.3em; margin: 10px 0 0; font-size: .9rem; color: #7a6650; }
.tree .bed g { transition: opacity 1s; }

/* His little elephant */
.tree .comp { cursor: pointer; outline: none; }
.tree .comp .breathe, .tree .comp .hopper, .tree .comp .ear, .tree .comp .trunk, .tree .comp .eye, .tree .comp .tail, .tree .comp .heart, .tree .comp .zz { transform-box: fill-box; }
.tree .comp .breathe { transform-origin: 50% 100%; animation: c-breathe 3.6s ease-in-out infinite; }
.tree .comp .ear { transform-origin: 20% 50%; animation: c-ear 4.2s ease-in-out infinite; }
.tree .comp .trunk { transform-origin: 80% 0%; animation: c-trunk 5s ease-in-out infinite; }
.tree .comp .tail { transform-origin: 0% 0%; animation: c-tail 2.4s ease-in-out infinite; }
.tree .comp .eye { transform-origin: 50% 50%; animation: c-blink 5.5s infinite; }
.tree .comp.asleep .breathe { animation-duration: 5s; }
.tree .comp.asleep .ear, .tree .comp.asleep .trunk, .tree .comp.asleep .tail { animation: none; }
.tree .comp .zz { animation: c-zz 3.2s ease-in-out infinite; opacity: 0; }
.tree .comp .zz.z2 { animation-delay: 1.1s; }
.tree .comp.hop .hopper { animation: c-hop 1.1s ease-out; }
.tree .comp.hop .trunk { animation: c-trunkup 1.1s ease-out; }
.tree .comp.hop .heart { animation: c-heart 1.3s ease-out; }
/* wandering (see roam() in memorial.js): legs step, the body bobs, the tail wags faster */
.tree .comp .leg { transform-box: fill-box; transform-origin: 50% 0%; }
.tree .comp.walking .leg { animation: c-leg .42s ease-in-out infinite; }
.tree .comp.walking .leg.b { animation-delay: -.21s; }
.tree .comp.walking .breathe { animation: c-bob .42s ease-in-out infinite; }
.tree .comp.running .leg, .tree .comp.running .breathe { animation-duration: .22s; }
.tree .comp.running .leg.b { animation-delay: -.11s; }
.tree .comp.walking .tail, .tree .comp.hopping .tail { animation-duration: .5s; }
.tree .comp.hopping .ear { animation: c-flap .3s ease-in-out infinite; }
.tree .comp.sniff .breathe { transform-origin: 75% 100%; animation: c-sniff 1.1s ease-in-out infinite; }
.tree .comp.sniff .tail { animation-duration: .45s; }
.comp-note { font-size: .85rem; opacity: .8; }
@keyframes c-breathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.015, 1.035); } }
@keyframes c-ear { 0%, 80%, 100% { transform: rotate(0); } 86% { transform: rotate(-12deg); } 92% { transform: rotate(4deg); } }
@keyframes c-trunk { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(7deg); } }
@keyframes c-tail { 0%, 100% { transform: rotate(-10deg); } 50% { transform: rotate(14deg); } }
@keyframes c-blink { 0%, 94%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }
@keyframes c-zz { 0% { opacity: 0; transform: translate(0, 4px); } 30% { opacity: .9; } 100% { opacity: 0; transform: translate(4px, -8px); } }
@keyframes c-hop { 0% { transform: translateY(0); } 25% { transform: translateY(-9px); } 45% { transform: translateY(0); } 62% { transform: translateY(-4px); } 80%, 100% { transform: translateY(0); } }
@keyframes c-leg { 0%, 100% { transform: rotate(16deg); } 50% { transform: rotate(-16deg); } }
@keyframes c-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-1.4px); } }
@keyframes c-sniff { 0%, 100% { transform: rotate(0); } 40%, 60% { transform: rotate(-6deg) translateY(1px); } }
@keyframes c-flap { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-14deg); } }
@keyframes c-trunkup { 0%, 100% { transform: rotate(0); } 30%, 60% { transform: rotate(-38deg); } }
@keyframes c-heart { 0% { opacity: 0; transform: translateY(4px); } 25% { opacity: 1; } 100% { opacity: 0; transform: translateY(-16px); } }
@media (prefers-reduced-motion: reduce) { .tree .comp * { animation: none !important; } }
.famlock { position: absolute; left: 8px; top: 8px; background: rgba(255,255,255,.88); border-radius: 999px; padding: 1px 7px; font-size: .75rem; }

/* Kannada and Hindi letters join together: spacing them out breaks the words, and they have no capitals. */
html:lang(kn) *, html:lang(hi) * { letter-spacing: normal !important; text-transform: none !important; }
html:lang(kn) body, html:lang(hi) body { line-height: 1.7; }
html:lang(kn) .kicker, html:lang(hi) .kicker { font-size: .95rem; }
/* Kannada letters stand taller than English ones at the same size, so headings come down a little. */
html:lang(kn) h2 { font-size: 1.6rem; line-height: 1.35; }
html:lang(kn) h3 { font-size: .92em; line-height: 1.4; }
html:lang(kn) .sub { font-size: .95rem; }
.ai-note { font-size: .8rem; opacity: .8; margin: 6px 0 0; }
.ai-note a { color: inherit; text-decoration: underline; }
