/* Bills Tracker — billstrack.com
   Palette extracted from the Xcode app (AccentColor picker defaults,
   Color(hex:) tokens in Dashboard/MonthlyBills/Settings, splash in Bills_TrackerApp).

   Brand / accent (Settings accentColors, default accentColorHex):
     --accent          #3b82f6  Blue (default)
     --accent-indigo   #6366f1  Indigo
     --accent-purple   #8b5cf6  Purple
     --accent-teal     #14b8a6  Teal
     --success         #10b981  Green / income / paid
     --success-deep    #059669  Emerald deep (net positive)
     --accent-orange   #f97316  Orange / tomorrow
     --warning         #f59e0b  Amber / today / budget caution
     --danger          #ef4444  Red / overdue / expense

   Surfaces & type (splash + Dashboard neutrals):
     --bg              #f1f5f9  Splash / light page
     --surface         #ffffff  Card (secondarySystemGroupedBackground ≈ white)
     --ink             #0f172a  Splash primary text
     --muted           #94a3b8  Later / secondary slate
     --line            #e5e7eb  Progress tracks / hairlines
*/

:root {
  --accent: #3b82f6;
  --accent-indigo: #6366f1;
  --accent-purple: #8b5cf6;
  --accent-teal: #14b8a6;
  --success: #10b981;
  --success-deep: #059669;
  --accent-orange: #f97316;
  --warning: #f59e0b;
  --danger: #ef4444;

  --bg: #f1f5f9;
  --bg-deep: #0f172a;
  --surface: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --muted-soft: #94a3b8;
  --line: #e5e7eb;
  --panel: rgba(255, 255, 255, 0.72);

  --radius: 22px;
  --font-display: "Syne", system-ui, sans-serif;
  --font-body: "Plus Jakarta Sans", system-ui, sans-serif;
  --shadow: 0 28px 60px rgba(15, 23, 42, 0.12);
  --max: 1120px;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font-body);
  font-weight: 450;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }

.skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 0.6rem 1rem;
  z-index: 100;
}
.skip:focus { left: 1rem; top: 1rem; }

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(1100px 640px at 8% -8%, rgba(59, 130, 246, 0.18), transparent 55%),
    radial-gradient(900px 560px at 96% 4%, rgba(99, 102, 241, 0.12), transparent 50%),
    radial-gradient(700px 480px at 72% 92%, rgba(16, 185, 129, 0.1), transparent 55%),
    linear-gradient(180deg, #f8fafc 0%, var(--bg) 42%, #eef2f7 100%);
}

.atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.22;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.45'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(52px);
  opacity: 0.55;
  animation: drift 18s ease-in-out infinite alternate;
}
.orb-a {
  width: 420px; height: 420px;
  background: rgba(59, 130, 246, 0.28);
  top: -90px; left: -70px;
}
.orb-b {
  width: 340px; height: 340px;
  background: rgba(16, 185, 129, 0.16);
  top: 18%; right: -70px;
  animation-delay: -6s;
  animation-duration: 22s;
}

@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(36px, 28px, 0) scale(1.06); }
}

.wrap {
  width: min(var(--max), calc(100% - 2.5rem));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(16px) saturate(1.2);
  background: rgba(241, 245, 249, 0.82);
  border-bottom: 1px solid rgba(229, 231, 235, 0.9);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.brand-mark {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.48rem;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.08), 0 8px 18px rgba(59, 130, 246, 0.22);
  flex-shrink: 0;
}
.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  font-size: 0.92rem;
  color: var(--muted);
}

.nav a:hover { color: var(--ink); }
.nav-cta { margin-left: 0.35rem; }

.menu-toggle {
  display: none;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 999px;
  padding: 0.85rem 1.35rem;
  font-weight: 600;
  border: 1px solid transparent;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-indigo));
  color: #fff;
  box-shadow: 0 12px 28px rgba(59, 130, 246, 0.32);
}
.btn-primary:hover { box-shadow: 0 16px 36px rgba(59, 130, 246, 0.4); }

.btn-ghost {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.65);
  color: var(--ink);
}
.btn-ghost:hover { border-color: #cbd5e1; background: var(--surface); }

/* Official App Store badge — do not restyle Apple artwork */
.store-badge {
  display: inline-block;
  line-height: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.store-badge:hover { transform: translateY(-1px); opacity: 0.95; }
.store-badge img {
  height: 48px;
  width: auto;
}

/* Hero */
.hero {
  position: relative;
  min-height: min(100svh, 920px);
  display: grid;
  align-items: center;
  padding: 3.5rem 0 4rem;
  overflow: clip;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 2.5rem;
  align-items: center;
}

.hero-copy { position: relative; z-index: 2; }

.hero-brand {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5.5vw, 4.4rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 0.95;
  background: linear-gradient(120deg, var(--ink) 12%, var(--accent) 58%, var(--accent-indigo) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero h1 {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 3.2vw, 2.35rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  max-width: 14ch;
  color: var(--ink);
}

.hero-lead {
  margin: 0 0 1.75rem;
  color: var(--muted);
  font-size: 1.08rem;
  max-width: 36ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-items: center;
}

.hero-meta {
  margin-top: 1.35rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  color: var(--muted);
  font-size: 0.88rem;
}
.hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.55);
}

/* Custom splash + device stage */
.device-stage {
  position: relative;
  perspective: 1400px;
  min-height: 560px;
  display: grid;
  place-items: center;
  padding-top: 2.75rem;
}

.splash-icon {
  position: absolute;
  z-index: 6;
  width: clamp(72px, 12vw, 104px);
  height: clamp(72px, 12vw, 104px);
  border-radius: 24%;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.08),
    0 24px 48px rgba(15, 23, 42, 0.18),
    0 0 36px rgba(59, 130, 246, 0.35);
  animation: splash-float 5.5s ease-in-out infinite;
  top: 3.2rem;
  left: 8%;
}
.splash-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@keyframes splash-float {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-10px) rotate(-2deg); }
}

