/*
 * JobInvoice site. Tokens are the app's own (src/theme/tokens.ts and
 * mockup/DESIGN.md): ink on paper, paper on desk, work blue for action,
 * pencil yellow for the marks a person makes. No web fonts are loaded --
 * the app uses the platform's faces, and a privacy-first product should not
 * send every visitor's IP address to a font CDN.
 */
:root {
  --ink: #202b44;
  --ink-muted: #5b6780;
  --ink-faint: #8a94a8;
  --work: #385de3;
  --work-pressed: #2b49b8;
  --pale-blue: #eef2fc;
  --paper: #ffffff;
  --desk: #f6f7fb;
  --pencil: #f1ce70;
  --pencil-wash: rgba(241, 206, 112, 0.42);
  --line: #e2e6f0;
  --positive: #1f8a53;
  --positive-soft: #e6f4ec;
  --warning: #9a6b00;
  --warning-soft: #fdf3dc;
  --shadow: 0 1px 2px rgba(32, 43, 68, 0.06), 0 18px 40px -18px rgba(32, 43, 68, 0.28);

  --display: "Avenir Next", Avenir, "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  --body: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --numeric: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --gutter: clamp(18px, 4vw, 40px);
  --max: 1160px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #eef2fc;
    --ink-muted: #a7b0c4;
    --ink-faint: #7c869b;
    --work: #7d97ff;
    --work-pressed: #9aafff;
    --pale-blue: #1b2440;
    --paper: #151c2e;
    --desk: #0f1421;
    --pencil: #e2bd5b;
    --pencil-wash: rgba(226, 189, 91, 0.26);
    --line: #28324b;
    --positive: #4cc486;
    --positive-soft: #152b21;
    --warning: #d8a73c;
    --warning-soft: #2c2416;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 22px 44px -20px rgba(0, 0, 0, 0.7);
    color-scheme: dark;
  }
}

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

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

body {
  margin: 0;
  background: var(--desk);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--work); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--work-pressed); }

:focus-visible { outline: 3px solid var(--work); outline-offset: 3px; border-radius: 4px; }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 50;
  background: var(--ink); color: var(--desk); padding: 10px 14px; border-radius: var(--radius-md);
}
.skip:focus { top: 12px; color: var(--desk); }

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

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--desk) 86%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand img { width: 34px; height: 34px; border-radius: 9px; }
.brand span { font-family: var(--display); font-weight: 600; font-size: 19px; letter-spacing: -0.01em; }

.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a {
  color: var(--ink-muted); text-decoration: none; font-size: 15px; font-weight: 500;
  padding: 10px 12px; border-radius: var(--radius-md);
}
.site-nav a:hover { color: var(--ink); background: var(--pale-blue); }
.site-nav a[aria-current="page"] { color: var(--ink); }
@media (max-width: 560px) {
  .site-nav .nav-optional { display: none; }
}

/* ---------- type ---------- */
h1, h2, h3 { font-family: var(--display); color: var(--ink); text-wrap: balance; margin: 0; }
h1 { font-size: clamp(40px, 6.4vw, 72px); line-height: 1.02; font-weight: 600; letter-spacing: -0.028em; }
h2 { font-size: clamp(30px, 4vw, 44px); line-height: 1.08; font-weight: 600; letter-spacing: -0.02em; }
h3 { font-size: 21px; line-height: 1.25; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; }

.kicker {
  font-family: var(--numeric); font-size: 12.5px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-faint); margin-bottom: 14px;
}
.lede { font-size: clamp(18px, 2vw, 21px); color: var(--ink-muted); max-width: 34em; }

/* a pencil mark, the way you'd underline the number that matters */
.mark {
  background-image: linear-gradient(transparent 58%, var(--pencil-wash) 58%, var(--pencil-wash) 92%, transparent 92%);
  padding-inline: 0.06em;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}

/* ---------- hero ---------- */
.hero { padding-block: clamp(40px, 7vw, 88px) clamp(56px, 8vw, 112px); }
.hero .wrap {
  display: grid; gap: clamp(40px, 6vw, 72px);
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: center;
}
@media (max-width: 900px) { .hero .wrap { grid-template-columns: 1fr; } }

