/*
   Royal Traditional – Demo 01 · base
   Concept: a temple-door invitation. Deep maroon and wine for ceremony,
   ivory and cream for reading, antique gold only as ornament and fine line.
   Three colour themes (royal red = default, sapphire blue, emerald green): every themed colour is a token below.
   */
:root {
  /* theme tokens (royal red, the default). Gold is the one constant across all themes. */
  --maroon: #541C27;
  --maroon-hi: #6B2535;      /* lit centre of panels / buttons */
  --maroon-lo: #46161f;
  --wine: #351018;
  --wine-deep: #240b11;
  --wine-ink: #1E080D;       /* near-black used for overlays */
  --gold: #C5A15B;
  --champ: #E6D5A5;
  --ivory: #F8F1E5;
  --cream: #EFE4D0;

  --gold-ink: #7A5C22;      /* gold for TEXT on light grounds (5.5:1 on ivory) */
  --ink: #3A1620;           /* body text on light */
  --ink-soft: #6B4A50;      /* secondary text on light (6.8:1 on ivory) */
  --on-dark: #F8F1E5;
  --on-dark-soft: #E3D3C2;  /* secondary text on maroon / wine */

  /* Telugu letters fall through to NTR automatically (it is only downloaded when Telugu is on the page).
     NTR has one weight, so Telugu never gets a fake bold or slant (see :lang(te) below). */
  --font-display: 'Cormorant Garamond', 'NTR', 'Times New Roman', Georgia, serif;
  --font-body: 'Lato', 'NTR', Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-telugu: 'NTR', serif;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-inout: cubic-bezier(0.77, 0, 0.175, 1);

  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --demo-h: calc(42px + var(--safe-t));

  color-scheme: light;
}

/* colour themes
   Switched with <html data-theme="blue|green">. js/services/theme.js wraps the switch in a View Transition,
   so the browser cross-fades the old and new page on the GPU (see "theme change" further down). */
/* Sapphire blue – midnight navy grounds, cool ivory paper, navy ink. */
html[data-theme="blue"] {
  --maroon: #122C5E; --maroon-hi: #183C78; --maroon-lo: #0D234E;
  --wine: #091B3B; --wine-deep: #061328; --wine-ink: #040F22;
  --ivory: #F5F3EB; --cream: #EAE6D6;
  --ink: #0F2140; --ink-soft: #425571;
  --on-dark: #F5F3EB; --on-dark-soft: #CFDAEC;
}
/* Emerald green – deep forest grounds, soft pistachio-ivory paper, green-black ink. */
html[data-theme="green"] {
  --maroon: #15543B; --maroon-hi: #1D6B49; --maroon-lo: #104631;
  --wine: #0C3524; --wine-deep: #082418; --wine-ink: #051E13;
  --ivory: #F5F3E6; --cream: #E8E6D0;
  --ink: #0E2E22; --ink-soft: #435A4D;
  --on-dark: #F5F3E6; --on-dark-soft: #CFE3D5;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--demo-h) + 8px);
  background: var(--wine);
}
html.is-locked, html.is-locked body, html.is-modal, html.is-modal body { overflow: hidden; }
html.is-modal .lb { overscroll-behavior: contain; touch-action: none; }

/* No scrollbar at all: the progress bar at the top of the page is the scroll indicator.
   Hiding it also means unlocking scroll after the intro can't shift the layout. */
html { scrollbar-width: none; -ms-overflow-style: none; }
::-webkit-scrollbar { display: none; width: 0; height: 0; }
html.is-locked body { height: 100%; }

body {
  margin: 0;
  background: var(--wine);
  color: var(--ink);
  font: 400 1rem/1.7 var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
  overscroll-behavior-y: none;
}

