:root {
  --bg: #f6f5ef;
  --bg-tinted: #ebeae0;
  --surface: #ffffff;
  --surface-soft: #f2f4f0;
  --ink: #162521;
  --ink-muted: #455650;
  --teal: #0e4742;
  --teal-dark: #09322f;
  --teal-soft: #dff0ed;
  --moss: #3d5522;
  --terracotta: #a33e1c;
  --terracotta-soft: #fae7e0;
  --amber-soft: #fcf1d6;
  --amber-ink: #6e4500;
  --border: #cfd6cf;
  --focus-ring: #c96a18;
  --shadow-sm: 0 2px 8px rgba(14, 42, 38, 0.06);
  --shadow-md: 0 10px 28px rgba(14, 42, 38, 0.1);
  --radius: 14px;
  --radius-sm: 10px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Noto Sans Malayalam", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--teal);
}

:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.visually-hidden,
.hp-field {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 1000;
  background: var(--teal-dark);
  color: #ffffff;
  padding: 14px 20px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0 0 var(--radius-sm) 0;
}

.skip-link:focus {
  left: 0;
}

.container {
  width: min(1140px, calc(100% - 2rem));
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(246, 245, 239, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding: 0.65rem 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--ink);
  min-height: 48px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--teal);
  color: #ffffff;
  font-size: 1.45rem;
  font-weight: 700;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.2;
}

.brand-sub {
  font-size: 0.8rem;
  color: var(--ink-muted);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 0.9rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
  color: var(--ink);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-link:hover {
  background: var(--bg-tinted);
}

.nav-cta {
  background: var(--teal);
  color: #ffffff;
}

.nav-cta:hover {
  background: var(--teal-dark);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0.65rem 1.3rem;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--teal);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--teal-dark);
}

.btn-secondary {
  background: var(--surface);
  color: var(--teal);
  border-color: var(--teal);
}

.btn-secondary:hover {
  background: var(--teal-soft);
}

.btn-full {
  width: 100%;
}

/* Hero */
.hero {
  padding: 2.75rem 0 3.25rem;
  background:
    radial-gradient(circle at 92% 12%, rgba(14, 71, 66, 0.08), transparent 44%),
    linear-gradient(180deg, var(--bg) 0%, #f1f0e8 100%);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.95fr;
  gap: 2.25rem;
  align-items: center;
}

.eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--teal);
}

h1 {
  margin: 0 0 1rem;
  font-size: clamp(1.9rem, 3.6vw, 2.85rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.hero-lead {
  margin: 0 0 1.5rem;
  font-size: 1.08rem;
  color: var(--ink-muted);
  max-width: 58ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-bottom: 1.75rem;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  margin: 0;
}

.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  box-shadow: var(--shadow-sm);
}

.metric-card dt {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-muted);
  margin-bottom: 0.2rem;
}

.metric-card dd {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--teal-dark);
}

.hero-emblem-card {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem;
  box-shadow: var(--shadow-md);
}

.emblem-frame {
  background: #414d1c;
  border-radius: var(--radius-sm);
  padding: 0.9rem;
  display: grid;
  place-items: center;
}

.emblem-frame img {
  width: 100%;
  max-width: 370px;
  border-radius: 6px;
}

.hero-emblem-card figcaption {
  margin-top: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.92rem;
  color: var(--ink-muted);
}

.hero-emblem-card figcaption strong {
  color: var(--ink);
  font-size: 1rem;
}

/* Sections */
.section {
  padding: 3.5rem 0;
}

.section-tinted {
  background: var(--bg-tinted);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin-bottom: 1.75rem;
}

.section-kicker {
  margin: 0 0 0.25rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--teal);
}

h2 {
  margin: 0;
  font-size: clamp(1.45rem, 2.5vw, 2rem);
  line-height: 1.2;
}

h3 {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
  line-height: 1.3;
}

.section-note {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.95rem;
}

