/* enhance.css — loaded after site.css: colour themes, reunion path, memorial height, scroll motion */

/* ---------- 1. page colour themes (no more all-blue banners) ---------- */
body[class*="th-"] { --acc: var(--bn2); }
body[class*="th-"] { --bn1: #14264a; --bn2: #d4a23a; } /* one common banner colour: logo navy + gold */

/* banner: no photo, logo navy with a page-related animated scene */
body[class*="th-"] .banner { background: var(--bn1); isolation: isolate; }
body[class*="th-"] .banner > img { display: none; }
body[class*="th-"] .banner::before {
  content: ''; position: absolute; inset: -20%; z-index: 0; pointer-events: none;
  background:
    radial-gradient(40% 55% at 78% 40%, rgba(212, 162, 58, 0.10), transparent 70%),
    radial-gradient(45% 60% at 15% 80%, rgba(91, 120, 196, 0.35), transparent 70%),
    radial-gradient(25% 35% at 50% 10%, rgba(255, 255, 255, 0.06), transparent 70%);
  animation: bnDrift 16s ease-in-out infinite alternate;
}
body[class*="th-"] .banner::after { display: none; }
@keyframes bnDrift { 0% { transform: translate3d(-4%, -3%, 0) scale(1); } 100% { transform: translate3d(5%, 4%, 0) scale(1.12); } }
.banner .crumb, .banner h1, .banner p { animation: bnIn 0.9s cubic-bezier(.2, .7, .2, 1) both; }
.banner h1 { animation-delay: 0.12s; }
.banner p { animation-delay: 0.26s; }
@keyframes bnIn { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }

/* retired batchmates: every card has one solid colour (no gradient, no blue) */
.rt { --c1: #8a3a1a; }
.rt.c1 { --c1: #0f6b60; }
.rt.c2 { --c1: #8c2447; }
.rt.c3 { --c1: #5a3597; }
.rt.c4 { --c1: #9a6a10; }
.rt.c5 { --c1: #25703a; }
.rt-head { background: var(--c1) !important; }

/* ---------- 2. memorial band: shorter ---------- */
.memorial-home { padding: clamp(30px, 3.6vw, 48px) 0; }
.memorial-home .diya-wrap, .memorial-home .diya { width: 84px; }
.memorial-home .diya-wrap { margin-bottom: 0; }
.memorial-home .quiet { margin: 0 auto 8px; font-size: clamp(1.25rem, 2.4vw, 1.8rem); }
.memorial-home .mem-line { margin: 0 0 16px; font-size: 1rem; }
.memorial-home .lotus { width: clamp(96px, 11vw, 170px); }
@media (max-width: 700px) { .memorial-home .lotus { width: 90px; } }

/* ---------- 4. scroll motion ---------- */
.sp-bar {
  position: fixed; top: 0; left: 0; right: 0; height: 4px; z-index: 9999; pointer-events: none;
  transform-origin: 0 50%; transform: scaleX(var(--sp, 0));
  background: linear-gradient(90deg, #8d99b0, #d4a23a, #ec7a5e, #c0304e, #3a6bd1);
}
.reveal { transition: opacity 0.85s cubic-bezier(.2, .7, .2, 1), transform 0.85s cubic-bezier(.2, .7, .2, 1); transition-delay: var(--d, 0ms); }
.tile.reveal:not(.in), .dl-card.reveal:not(.in) { transform: translateY(46px) scale(0.95); }
.tl.reveal:not(.in), .dept-tbl.reveal:not(.in) { transform: translateX(-34px); }
.ev.reveal:not(.in), .feat.reveal:not(.in) { transform: translateY(40px); }
.sec-head.reveal::before { transition: transform 0.8s 0.2s cubic-bezier(.2, .7, .2, 1); transform-origin: 50% 0; }
.sec-head.reveal:not(.in)::before { transform: scaleY(0); }
.tile .ph img { transition: transform 0.9s cubic-bezier(.2, .7, .2, 1); }
.tile:hover .ph img { transform: scale(1.07); }
.hero-inner { will-change: transform, opacity; }

@media (prefers-reduced-motion: reduce) {
  .banner::before, .banner::after { animation: none !important; }
  .banner .crumb, .banner h1, .banner p, 
  .sec-head.reveal:not(.in)::before { transform: none; }
  .sp-bar { display: none; }
}

/* ---------- 5. solid retired headings ---------- */
.rt-head { background: var(--c1); }

/* ---------- 6. animated banner background (replaces photos) ---------- */
body[class*="th-"] .banner { background: linear-gradient(120deg, var(--bn1) 0%, color-mix(in srgb, var(--bn1) 55%, var(--bn2)) 100%); }
body[class*="th-"] .banner::after { display: none; }
.bn-fx .grid {
  position: absolute; inset: -60px; opacity: 0.16; animation: bnGrid 26s linear infinite;
  background-image:
    linear-gradient(#fff, #fff), linear-gradient(#fff, #fff);
  background-size: 14px 2px, 2px 14px;
  background-repeat: repeat;
  background-position: 0 0, 6px -6px;
  background-origin: padding-box;
  mask-image: radial-gradient(ellipse at 80% 40%, #000 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 80% 40%, #000 0%, transparent 70%);
}
.bn-fx svg { position: absolute; left: 0; right: 0; bottom: 14px; width: 100%; height: 90px; opacity: 0.55; }
.bn-fx svg path { fill: none; stroke: var(--gold2); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 340 1100; stroke-dashoffset: 340; animation: bnEcg 5.5s ease-in-out infinite; filter: drop-shadow(0 0 6px var(--gold2)); }
@keyframes bnDrift { from { transform: translate3d(0, 0, 0) scale(1); } to { transform: translate3d(-90px, 60px, 0) scale(1.25); } }
@keyframes bnGrid { from { background-position: 0 0, 6px -6px; } to { background-position: 140px 140px, 146px 134px; } }
@keyframes bnEcg { 0% { stroke-dashoffset: 340; } 70%, 100% { stroke-dashoffset: -1100; } }
@media (prefers-reduced-motion: reduce) { .bn-fx i, .bn-fx .grid, .bn-fx svg path { animation: none !important; } .bn-fx svg path { stroke-dashoffset: 0; } }

/* page-related banner scene */
.bn-scene { position: absolute; z-index: 1; right: clamp(16px, 8vw, 130px); top: 50%; height: min(78%, 230px); aspect-ratio: 1; transform: translateY(-50%); pointer-events: none; }
.bn-scene svg { width: 100%; height: 100%; overflow: visible; fill: none; stroke: #f0cb78; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; animation: bnFloat 6s ease-in-out infinite; }
.bn-scene .halo { fill: rgba(212, 162, 58, 0.10); stroke: none; animation: bnPulse 4s ease-in-out infinite; transform-origin: 32px 32px; }
.bn-scene .dr { stroke-dasharray: 1; stroke-dashoffset: 1; animation: bnDraw 7s ease-in-out infinite; }
.bn-scene .dr:nth-of-type(2) { animation-delay: 0.25s; } .bn-scene .dr:nth-of-type(3) { animation-delay: 0.5s; }
.bn-scene .dr:nth-of-type(4) { animation-delay: 0.75s; } .bn-scene .dr:nth-of-type(5) { animation-delay: 1s; }
.bn-scene .fl { fill: rgba(240, 203, 120, 0.9); stroke: none; }
.bn-scene .tw { fill: #f0cb78; stroke: none; animation: bnTwinkle 2.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.bn-scene .tw.b { animation-delay: 1.1s; } .bn-scene .tw.c { animation-delay: 1.9s; }
.bn-scene .mv { transform-box: view-box; transform-origin: 32px 32px; }
.bn-scene .min { animation: bnSpin 8s linear infinite; } .bn-scene .hr { animation: bnSpin 96s linear infinite; }
.bn-scene .needle { animation: bnNeedle 5s ease-in-out infinite; }
.bn-scene .beat { animation: bnBeat 1.4s ease-in-out infinite; }
.bn-scene .flick { transform-box: fill-box; transform-origin: 50% 100%; animation: bnFlick 1.5s ease-in-out infinite; }
.bn-scene .swing { transform-box: view-box; transform-origin: 32px 8px; animation: bnSwing 4s ease-in-out infinite; }
.bn-scene .pl { transform-box: fill-box; transform-origin: center; animation: bnBeat 2s ease-in-out infinite; fill: rgba(240, 203, 120, 0.9); }
@keyframes bnDraw { 0% { stroke-dashoffset: 1; } 30%, 75% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -1; } }
@keyframes bnFloat { 0%, 100% { transform: translateY(-5px); } 50% { transform: translateY(6px); } }
@keyframes bnPulse { 0%, 100% { transform: scale(0.92); opacity: 0.7; } 50% { transform: scale(1.08); opacity: 1; } }
@keyframes bnTwinkle { 0%, 100% { transform: scale(0.2); opacity: 0.2; } 50% { transform: scale(1); opacity: 1; } }
@keyframes bnSpin { to { transform: rotate(360deg); } }
@keyframes bnNeedle { 0%, 100% { transform: rotate(-35deg); } 50% { transform: rotate(40deg); } }
@keyframes bnBeat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.1); } 30% { transform: scale(0.98); } 45% { transform: scale(1.06); } }
@keyframes bnFlick { 0%, 100% { transform: scale(1, 1) rotate(-2deg); } 50% { transform: scale(0.92, 1.1) rotate(2deg); } }
@keyframes bnSwing { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
@media (max-width: 700px) { .bn-scene { height: 120px; right: 10px; opacity: 0.45; } }
@media (prefers-reduced-motion: reduce) { .bn-scene *, .bn-scene svg { animation: none !important; } .bn-scene .dr { stroke-dashoffset: 0; } }
.banner .mdoodle { display: none !important; }

/* ===== v45: common photo banner on every inner page (overrides the old gradient) ===== */
body.inner .banner,
body[class*="th-"] .banner {
  background: #14264a url('../assets/img/banner.webp') center / cover no-repeat !important;
}
body.inner .banner::before,
body[class*="th-"] .banner::before { display: none !important; }
body.inner .banner::after,
body[class*="th-"] .banner::after {
  content: '' !important; display: block !important; position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(90deg, rgba(10, 20, 42, 0.82) 0%, rgba(10, 20, 42, 0.55) 40%, rgba(10, 20, 42, 0.08) 100%) !important;
}

/* ===== Navigation: glassy pill only at the top of the home page; dark bar once scrolled / on inner pages ===== */
.nav-link,
.nav-link:hover,
.nav-link:focus-visible { text-decoration: none; }
.nav-item .mega::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -20px;
  height: 20px;
}
@media (min-width: 1061px) {
  body:not(.inner) .site-header:not(.solid) .nav-desktop {
    background: rgba(255, 255, 255, 0.14);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    backdrop-filter: blur(16px) saturate(140%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 999px;
    padding: 0 8px;
    gap: 2px;
    box-shadow: 0 8px 28px rgba(8, 18, 40, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.35);
    align-self: center;
  }
  body:not(.inner) .site-header:not(.solid) .nav-link {
    color: #fff;
    padding: 12px 18px;
    border-radius: 999px;
    transition: background 0.2s;
  }
  body:not(.inner) .site-header:not(.solid) .nav-item:hover > .nav-link,
  body:not(.inner) .site-header:not(.solid) .nav-item:focus-within > .nav-link,
  body:not(.inner) .site-header:not(.solid) .nav-item.active > .nav-link {
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
  }
  body:not(.inner) .site-header:not(.solid) .nav-item .mega { top: calc(100% + 16px); }
}

/* ===== Scrolling stats bar: blue background, white text, "New" updates ===== */
.stats { background: var(--blue, #384f90) !important; border-block: 0 !important; }
.stats .counter { border-right: 1px solid rgba(255, 255, 255, 0.25) !important; }
.stats .counter b { color: #fff !important; }
.stats .counter span { color: rgba(255, 255, 255, 0.92) !important; }
.stats .counter.upd b {
  font: 800 0.68rem var(--sans) !important;
  letter-spacing: 0.08em;
  background: var(--gold2, #e8b84a);
  color: #14264a !important;
  padding: 4px 9px;
  border-radius: 999px;
  align-self: center;
}
.stats .counter.upd span { text-transform: none; font-size: 0.86rem; font-weight: 600; }

/* ===== Stats ticker: no hover colour, only "New" updates scroll ===== */
.stats a.counter:hover,
.stats a.counter:focus-visible { background: transparent !important; }
.stats a.counter:hover b,
.stats a.counter:focus-visible b { color: inherit; }
.stats .counter.upd:hover b { color: #14264a !important; }

/* ===== Navigation: separate small pills, normal (not bold) text ===== */
.nav-link,
.nav-item.active > .nav-link,
.nav-link:hover { font-weight: 400 !important; }
@media (min-width: 1061px) {
  body:not(.inner) .site-header:not(.solid) .nav-desktop {
    background: none !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    gap: 8px !important;
  }
  body:not(.inner) .site-header:not(.solid) .nav-link {
    font-size: 0.88rem;
    padding: 7px 15px !important;
    background: rgba(255, 255, 255, 0.14);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    backdrop-filter: blur(14px) saturate(140%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 999px;
    box-shadow: 0 4px 14px rgba(8, 18, 40, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  }
  body:not(.inner) .site-header:not(.solid) .nav-item:hover > .nav-link,
  body:not(.inner) .site-header:not(.solid) .nav-item:focus-within > .nav-link,
  body:not(.inner) .site-header:not(.solid) .nav-item.active > .nav-link {
    background: rgba(255, 255, 255, 0.28);
  }
}

/* year toggle tabs (Batch Moments, News) */
.ytabs { display: flex; flex-wrap: wrap; gap: 14px; margin: 6px 0 26px; }
.ytab {
  flex: 1 1 190px;
  max-width: 300px;
  padding: 14px 18px;
  background: #fff;
  border: 2px solid #d4d4d4;
  border-radius: 6px;
  font: 600 1.05rem var(--sans);
  color: var(--ink, #222);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.ytab:hover { border-color: var(--blue, #0f3a30); }
.ytab.on { background: var(--blue, #0f3a30); border-color: var(--blue, #0f3a30); color: #fff; }
.ytab:focus-visible { outline: 3px solid var(--blue, #0f3a30); outline-offset: 2px; }
.ytab-panel[hidden] { display: none; }
.ytab-empty { padding: 36px 0; color: #666; font-size: 1.05rem; }
@media (max-width: 700px) { .ytabs { gap: 8px; } .ytab { flex: 1 1 100%; max-width: none; padding: 12px; } }

/* Batch Moments: 4 photos per row */
.ytab-panel .gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.ytab-panel .gallery::after { display: none; }
.ytab-panel .g-item, .ytab-panel .g-item:hover { width: 100%; height: auto; flex: none; aspect-ratio: 4 / 3; }
.ytab-panel .g-item img, .ytab-panel .g-item img.loaded { object-fit: cover !important; }
@media (max-width: 900px) { .ytab-panel .gallery { grid-template-columns: repeat(3, 1fr); gap: 10px; } }
@media (max-width: 600px) { .ytab-panel .gallery { grid-template-columns: repeat(2, 1fr); gap: 8px; } }