img, svg, canvas { max-width: 100%; }
img { display: block; height: auto; }
button { font: inherit; color: inherit; }
a { color: inherit; }
h1, h2, h3, p, figure, dl, dd, ul { margin: 0; }
ul { padding: 0; list-style: none; }
address { font-style: normal; }
[hidden] { display: none !important; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.lang-te { font-family: var(--font-telugu); line-height: 1.9; }
.icon { flex: none; }

/* layout */
.wrap {
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
  padding-left: max(20px, var(--safe-l));
  padding-right: max(20px, var(--safe-r));
}

.sec {
  position: relative;
  padding-block: clamp(4.5rem, 11vw, 8rem);
  overflow: clip;
  isolation: isolate;
}
.sec--light { background: var(--ivory); color: var(--ink); }
.sec--cream { background: var(--cream); color: var(--ink); }
.sec--dark { background: var(--maroon); color: var(--on-dark); }
.sec--wine { background: var(--wine); color: var(--on-dark); }

/* Section transitions: a mango-leaf toran (mavinakulla) hangs from the previous section's colour, as over a wedding doorway.
   ::before = the string band in the previous section's (themed) colour, ::after = its gold edge lines and knots.
   The swaying leaves themselves are real elements added by js/lib/toran.js (.toran). 1 unit u = 1/44 of the tile width. */
.sec--edge { --lw: 40px; --u: calc(var(--lw) / 44); --lh: calc(var(--u) * 54); padding-top: calc(clamp(4.5rem, 11vw, 8rem) + var(--lh) * 0.42); }
@media (min-width: 760px) { .sec--edge { --lw: 46px; } }
@media (min-width: 1200px) { .sec--edge { --lw: 52px; } }
.sec--edge::before, .sec--edge::after {
  content: "";
  position: absolute; top: -1px; left: 0; right: 0;
  height: calc(var(--u) * 8);
  pointer-events: none;
  background-repeat: repeat-x;
  background-size: var(--lw) calc(var(--u) * 8);
}
.sec--edge::before {
  z-index: 1;
  background-color: var(--prev, var(--wine));
  -webkit-mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2044%208%22%3E%3Cpath%20fill%3D%22%23000%22%20d%3D%22M0%200H44V5.2H0Z%22%2F%3E%3C%2Fsvg%3E") 0 0 / var(--lw) calc(var(--u) * 8) repeat-x;
  mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2044%208%22%3E%3Cpath%20fill%3D%22%23000%22%20d%3D%22M0%200H44V5.2H0Z%22%2F%3E%3C%2Fsvg%3E") 0 0 / var(--lw) calc(var(--u) * 8) repeat-x;
}
.sec--edge::after { z-index: 3; background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2044%208%22%3E%3Cdefs%3E%3CradialGradient%20id%3D%22g%22%20cx%3D%22.35%22%20cy%3D%22.3%22%20r%3D%22.8%22%3E%3Cstop%20offset%3D%220%22%20stop-color%3D%22%23F6EBC4%22%2F%3E%3Cstop%20offset%3D%22.55%22%20stop-color%3D%22%23D4B06A%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23A9843A%22%2F%3E%3C%2FradialGradient%3E%3C%2Fdefs%3E%3Cg%20fill%3D%22none%22%20stroke%3D%22%23B8923F%22%20stroke-linecap%3D%22round%22%3E%3Cpath%20d%3D%22M0%205.2H44%22%20stroke-width%3D%221%22%2F%3E%3Cpath%20d%3D%22M0%201.7H44%22%20stroke-width%3D%22.5%22%20opacity%3D%22.55%22%2F%3E%3C%2Fg%3E%3Ccircle%20cx%3D%2213%22%20cy%3D%225.4%22%20r%3D%222.3%22%20fill%3D%22url(%23g)%22%20stroke%3D%22%238F6D2A%22%20stroke-width%3D%22.5%22%2F%3E%3Ccircle%20cx%3D%2235%22%20cy%3D%225.4%22%20r%3D%222.3%22%20fill%3D%22url(%23g)%22%20stroke%3D%22%238F6D2A%22%20stroke-width%3D%22.5%22%2F%3E%3C%2Fsvg%3E"); }

.toran { position: absolute; z-index: 2; top: -1px; left: 0; right: 0; height: var(--lh); display: flex; gap: calc(var(--u) * 1.5); pointer-events: none; }
.toran__l {
  flex: none; display: block;
  color: var(--prev, var(--wine));
  transform-origin: 50% 7.4%;
  animation: leaf-sway var(--dur, 5s) ease-in-out var(--dl, 0s) infinite alternate paused;
}
.toran__l--b { width: calc(var(--u) * 26); height: calc(var(--u) * 54); }
.toran__l--s { width: calc(var(--u) * 15); height: calc(var(--u) * 46); transform-origin: 50% 11%; }
.is-swaying .toran__l { animation-play-state: running; will-change: transform; }
@keyframes leaf-sway {
  from { transform: rotate(calc(var(--a, 3deg) * -1)); }
  to   { transform: rotate(var(--a, 3deg)); }
}
@media (prefers-reduced-motion: reduce) { .toran__l { animation: none; will-change: auto; } }

/* type */
.eyebrow {
  font: 700 0.72rem/1.4 var(--font-body);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold-ink);
}
.eyebrow--light { color: var(--gold); }

.sec__head { display: grid; justify-items: center; text-align: center; gap: 0.9rem; margin-bottom: clamp(2.5rem, 6vw, 4.5rem); }
.sec__title {
  font: 500 clamp(2.5rem, 8.5vw, 4.4rem)/1.05 var(--font-display);
  letter-spacing: -0.005em;
  text-wrap: balance;
}
.sec--light .sec__title, .sec--cream .sec__title { color: var(--maroon); }
.sec__lead { max-width: 34rem; color: var(--ink-soft); text-wrap: pretty; }
.sec--dark .sec__lead, .sec--wine .sec__lead { color: var(--on-dark-soft); }
.sec__divider { width: min(300px, 70vw); color: var(--gold); }
.sec__divider svg, .venue__divider svg, .closing__divider svg { display: block; width: 100%; height: auto; overflow: visible; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.65em;
  min-height: 42px; padding: 0.72em 1.4em;
  font: 700 0.7rem/1.2 var(--font-body);
  letter-spacing: 0.16em; text-transform: uppercase; text-decoration: none; text-align: center;
  border: 1px solid transparent; border-radius: 2px; cursor: pointer;
  transition: background-color 0.35s, color 0.35s, border-color 0.35s, transform 0.4s var(--ease-out), box-shadow 0.4s, translate 0.35s var(--ease-out);
  touch-action: manipulation;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn--lg { min-height: 48px; padding-inline: 1.8em; font-size: 0.74rem; }
.btn--gold { background: var(--gold); color: var(--wine); }
.btn--gold:hover { background: var(--champ); transform: translateY(-2px); box-shadow: 0 10px 26px -12px rgba(0, 0, 0, 0.55); }
.btn--maroon { background: var(--maroon); color: var(--ivory); border-color: var(--maroon); }
.btn--maroon:hover { background: var(--wine); border-color: var(--gold); transform: translateY(-2px); box-shadow: 0 12px 28px -14px color-mix(in srgb, var(--wine) 70%, transparent); }
.btn--ghost-light { color: var(--champ); border-color: rgba(197, 161, 91, 0.7); background: transparent; }
.btn--ghost-light:hover { background: rgba(197, 161, 91, 0.14); border-color: var(--gold); transform: translateY(-2px); }
.btn--ghost-dark { color: var(--maroon); border-color: color-mix(in srgb, var(--maroon) 55%, transparent); background: transparent; }
.btn--ghost-dark:hover { background: var(--maroon); color: var(--ivory); border-color: var(--maroon); transform: translateY(-2px); }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.sec--light :focus-visible, .sec--cream :focus-visible { outline-color: var(--maroon); }
.btn:focus-visible { outline-offset: 4px; }

/* motion primitives */
/* scroll reveal – elements only wait invisibly when JS is running (html.js) */
html.js [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 30px, 0);
  transition: opacity 0.95s var(--ease-out), transform 1.05s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 110ms);
}
html.js [data-reveal="left"] { transform: translate3d(-44px, 0, 0); }
html.js [data-reveal="right"] { transform: translate3d(44px, 0, 0); }
html.js [data-reveal="zoom"] { transform: scale(0.92); }
html.js [data-reveal="clip"] { transform: none; }
/* card: tips up from below like a page being turned */
html.js [data-reveal="card"] { transform: perspective(1000px) translate3d(0, 54px, 0) rotateX(16deg) scale(0.95); transform-origin: 50% 100%; transition-duration: 1.1s, 1.3s; }
/* cells: the wrapper stays put, its children animate one by one (see sections.css) */
html.js [data-reveal="cells"] { opacity: 1; transform: none; }
html.js [data-reveal].is-in { opacity: 1; transform: none; }