/* Comparison */
.view-toggle,
.filter-bar,
.wall-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.toggle-btn,
.filter-chip {
  min-height: 48px;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.toggle-btn:hover,
.filter-chip:hover {
  border-color: var(--teal);
}

.toggle-btn.is-active,
.filter-chip.is-active {
  background: var(--teal);
  border-color: var(--teal);
  color: #ffffff;
}

.comparison-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

.comparison-grid[data-mode="cleaned"] .compare-alert,
.comparison-grid[data-mode="neglected"] .compare-cleaned {
  display: none;
}

.comparison-grid[data-mode="cleaned"],
.comparison-grid[data-mode="neglected"] {
  grid-template-columns: minmax(0, 680px);
}

.compare-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.compare-badge {
  align-self: flex-start;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}

.badge-good {
  background: var(--teal-soft);
  color: var(--teal-dark);
}

.badge-warn {
  background: var(--terracotta-soft);
  color: var(--terracotta);
}

.compare-media {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  display: grid;
  place-items: center;
}

.compare-media img {
  width: 240px;
  height: 240px;
  object-fit: cover;
  border-radius: 8px;
}

.ml-quote {
  margin: 0 0 0.65rem;
  padding: 0.6rem 0.85rem;
  border-left: 3px solid var(--teal);
  background: var(--surface-soft);
  border-radius: 0 8px 8px 0;
  font-size: 0.92rem;
  color: var(--ink);
}

.compare-body p:last-child {
  margin: 0;
  color: var(--ink-muted);
}

/* Gallery */
.filter-bar {
  margin-bottom: 1.5rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.35rem;
}

.photo-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.photo-card[hidden] {
  display: none;
}

.photo-trigger {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: var(--surface-soft);
  cursor: pointer;
  min-height: 48px;
}

.photo-well {
  display: grid;
  place-items: center;
  height: 240px;
  padding: 0.9rem;
  background: linear-gradient(145deg, #e7ece8 0%, #f4f3ec 100%);
  border-bottom: 1px solid var(--border);
}

.photo-well img {
  max-height: 210px;
  width: auto;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.14);
  transition: transform 0.2s ease;
}

.photo-well-wide img {
  max-width: 100%;
  max-height: 185px;
}

.photo-trigger:hover img {
  transform: scale(1.03);
}

.photo-content {
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.photo-content p {
  margin: 0;
  font-size: 0.94rem;
  color: var(--ink-muted);
}

.photo-tag {
  align-self: flex-start;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.tag-good {
  background: var(--teal-soft);
  color: var(--teal-dark);
}

.tag-warn {
  background: var(--amber-soft);
  color: var(--amber-ink);
}

.tag-danger {
  background: var(--terracotta-soft);
  color: var(--terracotta);
}

.tag-info {
  background: #e3ebee;
  color: #1c4452;
}

/* Public Feedback Section */
.feedback-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.15fr);
  gap: 1.75rem;
  align-items: start;
}

.feedback-form-panel,
.feedback-wall-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.panel-intro {
  margin: 0 0 1.25rem;
  color: var(--ink-muted);
  font-size: 0.94rem;
}

.form-row {
  margin-bottom: 1rem;
}

.form-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}

label,
legend {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink);
}

.req {
  color: var(--terracotta);
}

.char-count {
  font-size: 0.8rem;
  color: var(--ink-muted);
}

input[type="text"],
input[type="search"],
select,
textarea {
  width: 100%;
  min-height: 48px;
  padding: 0.65rem 0.85rem;
  border: 1.5px solid #9da9a1;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: #ffffff;
}

textarea {
  min-height: 112px;
  resize: vertical;
}

.rating-fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 1rem;
}

.rating-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.rating-pill {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 48px;
  padding: 0 0.8rem;
  border: 1.5px solid #9da9a1;
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.86rem;
}

.rating-pill input {
  width: 18px;
  height: 18px;
  accent-color: var(--teal);
  cursor: pointer;
}

.rating-pill:has(input:checked) {
  background: var(--teal-soft);
  border-color: var(--teal);
  color: var(--teal-dark);
}

.form-status {
  min-height: 1.4rem;
  margin-bottom: 0.85rem;
  font-size: 0.94rem;
  font-weight: 600;
}

.form-status.is-error {
  color: var(--terracotta);
}

.form-status.is-success {
  color: var(--teal-dark);
}

.wall-controls {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.feedback-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.feedback-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.1rem 1.15rem;
  background: #fcfcf9;
}

.fb-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem 1rem;
  margin-bottom: 0.55rem;
}

.fb-author {
  font-weight: 700;
  font-size: 1rem;
}

.fb-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin-top: 0.25rem;
  font-size: 0.84rem;
  color: var(--ink-muted);
}

.fb-stars {
  font-weight: 700;
  font-size: 0.86rem;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
}

.fb-message {
  margin: 0 0 0.85rem;
  color: var(--ink);
}

.fb-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.fb-date {
  font-size: 0.82rem;
  color: var(--ink-muted);
}

.support-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 48px;
  padding: 0 0.95rem;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}

.support-btn:hover {
  border-color: var(--teal);
  background: var(--teal-soft);
}

.support-btn[aria-pressed="true"] {
  background: var(--teal);
  border-color: var(--teal);
  color: #ffffff;
}

.loading-note,
.empty-note {
  padding: 1.5rem;
  text-align: center;
  color: var(--ink-muted);
  background: var(--surface-soft);
  border-radius: var(--radius-sm);
}

/* Footer */
.site-footer {
  background: var(--teal-dark);
  color: #e8f1ef;
  padding: 2rem 0;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.footer-title {
  margin: 0;
  font-weight: 700;
  font-size: 1.05rem;
}

.footer-sub,
.footer-meta {
  margin: 0.2rem 0 0;
  font-size: 0.88rem;
  color: #c5dad6;
}

/* Lightbox */
.lightbox[hidden] {
  display: none;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 22, 20, 0.82);
}

.lightbox-dialog {
  position: relative;
  z-index: 1;
  width: min(580px, 100%);
  max-height: 92vh;
  overflow-y: auto;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.lightbox-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
}

.lightbox-counter {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ink-muted);
}

.lightbox-icon-btn {
  min-height: 48px;
  min-width: 48px;
  padding: 0 1rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
}

.lightbox-stage {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  display: grid;
  place-items: center;
  margin-bottom: 1rem;
}

.lightbox-stage img {
  width: auto;
  max-width: 100%;
  max-height: 320px;
  border-radius: 8px;
}

.lightbox-caption p {
  margin: 0 0 1rem;
  color: var(--ink-muted);
}

.lightbox-nav {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
}

@media (max-width: 900px) {
  .hero-grid,
  .comparison-grid,
  .feedback-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .hero-metrics,
  .form-split {
    grid-template-columns: 1fr;
  }
}
