/*
 * Marketing pages (layouts/site.php). Same palette and system font as the app (app.css),
 * plus a dark theme. Shapes: buttons are pills, cards and frames 22px, phones 40px.
 */

:root {
  --bg: #f2f2f7;
  --bg-2: #e9ebf3;
  --card: #ffffff;
  --ink: #111114;
  --ink-2: #3c3c43;
  --muted: #62626a;
  --line: rgba(17, 17, 20, 0.08);
  --accent: #2563eb;
  --accent-ink: #ffffff;
  --accent-soft: #e8f0fe;
  --bezel: #1c1c21;
  --shadow: 0 1px 2px rgba(30, 41, 79, 0.06), 0 24px 48px -24px rgba(30, 41, 79, 0.28);
  --shadow-lg: 0 2px 4px rgba(30, 41, 79, 0.06), 0 40px 80px -32px rgba(30, 41, 79, 0.4);
  --radius: 22px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0c10;
    --bg-2: #12131a;
    --card: #17171d;
    --ink: #f3f3f6;
    --ink-2: #d1d1d8;
    --muted: #a0a0aa;
    --line: rgba(255, 255, 255, 0.09);
    --accent: #3b82f6;
    --accent-soft: rgba(59, 130, 246, 0.14);
    --bezel: #2a2a31;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 24px 48px -24px rgba(0, 0, 0, 0.7);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.4), 0 40px 80px -32px rgba(0, 0, 0, 0.8);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  background-image: radial-gradient(70% 40rem at 80% -12rem, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%);
  background-repeat: no-repeat;
  overflow-x: clip;
}
a { color: var(--accent); text-decoration: none; }
h1, h2, h3 { margin: 0; text-wrap: balance; font-family: var(--font-display); }
p { margin: 0; text-wrap: pretty; }
img { display: block; max-width: 100%; height: auto; }
figure { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
::selection { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.muted { color: var(--muted); }
.icon { width: 24px; height: 24px; flex-shrink: 0; }
.icon-sm { width: 18px; height: 18px; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 30; background: var(--card); color: var(--ink); padding: 8px 12px; border-radius: 8px; }
.skip-link:focus { left: 8px; }

.wrap { width: 100%; max-width: 1200px; margin-inline: auto; padding: 0 16px; }
@media (min-width: 48rem) { .wrap { padding: 0 32px; } }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 999px;
  font-weight: 600; font-size: 16px; white-space: nowrap;
  transition: transform 0.2s var(--ease), background-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.btn:active { transform: translateY(1px) scale(0.98); }
.btn-sm { min-height: 38px; padding: 0 16px; font-size: 15px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 20px -10px color-mix(in srgb, var(--accent) 80%, transparent); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn-ghost { color: var(--ink); background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.btn-ghost:hover { background: color-mix(in srgb, var(--card) 92%, var(--ink)); }
.btn-light { background: #ffffff; color: #1d4ed8; }
.btn-light:hover { background: #eef3ff; }

/* Navigation (z-index scale: nav 20, skip link 30) */
.site-nav {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(180%) blur(18px); -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease);
}
.site-nav.is-scrolled { border-bottom-color: var(--line); }
.nav-inner { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; font-size: 19px; letter-spacing: -0.01em; }
.brand img { border-radius: 7px; }
.nav-links { display: none; gap: 28px; margin-left: 16px; }
.nav-links a, .nav-signin { color: var(--ink-2); font-size: 15px; font-weight: 500; }
.nav-links a:hover, .nav-signin:hover { color: var(--ink); }
.nav-actions { display: flex; align-items: center; gap: 18px; margin-left: auto; }
@media (min-width: 56rem) { .nav-links { display: flex; } }
@media (max-width: 24rem) { .nav-signin { display: none; } }

/* Hero */
.hero {
  display: grid; gap: 40px; align-items: center;
  padding-top: 40px; padding-bottom: 48px;
}
.hero h1 {
  font-size: clamp(44px, 9vw, 76px); line-height: 1.02; letter-spacing: -0.035em; font-weight: 800;
}
.lede { margin-top: 20px; font-size: clamp(18px, 2.2vw, 21px); color: var(--ink-2); max-width: 30ch; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero-visual { position: relative; height: 520px; }
.phone {
  position: absolute; width: 240px; aspect-ratio: 390 / 844;
  padding: 8px; border-radius: 40px; background: var(--bezel);
  box-shadow: var(--shadow-lg), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.phone img { width: 100%; height: 100%; object-fit: cover; object-position: top; border-radius: 32px; }
.phone-front { left: 50%; top: 0; transform: translateX(-78%); z-index: 2; }
.phone-back { left: 50%; top: 48px; transform: translateX(-4%) rotate(4deg); opacity: 0.96; }
@media (min-width: 64rem) {
  .hero { grid-template-columns: 1.05fr 1fr; gap: 24px; padding-top: 72px; padding-bottom: 72px; min-height: calc(100dvh - 64px); max-height: 900px; }
  .hero-visual { height: 640px; }
  .phone { width: 280px; }
  .phone-front { transform: translateX(-70%); }
  .phone-back { top: 72px; transform: translateX(2%) rotate(4deg); }
}

/* Section headings */
.section-h { font-size: clamp(32px, 5vw, 48px); line-height: 1.08; letter-spacing: -0.028em; font-weight: 750; max-width: 18ch; }
.body { margin-top: 16px; color: var(--ink-2); font-size: 18px; max-width: 46ch; }
section + section { margin-top: 96px; }
@media (min-width: 64rem) { section + section { margin-top: 140px; } }

/* Flow: connected steps, vertical on phones */
.flow-steps { list-style: none; margin: 40px 0 0; padding: 0; display: grid; gap: 28px; position: relative; }
.flow-steps::before {
  content: ""; position: absolute; left: 23px; top: 24px; bottom: 24px; width: 2px;
  background: linear-gradient(var(--accent), color-mix(in srgb, var(--accent) 15%, transparent));
}
.flow-step { position: relative; padding-left: 68px; }
.flow-icon {
  position: absolute; left: 0; top: 0; width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center; background: var(--card); color: var(--accent);
  box-shadow: var(--shadow), 0 0 0 6px var(--bg);
}
.flow-step h3 { font-size: 20px; letter-spacing: -0.01em; padding-top: 10px; }
.flow-step p { margin-top: 6px; color: var(--muted); max-width: 30ch; }
@media (min-width: 56rem) {
  .flow-steps { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; margin-top: 56px; }
  .flow-steps::before { left: 24px; right: 12%; top: 23px; bottom: auto; width: auto; height: 2px; background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 15%, transparent)); }
  .flow-step { padding-left: 0; padding-top: 72px; }
  .flow-step h3 { padding-top: 0; }
}

/* Client view: browser frame + copy */
.clients { display: grid; gap: 40px; align-items: center; }
.browser {
  border-radius: var(--radius); overflow: hidden; background: var(--card);
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--line);
}
.browser img { width: 100%; }
.ticks { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 12px; }
.ticks li { display: flex; align-items: center; gap: 12px; font-weight: 500; }
.ticks .icon { color: var(--accent); }
@media (min-width: 64rem) {
  .clients { grid-template-columns: 1.35fr 1fr; gap: 64px; }
  .clients .browser { margin-left: -64px; }
}

/* Feature bento: 5 tiles */
.bento { display: grid; gap: 16px; margin-top: 40px; }
.tile {
  border-radius: var(--radius); background: var(--card); padding: 28px;
  box-shadow: var(--shadow), 0 0 0 1px var(--line); overflow: hidden;
}
.tile h3 { font-size: 21px; letter-spacing: -0.015em; margin-top: 16px; }
.tile p { margin-top: 8px; color: var(--muted); max-width: 36ch; }
.tile-icon { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.tile-accent { background: var(--accent); color: #fff; box-shadow: var(--shadow); }
.tile-accent p { color: rgba(255, 255, 255, 0.86); }
.tile-accent .tile-icon { background: rgba(255, 255, 255, 0.18); color: #fff; }
.tile-reports { padding-bottom: 0; display: flex; flex-direction: column; }
.tile-reports img { margin: 28px -28px 0 0; border-top-left-radius: 14px; box-shadow: 0 0 0 1px var(--line); align-self: flex-end; width: calc(100% + 0px); }
.tile-brand { background: linear-gradient(135deg, var(--card) 40%, var(--accent-soft)); }
.swatches { list-style: none; padding: 0; margin: 24px 0 0; display: flex; flex-wrap: wrap; gap: 10px; }
.swatches li { width: 30px; height: 30px; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.35), 0 0 0 1px var(--line); }
@media (min-width: 48rem) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile-reports, .tile-brand { grid-column: span 2; }
}
@media (min-width: 64rem) {
  .bento { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: minmax(220px, auto); }
  .tile-reports { grid-column: 1 / span 2; grid-row: 1 / span 2; }
  .tile-recurring { grid-column: 3; grid-row: 1; }
  .tile-reminders { grid-column: 3; grid-row: 2; }
  .tile-expenses { grid-column: 1; grid-row: 3; }
  .tile-brand { grid-column: 2 / span 2; grid-row: 3; display: flex; align-items: center; justify-content: space-between; gap: 32px; }
  .tile-brand .swatches { margin: 0; max-width: 220px; justify-content: flex-end; }
}

/* Desktop + phone */
.anywhere-copy { max-width: 640px; }
.anywhere-visual { position: relative; margin-top: 40px; padding-bottom: 120px; }
.anywhere-visual .browser { width: 92%; }
.phone-float { right: 0; bottom: 0; width: 120px; padding: 5px; border-radius: 24px; }
.phone-float img { border-radius: 19px; }
@media (min-width: 48rem) {
  .phone-float { width: 210px; padding: 8px; border-radius: 38px; }
  .phone-float img { border-radius: 30px; }
  .anywhere-visual { padding-bottom: 64px; }
  .anywhere-visual .browser { width: 86%; }
}
@media (min-width: 64rem) {
  .anywhere-copy { margin-left: auto; text-align: right; }
  .anywhere-copy .section-h, .anywhere-copy .body { margin-left: auto; }
}

/* Closing call to action */
.closer {
  display: grid; gap: 28px; justify-items: start;
  padding: 48px 28px; border-radius: 28px; color: #fff;
  background: radial-gradient(120% 140% at 100% 0%, #3b82f6 0%, #2563eb 45%, #1d4ed8 100%);
  box-shadow: var(--shadow-lg);
}
.closer h2 { font-size: clamp(30px, 4.6vw, 46px); line-height: 1.08; letter-spacing: -0.028em; font-weight: 750; max-width: 16ch; }
@media (min-width: 56rem) {
  .closer { grid-template-columns: 1fr auto; align-items: center; padding: 64px; }
}

/* Footer */
.site-footer { margin-top: 96px; padding: 32px 0 48px; border-top: 1px solid var(--line); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; }
.footer-inner p { font-size: 15px; }
.footer-links { display: flex; gap: 24px; margin-left: auto; font-size: 15px; }
.footer-links a { color: var(--ink-2); }
.footer-links a:hover { color: var(--ink); }

/* Entry motion: hero on load, sections as they scroll in. Only with JS (site.js adds .js) and no reduced-motion. */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); transition-delay: calc(var(--i, 0) * 90ms); }
  .js .reveal.is-in { opacity: 1; transform: none; }
  .js .hero .reveal:nth-child(2) { --i: 1; }
  .js .hero .reveal:nth-child(3) { --i: 2; }
  .js .hero-visual .phone { animation: phone-in 1.1s var(--ease) both; }
  .js .hero-visual .phone-back { animation-delay: 0.18s; }
  .phone-float { transition: transform 0.6s var(--ease); }
  .anywhere-visual:hover .phone-float { transform: translateY(-8px); }
}
@keyframes phone-in { from { opacity: 0; translate: 0 40px; } to { opacity: 1; translate: 0 0; } }
