/* PaniBook public site. Wraplet palette: blue is water and the brand, orange only marks money moving. */
:root {
  --paper: #f8fafc;
  --paper-2: #eef2ff;
  --ink: #0f172a;
  --ink-2: #475569;
  --line: #dbe3ef;
  --blue: #2b4fff;
  --deep: #1731a5;
  --sky: #9fb4ff;
  --orange: #ff6538;
  --orange-ink: #c2410c; /* orange for text on light: 5.2:1 */
  --wa: #e7ffdb;

  --f-display: 'Bricolage Grotesque', 'Geist', ui-sans-serif, system-ui, sans-serif;
  --f-body: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --f-mono: 'Geist Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --f-urdu: 'Noto Nastaliq Urdu', 'Jameel Noori Nastaleeq', serif;

  --gut: clamp(16px, 4vw, 40px);
  --max: 1240px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --r: 18px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--f-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-weight: 700; }
dl, dd, ol, ul, figure, blockquote { margin: 0; padding: 0; }
ol, ul { list-style: none; }
button { font: inherit; color: inherit; }
.defs { position: absolute; }

.wrap { width: min(var(--max), 100% - 2 * var(--gut)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 6px; }
.langs :focus-visible, .end :focus-visible { outline-color: #fff; }

.skip {
  position: fixed; left: var(--gut); top: 12px; z-index: 50;
  padding: 10px 16px; border-radius: 10px; background: var(--ink); color: #fff; font-weight: 600; text-decoration: none;
  transform: translateY(-160%); transition: transform 0.2s var(--ease);
}
.skip:focus { transform: none; }

/* ---------- type ---------- */
.display {
  font-family: var(--f-display);
  font-size: clamp(3.4rem, 9.2vw, 8.75rem);
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.04em;
  font-variation-settings: 'opsz' 96;
}
.h2 {
  font-family: var(--f-display);
  font-size: clamp(2.1rem, 4.4vw, 4rem);
  line-height: 1;
  letter-spacing: -0.032em;
  font-variation-settings: 'opsz' 72;
  text-wrap: balance;
}
.eyebrow {
  font: 500 0.78rem/1.2 var(--f-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 1rem;
}
.eyebrow--light { color: var(--sky); }
.lede { font-size: clamp(1.08rem, 1.4vw, 1.25rem); line-height: 1.55; color: var(--ink-2); max-width: 36rem; text-wrap: pretty; }
.lede--light { color: rgb(255 255 255 / 0.82); }

/* ---------- buttons ---------- */
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 2rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 24px; border-radius: 14px;
  background: var(--blue); color: #fff; border: 2px solid var(--blue);
  font-weight: 600; text-decoration: none; letter-spacing: -0.005em;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s, transform 0.15s var(--ease);
}
.btn:active { transform: scale(0.98); }
.btn--sm { min-height: 42px; padding: 0 16px; border-radius: 11px; font-size: 0.95rem; }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--light { background: #fff; color: var(--deep); border-color: #fff; }
.btn--line { background: transparent; color: #fff; border-color: rgb(255 255 255 / 0.55); }
@media (hover: hover) {
  .btn:hover { background: var(--deep); border-color: var(--deep); }
  .btn--ghost:hover { background: #fff; border-color: var(--ink); color: var(--ink); }
  .btn--light:hover { background: var(--paper-2); border-color: var(--paper-2); }
  .btn--line:hover { background: rgb(255 255 255 / 0.1); border-color: #fff; }
}

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 20; transition: background-color 0.25s, box-shadow 0.25s; }
.top[data-scrolled] { background: rgb(248 250 252 / 0.86); backdrop-filter: saturate(1.4) blur(12px); box-shadow: 0 1px 0 var(--line); }
.top__in { display: flex; align-items: center; gap: 24px; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand__mark { width: 34px; height: 34px; }
.brand__name { font: 700 1.3rem/1 var(--f-display); letter-spacing: -0.03em; }
.nav { display: flex; gap: 28px; margin-left: auto; font-size: 0.95rem; font-weight: 500; }
.nav a { text-decoration: none; color: var(--ink-2); transition: color 0.2s; }
@media (hover: hover) { .nav a:hover { color: var(--ink); } }
@media (max-width: 760px) {
  .nav { display: none; }
  .top .btn { margin-left: auto; }
}

/* ---------- bottle drawing ---------- */
.bottle { --fill: 0; width: 100%; height: auto; overflow: visible; }
.b-cap { fill: var(--deep); }
.b-neck { fill: var(--sky); }
.b-glass { fill: rgb(159 180 255 / 0.16); }
.b-water { fill: var(--blue); transform: translateY(calc((1 - var(--fill)) * 280px)); }
.b-wave { animation: wave 3.2s linear infinite; }
.b-outline { fill: none; stroke: var(--deep); stroke-width: 3.5; stroke-linejoin: round; }
.b-ridge { stroke: rgb(23 49 165 / 0.28); stroke-width: 3; stroke-linecap: round; }
@keyframes wave { to { transform: translateX(100px); } }

/* ---------- 1. hero ---------- */
.hero {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 40px; align-items: center;
  min-height: calc(100svh - 68px); padding-block: 24px 56px;
}
.hero .lede { margin-top: 1.75rem; }
.credit { margin-top: 1.75rem; font-size: 0.92rem; color: var(--ink-2); }
.credit a { font-weight: 600; color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.hero__art { position: relative; justify-self: center; width: min(100%, 340px); }
.bottle--hero { --fill: 0.32; transform: rotate(-4deg); filter: drop-shadow(0 30px 40px rgb(23 49 165 / 0.18)); }
.hero__cue { margin-top: 28px; text-align: center; font: 500 0.78rem/1.4 var(--f-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.hero__cue::after { content: ''; display: block; width: 1px; height: 40px; margin: 12px auto 0; background: linear-gradient(var(--blue), transparent); }
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; min-height: 0; padding-top: 32px; gap: 32px; }
  .hero__art { width: min(62%, 240px); }
}

/* ---------- 2. signature: khata ---------- */
.khata { position: relative; height: 400svh; background: linear-gradient(var(--paper), var(--paper-2) 30%, var(--paper-2) 80%, var(--paper)); }
.stage { position: sticky; top: 0; height: 100svh; padding-top: 68px; display: flex; align-items: center; overflow: hidden; }
.stage__in {
  display: grid; gap: 28px 48px; align-items: center;
  grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.1fr) minmax(0, 0.95fr);
  grid-template-areas: 'head head head' 'bottle ledger wa';
}
.stage__head { grid-area: head; }
.stage__bottle { grid-area: bottle; display: flex; align-items: center; gap: 20px; }
.stage__bottle .bottle { width: min(100%, 230px); }

.rail { display: grid; gap: 18px; font: 500 0.8rem/1 var(--f-mono); letter-spacing: 0.06em; text-transform: uppercase; color: rgb(71 85 105 / 0.6); }
.rail li { display: flex; align-items: center; gap: 10px; transition: color 0.3s; }
.rail li::before { content: ''; width: 10px; height: 10px; border-radius: 50%; border: 2px solid currentColor; transition: background-color 0.3s, border-color 0.3s; }
.rail li.is-on { color: var(--deep); }
.rail li.is-on::before { background: var(--blue); border-color: var(--blue); }

.ledger {
  grid-area: ledger; background: #fff; border-radius: var(--r); padding: 26px 28px 22px;
  box-shadow: 0 1px 0 var(--line), 0 30px 60px -30px rgb(23 49 165 / 0.35);
}
.ledger__cap { display: flex; justify-content: space-between; gap: 12px; font: 500 0.78rem/1.3 var(--f-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.ledger__rows { display: grid; gap: 4px; padding-top: 10px; }
.row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 10px 0; }
.row dt { color: var(--ink-2); }
.row dd { font: 500 1.05rem/1 var(--f-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.row--paid dd { color: var(--orange-ink); font-weight: 600; }
.row--total { margin-top: 6px; padding-top: 16px; border-top: 1.5px dashed var(--line); }
.row--total dt { color: var(--ink); font-weight: 600; }
.row--total dd { font: 700 clamp(1.9rem, 3vw, 2.6rem)/1 var(--f-display); letter-spacing: -0.03em; color: var(--blue); }
.ledger__note { margin-top: 14px; font-size: 0.85rem; color: var(--ink-2); }

.wa {
  grid-area: wa; align-self: center; position: relative;
  background: var(--wa); border-radius: 16px 16px 16px 4px; padding: 16px 18px 14px;
  box-shadow: 0 24px 50px -24px rgb(15 23 42 / 0.4); transform: rotate(1.5deg);
}
.wa__cap { font: 500 0.72rem/1.3 var(--f-mono); letter-spacing: 0.08em; text-transform: uppercase; color: #3f6212; margin-bottom: 10px; }
.wa__msg { font-size: 0.93rem; line-height: 1.5; }
.wa__msg span { display: block; }
.wa__msg .l--gap { margin-bottom: 0.75em; }
.wa__msg .l--key { font-weight: 600; }

/* Scroll staging: only when JS drives it. Without JS (or with reduced motion) everything shows. */
html.js .khata .row, html.js .khata .wa { transition: opacity 0.5s var(--ease), transform 0.5s var(--ease); }
html.js .khata .row:not(.is-on) { opacity: 0.16; transform: translateY(10px); }
html.js .khata .wa:not(.is-on) { opacity: 0; transform: translateY(40px) rotate(6deg); }

@media (max-width: 899px) {
  .khata { height: 360svh; }
  .stage__in {
    grid-template-columns: 92px minmax(0, 1fr); gap: 18px 16px;
    grid-template-areas: 'head head' 'bottle ledger' 'wa wa';
  }
  .stage__bottle .bottle { width: 92px; }
  .rail { display: none; }
  .ledger { padding: 16px 16px 14px; }
  .ledger__cap { font-size: 0.66rem; padding-bottom: 10px; }
  .ledger__date { display: none; }
  .row { padding: 6px 0; font-size: 0.86rem; }
  .row dd { font-size: 0.88rem; }
  .row--total dd { font-size: 1.6rem; }
  .ledger__note { display: none; }
  .wa { transform: none; padding: 12px 14px; }
  html.js .khata .wa:not(.is-on) { transform: translateY(40px); }
  .wa__msg { font-size: 0.8rem; line-height: 1.42; }
}
@media (max-width: 899px) and (max-height: 760px) {
  .stage__head .eyebrow { display: none; }
  .wa__msg .l--opt { display: none; }
}

/* ---------- 3. offline ---------- */
.split { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 64px; align-items: center; padding-block: clamp(96px, 14vw, 180px); }
.split__copy p:not(.eyebrow) { margin-top: 1.25rem; color: var(--ink-2); max-width: 34rem; }
.voice { margin-top: 2.25rem; padding-left: 20px; border-left: 3px solid var(--blue); }
.voice p { font: 600 clamp(1.3rem, 2vw, 1.6rem)/1.25 var(--f-display); letter-spacing: -0.02em; color: var(--ink) !important; margin: 0 !important; }
.voice footer { margin-top: 8px; font-size: 0.88rem; color: var(--ink-2); }

.phone { justify-self: center; width: min(100%, 320px); aspect-ratio: 320 / 640; padding: 12px; border-radius: 46px; background: var(--ink); box-shadow: 0 40px 80px -40px rgb(15 23 42 / 0.6); }
.phone__screen { height: 100%; border-radius: 36px; background: var(--paper); padding: 28px 16px 16px; overflow: hidden; }
.phone__bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: 600; font-size: 0.95rem; }
.pill { font: 500 0.68rem/1 var(--f-mono); padding: 6px 9px; border-radius: 99px; background: #e2e8f0; color: var(--ink-2); white-space: nowrap; transition: background-color 0.4s, color 0.4s; }
.pill.is-synced { background: var(--blue); color: #fff; }
.stops { display: grid; gap: 10px; margin-top: 18px; }
.stop { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 12px 14px; border-radius: 14px; background: #fff; border: 1px solid var(--line); font-size: 0.85rem; }
.stop b { font-weight: 600; }
.stop span { grid-column: 1; color: var(--ink-2); font-size: 0.78rem; }
.stop i { grid-row: 1 / span 2; grid-column: 2; align-self: center; font: 500 0.78rem/1 var(--f-mono); font-style: normal; color: var(--ink-2); }
.stop--done { border-color: transparent; background: #eef2ff; }
.stop--done i { color: var(--deep); }
.stop:last-child { border: 2px solid var(--blue); }
.stop:last-child i { color: var(--blue); font-weight: 600; }

/* ---------- 4. bottles ---------- */
.bottles { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px; align-items: end; padding-bottom: clamp(96px, 14vw, 180px); }
.bottles__copy p:not(.eyebrow) { margin-top: 1.25rem; color: var(--ink-2); max-width: 34rem; }
.tally { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.tally div { padding: 22px 0 20px; border-bottom: 1px solid var(--line); }
.tally div:nth-child(odd) { padding-right: 20px; border-right: 1px solid var(--line); }
.tally div:nth-child(even) { padding-left: 24px; }
.tally dt { font-size: 0.88rem; color: var(--ink-2); }
.tally dd { margin-top: 6px; font: 700 clamp(2.2rem, 4vw, 3.4rem)/1 var(--f-display); letter-spacing: -0.035em; font-variant-numeric: tabular-nums; }

/* ---------- 5. languages ---------- */
.langs { background: var(--deep); color: #fff; padding-block: clamp(88px, 12vw, 160px); position: relative; overflow: hidden; }
.langs::before { content: ''; position: absolute; inset: -30% -20% auto auto; width: 70%; height: 120%; border-radius: 80px; background: var(--blue); opacity: 0.45; transform: rotate(-14deg); pointer-events: none; }
.langs .wrap { position: relative; }
.tabs { display: inline-flex; gap: 6px; margin-top: 2.25rem; padding: 6px; border-radius: 16px; background: rgb(255 255 255 / 0.1); }
.tabs button { min-height: 44px; padding: 0 18px; border: 0; border-radius: 11px; background: transparent; color: rgb(255 255 255 / 0.85); font-weight: 600; cursor: pointer; }
.tabs button[aria-selected='true'] { background: #fff; color: var(--deep); }
.tabs button[lang='ur'] { font-family: var(--f-urdu); font-size: 0.95rem; }
.said { margin-top: 2.5rem; min-height: 9.5em; }
.said p { font: 600 clamp(1.8rem, 4.2vw, 3.6rem)/1.12 var(--f-display); letter-spacing: -0.025em; max-width: 22ch; text-wrap: balance; }
.said p[lang='ur'] { font-family: var(--f-urdu); font-weight: 500; line-height: 2.1; letter-spacing: 0; max-width: 24ch; margin-left: auto; text-align: right; }
.langs__note { margin-top: 2rem; max-width: 38rem; color: rgb(255 255 255 / 0.8); }
.langs__note bdi { font-family: var(--f-urdu); }

/* ---------- 6. feature index ---------- */
.index { padding-block: clamp(96px, 14vw, 180px); }
.feats { display: grid; grid-template-columns: 1fr 1fr; column-gap: 56px; margin-top: 3rem; counter-reset: f; }
.feats li { display: grid; grid-template-columns: 56px 1fr; gap: 4px 12px; padding: 26px 0; border-top: 1px solid var(--line); }
.feats__n { grid-row: 1 / span 2; font: 500 0.85rem/1.9 var(--f-mono); color: var(--blue); }
.feats h3 { font: 700 clamp(1.3rem, 1.8vw, 1.6rem)/1.15 var(--f-display); letter-spacing: -0.02em; }
.feats p { color: var(--ink-2); font-size: 0.98rem; }

/* ---------- 7. end ---------- */
.end { position: relative; overflow: hidden; background: var(--blue); color: #fff; padding-block: clamp(96px, 13vw, 170px); }
.end::before { content: ''; position: absolute; left: -10%; bottom: -55%; width: 120%; height: 90%; background: var(--deep); transform: rotate(-6deg); pointer-events: none; }
.end::after { content: ''; position: absolute; right: 0; top: 0; width: clamp(90px, 14vw, 200px); aspect-ratio: 1; background: var(--orange); clip-path: polygon(30% 0, 100% 0, 100% 100%); pointer-events: none; }
.end__in { position: relative; }
.display--end { font-size: clamp(2.8rem, 7.2vw, 6.5rem); max-width: 12ch; }
.end .lede { margin-top: 1.5rem; }

/* ---------- footer ---------- */
.foot { padding-block: 40px; font-size: 0.92rem; color: var(--ink-2); }
.foot__in { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 32px; }
.foot__in > p:first-of-type { flex: 1 1 260px; }
.foot__in p a { color: var(--ink); font-weight: 600; text-underline-offset: 3px; }
.foot__nav { display: flex; gap: 20px; }
.foot__nav a { text-decoration: none; }
@media (hover: hover) { .foot__nav a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; } }
.foot__copy { width: 100%; font-size: 0.82rem; }

/* ---------- reveal (JS only) ---------- */
html.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
html.js .reveal.in { opacity: 1; transform: none; }

/* ---------- small screens ---------- */
@media (max-width: 860px) {
  .split, .bottles { grid-template-columns: 1fr; gap: 48px; }
  .phone { width: min(100%, 280px); }
  .feats { grid-template-columns: 1fr; }
  .tabs { display: flex; width: 100%; }
  .tabs button { flex: 1; padding: 0 8px; }
}

/* ---------- reduced motion: same content, no movement ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .khata { height: auto; }
  .stage { position: static; height: auto; padding-block: 96px; }
  .stage .bottle { --fill: 0.85; }
  html.js .khata .row, html.js .khata .wa, html.js .reveal { opacity: 1 !important; transform: none !important; }
  html.js .khata .wa { transform: rotate(1.5deg) !important; }
}
@media (prefers-reduced-motion: reduce) and (max-width: 899px) {
  html.js .khata .wa { transform: none !important; }
  .wa__msg .l--opt { display: block; }
}

/* ---------- 404 ---------- */
.lost { min-height: 100svh; display: flex; flex-direction: column; justify-content: center; gap: 0; padding-block: 48px; }
.lost .brand { position: absolute; top: 24px; }
.lost .eyebrow { margin-top: 0; }
.lost__title { font-size: clamp(2.8rem, 8vw, 7rem); max-width: 13ch; }
.lost .lede { margin-top: 1.5rem; }
