/* ── Design tokens ─────────────────────────────── */
:root {
  --bg:           #F9F7F4;
  --surface:      #FFFFFF;
  --accent:       #7A9E7E;
  --accent-dark:  #5e826a;
  --accent-light: #e8f2ea;
  --text:         #1a1a1a;
  --text-2:       #6b7280;
  --text-3:       #9ca3af;
  --border:       #e5e7eb;
  --radius:       14px;
  --radius-sm:    8px;
  --max-w:        960px;
  --font-display: 'Syne', system-ui, sans-serif;
  --font-body:    'DM Sans', system-ui, sans-serif;
  --font-mark:    'Noto Serif Devanagari', serif;
}

/* ── Reset ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ────────────────────────────────────── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 32px;
}

/* ── Nav ───────────────────────────────────────── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(249, 247, 244, 0.88);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 32px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.03em;
  text-decoration: none;
}
.nav-logo span { color: var(--accent); }
.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
}
.nav-links a {
  font-size: 0.875rem;
  color: var(--text-2);
  transition: color 0.15s;
}
.nav-links a:hover { color: var(--text); text-decoration: none; }

/* ── Hero ──────────────────────────────────────── */
.hero {
  padding: 88px 0 72px;
  position: relative;
  overflow: hidden;
}

/* Devanagari watermark — चाबी means "key" */
.hero::before {
  content: 'चाबी';
  font-family: var(--font-mark);
  font-weight: 700;
  font-size: clamp(18rem, 32vw, 28rem);
  line-height: 1;
  color: var(--accent);
  opacity: 0.045;
  position: absolute;
  right: -24px;
  top: 50%;
  transform: translateY(-52%);
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
  white-space: nowrap;
  z-index: 0;
}

.hero .container {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 64px;
  align-items: center;
}

.hero-text { text-align: left; }

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 6vw, 4.4rem);
  font-weight: 800;
  line-height: 1.0;
  letter-spacing: -0.045em;
  color: var(--text);
  margin-bottom: 20px;
  text-wrap: balance;
}
.hero h1 em {
  font-style: normal;
  color: var(--accent);
}

.hero-text p {
  font-size: 1.0625rem;
  color: var(--text-2);
  max-width: 420px;
  margin-bottom: 32px;
  line-height: 1.7;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--text);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 500;
  padding: 13px 26px;
  border-radius: 100px;
  transition: background 0.15s, transform 0.15s;
}
.hero-cta:hover {
  background: #333;
  transform: translateY(-1px);
  text-decoration: none;
}
.hero-cta:active { transform: scale(0.96); }
.hero-cta svg { width: 18px; height: 18px; fill: currentColor; }

.hero-note {
  margin-top: 12px;
  font-size: 0.8rem;
  color: var(--text-3);
}

