/*
 * project-b marketing site.
 *
 * Static site (no build): this file mirrors the app's design tokens from
 * `web/src/index.css` / `docs/ui-identity.md` — monochrome zinc with an
 * inverted primary. Keep the two token blocks (light `:root`, dark
 * `prefers-color-scheme`) in sync with the app; the app follows the OS, and
 * so does this site. Never hand-write a palette value in the rules below —
 * only these tokens.
 */

:root {
  --background: #fafafa;
  --foreground: #18181b;
  --card: #ffffff;
  --card-foreground: #18181b;
  --primary: #18181b;
  --primary-foreground: #fafafa;
  --secondary: #e4e4e7;
  --secondary-foreground: #18181b;
  --muted: #f4f4f5;
  --muted-foreground: #71717a;
  --accent: #f4f4f5;
  --accent-foreground: #18181b;
  --destructive: #dc2626; /* money only: expense */
  --success: #16a34a; /* money only: income */
  --border: #e4e4e7;
  --ring: #18181b;
  --radius: 0.5rem;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.05), 0 8px 24px -12px rgb(0 0 0 / 0.18);
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #09090b;
    --foreground: #f4f4f5;
    --card: #18181b;
    --card-foreground: #f4f4f5;
    --primary: #f4f4f5;
    --primary-foreground: #18181b;
    --secondary: #27272a;
    --secondary-foreground: #f4f4f5;
    --muted: #27272a;
    --muted-foreground: #a1a1aa;
    --accent: #27272a;
    --accent-foreground: #f4f4f5;
    --destructive: #f87171;
    --success: #4ade80;
    --border: #27272a;
    --ring: #f4f4f5;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.5), 0 12px 32px -16px rgb(0 0 0 / 0.7);
  }
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--background);
  color: var(--foreground);
  font-family: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
  line-height: 1.6;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg {
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3 {
  line-height: 1.15;
  letter-spacing: -0.02em;
}

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

.container {
  width: 100%;
  max-width: 68rem;
  margin-inline: auto;
  padding-inline: 1.25rem;
}

@media (min-width: 640px) {
  .container {
    padding-inline: 2rem;
  }
}

/* --- Buttons ------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.625rem 1.25rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: opacity 150ms ease, background-color 150ms ease,
    border-color 150ms ease;
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
}

.btn-primary:hover {
  opacity: 0.9;
}

.btn-secondary {
  background: var(--secondary);
  color: var(--secondary-foreground);
}

.btn-secondary:hover {
  background: var(--accent);
}

.btn-ghost {
  border-color: var(--border);
  color: var(--foreground);
}

.btn-ghost:hover {
  background: var(--accent);
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--background) 85%, transparent);
  backdrop-filter: blur(12px);
}

.site-header .container {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 4.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 1.0625rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.brand svg {
  width: 1.875rem;
  height: 1.875rem;
}

.brand-mark {
  fill: var(--primary);
}

.brand-mark-glyph {
  stroke: var(--primary-foreground);
}

.site-nav {
  display: flex;
  gap: 0.25rem;
  margin-inline: auto;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding-inline: 0.875rem;
  border-radius: var(--radius);
  color: var(--muted-foreground);
  font-size: 0.9375rem;
  font-weight: 500;
}

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

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.site-nav + .header-actions {
  margin-left: 0;
}

.header-actions .btn {
  min-height: 2.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.9375rem;
}

.header-actions .btn-ghost {
  display: none;
}

@media (min-width: 640px) {
  .header-actions .btn-ghost {
    display: inline-flex;
  }
}

@media (max-width: 767px) {
  .site-nav {
    display: none;
  }
}

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

.hero {
  padding-block: 3.5rem 4rem;
}

@media (min-width: 960px) {
  .hero {
    padding-block: 5.5rem 6rem;
  }
}

.hero .container {
  display: grid;
  gap: 3rem;
}

@media (min-width: 960px) {
  .hero .container {
    grid-template-columns: 1.05fr 0.95fr;
    align-items: center;
    gap: 4rem;
  }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--muted-foreground);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.eyebrow-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: var(--foreground);
}

.hero h1 {
  margin-top: 1.25rem;
  font-size: clamp(2.125rem, 6vw, 3.5rem);
  font-weight: 800;
}

.hero-sub {
  margin-top: 1.25rem;
  max-width: 34rem;
  color: var(--muted-foreground);
  font-size: clamp(1.0625rem, 2.4vw, 1.25rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.hero-note {
  margin-top: 1.25rem;
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

/* Illustrative "app" card — labelled as a mock in the markup. */
.mock {
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--card);
  color: var(--card-foreground);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

.mock-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.mock-head strong {
  font-size: 1.0625rem;
  font-weight: 700;
}

.mock-head span {
  color: var(--muted-foreground);
  font-size: 0.8125rem;
  font-weight: 500;
}

.mock-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1rem;
}

.mock-total span {
  color: var(--muted-foreground);
  font-size: 0.8125rem;
  font-weight: 500;
}

