@font-face { font-family: Satoshi; src: url(fonts/Satoshi-Regular.otf) format("opentype"); font-weight: 400; font-display: swap; }
@font-face { font-family: Satoshi; src: url(fonts/Satoshi-Medium.otf) format("opentype"); font-weight: 500; font-display: swap; }
@font-face { font-family: Satoshi; src: url(fonts/Satoshi-Bold.otf) format("opentype"); font-weight: 700; font-display: swap; }

:root {
  --accent: #18A44B;          /* Puch green */
  --accent-soft: #E8F5EC;
  --ink: #0E1411;
  --ink-2: #3E4642;
  --muted: #737B77;
  --faint: #A9AFAC;
  --line: #E6E8E7;
  --wash: #F6F7F6;
  --paper: #FFFFFF;
  --grey-bar: #D5D9D7;
  --radius: 16px;
  --maxw: 1160px;
}
.vtheme { --accent: #2F7BF6; --accent-soft: #EAF1FE; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: Satoshi, Inter, system-ui, "Noto Sans Devanagari", "Nirmala UI", sans-serif;
  color: var(--ink); background: var(--paper); line-height: 1.5; font-size: 17px;
}
img, video { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .86em; }
.wrap { max-width: var(--maxw); margin: 0 auto; }
.hl { color: var(--accent); }
.muted { color: var(--muted); font-size: 14px; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.94); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: var(--maxw); margin: 0 auto; display: flex; align-items: center; gap: 16px; padding: 10px 20px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.brand img { width: 26px; height: 26px; }
.chapters { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; flex: 1; }
.chapters::-webkit-scrollbar { display: none; }
.chapters a { text-decoration: none; font-size: 14px; font-weight: 500; color: var(--muted); padding: 6px 11px; border-radius: 999px; white-space: nowrap; }
.chapters a.active { background: var(--wash); color: var(--ink); }
.progress { position: absolute; left: 0; bottom: -1px; height: 2px; background: #18A44B; width: 0; }

/* ---------- sections ---------- */
.chapter { scroll-margin-top: 52px; }
.panel { padding: 88px 20px; position: relative; }
.panel + .panel { border-top: 1px solid var(--line); }
.panel[id] { scroll-margin-top: 52px; }
.pageno { position: absolute; top: 20px; right: 22px; font-size: 12px; color: var(--faint); font-weight: 500; letter-spacing: .06em; }

.kicker { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
h1, h2, h3 { line-height: 1.08; letter-spacing: -.02em; margin: 0; }
h1 { font-size: clamp(40px, 7vw, 84px); font-weight: 700; max-width: 14ch; }
h2 { font-size: clamp(30px, 4.2vw, 50px); font-weight: 700; max-width: 22ch; }
h3 { font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.lede { font-size: clamp(18px, 2vw, 21px); color: var(--ink-2); max-width: 56ch; margin: 18px 0 0; }

/* hero */
.hero { padding: 112px 20px 88px; position: relative; }
.hero-logo { height: 34px; margin-bottom: 56px; }

/* chapter cover */
.cover { background: var(--wash); padding: 96px 20px 88px; position: relative; }
.cover .num { font-size: 13px; font-weight: 700; color: var(--accent); letter-spacing: .12em; text-transform: uppercase; margin-bottom: 14px; }
.cover h2 { font-size: clamp(36px, 5.4vw, 64px); max-width: 16ch; }
.cover-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 56px; align-items: center; }
.v-mark { width: 64px; height: 64px; margin-bottom: 28px; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; margin-top: 52px; }
.stats.s3 { grid-template-columns: repeat(3, 1fr); }
.stats.s2 { grid-template-columns: 1fr 1fr; margin-top: 0; align-content: center; }
.stat { border-top: 1px solid var(--ink); padding-top: 14px; }
.stat .v { font-size: clamp(32px, 4.2vw, 50px); font-weight: 500; letter-spacing: -.03em; line-height: 1; }
.stat .l { font-size: 15px; color: var(--muted); margin-top: 8px; line-height: 1.35; }
.stat.illus .v::after, .illus-n::after { content: "*"; color: var(--accent); font-size: .5em; vertical-align: super; margin-left: 2px; }

/* products & chips */
.products { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.product { display: flex; gap: 20px; align-items: flex-start; text-decoration: none; padding: 28px; border-radius: var(--radius); background: var(--wash); transition: background .2s; }
.product:hover { background: #EEF0EF; }
.product img { width: 52px; height: 52px; flex: 0 0 auto; }
.product h3 { font-size: 26px; }
.product p { margin: 8px 0 14px; color: var(--ink-2); }
.pill { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; background: #fff; color: var(--muted); }
.product.v .pill { color: #2F7BF6; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { text-decoration: none; padding: 10px 16px; border: 1px solid var(--line); border-radius: 999px; font-weight: 500; font-size: 15px; }
.chip:hover { border-color: var(--ink); }

/* viz layout */
.viz-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 56px; align-items: center; margin-top: 48px; }
.viz-grid.two { grid-template-columns: 1fr 1fr; }

/* charts */
.chart { margin: 0; position: relative; }
.chart .ct { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.chart .ct b { font-size: 15px; font-weight: 700; }
.chart .ct span { font-size: 12px; color: var(--muted); white-space: nowrap; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid-l { stroke: var(--line); stroke-width: 1; }
.chart .ax { fill: var(--muted); font-size: 12px; font-family: inherit; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: var(--accent); opacity: .08; }
.chart .dot { fill: var(--accent); stroke: #fff; stroke-width: 2; }
.chart .bar { fill: var(--accent); }
.chart .bar.dim { fill: var(--grey-bar); }
.chart .lbl { fill: var(--ink); font-size: 13px; font-family: inherit; }
.chart .val { fill: var(--ink-2); font-size: 13px; font-family: inherit; font-weight: 500; }
.chart .hit { fill: transparent; cursor: default; }
.chart .hit:hover + .bar, .chart .bar:hover { opacity: .8; }
.tip { position: fixed; z-index: 90; pointer-events: none; background: var(--ink); color: #fff; font-size: 13px; padding: 6px 9px; border-radius: 8px; white-space: nowrap; opacity: 0; transition: opacity .1s; }
.tip.on { opacity: 1; }
.tip b { font-weight: 700; }

/* tiles */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 44px; }
.tile { position: relative; text-align: left; border: 0; background: var(--wash); border-radius: var(--radius); padding: 24px; text-decoration: none; display: block; width: 100%; }
.tile > b { display: block; font-size: 34px; font-weight: 500; letter-spacing: -.03em; margin-bottom: 18px; color: var(--accent); }
.tile p { margin: 6px 0 0; color: var(--muted); font-size: 15px; }
.tile.link { cursor: pointer; transition: background .2s; }
.tile.link:hover { background: #EEF0EF; }
.tile i { position: absolute; top: 20px; right: 22px; font-style: normal; color: var(--faint); font-size: 20px; }

/* read more */
.more { margin-top: 36px; background: none; border: 1px solid var(--line); border-radius: 999px; padding: 10px 18px; font-weight: 500; font-size: 15px; cursor: pointer; display: inline-flex; gap: 8px; align-items: center; }
.more::after { content: "+"; color: var(--accent); font-weight: 700; }
.more:hover { border-color: var(--ink); }
dialog#sheet { border: 0; padding: 0; border-radius: 20px; width: min(680px, calc(100vw - 32px)); max-height: min(80vh, 760px); color: var(--ink); box-shadow: 0 30px 80px rgba(14,20,17,.18); }
dialog#sheet::backdrop { background: rgba(14,20,17,.35); }
.sheet-body { padding: 36px 36px 32px; overflow-y: auto; max-height: min(80vh, 760px); }
.sheet-body h3 { font-size: 26px; margin-bottom: 8px; padding-right: 40px; }
dialog .x { position: absolute; top: 14px; right: 14px; width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--wash); font-size: 22px; line-height: 1; cursor: pointer; }
ul.points { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 14px; }
ul.points li { padding-left: 20px; position: relative; color: var(--ink-2); }
ul.points li::before { content: ""; position: absolute; left: 2px; top: 10px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
ul.points b { color: var(--ink); }

/* flow */
.flow { display: flex; gap: 0; margin-top: 44px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.flow::-webkit-scrollbar { display: none; }
.flow .node { flex: 1 1 0; min-width: 132px; border: 1px solid var(--line); border-radius: 12px; padding: 14px 14px; background: #fff; position: relative; margin-right: 26px; }
.flow .node:last-child { margin-right: 0; }
.flow .node:not(:last-child)::after { content: ""; position: absolute; right: -22px; top: 50%; width: 18px; height: 2px; background: var(--faint); }
.flow .node.own { border-color: var(--ink); }
.flow .node b { display: block; font-size: 15px; }
.flow .node span { display: block; font-size: 13px; color: var(--muted); margin-top: 3px; line-height: 1.3; }

/* gateway tiers */
.tiers { display: grid; gap: 22px; justify-items: center; margin-top: 8px; }
.tier { border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; text-align: center; min-width: 220px; position: relative; background: #fff; }
.tier b { display: block; font-size: 16px; }
.tier span { display: block; color: var(--muted); font-size: 13px; }
.tier.gw { border-color: var(--ink); }
.tier.app::after, .tier.gw::after { content: ""; position: absolute; left: 50%; bottom: -22px; width: 2px; height: 22px; background: var(--faint); }
.tier-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; width: 100%; }
.tier.t1 { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.tier.t2 { border-style: dashed; color: var(--muted); }

/* videos */
.vid { position: relative; border-radius: 14px; overflow: hidden; background: #0d0f0e; aspect-ratio: 16/9; }
.vid video { width: 100%; height: 100%; object-fit: contain; background: #0d0f0e; }
.vid.portrait { aspect-ratio: 9/16; }
.vid-pending { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 24px; gap: 8px; background: #ECEFED; color: var(--muted); font-size: 15px; }
.vid-pending b { color: var(--ink); font-size: 17px; }
.media-pair { display: grid; grid-template-columns: 3.16fr 1fr; gap: 20px; margin-top: 44px; align-items: start; }
.media-pair .portrait { width: 100%; aspect-ratio: 9/16; }
.media-pair.wide { grid-template-columns: 1fr 1fr; }
.media-pair.wide .vid { aspect-ratio: 16/9; }
.cap { display: grid; grid-template-columns: 3.16fr 1fr; gap: 20px; font-size: 13px; color: var(--muted); margin: 10px 0 0; }
.media-pair.wide + .cap { grid-template-columns: 1fr 1fr; }
.media-pair.real-first:not(.wide), .media-pair.real-first:not(.wide) + .cap { grid-template-columns: 1fr 3.16fr; }
.media-pair .portrait.tall { aspect-ratio: 9/20; }
.media-pair.real-first.tall, .media-pair.real-first.tall + .cap { grid-template-columns: 1fr 3.95fr; }

/* Vartalaap nav */
.vnav { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 48px; }
.vnav a { text-decoration: none; background: #fff; border-radius: 14px; padding: 18px 20px; border: 1px solid transparent; }
.vnav a:hover { border-color: var(--accent); }
.vnav b { display: block; font-size: 17px; }
.vnav span { color: var(--muted); font-size: 14px; }

/* misc */
.shots { display: flex; gap: 14px; margin-top: 44px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.shots img { height: 420px; width: auto; border-radius: 14px; scroll-snap-align: start; flex: 0 0 auto; background: var(--wash); }
.stickers { display: flex; gap: 18px; margin-top: 40px; flex-wrap: wrap; }
.stickers img { height: 110px; width: auto; }
.states { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 28px; }
.state { padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); font-size: 13px; font-family: ui-monospace, Menlo, monospace; }
.state.user { border-color: var(--accent); color: var(--accent); }
.states .to { color: var(--faint); }
.ladder { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin-top: 52px; }
.rung { border-top: 2px solid #18A44B; padding-top: 16px; }
.rung.v { border-color: #2F7BF6; }
.rung.r { border-color: var(--faint); }
.rung h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.rung ul { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; color: var(--ink-2); }
table.spec { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 15px; }
table.spec td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.spec td:first-child { color: var(--muted); width: 90px; }
.layers { display: grid; gap: 10px; margin-top: 18px; }
.layer { display: grid; grid-template-columns: 110px 1fr; gap: 12px; }
.layer .lname { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding-top: 8px; }
.layer .boxes { display: flex; flex-wrap: wrap; gap: 6px; }
.layer .box { border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-size: 14px; }
.layer .box.own { border-color: var(--ink); }

footer { padding: 48px 20px 72px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
footer .wrap { display: grid; gap: 6px; }
footer b { color: var(--ink); }

/* ---------- tablet ---------- */
@media (max-width: 920px) {
  .cover-grid, .viz-grid, .viz-grid.two { grid-template-columns: 1fr; gap: 36px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats.s3 { grid-template-columns: repeat(3, 1fr); }
  .products { grid-template-columns: 1fr; }
}

/* ---------- phone: compact, swipe instead of stack ---------- */
@media (max-width: 640px) {
  body { font-size: 15px; }
  .topbar-inner { padding: 8px 14px; gap: 10px; }
  .brand span { display: none; }
  .chapters a { font-size: 13px; padding: 5px 9px; }
  .panel { padding: 44px 16px; }
  .cover { padding: 44px 16px 40px; }
  .hero { padding: 44px 16px 36px; }
  .hero-logo { height: 26px; margin-bottom: 28px; }
  h1 { font-size: 36px; }
  h2 { font-size: 25px; }
  .cover h2 { font-size: 28px; }
  .lede { font-size: 15.5px; margin-top: 10px; }
  .kicker { font-size: 11px; margin-bottom: 8px; }
  .cover .num { font-size: 11px; margin-bottom: 8px; }
  .pageno { display: none; }
  .cover-grid, .viz-grid, .viz-grid.two { gap: 24px; margin-top: 24px; }
  .cover-grid { margin-top: 0; }

  .stats, .stats.s2 { grid-template-columns: 1fr 1fr; gap: 16px 14px; margin-top: 24px; }
  .stat { padding-top: 8px; }
  .stat .v { font-size: 26px; }
  .stat .l { font-size: 12.5px; margin-top: 4px; }

  .products { grid-template-columns: 1fr; gap: 10px; }
  .product { padding: 16px; gap: 14px; }
  .product img { width: 38px; height: 38px; }
  .product h3 { font-size: 20px; }
  .product p { margin: 4px 0 8px; font-size: 14px; }
  .chips { gap: 6px; }
  .chip { padding: 6px 11px; font-size: 13px; }
  .kicker[style] { margin-top: 32px !important; }

  /* horizontal rails */
  .tiles, .vnav { display: flex; overflow-x: auto; gap: 10px; margin: 24px -16px 0; padding: 0 16px 4px; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .tiles::-webkit-scrollbar, .vnav::-webkit-scrollbar { display: none; }
  .tile { flex: 0 0 70%; scroll-snap-align: start; padding: 16px; }
  .tile > b { font-size: 24px; margin-bottom: 8px; }
  .tile p { font-size: 13.5px; }
  .vnav a { flex: 0 0 auto; padding: 10px 14px; }
  .vnav b { font-size: 15px; }
  .vnav span { display: none; }
  .vnav { margin-top: 24px; }
  .v-mark { width: 44px; height: 44px; margin-bottom: 16px; }

  .flow { margin: 24px -16px 0; padding: 2px 16px; scroll-snap-type: x proximity; }
  .flow .node { min-width: 112px; padding: 10px; margin-right: 18px; }
  .flow .node:not(:last-child)::after { right: -16px; width: 14px; }
  .flow .node b { font-size: 13.5px; }
  .flow .node span { font-size: 12px; }

  .shots { margin: 24px -16px 0; padding: 0 16px 4px; gap: 10px; }
  .shots img { height: 300px; }
  .stickers { gap: 10px; margin-top: 20px; flex-wrap: nowrap; }
  .stickers img { height: 64px; }

  .media-pair, .media-pair.wide { display: flex; overflow-x: auto; gap: 10px; margin: 24px -16px 0; padding: 0 16px; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .media-pair::-webkit-scrollbar { display: none; }
  .media-pair > .vid { flex: 0 0 88%; scroll-snap-align: start; }
  .media-pair > .vid.portrait { flex: 0 0 auto; height: calc((100vw - 32px) * .88 * .5625); width: auto; }
  .cap, .media-pair.wide + .cap { display: block; }
  .cap span + span::before { content: " · swipe → "; }

  .chart .ct b { font-size: 14px; }
  .viz-grid.two { display: flex; overflow-x: auto; gap: 24px; margin: 24px -16px 0; padding: 0 16px; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .viz-grid.two::-webkit-scrollbar { display: none; }
  .viz-grid.two > .chart { flex: 0 0 86%; scroll-snap-align: start; }
  .more { margin-top: 22px; padding: 8px 14px; font-size: 14px; }
  .states { margin-top: 18px; }
  .state { font-size: 11.5px; padding: 5px 9px; }
  .tiers { gap: 18px; }
  .tier { min-width: 0; width: 100%; padding: 10px 12px; }
  .tier b { font-size: 14px; }
  .tier span { font-size: 12px; }
  .tier.app::after, .tier.gw::after { bottom: -18px; height: 18px; }

  .ladder { display: flex; overflow-x: auto; gap: 16px; margin: 28px -16px 0; padding: 0 16px; scrollbar-width: none; }
  .rung { flex: 0 0 64%; }
  .rung ul { font-size: 14px; gap: 5px; }

  dialog#sheet { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 20px 20px 0 0; max-height: 82vh; }
  .sheet-body { padding: 28px 20px 32px; max-height: 82vh; }
  .sheet-body h3 { font-size: 21px; }
  ul.points { gap: 10px; }
  ul.points li { font-size: 14.5px; }
  .layer { grid-template-columns: 1fr; gap: 4px; }
  .layer .lname { padding-top: 0; }
  footer { padding: 32px 16px 48px; }
}
