/* BillSetu — the public site.
   The app's world, moved outdoors: paper, hairlines, a letterhead, columns that line up.
   Tokens are the app's own (src/index.css) so the site and the software are one object. */

@font-face {
  font-family: 'Source Sans 3';
  font-style: normal; font-weight: 200 900; font-display: swap;
  src: url('/fonts/source-sans-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Source Sans 3';
  font-style: normal; font-weight: 200 900; font-display: swap;
  src: url('/fonts/source-sans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Source Serif 4';
  font-style: normal; font-weight: 200 900; font-display: swap;
  src: url('/fonts/source-serif-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Source Serif 4';
  font-style: normal; font-weight: 200 900; font-display: swap;
  src: url('/fonts/source-serif-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --ink:        #181818;
  --ink-2:      #5c5c5c;
  --ink-3:      #6e6e6e;
  --rule:       #d9d9d9;
  --rule-soft:  #ebebeb;
  --paper:      #f5f5f5;
  --sheet:      #ffffff;
  --sunken:     #f2f2f2;
  --paid:       #1f6b45;

  --serif: 'Source Serif 4', ui-serif, Georgia, 'Times New Roman', serif;
  --sans:  'Source Sans 3', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;

  --gutter: clamp(1.25rem, 5vw, 4rem);
  --measure: 34rem;
  --radius: 3px;
  --logo-invert: 0;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink:       #ededed;
    --ink-2:     #b3b3b3;
    --ink-3:     #949494;
    --rule:      #3a3a3a;
    --rule-soft: #292929;
    --paper:     #141414;
    --sheet:     #1c1c1c;
    --sunken:    #1e1e1e;
    --paid:      #7fc9a3;
    --logo-invert: 1;
    color-scheme: dark;
  }
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  scrollbar-color: var(--rule) transparent;
}

/* The surfaces a browser draws for you still belong to the design. */
::selection { background: var(--ink); color: var(--paper); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 1px; }
:where(a) { color: inherit; text-underline-offset: 0.22em; text-decoration-thickness: 1px; }
:where(a):hover { text-decoration-color: var(--ink-3); }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.018em; text-wrap: balance; margin: 0; }
p { margin: 0; }
p + p { margin-top: 0.85em; }

.num { font-variant-numeric: tabular-nums lining-nums; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 10;
  background: var(--ink); color: var(--paper); padding: 0.6rem 1rem; border-radius: var(--radius);
}
.skip:focus { left: var(--gutter); top: 0.75rem; }

.wrap { max-width: 68rem; margin: 0 auto; padding-inline: var(--gutter); }

/* ── Letterhead ─────────────────────────────────────────────────────────── */

.letterhead {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}
.letterhead .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; min-height: 4.5rem; flex-wrap: wrap;
}
.mark { display: inline-flex; align-items: center; text-decoration: none; padding-block: 1rem; }
.mark img { display: block; height: 1.5rem; width: auto; filter: invert(var(--logo-invert)); }
.mark small {
  display: block; font-size: 0.75rem; color: var(--ink-3);
  letter-spacing: 0.02em; margin-top: 0.15rem;
}
.letterhead nav { display: flex; gap: clamp(0.9rem, 2.4vw, 1.75rem); align-items: center; padding-bottom: 0.25rem; }
.letterhead nav a {
  font-size: 0.9375rem; color: var(--ink-2); text-decoration: none;
  padding-block: 0.35rem; border-bottom: 1px solid transparent;
}
.letterhead nav a:hover { color: var(--ink); border-bottom-color: var(--ink); }

/* ── Sheet: the working surface every section sits on ───────────────────── */

main { display: block; }

.sheet {
  background: var(--sheet);
  border-bottom: 1px solid var(--rule);
}
.sheet.plain { background: var(--paper); }

.band h2.head {
  font-size: clamp(1.75rem, 3.6vw, 2.5rem); line-height: 1.12;
  letter-spacing: -0.024em; margin-bottom: 0.75rem;
}
.band .head-sub { color: var(--ink-2); max-width: var(--measure); margin-bottom: clamp(1.75rem, 3.5vw, 2.5rem); }

.band {
  padding-block: clamp(3rem, 8vw, 5.5rem);
}

/* A real table head: it labels the columns of the ruled rows underneath.
   Not a label above a heading — the heading carries itself. */
.thead {
  display: none;
  font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 600;
  padding-bottom: 0.5rem;
}
@media (min-width: 44rem) {
  .thead { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: 2rem; }
  .thead.three { grid-template-columns: 10rem minmax(0, 1fr) auto; }
  .thead.three span:last-child { text-align: right; }
}

/* ── Hero ───────────────────────────────────────────────────────────────── */

.hero { display: grid; gap: clamp(2rem, 5vw, 3.5rem); align-items: end; }
@media (min-width: 60rem) { .hero { grid-template-columns: minmax(0, 1fr) 15rem; } }

.hero h1 {
  font-size: clamp(2.35rem, 6.2vw, 4rem);
  line-height: 1.04;
  letter-spacing: -0.028em;
  margin-bottom: 1.15rem;
}
.hero .sub { color: var(--ink-2); font-size: clamp(1.0625rem, 1.6vw, 1.1875rem); max-width: var(--measure); }

.actions { display: flex; flex-wrap: wrap; gap: 0.75rem 1.25rem; align-items: center; margin-top: 2rem; }

.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--ink); color: var(--paper);
  font: inherit; font-weight: 600; font-size: 1rem;
  padding: 0.7rem 1.35rem; border: 1px solid var(--ink); border-radius: var(--radius);
  text-decoration: none;
  transition: background 140ms ease-out, transform 140ms ease-out;
}
.btn:hover { background: #000; }
@media (prefers-color-scheme: dark) { .btn:hover { background: #fff; } }
.btn:active { transform: translateY(1px); }

.btn-quiet {
  font-weight: 600; font-size: 1rem; color: var(--ink);
  text-decoration: none; border-bottom: 1px solid var(--rule); padding-bottom: 0.15rem;
}
.btn-quiet:hover { border-bottom-color: var(--ink); }

/* The price, set the way an amount is set on a bill: ruled above and below,
   right-aligned, tabular. */
.amount {
  border-top: 2px solid var(--ink); border-bottom: 1px solid var(--rule);
  padding: 0.85rem 0 1rem; text-align: right;
}
.amount .label { font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.amount .figure {
  font-family: var(--serif); font-size: clamp(2.5rem, 5vw, 3.25rem); font-weight: 600;
  line-height: 1.05; letter-spacing: -0.03em; display: block; margin-top: 0.35rem;
}
.amount .unit { color: var(--ink-2); font-size: 0.9375rem; }

/* ── The inverted band: one authored contrast in the whole page ─────────── */

.promise {
  background: var(--ink); color: var(--paper);
  border-bottom: 1px solid var(--ink);
}
.promise h2 {
  font-size: clamp(1.9rem, 4.6vw, 3rem); line-height: 1.1; letter-spacing: -0.024em;
  max-width: 22ch;
}
.promise p {
  margin-top: 1.15rem; max-width: var(--measure);
  color: color-mix(in oklab, currentColor 76%, transparent); font-size: 1.0625rem;
}
.promise a { color: inherit; text-decoration-color: color-mix(in oklab, currentColor 45%, transparent); }

/* ── Ruled rows: the line-item table this whole page is built from ──────── */

.rows { border-top: 1px solid var(--rule); }
.row {
  display: grid; gap: 0.25rem 2rem;
  padding: 1.05rem 0;
  border-bottom: 1px solid var(--rule-soft);
}
@media (min-width: 44rem) {
  .row { grid-template-columns: 15rem minmax(0, 1fr); align-items: baseline; }
  .row.three { grid-template-columns: 10rem minmax(0, 1fr) auto; }
}
.row dt, .row .k { font-weight: 600; font-size: 1.0625rem; }
.row dd, .row .v { margin: 0; color: var(--ink-2); max-width: 62ch; }
.row .status { color: var(--paid); font-size: 0.9375rem; font-weight: 600; white-space: nowrap; }

/* ── Google note: set in from the margin, the way a note sits under a bill ─ */

.note {
  border-left: 1px solid var(--rule);
  padding-left: clamp(1.25rem, 3vw, 2.25rem);
  max-width: 44rem;
}
.note h2 { font-size: clamp(1.6rem, 3.2vw, 2.15rem); line-height: 1.15; margin-bottom: 0.9rem; }
.note p { color: var(--ink-2); }
.note .fine { margin-top: 1.1rem; font-size: 0.9375rem; color: var(--ink-2); }
.note code, .prose code {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 0.875em;
  background: var(--sunken); border: 1px solid var(--rule-soft);
  border-radius: 2px; padding: 0.1em 0.35em;
}

/* ── Price block, set as an invoice total ──────────────────────────────── */

.bill { max-width: 38rem; }
.bill .line {
  display: flex; justify-content: space-between; gap: 1.5rem;
  padding: 0.6rem 0; border-bottom: 1px solid var(--rule-soft);
  color: var(--ink-2);
}
.bill .line span:last-child { color: var(--paid); font-weight: 600; white-space: nowrap; }
.bill .total {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1.5rem;
  border-top: 2px solid var(--ink); margin-top: 0.35rem; padding-top: 0.9rem;
}
.bill .total .what { font-weight: 600; }
.bill .total .what small { display: block; font-weight: 400; color: var(--ink-3); font-size: 0.875rem; }
.bill .total .figure { font-family: var(--serif); font-size: 2.25rem; font-weight: 600; letter-spacing: -0.03em; }

/* ── Questions ─────────────────────────────────────────────────────────── */

.faq { border-top: 1px solid var(--rule); }
details { border-bottom: 1px solid var(--rule-soft); }
details summary {
  list-style: none; cursor: pointer; padding: 1.05rem 2.5rem 1.05rem 0;
  font-weight: 600; position: relative;
}
details summary::-webkit-details-marker { display: none; }
details summary::after {
  content: ''; position: absolute; right: 0.35rem; top: 1.5rem;
  width: 9px; height: 9px; border-right: 1.5px solid var(--ink-3); border-bottom: 1.5px solid var(--ink-3);
  transform: rotate(45deg); transition: transform 180ms cubic-bezier(0.16, 1, 0.3, 1);
}
details[open] summary::after { transform: rotate(-135deg); top: 1.75rem; }
details summary:hover { color: var(--ink); }
details p { padding: 0 0 1.15rem; color: var(--ink-2); max-width: 62ch; }

/* ── Footer ────────────────────────────────────────────────────────────── */

footer { background: var(--paper); padding-block: 2.5rem 3.5rem; }
footer .cols { display: flex; flex-wrap: wrap; gap: 1rem 2.5rem; justify-content: space-between; align-items: baseline; }
footer a { color: var(--ink-2); text-decoration: none; border-bottom: 1px solid var(--rule); }
footer a:hover { color: var(--ink); border-bottom-color: var(--ink); }
footer .fine { color: var(--ink-3); font-size: 0.9375rem; margin-top: 1.75rem; }

/* ── Document pages (privacy, terms) ───────────────────────────────────── */

.doc { display: grid; gap: clamp(2rem, 5vw, 3.5rem); align-items: start; }
@media (min-width: 62rem) { .doc { grid-template-columns: 14rem minmax(0, 1fr); } }

.toc { font-size: 0.9375rem; }
@media (min-width: 62rem) { .toc { position: sticky; top: 2rem; } }
.toc ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.toc li { counter-increment: toc; border-bottom: 1px solid var(--rule-soft); }
.toc a {
  display: grid; grid-template-columns: 1.75rem 1fr; gap: 0.5rem;
  padding: 0.5rem 0; color: var(--ink-2); text-decoration: none;
}
.toc a::before { content: counter(toc, decimal-leading-zero); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.toc a:hover { color: var(--ink); }

.prose { max-width: 40rem; }
.prose h1 { font-size: clamp(2.1rem, 5vw, 3rem); line-height: 1.08; letter-spacing: -0.026em; }
.prose .updated { color: var(--ink-3); font-size: 0.9375rem; margin-top: 0.85rem; }
.prose .lede { margin-top: 1.5rem; font-size: 1.125rem; color: var(--ink-2); }
.prose section { margin-top: 2.75rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); scroll-margin-top: 1.5rem; }
.prose h2 { font-size: 1.375rem; line-height: 1.25; margin-bottom: 0.85rem; }
.prose h2 .n { color: var(--ink-3); font-family: var(--sans); font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.1em; display: block; margin-bottom: 0.4rem; }
.prose p { color: var(--ink-2); }
.prose ul { margin: 0.85rem 0 0; padding: 0; list-style: none; }
.prose li { color: var(--ink-2); padding: 0.3rem 0 0.3rem 1.25rem; position: relative; }
.prose li::before { content: ''; position: absolute; left: 0; top: 0.95em; width: 0.5rem; height: 1px; background: var(--ink-3); }
.prose a { color: var(--ink); text-decoration-color: var(--rule); overflow-wrap: anywhere; }
.prose a:hover { text-decoration-color: var(--ink); }

/* ── Motion: a page settles, the way a sheet is set down. One moment. ───── */

@keyframes settle {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: no-preference) {
  .settle > * { animation: settle 320ms cubic-bezier(0.16, 1, 0.3, 1) backwards; }
  .settle > *:nth-child(2) { animation-delay: 60ms; }
  .settle > *:nth-child(3) { animation-delay: 120ms; }
  .settle > *:nth-child(4) { animation-delay: 180ms; }
}
