/* ===========================================================================
   JamaBook — shared stylesheet
   ---------------------------------------------------------------------------
   Design language: the bahi-khata (bound ledger register). Ruled baselines,
   a marginal column, tabular figures, ink-on-paper neutrals biased toward the
   product's own teal (#0F4C5C, the app's brand token) so site and app agree.
   =========================================================================== */

:root {
  --paper:      #FBFAF7;
  --surface:    #FFFFFF;
  --ink:        #12242B;
  --muted:      #5C6B70;
  --brand:      #0F4C5C;
  --brand-ink:  #0B3A46;
  --brand-soft: #E4EDEE;
  --rule:       #D6DEDC;
  --redink:     #A8391A;
  --flag:       #8A6A12;
  --flag-soft:  #FBF2DA;
  --on-brand:   #FFFFFF;

  --display: 'Bitter', Georgia, 'Times New Roman', serif;
  --body: 'Karla', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --mono: 'IBM Plex Mono', 'Consolas', monospace;
  --deva: 'Noto Sans Devanagari', 'Nirmala UI', sans-serif;

  --measure: 68ch;
  --page: 64rem;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:      #0D171B;
    --surface:    #132329;
    --ink:        #EAF1F0;
    --muted:      #9AAFB3;
    --brand:      #6FBDC9;
    --brand-ink:  #9AD4DD;
    --brand-soft: #16323A;
    --rule:       #294049;
    --redink:     #E8846A;
    --flag:       #D9B75A;
    --flag-soft:  #2B2413;
    --on-brand:   #0D171B;
  }
}

:root[data-theme="dark"] {
  --paper:      #0D171B;
  --surface:    #132329;
  --ink:        #EAF1F0;
  --muted:      #9AAFB3;
  --brand:      #6FBDC9;
  --brand-ink:  #9AD4DD;
  --brand-soft: #16323A;
  --rule:       #294049;
  --redink:     #E8846A;
  --flag:       #D9B75A;
  --flag-soft:  #2B2413;
  --on-brand:   #0D171B;
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--brand);
  color: var(--on-brand);
  padding: 0.7rem 1.1rem;
  z-index: 100;
}
.skip:focus { left: 0; }

.wrap { max-width: var(--page); margin: 0 auto; padding: 0 1.5rem; }

/* ---- site header ---------------------------------------------------- */
.site-head {
  border-bottom: 1px solid var(--rule);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 20;
}
.site-head .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}
.brand {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--ink);
  white-space: nowrap;
}
/* One flex item, not two: with .brand a flex container, a bare <span>Jama</span>
   beside the text "Book" makes each an item and the gap splits the word. */
.brand-text { white-space: nowrap; }
.brand-accent { color: var(--brand); }
.site-nav { display: flex; gap: 0.35rem 1.35rem; flex-wrap: wrap; align-items: center; }
.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.2rem 0;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--brand); }

/* ---- typography ------------------------------------------------------ */
h1, h2, h3, h4 { font-family: var(--display); text-wrap: balance; letter-spacing: -0.01em; }
h1 {
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.1;
  margin: 0 0 1rem;
}
h2 { font-weight: 700; font-size: 1.55rem; line-height: 1.25; margin: 0 0 0.85rem; }
h3 { font-weight: 500; font-size: 1.1rem; margin: 1.9rem 0 0.5rem; }
h4 { font-weight: 500; font-size: 0.98rem; margin: 1.3rem 0 0.4rem; }

p { margin: 0 0 1rem; max-width: var(--measure); }
ul, ol { max-width: var(--measure); margin: 0 0 1rem; padding-left: 1.15rem; }
li { margin-bottom: 0.4rem; }
li::marker { color: var(--brand); }

a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 2px;
}

.lede { font-size: 1.18rem; color: var(--muted); max-width: 52ch; text-wrap: balance; }
.deva { font-family: var(--deva); }
.mono, code { font-family: var(--mono); font-size: 0.85em; font-variant-numeric: tabular-nums; }

/* ---- page scaffolding ------------------------------------------------ */
main { display: block; }
.page-head { padding: 3.5rem 0 2rem; border-bottom: 2px solid var(--ink); }
.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand);
  margin: 0 0 0.7rem;
}
section { padding: 2.6rem 0; border-bottom: 1px solid var(--rule); }
section:last-of-type { border-bottom: 0; }

/* The register's marginal column. */
.sheet { display: grid; grid-template-columns: 7.5rem 1fr; gap: 0 2.5rem; }
.sheet > .margin-note {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 2.75rem;
  text-align: right;
}
.sheet > .col { min-width: 0; }
@media (max-width: 760px) {
  .sheet { grid-template-columns: 1fr; gap: 0; }
  .sheet > .margin-note { text-align: left; padding-top: 2rem; padding-bottom: 0; }
}

