/* Noto Serif (SIL Open Font License), hosted here so headings do not wait on a third-party request.
   Latin subset only; Kannada text in headings uses Noto Sans Kannada from Google Fonts. */
@font-face {
  font-family: "Noto Serif";
  font-style: normal;
  font-weight: 600 700;
  font-display: swap;
  src: url("assets/fonts/noto-serif-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Design tokens: the handover palette (HANDOVER.md section 3). The older names below
   are kept and pointed at the new values, so existing rules pick up the new look. */
:root {
  /* Surfaces and ink */
  --paper: oklch(0.985 0.005 75);
  --paper-2: oklch(0.965 0.006 75);
  --paper-3: oklch(0.945 0.008 75);
  --rule: oklch(0.88 0.008 75);
  --rule-strong: oklch(0.72 0.010 75);
  --ink: oklch(0.22 0.012 60);
  --ink-2: oklch(0.40 0.012 60);
  --ink-3: oklch(0.55 0.010 60);

  /* Accent: one terracotta */
  --accent: oklch(0.55 0.13 45);
  --accent-ink: oklch(0.40 0.13 45);
  --accent-soft: oklch(0.94 0.04 45);
  --accent-line: oklch(0.78 0.09 45);

  /* Functional */
  --ok: oklch(0.50 0.12 150);
  --warn: oklch(0.62 0.13 75);
  --err: oklch(0.52 0.16 28);

  /* Spacing (4px base) and radii */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px;
  --s-7: 32px; --s-8: 40px; --s-9: 48px; --s-10: 64px; --s-11: 80px; --s-12: 96px;
  --r-1: 4px; --r-2: 6px; --r-3: 10px; --r-4: 14px;

  /* Legacy names, mapped to the handover values */
  --brand: var(--accent);
  --brand-dark: var(--ink);
  --highlight: var(--accent-soft);
  --navy: var(--ink);
  --cream: var(--paper);
  --tint: var(--paper-2);
  --muted: var(--ink-2);
  --line: var(--rule);
  --white: #ffffff;
  --font-serif: "Source Serif 4", "Noto Serif", Georgia, serif;
  --font-sans: Inter, "Noto Sans Kannada", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-kn: "Noto Sans Kannada", Inter, system-ui, sans-serif;
  color-scheme: light;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 24px; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15.5px;
  line-height: 24px;
  overflow-x: hidden;
}

/* Language switching: English by default, Kannada when html.kn-mode is set */
.kn { display: none; }
html.kn-mode .kn { display: inline; }
html.kn-mode .en { display: none; }

img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); }
a:focus-visible,
button:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
/* Reading column: 780px, centred on the same axis as the hero. */
.narrow { max-width: 780px; }

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  color: var(--brand-dark);
  margin: 0 0 0.6em;
}
h1 { font-size: clamp(36px, 4vw, 44px); line-height: 1.1; letter-spacing: -0.02em; }
h2 { font-size: 30px; line-height: 36px; }
h3 { font-size: 19px; line-height: 25px; }

/* Kannada sits beside English at the same optical size (HANDOVER section 3.2). */
:lang(kn), .kn { font-family: var(--font-kn); }

p { margin: 0 0 1em; }

/* Header */
.site-header {
  background: var(--paper-2);
  color: var(--ink);
  border-bottom: 1px solid var(--rule);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  padding-bottom: 12px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.05rem;
}
.brand img { flex: 0 0 auto; }
.lang-toggle {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  padding: 6px 14px;
  font: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  min-height: 44px;
}
.lang-toggle:hover { background: var(--paper-3); }

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  padding-bottom: 12px;
}
.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.95rem;
  opacity: 1;
  padding: 4px 0;
}
.nav a:hover { text-decoration: underline; opacity: 1; }

/* Hero */
.hero { background: var(--tint); padding-bottom: 32px; }
.hero-media {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 24px 16px 0;
}
.hero-logo {
  width: 96px;
  height: auto;
  display: block;
}
.founders {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: flex-start;
}
.founders { --h: 200px; }
.founders figure { margin: 0; text-align: center; min-width: 0; flex: 0 0 auto; }
.founders figure:nth-child(1) { width: calc(var(--h) * 0.7475); }
.founders figure:nth-child(2) { width: calc(var(--h) * 0.765); }
.founders img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--white);
}
.founders figcaption {
  margin-top: 8px;
  font-family: "Noto Serif", Georgia, serif;
  font-size: 16px;
  color: var(--brand-dark);
  line-height: 1.3;
}
.hero-text { padding-top: 24px; text-align: center; }
.hero-text .lead { margin-left: auto; margin-right: auto; }
.hero-text .eyebrow { display: block; }
.eyebrow {
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.lead { font-size: 18px; line-height: 28px; color: var(--ink-2); max-width: 46ch; }

.cta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 20px;
  border-radius: var(--r-2);
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  font-size: 1rem;
  line-height: 1.3;
}
.btn-primary { background: var(--brand); color: var(--white); }
.btn-primary:hover { background: var(--accent-ink); }
.btn-ghost { border: 1px solid var(--rule-strong); color: var(--ink); background: transparent; }
.btn-ghost:hover { background: var(--paper-3); }