/* scroll-scrubbed paragraphs: JS dims each word, then brightens them as the text reaches reading position */
[data-scrub] .w { transition: opacity 0.18s linear; }

/* images that drift inside their frame get a little extra scale so the drift never shows an edge */
.fx-img { scale: 1.14; will-change: translate; }

/* split text (words / letters rise out of a mask) */
.split__mask { display: inline-block; overflow: hidden; vertical-align: bottom; padding: 0.06em 0.1em 0.14em; margin: -0.06em -0.1em -0.14em; }
.split__unit { display: inline-block; transform: translateY(108%); will-change: transform; }
[data-split-reveal].is-in .split__unit,
.is-revealed .split__unit,
.is-lit .split__unit {
  transform: none;
  transition: transform 1.15s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 70ms + var(--split-delay, 0ms));
}
/* a title that has not been split yet (before JS idle) must still be readable */
[data-split-reveal]:not([data-split]) { opacity: 1; }

/* line-drawn ornaments */
[data-draw] .rt-draw { stroke-dasharray: 1 2; stroke-dashoffset: 1; }
[data-draw] .rt-fade { opacity: 0; }
[data-draw].is-in .rt-draw,
.is-revealed [data-draw] .rt-draw,
.is-lit [data-draw] .rt-draw,
.is-in [data-draw] .rt-draw {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1.9s var(--ease-inout);
}
[data-draw].is-in .rt-draw:nth-of-type(3n+2), .is-revealed [data-draw] .rt-draw:nth-of-type(3n+2), .is-lit [data-draw] .rt-draw:nth-of-type(3n+2), .is-in [data-draw] .rt-draw:nth-of-type(3n+2) { transition-delay: 0.15s; }
[data-draw].is-in .rt-draw:nth-of-type(3n), .is-revealed [data-draw] .rt-draw:nth-of-type(3n), .is-lit [data-draw] .rt-draw:nth-of-type(3n), .is-in [data-draw] .rt-draw:nth-of-type(3n) { transition-delay: 0.3s; }
[data-draw].is-in .rt-fade, .is-revealed [data-draw] .rt-fade, .is-lit [data-draw] .rt-fade, .is-in [data-draw] .rt-fade {
  opacity: 1; transition: opacity 1.2s 1s var(--ease-out);
}

