/*
  The policy pages, in the landing page's world (/meta-ads-intelligence):
  the dark space on top carries the name and the tabs, and the text sits on
  a sheet of paper, set for long reading. Same fonts as the site (Inter Tight
  for text, Newsreader for headings, IBM Plex Mono for small labels) and the
  same colours (app/globals.css). Static on purpose: Razorpay's KYC checks
  these addresses, so they load without JavaScript.
*/

:root {
  --void: #0e0d0c;
  --fg: #f2f0ea;
  --fg-2: #beb9b1;
  --fg-muted: #807b74;
  --glass-line: rgba(242, 240, 234, 0.12);

  --paper: #f2f0ea;
  --ink: #222121;
  --text: #46433f;
  --muted: #746f68;
  --hair: #d6d3cc;

  --accent: #ff6215;
  --accent-ink: #c03b05; /* orange that passes AA on paper */

  --sans: "Inter Tight", ui-sans-serif, system-ui, sans-serif;
  --serif: "Newsreader", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;

  --col: 760px;
  --gutter: 20px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 24px; }

body {
  margin: 0;
  background: var(--void);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: rgba(255, 98, 21, 0.3); }

:focus-visible {
  outline: 2px solid #ff9166;
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---- The dark top: bar, title, tabs ------------------------------------ */

.top {
  position: relative;
  isolation: isolate;
  padding-bottom: 36px;
}
/* A warm light behind the title, as behind the pricing row. */
.top::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(ellipse 50% 70% at 82% 0%, rgba(255, 98, 21, 0.2), transparent 70%);
}

.bar {
  max-width: 1360px;
  margin: 0 auto;
  height: 64px;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(242, 240, 234, 0.06);
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--fg);
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.logo img { display: block; width: 28px; height: auto; }
.barlink {
  color: var(--fg-2);
  text-decoration: none;
  font-size: 14px;
  white-space: nowrap;
  transition: color 0.2s;
}
.barlink:hover { color: var(--fg); }

header.masthead,
nav.sitenav {
  max-width: calc(var(--col) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

header.masthead { padding-top: 56px; }

.brand {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  line-height: 1.04;
  letter-spacing: -0.022em;
  margin: 14px 0 14px;
  color: var(--fg);
  text-wrap: balance;
}

.meta {
  max-width: 52ch;
  font-size: 17px;
  line-height: 1.6;
  color: var(--fg-2);
}

/* Tabs: one row. On a phone it scrolls sideways inside itself, never the page. */
nav.sitenav {
  display: flex;
  gap: 8px;
  margin-top: 32px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}
nav.sitenav::-webkit-scrollbar { display: none; }
nav.sitenav a {
  flex: none;
  padding: 8px 15px;
  border: 1px solid var(--glass-line);
  border-radius: 999px;
  background: rgba(242, 240, 234, 0.04);
  color: var(--fg-2);
  font-size: 14px;
  line-height: 1.3;
  white-space: nowrap;
  text-decoration: none;
  transition: color 0.2s, border-color 0.2s, background-color 0.2s;
}
nav.sitenav a:hover { color: var(--fg); border-color: rgba(242, 240, 234, 0.3); }
nav.sitenav a.on {
  background: var(--paper);
  border-color: var(--paper);
  color: var(--ink);
  font-weight: 600;
}

/* ---- The paper sheet ---------------------------------------------------- */

main.sheet {
  margin: 0 8px;
  border-radius: 28px;
  background: var(--paper);
  color: var(--text);
  box-shadow: 0 40px 120px -40px rgba(0, 0, 0, 0.9);
}

.wrap {
  max-width: calc(var(--col) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 44px var(--gutter) 72px;
}

section.policy h2 { display: none; } /* the page title already says it */

.updated {
  display: inline-flex;
  align-items: flex-start;
  gap: 10px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: var(--muted);
  margin-bottom: 28px;
}
.updated::before {
  content: "";
  flex: none;
  margin-top: 0.5em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.4rem, 3.4vw, 1.65rem);
  line-height: 1.2;
  letter-spacing: -0.012em;
  color: var(--ink);
  margin: 2.2em 0 0.6em;
  text-wrap: balance;
}
.updated + h3 { margin-top: 0.4em; }
.box + h3 { margin-top: 1.6em; }

p { margin: 0 0 1em; }
strong { font-weight: 600; color: var(--ink); }
em { font-style: italic; }
code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: rgba(34, 33, 33, 0.06);
  border-radius: 5px;
  padding: 0.1em 0.35em;
  overflow-wrap: anywhere;
}

ul { list-style: none; margin: 0 0 1.2em; padding: 0; }
li { position: relative; padding-left: 22px; margin-bottom: 0.6em; }
li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.74em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

a { color: var(--accent-ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; overflow-wrap: anywhere; }
a:hover { text-decoration-thickness: 2px; }

/* A note that matters more than the text around it. */
.box {
  margin: 0 0 1.6em;
  padding: 18px 22px;
  border: 1px solid rgba(255, 98, 21, 0.28);
  border-radius: 18px;
  background: rgba(255, 98, 21, 0.06);
  color: var(--ink);
}
.box p:last-child { margin-bottom: 0; }

table.data {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2em 0 1.6em;
  font-size: 15.5px;
  line-height: 1.55;
  border-top: 1px solid var(--ink);
}
table.data th {
  text-align: left;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 12px 16px 10px 0;
  border-bottom: 1px solid var(--hair);
}
table.data td {
  padding: 12px 16px 12px 0;
  border-bottom: 1px solid var(--hair);
  vertical-align: top;
}
table.data td:first-child { width: 34%; }
table.data td:last-child, table.data th:last-child { padding-right: 0; }

/* ---- All policies (the index) ------------------------------------------- */

.label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 12px;
}

.home-list { margin: 0 0 56px; padding: 0; list-style: none; border-top: 1px solid var(--ink); }
.home-list li { padding: 0; margin: 0; border-bottom: 1px solid var(--hair); }
.home-list li::before { display: none; }
.home-list a {
  display: grid;
  grid-template-columns: 2.6rem 1fr auto;
  align-items: baseline;
  column-gap: 8px;
  padding: 20px 4px;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--serif);
  font-size: clamp(1.35rem, 3.6vw, 1.65rem);
  line-height: 1.2;
  letter-spacing: -0.012em;
  transition: background-color 0.2s;
}
.home-list a::after {
  content: "\2192";
  grid-column: 3;
  grid-row: 1;
  font-family: var(--sans);
  font-size: 18px;
  color: var(--muted);
  transition: transform 0.2s, color 0.2s;
}
.home-list a:hover { background: rgba(255, 255, 255, 0.45); }
.home-list a:hover::after { color: var(--accent-ink); transform: translateX(4px); }
.home-list .n {
  grid-column: 1;
  grid-row: 1 / span 2;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--accent-ink);
}
.home-list .d {
  grid-column: 2 / span 2;
  margin-top: 6px;
  font-family: var(--sans);
  font-size: 15.5px;
  line-height: 1.5;
  letter-spacing: 0;
  color: var(--text);
}