/* ── App preview (CSS phone) ───────────────────── */
.phone-wrap {
  width: 240px;
}
.phone {
  background: var(--text);
  border-radius: 44px;
  padding: 11px;
  box-shadow: 0 40px 100px rgba(0,0,0,0.2), 0 0 0 1px rgba(0,0,0,0.06);
}
.phone-screen {
  background: var(--bg);
  border-radius: 33px;
  overflow: hidden;
  aspect-ratio: 9 / 19.5;
  display: flex;
  flex-direction: column;
}
.phone-bar {
  height: 40px;
  background: var(--accent);
  display: flex;
  align-items: flex-end;
  padding: 0 16px 8px;
}
.phone-bar span {
  color: white;
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.phone-content {
  flex: 1;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.phone-row {
  background: white;
  border-radius: 10px;
  padding: 9px 11px;
  display: flex;
  align-items: center;
  gap: 9px;
}
.phone-badge {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 0.6rem;
  font-weight: 800;
  color: white;
  flex-shrink: 0;
}
.phone-row-text { flex: 1; overflow: hidden; }
.phone-row-title {
  font-size: 0.63rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.phone-row-sub {
  font-size: 0.53rem;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.phone-tabbar {
  height: 54px;
  background: white;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 8px 4px;
}
.phone-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.phone-tab-dot {
  width: 22px;
  height: 22px;
  border-radius: 6px;
}
.phone-tab-label {
  font-size: 0.43rem;
  color: var(--text-3);
}
.phone-tab.active .phone-tab-dot { background: var(--accent); }
.phone-tab.active .phone-tab-label { color: var(--accent); }
.phone-tab:not(.active) .phone-tab-dot { background: var(--border); }

/* ── Features ──────────────────────────────────── */
.features {
  padding: 80px 0;
}
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
.feature-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07), 0 0 1px rgba(0,0,0,0.05);
}
.feature-icon {
  width: 44px;
  height: 44px;
  background: var(--accent-light);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  color: var(--accent-dark);
}
.feature-icon svg {
  width: 22px;
  height: 22px;
}
.feature-card h3 {
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.feature-card p {
  font-size: 0.875rem;
  color: var(--text-2);
  line-height: 1.65;
  text-wrap: pretty;
}

/* ── How it works ──────────────────────────────── */
.how {
  padding: 72px 0;
  background: var(--accent-light);
  border-radius: 24px;
  margin: 0 32px 80px;
}
.section-title {
  font-family: var(--font-display);
  text-align: center;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.15;
  margin-bottom: 48px;
  color: var(--text);
  text-wrap: balance;
}
.steps {
  display: flex;
  flex-direction: column;
  max-width: 520px;
  margin: 0 auto;
  padding: 0 32px;
}
.step {
  display: flex;
  gap: 20px;
  padding: 20px 0;
  position: relative;
}
.step:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 19px;
  top: 52px;
  bottom: 0;
  width: 2px;
  background: var(--accent);
  opacity: 0.3;
}
.step-num {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.step-body h3 {
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 700;
  margin-bottom: 4px;
  letter-spacing: -0.02em;
  padding-top: 9px;
  text-wrap: balance;
}
.step-body p {
  font-size: 0.875rem;
  color: var(--text-2);
  text-wrap: pretty;
}

/* ── Footer ────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: -0.03em;
  text-decoration: none;
  color: var(--text);
}
.footer-logo span { color: var(--accent); }
.footer-links {
  display: flex;
  gap: 24px;
  list-style: none;
}
.footer-links a {
  font-size: 0.85rem;
  color: var(--text-2);
}
.footer-note {
  width: 100%;
  font-size: 0.8rem;
  color: var(--text-3);
}

/* ── Legal pages ────────────────────────────────── */
.legal-hero {
  padding: 56px 0 40px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 48px;
}
.legal-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: 10px;
}
.legal-hero p {
  color: var(--text-2);
  font-size: 0.9rem;
}
.legal-body {
  max-width: 640px;
  padding-bottom: 80px;
}
.legal-body h2 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 36px 0 10px;
}
.legal-body h2:first-child { margin-top: 0; }
.legal-body p, .legal-body li {
  font-size: 0.95rem;
  color: var(--text-2);
  line-height: 1.7;
  margin-bottom: 10px;
}
.legal-body ul {
  padding-left: 20px;
  margin-bottom: 10px;
}
.legal-body a { color: var(--accent-dark); }

/* ── Load animations ────────────────────────────── */
@keyframes chabi-enter {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: no-preference) {
  .hero-text {
    animation: chabi-enter 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  }
  .phone-wrap {
    animation: chabi-enter 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.12s both;
  }
}

/* Scroll-triggered reveal for feature cards — progressive enhancement */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .feature-card {
      animation: chabi-enter 0.4s ease-out both;
      animation-timeline: view();
      animation-range: entry 0% entry 35%;
    }
    .feature-card:nth-child(2) { animation-delay: 0.07s; }
    .feature-card:nth-child(3) { animation-delay: 0.14s; }
    .feature-card:nth-child(4) { animation-delay: 0.21s; }
  }
}

/* ── Responsive ─────────────────────────────────── */
@media (max-width: 680px) {
  .container { padding: 0 20px; }
  .nav-inner { padding: 0 20px; }

  .hero { padding: 56px 0 48px; }
  .hero::before { display: none; }
  .hero .container {
    grid-template-columns: 1fr;
    gap: 40px;
    text-align: center;
  }
  .hero-text { text-align: center; }
  .hero-text p { max-width: none; margin-left: auto; margin-right: auto; }
  .phone-wrap { width: 200px; margin: 0 auto; }

  .how { margin: 0 16px 64px; }
  .steps { padding: 0 20px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 440px) {
  .feature-grid { grid-template-columns: 1fr; }
}