.hero h1 { margin-bottom: 22px; }
.hero .lede { margin-bottom: 30px; }

.availability { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.store-chip {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--ink); color: var(--desk);
  border-radius: 12px; padding: 11px 16px; font-weight: 600; font-size: 15px; line-height: 1.2;
}
.store-chip small { display: block; font-weight: 500; font-size: 11.5px; opacity: 0.72; letter-spacing: 0.02em; }
.store-chip svg { width: 20px; height: 20px; flex: none; fill: currentColor; }
.availability .note { color: var(--ink-faint); font-size: 14px; }

.hero-facts {
  margin: 34px 0 0; padding: 0; list-style: none;
  display: flex; flex-wrap: wrap; gap: 8px 22px; color: var(--ink-muted); font-size: 15px;
}
.hero-facts li { display: inline-flex; align-items: center; gap: 8px; }
.hero-facts li::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--work); flex: none;
}

/* The signature: a rate from a spreadsheet becoming a clean line on paper. */
.stage { position: relative; padding: 28px 0 0 0; min-height: 520px; }
@media (max-width: 900px) { .stage { max-width: 560px; margin-inline: auto; width: 100%; } }

.rate-card {
  position: absolute; z-index: 3; top: 0; left: -10px;
  width: min(340px, 80%);
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 14px 16px; display: grid; grid-template-columns: auto 1fr auto; gap: 4px 12px; align-items: center;
  transform: rotate(-2.2deg);
  animation: rate-drop 1.1s cubic-bezier(.2,.8,.2,1) .35s both;
}
.rate-card .glyph {
  grid-row: span 2; width: 38px; height: 38px; border-radius: 10px; background: var(--pale-blue);
  display: grid; place-items: center; color: var(--work);
}
.rate-card .glyph svg { width: 20px; height: 20px; }
.rate-card .name { font-weight: 600; font-size: 15px; line-height: 1.3; }
.rate-card .price { font-family: var(--numeric); font-weight: 600; font-size: 15px; text-align: right; }
.rate-card .rate-source { font-size: 12.5px; color: var(--ink-muted); line-height: 1.3; }
.rate-card .unit { font-size: 12.5px; color: var(--ink-muted); text-align: right; }
.rate-card .badge {
  position: absolute; right: 12px; top: -11px;
  font-family: var(--numeric); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase;
  background: var(--pencil); color: #3a2c00; padding: 3px 8px; border-radius: 999px;
}

