:root {
  --ink: #1C1611;
  --ink-muted: #5F5449;
  --ink-soft: #8B7D70;
  --bg: #FDFAF5;
  --bg-warm: #F6EDDF;
  --line: #E8DFD1;
  --green: #22C55E;
  --green-deep: #15803D;
  --green-ink: #0E5C2B;

  --max: 1120px;
  --narrow: 640px;

  --font-display: "Fraunces", ui-serif, Georgia, serif;
  --font-body: "Manrope", -apple-system, "Segoe UI", sans-serif;

  --ease: cubic-bezier(0.2, 0.65, 0.25, 1);
}

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

html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  background-image:
    radial-gradient(circle at 12% 0%, rgba(34, 197, 94, 0.07) 0%, transparent 42%),
    radial-gradient(circle at 100% 8%, rgba(245, 158, 107, 0.08) 0%, transparent 38%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-optical-sizing: auto;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.1;
  color: var(--ink);
  margin: 0;
  letter-spacing: -0.02em;
}

p { margin: 0 0 1rem; }

a {
  color: var(--green-ink);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}

a:hover, a:focus-visible { color: var(--green-deep); }

::selection { background: rgba(34, 197, 94, 0.25); color: var(--ink); }

/* ========== Top nav ========== */
.nav {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem 1.5rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.nav-brand img { border-radius: 9px; }

.nav-links { display: flex; gap: 1.5rem; }

.nav-links a {
  color: var(--ink-muted);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
}

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

/* ========== Landing wrapper ========== */
.landing {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ========== Hero ========== */
.hero {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 3rem;
  align-items: center;
  padding: clamp(3rem, 8vw, 5.5rem) 0 clamp(2.5rem, 6vw, 4rem);
}

.hero-title {
  font-size: clamp(2.75rem, 6.5vw, 5rem);
  font-weight: 500;
  line-height: 0.98;
  margin-bottom: 1.75rem;
}

.hero-title em {
  font-style: italic;
  color: var(--green-deep);
  font-weight: 500;
}

.hero-sub {
  font-size: clamp(1.125rem, 1.6vw, 1.375rem);
  line-height: 1.45;
  color: var(--ink-muted);
  max-width: 30rem;
  margin-bottom: 2.25rem;
}

.hero-art {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-art img {
  width: 100%;
  max-width: 320px;
  height: auto;
  border-radius: 27%;
  box-shadow:
    0 30px 60px -25px rgba(21, 128, 61, 0.55),
    0 10px 25px -10px rgba(28, 22, 17, 0.20);
  transform: rotate(-3deg);
  transition: transform 0.5s var(--ease);
}

.hero-art img:hover { transform: rotate(0deg); }

/* ========== Download buttons (App Store / Google Play badges) ========== */
.download-buttons {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.button {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 1.125rem;
  min-height: 56px;
  min-width: 184px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--bg);
  text-decoration: none;
  border: 1px solid rgba(253, 250, 245, 0.18);
  font-family: -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;
  line-height: 1;
  transition: transform 0.2s var(--ease), background 0.2s ease, box-shadow 0.25s ease, border-color 0.2s ease;
}

.button:hover, .button:focus-visible {
  background: #000;
  color: var(--bg);
  text-decoration: none;
  border-color: rgba(253, 250, 245, 0.32);
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -10px rgba(28, 22, 17, 0.45);
}

.button-icon {
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
}

.button-text {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  line-height: 1;
}

.button-text-top {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 400;
  opacity: 0.9;
}

.button-text-bottom {
  font-size: 1.1875rem;
  font-weight: 500;
  letter-spacing: -0.005em;
}

/* ========== Pitch ========== */
.pitch {
  max-width: var(--narrow);
  margin: 2.5rem auto 4rem;
}

.pitch-lead {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 400;
  line-height: 1.2;
  color: var(--ink);
  margin-bottom: 1.75rem;
  letter-spacing: -0.015em;
}

.pitch-lead em {
  font-style: italic;
  color: var(--green-deep);
  font-weight: 500;
}

.pitch p {
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink-muted);
}

.pitch p + p { margin-top: 1.125rem; }

/* ========== Features ========== */
.features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2.75rem 3rem;
  margin: 0 auto 5rem;
  padding: 3.5rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.feature h2 {
  font-size: 1.375rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  position: relative;
  padding-left: 1rem;
}

.feature h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.25em;
  bottom: 0.35em;
  width: 3px;
  background: var(--green);
  border-radius: 3px;
}

.feature p {
  color: var(--ink-muted);
  margin-bottom: 0;
  max-width: 34em;
  padding-left: 1rem;
}

/* ========== Founders ========== */
.founders {
  max-width: var(--narrow);
  margin: 0 auto 5rem;
  padding: 3rem 2.25rem;
  background: var(--bg-warm);
  border: 1px solid var(--line);
  border-radius: 20px;
  text-align: center;
}

.founders-eyebrow {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--green-deep);
  margin: 0 0 1.25rem;
}

.founders-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.125rem);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 0 0 1.5rem;
}

.founders-body {
  color: var(--ink-muted);
  font-size: 1.0625rem;
  line-height: 1.7;
  max-width: 34rem;
  margin: 0 auto 1.75rem;
}

.founders-count {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--ink);
  margin: 0;
}