.entity {
  padding: 22px 24px;
  border: 1px solid #fff;
  border-radius: 22px;
  background: rgba(255, 254, 251, 0.6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), 0 24px 60px -34px rgba(70, 35, 10, 0.35);
  font-size: 15px;
  line-height: 1.55;
}
.entity table { width: 100%; border-collapse: collapse; }
.entity td { padding: 7px 0; vertical-align: top; border-bottom: 1px solid var(--hair); }
.entity tr:last-child td { border-bottom: 0; }
.entity td:first-child { color: var(--muted); width: 210px; padding-right: 16px; }
.entity td:last-child { color: var(--ink); }

/* ---- Footer ------------------------------------------------------------- */

footer {
  max-width: 1360px;
  margin: 0 auto;
  padding: 36px var(--gutter) 44px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--fg-muted);
}
footer > div { max-width: 80ch; margin-bottom: 10px !important; }
footer a { color: var(--fg-2); text-decoration-color: rgba(242, 240, 234, 0.3); }
footer a:hover { color: var(--fg); }

/* ---- Wider screens ------------------------------------------------------ */

@media (min-width: 640px) {
  :root { --gutter: 32px; }
  main.sheet { margin: 0 16px; border-radius: 40px; }
  .wrap { padding-top: 56px; padding-bottom: 96px; }
  header.masthead { padding-top: 72px; }
  .top { padding-bottom: 44px; }
  nav.sitenav { flex-wrap: wrap; overflow: visible; }
}

@media (max-width: 520px) {
  body { font-size: 16.5px; }
  table.data { font-size: 15px; }
  table.data td:first-child { width: 38%; }
  .entity { padding: 16px 18px; }
  .entity td { display: block; width: auto !important; padding: 0; border: 0; }
  .entity td:first-child { padding-top: 10px; font-size: 13px; }
  .entity td:last-child { padding-bottom: 10px; border-bottom: 1px solid var(--hair); }
  .entity tr:last-child td:last-child { border-bottom: 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---- Print: plain black on white, no chrome ----------------------------- */

@media print {
  @page { size: A4; margin: 16mm 14mm; }
  body { background: #fff; color: #000; font-size: 10.5pt; line-height: 1.5; }
  .top::before, .bar, nav.sitenav { display: none; }
  .top { padding: 0; }
  header.masthead { padding: 0 0 12pt; max-width: none; }
  h1, .meta, .brand, footer { color: #000; }
  main.sheet { margin: 0; border-radius: 0; box-shadow: none; background: #fff; color: #000; }
  .wrap { padding: 0; max-width: none; }
  section.policy h2 { display: block; font-family: var(--serif); }
  h2, h3 { page-break-after: avoid; }
  table.data, .box, .entity { page-break-inside: avoid; }
  a { color: #000; }
}
