/* ─────────────────────────────────────────────────────────────
   Kinha Technology — company site
   Palette and type follow kinha-tech-product/docs/brand.md.

   NOTE: amber #E0A356 means "it is your turn" and belongs to Meri Bari.
   brand.md permits it in exactly three places, one of which is the Meri
   Bari logo dot — so on this site it may appear inside the .product-mark
   SVG and nowhere else. Never in CSS. tools/check-brand.mjs enforces it.
   ───────────────────────────────────────────────────────────── */

:root {
  --teal:      #2E8B6E;
  --teal-dark: #1F6B54;
  --forest:    #1A3A35;
  --bar-mid:   #4FAE8A;
  --bar-light: #7FC9AE;
  --coral:     #D8674E;
  --wash:      #EBF7F5;
  --cream:     #FAFAF7;

  --ink:       #1A3A35;
  --ink-soft:  #4A5C57;
  --ink-mute:  #7A8A85;
  --rule:      rgba(46, 139, 110, .14);

  --serif: Lora, Georgia, "Times New Roman", serif;
  --sans:  "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --deva:  "Noto Sans Devanagari", var(--sans);

  --wrap: 1080px;
  --r-sm: 10px;
  --r:    16px;
  --r-lg: 24px;
}

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

html {
  scroll-behavior: smooth;
  /* Stop iOS inflating body text when a phone is rotated into landscape. */
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

html[lang="hi"] body,
html[lang="hi"] h1, html[lang="hi"] h2, html[lang="hi"] h3,
[lang="hi"] { font-family: var(--deva); }

/* The wordmark is a logo, not copy — it stays in Lora in both languages. */
html[lang="hi"] .brand-name { font-family: var(--serif); }
html[lang="hi"] .brand-sub  { font-family: var(--sans); }

img, svg { max-width: 100%; }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -.02em;
  line-height: 1.15;
  margin: 0;
  text-wrap: balance;
}
h1 { font-size: clamp(38px, 5.8vw, 64px); }
h2 { font-size: clamp(28px, 3.6vw, 42px); }
h3 { font-size: 19px; letter-spacing: -.01em; }
p  { margin: 0; text-wrap: pretty; }

a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--teal-dark); }

:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
  border-radius: 4px;
}

/* The header is sticky, so an anchor jump would otherwise land underneath it. */
[id] { scroll-margin-top: 88px; }

.skip {
  position: absolute; left: -9999px;
  background: var(--forest); color: var(--cream);
  padding: 12px 18px; border-radius: 0 0 var(--r-sm) 0; z-index: 100;
}
.skip:focus { left: 0; top: 0; color: var(--cream); }

/* The side padding respects notch/rounded-corner insets on phones in landscape. */
.wrap {
  width: 100%; max-width: var(--wrap); margin: 0 auto;
  padding-inline: 28px; /* fallback — the line below is dropped whole if unsupported */
  padding-inline: max(28px, env(safe-area-inset-left, 0px)) max(28px, env(safe-area-inset-right, 0px));
}
.narrow { max-width: 720px; }
.narrow-p { max-width: 640px; }
.center { text-align: center; }
.center .lede, .center .narrow-p { margin-left: auto; margin-right: auto; }

.eyebrow {
  font-size: 12px; font-weight: 500;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--teal); margin-bottom: 14px;
}
.eyebrow-light { color: var(--bar-light); }

.lede { font-size: clamp(17px, 1.6vw, 19px); line-height: 1.7; margin-top: 18px; }

/* ── buttons ─────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: inherit; font-size: 16px; font-weight: 500;
  padding: 14px 26px; border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; transition: background .15s, color .15s, border-color .15s, transform .15s;
  white-space: nowrap;
  /* Hindi labels run longer than English. Never let one spill out. */
  max-width: 100%;
}
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-dark); color: #fff; transform: translateY(-1px); }
.btn-ghost { color: var(--ink); border-color: var(--rule); background: transparent; }
.btn-ghost:hover { color: var(--ink); border-color: var(--teal); background: rgba(46,139,110,.05); }
.btn-sm { padding: 10px 18px; font-size: 15px; }
.wa-icon { width: 19px; height: 19px; flex: none; }