.founders-count strong {
  font-style: italic;
  font-weight: 500;
  color: var(--green-deep);
  font-size: 1.4em;
  margin-right: 0.15em;
}

/* ========== Closer ========== */
.closer {
  text-align: center;
  padding: 2rem 0 5rem;
  max-width: var(--narrow);
  margin: 0 auto;
}

.closer-line {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.5vw, 2.625rem);
  font-weight: 400;
  line-height: 1.2;
  color: var(--ink);
  margin-bottom: 2rem;
  letter-spacing: -0.02em;
}

.closer-line strong {
  color: var(--green-deep);
  font-weight: 500;
  font-style: italic;
}

.closer .download-buttons { justify-content: center; }

/* ========== Footer ========== */
.footer-nav {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  display: flex;
  gap: 2rem;
  justify-content: center;
  font-size: 0.9375rem;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
}

.footer-nav a {
  color: var(--ink-soft);
  text-decoration: none;
}

.footer-nav a:hover, .footer-nav a:focus-visible {
  color: var(--green-deep);
}

/* ========== Legal pages (privacy/terms/support/404) ========== */
.container {
  max-width: var(--narrow);
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.site-header {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 1rem 0 0;
  margin-bottom: 1.5rem;
}

.site-header img {
  border-radius: 10px;
  flex: 0 0 auto;
}

.site-header-link {
  display: inline-flex;
  align-items: center;
  gap: 0.875rem;
  color: inherit;
  text-decoration: none;
}

.site-header-link:hover,
.site-header-link:focus-visible {
  color: var(--green-deep);
}

.site-header h1 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  margin: 0;
  letter-spacing: -0.015em;
  font-weight: 500;
}

.muted { color: var(--ink-soft); font-size: 0.9375rem; }

.inviter-avatar {
  display: block;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 1rem;
}

/* ========== Invite code block (connect.html) ========== */
.invite-code-block {
  margin: 2rem 0 1.75rem;
  padding: 1.5rem 1.5rem 1.25rem;
  background: var(--bg-warm);
  border: 1px solid var(--line);
  border-radius: 16px;
  text-align: center;
}

.invite-code-eyebrow {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--green-deep);
  margin: 0 0 0.875rem;
}

.invite-code-pill {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: border-color 0.2s ease, transform 0.2s var(--ease);
}

.invite-code-pill:hover, .invite-code-pill:focus-visible {
  border-color: var(--green-deep);
  transform: translateY(-1px);
}

.invite-code-text {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: clamp(1.75rem, 5vw, 2.25rem);
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--ink);
}

.invite-code-status {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}

/* ========== Plan invite landing (/p/<planId>) ========== */
.plan-map {
  display: block;
  width: 100%;
  max-width: 420px;
  height: auto;
  aspect-ratio: 2 / 1;
  margin: 1rem auto 1.25rem;
  border-radius: 12px;
  border: 1px solid var(--line);
}

/* ========== Platform-aware store buttons (connect.html) ========== */
/* JS hides the non-detected store button on mobile; toggle reveals it. */
.platform-hidden { display: none !important; }

/* Center the buttons row on connect.html (narrow centered container).
   Scoped to .container so the homepage hero's left-aligned buttons aren't
   affected. */
.container .download-buttons {
  justify-content: center;
}

.platform-toggle {
  display: block;
  margin: 0.875rem auto 0;
  background: transparent;
  border: 0;
  padding: 0.375rem 0.75rem;
  font: inherit;
  font-size: 0.9375rem;
  color: var(--ink-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  cursor: pointer;
}

.platform-toggle:hover,
.platform-toggle:focus-visible {
  color: var(--green-deep);
}

[hidden] { display: none !important; }

.copy-status {
  margin: 0 0 0.875rem;
  padding: 0.625rem 1rem;
  background: var(--bg-warm);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--green-ink);
  font-size: 0.9375rem;
  font-weight: 500;
  text-align: center;
}

.legal h2 {
  font-family: var(--font-display);
  font-size: 1.375rem;
  margin: 2rem 0 0.75rem;
  letter-spacing: -0.01em;
  font-weight: 500;
}

.legal ul {
  padding-left: 1.25rem;
  color: var(--ink);
}

.legal li {
  margin-bottom: 0.5rem;
  line-height: 1.55;
}

.legal .footer-nav {
  border: none;
  border-top: 1px solid var(--line);
  padding: 1.5rem 0 0;
  margin-top: 2.5rem;
  justify-content: flex-start;
}

/* ========== Responsive ========== */
@media (max-width: 820px) {
  .hero {
    grid-template-columns: 1fr;
    padding: 1.5rem 0 2.5rem;
    gap: 1.75rem;
  }

  .hero-art { order: -1; }

  .hero-art img {
    max-width: 170px;
    transform: rotate(-2deg);
  }

  .features {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 2.5rem 0;
  }

  /* Stack vertically on narrow viewports but keep buttons at their natural
     pill width — never stretch to full viewport. */
  .download-buttons {
    flex-direction: column;
    align-items: center;
  }

  .nav { padding: 1.25rem 1rem 0; }
  .landing { padding: 0 1rem; }
  .footer-nav { padding: 1.5rem 1rem 2rem; }

  .founders {
    padding: 2.25rem 1.25rem;
    margin-bottom: 3rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
  .hero-art img { transform: none; }
}
