/* Billhead — site theme.
   Tokens mirror the app's Carbonless AppTheme (Triplicate/Shared/Theme.swift)
   so the site and app read as one brand: warm paper ground, ink navy,
   goldenrod for the money moments. Headings share the lettermark's serif. */

:root {
  color-scheme: light dark;
  --paper: #f6f1e7;
  --card: #ffffff;
  --line: #e7dfce;
  --ink: #182b40;
  --muted: #5c6b7a;
  --accent: #f0b429;
  --on-accent: #182b40;
  --accent-deep: #9c6a08;
  --pink: #ef9fb4;
  --footer-bg: #182b40;
  --footer-text: #f7f2e6;
  --focus: #9c6a08;
  --shadow-slip: 0 24px 48px rgba(24, 43, 64, 0.18);
  --serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #15120d;
    --card: #201c15;
    --line: #332d23;
    --ink: #f2ede0;
    --muted: #a89f8d;
    --accent: #f0b429;
    --on-accent: #182b40;
    --accent-deep: #f2b84b;
    --footer-bg: #0e1622;
    --footer-text: #f7f2e6;
    --focus: #f2b84b;
    --shadow-slip: 0 24px 48px rgba(0, 0, 0, 0.55);
  }
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family:
    ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Helvetica, Arial, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
}

/* Ledger-paper hint: a faint ruled top edge, like the first slip in the book. */
body::before {
  content: "";
  display: block;
  height: 4px;
  background: linear-gradient(90deg, var(--accent) 0 34%, var(--pink) 34% 67%, var(--ink) 67%);
}

::selection {
  background: rgba(240, 180, 41, 0.35);
}

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

.wrap {
  width: 100%;
  max-width: 1040px;
  margin-inline: auto;
  padding-inline: 20px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--card);
  color: var(--ink);
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
  z-index: 10;
}

.skip-link:focus {
  left: 0;
}

/* ---------- Header ---------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-block: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.28rem;
  letter-spacing: -0.01em;
}

.brand img {
  width: 34px;
  height: 34px;
  border-radius: 8px;
}

.site-nav {
  display: flex;
  gap: 20px;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}

.site-nav a:hover {
  color: var(--accent-deep);
}

/* ---------- Hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 48px;
  align-items: center;
  padding-block: 56px 40px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent-deep);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero-title {
  margin: 0 0 18px;
  font-family: var(--serif);
  font-size: clamp(2.3rem, 5.4vw, 3.4rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
}

.hero-sub {
  margin: 0 0 26px;
  color: var(--muted);
  font-size: 1.12rem;
  max-width: 34em;
}

.store-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.store-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: 999px;
  padding: 12px 22px;
  font-size: 0.98rem;
  box-shadow: 0 10px 24px rgba(240, 180, 41, 0.35);
}

.store-pill strong {
  font-weight: 800;
}

/* The layered document slips. */
.slips {
  position: relative;
  min-height: 460px;
}

.slip {
  position: absolute;
  border-radius: 6px;
  box-shadow: var(--shadow-slip);
  border: 1px solid var(--line);
  background: #fff;
  overflow: hidden;
}

.slip img {
  display: block;
  width: 100%;
  height: auto;
}

.slip-back {
  width: 76%;
  right: 0;
  top: 0;
  transform: rotate(2.4deg);
}

.slip-front {
  width: 82%;
  left: 0;
  bottom: 0;
  transform: rotate(-1.6deg);
}

/* ---------- Feature cards ---------- */

.features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  padding-block: 26px 8px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px 22px 18px;
  position: relative;
  overflow: hidden;
}

/* Carbonless top edges: the triplicate sheet colors, cycling. */
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--accent);
}

.card:nth-child(3n + 2)::before {
  background: var(--pink);
}

.card:nth-child(3n)::before {
  background: var(--ink);
}

.card h2 {
  margin: 10px 0 8px;
  font-family: var(--serif);
  font-size: 1.18rem;
  letter-spacing: -0.005em;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.97rem;
}

.glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent-deep);
}

.fineprint {
  margin: 26px 0 40px;
  color: var(--muted);
  font-size: 0.88rem;
  text-align: center;
}

.fineprint a {
  color: var(--accent-deep);
}

/* ---------- Prose pages (privacy / terms / support) ---------- */

.prose {
  max-width: 720px;
  margin-inline: auto;
  padding-block: 24px 56px;
}

.prose h1 {
  font-family: var(--serif);
  font-size: 2.1rem;
  line-height: 1.15;
  margin: 18px 0 6px;
}

.prose .updated {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 26px;
}

.prose h2 {
  font-family: var(--serif);
  font-size: 1.3rem;
  margin: 30px 0 8px;
}

.prose p,
.prose li {
  color: var(--muted);
  font-size: 1.02rem;
}

.prose strong {
  color: var(--ink);
}

.prose a {
  color: var(--accent-deep);
}

.prose .lead {
  font-size: 1.12rem;
  color: var(--ink);
}

/* ---------- 404 ---------- */

.notfound {
  text-align: center;
  padding-block: 80px 100px;
}

.notfound h1 {
  font-family: var(--serif);
  font-size: 2.4rem;
  margin: 8px 0 10px;
}

.notfound p {
  color: var(--muted);
}

.contact-pill {
  display: inline-block;
  margin-top: 18px;
  background: var(--accent);
  color: var(--on-accent);
  text-decoration: none;
  font-weight: 700;
  border-radius: 999px;
  padding: 12px 24px;
}

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

.site-footer {
  margin-top: auto;
  background: var(--footer-bg);
  color: var(--footer-text);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-block: 26px;
}

.site-footer p {
  margin: 0;
  font-size: 0.92rem;
}

.site-footer a {
  color: var(--footer-text);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 0.92rem;
}

.footer-links a {
  text-decoration: none;
  opacity: 0.85;
}

.footer-links a:hover {
  opacity: 1;
  text-decoration: underline;
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    padding-block: 40px 24px;
  }

  .slips {
    min-height: 0;
    height: 430px;
    max-width: 420px;
  }

  .features {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .site-nav {
    gap: 14px;
  }

  .slips {
    height: 360px;
  }
}