/* decorative keyframes used by the SVG ornaments */
@keyframes twinkle { 0%, 100% { opacity: 0; transform: scale(0.6); } 50% { opacity: 0.95; transform: scale(1); } }
@keyframes flicker {
  0%, 100% { transform: scaleY(1) skewX(0deg); }
  22% { transform: scaleY(1.06) skewX(-1.6deg); }
  47% { transform: scaleY(0.96) skewX(1.2deg); }
  71% { transform: scaleY(1.04) skewX(-0.8deg); }
}
@keyframes breathe { 0%, 100% { transform: scale(0.94); } 50% { transform: scale(1.07); } }
.mandap__spark { opacity: 0; transform-box: fill-box; transform-origin: center; animation: twinkle 4.2s ease-in-out infinite; }
.mandap__fire { animation: flicker 1.7s ease-in-out infinite; }
.diya .glow { transform-box: fill-box; transform-origin: center; }

/* portfolio-demo bar (outside the invitation) */
.demo-bar {
  position: fixed; z-index: 300; top: 0; left: 0; right: 0;
  height: var(--demo-h);
  padding-top: var(--safe-t);
  background: color-mix(in srgb, var(--wine-ink) 94%, transparent);
  border-bottom: 1px solid rgba(197, 161, 91, 0.3);
  color: var(--champ);
}
.demo-bar__inner {
  height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-left: max(14px, var(--safe-l)); padding-right: max(10px, var(--safe-r));
}
.demo-bar__studio, .demo-footer__studio, .demo-footer__fine a { color: inherit; text-decoration: none; border-bottom: 1px solid rgba(197, 161, 91, 0.45); transition: color 0.2s, border-color 0.2s; }
.demo-bar__studio:hover, .demo-footer__studio:hover, .demo-footer__fine a:hover { color: var(--gold); border-color: var(--gold); }
.demo-footer__studio { font-weight: 700; }
.demo-bar__badge { display: inline-flex; align-items: center; gap: 0.6em; font: 700 0.68rem/1 var(--font-body); letter-spacing: 0.22em; text-transform: uppercase; white-space: nowrap; }
.demo-bar__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 3px rgba(197, 161, 91, 0.22); }
.demo-bar__cta {
  display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 14px;
  background: var(--gold); color: var(--wine); border-radius: 999px; text-decoration: none;
  font: 700 0.68rem/1 var(--font-body); letter-spacing: 0.14em; text-transform: uppercase; white-space: nowrap;
  transition: background-color 0.3s, transform 0.3s var(--ease-out);
}
.demo-bar__cta:hover { background: var(--champ); transform: translateY(-1px); }
.demo-bar__cta-long { display: none; }
@media (min-width: 560px) { .demo-bar__cta-long { display: inline; } .demo-bar__cta-short { display: none; } }
.demo-bar__sub { display: none; } /* "· Royal Traditional" only where the bar has room for it */
@media (min-width: 680px) { .demo-bar__sub { display: inline; } }
.demo-bar__actions { display: flex; align-items: center; gap: 10px; }
@media (max-width: 420px) { .demo-bar__inner { gap: 8px; } .demo-bar__badge { font-size: 0.6rem; letter-spacing: 0.15em; gap: 0.5em; } .demo-bar__cta { padding: 0 11px; letter-spacing: 0.1em; } .demo-bar__actions { gap: 8px; } }