.mock-total strong {
  font-size: 1.75rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.mock-rows {
  display: grid;
  gap: 0.875rem;
  margin-top: 0.25rem;
}

.mock-row {
  display: grid;
  grid-template-columns: 6.5rem 1fr auto;
  align-items: center;
  gap: 0.875rem;
  font-size: 0.875rem;
}

.mock-row-label {
  color: var(--muted-foreground);
  font-weight: 500;
}

.mock-bar {
  height: 0.5rem;
  border-radius: 999px;
  background: var(--muted);
  overflow: hidden;
}

.mock-bar > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--foreground);
}

.bar-28 {
  width: 28%;
}

.bar-60 {
  width: 60%;
}

.bar-12 {
  width: 12%;
}

.amount {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  white-space: nowrap;
}

.amount-expense {
  color: var(--destructive);
}

.amount-income {
  color: var(--success);
}

.mock-settle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
}

/* Only the label is muted — the amount keeps its money colour (a bare
   `.mock-settle span` rule would out-specify `.amount-income`). */
.mock-settle-label {
  color: var(--muted-foreground);
}

/* --- Sections ------------------------------------------------------------ */

.section {
  padding-block: 3.5rem;
  border-top: 1px solid var(--border);
}

@media (min-width: 960px) {
  .section {
    padding-block: 5rem;
  }
}

.section-head {
  max-width: 40rem;
  margin-bottom: 2.5rem;
}

.section-head h2 {
  margin-top: 0.875rem;
  font-size: clamp(1.625rem, 3.6vw, 2.25rem);
  font-weight: 800;
}

.section-head p {
  margin-top: 0.875rem;
  color: var(--muted-foreground);
  font-size: 1.0625rem;
}

.grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 640px) {
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 960px) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card {
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--card);
  color: var(--card-foreground);
  padding: 1.5rem;
}

.feature h3 {
  margin-top: 1rem;
  font-size: 1.0625rem;
  font-weight: 700;
}

.feature p {
  margin-top: 0.5rem;
  color: var(--muted-foreground);
  font-size: 0.9375rem;
}

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius);
  background: var(--muted);
  color: var(--foreground);
}

.feature-icon svg {
  width: 1.375rem;
  height: 1.375rem;
  stroke-width: 2;
}

.steps {
  list-style: none;
  display: grid;
  gap: 1rem;
  counter-reset: step;
}

@media (min-width: 960px) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
  }
}

.step {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--card);
  color: var(--card-foreground);
  padding: 1.5rem;
}

.step-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: var(--primary);
  color: var(--primary-foreground);
  font-size: 0.875rem;
  font-weight: 700;
}

.step h3 {
  margin-top: 1rem;
  font-size: 1.0625rem;
  font-weight: 700;
}

.step p {
  margin-top: 0.5rem;
  color: var(--muted-foreground);
  font-size: 0.9375rem;
}

.faq {
  display: grid;
  gap: 0.75rem;
  max-width: 44rem;
}

.faq details {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--card-foreground);
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.25rem;
  padding: 0.875rem 1.25rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  color: var(--muted-foreground);
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1;
}

.faq details[open] summary::after {
  content: "−";
}

.faq details p {
  padding: 0 1.25rem 1.25rem;
  color: var(--muted-foreground);
  font-size: 0.9375rem;
}

.cta-band {
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--card);
  color: var(--card-foreground);
  box-shadow: var(--shadow);
  padding: 2.5rem 1.5rem;
  text-align: center;
}

@media (min-width: 640px) {
  .cta-band {
    padding: 3.5rem 2.5rem;
  }
}

.cta-band h2 {
  font-size: clamp(1.625rem, 3.6vw, 2.25rem);
  font-weight: 800;
}

.cta-band p {
  margin: 0.875rem auto 0;
  max-width: 32rem;
  color: var(--muted-foreground);
  font-size: 1.0625rem;
}

.cta-band .hero-actions {
  justify-content: center;
  margin-top: 1.75rem;
}

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

.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding-block: 2.5rem;
}

.site-footer .container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.footer-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.footer-note {
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding-inline: 0.5rem;
  border-radius: var(--radius);
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

.footer-links a:hover {
  background: var(--accent);
  color: var(--foreground);
}

/* --- Legal pages --------------------------------------------------------- */

.legal {
  width: 100%;
  max-width: 44rem;
  margin-inline: auto;
  padding: 3rem 1.25rem 2rem;
}

@media (min-width: 640px) {
  .legal {
    padding-inline: 2rem;
  }
}

.legal .prose {
  text-align: left;
}

.legal h1 {
  font-size: clamp(1.75rem, 5vw, 2.25rem);
  font-weight: 800;
}

.legal h2 {
  margin-top: 2.25rem;
  font-size: 1.0625rem;
  font-weight: 700;
}

.legal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-top: 0.5rem;
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

.legal .prose > p,
.legal .prose > ul,
.legal .prose > ol {
  margin-top: 1rem;
}

.legal .prose ul,
.legal .prose ol {
  padding-left: 1.25rem;
}

.legal .prose li {
  margin-bottom: 0.5rem;
}

.legal .prose a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal .hero-actions {
  justify-content: flex-start;
  margin-top: 1.5rem;
}

.notice-banner {
  margin-bottom: 2rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--muted);
  text-align: left;
}

.notice-banner strong {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.875rem;
  font-weight: 700;
}

.notice-banner p {
  color: var(--muted-foreground);
  font-size: 0.875rem;
}