/* The header CTA carries a long label and a short one. Below 430px the long
   Hindi label is wider than the viewport, so the short one takes over. */
.cta-short { display: none; }

/* ── header ──────────────────────────────────────────────── */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 250, 247, .88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}
.header-inner { display: flex; align-items: center; gap: 28px; height: 68px; }

.brand { display: flex; align-items: center; gap: 11px; flex: none; }
.brand-mark { width: 32px; height: 32px; flex: none; }
.brand-word { display: flex; flex-direction: column; line-height: 1; }
.brand-name { font-family: var(--serif); font-size: 20px; font-weight: 600; color: var(--ink); letter-spacing: -.02em; }
.brand-sub {
  font-family: var(--sans); font-size: 8.5px; font-weight: 500;
  letter-spacing: .28em; color: var(--ink-mute); margin-top: 3px;
}

.site-nav { display: flex; gap: 26px; margin-left: auto; font-size: 15px; }
.site-nav a { color: var(--ink-soft); }
.site-nav a:hover { color: var(--ink); }

.header-actions { display: flex; align-items: center; gap: 14px; flex: none; }

.lang { display: flex; border: 1px solid var(--rule); border-radius: 999px; overflow: hidden; }
.lang-btn {
  font-family: inherit; font-size: 13px; font-weight: 500;
  padding: 6px 13px; border: 0; background: transparent;
  color: var(--ink-mute); cursor: pointer; transition: background .15s, color .15s;
}
.lang-btn[data-lang="hi"] { font-family: var(--deva); }
.lang-btn:hover { color: var(--ink); }
.lang-btn.is-on { background: var(--teal); color: #fff; }

/* ── hero ────────────────────────────────────────────────── */

.hero {
  padding: clamp(64px, 9vw, 128px) 0 clamp(56px, 8vw, 104px);
  background:
    radial-gradient(820px 420px at 78% -14%, rgba(79, 174, 138, .17), transparent 62%),
    var(--cream);
}
.hero-inner { max-width: 800px; }
.hero .lede { max-width: 660px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

/* ── bands ───────────────────────────────────────────────── */

.band { padding: clamp(56px, 7.5vw, 100px) 0; }
.band-wash { background: var(--wash); }
.band-dark { background: var(--forest); }
.band-dark h2, .band-dark h3 { color: var(--cream); }
.band-dark .lede, .band-dark p { color: #B9CFC9; }

/* ── the product card ────────────────────────────────────── */

.product {
  margin-top: 40px;
  background: #fff; border: 1px solid var(--rule); border-radius: var(--r-lg);
  padding: clamp(26px, 4vw, 40px);
  display: flex; flex-direction: column; gap: 18px;
  max-width: 760px;
}
.product-head { display: flex; align-items: center; gap: 18px; }
.product-mark { width: 52px; height: 52px; flex: none; }
.product h3 { font-size: 26px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.product-deva { font-family: var(--deva); font-size: 17px; font-weight: 400; color: var(--ink-mute); }
.product-tag { font-size: 15px; color: var(--ink-mute); margin-top: 3px; }
.product p { font-size: 16.5px; line-height: 1.7; }

.product-link {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 500; align-self: flex-start;
}
.product-link .arrow { transition: transform .15s; }
.product-link:hover .arrow { transform: translateX(3px); }

/* ── principle cards ─────────────────────────────────────── */

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 44px; }
.card {
  background: var(--cream); border-radius: var(--r-lg);
  padding: 28px; display: flex; flex-direction: column; gap: 10px;
}
.card-n {
  font-family: var(--sans); font-size: 12px; font-weight: 700;
  letter-spacing: .1em; color: var(--bar-mid); margin-bottom: 2px;
}
.card p { font-size: 15.5px; }

/* ── contact ─────────────────────────────────────────────── */

.contact-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 16px; margin-top: 38px; text-align: left;
}
.contact-card {
  background: #23423C; border: 1px solid rgba(127, 201, 174, .2);
  border-radius: var(--r); padding: 22px 24px;
  display: flex; flex-direction: column; gap: 5px;
  transition: border-color .15s, background .15s;
}
.contact-card:hover { border-color: var(--bar-mid); background: #27483F; }
.contact-label { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--bar-light); font-weight: 500; }
.contact-value { font-size: 17px; color: var(--cream); font-weight: 500; word-break: break-word; }

.contact-note { margin-top: 40px; font-size: 15.5px; color: #B9CFC9 !important; }
.band-dark .btn-primary { margin-top: 18px; }

/* ── footer ──────────────────────────────────────────────── */

.site-footer { background: #16302C; color: #B9CFC9; padding: 52px 0 44px; }
.footer-inner { display: grid; grid-template-columns: 1.5fr .75fr .75fr; gap: 36px; }
.footer-brand { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.footer-tag { font-family: var(--serif); font-size: 15px; color: var(--bar-light); }
html[lang="hi"] .footer-tag { font-family: var(--deva); }

.footer-links, .footer-contact { display: flex; flex-direction: column; gap: 11px; font-size: 15px; }
.footer-links a, .footer-contact a { color: #B9CFC9; }
.footer-links a:hover, .footer-contact a:hover { color: var(--cream); }

/* ── responsive ───────────────────────────────────────────
   Read the "Mobile rules" section of README.md before editing this block.
   Content-first ordering, nothing wider than the viewport, and every
   tappable thing at least 44px on a touch screen.
   ───────────────────────────────────────────────────────── */

@media (max-width: 940px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 700px) {
  body { font-size: 16px; }
  [id] { scroll-margin-top: 76px; }

  .site-nav { display: none; }
  .header-actions { margin-left: auto; }

  .cards { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }

  /* Full-width only for buttons that sit in content. The sticky header's
     .btn-sm must keep its intrinsic width or it blows the header apart. */
  .hero-cta .btn,
  .band-dark .btn { width: 100%; justify-content: center; }
  .hero-cta { flex-direction: column; align-items: stretch; }

  .product-head { align-items: flex-start; }
  .product h3 { font-size: 23px; }
}

/* Small phones — 360px and down is still a large share of Indian handsets. */
@media (max-width: 430px) {
  .wrap {
    padding-inline: 20px;
    padding-inline: max(20px, env(safe-area-inset-left, 0px)) max(20px, env(safe-area-inset-right, 0px));
  }

  /* The wordmark, language toggle and CTA together overflow a 360px header.
     The mark alone still identifies the page, and the CTA is what matters. */
  .brand-word { display: none; }
  .header-actions { gap: 10px; }
  .btn-sm { padding: 9px 14px; font-size: 14px; }
  .cta-long { display: none; }
  .cta-short { display: inline; }

  h1 { font-size: clamp(32px, 8.5vw, 40px); }
  .product-mark { width: 44px; height: 44px; }
  .product-head { gap: 14px; }
}

/* Touch input, at any width. Pointer size is not screen size — a 1024px
   tablet needs these as much as a 360px phone. */
@media (pointer: coarse) {
  /* min-height, not padding. Padding has to be guessed against the line box
     and lands a few pixels short; min-height is the thing being asserted.
     44px is the WCAG 2.5.8 target size. */
  .lang-btn,
  .btn,
  .brand,
  .site-nav a,
  .footer-links a,
  .footer-contact a,
  .product-link {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  .btn, .lang-btn { justify-content: center; }

  /* No hover lift on touch — it sticks after the tap and reads as broken. */
  .btn-primary:hover { transform: none; }
  .product-link:hover .arrow { transform: none; }
}