/* Deadline bar */
.deadline-bar {
  background: var(--accent-soft);
  color: var(--ink);
  border-left: 3px solid var(--accent);
}
.deadline-bar .wrap { padding-top: 14px; padding-bottom: 14px; }
.deadline-bar p { margin: 0; text-align: center; }
.deadline-bar strong { font-weight: 700; }

/* Sections */
.section { padding: 48px 0; }
.section-tint { background: var(--tint); }

.checklist,
.bullets {
  list-style: none;
  padding: 0;
  margin: 0 0 1em;
}
.checklist li {
  position: relative;
  padding-left: 32px;
  margin-bottom: 12px;
}
.checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  background: var(--brand);
  box-shadow: inset 0 0 0 4px var(--white);
}
.bullets li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 12px;
}
.bullets li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.65em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
}

/* District chips */
.chips {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chips li {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.95rem;
}

/* Steps */
.steps {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 0;
}
.steps li {
  counter-increment: step;
  position: relative;
  padding: 0 0 24px 56px;
  border-left: 2px dashed var(--line);
  margin-left: 18px;
}
.steps li:last-child { border-left-color: transparent; padding-bottom: 0; }
.steps li::before {
  content: counter(step);
  position: absolute;
  left: -20px;
  top: -2px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--brand);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Noto Serif", Georgia, serif;
  font-weight: 700;
  font-size: 1.1rem;
}
.steps h3 { margin-top: 6px; }
.steps p { margin: 0; }

/* Download cards */
.cards {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}
.card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-3);
  padding: 18px 20px;
  text-decoration: none;
  color: var(--ink);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.card:hover { border-color: var(--accent-line); }
.card-title {
  font-family: "Noto Serif", Georgia, serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--brand-dark);
}
.card-meta { color: var(--muted); font-size: 0.9rem; }
.grid-note {
  grid-column: 1 / -1;
  margin: 4px 0 0;
  font-size: 16px;
  color: var(--ink);
}
.old-form {
  color: var(--muted);
  font-size: 15px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.old-form a { color: var(--muted); }
.founders figcaption .kn { font-size: 15px; color: var(--muted); }
html.kn-mode .founders figcaption .kn { display: block; }
html.kn-mode .founders figcaption .en { display: none; }

/* Contact */
.contact {
  margin: 0;
  display: grid;
  gap: 4px 0;
}
.contact dt {
  font-weight: 700;
  color: var(--brand-dark);
  margin-top: 16px;
}
.contact dd {
  margin: 2px 0 0;
  word-break: break-word;
}

/* Footer */
.site-footer {
  background: var(--paper-2);
  border-top: 1px solid var(--rule);
  color: var(--ink-2);
  padding: 24px 0;
  font-size: 0.9rem;
  text-align: center;
}
.site-footer p { margin: 0; }

/* Wider screens */
@media (min-width: 640px) {
  .hero-text { padding-top: 32px; }
  .cards { grid-template-columns: 1fr 1fr; }
  .contact { grid-template-columns: 200px 1fr; }
  .contact dt { margin-top: 0; }
  .contact dd { margin-top: 0; }
  .contact dt, .contact dd { padding-bottom: 14px; border-bottom: 1px solid var(--line); }
  .contact dd:last-of-type { border-bottom: 0; }
}

@media (min-width: 600px) {
  .hero-logo { width: 120px; }
  .founders { gap: 20px; }
  .founders { --h: 300px; }
  .founders figcaption { font-size: 17px; }
}

@media (min-width: 900px) {
  .hero-media { padding-top: 32px; gap: 20px; }
  .hero-logo { width: 130px; }
  .founders { gap: 24px; }
  .founders { --h: 320px; }
  .founders figcaption { font-size: 18px; }
  .hero-text { padding-top: 40px; }
}

/* Help assistant */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.chat-launch {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 60;
  min-height: 48px;
  padding: 12px 20px;
  border: 0;
  border-radius: 999px;
  background: var(--brand);
  color: var(--white);
  font: inherit;
  font-weight: 600;
  box-shadow: 0 6px 16px rgba(10, 52, 64, 0.25);
  cursor: pointer;
}
.chat-launch:hover { background: var(--brand-dark); }
.chat-launch[aria-expanded="true"] { display: none; }
.chat-panel[hidden] { display: none; }
.chat-panel {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 61;
  width: min(380px, calc(100vw - 32px));
  height: min(560px, calc(100vh - 32px));
  height: min(560px, calc(100dvh - 32px));
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(10, 52, 64, 0.22);
  overflow: hidden;
}
.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 8px 8px 16px;
  background: var(--brand);
  color: var(--white);
}
.chat-head h2 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--white);
}
.chat-close {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--white);
  font: inherit;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}
