/* Manjapai website: colours from the logo (branding/README.md). */
:root {
  --yellow: #fdd207;
  --yellow-soft: #fff6c7;
  --gold: #f6aa05;
  --gold-text: #9a6400;
  --green: #0f5b1b;
  --green-deep: #04340f;
  --leaf: #157724;
  --cream: #fffbe6;
  --ink: #1c2a1f;
  --muted: #55615a;
  --line: #e7e3cf;
  --white: #ffffff;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(15, 91, 27, 0.12);
  --max: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Noto Sans Tamil', 'Noto Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: var(--white);
  line-height: 1.65;
  font-size: 17px;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--green); }
a:hover { color: var(--leaf); }
h1, h2, h3 { font-family: 'Baloo Thambi 2', 'Noto Sans Tamil', sans-serif; line-height: 1.25; color: var(--green); margin: 0 0 0.5em; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.3rem); font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 700; }
p { margin: 0 0 1em; }

/* Language: Tamil first, English on demand. Mark text with class="ta" / class="en". */
html.lang-en .ta { display: none !important; }
html:not(.lang-en) .en { display: none !important; }

.wrap { width: min(var(--max), 100% - 32px); margin-inline: auto; }
.section { padding: clamp(48px, 8vw, 88px) 0; }
.section--cream { background: var(--cream); }
.section--green { background: var(--green); color: #eef6ef; }
.section--green h2, .section--green h3 { color: var(--yellow); }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 46rem; }
.center { text-align: center; }
.center .lead { margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--yellow); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, 0.96); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: 16px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; }
.brand img { width: 44px; height: 44px; object-fit: contain; }
.brand-name { font-family: 'Baloo Thambi 2', sans-serif; font-weight: 800; font-size: 1.35rem; color: var(--green); line-height: 1; }
.brand-name small { display: block; font-size: 0.72rem; font-weight: 600; color: var(--gold-text); }
.nav { display: flex; gap: 4px; align-items: center; }
.nav a { text-decoration: none; color: var(--ink); padding: 8px 12px; border-radius: 10px; font-weight: 600; font-size: 0.95rem; }
.nav a:hover, .nav a[aria-current='page'] { background: var(--yellow-soft); color: var(--green); }
.lang-toggle { border: 2px solid var(--green); background: var(--white); color: var(--green); border-radius: 999px; padding: 6px 14px; font: inherit; font-weight: 700; font-size: 0.9rem; cursor: pointer; white-space: nowrap; }
.lang-toggle:hover { background: var(--green); color: var(--white); }
.menu-btn { display: none; border: 0; background: none; font-size: 1.6rem; cursor: pointer; color: var(--green); padding: 4px 8px; }
@media (max-width: 860px) {
  .menu-btn { display: block; }
  .nav { display: none; position: absolute; top: 68px; left: 0; right: 0; background: var(--white); flex-direction: column; align-items: stretch; padding: 8px 16px 16px; border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
  .nav.open { display: flex; }
  .nav a { padding: 12px; }
}

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 14px 22px; border-radius: 14px; font-weight: 700; text-decoration: none; border: 2px solid transparent; cursor: pointer; font: inherit; font-weight: 700; line-height: 1.2; min-height: 52px; }
.btn--primary { background: var(--green); color: var(--white); }
.btn--primary:hover { background: var(--green-deep); color: var(--white); }
.btn--yellow { background: var(--yellow); color: var(--green-deep); }
.btn--yellow:hover { background: var(--gold); color: var(--green-deep); }
.btn--ghost { border-color: var(--green); color: var(--green); background: var(--white); }
.btn--ghost:hover { background: var(--yellow-soft); }
.btn[aria-disabled='true'] { opacity: 0.6; pointer-events: none; }
.btn small { display: block; font-weight: 500; font-size: 0.75rem; opacity: 0.85; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* Hero */
.hero { background: radial-gradient(1200px 500px at 85% 10%, var(--yellow-soft), transparent 60%), linear-gradient(180deg, var(--cream), var(--white)); padding: clamp(32px, 6vw, 72px) 0 clamp(40px, 7vw, 80px); overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 32px; align-items: center; }
.hero-logo { width: min(420px, 100%); margin: 0 auto; filter: drop-shadow(0 18px 30px rgba(15, 91, 27, 0.18)); }
.slogan { font-family: 'Baloo Thambi 2', sans-serif; font-weight: 800; font-size: clamp(2rem, 5.2vw, 3.4rem); line-height: 1.2; color: var(--green); margin: 0 0 12px; }
.slogan mark { background: linear-gradient(transparent 58%, var(--yellow) 58%, var(--yellow) 92%, transparent 92%); color: inherit; padding: 0 0.08em; }
.slogan-en { font-size: 1.15rem; font-weight: 700; color: var(--ink); margin: -4px 0 8px; }
.tagline { font-size: 1.2rem; font-weight: 600; color: var(--gold-text); margin-bottom: 24px; }
.hero-points { list-style: none; padding: 0; margin: 24px 0 0; display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--muted); font-weight: 600; font-size: 0.95rem; }
.hero-points li::before { content: '✓'; color: var(--leaf); font-weight: 800; margin-right: 6px; }
@media (max-width: 860px) { .hero .wrap { grid-template-columns: 1fr; text-align: center; } .hero .btn-row, .hero-points { justify-content: center; } .hero-logo { width: min(300px, 80%); } }