/* ---- hero ------------------------------------------------------------ */
.hero { padding: 4.5rem 0 3rem; border-bottom: 2px solid var(--ink); }
.hero .lede { margin-bottom: 1.8rem; }
.hero-figures {
  display: flex;
  gap: 2.5rem;
  flex-wrap: wrap;
  margin-top: 2.2rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--rule);
}
.figure .n {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.7rem;
  display: block;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.figure .l {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.cta {
  display: inline-block;
  background: var(--brand);
  color: var(--on-brand);
  font-weight: 700;
  padding: 0.75rem 1.5rem;
  text-decoration: none;
  border-radius: 3px;
}
.cta:hover { background: var(--brand-ink); }
.cta-row { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }

/* ---- feature grid ---------------------------------------------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  margin-top: 1.4rem;
}
.grid > article { background: var(--surface); padding: 1.35rem 1.4rem; }
.grid h3 { margin-top: 0; font-size: 1.02rem; }
.grid p { font-size: 0.93rem; margin-bottom: 0; color: var(--muted); }

/* ---- two-column ledger panel ---------------------------------------- */
.ledger {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  margin: 1.3rem 0 0;
}
@media (max-width: 620px) { .ledger { grid-template-columns: 1fr; } }
.ledger > div { background: var(--surface); padding: 1.25rem 1.35rem; }
.ledger h3 {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 0 0.75rem;
  font-weight: 500;
}
.ledger .stays h3 { color: var(--brand); }
.ledger .never h3 { color: var(--redink); }
.ledger ul { margin: 0; padding-left: 1rem; font-size: 0.94rem; }
.ledger .never li::marker { color: var(--redink); }

/* ---- tables ---------------------------------------------------------- */
.table-scroll { overflow-x: auto; margin: 1.1rem 0 0; }
table { width: 100%; border-collapse: collapse; font-size: 0.89rem; min-width: 32rem; }
caption {
  text-align: left;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 0.6rem;
}
th, td { text-align: left; padding: 0.62rem 0.9rem 0.62rem 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
th {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--ink);
}
tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--brand-soft) 40%, transparent); }
.yes { color: var(--brand); font-weight: 700; }
.no { color: var(--redink); font-weight: 700; }

/* ---- FAQ ------------------------------------------------------------- */
.qa { border-bottom: 1px solid var(--rule); padding: 1.3rem 0; max-width: var(--measure); }
.qa:last-child { border-bottom: 0; }
.qa h3 { margin: 0 0 0.5rem; font-size: 1.06rem; font-weight: 700; }
.qa p { margin-bottom: 0.7rem; }
.qa p:last-child { margin-bottom: 0; }

/* ---- notices --------------------------------------------------------- */
.notice {
  background: var(--flag-soft);
  border-left: 3px solid var(--flag);
  padding: 1rem 1.2rem;
  margin: 0 0 2rem;
  max-width: var(--measure);
}
.notice p { margin: 0; font-size: 0.93rem; }
.notice b {
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 0.3rem;
  color: var(--flag);
}
.fill {
  background: var(--flag-soft);
  color: var(--flag);
  font-family: var(--mono);
  font-size: 0.78rem;
  padding: 0.1rem 0.42rem;
  border: 1px dashed var(--flag);
  border-radius: 2px;
  white-space: nowrap;
}

/* ---- footer ---------------------------------------------------------- */
.site-foot {
  border-top: 2px solid var(--ink);
  margin-top: 3rem;
  padding: 2.5rem 0 3.5rem;
  font-size: 0.88rem;
  color: var(--muted);
}
.foot-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 1.8rem;
  margin-bottom: 2rem;
}
.foot-cols h2 {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 0 0 0.6rem;
}
.foot-cols ul { list-style: none; padding: 0; margin: 0; }
.foot-cols li { margin-bottom: 0.35rem; }
.foot-cols a { color: var(--muted); text-decoration: none; }
.foot-cols a:hover { color: var(--brand); text-decoration: underline; }
.foot-legal { border-top: 1px solid var(--rule); padding-top: 1.3rem; }
.foot-legal p { font-size: 0.82rem; margin-bottom: 0.4rem; }

.crumbs { font-size: 0.8rem; color: var(--muted); padding: 1rem 0 0; }
.crumbs a { color: var(--muted); }
.crumbs ol { list-style: none; display: flex; gap: 0.5rem; padding: 0; margin: 0; flex-wrap: wrap; }
.crumbs li::after { content: "/"; margin-left: 0.5rem; color: var(--rule); }
.crumbs li:last-child::after { content: ""; }

