/* FinNest website. Tokens from docs/WEBSITE.md */
@font-face { font-family: 'Anybody'; src: url('fonts/anybody.woff2') format('woff2-variations'), url('fonts/anybody.woff2') format('woff2'); font-weight: 100 900; font-stretch: 50% 150%; font-display: swap; }
@font-face { font-family: 'Plus Jakarta Sans'; src: url('fonts/jakarta-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Plus Jakarta Sans'; src: url('fonts/jakarta-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Plus Jakarta Sans'; src: url('fonts/jakarta-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Kalam'; src: url('fonts/kalam-latin-400.woff2') format('woff2'); font-weight: 400; font-display: swap; unicode-range: U+0000-00FF, U+20B9, U+2212, U+2713; }
@font-face { font-family: 'Kalam'; src: url('fonts/kalam-latin-700.woff2') format('woff2'); font-weight: 700; font-display: swap; unicode-range: U+0000-00FF, U+20B9, U+2212, U+2713; }
@font-face { font-family: 'Kalam'; src: url('fonts/kalam-deva-700.woff2') format('woff2'); font-weight: 700; font-display: swap; unicode-range: U+0900-097F; }

:root {
  --red: #A3201F;
  --red-deep: #7E1414;
  --marigold: #E8A10B;
  --ink: #1B2246;
  --ink-soft: #4A5175;
  --lavender: #E7E6F0;
  --paper: #FBF3DC;
  --rule-blue: #9DB4D9;
  --teal: #0F766E;
  --display: 'Anybody', 'Arial Black', system-ui, sans-serif;
  --body: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --hand: 'Kalam', 'Comic Sans MS', cursive;
  --measure: 62ch;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--lavender); color: var(--ink); font: 400 1.0625rem/1.6 var(--body); -webkit-font-smoothing: antialiased; }
a { color: var(--red); text-underline-offset: 3px; }
a:hover { color: var(--red-deep); }
:focus-visible { outline: 3px solid var(--marigold); outline-offset: 3px; border-radius: 3px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 12px; z-index: 10; background: #fff; padding: 8px 12px; }
h1, h2, h3 { font-family: var(--display); line-height: 1.02; margin: 0 0 .5em; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.9rem, 4vw, 2.8rem); font-weight: 800; font-stretch: 125%; }
h3 { font-size: 1.25rem; font-weight: 700; font-stretch: 110%; }
p { margin: 0 0 1em; max-width: var(--measure); }

/* ---------- Header ---------- */
.bar { max-width: 1180px; margin: 0 auto; padding: 18px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font: 800 1.35rem var(--display); font-stretch: 120%; color: var(--ink); text-decoration: none; }
.logo-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--teal); color: #fff; display: grid; place-items: center; font: 700 1.1rem var(--body); }
.bar nav { display: flex; align-items: center; gap: 22px; }
.bar nav a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: .95rem; }
.bar nav a:hover { color: var(--red); }
.bar .bar-cta { color: #fff; background: var(--ink); padding: 8px 16px; border-radius: 999px; }
.bar .bar-cta:hover { color: #fff; background: var(--red); }

/* ---------- Hero ---------- */
.hero { max-width: 1180px; margin: 0 auto; padding: 24px 24px 72px; display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); gap: 32px; align-items: center; }
.hero h1 { font-size: clamp(2.6rem, 7.2vw, 5.6rem); font-weight: 900; font-stretch: 140%; line-height: .92; letter-spacing: -0.02em; margin-bottom: .35em; }
.lede { font-size: 1.2rem; color: var(--ink-soft); }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 26px 0 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 14px 22px; border-radius: 12px; font: 700 1rem var(--body); text-decoration: none; border: 2px solid transparent; cursor: pointer; }
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { background: var(--red-deep); color: #fff; }
.btn-line { border-color: var(--ink); color: var(--ink); }
.btn-line:hover { background: var(--ink); color: #fff; }
.fine { font-size: .9rem; color: var(--ink-soft); }

/* ---------- The khata (3D ledger) ---------- */
.scene { perspective: 2000px; perspective-origin: 50% 20%; padding: 30px 0 70px; }
.khata {
  --rx: 18deg; --ry: 0deg; --rz: -3deg;
  position: relative; width: 49%; margin-left: 50%; aspect-ratio: 3 / 4;
  container-type: inline-size;
  transform-style: preserve-3d;
  transform: rotateX(var(--rx)) rotateY(var(--ry)) rotateZ(var(--rz));
  transition: transform .5s cubic-bezier(.2, .7, .2, 1);
}
.khata > * { position: absolute; inset: 0; }
.back-cover { inset: -10px -12px -10px -2px; background: var(--red); border-radius: 4px 10px 10px 4px; transform: translateZ(-16px); box-shadow: 0 40px 60px -20px rgba(27, 34, 70, .45);
  background-image: repeating-linear-gradient(90deg, rgba(0,0,0,.05) 0 2px, transparent 2px 5px), repeating-linear-gradient(0deg, rgba(255,255,255,.04) 0 2px, transparent 2px 6px); }
.page-block { inset: 3px 0 3px 0; background: repeating-linear-gradient(0deg, #efe4c3 0 1px, var(--paper) 1px 3px); transform: translateZ(-8px); border-radius: 0 6px 6px 0; }
.page {
  background-color: var(--paper);
  background-image:
    linear-gradient(90deg, transparent 13%, rgba(163, 32, 31, .55) 13%, rgba(163, 32, 31, .55) calc(13% + 1px), transparent calc(13% + 1px), transparent calc(13% + 4px), rgba(163, 32, 31, .55) calc(13% + 4px), rgba(163, 32, 31, .55) calc(13% + 5px), transparent calc(13% + 5px)),
    repeating-linear-gradient(180deg, transparent 0 calc(var(--line) - 1px), var(--rule-blue) calc(var(--line) - 1px) var(--line));
  --line: 10.6cqw;
  padding: calc(var(--line) * 1.05) 8% 0 17%;
  color: var(--ink);
}
.page-right { border-radius: 0 6px 6px 0; box-shadow: inset 14px 0 18px -14px rgba(0,0,0,.35); }
.hand { font-family: var(--hand); margin: 0; max-width: none; font-size: 5.6cqw; line-height: var(--line); white-space: nowrap; }
.hand.head { font-weight: 700; font-size: 6.4cqw; color: var(--red); }
.hand.row { display: flex; justify-content: space-between; gap: 8px; }
.hand.big { font-weight: 700; font-size: 7cqw; }
.hand.save { color: var(--teal); font-weight: 700; }
.hand output, .hand span { font-weight: 700; white-space: nowrap; }
.page hr { border: 0; border-top: 2px solid var(--ink); margin: calc(var(--line) * .5 - 1px) 0 calc(var(--line) * .5 - 1px); }
.page input[type=range] { width: 100%; height: var(--line); margin: 0; accent-color: var(--red); cursor: pointer; }
.cover { transform-style: preserve-3d; transform-origin: 0 50%; transform: translateZ(4px) rotateY(0deg); transition: transform 1.7s cubic-bezier(.65, .05, .25, 1); }
.khata.open .cover { transform: translateZ(1px) rotateY(-179.5deg); }
.cover-front, .cover-inside { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.cover-front {
  inset: -10px -12px -10px -2px; border-radius: 4px 10px 10px 4px; background: var(--red); color: #FBE9C0;
  background-image: repeating-linear-gradient(90deg, rgba(0,0,0,.06) 0 2px, transparent 2px 5px), radial-gradient(circle at 30% 20%, rgba(255,255,255,.12), transparent 60%);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6%;
  box-shadow: inset 0 0 0 6px rgba(232, 161, 11, .55), inset 0 0 0 9px var(--red);
}
.shubh { font: 700 clamp(1.4rem, 3.4vw, 2.4rem) var(--hand); color: var(--marigold); }
.cover-mark { font: 700 clamp(2.6rem, 7vw, 5rem) var(--body); line-height: 1; color: #FBE9C0; }
.cover-name { font: 800 clamp(.9rem, 1.8vw, 1.3rem) var(--display); font-stretch: 130%; letter-spacing: .02em; }
.cover-inside { transform: rotateY(180deg); border-radius: 6px 0 0 6px; box-shadow: inset -14px 0 18px -14px rgba(0,0,0,.35); }
.string { inset: auto; left: 18px; top: -6px; width: 7px; height: calc(100% + 46px); background: linear-gradient(90deg, #c98500, var(--marigold), #c98500); transform: translateZ(6px); border-radius: 0 0 3px 3px; clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 94%, 0 100%); }
.khata.open .string { transform: translateZ(1px); }

/* ---------- Ledger band ---------- */
.ledger { background: var(--paper); padding: 72px max(24px, calc((100% - 1132px) / 2)); position: relative;
  background-image: linear-gradient(90deg, transparent 64px, rgba(163,32,31,.6) 64px, rgba(163,32,31,.6) 65px, transparent 65px, transparent 69px, rgba(163,32,31,.6) 69px, rgba(163,32,31,.6) 70px, transparent 70px); }
.ledger h2, .ledger > p { padding-left: 64px; }
.section-note { color: var(--ink-soft); }
.ledger table { width: 100%; border-collapse: collapse; margin: 20px 0 28px; }
.ledger th { text-align: left; font: 600 .95rem var(--body); color: var(--red); padding: 10px 12px; border-bottom: 2px solid var(--ink); }
.ledger th:first-child, .ledger td:first-child { padding-left: 64px; }
.ledger td { padding: 13px 12px; border-bottom: 1px solid var(--rule-blue); vertical-align: top; }
.ledger td:first-child { font-size: 1.08rem; }
.ledger td:last-child { width: 34%; border-left: 1px solid rgba(163,32,31,.6); font-weight: 600; }
.ledger tbody tr:hover td { background: rgba(232, 161, 11, .12); }

/* ---------- Screenshots ---------- */
.shots, .private, .get { max-width: 1180px; margin: 0 auto; padding: 80px 24px 0; }
.shot-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; margin-top: 28px; }
.shot-row figure { margin: 0; }
.shot-row img { width: 100%; height: auto; display: block; border: 9px solid var(--ink); border-radius: 30px; background: #fff; }
.shot-row figcaption { margin-top: 12px; font-size: .95rem; color: var(--ink-soft); max-width: 32ch; }

/* ---------- Privacy ---------- */
.private dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 36px; margin: 28px 0 0; }
.private dl > div { border-top: 2px solid var(--ink); padding: 14px 0 26px; }
.private dt { font-weight: 700; font-size: 1.05rem; margin-bottom: 4px; }
.private dd { margin: 0; color: var(--ink-soft); }

/* ---------- Fraud alarm ---------- */
.alarm { margin: 80px auto 0; max-width: 1132px; background: var(--red); color: #fff; border-radius: 18px; padding: 36px 40px; display: grid; grid-template-columns: auto 1fr; gap: 12px 40px; align-items: center; }
.alarm h2 { margin: 0; font-size: clamp(1.6rem, 3vw, 2.2rem); }
.alarm p { margin: 0; }
.alarm a { color: #fff; }
.alarm .num { font: 900 1.6em var(--display); font-stretch: 130%; text-decoration-thickness: 3px; }
.alarm a:hover { color: #FBE9C0; }

/* ---------- Get ---------- */
.get-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px; margin-top: 24px; }
.get-grid > div { border-top: 2px solid var(--ink); padding-top: 16px; }
.store-row { display: flex; flex-wrap: wrap; gap: 10px; }
.store { border: 2px dashed var(--ink-soft); border-radius: 12px; padding: 10px 14px; font-weight: 600; color: var(--ink-soft); }

/* ---------- Footer ---------- */
.foot { max-width: 1180px; margin: 96px auto 0; padding: 28px 24px 40px; border-top: 1px solid rgba(27,34,70,.2); font-size: .9rem; color: var(--ink-soft); }
.foot nav { display: flex; flex-wrap: wrap; gap: 20px; margin: 12px 0; }
.foot nav a { color: var(--ink); font-weight: 600; }
.copy { margin: 0; }

/* ---------- Legal pages ---------- */
.doc { max-width: 760px; margin: 0 auto; padding: 24px 24px 0; }
.doc h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); font-weight: 900; font-stretch: 130%; }
.doc h2 { font-size: 1.5rem; font-stretch: 115%; margin-top: 1.6em; }
.doc .updated { color: var(--ink-soft); }
.doc ul { padding-left: 1.2em; max-width: var(--measure); }
.doc li { margin-bottom: .45em; }
.doc code { background: #fff; padding: 1px 6px; border-radius: 5px; font-size: .9em; }
.doc .box { background: #fff; border-left: 4px solid var(--red); padding: 16px 20px; border-radius: 0 10px 10px 0; margin: 20px 0; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-bottom: 40px; }
  .scene { padding: 10px 0 70px; }
  .khata { width: 46%; }
  .shot-row { grid-template-columns: repeat(3, minmax(220px, 1fr)); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; }
  .shot-row figure { scroll-snap-align: start; }
  .private dl { grid-template-columns: 1fr 1fr; }
  .alarm { grid-template-columns: 1fr; margin-left: 24px; margin-right: 24px; padding: 28px; }
}
@media (max-width: 560px) {
  body { font-size: 1rem; }
  .bar nav a:not(.bar-cta) { display: none; }
  /* Phones: the working page stays readable; the left page peeks in from the edge. */
  .scene { overflow-x: clip; margin: 0 -24px; padding: 20px 0 64px; }
  .khata { width: 64%; margin-left: 33%; --rx: 10deg; --rz: -2deg; }
  .ledger { background-image: linear-gradient(90deg, transparent 18px, rgba(163,32,31,.6) 18px, rgba(163,32,31,.6) 19px, transparent 19px); padding-left: 24px; padding-right: 16px; }
  .ledger h2, .ledger > p, .ledger th:first-child, .ledger td:first-child { padding-left: 12px; }
  .ledger td:last-child { width: 40%; }
  .private dl, .get-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .khata, .cover { transition: none !important; }
}
