/* Kasavu: off-white cloth with a gold zari border, palm green and boat-wood brown.
   Gilda Display for names and titles, Karla for text, Noto Serif Malayalam for the Malayalam.
   --u is one unit of the 400-wide backwater drawing, so the boat (an HTML button) tracks the SVG. */
:root {
  --cream: #fbf7ec; --cloth: #f4ecd6; --gold: #c8a03c; --gold-ink: #856417; --green: #1f5b3f; --leaf: #2f7350;
  --wood: #7a4a22; --ink: #2d2a1f; --soft: #5c5743;
  --u: calc(min(100vw, 520px) / 400);
  --fx-bg: var(--cream); --fx-music-bg: var(--green); --fx-music-ring: var(--gold); --fx-music-ink: #f6e3ac;
}
html { scroll-behavior: smooth; background: var(--cloth); }
html.shut, html.shut body { overflow: hidden; }
body {
  font: 400 17px/1.6 Karla, system-ui, sans-serif; color: var(--ink);
  background: repeating-linear-gradient(90deg, rgba(200, 160, 60, .05) 0 1px, transparent 1px 4px), var(--cloth);
}
/* on a wide screen the page is a length of cloth, its kasavu border running down both sides */
.page {
  max-width: 520px; margin: 0 auto; background: var(--cream); position: relative;
  box-shadow: -5px 0 0 var(--cream), -7px 0 0 var(--gold), -12px 0 0 var(--cream), -26px 0 0 var(--gold), -31px 0 0 var(--cream), -33px 0 0 var(--gold),
    5px 0 0 var(--cream), 7px 0 0 var(--gold), 12px 0 0 var(--cream), 26px 0 0 var(--gold), 31px 0 0 var(--cream), 33px 0 0 var(--gold);
}
h1, h2, h3 { margin: 0; font-family: "Gilda Display", Georgia, serif; font-weight: 400; text-wrap: balance; }
a { color: inherit; }
.ml { font-family: "Noto Serif Malayalam", "Gilda Display", serif; line-height: 1.5; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; border-radius: 4px; }