/* ===========================================================================
   Motion
   ---------------------------------------------------------------------------
   The resting state is the readable state. JS adds .lift-armed itself, so if
   the script never runs nothing is offset and nothing is dimmed — the page is
   simply still. Every effect here is disabled under prefers-reduced-motion.
   =========================================================================== */

.lift-armed {
  transform: translateY(12px);
  opacity: 0.72;
  transition: transform 620ms cubic-bezier(.22,.61,.36,1), opacity 620ms ease;
  will-change: transform;
}
.lift-in { transform: none; opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .lift-armed { transform: none; opacity: 1; transition: none; }
}

/* ---- hero with the animated register -------------------------------- */
.hero-split {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 3rem;
  align-items: center;
}
@media (max-width: 880px) {
  .hero-split { grid-template-columns: 1fr; gap: 2.2rem; }
}

.ledger-frame {
  position: relative;
  border: 1px solid var(--rule);
  background: var(--surface);
  box-shadow: 0 18px 38px -28px rgba(18, 36, 43, 0.55);
}
/* The bound edge of a register: a stitched spine down the left. */
.ledger-frame::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: repeating-linear-gradient(
    to bottom,
    var(--brand) 0 10px,
    transparent 10px 18px
  );
  opacity: 0.5;
}
#ledger-canvas {
  display: block;
  width: 100%;
  height: 340px;
}
@media (max-width: 480px) { #ledger-canvas { height: 290px; } }

.ledger-caption {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.6rem 0 0;
  text-align: right;
}

/* ---- micro-interactions --------------------------------------------- */
.grid > article {
  transition: background 220ms ease, transform 220ms cubic-bezier(.22,.61,.36,1);
}
.grid > article:hover {
  background: var(--brand-soft);
  transform: translateY(-2px);
}
.cta { transition: background 200ms ease, transform 200ms ease; }
.cta:hover { transform: translateY(-1px); }

.figure .n { transition: color 200ms ease; }

@media (prefers-reduced-motion: reduce) {
  .grid > article, .cta { transition: none; }
  .grid > article:hover, .cta:hover { transform: none; }
}

/* A quiet pulse on the "no signal" idea — three bars, the third never fills. */
.signal { display: inline-flex; align-items: flex-end; gap: 2px; height: 0.8em; margin-left: 0.4rem; }
.signal i { width: 3px; background: var(--brand); display: block; }
.signal i:nth-child(1) { height: 40%; }
.signal i:nth-child(2) { height: 70%; }
.signal i:nth-child(3) { height: 100%; opacity: 0.25; }

/* ===========================================================================
   Hindi pages
   ---------------------------------------------------------------------------
   Bitter and Karla carry no Devanagari, so on a Hindi page they would fall
   back silently to whatever the system has — which is how Hindi sites end up
   looking broken while the CSS "works". Redefining the two font tokens swaps
   the whole page to a face that actually has the glyphs, without touching a
   single component rule.

   The mono token is deliberately left alone: it only ever sets digits, codes
   and permission names, which stay Latin in both languages.
   =========================================================================== */

html[lang="hi"] {
  --display: 'Noto Sans Devanagari', 'Nirmala UI', Georgia, serif;
  --body: 'Noto Sans Devanagari', 'Nirmala UI', system-ui, sans-serif;
  /* Devanagari needs more room between lines than Latin at the same size:
     the matras sit above and below the baseline and collide otherwise. */
  --measure: 62ch;
}
html[lang="hi"] body { line-height: 1.8; }
html[lang="hi"] h1, html[lang="hi"] h2, html[lang="hi"] h3 { line-height: 1.4; letter-spacing: 0; }
html[lang="hi"] .qa h3 { font-weight: 700; }

/* ---- brand mark in the header --------------------------------------- */
.brand { display: inline-flex; align-items: center; gap: 0.55rem; }
.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 5px;
  display: block;
  flex: none;
}

/* ---- app screenshots -------------------------------------------------- */
.shots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1.75rem 1.25rem;
  margin-top: 1.5rem;
  align-items: start;
}
.shot { margin: 0; }
/*
  A plain bezel, not a photorealistic handset. The screenshot is the content;
  a glossy device mock-up would date faster than the app and draw the eye away
  from what the screen actually says.
*/
.phone {
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 6px;
  background: var(--surface);
  overflow: hidden;
}
.phone img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 9px;
  /* Width and height are set on the tag too, so the row reserves its space
     before the image arrives and the page does not jump as they load. */
}
.shot figcaption {
  font-size: 0.86rem;
  color: var(--muted);
  padding-top: 0.7rem;
  line-height: 1.45;
}
.shot figcaption b {
  display: block;
  color: var(--ink);
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.15rem;
}