/* theme picker */
.theme { position: relative; }
.theme__btn {
  display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border-radius: 50%; cursor: pointer;
  background: color-mix(in srgb, var(--wine) 60%, transparent); border: 1px solid color-mix(in srgb, var(--gold) 70%, transparent);
  transition: transform 0.35s var(--ease-out), border-color 0.3s, box-shadow 0.3s;
}
.theme__btn:hover { transform: scale(1.08); border-color: var(--gold); }
.theme__btn:focus-visible, .theme__opt:focus-visible { outline: 2px solid var(--champ); outline-offset: 3px; }
.theme.is-open .theme__btn { border-color: var(--champ); box-shadow: 0 0 0 3px rgba(197, 161, 91, 0.25); }
/* the three themes, as one little disc */
.theme__disc { width: 20px; height: 20px; border-radius: 50%; background: conic-gradient(from -30deg, #8C2A3E 0 120deg, #2B5FB8 120deg 240deg, #2A8A64 240deg 360deg); box-shadow: inset 0 0 0 1.5px rgba(248, 241, 229, 0.85), 0 0 0 1px rgba(0, 0, 0, 0.25); transition: transform 0.6s var(--ease-out); }
.theme.is-open .theme__disc { transform: rotate(120deg); }
.theme__menu {
  position: absolute; top: calc(100% + 12px); right: -2px; width: 244px; padding: 8px;
  background: color-mix(in srgb, var(--wine-ink) 97%, transparent); border: 1px solid color-mix(in srgb, var(--gold) 60%, transparent); border-radius: 8px;
  box-shadow: 0 24px 50px -16px rgba(0, 0, 0, 0.8), 0 0 0 4px color-mix(in srgb, var(--wine-ink) 50%, transparent);
  opacity: 0; transform: translateY(-8px) scale(0.97); transform-origin: 90% 0; transition: opacity 0.25s, transform 0.35s var(--ease-out);
}
.theme.is-open .theme__menu { opacity: 1; transform: none; }
@media (max-width: 560px) { .theme { position: static; } .theme__menu { position: fixed; top: calc(var(--demo-h) + var(--safe-t) + 10px); right: 12px; width: min(260px, calc(100vw - 24px)); transform-origin: 100% 0; } }
.theme__title { padding: 6px 10px 8px; font: 700 0.6rem/1 var(--font-body); letter-spacing: 0.24em; text-transform: uppercase; color: var(--gold); }
.theme__opt {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 10px; text-align: left; cursor: pointer;
  background: transparent; border: 1px solid transparent; border-radius: 6px; color: var(--on-dark);
  transition: background-color 0.25s, border-color 0.25s;
}
.theme__opt:hover { background: rgba(197, 161, 91, 0.1); }
.theme__opt[aria-checked="true"] { background: rgba(197, 161, 91, 0.14); border-color: rgba(197, 161, 91, 0.55); }
.theme__chip { position: relative; flex: none; width: 40px; height: 40px; border-radius: 5px; background: linear-gradient(135deg, var(--a) 0 52%, var(--b) 52% 100%); box-shadow: inset 0 0 0 1px rgba(197, 161, 91, 0.75); }
.theme__chip::after { content: ""; position: absolute; right: 6px; bottom: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 2px var(--b); }
.theme__txt { display: grid; gap: 3px; min-width: 0; flex: 1; }
.theme__name { font: 600 1.02rem/1.1 var(--font-display); letter-spacing: 0.02em; }
.theme__note { font: 400 0.68rem/1.2 var(--font-body); letter-spacing: 0.08em; color: var(--on-dark-soft); }
.theme__tick { color: var(--gold); opacity: 0; transform: scale(0.6); transition: opacity 0.25s, transform 0.35s var(--ease-out); }
.theme__opt[aria-checked="true"] .theme__tick { opacity: 1; transform: none; }

/* theme change: the browser cross-fades a snapshot of the old page into the new one */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.7s; animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1); }
html.is-theming { cursor: progress; }
/* the gold light-sweep: the band is captured as its own layer, and that layer is what slides across the screen */
.theme-sweep {
  position: fixed; z-index: 250; top: -10%; bottom: -10%; left: 0; width: 34%; pointer-events: none;
  view-transition-name: theme-sweep;
  background: linear-gradient(100deg, transparent 0%, rgba(197, 161, 91, 0.12) 28%, rgba(240, 222, 170, 0.3) 50%, rgba(197, 161, 91, 0.12) 72%, transparent 100%);
}
::view-transition-group(theme-sweep) { animation: theme-sweep 1.1s cubic-bezier(0.77, 0, 0.175, 1) both; }
::view-transition-old(theme-sweep) { display: none; }
::view-transition-new(theme-sweep) { animation: none; mix-blend-mode: normal; }
@keyframes theme-sweep { 0% { transform: translateX(-110%) skewX(-14deg); opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { transform: translateX(400%) skewX(-14deg); opacity: 0; } }

/* reading progress hairline */
.progress { position: fixed; z-index: 290; top: var(--demo-h); left: 0; right: 0; height: 2px; pointer-events: none; }
.progress i { display: block; height: 100%; background: var(--gold); transform: scaleX(0); transform-origin: left; }

/* floating music control */
.music {
  position: fixed; z-index: 250;
  right: max(14px, var(--safe-r)); bottom: calc(14px + var(--safe-b));
  display: flex; align-items: center; gap: 10px;
  opacity: 0; transform: translateY(14px) scale(0.9);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}
.music.is-in { opacity: 1; transform: none; }
.music__btn {
  position: relative; display: grid; place-items: center; width: 62px; height: 62px; flex: none;
  border-radius: 50%; cursor: pointer;
  background: radial-gradient(circle at 35% 28%, var(--maroon-hi), var(--maroon) 62%, var(--wine));
  color: var(--gold); border: 1px solid var(--gold);
  box-shadow: inset 0 0 0 3px var(--maroon), inset 0 0 0 4px rgba(197, 161, 91, 0.55), 0 0 0 4px color-mix(in srgb, var(--wine) 55%, transparent), 0 14px 30px -10px rgba(0, 0, 0, 0.7);
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s;
  touch-action: manipulation;
}
.music__btn:hover { transform: scale(1.07); }
.music__btn:focus-visible { outline: 2px solid var(--champ); outline-offset: 5px; }
.music__inst { display: block; overflow: visible; transform-origin: 50% 55%; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.55)); }
/* the ring that ripples out while the music plays */
.music__ring { position: absolute; inset: -1px; border-radius: 50%; border: 1px solid var(--gold); opacity: 0; pointer-events: none; }
.music__notes { position: absolute; inset: 0; pointer-events: none; }
.music__note { position: absolute; left: 12px; bottom: 16px; color: var(--champ); opacity: 0; }
.music.is-playing .music__btn { box-shadow: inset 0 0 0 3px var(--maroon), inset 0 0 0 4px var(--champ), 0 0 0 4px color-mix(in srgb, var(--wine) 55%, transparent), 0 0 26px -2px rgba(197, 161, 91, 0.55), 0 14px 30px -10px rgba(0, 0, 0, 0.7); }
.music.is-playing .music__inst { animation: nd-sway 2.6s ease-in-out infinite; }
.music.is-playing .music__ring { animation: nd-ring 2.6s ease-out infinite; }
.music.is-playing .music__note { animation: nd-note 3s ease-out infinite; }
.music.is-playing .music__note.n2 { animation-delay: -1s; left: 6px; }
.music.is-playing .music__note.n3 { animation-delay: -2s; left: 18px; }
@keyframes nd-sway { 0%, 100% { transform: rotate(-5deg); } 50% { transform: rotate(5deg) translateY(-1px); } }
@keyframes nd-ring { 0% { transform: scale(1); opacity: 0.6; } 100% { transform: scale(1.65); opacity: 0; } }
@keyframes nd-note { 0% { transform: translate(0, 0) rotate(-8deg) scale(0.7); opacity: 0; } 15% { opacity: 0.95; } 100% { transform: translate(-30px, -46px) rotate(14deg) scale(1.05); opacity: 0; } }