.device-tabs {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.3rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.device-tabs button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.82rem;
}

.device-tabs button[aria-selected="true"] {
  background: rgba(59, 130, 246, 0.14);
  color: var(--accent);
}

.device-frame {
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.35s ease;
  will-change: transform;
}

.phone-shell,
.pad-shell,
.mac-shell {
  position: relative;
  border-radius: 28px;
  background: var(--bg-deep);
  border: 1px solid rgba(15, 23, 42, 0.2);
  box-shadow: var(--shadow), 0 0 0 1px rgba(255, 255, 255, 0.35) inset;
  overflow: hidden;
}

.phone-shell {
  width: min(280px, 72vw);
  aspect-ratio: 9 / 19.5;
  padding: 10px;
  border-radius: 34px;
}

.pad-shell {
  width: min(420px, 86vw);
  aspect-ratio: 3 / 4;
  padding: 12px;
  border-radius: 24px;
}

.mac-shell {
  width: min(520px, 92vw);
  aspect-ratio: 16 / 10.2;
  padding: 12px 12px 28px;
  border-radius: 16px;
}

.mac-shell::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 8px;
  width: 28%;
  height: 6px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
}

.device-screen {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  border-radius: inherit;
  background: var(--bg);
}

.phone-shell .device-screen { border-radius: 24px; }
.pad-shell .device-screen { border-radius: 14px; }
.mac-shell .device-screen { border-radius: 8px; }

.glow-ring {
  position: absolute;
  inset: 12% -8% auto;
  height: 55%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.28), transparent 65%);
  filter: blur(20px);
  z-index: -1;
  animation: pulse 5.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50% { opacity: 0.9; transform: scale(1.06); }
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  animation: rise 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.reveal-delay-1 { animation-delay: 0.12s; }
.reveal-delay-2 { animation-delay: 0.24s; }
.reveal-delay-3 { animation-delay: 0.36s; }
.reveal-delay-4 { animation-delay: 0.48s; }

@keyframes rise {
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .reveal, .orb, .glow-ring, .device-frame, .splash-icon {
    animation: none !important;
    opacity: 1;
    transform: none !important;
  }
}

.section {
  padding: 5.5rem 0;
  border-top: 1px solid var(--line);
}

.section-label {
  margin: 0 0 0.65rem;
  color: var(--accent);
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.75rem;
}

.section h2 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--ink);
}

.section-lead {
  margin: 0 0 2rem;
  color: var(--muted);
  max-width: 52ch;
}

.feature-rail {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem 1rem;
}

.feature {
  padding: 1.25rem 1.15rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: transparent;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.feature:hover {
  background: var(--surface);
  border-color: var(--line);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.feature h3 {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-size: 1.08rem;
  letter-spacing: -0.02em;
  color: var(--ink);
}

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

.platforms {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.platform {
  padding: 1.5rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.platform h3 {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  color: var(--ink);
}

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

.download-band {
  margin: 0;
  padding: 4.5rem 0 5rem;
  border-top: 1px solid var(--line);
  text-align: center;
  background:
    radial-gradient(700px 280px at 50% 0%, rgba(59, 130, 246, 0.12), transparent 70%),
    linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.5));
}

.download-band h2 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  letter-spacing: -0.03em;
  color: var(--ink);
}

.download-band p {
  margin: 0 auto 1.5rem;
  color: var(--muted);
  max-width: 42ch;
}

.download-band .cta-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.page { padding: 3.5rem 0 5rem; }

.page h1 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.8rem);
  letter-spacing: -0.03em;
  color: var(--ink);
}

.page .updated {
  color: var(--muted);
  margin: 0 0 2rem;
}

.prose { max-width: 68ch; }

.prose h2 {
  margin: 2rem 0 0.65rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--ink);
}

.prose p, .prose li { color: var(--muted); }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.prose strong { color: var(--ink); }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 2rem 0 2.5rem;
  color: var(--muted-soft);
  font-size: 0.9rem;
  background: var(--surface);
}

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

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

.footer-links a:hover { color: var(--ink); }

.is-hidden { display: none !important; }

@media (max-width: 920px) {
  .hero-grid { grid-template-columns: 1fr; gap: 2.75rem; }
  .hero { min-height: auto; padding-top: 2.5rem; }
  .hero h1 { max-width: none; }
  .device-stage { min-height: 500px; margin-top: 0.5rem; }
  .splash-icon { left: 4%; top: 3.6rem; }
  .feature-rail, .platforms { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .nav { display: none; }
  .nav.is-open {
    display: flex;
    flex-direction: column;
    position: absolute;
    right: 1.25rem;
    top: 4.1rem;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 1rem;
    min-width: 12rem;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
  }
  .menu-toggle { display: inline-flex; }
}
