@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+Tamil:wght@500&family=Cinzel:wght@600&display=swap');

/* =====================================================================
   Getti Melam — theme styles. Loaded only for layout "getti-melam".
   Tie the three knots → thamboolam → thali + getti melam + akshata → blessings
   → the muhurtham on a brass plate. Palette: turmeric, kumkum red, brass.
   ===================================================================== */

.layout-getti-melam { --gm-turmeric: #e8a317; --gm-kumkum: #b3121f; --gm-brass: #c99a3c; --gm-ink: #4a1a05; }

/* ---------------- Opening: moondru mudichu ---------------- */
.intro-theme { padding: 0; overflow: hidden; background: radial-gradient(ellipse at 50% 35%, #fff1c2, #f6c64a 45%, #b8560a); }
.gmi { position: absolute; inset: 0; display: grid; grid-template-rows: 1fr auto; justify-items: center; padding-bottom: 6vh; }
.gmi-thread { width: min(78vw, 360px); height: auto; align-self: start; margin-top: 4vh; overflow: visible; filter: drop-shadow(0 6px 10px rgba(74, 26, 5, .3)); }
.gmi-thali { transform-box: fill-box; transform-origin: 50% 0; animation: gmThali 3s ease-in-out infinite alternate; }
@keyframes gmThali { from { transform: rotate(-4deg); } to { transform: rotate(4deg); } }
.gmi-knot { opacity: 0; transform-box: fill-box; transform-origin: center; transform: scale(.3); transition: opacity .3s, transform .5s cubic-bezier(.3, 1.8, .5, 1); }
.gmi[data-knots="1"] .gmi-knot[data-k="1"], .gmi[data-knots="2"] .gmi-knot:is([data-k="1"], [data-k="2"]), .gmi[data-knots="3"] .gmi-knot { opacity: 1; transform: none; }
.gmi.thud { animation: gmThud .25s ease-out; }
@keyframes gmThud { 30% { transform: scale(1.02) translateY(2px); } }
.gmi-card { position: relative; z-index: 2; max-width: 360px; margin: 0 16px; padding: 22px 22px 24px; text-align: center; border-radius: 20px;
    background: rgba(74, 26, 5, .7); backdrop-filter: blur(4px); box-shadow: 0 0 0 1px rgba(255, 241, 168, .6), 0 18px 44px rgba(74, 26, 5, .4); transition: opacity .6s, transform .8s; }
.gmi-tamil { margin: 0 0 6px; font: 500 1.05rem 'Noto Serif Tamil', serif; color: #ffe08a; }
.gmi .intro-to { color: #fff6dc; font-size: 1.05rem; margin-bottom: 4px; }
.gmi .intro-names { color: #ffe08a; }
.gmi-help { margin: 8px 0 0; color: #fff6dc; font-size: .9rem; opacity: .9; }
.gmi .intro-btn { margin-top: 16px; color: #4a1a05; background: linear-gradient(180deg, #fff1a8, #e8a317); border-color: #fff1a8; }
.intro.opening .gmi-card { opacity: 0; transform: translateY(20px); }
.intro.opening .gmi-thread { animation: gmRise 1.6s ease-in forwards; }
@keyframes gmRise { to { transform: translateY(-30vh) scale(.7); opacity: 0; } }
.intro-theme.opened { transition-delay: .2s; }

/* ---------------- Hero: the muhurtham ---------------- */
.layout-getti-melam .hero { padding: 0; display: block; min-height: 0; }
.layout-getti-melam .scroll-cue { display: none; }

.gm { --h: max(calc(100vh - var(--gm-off, 0px)), 560px); position: relative; width: 100%; height: var(--h); overflow: hidden; isolation: isolate; background: #f6c64a; }
@supports (height: 100svh) { .gm { --h: max(calc(100svh - var(--gm-off, 0px)), 560px); } }
.gm-fill { position: absolute; inset: -40px; background-size: cover; background-position: center; filter: blur(26px) saturate(1.15); }
.gm-frame { position: absolute; top: 0; left: 50%; height: 100%; width: min(calc(var(--h) * 9 / 16), 100%); transform: translateX(-50%); container-type: inline-size; overflow: hidden; }
.gm-scene { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.1s ease; animation: gmKen 20s ease-in-out infinite alternate; }
@keyframes gmKen { from { scale: 1.02; } to { scale: 1.07; } }
.gm[data-state="rest"] .s1, .gm[data-state="s1"] .s1, .gm[data-state="s2"] .s2, .gm[data-state="s3"] .s3, .gm[data-state="done"] .s3 { opacity: 1; }
/* the getti melam moment: a golden flash and a drum-roll shake */
.gm-flash { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 50% 50%, rgba(255, 241, 168, .9), rgba(255, 200, 80, .3) 40%, transparent 70%); opacity: 0; }
.gm[data-state="s2"] .gm-flash { animation: gmFlash 1.6s ease-out .5s; }
@keyframes gmFlash { 20% { opacity: 1; } 100% { opacity: 0; } }
.gm[data-state="s2"] .gm-frame { animation: gmRoll .08s linear .5s 14; }
@keyframes gmRoll { 50% { translate: 0 1.5px; } }

/* akshata (turmeric rice) and petals, created by theme.js */
.gm-rice { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.gm-rice i { position: absolute; top: -2%; left: var(--x); width: var(--w); height: calc(var(--w) * 1.8); border-radius: 50%; background: var(--c); opacity: .95;
    animation: gmFall var(--t) linear forwards; animation-delay: var(--dl); }
@keyframes gmFall { to { transform: translate(var(--dx), 110cqh) rotate(var(--r)); opacity: .7; } }
.gm-frame { container-type: size; }

/* names */
.gm-top { position: absolute; top: 3%; left: 7%; right: 7%; padding: 2.2cqw 3cqw 2.6cqw; text-align: center; border-radius: 4cqw; color: #fff6dc;
    background: radial-gradient(ellipse at 50% 50%, rgba(74, 26, 5, .78), rgba(74, 26, 5, .52) 75%, rgba(74, 26, 5, .3));
    box-shadow: 0 0 0 1px rgba(255, 241, 168, .55), 0 8px 24px rgba(74, 26, 5, .3); backdrop-filter: blur(3px); text-shadow: 0 1px 2px rgba(40, 10, 0, .85); transition: opacity .9s; }
.gm[data-state="rest"] .gm-top { opacity: 0; }
.gm-tamil { margin: 0; font: 500 3.2cqw/1.4 'Noto Serif Tamil', serif; color: #ffe08a; }
.gm-kick { margin: .6cqw 0 0; font: 600 2.3cqw/1.3 'Cinzel', serif; letter-spacing: .16em; text-transform: uppercase; }
.gm-top .names { margin: 1cqw 0 0; font-family: var(--hf); font-weight: 400; font-size: 10cqw; line-height: 1.05; white-space: nowrap; color: #ffe08a; }
.gm-top .names.long { font-size: 7.6cqw; }
.gm-top .names.xlong { font-size: 5.6cqw; white-space: normal; }
.gm-top .names .amp { display: inline-block; margin: 0 .2em; font-size: .6em; color: #fff6dc; }
.gm-sub { margin: .6cqw 0 0; font: italic 500 3.6cqw/1.3 'Cormorant Garamond', Georgia, serif; }

/* ritual label */
.gm-step { position: absolute; left: 0; right: 0; bottom: 5%; display: grid; justify-items: center; pointer-events: none; }
.gm-step p { grid-area: 1 / 1; margin: 0; padding: 1.6cqw 4.4cqw; border-radius: 3cqw; text-align: center; color: #fff6dc; background: rgba(179, 18, 31, .86);
    box-shadow: 0 0 0 1.5px #ffe08a, 0 8px 20px rgba(74, 26, 5, .35); opacity: 0; transform: translateY(3cqw); transition: opacity .5s, transform .6s cubic-bezier(.2, .9, .3, 1.2); }
.gm-step b { display: block; font: 600 3.4cqw/1.2 'Cinzel', serif; letter-spacing: .1em; color: #ffe08a; }
.gm-step span { font: italic 500 3.6cqw/1.3 'Cormorant Garamond', serif; }
.gm[data-state="s1"] .gm-step [data-n="1"], .gm[data-state="s2"] .gm-step [data-n="2"], .gm[data-state="s3"] .gm-step [data-n="3"] { opacity: 1; transform: none; }

/* the muhurtham on a brass plate, tied with turmeric thread */
.gm-date { position: absolute; left: 50%; bottom: 4%; width: 66cqw; padding: 3.4cqw 4cqw 3.6cqw; transform: translate(-50%, 4cqw); display: grid; justify-items: center; text-align: center; border-radius: 50% / 34%;
    background: radial-gradient(ellipse at 50% 30%, #fff1c2, #e8b44a 45%, #a8741e 80%); color: var(--gm-ink);
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .5), inset 0 -6px 14px rgba(90, 50, 5, .4), 0 0 0 3px var(--gm-turmeric), 0 0 0 5px rgba(179, 18, 31, .8), 0 12px 30px rgba(74, 26, 5, .45);
    opacity: 0; transition: opacity .9s, transform 1s cubic-bezier(.2, .9, .3, 1.2); }
.gm[data-state="done"] .gm-date { opacity: 1; transform: translate(-50%, 0); }
.gm-label { font: 600 2.4cqw/1.3 'Cinzel', serif; letter-spacing: .3em; text-transform: uppercase; color: var(--gm-kumkum); }
.gm-date b { margin: .4cqw 0; font: 600 7cqw/1.05 'Cinzel', serif; color: #4a1a05; }
.gm-date span:last-child { font: italic 600 3.4cqw/1.2 'Cormorant Garamond', serif; }

.gm-sound { position: absolute; right: 12px; bottom: 40px; z-index: 6; border: 1px solid rgba(255, 241, 168, .8); border-radius: 99px; padding: 8px 14px; font: 600 13px var(--bf); color: #fff6dc; background: rgba(74, 26, 5, .6); backdrop-filter: blur(4px); cursor: pointer; }
.gm-sound[aria-pressed="true"] { background: linear-gradient(180deg, #fff1a8, #e8a317); color: #4a1a05; }
.gm-sound:focus-visible { outline: 2px solid #ffe08a; outline-offset: 2px; }
.gm-credit { position: absolute; left: 0; right: 0; bottom: 3px; z-index: 6; margin: 0; text-align: center; font-size: 9px; color: rgba(255, 246, 220, .8); text-shadow: 0 1px 2px rgba(40, 10, 0, .9); }
.gm-credit a { color: inherit; }

/* keep the bottom menu out of the way while the scene is on screen */
.layout-getti-melam .dock { transition: opacity .4s, translate .4s, visibility 0s; }
.layout-getti-melam.gm-at-top .dock { opacity: 0 !important; translate: 0 24px; visibility: hidden; pointer-events: none; transition: opacity .3s, translate .3s, visibility 0s .3s; }

/* ---------------- The rest of the invitation: turmeric thread and mango leaves ---------------- */
.layout-getti-melam .inv-main { background: linear-gradient(#fff1c2, var(--bg) 420px); }
.layout-getti-melam .sec { position: relative; }
/* a turmeric thread with a tiny gold thali between sections */
.layout-getti-melam .sec + .sec::before { content: ''; position: absolute; top: 0; left: 12%; right: 12%; height: 18px;
    background: radial-gradient(circle at 50% 11px, #e8b44a 0 5px, #8a5a12 5.5px, transparent 6.5px), linear-gradient(var(--gm-turmeric), var(--gm-turmeric)) 0 3px / 100% 2px no-repeat; }
.layout-getti-melam .sec-title { position: relative; padding-top: 34px; }
/* a little mango-leaf toran over every section title */
.layout-getti-melam .sec-title::before { content: ''; position: absolute; top: 0; left: 50%; width: 132px; height: 22px; margin-left: -66px;
    background: radial-gradient(ellipse 5px 10px at 50% 10px, #2f7d32 96%, transparent) 0 0 / 16.5px 22px repeat-x, linear-gradient(#6b3d12, #6b3d12) 0 0 / 100% 2px no-repeat; }
.layout-getti-melam .sec-title h2 { color: var(--gm-kumkum); }
.layout-getti-melam .sec-title .kick { color: #8a5a12; }
.layout-getti-melam .card { border: 1px solid rgba(232, 163, 23, .55); box-shadow: inset 0 3px 0 var(--gm-turmeric), 0 12px 30px rgba(184, 86, 10, .12); }
.layout-getti-melam .reveal { transform: translateY(18px) scale(.97); }
.layout-getti-melam .reveal.in { transform: none; }

@media (prefers-reduced-motion: reduce) {
    .gm *, .gmi * { animation: none !important; }
}
.mode-demo .gmi-thread { margin-top: 128px; width: min(64vw, 300px); }

/* ---------------- Modhiram eduthal: find the ring in the pot ---------------- */
.gmr { padding: 54px max(16px, env(safe-area-inset-right, 0px)) 46px max(16px, env(safe-area-inset-left, 0px)); text-align: center; color: var(--gm-ink); background: linear-gradient(#fbe3a6, #fff8e7); }
.gmr-tamil { margin: 0; font: 500 1.05rem 'Noto Serif Tamil', serif; color: var(--gm-kumkum); }
.gmr h2 { margin: 4px 0 8px; font: 600 clamp(1.9rem, 8vw, 2.5rem)/1.1 'Cinzel', serif; }
.gmr-text { max-width: 38ch; margin: 0 auto 16px; line-height: 1.55; }
.gmr-bet { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 18px; }
.gmr-bet button { max-width: 100%; padding: 10px 18px; border: 2px solid var(--gm-kumkum); border-radius: 99px; background: #fff; color: var(--gm-kumkum); font: 700 .95rem var(--bf); cursor: pointer; overflow-wrap: anywhere; transition: transform .15s, background .2s; }
.gmr-bet button:hover:not(:disabled) { transform: translateY(-2px); }
.gmr-bet button.on { background: var(--gm-kumkum); color: #fff; }
.gmr-bet button:disabled:not(.on) { opacity: .45; cursor: default; }
.gmr-stage { width: min(400px, 100%); margin: 0 auto; overflow: hidden; padding: 14px 10px 16px; border-radius: 22px; background: radial-gradient(circle at 50% 30%, #fff8e7, #f6d57e); box-shadow: inset 0 0 0 2px rgba(201, 154, 60, .45); }
.gmr-score { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.gmr-score > span { display: grid; min-width: 0; }
.gmr-score small { font-size: .78rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gmr-score b { font: 600 1.8rem 'Cinzel', serif; color: var(--gm-kumkum); }
.gmr-round { font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; opacity: .75; }
.gmr-pot { position: relative; display: block; width: 100%; padding: 0; border: 0; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.gmr-pot:disabled { cursor: default; }
.gmr-pot svg { display: block; width: 100%; overflow: visible; }
.gmr-hand { transition: transform .5s cubic-bezier(.3, 1.3, .5, 1); }
.gmr-ha { transform: translate(-36px, -34px); }
.gmr-hb { transform: translate(36px, -34px); }
.gmr-ring { opacity: 0; transition: opacity .3s .2s; }
.gmr[data-step="search"] .gmr-ha { animation: gmrDipA .4s ease-in-out infinite alternate; }
.gmr[data-step="search"] .gmr-hb { animation: gmrDipB .4s .1s ease-in-out infinite alternate; }
.gmr[data-step="search"] .gmr-milk { animation: gmrSwirl .3s ease-in-out infinite alternate; transform-origin: 150px 122px; }
.gmr[data-step="search"] .gmr-splash circle { animation: gmrSplash .45s var(--d) ease-out infinite; }
.gmr[data-win="a"] .gmr-ha, .gmr[data-win="b"] .gmr-hb { transform: translate(0, -64px) rotate(var(--rot, 0deg)); }
.gmr[data-win="a"] .gmr-ha { --rot: -8deg; }
.gmr[data-win="b"] .gmr-hb { --rot: 8deg; }
.gmr[data-win="a"] .gmr-ha .gmr-ring, .gmr[data-win="b"] .gmr-hb .gmr-ring { opacity: 1; animation: gmrShine 1s ease-in-out infinite alternate; }
.gmr-splash circle { opacity: 0; }
.gmr-tap { position: absolute; left: 50%; bottom: 34%; transform: translateX(-50%); padding: 5px 12px; border-radius: 99px; background: rgba(74, 26, 5, .82); color: #fff6dc; font-size: .82rem; font-weight: 700; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .3s; }
.gmr[data-step="ready"] .gmr-tap { opacity: 1; animation: gmrBob 1.2s ease-in-out infinite; }
.gmr-call { min-height: 1.5em; margin: 8px 0 0; font-weight: 700; }
.gmr-final { margin-top: 18px; animation: gmrPop .5s cubic-bezier(.3, 1.6, .5, 1); }
.gmr-final[hidden] { display: none; }
.gmr-crown { margin: 0; font-size: 2.6rem; line-height: 1; }
.gmr-verdict { margin: 6px auto; max-width: 30ch; font: 600 1.25rem/1.35 'Cinzel', serif; color: var(--gm-kumkum); overflow-wrap: anywhere; }
.gmr-you { margin: 0 auto 12px; max-width: 34ch; }
.gmr-again { padding: 9px 18px; border: 0; border-radius: 99px; background: var(--gm-ink); color: #fff6dc; font: 700 .9rem var(--bf); cursor: pointer; }
@keyframes gmrDipA { from { transform: translate(-6px, 4px) rotate(-3deg); } to { transform: translate(4px, 14px) rotate(4deg); } }
@keyframes gmrDipB { from { transform: translate(6px, 4px) rotate(3deg); } to { transform: translate(-4px, 14px) rotate(-4deg); } }
@keyframes gmrSwirl { to { transform: scaleX(.94) translateY(2px); } }
@keyframes gmrSplash { 0% { opacity: .95; transform: translateY(0); } 100% { opacity: 0; transform: translateY(var(--sy)); } }
@keyframes gmrShine { to { filter: drop-shadow(0 0 6px #fff59d) drop-shadow(0 0 12px #ffd54f); } }
@keyframes gmrBob { 50% { transform: translateX(-50%) translateY(-5px); } }
@keyframes gmrPop { from { opacity: 0; transform: scale(.85); } }
@media (prefers-reduced-motion: reduce) { .gmr * { animation: none !important; transition: none !important; } }