/* section dots (desktop) */
.dots { display: none; }
@media (min-width: 1100px) {
  .dots { display: block; position: fixed; z-index: 240; right: max(18px, var(--safe-r)); top: 50%; transform: translateY(-50%); }
  .dots ul { display: grid; gap: 4px; }
  .dots a { position: relative; display: flex; align-items: center; justify-content: flex-end; gap: 12px; min-width: 28px; height: 28px; text-decoration: none; }
  .dots__dot { width: 9px; height: 9px; border-radius: 50%; border: 1px solid var(--gold); background: color-mix(in srgb, var(--wine) 70%, transparent); transition: transform 0.35s var(--ease-out), background-color 0.35s; }
  .dots a[aria-current="true"] .dots__dot { background: var(--gold); transform: scale(1.35); }
  .dots a:hover .dots__dot { transform: scale(1.35); }
  .dots__label {
    padding: 4px 10px; background: var(--wine); color: var(--champ); border: 1px solid rgba(197, 161, 91, 0.4); border-radius: 2px;
    font: 700 0.62rem/1.2 var(--font-body); letter-spacing: 0.18em; text-transform: uppercase; white-space: nowrap;
    opacity: 0; transform: translateX(6px); pointer-events: none; transition: opacity 0.3s, transform 0.4s var(--ease-out);
  }
  .dots a:hover .dots__label, .dots a:focus-visible .dots__label { opacity: 1; transform: none; }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  .theme__menu, .theme__disc { transition: none; }
  html { scroll-behavior: auto; }
  html.js [data-reveal], html.js [data-reveal="left"], html.js [data-reveal="right"], html.js [data-reveal="zoom"], html.js [data-reveal="card"] { opacity: 1; transform: none; transition: none; }
  [data-scrub] .w { opacity: 1 !important; }
  .fx-img { scale: 1; }
  .split__unit { transform: none !important; transition: none !important; }
  [data-draw] .rt-draw { stroke-dashoffset: 0; transition: none; }
  [data-draw] .rt-fade { opacity: 1; transition: none; }
  .mandap__spark { animation: none; opacity: 0.8; }
  .mandap__fire, .music.is-playing .music__inst, .music.is-playing .music__ring, .music.is-playing .music__note { animation: none; }
  .music.is-playing .music__note.n1 { opacity: 0.9; transform: translate(-14px, -22px); }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}