.chat-note {
  margin: 0;
  padding: 8px 16px;
  font-size: 0.9rem;
  color: var(--muted);
  background: var(--tint);
  border-bottom: 1px solid var(--line);
}
.chat-log {
  flex: 1 1 auto;
  min-height: 160px;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chat-msg {
  max-width: 88%;
  margin: 0;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.95rem;
  line-height: 1.45;
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.chat-msg-user {
  align-self: flex-end;
  background: var(--brand);
  color: var(--white);
  border-bottom-right-radius: 2px;
}
.chat-msg-bot {
  align-self: flex-start;
  background: var(--tint);
  color: var(--ink);
  border-bottom-left-radius: 2px;
}
.chat-sources {
  margin-top: 6px;
  font-size: 0.85rem;
  color: var(--muted);
}
.chat-sources a { color: var(--brand); }
.chat-ai-note {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px dashed var(--line);
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--muted);
}
.chat-suggest {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 16px 8px;
}
.chat-suggest button {
  min-height: 44px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: var(--brand-dark);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}
.chat-suggest button:hover { background: var(--tint); }
.chat-panel.has-chat .chat-suggest { display: none; }
.chat-form {
  display: flex;
  gap: 8px;
  padding: 10px 16px 14px;
  border-top: 1px solid var(--line);
}
.chat-form input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  padding: 8px 12px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
}
.chat-form input:focus { outline: 3px solid var(--brand); outline-offset: 1px; }
.chat-send { min-height: 44px; padding: 8px 16px; }

/* Logo and motion */
.header-actions { display: flex; align-items: center; gap: 8px; }
.chat-header-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 6px 12px;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
  cursor: pointer;
}
.chat-header-btn:hover { background: var(--paper-3); }
.chat-header-btn[aria-expanded="true"] { background: var(--paper-3); }

.chat-title { display: flex; align-items: center; gap: 10px; }
.chat-logo {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  padding: 2px;
  border-radius: 50%;
  background: var(--white);
  box-sizing: border-box;
}
.chat-launch { display: inline-flex; align-items: center; }
.chat-launch-logo {
  width: 24px;
  height: 24px;
  margin-right: 8px;
  padding: 2px;
  border-radius: 50%;
  background: var(--white);
  box-sizing: border-box;
}
.chat-row-bot { display: flex; align-items: flex-end; gap: 8px; align-self: flex-start; max-width: 100%; }
.chat-avatar {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--white);
  box-sizing: border-box;
}
.chat-dots { display: inline-flex; align-items: center; gap: 4px; min-height: 1.45em; }
.chat-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand);
  animation: chat-dot 1.2s infinite ease-in-out;
}
.chat-dots span:nth-child(2) { animation-delay: 0.15s; }
.chat-dots span:nth-child(3) { animation-delay: 0.3s; }
.chat-msg { animation: chat-in 0.25s ease-out both; }
.chat-panel { animation: chat-panel-in 0.2s ease-out both; }

@keyframes chat-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
@keyframes chat-panel-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
@keyframes chat-dot {
  0%, 80%, 100% { opacity: 0.3; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}

@media (prefers-reduced-motion: reduce) {
  .chat-msg, .chat-panel, .chat-dots span { animation: none; }
}

/* On phones the floating button is a compact pill with a chat icon and a short label. */
.chat-bubble { flex: 0 0 auto; }
.chat-launch .chat-bubble { display: none; margin-right: 8px; }
.chat-short { display: none; }
@media (max-width: 599px) {
  .chat-launch {
    height: 48px;
    min-height: 48px;
    padding: 0 16px;
    gap: 6px;
  }
  .chat-launch-logo { display: none; }
  .chat-launch .chat-bubble { display: block; margin-right: 0; }
  .chat-long { display: none; }
  .chat-short { display: inline; }

  /* Once the hero has scrolled away, the button becomes a round icon. The label stays for screen readers. */
  .chat-launch { transition: width 0.2s ease, padding 0.2s ease; }
  .chat-launch.chat-launch-compact {
    width: 52px;
    height: 52px;
    min-height: 52px;
    padding: 0;
    justify-content: center;
    gap: 0;
  }
  .chat-launch.chat-launch-compact .chat-short {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card { transition: none; }
}
