/* =========================================================
   Gayathri Matrimonial Services
   One continuous "wedding invitation" page on an ivory ground.
   ========================================================= */

/* ---------- Fonts (self-hosted, SIL Open Font License) ---------- */
@font-face { font-family: "Cormorant Garamond"; font-weight: 500; font-style: normal; font-display: swap;
  src: url("assets/fonts/cormorant-garamond-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-weight: 600; font-style: normal; font-display: swap;
  src: url("assets/fonts/cormorant-garamond-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-weight: 500; font-style: italic; font-display: swap;
  src: url("assets/fonts/cormorant-garamond-latin-500-italic.woff2") format("woff2"); }
@font-face { font-family: "Marcellus"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("assets/fonts/marcellus-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Lora"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("assets/fonts/lora-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Lora"; font-weight: 500; font-style: normal; font-display: swap;
  src: url("assets/fonts/lora-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Lora"; font-weight: 400; font-style: italic; font-display: swap;
  src: url("assets/fonts/lora-latin-400-italic.woff2") format("woff2"); }

/* ---------- Tokens ---------- */
:root {
  --ivory: #FFF9ED;
  --maroon: #800020;
  --maroon-deep: #64001A;
  --gold: #C5A059;
  --gold-text: #87662A;      /* darker gold for small text: passes WCAG AA on ivory */
  --champagne: #F4E6C8;
  --charcoal: #30251F;
  --leaf: #1F6B45;           /* mango-leaf green, used only for WhatsApp + thoranam */
  --leaf-deep: #175536;

  --display: "Cormorant Garamond", "Cormorant", Garamond, "Times New Roman", serif;
  --label: "Marcellus", "Cormorant Garamond", Georgia, serif;
  --body: "Lora", Georgia, "Times New Roman", serif;

  --frame-inset: 16px;
  --corner: 104px;
  --nav-h: 76px;
  --bar-h: 0px;
  --gutter: clamp(20px, 6vw, 128px);
  --measure: 1080px;

  --k-line: var(--gold);
  --k-dot: var(--maroon);
  --k-fill: none;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + 12px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  background: var(--ivory);
  color: var(--charcoal);
  font-family: var(--body);
  font-size: 1.125rem;          /* 18px: comfortable for older readers */
  line-height: 1.7;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  padding-bottom: var(--bar-h);
}
img, svg { display: block; max-width: 100%; }
a { color: var(--maroon); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--maroon-deep); }
h1, h2, h3 { font-family: var(--display); color: var(--maroon); font-weight: 600; line-height: 1.12; margin: 0; }
h2 { font-size: clamp(2.1rem, 1.5rem + 2.4vw, 3.25rem); letter-spacing: -0.005em; text-wrap: balance; }
h3 { font-size: 1.6rem; }
p { margin: 0 0 1em; }
strong { font-weight: 500; color: var(--charcoal); }

:focus-visible { outline: 2px solid var(--maroon); outline-offset: 3px; border-radius: 4px; }

.skip-link {
  position: absolute; left: 50%; top: -60px; transform: translateX(-50%);
  background: var(--maroon); color: var(--ivory); padding: 10px 18px; border-radius: 0 0 8px 8px;
  z-index: 100; text-decoration: none; font-family: var(--label);
}
.skip-link:focus { top: 0; color: var(--ivory); }

.icon { width: 1.25em; height: 1.25em; flex: none; }

.eyebrow {
  font-family: var(--label);
  font-size: 0.875rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-text);
  margin: 0 0 0.9rem;
}

/* ---------- Kolam symbols ---------- */
.k-line { fill: var(--k-fill); stroke: var(--k-line); stroke-width: 1.35; stroke-linecap: round; stroke-linejoin: round; }
.k-dot  { fill: var(--k-dot); }

/* ---------- The fixed invitation frame ---------- */
.frame {
  position: fixed; inset: 0; z-index: 55; pointer-events: none;
}
.frame::before, .frame::after {
  content: ""; position: absolute; border-style: solid; border-color: var(--gold);
}
.frame::before { inset: var(--frame-inset); border-width: 1px; opacity: 0.85; }
.frame::after  { inset: calc(var(--frame-inset) + 5px); border-width: 0.5px; border-color: var(--maroon); opacity: 0.28; }
.frame__corner {
  position: absolute; width: var(--corner); height: var(--corner);
  --k-fill: var(--ivory);           /* the kolam sits on ivory and "breaks" the hairlines */
  --k-line: var(--gold);
}
.frame__corner .k-line { stroke-width: 1.5; }
.frame__corner--tl { top: 2px; left: 2px; }
.frame__corner--tr { top: 2px; right: 2px; transform: scaleX(-1); }
.frame__corner--bl { bottom: 2px; left: 2px; transform: scaleY(-1); }
.frame__corner--br { bottom: 2px; right: 2px; transform: scale(-1); }

/* ---------- Navigation ---------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  padding: calc(var(--frame-inset) + 6px) calc(var(--corner) + 8px) 0;
  background: var(--ivory);
  box-shadow: 0 1px 0 rgba(197, 160, 89, 0.35);
}
.nav {
  max-width: 1180px; margin: 0 auto; height: calc(var(--nav-h) - var(--frame-inset) - 6px);
  display: flex; align-items: center; gap: 24px;
}
.nav__brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--maroon); margin-right: auto; }
.nav__mark { width: 34px; height: 34px; }
.nav__brand-text { font-family: var(--display); font-weight: 600; font-size: 1.45rem; line-height: 1; display: flex; flex-direction: column; }
.nav__brand-text small { font-family: var(--label); font-size: 0.62rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold-text); margin-top: 4px; font-weight: 400; }

.nav__menu { list-style: none; margin: 0; padding: 0; display: flex; gap: clamp(14px, 2vw, 30px); }
.nav__link {
  position: relative; display: block; padding: 10px 2px;
  font-family: var(--label); font-size: 0.95rem; letter-spacing: 0.06em;
  color: var(--charcoal); text-decoration: none;
}
.nav__link::after {        /* active indicator: a small gold lozenge that grows into a hairline */
  content: ""; position: absolute; left: 50%; bottom: 2px; width: 6px; height: 6px;
  background: var(--gold); transform: translateX(-50%) rotate(45deg) scale(0);
  transition: transform 0.35s ease;
}
.nav__link::before {
  content: ""; position: absolute; left: 50%; right: 50%; bottom: 4.5px; height: 1px; background: var(--gold);
  transition: left 0.35s ease, right 0.35s ease;
}
.nav__link:hover { color: var(--maroon); }
.nav__link.is-active { color: var(--maroon); }
.nav__link.is-active::after { transform: translateX(-50%) rotate(45deg) scale(1); }
.nav__link.is-active::before { left: 18%; right: 18%; }

.nav__call {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border: 1px solid var(--maroon); border-radius: 999px; color: var(--maroon); text-decoration: none;
  font-family: var(--label); font-size: 0.95rem; letter-spacing: 0.04em; white-space: nowrap;
  transition: background 0.25s ease, color 0.25s ease;
}
.nav__call:hover { background: var(--maroon); color: var(--ivory); }
.nav__call .icon { width: 1.05em; height: 1.05em; }

.nav__toggle { display: none; }

/* ---------- Layout ---------- */
main { position: relative; }
.section {
  max-width: calc(var(--measure) + var(--gutter) * 2);
  margin: 0 auto;
  padding: clamp(40px, 6vw, 72px) var(--gutter);
}
.section__head { text-align: center; max-width: 720px; margin: 0 auto clamp(40px, 5vw, 64px); }
.section__lede { margin-top: 1.1rem; color: #5A4A40; }

/* ---------- Divider: kolam + hairlines, draws itself in ---------- */
.divider {
  display: flex; align-items: center; justify-content: center; gap: 18px;
  max-width: 560px; margin: 0 auto; padding: 0 var(--gutter);
}
.divider__line { flex: 1; height: 1px; background: linear-gradient(90deg, rgba(197,160,89,0), var(--gold)); }
.divider__line:last-child { background: linear-gradient(270deg, rgba(197,160,89,0), var(--gold)); }
.divider__kolam { width: 64px; height: 64px; flex: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; padding: 0 28px; border-radius: 999px;
  font-family: var(--label); font-size: 1.06rem; letter-spacing: 0.04em; text-decoration: none;
  border: 1.5px solid transparent;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--maroon); color: var(--ivory); border-color: var(--maroon); box-shadow: inset 0 0 0 3px var(--maroon), inset 0 0 0 4px rgba(197,160,89,0.75); }
.btn--primary:hover { background: var(--maroon-deep); color: var(--ivory); }
.btn--wa { background: transparent; color: var(--leaf); border-color: var(--leaf); }
.btn--wa:hover { background: var(--leaf); color: #fff; }

.cta-pair { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: calc(var(--nav-h) + 4px) var(--gutter) clamp(36px, 5vw, 64px);
  min-height: min(100svh, 860px);
  display: flex; flex-direction: column; align-items: center;
}
.thoranam { width: min(100%, 980px); height: auto; margin: 0 auto; overflow: visible; }
.thoranam g { transform-box: fill-box; transform-origin: 50% 0; }
.hero__inner {
  position: relative; text-align: center; max-width: 820px; width: 100%;
  margin: clamp(10px, 2vw, 26px) auto 0; padding: clamp(10px, 2vw, 24px) clamp(8px, 4vw, 56px) 0;
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.hero__corner { position: absolute; width: 40px; height: 40px; top: -6px; display: none; }
.hero__corner--l { left: 0; }
.hero__corner--r { right: 0; }

.hero__title { display: flex; flex-direction: column; align-items: center; margin-bottom: 1.1rem; }
.hero__name {
  font-size: clamp(3.6rem, 2rem + 6.5vw, 7rem); line-height: 0.92; letter-spacing: -0.01em;
}
.hero__name-sub {
  font-family: var(--label); font-weight: 400; font-size: clamp(0.95rem, 0.8rem + 0.7vw, 1.3rem);
  letter-spacing: 0.34em; text-transform: uppercase; color: var(--charcoal); margin-top: 0.7rem;
  padding-left: 0.34em;
}
.rule { display: flex; align-items: center; gap: 10px; width: min(260px, 70%); margin: 0 auto 1.2rem; }
.rule span { flex: 1; height: 1px; background: var(--gold); }
.rule i { width: 7px; height: 7px; background: var(--gold); transform: rotate(45deg); box-shadow: 0 0 0 3px var(--ivory), 0 0 0 4px var(--gold); }
.hero__headline {
  font-family: var(--display); font-style: italic; font-weight: 500;
  font-size: clamp(1.75rem, 1.2rem + 2vw, 2.6rem); line-height: 1.2; color: var(--maroon);
  margin-bottom: 0.8rem; text-wrap: balance;
}
.hero__copy { max-width: 34em; color: #4A3B33; margin-bottom: 1.8rem; text-wrap: balance; }
.hero__meta { margin: 1.4rem 0 0; font-family: var(--label); letter-spacing: 0.06em; font-size: 0.98rem; color: #5A4A40; }
.hero__meta a { text-decoration: none; }
.hero__meta span { margin: 0 0.6em; color: var(--gold); }

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: minmax(240px, 380px) 1fr; gap: clamp(40px, 6vw, 88px); align-items: center; }
.portrait { margin: 0; }
.portrait__arch {
  position: relative; aspect-ratio: 4 / 5; border-radius: 999px 999px 6px 6px; overflow: hidden;
  background: var(--champagne);
  box-shadow: 0 0 0 1px var(--gold), 0 0 0 8px var(--ivory), 0 0 0 9px rgba(128, 0, 32, 0.3);
  margin: 10px;
}
.portrait__arch img { width: 100%; height: 100%; object-fit: cover; }
.portrait__placeholder {
  position: absolute; inset: 0; display: grid; place-items: center;
  background:
    radial-gradient(circle at 50% 40%, rgba(255, 249, 237, 0.9), rgba(244, 230, 200, 0) 62%),
    var(--champagne);
}
.portrait__placeholder { align-content: center; gap: 14px; }
.portrait__placeholder svg { width: 84px; height: 84px; margin: 0 auto; }
.portrait__initial {
  display: grid; place-items: center; width: 118px; height: 118px; margin: 0 auto; border-radius: 50%;
  border: 1px solid var(--gold); box-shadow: 0 0 0 6px var(--champagne), 0 0 0 7px rgba(128, 0, 32, 0.25);
  font-family: var(--display); font-style: italic; font-weight: 500; font-size: 4.2rem; color: var(--maroon); line-height: 1; padding-bottom: 0.08em;
}
.portrait figcaption { text-align: center; margin-top: 18px; font-size: 0.95rem; color: #5A4A40; }
.portrait figcaption strong { display: block; font-family: var(--display); font-size: 1.5rem; color: var(--maroon); font-weight: 600; }

.about__text h2 { margin-bottom: 1.4rem; }
.values { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; gap: 0; border-top: 1px solid rgba(197, 160, 89, 0.55); }
.values li { position: relative; padding: 16px 0 16px 34px; border-bottom: 1px solid rgba(197, 160, 89, 0.55); font-size: 1.02rem; color: #4A3B33; }
.values li::before { content: ""; position: absolute; left: 6px; top: 27px; width: 8px; height: 8px; background: var(--maroon); transform: rotate(45deg); }
.values strong { display: block; font-family: var(--display); font-size: 1.35rem; font-weight: 600; color: var(--maroon); line-height: 1.3; }

/* ---------- Communities ---------- */
.communities__list { display: grid; grid-template-columns: repeat(3, 1fr); }
.community {
  position: relative; text-align: center; padding: 8px clamp(18px, 3vw, 44px) 12px;
  display: flex; flex-direction: column; align-items: center;
}
.community + .community::before {        /* delicate vertical divider with a lozenge */
  content: ""; position: absolute; left: 0; top: 12%; bottom: 12%; width: 1px;
  background: linear-gradient(rgba(197,160,89,0), var(--gold) 30%, var(--gold) 70%, rgba(197,160,89,0));
}
.community + .community::after {
  content: ""; position: absolute; left: -4px; top: 50%; width: 8px; height: 8px; background: var(--ivory);
  border: 1px solid var(--gold); transform: rotate(45deg);
}
.community__kolam { width: 64px; height: 64px; margin-bottom: 14px; }
.community h3 { font-size: clamp(1.9rem, 1.5rem + 1vw, 2.3rem); margin-bottom: 0.8rem; }
.community h3 span { display: block; font-family: var(--label); font-weight: 400; font-size: 0.78rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--gold-text); margin-top: 8px; }
.community p { color: #4A3B33; flex: 1; max-width: 22em; }
.link-wa {
  display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 20px; margin-top: 6px;
  border: 1px solid rgba(31, 107, 69, 0.55); border-radius: 999px; color: var(--leaf); text-decoration: none;
  font-family: var(--label); font-size: 0.98rem; letter-spacing: 0.02em;
  transition: background 0.25s ease, color 0.25s ease;
}
.link-wa:hover { background: var(--leaf); color: #fff; }
.link-wa .icon { width: 1.1em; height: 1.1em; }

/* ---------- How it works: ceremonial timeline ---------- */
.journey__steps {
  list-style: none; margin: 0; padding: 0; position: relative;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(16px, 2.5vw, 36px);
}
.journey__steps::before {          /* the gold thread */
  content: ""; position: absolute; top: 31px; left: 12.5%; right: 12.5%; height: 1px;
  background: var(--gold); transform-origin: left center;
}
.step { position: relative; text-align: center; }
.step__num {
  position: relative; z-index: 1; display: grid; place-items: center; width: 62px; height: 62px; margin: 0 auto 22px;
  font-family: var(--display); font-weight: 600; font-size: 1.85rem; color: var(--maroon); line-height: 1;
  background: var(--ivory); border: 1px solid var(--gold); border-radius: 50%;
  box-shadow: 0 0 0 5px var(--ivory), 0 0 0 6px rgba(197, 160, 89, 0.45);
}
.step h3 { font-size: 1.45rem; margin-bottom: 0.6rem; text-wrap: balance; }
.step p { font-size: 1.02rem; color: #4A3B33; }
.journey__note {
  max-width: 40em; margin: clamp(28px, 4vw, 48px) auto 0; text-align: center;
  font-style: italic; color: #5A4A40;
}

/* ---------- Contact ---------- */
.contact { padding-bottom: clamp(48px, 7vw, 96px); }
.contact__card {
  position: relative; max-width: 760px; margin: 0 auto; text-align: center;
  padding: clamp(36px, 5vw, 60px) clamp(22px, 5vw, 64px) clamp(32px, 4vw, 48px);
  border: 1px solid var(--gold); outline: 1px solid rgba(128, 0, 32, 0.22); outline-offset: 6px;
  background: linear-gradient(180deg, rgba(244, 230, 200, 0.55), rgba(255, 249, 237, 0) 70%);
}
.vilakku { width: 116px; height: auto; margin: 0 auto 18px; overflow: visible; }
.vilakku__flames path:nth-child(odd) { transform-box: fill-box; transform-origin: 50% 100%; }
.contact__card h2 { margin-bottom: 0.9rem; }
.contact__lede { font-size: 1.15rem; color: #4A3B33; }
.contact__details {
  font-style: normal; display: flex; flex-direction: column; gap: 2px; margin: 1.6rem auto 1.8rem;
  padding: 18px 0; border-top: 1px solid rgba(197, 160, 89, 0.6); border-bottom: 1px solid rgba(197, 160, 89, 0.6);
  max-width: 420px; font-size: 1.08rem;
}
.contact__biz { font-family: var(--display); font-size: 1.6rem; color: var(--maroon); font-weight: 600; }
.contact__details a { font-weight: 500; white-space: nowrap; }

.community-pick { border: 0; margin: 0 0 1.4rem; padding: 0; min-width: 0; }
.community-pick legend { font-family: var(--label); font-size: 0.85rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold-text); margin: 0 auto 12px; padding: 0; }
.community-pick__options { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.community-pick label { position: relative; cursor: pointer; }
.community-pick input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.community-pick span {
  display: inline-flex; align-items: center; min-height: 46px; padding: 0 18px; border-radius: 999px;
  border: 1px solid rgba(197, 160, 89, 0.9); font-size: 1rem; color: var(--charcoal); background: var(--ivory);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.community-pick input:checked + span { background: var(--maroon); border-color: var(--maroon); color: var(--ivory); }
.community-pick input:focus-visible + span { outline: 2px solid var(--maroon); outline-offset: 3px; }
.contact__hint { font-size: 0.95rem; color: #6A5A50; margin: 1rem auto 0; max-width: 30em; }

.privacy {
  margin: 2rem auto 0; padding-top: 1.4rem; border-top: 1px dashed rgba(197, 160, 89, 0.8);
  max-width: 34em; font-size: 0.98rem; color: #4A3B33;
}
.privacy h3 { font-size: 1.35rem; margin-bottom: 0.4rem; }
.privacy p { margin: 0; }

/* ---------- Footer ---------- */
.footer { text-align: center; padding: 8px var(--gutter) calc(var(--frame-inset) + 64px); font-size: 0.98rem; color: #5A4A40; }
.footer .divider { margin-bottom: 18px; }
.footer p { margin: 0 0 0.35em; }
.footer__name { font-family: var(--display); font-weight: 600; font-size: 1.6rem; color: var(--maroon); }
.footer__nav { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 22px; padding: 0; margin: 14px 0; font-family: var(--label); font-size: 0.95rem; }
.footer__nav a { display: inline-block; padding: 6px 0; text-decoration: none; }
.footer__small { font-size: 0.85rem; color: #7A6A60; }

/* ---------- Floating WhatsApp (desktop) ---------- */
.float-wa {
  position: fixed; z-index: 45; right: calc(var(--frame-inset) + 22px); bottom: calc(var(--frame-inset) + var(--corner) * 0.78);
  display: inline-flex; align-items: center; gap: 10px; height: 56px; padding: 0 22px 0 18px; border-radius: 999px;
  background: var(--leaf); color: #fff; text-decoration: none; font-family: var(--label); font-size: 1rem; letter-spacing: 0.04em;
  box-shadow: 0 0 0 3px var(--ivory), 0 0 0 4px var(--gold), 0 10px 24px -10px rgba(48, 37, 31, 0.45);
  transition: background 0.25s ease, transform 0.25s ease;
}
.float-wa:hover { background: var(--leaf-deep); color: #fff; transform: translateY(-2px); }
.float-wa .icon { width: 1.5em; height: 1.5em; }

/* ---------- Mobile contact bar ---------- */
.contact-bar { display: none; }

/* =========================================================
   Motion (only when JS is present and motion is welcome)
   ========================================================= */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.9s ease, transform 0.9s cubic-bezier(.2,.7,.2,1); }
  .js .reveal.is-visible { opacity: 1; transform: none; }
  .js .hero .reveal { transition-delay: calc(var(--i, 0) * 110ms); }

  /* kolam line-drawing */
  .js .divider .k-line, .js .frame__corner .k-line, .js .community__kolam .k-line, .js .hero__corner .k-line {
    stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 2.4s ease-in-out;
  }
  .js .divider.is-visible .k-line, .js .frame.is-drawn .k-line, .js .community.is-visible .k-line, .js .hero__inner.is-drawn .k-line { stroke-dashoffset: 0; }
  .js .divider__line { transform: scaleX(0); transition: transform 1.4s ease 0.4s; }
  .js .divider__line:first-child { transform-origin: right; }
  .js .divider__line:last-child { transform-origin: left; }
  .js .divider.is-visible .divider__line { transform: scaleX(1); }

  /* the gold thread of the timeline */
  .js .journey__steps::before { transform: scaleX(0); transition: transform 2s ease 0.2s; }
  .js .journey__steps.is-drawn::before { transform: scaleX(1); }

  /* thoranam leaves settle gently once */
  .js .thoranam g { animation: sway 2.6s ease-out both; }
  @keyframes sway { 0% { rotate: 4deg; opacity: 0; } 40% { opacity: 1; } 60% { rotate: -1.5deg; } 100% { rotate: 0deg; } }

  /* lamp flames breathe very slowly */
  .vilakku__flames path:nth-child(odd) { animation: flame 4.5s ease-in-out infinite alternate; }
  .vilakku__flames path:nth-child(4n+3) { animation-delay: -1.7s; }
  @keyframes flame { from { transform: scale(1); } to { transform: scale(0.92, 1.06); } }
}

/* =========================================================
   Tablet
   ========================================================= */
@media (max-width: 1099px) {
  :root { --corner: 76px; --frame-inset: 12px; --nav-h: 70px; }
  .nav__menu { gap: 16px; }
  .nav__link { font-size: 0.9rem; }
  .about { grid-template-columns: minmax(200px, 300px) 1fr; }
}

/* Navigation collapses before it gets crowded */
@media (max-width: 959px) {
  .site-header { padding-left: calc(var(--corner) + 6px); padding-right: calc(var(--corner) + 6px); }
  .nav { gap: 12px; }
  .nav__toggle {
    display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px;
    background: transparent; border: 1px solid rgba(197, 160, 89, 0.9); border-radius: 999px;
    font-family: var(--label); font-size: 0.95rem; color: var(--maroon); cursor: pointer; order: 3;
  }
  .nav__toggle-bars, .nav__toggle-bars::before, .nav__toggle-bars::after {
    display: block; width: 16px; height: 1.5px; background: var(--maroon); position: relative; transition: transform 0.25s ease, opacity 0.25s ease;
  }
  .nav__toggle-bars::before, .nav__toggle-bars::after { content: ""; position: absolute; left: 0; }
  .nav__toggle-bars::before { top: -5px; }
  .nav__toggle-bars::after { top: 5px; }
  .nav__toggle[aria-expanded="true"] .nav__toggle-bars { background: transparent; }
  .nav__toggle[aria-expanded="true"] .nav__toggle-bars::before { transform: translateY(5px) rotate(45deg); }
  .nav__toggle[aria-expanded="true"] .nav__toggle-bars::after { transform: translateY(-5px) rotate(-45deg); }

  .nav__menu {
    position: absolute; top: 100%; left: var(--frame-inset); right: var(--frame-inset);
    flex-direction: column; gap: 0; padding: 8px 24px 20px; background: var(--ivory);
    border-bottom: 1px solid var(--gold); box-shadow: 0 18px 30px -24px rgba(48, 37, 31, 0.5);
    visibility: hidden; opacity: 0; transform: translateY(-8px); transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0.25s;
  }
  .nav__menu.is-open { visibility: visible; opacity: 1; transform: none; transition: opacity 0.25s ease, transform 0.25s ease; }
  .js .nav__menu:not(.is-open) { pointer-events: none; }
  html:not(.js) .nav__menu { position: static; visibility: visible; opacity: 1; transform: none; flex-direction: row; flex-wrap: wrap; }
  .nav__menu li + li { border-top: 1px solid rgba(197, 160, 89, 0.35); }
  .nav__link { font-size: 1.15rem; padding: 14px 4px; text-align: center; }
  .nav__link::before, .nav__link::after { display: none; }
  .nav__link.is-active { color: var(--maroon); }
  .nav__link.is-active::after { display: block; position: static; transform: rotate(45deg); width: 6px; height: 6px; margin: 4px auto 0; }
  .site-header { position: fixed; }
  .nav { position: static; }
  .site-header .nav__menu { top: 100%; }
}

/* =========================================================
   Mobile
   ========================================================= */
@media (max-width: 759px) {
  :root { --frame-inset: 6px; --nav-h: 64px; --bar-h: calc(68px + env(safe-area-inset-bottom)); --gutter: 22px; }
  body { font-size: 1.0625rem; }

  /* simplified frame: hairline sides only, kolam lives in the hero corners instead */
  .frame::after { display: none; }
  .frame::before { inset: 0 var(--frame-inset); border-width: 0 1px; opacity: 0.7; }
  .frame__corner { display: none; }

  .site-header { padding: 6px 14px 0; background: var(--ivory); border-bottom: 1px solid rgba(197, 160, 89, 0.5); }
  .nav { height: calc(var(--nav-h) - 7px); }
  .nav__call { display: none; }       /* the bottom bar carries Call on mobile */
  .nav__mark { width: 30px; height: 30px; }
  .nav__brand-text { font-size: 1.3rem; }
  .nav__brand-text small { font-size: 0.56rem; }
  .nav__menu { left: 0; right: 0; }

  .hero { min-height: 0; padding-top: calc(var(--nav-h) + 2px); padding-bottom: 28px; }
  .thoranam { width: 112%; max-width: none; margin-left: -6%; }
  .hero__inner { margin-top: 4px; padding: 10px 6px 0; }
  .hero__corner { display: block; width: 34px; height: 34px; top: 4px; }
  .hero__corner--l { left: -4px; }
  .hero__corner--r { right: -4px; transform: scaleX(-1); }
  .hero__name { font-size: 3.5rem; }
  .hero__name-sub { font-size: 0.82rem; letter-spacing: 0.28em; margin-top: 0.5rem; }
  .eyebrow { font-size: 0.78rem; letter-spacing: 0.16em; margin-bottom: 0.7rem; }
  .hero .eyebrow { padding: 0 36px; text-wrap: balance; }
  .rule { margin-bottom: 0.9rem; }
  .hero__headline { font-size: 1.65rem; margin-bottom: 0.6rem; }
  .hero__copy { font-size: 1.02rem; margin-bottom: 1.3rem; }
  .cta-pair { flex-direction: column; width: 100%; max-width: 360px; gap: 10px; }
  .cta-pair .btn { width: 100%; min-height: 54px; }
  .hero__meta { font-size: 0.92rem; margin-top: 1.1rem; }

  .divider__kolam { width: 52px; height: 52px; }

  .about { grid-template-columns: 1fr; gap: 28px; }
  .portrait { max-width: 260px; margin: 0 auto; }
  .about__text { text-align: left; }
  .about__text .eyebrow, .about__text h2 { text-align: center; }

  .communities__list { grid-template-columns: 1fr; }
  .community { padding: 26px 4px; }
  .community + .community::before { left: 15%; right: 15%; top: 0; bottom: auto; width: auto; height: 1px;
    background: linear-gradient(90deg, rgba(197,160,89,0), var(--gold) 30%, var(--gold) 70%, rgba(197,160,89,0)); }
  .community + .community::after { left: 50%; top: -4px; margin-left: -4px; }
  .community__kolam { width: 52px; height: 52px; }
  .link-wa { min-height: 52px; }

  /* timeline becomes vertical, thread on the left */
  .journey__steps { grid-template-columns: 1fr; gap: 26px; }
  .journey__steps::before { top: 30px; bottom: 30px; left: 27px; right: auto; width: 1px; height: auto; transform-origin: top center; }
  .js .journey__steps::before { transform: scaleY(0); }
  .js .journey__steps.is-drawn::before { transform: scaleY(1); }
  .step { text-align: left; padding-left: 76px; min-height: 56px; }
  .step__num { position: absolute; left: 0; top: 0; width: 54px; height: 54px; font-size: 1.6rem; margin: 0; }
  .step h3 { font-size: 1.35rem; padding-top: 10px; }
  .journey__note { text-align: left; }

  .contact__card { padding-left: 18px; padding-right: 18px; outline-offset: 4px; }
  .community-pick span { min-height: 48px; padding: 0 16px; }

  .float-wa { display: none; }
  .footer { padding-bottom: 28px; }

  .contact-bar {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    background: var(--ivory); border-top: 1px solid var(--gold);
    box-shadow: 0 -10px 24px -18px rgba(48, 37, 31, 0.5);
  }
  .contact-bar__btn {
    display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; border-radius: 12px;
    font-family: var(--label); font-size: 1.02rem; letter-spacing: 0.02em; text-decoration: none; color: #fff;
  }
  .contact-bar__btn--call { background: var(--maroon); }
  .contact-bar__btn--wa { background: var(--leaf); }
  .contact-bar__btn:hover, .contact-bar__btn:active { color: #fff; filter: brightness(0.94); }
  .contact-bar__btn .icon { width: 1.3em; height: 1.3em; }
}

@media (max-width: 359px) {
  .hero__name { font-size: 3rem; }
  .contact-bar__btn { font-size: 0.92rem; gap: 6px; }
}

/* Short laptop screens: keep the hero inside one view */
@media (min-width: 760px) and (max-height: 760px) {
  .hero { min-height: 0; }
  .hero__name { font-size: clamp(3.4rem, 2rem + 5vw, 5.6rem); }
}

@media print {
  .frame, .site-header, .float-wa, .contact-bar, .thoranam { display: none !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
}

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