/*
   v1 additions: client mode, languages, preview, monogram
   */

/* client invitations have no demo bar: everything that made room for it starts at the safe area instead */
html[data-mode="client"] { --demo-h: var(--safe-t); }

.noscript { position: fixed; inset: 0; display: grid; place-items: center; padding: 2rem; text-align: center; background: var(--wine); color: var(--on-dark); font: 1.1rem/1.6 var(--font-display); }

/* language change: a quick fade out, and back in on the reloaded page */
html.is-switching body { opacity: 0; transition: opacity 0.22s ease; }
html.is-resuming body { opacity: 0; animation: lx-unhide 0.3s ease 1.6s forwards; } /* safety net if scripts fail */
@keyframes lx-unhide { to { opacity: 1; } }
html.is-resumed body { opacity: 1; transition: opacity 0.38s ease; }

/* Telugu typography
   Telugu needs more line height for vowel signs above and below, no letter-spacing or capitals (it has none),
   and never a slanted fake italic. :lang(te) matches the whole page in Telugu, and Telugu accent lines in English. */
:lang(te) { font-synthesis: none; }
:lang(te):is(.eyebrow, .btn, .person__role, .person__parents span, .countdown__when, .cd__label, .event__day, .map-card__load, .map-card__open,
  .closing__family, .intro__date, .intro__open, .hero__month, .hero__when, .hero__cue, .dots__label, .theme__title, .demo-bar__cta, .lang-switch__opt) {
  letter-spacing: 0.02em; text-transform: none;
}
html[data-lang="te"] body { line-height: 1.85; }
html[data-lang="te"] :is(.sec__title, .person__name, .event__name, .venue__title, .closing__thanks, .hero__names, .intro__names, .demo-footer__title) { line-height: 1.35; font-style: normal; }
html[data-lang="te"] .split__mask { padding-block: 0.16em 0.22em; margin-block: -0.16em -0.22em; }
/* small labels: Telugu letters are denser than Latin capitals, so they need a larger size to stay readable */
html[data-lang="te"] :is(.eyebrow, .person__role, .person__parents span, .event__day, .closing__family, .countdown__when, .hero__when, .intro__date) { font-size: 0.86rem; font-weight: 400; }
html[data-lang="te"] :is(.btn, .intro__open, .map-card__load, .map-card__open, .demo-bar__cta, .dots__label) { font-size: 0.84rem; font-weight: 400; }
html[data-lang="te"] .cd__label { font-size: clamp(0.72rem, 2.4vw, 0.84rem); font-weight: 400; padding-left: 0; }
html[data-lang="te"] .hero__cue { font-size: 0.78rem; font-weight: 400; }
/* dates: Telugu month names must never be letter-spaced (flourish.css animates the spacing for Latin months) */
html[data-lang="te"] :is(.hero__month, .closing__date) { letter-spacing: 0.02em !important; font-size: 0.95rem; }
html[data-lang="te"] .closing__date { font-size: clamp(1.15rem, 3.4vw, 1.4rem); padding-left: 0; }