.paper {
  position: relative; z-index: 2;
  /* Room on the right for the phone behind it, room on top for the rate
     card, which overlaps the paper's edge but never its text. */
  margin: 84px clamp(0px, 20%, 128px) 0 clamp(12px, 5%, 36px);
  background: var(--paper); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); overflow: hidden;
}
.paper::before { content: ""; display: block; height: 5px; background: var(--work); }
.paper-body { padding: clamp(20px, 3.4vw, 32px); }
.paper .from { font-family: var(--display); font-weight: 600; font-size: 19px; }
.paper .addr { color: var(--ink-muted); font-size: 13px; }
.paper .doc-title { font-family: var(--display); font-weight: 600; font-size: clamp(24px, 2.6vw, 30px); margin-top: 14px; letter-spacing: -0.015em; }
.paper .dates { color: var(--ink-muted); font-size: 13px; }
.paper .label {
  margin-top: 16px; font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint);
}
.paper table { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 14.5px; }
.paper th {
  text-align: left; font-weight: 500; color: var(--ink-faint); font-size: 12.5px;
  padding: 0 0 8px; border-bottom: 1px solid var(--line);
}
.paper td { padding: 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.paper .num { text-align: right; font-family: var(--numeric); white-space: nowrap; padding-left: 12px; }
.paper td.num { font-size: 13.5px; }
.paper .optional { color: var(--ink-faint); }
.paper .optional small { display: block; font-size: 12px; }
.paper tr.arriving td { animation: line-in .7s ease-out 1.25s both; }
.paper tr.arriving .num.amount { position: relative; }
.paper .total { display: flex; justify-content: space-between; align-items: baseline; padding-top: 14px; }
.paper .total span:first-child { font-family: var(--display); font-size: 19px; }
.paper .total strong { font-family: var(--numeric); font-size: clamp(20px, 2.2vw, 24px); }
.paper .total strong .mark { padding-inline: 0.15em; }

.phone-peek {
  position: absolute; z-index: 1; right: 0; bottom: -44px;
  width: clamp(160px, 34%, 210px);
  border-radius: 30px; padding: 7px; background: #11151f;
  box-shadow: var(--shadow);
  transform: rotate(4deg);
}
.phone-peek img { border-radius: 24px; }
@media (max-width: 520px) {
  .phone-peek { display: none; }
  .stage { min-height: 0; }
  .rate-card { left: 0; width: 88%; }
  .paper { margin-right: 0; margin-left: 12px; }
}
.hero { overflow-x: clip; }

@keyframes rate-drop {
  from { opacity: 0.001; transform: translateY(-26px) rotate(-6deg); }
  to   { opacity: 1; transform: translateY(0) rotate(-2.2deg); }
}
@keyframes line-in {
  0%   { background: var(--pencil-wash); }
  100% { background: transparent; }
}

/* ---------- sections ---------- */
section { scroll-margin-top: 84px; }
.band { padding-block: clamp(64px, 9vw, 120px); }
.band.paper-band { background: var(--paper); border-block: 1px solid var(--line); }

.section-head { max-width: 40em; margin-bottom: clamp(36px, 5vw, 56px); }
.section-head h2 { margin-bottom: 16px; }

/* the workflow: a real sequence, so it is numbered */
.flow { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(20px, 3vw, 28px); grid-template-columns: repeat(4, minmax(0, 1fr)); counter-reset: step; }
@media (max-width: 980px) { .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .flow { grid-template-columns: 1fr; } }
.flow li { counter-increment: step; display: flex; flex-direction: column; gap: 14px; }
.flow .shot {
  border-radius: 26px; padding: 6px; background: #11151f; box-shadow: var(--shadow);
  max-width: 260px; width: 100%; margin-inline: auto;
}
.flow .shot img { border-radius: 21px; }
.flow .step-label {
  font-family: var(--numeric); font-size: 12.5px; color: var(--work); letter-spacing: 0.04em;
}
.flow .step-label::before { content: counter(step, decimal-leading-zero) " · "; color: var(--ink-faint); }
.flow p { color: var(--ink-muted); font-size: 15.5px; }

/* feature split */
.split {
  display: grid; gap: clamp(32px, 6vw, 80px); align-items: center;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
}
.split.reverse { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.split.reverse .split-copy { order: 2; }
@media (max-width: 900px) {
  .split, .split.reverse { grid-template-columns: 1fr; }
  .split.reverse .split-copy { order: 0; }
}
.split-copy h2 { margin-bottom: 18px; }
.split-copy .lede { margin-bottom: 26px; }

.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.checks li { display: grid; grid-template-columns: 22px 1fr; gap: 12px; align-items: start; }
.checks li::before {
  content: ""; width: 22px; height: 22px; margin-top: 2px; border-radius: 7px;
  background: var(--pale-blue) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23385de3' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 14px no-repeat;
}

.tablet {
  border-radius: 26px; padding: 12px; background: #11151f; box-shadow: var(--shadow);
}
.tablet img { border-radius: 15px; }

.phone-pair { display: flex; justify-content: center; gap: clamp(14px, 3vw, 28px); align-items: flex-start; }
.phone-pair .shot { border-radius: 30px; padding: 7px; background: #11151f; box-shadow: var(--shadow); width: min(250px, 46%); }
.phone-pair .shot img { border-radius: 24px; }
.phone-pair .shot:nth-child(2) { margin-top: 48px; }

/* sources: three real ways rates arrive */
.sources { display: grid; gap: 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 8px; }
@media (max-width: 720px) { .sources { grid-template-columns: 1fr; } }
.source {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 18px; display: grid; gap: 6px;
}
.source .file { font-family: var(--numeric); font-size: 13px; color: var(--ink-muted); }
.source h3 { font-size: 18px; }
.source p { font-size: 15px; color: var(--ink-muted); }

/* local-first statement */
.ledger {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden;
}
@media (max-width: 720px) { .ledger { grid-template-columns: 1fr; } }
.ledger div { padding: 22px 24px; border-bottom: 1px solid var(--line); }
.ledger div:nth-child(odd) { border-right: 1px solid var(--line); }
@media (max-width: 720px) { .ledger div:nth-child(odd) { border-right: none; } }
.ledger div:nth-last-child(-n + 2) { border-bottom: none; }
@media (max-width: 720px) { .ledger div:nth-last-child(2) { border-bottom: 1px solid var(--line); } }
.ledger dt { font-weight: 600; margin-bottom: 6px; }
.ledger dd { margin: 0; color: var(--ink-muted); font-size: 15.5px; }

.langs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.langs span {
  background: var(--paper); border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 13px; font-size: 14.5px;
}

/* closing */
.closing { text-align: center; }
.closing .wrap { display: grid; justify-items: center; gap: 22px; }
.closing h2 { max-width: 16em; }
.closing .availability { justify-content: center; }

/* ---------- prose pages (privacy, support) ---------- */
.prose-page { padding-block: clamp(40px, 6vw, 72px) clamp(64px, 8vw, 104px); }
.prose {
  max-width: 720px; margin: 0 auto;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: clamp(24px, 5vw, 56px);
}
.prose h1 { font-size: clamp(34px, 5vw, 48px); margin-bottom: 14px; }
.prose h2 { font-size: clamp(22px, 2.6vw, 26px); margin: 40px 0 12px; letter-spacing: -0.012em; }
.prose h3 { font-size: 18px; margin: 28px 0 8px; }
.prose p, .prose ul, .prose ol { margin: 0 0 14px; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: 6px; }
.prose li::marker { color: var(--ink-faint); }
.prose code {
  font-family: var(--numeric); font-size: 0.88em;
  background: var(--pale-blue); border-radius: 5px; padding: 1px 5px; overflow-wrap: anywhere;
}
.prose strong { font-weight: 650; }
.prose hr { border: none; border-top: 1px solid var(--line); margin: 32px 0; }
.prose .placeholder {
  background: var(--warning-soft); color: var(--warning); border-radius: 4px; padding: 0 4px;
  font-weight: 600;
}
.prose .meta { color: var(--ink-muted); font-size: 15px; margin-bottom: 28px; }

.faq { display: grid; gap: 10px; margin-top: 8px; }
.faq details {
  border: 1px solid var(--line); border-radius: var(--radius-md); padding: 0 18px; background: var(--desk);
}
.faq summary {
  cursor: pointer; font-weight: 600; padding: 16px 0; list-style: none;
  display: flex; justify-content: space-between; gap: 16px; align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--numeric); color: var(--ink-faint); font-size: 18px; }
.faq details[open] summary::after { content: "–"; }
.faq details > div { padding-bottom: 16px; color: var(--ink-muted); }
.faq details > div p + p { margin-top: 10px; }

.contact-card {
  display: grid; gap: 4px; margin: 18px 0 8px; padding: 18px 20px;
  background: var(--pale-blue); border-radius: var(--radius-md);
}
.contact-card a { font-weight: 600; font-size: 18px; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding-block: 34px 44px; color: var(--ink-muted); font-size: 14.5px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px 28px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.site-footer a { color: var(--ink-muted); text-decoration: none; }
.site-footer a:hover { color: var(--ink); text-decoration: underline; }

/* ---------- 404 ---------- */
.lost { min-height: 60vh; display: grid; place-items: center; text-align: center; padding-block: 64px; }
.lost .code { font-family: var(--numeric); color: var(--ink-faint); letter-spacing: 0.08em; margin-bottom: 12px; }
.lost h1 { font-size: clamp(34px, 5vw, 52px); margin-bottom: 14px; }
.lost p { color: var(--ink-muted); margin-bottom: 26px; }
.button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 46px;
  padding: 0 20px; border-radius: 12px; background: var(--work); color: #fff;
  font-weight: 600; text-decoration: none;
}
.button:hover { background: var(--work-pressed); color: #fff; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
