* { box-sizing: border-box; margin: 0; }
:root { --ink: #1d1445; --ink-2: rgba(29,20,69,.62); --soft: #efeaf8; --line: rgba(29,20,69,.12); --gap: 16px; --ml: 'Anek Malayalam', 'Noto Sans Malayalam', system-ui, sans-serif; --en: 'Plus Jakarta Sans', system-ui, sans-serif; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--en), var(--ml); color: var(--ink); background: #fff; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.main { margin-left: var(--nav-w); min-height: 100vh; padding: 0 20px 40px; }

/* top: search + upload */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 14px 0 8px; background: rgba(255,255,255,.94); backdrop-filter: blur(10px); }
.top-logo { display: none; width: 40px; height: 40px; flex: none; }
.top-logo svg { width: 100%; height: 100%; }
.search { position: relative; flex: 1; max-width: 980px; }
.search-i { position: absolute; left: 18px; top: 50%; translate: 0 -50%; width: 20px; height: 20px; fill: none; stroke: var(--ink-2); stroke-width: 2.4; stroke-linecap: round; pointer-events: none; }
.search input { width: 100%; height: 50px; padding: 0 20px 0 50px; border: 2px solid transparent; border-radius: 26px; background: var(--soft); outline: none; font: 600 15.5px var(--ml), var(--en); }
.search input:hover { background: #e7e0f4; }
.search input:focus { background: #fff; border-color: #c425d6; box-shadow: 0 0 0 4px rgba(196,37,214,.14); }
.search input::placeholder { color: var(--ink-2); font-weight: 500; }
.sugg { position: absolute; top: calc(100% + 8px); left: 0; right: 0; list-style: none; padding: 8px; border-radius: 22px; background: #fff; box-shadow: 0 18px 50px rgba(40,20,110,.25); max-height: 60vh; overflow: auto; }
.sugg li { display: flex; flex-direction: column; padding: 10px 14px; border-radius: 14px; cursor: pointer; font: 700 14.5px var(--ml), var(--en); }
.sugg li small { font: 500 12.5px var(--ml), var(--en); color: var(--ink-2); }
.sugg li:hover, .sugg li.on { background: var(--soft); }
.sugg li.none { color: var(--ink-2); cursor: default; }
.up-btn { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 46px; padding: 0 20px; border-radius: 24px; text-decoration: none; font: 800 14.5px var(--ml), var(--en); color: #1a0b4a; background: linear-gradient(135deg, #ffd23a, #ff9d00); transition: transform .15s, filter .15s; white-space: nowrap; }
.up-btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.up-btn.solid { margin-top: 6px; }

/* district chips */
.chips-wrap { position: sticky; top: 72px; z-index: 19; background: rgba(255,255,255,.94); backdrop-filter: blur(10px); padding: 4px 0 12px; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 40px; padding: 0 18px; border: 0; border-radius: 20px; background: var(--soft); font: 700 14px var(--ml), var(--en); transition: background .15s; white-space: nowrap; }
.chip:hover { background: #e3dbf3; }
.chip.on { background: var(--ink); color: #fff; }
.chip.filter { background: linear-gradient(135deg, #ffd23a, #ff9d00); color: #1a0b4a; }

/* masonry */
.feed { display: flex; gap: var(--gap); align-items: flex-start; padding-top: 6px; }
.col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.pin { display: flex; flex-direction: column; gap: 6px; padding-bottom: 8px; }
.pin-img {
  position: relative; display: block; width: 100%; border-radius: 18px; overflow: hidden; cursor: zoom-in; outline: none;
  background: linear-gradient(110deg, #f1ecfa 30%, #e4dcf4 50%, #f1ecfa 70%) 0 0 / 200% 100%; animation: shimmer 1.3s linear infinite;
}
.pin-img.loaded { animation: none; background: var(--soft); }
.pin-img img { display: block; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .35s; }
.pin-img.loaded img { opacity: 1; }
.pin-img:focus-visible { box-shadow: 0 0 0 3px #c425d6; }
.pin-over { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: space-between; gap: 6px; padding: 10px; background: linear-gradient(180deg, rgba(20,10,50,.28), transparent 35%, transparent 60%, rgba(20,10,50,.5)); opacity: 0; transition: opacity .15s; }
.pin-img:hover .pin-over, .pin-img:focus-visible .pin-over { opacity: 1; }
.pin-btn { height: 36px; padding: 0 14px; border: 0; border-radius: 18px; background: #fff; color: var(--ink); font: 800 13px var(--ml), var(--en); text-decoration: none; display: inline-flex; align-items: center; gap: 5px; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.pin-btn:hover { background: var(--soft); }
.pin-cap { padding: 0 4px; display: flex; flex-direction: column; }
.pin-cap b { font: 800 14px/1.3 var(--ml), var(--en); }
.pin-cap span { font: 500 12.5px/1.3 var(--ml), var(--en); color: var(--ink-2); }
@keyframes shimmer { to { background-position: -200% 0; } }
.sentinel { height: 1px; }
.foot { margin-top: 28px; text-align: center; font-size: 13px; color: var(--ink-2); }

/* pin close-up */
.viewer { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; }
.viewer-bg { position: absolute; inset: 0; background: rgba(15,8,40,.72); animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(18px) scale(.98); opacity: 0; } }
.viewer-card { position: relative; display: flex; width: min(1020px, 100%); max-height: calc(100dvh - 40px); border-radius: 32px; overflow: hidden; background: #fff; box-shadow: 0 30px 90px rgba(0,0,0,.5); animation: rise .3s cubic-bezier(.2,.9,.3,1); }
.viewer-img { flex: 1 1 56%; min-width: 0; display: grid; place-items: center; background: #f4f0fb; }
.viewer-img img { display: block; max-width: 100%; max-height: calc(100dvh - 40px); object-fit: contain; }
.viewer-info { flex: 1 1 44%; min-width: 260px; display: flex; flex-direction: column; gap: 8px; padding: 36px 32px; overflow: auto; }
.viewer-info h2 { font: 800 28px/1.15 var(--ml); }
.viewer-info p { font: 600 15px var(--ml), var(--en); }
.muted { color: var(--ink-2); font-weight: 500 !important; font-size: 13.5px !important; }
.viewer-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 18px; }
.btn { height: 46px; padding: 0 20px; border: 0; border-radius: 24px; background: var(--soft); font: 800 14.5px var(--ml), var(--en); text-decoration: none; display: inline-flex; align-items: center; }
.btn:hover { background: #e3dbf3; }
.btn.primary { background: linear-gradient(135deg, #ffd23a, #ff9d00); color: #1a0b4a; }
.btn.ghost { background: transparent; color: var(--ink-2); }
.viewer-x, .viewer-nav { position: absolute; z-index: 3; border: 0; border-radius: 50%; background: #fff; color: var(--ink); box-shadow: 0 6px 22px rgba(0,0,0,.3); display: grid; place-items: center; }
.viewer-x { top: 16px; right: 16px; width: 44px; height: 44px; font-size: 16px; }
.viewer-nav { top: 50%; translate: 0 -50%; width: 48px; height: 48px; font-size: 30px; line-height: 1; padding-bottom: 4px; }
.viewer-nav.prev { left: 16px; } .viewer-nav.next { right: 16px; }
.viewer-nav[disabled] { opacity: .3; cursor: default; }
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 90; translate: -50% 20px; opacity: 0; pointer-events: none; padding: 12px 20px; border-radius: 14px; background: var(--ink); color: #fff; font: 700 14px var(--ml), var(--en); transition: .3s; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; translate: -50% 0; }

@media (max-width: 767px) {
  .main { margin-left: 0; padding: 0 10px calc(var(--nav-h) + 24px + env(safe-area-inset-bottom)); }
  :root { --gap: 8px; }
  .top { gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 0 6px; }
  .top-logo { display: block; }
  .up-btn:not(.solid) { display: none; }
  .search input { height: 46px; }
  .chips-wrap { top: calc(62px + env(safe-area-inset-top)); }
  .chip { height: 36px; padding: 0 15px; }
  .pin-over { display: none; }
  .pin-img { border-radius: 14px; }
  .viewer { padding: 0; align-items: end; }
  .viewer-card { flex-direction: column; width: 100%; max-height: 94dvh; border-radius: 26px 26px 0 0; overflow-y: auto; }
  .viewer-img img { max-height: 62dvh; }
  .viewer-info { padding: 20px 20px calc(24px + env(safe-area-inset-bottom)); min-width: 0; }
  .viewer-info h2 { font-size: 24px; }
  .viewer-nav { top: 30dvh; width: 40px; height: 40px; font-size: 26px; }
  .viewer-nav.prev { left: 8px; } .viewer-nav.next { right: 8px; }
  .toast { bottom: calc(var(--nav-h) + 20px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* search pill is a button that opens the Spotlight dock */
.search { display: flex; align-items: center; gap: 12px; height: 50px; padding: 0 16px 0 50px; border: 2px solid transparent; border-radius: 26px; background: var(--soft); text-align: left; font: 500 15.5px var(--ml), var(--en); color: var(--ink-2); }
.search:hover { background: #e7e0f4; }
.search span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search kbd { flex: none; padding: 3px 8px; border-radius: 8px; background: rgba(29,20,69,.08); font: 700 12px var(--en); }
.top-logo { width: auto; height: 36px; }
.top-logo img { display: block; height: 100%; width: auto; }
@media (max-width: 767px) { .search kbd { display: none; } }

/* about + FAQ (visible text for readers, search engines and AI assistants) */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.about { max-width: 820px; margin: 48px auto 0; padding: 28px 24px; border-radius: 24px; background: var(--soft); }
.about h2 { font: 800 22px/1.3 var(--ml); margin-bottom: 10px; }
.about p { font: 500 15.5px/1.7 var(--ml), var(--en); color: rgba(29,20,69,.82); }
.about a { color: #9a1fb0; font-weight: 700; }
.faq { margin-top: 16px; display: grid; gap: 8px; }
.faq details { border-radius: 16px; background: #fff; padding: 0 18px; }
.faq summary { cursor: pointer; padding: 14px 0; font: 700 15px/1.4 var(--ml), var(--en); list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-weight: 800; color: #c425d6; }
.faq details[open] summary::after { content: '–'; }
.faq details p { padding: 0 0 16px; font-size: 14.5px; }

/* never let the top bar or its search pill push the page wider than the screen */
.main, .top, .search, .search span { min-width: 0; }
.main { overflow-x: clip; }

/* Pinterest-style masonry: equal fixed-width columns, centred, cards keep their natural height; the number of columns follows the window */
@media (min-width: 768px) {
  .feed { justify-content: center; }
  .col { flex: 0 0 236px; width: 236px; }
}
.pin-img { min-height: 60px; }