/* language switch */
.lang-switch { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 999px; }
.lang-switch__opt {
  min-width: 44px; min-height: 36px; padding: 0 12px; border: 0; border-radius: 999px; background: transparent; cursor: pointer;
  font: 700 0.7rem/1 var(--font-body); letter-spacing: 0.14em; color: inherit; opacity: 0.72;
  transition: background-color 0.3s, color 0.3s, opacity 0.3s; touch-action: manipulation;
}
.lang-switch__opt:lang(te) { font-family: var(--font-telugu); font-size: 0.9rem; font-weight: 400; letter-spacing: 0; }
.lang-switch__opt:hover { opacity: 1; }
.lang-switch__opt[aria-pressed="true"] { opacity: 1; background: var(--gold); color: var(--wine-deep); cursor: default; }
.lang-switch__opt:focus-visible { outline: 2px solid var(--champ); outline-offset: 2px; }
.lang-switch__sep { display: none; }

/* on the cover, under "Open Invitation" */
.lang-switch--cover { margin-top: 0.9rem; border: 1px solid rgba(197, 161, 91, 0.45); color: var(--champ); }
.lang-switch--cover .lang-switch__opt { min-height: 34px; padding: 0 16px; font-size: 0.66rem; }
.lang-switch--cover .lang-switch__opt:lang(te) { font-size: 0.86rem; }

/* floating, once the invitation is open (client invitations) */
.lang-switch--float {
  position: fixed; z-index: 300; top: calc(12px + var(--safe-t)); right: max(12px, var(--safe-r));
  background: color-mix(in srgb, var(--wine) 82%, transparent); color: var(--champ);
  border: 1px solid rgba(197, 161, 91, 0.45); box-shadow: 0 10px 24px -14px rgba(0, 0, 0, 0.6);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  opacity: 0; translate: 0 -8px; pointer-events: none; transition: opacity 0.5s var(--ease-out), translate 0.5s var(--ease-out);
}
html.is-open .lang-switch--float { opacity: 1; translate: 0 0; pointer-events: auto; }
html.is-modal .lang-switch--float { opacity: 0; pointer-events: none; }

/* inside the demo bar */
.lang-switch--bar { color: var(--champ); border: 1px solid rgba(197, 161, 91, 0.4); padding: 2px; }
.lang-switch--bar .lang-switch__opt { min-width: 36px; min-height: 28px; padding: 0 9px; font-size: 0.6rem; }
.lang-switch--bar .lang-switch__opt:lang(te) { font-size: 0.78rem; }

/* preview badge (private preview links only) */
.preview-badge {
  position: fixed; z-index: 310; left: max(12px, var(--safe-l)); bottom: calc(14px + var(--safe-b));
  display: inline-flex; align-items: center; gap: 0.6em; padding: 8px 14px; border-radius: 999px;
  background: var(--champ); color: var(--wine-deep); box-shadow: 0 10px 26px -12px rgba(0, 0, 0, 0.65);
  font: 400 0.72rem/1.2 var(--font-body); pointer-events: none;
}
.preview-badge strong { font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; }
.preview-badge strong:lang(te) { letter-spacing: 0; }
.preview-badge__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--maroon); animation: preview-pulse 1.8s ease-in-out infinite; }
@keyframes preview-pulse { 50% { opacity: 0.35; } }
/* client invitations: top centre, clear of the text (the demo bar owns the top in samples) */
html[data-mode="client"] .preview-badge { top: calc(10px + var(--safe-t)); bottom: auto; left: 50%; translate: -50% 0; }

/* closing credit (client invitations) */
.studio-credit { background: var(--wine-deep); color: var(--on-dark-soft); text-align: center; padding: 1.6rem 1rem calc(5.5rem + var(--safe-b)); border-top: 1px solid rgba(197, 161, 91, 0.28); }
.studio-credit p { font: 400 0.74rem/1.6 var(--font-body); letter-spacing: 0.08em; }
.studio-credit a { color: var(--gold); text-decoration: none; font-weight: 700; letter-spacing: 0.26em; padding: 10px 2px; }
.studio-credit a:hover { color: var(--champ); }
.studio-credit a:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