/* Cards and grids */
.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-2.grid-wide { grid-template-columns: 1.4fr 1fr; }
@media (max-width: 960px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 760px) { .grid-3, .grid-2, .grid-2.grid-wide, .grid-4 { grid-template-columns: 1fr; } }
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: 0 2px 0 rgba(0, 0, 0, 0.02); }
.card h3 { margin-bottom: 6px; }
.card p:last-child { margin-bottom: 0; }
.step-num { width: 44px; height: 44px; border-radius: 50%; background: var(--yellow); color: var(--green-deep); display: grid; place-items: center; font-weight: 800; font-size: 1.2rem; margin-bottom: 12px; }
.emoji { font-size: 2rem; line-height: 1; margin-bottom: 10px; display: block; }

/* App cards */
.app-card { display: flex; flex-direction: column; gap: 12px; }
.app-card img.app-icon { width: 72px; height: 72px; border-radius: 16px; box-shadow: var(--shadow); }
.app-card .btn-row { margin-top: auto; }
.app-card .who { font-size: 0.85rem; font-weight: 700; color: var(--gold-text); text-transform: uppercase; letter-spacing: 0.04em; }

/* Pincode check */
.pin-form { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.pin-form input { flex: 1 1 180px; font: inherit; font-size: 1.15rem; padding: 12px 16px; border-radius: 12px; border: 2px solid var(--line); letter-spacing: 0.15em; min-height: 52px; }
.pin-form input:focus { outline: none; border-color: var(--green); }
.pin-result { margin-top: 12px; font-weight: 700; min-height: 1.6em; }
.pin-result.ok { color: var(--leaf); }
.pin-result.no { color: #a33; }
.pin-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; padding: 0; list-style: none; }
.pin-list li { background: var(--white); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-weight: 700; color: var(--green); }

/* FAQ */
.faq details { border: 1px solid var(--line); border-radius: 14px; background: var(--white); margin-bottom: 10px; }
.faq summary { cursor: pointer; padding: 16px 20px; font-weight: 700; color: var(--green); list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-size: 1.4rem; line-height: 1; color: var(--gold); }
.faq details[open] summary::after { content: '−'; }
.faq details > div { padding: 0 20px 16px; color: var(--muted); }

/* Steps list (install guide) */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: step; position: relative; padding: 0 0 22px 60px; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 42px; height: 42px; border-radius: 50%; background: var(--yellow); color: var(--green-deep); font-weight: 800; display: grid; place-items: center; }
.steps li strong { color: var(--green); }

.note { background: var(--yellow-soft); border-left: 5px solid var(--gold); padding: 14px 18px; border-radius: 10px; }
.contact-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.contact-list a { font-weight: 700; }

/* Policy pages */
.doc { max-width: 820px; }
.doc h2 { font-size: 1.45rem; margin-top: 1.6em; }
.doc ul { padding-left: 1.2em; }
.doc li { margin-bottom: 0.4em; }
.doc .summary-ta { background: var(--cream); border: 1px solid var(--line); border-radius: 14px; padding: 16px 20px; margin-bottom: 24px; }
.page-head { background: linear-gradient(180deg, var(--cream), var(--white)); padding: 40px 0 8px; }
.updated { color: var(--muted); font-size: 0.9rem; }

/* Footer */
.site-footer { background: var(--green-deep); color: #d7e5da; padding: 48px 0 24px; font-size: 0.95rem; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { color: var(--yellow); text-decoration: underline; }
.site-footer .cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 28px; }
.site-footer h4 { color: var(--yellow); margin: 0 0 10px; font-size: 1rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.site-footer .foot-logo { width: 150px; background: var(--white); border-radius: 16px; padding: 10px; margin-bottom: 12px; }
.site-footer .legal { border-top: 1px solid rgba(255, 255, 255, 0.15); margin-top: 32px; padding-top: 16px; display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; color: #a9c2ae; }
@media (max-width: 860px) { .site-footer .cols { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .site-footer .cols { grid-template-columns: 1fr; } }

[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