/* the kasavu border */
.zari {
  height: 27px;
  background:
    linear-gradient(var(--gold), var(--gold)) 0 3px / 100% 1.5px no-repeat,
    repeating-linear-gradient(90deg, rgba(255, 250, 220, .34) 0 2px, transparent 2px 5px) 0 8px / 100% 11px no-repeat,
    linear-gradient(#dcb957, #b88e2a) 0 8px / 100% 11px no-repeat,
    linear-gradient(var(--gold), var(--gold)) 0 22.5px / 100% 1.5px no-repeat,
    var(--cream);
}
.zari--green { background-color: var(--green); }

/* ---------- gate + hero ---------- */
.gate {
  position: relative; min-height: 100svh; display: flex; flex-direction: column; overflow: hidden;
  background: linear-gradient(var(--cream) 30%, #f8eed1 78%, #f5e6bd);
}
html.shut .gate { height: 100svh; }
.gate__head { flex: 1; min-height: 0; display: grid; place-items: center; padding: 46px 24px 6px; text-align: center; }
.gate__head > * { grid-area: 1 / 1; }
.gate__shut { opacity: 0; visibility: hidden; transition: opacity .6s, visibility 0s .6s; }
html.shut .gate__shut { opacity: 1; visibility: visible; transition: none; }
.hero { transition: opacity 1.3s .25s, translate 1.3s .25s cubic-bezier(.22, 1, .36, 1); }
html.shut .hero { opacity: 0; visibility: hidden; translate: 0 14px; }
.gate__to { font-size: 16px; color: var(--soft); margin-bottom: 6px; }
.gate__ml, .hero__ml { color: var(--gold-ink); font-size: 21px; font-weight: 600; letter-spacing: .02em; }
.gate__ml { font-size: 26px; }
.gate__who { font-family: "Gilda Display", serif; font-size: clamp(34px, 10.5vw, 46px); line-height: 1.15; color: var(--green); margin: 6px 0 12px; text-wrap: balance; }
.gate__ask { color: var(--soft); font-size: 16px; }
.hero__lead { font-size: 16px; color: var(--soft); max-width: 300px; margin: 6px auto 10px; line-height: 1.45; }
.hero__names { font-size: clamp(31px, 9.2vw, 42px); line-height: 1.12; color: var(--green); }
.hero__names span { display: block; }
.hero__names i { display: block; font-size: .62em; color: var(--gold); line-height: 1.2; font-style: italic; }
.hero__hi { font-size: 19px; color: var(--wood); margin-top: 8px; }
.hero__date { margin-top: 10px; font-weight: 700; font-size: 16px; letter-spacing: .04em; }
.hero__venue { font-size: 16px; color: var(--soft); }

.scene { position: relative; flex: none; height: min(calc(360 * var(--u)), 50svh); --p: 1; }
html.shut .scene { --p: 0; }
.bw { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.bw__cur { transform-box: fill-box; transform-origin: 50% 100%; transition: transform 1.5s cubic-bezier(.5, 0, .2, 1); }
.bw__cur--l { transform: translateX(-82px) rotate(-5deg); }
.bw__cur--r { transform: translateX(82px) rotate(5deg); }
.bw__mand { transition: opacity 1.2s .35s; }
html.shut .gate:not(.arrived) .bw__cur { transform: none; }
html.shut .gate:not(.arrived) .bw__mand { opacity: 0; }
.bw__lines { animation: drift 7s ease-in-out infinite alternate; }
@keyframes drift { from { transform: translateX(-7px); } to { transform: translateX(7px); } }

.boat {
  position: absolute; left: 0; bottom: 0; width: calc(150 * var(--u)); aspect-ratio: 160 / 110; padding: 0; border: 0; background: none;
  cursor: grab; touch-action: none; -webkit-tap-highlight-color: transparent; z-index: 2;
  transform: translate(calc((10 + var(--p) * 218) * var(--u)), calc((-26 - var(--p) * 112) * var(--u))) scale(calc(1 - var(--p) * .42));
  transform-origin: 50% 80%; transition: transform .85s cubic-bezier(.3, .7, .3, 1);
}
.boat.dragging { transition: none; cursor: grabbing; }
.vallam { display: block; width: 100%; height: 100%; overflow: visible; animation: bob 3.4s ease-in-out infinite; transform-origin: 50% 60%; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-.8deg); } 50% { transform: translateY(2px) rotate(.8deg); } }
.vallam__oar { transform-box: fill-box; transform-origin: 100% 0; }
.boat.row .vallam__oar { animation: oar .6s ease-in-out; }
@keyframes oar { 0% { transform: rotate(0); } 40% { transform: rotate(-34deg); } 100% { transform: rotate(0); } }
.scene__rips { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.rip {
  position: absolute; width: 46px; height: 13px; margin: -6px 0 0 -23px; border-radius: 50%;
  border: 1.5px solid rgba(255, 253, 244, .95); animation: rip 1.7s ease-out forwards;
}
@keyframes rip { from { transform: scale(.3); opacity: .95; } to { transform: scale(2.6); opacity: 0; } }

.gate__hint {
  position: absolute; right: 14px; top: 43%; z-index: 3; width: max-content; max-width: 190px;
  text-align: center; font-size: 16px; line-height: 1.3; color: var(--green); pointer-events: none;
  background: rgba(251, 247, 236, .86); padding: 8px 16px; border-radius: 18px; border: 1px solid rgba(200, 160, 60, .7);
  opacity: 0; transition: opacity .5s;
}
.gate__hint b { display: block; font-weight: 700; }
.gate__hint span { display: block; font-size: 14px; color: var(--soft); }
html.shut .gate:not(.arrived):not(.rowing) .gate__hint { opacity: 1; }
.gate__down {
  position: absolute; left: 50%; bottom: calc(12px + env(safe-area-inset-bottom)); translate: -50% 0; z-index: 3; min-height: 44px; display: grid; justify-items: center; align-content: center;
  font-size: 13px; letter-spacing: .16em; text-transform: uppercase; text-decoration: none; color: var(--green); font-weight: 700;
  padding: 6px 16px; background: rgba(251, 247, 236, .8); border-radius: 22px; transition: opacity .8s 1.4s;
}
.gate__down i { width: 9px; height: 9px; border-right: 2px solid var(--gold-ink); border-bottom: 2px solid var(--gold-ink); rotate: 45deg; margin-top: 2px; animation: nod 1.8s ease-in-out infinite; }
@keyframes nod { 50% { translate: 0 4px; } }
html.shut .gate__down { opacity: 0; visibility: hidden; transition: none; }
.gate__skip {
  position: absolute; right: 12px; top: calc(34px + env(safe-area-inset-top)); z-index: 4; min-width: 64px; min-height: 44px; padding: 0 16px;
  background: rgba(251, 247, 236, .9); border: 1px solid var(--gold); border-radius: 22px; cursor: pointer;
  font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--green); font-weight: 700;
}
html:not(.shut) .gate__skip { display: none; }

/* ---------- sections ---------- */
.sec { position: relative; text-align: center; }
.sec > .reveal, .sec > .fams, .sec > .evs, .sec > .leaf, .sec > .dishes { margin: 0 24px; }
.sec > .zari + .reveal, .sec > .reveal:first-child { padding-top: 54px; }
.sec { padding-bottom: 60px; }
.sec__ml { color: var(--gold-ink); font-size: 19px; font-weight: 600; }
.sec__title { font-size: clamp(28px, 8vw, 34px); line-height: 1.18; color: var(--green); margin: 2px 0 12px; }
.sec__sub { color: var(--soft); max-width: 380px; margin: 0 auto; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 18px; border-radius: 22px;
  border: 1px solid var(--green); color: var(--green); text-decoration: none; font-size: 14px; font-weight: 700; letter-spacing: .06em;
  transition: background .25s, color .25s;
}
.btn:hover { background: rgba(31, 91, 63, .08); }
.btn--solid { background: var(--green); color: var(--cream); }
.btn--solid:hover { background: #17482f; }
.btn--gold { background: var(--gold); border-color: var(--gold); color: #251d08; font-size: 16px; padding: 12px 28px; border-radius: 28px; }
.btn--gold:hover { background: #d8b352; }

/* muhurtham */
.sec--date { background: linear-gradient(#a6cdb9, var(--cream) 90px); }
.vilakku { width: 54px; height: auto; display: block; margin: 0 auto 8px; }
.vilakku__f { animation: flame 2.2s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes flame { from { transform: scaleY(.9); } to { transform: scaleY(1.08); } }
.date { display: grid; justify-items: center; margin: 14px auto 6px; width: 220px; padding: 16px 0 14px; border-top: 1.5px solid var(--gold); border-bottom: 1.5px solid var(--gold); position: relative; }
.date::before, .date::after { content: ""; position: absolute; left: 0; right: 0; height: 5px; background: linear-gradient(#dcb957, #b88e2a); }
.date::before { top: 4px; } .date::after { bottom: 4px; }
.date__wd { font-size: 14px; letter-spacing: .24em; text-transform: uppercase; font-weight: 700; color: var(--wood); margin-top: 6px; }
.date__day { font-family: "Gilda Display", serif; font-size: 92px; line-height: 1; color: var(--green); }
.date__my { font-size: 15px; letter-spacing: .2em; text-transform: uppercase; font-weight: 700; color: var(--wood); margin-bottom: 6px; }
.date__time { margin-top: 18px; display: grid; }
.date__time span { font-size: 14px; letter-spacing: .14em; text-transform: uppercase; color: var(--soft); }
.date__time b { font-family: "Gilda Display", serif; font-weight: 400; font-size: 46px; line-height: 1.15; color: var(--wood); }
.date__what { margin-top: 12px; color: var(--soft); }
.count { display: flex; justify-content: center; gap: 8px; margin-top: 26px; }
.count span { width: 70px; padding: 10px 0 8px; background: #fffdf6; border: 1px solid #e3d5a6; border-bottom: 3px solid var(--gold); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--soft); }
.count b { font-family: "Gilda Display", serif; font-weight: 400; font-size: 30px; line-height: 1.1; color: var(--green); letter-spacing: 0; }
.count__done { margin-top: 22px; font-family: "Gilda Display", serif; font-size: 22px; color: var(--green); }

/* invitation */
.jasmine { display: block; width: min(300px, 86%); height: auto; margin: 0 auto 14px; }
.letter { max-width: 400px; margin: 0 auto; font-size: 18px; }
.letter--own { white-space: pre-line; }
.letter--quiet { margin-top: 12px; font-style: italic; color: var(--soft); font-size: 17px; }
.story__places { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.story__places span { padding: 3px 12px; border: 1px solid var(--gold); border-radius: 14px; font-size: 14px; }

/* families */
.sec--fam { padding-bottom: 64px; }
.fams { display: grid; gap: 18px; margin-top: 16px !important; }
.fam { background: #fffdf6; border: 1px solid #e3d5a6; padding: 30px 18px 22px; position: relative; }
.fam::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 13px; background: linear-gradient(#dcb957, #b88e2a) 0 3px / 100% 6px no-repeat, linear-gradient(var(--gold), var(--gold)) 0 11.5px / 100% 1.5px no-repeat; }
.fam__side { font-size: 13px; letter-spacing: .22em; text-transform: uppercase; font-weight: 700; color: var(--gold-ink); }
.fam__name { font-size: 29px; line-height: 1.2; color: var(--green); margin: 2px 0 8px; }
.fam__rel { font-size: 14px; font-style: italic; color: var(--soft); margin-top: 6px; }
.fam__parents { font-size: 17px; font-weight: 500; }
.fam__kin { list-style: none; margin: 16px 0 0; padding: 14px 0 0; border-top: 1px dashed #d9c68c; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 22px; }
.fam__kin li { display: grid; }
.fam__kin small { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--soft); }

/* functions: stops along the water */
.sec--events { background: linear-gradient(var(--cream), #eef2e2 30%, #e2ecdc); }
.evs { position: relative; margin-top: 26px !important; padding-left: 30px; display: grid; gap: 20px; text-align: left; }
.evs::before { content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px; border-left: 2px dashed #7fb39c; }
.ev { position: relative; }
.ev__stop { position: absolute; left: -30px; top: 26px; width: 18px; height: 18px; border-radius: 50%; background: var(--cream); border: 2px solid var(--leaf); box-shadow: 0 0 0 4px rgba(127, 179, 156, .3); }
.ev--main .ev__stop { background: var(--gold); border-color: var(--green); box-shadow: 0 0 0 5px rgba(200, 160, 60, .3); }
.ev__card { background: #fffdf6; border: 1px solid #e3d5a6; border-top: 0; padding: 26px 18px 18px; position: relative; }
.ev__card::before { content: ""; position: absolute; left: -1px; right: -1px; top: 0; height: 11px; background: linear-gradient(#dcb957, #b88e2a) 0 0 / 100% 6px no-repeat, linear-gradient(var(--gold), var(--gold)) 0 9px / 100% 1.5px no-repeat; }
.ev--main .ev__card { background: #fffaf0; box-shadow: 0 14px 30px -20px rgba(122, 74, 34, .5); }
.ev__ml { color: var(--gold-ink); font-size: 17px; font-weight: 600; }
.ev__name { font-size: 28px; line-height: 1.2; color: var(--green); }
.ev__when { margin-top: 6px; font-weight: 700; }
.ev__time { font-family: "Gilda Display", serif; font-size: 28px; line-height: 1.25; color: var(--wood); }
.ev__time span { font-family: Karla, sans-serif; font-size: 13px; letter-spacing: .16em; text-transform: uppercase; font-weight: 700; color: var(--gold-ink); margin-right: 8px; vertical-align: middle; }
.ev__sched { list-style: none; margin: 6px 0 0; padding: 0; }
.ev__sched li { display: flex; gap: 10px; } .ev__sched b { color: var(--wood); }
.ev__where { margin-top: 8px; color: var(--soft); }
.ev__where strong { display: block; color: var(--ink); }
.ev__note { margin-top: 8px; font-style: italic; }
.ev__dress { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 14px; }
.ev__dress span { text-transform: uppercase; letter-spacing: .14em; font-weight: 700; color: var(--gold-ink); }
.ev__dress em { font-style: normal; padding: 1px 10px; border: 1px solid var(--gold); border-radius: 12px; }
.ev__links { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.ev__links .btn { padding: 6px 14px; font-size: 13px; }

/* sadya */
.sec--sadya { background: #e2ecdc; }
.sec--sadya > .zari { background-color: #e2ecdc; }
.leaf { margin-top: 20px !important; }
.leaf svg { display: block; width: 100%; max-width: 420px; margin: 0 auto; height: auto; filter: drop-shadow(0 12px 14px rgba(31, 91, 63, .25)); overflow: visible; }
.dish { transform-box: fill-box; transform-origin: 50% 50%; transition: opacity .5s, transform .5s cubic-bezier(.3, 1.5, .5, 1); transition-delay: calc(var(--i) * .15s + .35s); }
html.js .leaf:not(.in) .dish { opacity: 0; transform: translateY(-10px) scale(.7); }
.dish.on { animation: serve .9s ease; }
@keyframes serve { 30% { transform: scale(1.28) rotate(-4deg); } 60% { transform: scale(.96); } }
.dishes { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 22px !important; }
.dishes__b { min-height: 44px; padding: 6px 15px; border-radius: 22px; border: 1px solid var(--leaf); background: var(--cream); color: var(--green); font-size: 15px; font-weight: 500; cursor: pointer; transition: background .2s, color .2s; }
.dishes__b[aria-pressed="true"] { background: var(--green); color: var(--cream); border-color: var(--green); }
.dishes__say { margin: 14px 24px 0; min-height: 3.2em; font-style: italic; color: var(--ink); }

/* venue */
.sec--venue { padding-bottom: 0; }
.venue__addr { font-size: 18px; font-weight: 700; color: var(--wood); margin-bottom: 8px; }
.sec--venue .btn { margin-top: 20px; }
.venue__water { margin-top: 44px; height: 132px; position: relative; overflow: hidden; background: linear-gradient(var(--cream), #d6e6d2 34%, #9cc7b3); }
.venue__water::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(180deg, transparent 0 17px, rgba(255, 253, 244, .5) 17px 18px); mask: linear-gradient(transparent 40%, #000); -webkit-mask: linear-gradient(transparent 40%, #000); }
.venue__water .vallam { position: absolute; left: 50%; top: 8px; width: 176px; height: auto; margin-left: -88px; }

/* gallery */
.gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.gallery img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; display: block; border: 5px solid #fffdf6; outline: 1px solid #e3d5a6; }

/* reply + footer */
.sec--reply { background: var(--green); color: var(--cream); padding-bottom: 72px; }
.sec--reply .sec__ml { color: #ecd27f; }
.sec--reply .sec__title { color: var(--cream); }
.sec--reply .sec__sub { color: #d5e2d2; }
.sec--reply .btn { margin-top: 24px; }
.sec--reply :focus-visible, .foot :focus-visible { outline-color: #ecd27f; }
.reply__tag { margin-top: 28px; font-family: "Gilda Display", serif; font-size: 24px; color: #ecd27f; overflow-wrap: anywhere; }
.reply__tag span { display: block; font-family: Karla, sans-serif; font-size: 13px; letter-spacing: .18em; text-transform: uppercase; color: #d5e2d2; }
.foot { background: #17462f; color: #d5e2d2; text-align: center; padding-bottom: calc(86px + env(safe-area-inset-bottom)); font-size: 16px; }
.foot .zari { background-color: #17462f; margin-bottom: 30px; }
.foot__names { font-family: "Gilda Display", serif; font-size: 30px; color: var(--cream); padding: 0 24px; }
.foot__date { padding: 0 24px; }
.foot__up { margin: 10px 0 18px; }
.foot__up a { display: inline-block; padding: 12px 10px; color: #ecd27f; }
.foot__music, .foot__credit { font-size: 14px; padding: 0 64px; opacity: .85; }
.foot__credit a { color: #ecd27f; display: inline-block; padding: 6px 0; }

/* ---------- link-preview card ---------- */
html.og .ogcard { background: var(--cream); font-family: Karla, sans-serif; color: var(--ink); }
.og__text { width: 590px; padding: 0 30px 0 62px; display: flex; flex-direction: column; justify-content: center; position: relative; }
.og__text::before, .og__text::after { content: ""; position: absolute; left: 0; width: 1200px; height: 34px; z-index: 2; background: linear-gradient(var(--gold), var(--gold)) 0 4px / 100% 2px no-repeat, linear-gradient(#dcb957, #b88e2a) 0 10px / 100% 14px no-repeat, linear-gradient(var(--gold), var(--gold)) 0 28px / 100% 2px no-repeat, var(--cream); }
.og__text::before { top: 0; } .og__text::after { bottom: 0; }
.og__ml { font-size: 40px; font-weight: 600; color: var(--gold-ink); }
.og__names { font-family: "Gilda Display", serif; font-size: 104px; line-height: 1.04; color: var(--green); margin: 4px 0 18px; overflow-wrap: anywhere; }
.og__names i { color: var(--gold); font-size: .7em; }
.og__date { font-size: 44px; font-weight: 700; color: var(--wood); line-height: 1.2; }
.og__venue { font-size: 28px; color: var(--soft); margin-top: 6px; }
.og__scene { position: relative; flex: 1; background: linear-gradient(var(--cream) 20%, #f5e6bd 60%); overflow: hidden; }
.og__boat { position: absolute; left: 36px; bottom: 60px; width: 330px; }
.og__boat .vallam, .bw--og .bw__lines { animation: none; }

@media (min-width: 700px) {
  .gate__skip { right: 18px; }
}
@media (max-height: 700px) {
  .gate__head { padding-top: 40px; }
  .scene { height: min(calc(360 * var(--u)), 45svh); }
  .hero__lead { font-size: 15px; margin-bottom: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rip { display: none; }
}
