/* Tend2Thrive site styles — shared by every page and blog post.
   Previously this block was copy-pasted inline into each HTML file. */

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

:root {
  --blue: #004F99;
  --blue-dark: #003D75;
  --green: #00BA00;
  --pale: #eef4fb;
  --text: #1a1a1a;
  --muted: #555;
  --border: #d3e2f0;
}

body {
  font-family: Georgia, "Times New Roman", serif;
  color: var(--text);
  line-height: 1.6;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Scrollable page area — everything except the fixed nav */
.page {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

/* ── Nav ── */
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 2rem;
  border-bottom: 1px solid var(--blue-dark);
  background: var(--blue);
  position: sticky;
  top: 0;
  z-index: 10;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 1.35rem;
  font-weight: bold;
  color: #fff;
  text-decoration: none;
  letter-spacing: -0.5px;
}

.logo img {
  height: 4rem;
  width: 4rem;
  display: block;
  margin-top: -1rem;
  margin-bottom: -1rem;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 2rem;
  font-family: system-ui, sans-serif;
  font-size: 0.9rem;
  align-items: center;
}

nav a {
  text-decoration: none;
  color: #fff;
}

nav a:hover { color: var(--green); }

.nav-cta {
  background: transparent;
  color: #fff !important;
  border: 1px solid var(--green);
  padding: 0.5rem 1.1rem;
  border-radius: 4px;
}

.nav-cta:hover { background: var(--green) !important; color: var(--text) !important; }

/* Hamburger toggle — hidden on desktop */
.nav-toggle { display: none; }
.nav-toggle-label { display: none; }

/* ── Hero ── */
.hero {
  text-align: center;
  padding: 5rem 2rem 4rem;
  background: var(--pale);
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.2;
  max-width: 700px;
  margin: 0 auto 1.25rem;
  color: var(--blue);
  text-wrap: balance;
}

.hero p {
  font-size: 1.2rem;
  color: var(--muted);
  max-width: 600px;
  margin: 0 auto 2.5rem;
  text-wrap: balance;
}

.btn-primary {
  display: inline-block;
  background: var(--blue);
  color: #fff;
  padding: 0.85rem 2rem;
  border-radius: 4px;
  text-decoration: none;
  font-family: system-ui, sans-serif;
  font-size: 1rem;
  margin-right: 0.75rem;
}

.btn-primary:hover { background: var(--blue-dark); }

.btn-secondary {
  display: inline-block;
  color: var(--blue);
  border: 1px solid var(--blue);
  padding: 0.85rem 2rem;
  border-radius: 4px;
  text-decoration: none;
  font-family: system-ui, sans-serif;
  font-size: 1rem;
}

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

/* ── Section shared ── */
section { padding: 4rem 2rem; }

.section-label {
  font-family: system-ui, sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--blue);
  margin-bottom: 0.75rem;
}

.section-heading {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  max-width: 560px;
  line-height: 1.25;
  margin-bottom: 1rem;
}

.section-sub {
  color: var(--muted);
  max-width: 520px;
  margin-bottom: 2.5rem;
  font-size: 1.05rem;
}

.center { text-align: center; margin-left: auto; margin-right: auto; }

/* ── Features ── */
.features { background: #fff; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  max-width: 900px;
  margin: 0 auto;
}

/* Three across, then straight to one. Auto-fit would stop at two on the way
   down, which leaves a lone card stranded on the second row. */
@media (max-width: 860px) {
  .feature-grid { grid-template-columns: 1fr; }
}

.feature-card {
  border: 1px solid var(--border);
  border-top: 3px solid var(--green);
  border-radius: 6px;
  padding: 1.75rem;
}

.feature-icon {
  font-size: 1.75rem;
  margin-bottom: 0.75rem;
  text-align: center;
}

.feature-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  text-align: center;
}

.feature-card p {
  color: var(--muted);
  font-size: 0.95rem;
  font-family: system-ui, sans-serif;
}

/* ── Trust strip ── */
.trust {
  background: #fff;
  border-top: 1px solid var(--border);
  padding: 2.75rem 2rem;
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem 2.5rem;
  max-width: 860px;
  margin: 0 auto;
}

.trust-item {
  flex: 1 1 220px;
  max-width: 260px;
  font-family: system-ui, sans-serif;
  font-size: 0.9rem;
  color: var(--muted);
}

.trust-item .ti-icon { font-size: 1.15rem; margin-right: 0.5rem; }

.trust-item strong {
  display: block;
  color: var(--text);
  font-size: 0.95rem;
  margin-bottom: 0.15rem;
}

/* ── How it works ── */
.how { background: var(--pale); }

.steps {
  position: relative;
  max-width: 640px;
  margin: 0 auto;
  padding-left: 1rem;
  padding-bottom: 4rem; /* room for the stem to grow down into the pot */
}

/* The growing stem */
.steps::before {
  content: "";
  position: absolute;
  left: calc(1rem + 1.125rem - 1.5px);
  top: 1.125rem;
  bottom: 2.2rem; /* runs down into the soil of the pot */
  width: 3px;
  background: var(--green);
  border-radius: 3px;
}

/* The pot the stem grows out of — same motif as the app's timeline pot */
.steps::after {
  content: "";
  position: absolute;
  left: calc(1rem + 1.125rem - 1.6rem); /* 3.2rem-wide pot centred on the stem */
  bottom: 0.4rem;
  width: 3.2rem;
  height: 2.2rem;
  background: var(--blue);
  border-top: 0.4rem solid var(--blue-dark); /* rim */
  box-sizing: border-box;
  clip-path: polygon(0 0, 100% 0, 92% 22%, 82% 100%, 18% 100%, 8% 22%);
}

.step {
  position: relative;
  padding-left: 3.5rem;
  padding-bottom: 2.5rem;
}

.step:last-child { padding-bottom: 0; }

.step-num {
  position: absolute;
  left: 0;
  top: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--green);
  color: var(--text);
  font-family: system-ui, sans-serif;
  font-weight: bold;
  font-size: 0.9rem;
  z-index: 1;
}

/* Two leaves budding off the stem in the gap below each node */
.step:not(:last-child)::before,
.step:not(:last-child)::after {
  content: "";
  position: absolute;
  width: 0.9rem;
  height: 0.9rem;
  background: var(--green);
  opacity: 0.55;
  z-index: 0;
}

/* upper leaf / lower leaf vertical positions within the gap */
.step:not(:last-child)::before { top: calc(2.25rem + 0.45rem); }
.step:not(:last-child)::after  { top: calc(2.25rem + 1.45rem); }

/* right-side leaf — offset 2px off the stem so it doesn't cut through */
.step:nth-child(odd):not(:last-child)::before,
.step:nth-child(even):not(:last-child)::after {
  left: calc(1.125rem + 2px);
  border-radius: 0 100% 0 100%;
  transform: rotate(-25deg);
}

/* left-side leaf — mirrored, offset 2px off the stem */
.step:nth-child(odd):not(:last-child)::after,
.step:nth-child(even):not(:last-child)::before {
  left: calc(1.125rem - 0.9rem - 2px);
  border-radius: 100% 0 100% 0;
  transform: rotate(25deg);
}

.step h3 { font-size: 1.05rem; margin-bottom: 0.4rem; padding-top: 0.35rem; }

.step p {
  color: var(--muted);
  font-size: 0.9rem;
  font-family: system-ui, sans-serif;
}

/* ── CTA band ── */
.cta-band {
  background: var(--blue);
  color: #fff;
  text-align: center;
  padding: 4rem 2rem;
}

.cta-band h2 {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  margin-bottom: 0.75rem;
}

.cta-band p {
  font-size: 1.05rem;
  opacity: 0.85;
  max-width: 480px;
  margin: 0 auto 2rem;
}

.btn-white {
  display: inline-block;
  background: #fff;
  color: var(--blue);
  padding: 0.85rem 2rem;
  border-radius: 4px;
  text-decoration: none;
  font-family: system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 600;
}

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

/* ── Footer ── */
footer {
  border-top: 1px solid var(--border);
  padding: 2rem;
  text-align: center;
  font-family: system-ui, sans-serif;
  font-size: 0.85rem;
  color: var(--muted);
}

footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--blue); }

/* ── Legal & long-form prose (privacy, terms, blog posts) ── */
.legal {
  max-width: 760px;
  margin: 0 auto;
  padding: 3.5rem 2rem 4rem;
}

.legal .eyebrow {
  font-family: system-ui, sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--blue);
  margin-bottom: 0.75rem;
}

.legal h1 {
  font-size: clamp(2rem, 4vw, 2.75rem);
  color: var(--blue);
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.legal .updated {
  font-family: system-ui, sans-serif;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 2.5rem;
}

.legal h2 {
  font-size: 1.35rem;
  color: var(--blue);
  margin: 2.5rem 0 0.75rem;
}

.legal h3 {
  font-size: 1.05rem;
  margin: 1.5rem 0 0.5rem;
}

.legal p, .legal li {
  color: var(--text);
  font-size: 1rem;
  margin-bottom: 1rem;
}

.legal ul, .legal ol { padding-left: 1.5rem; margin-bottom: 1rem; }
.legal li { margin-bottom: 0.5rem; }

.legal a { color: var(--blue); }

.legal .lead {
  font-size: 1.1rem;
  color: var(--muted);
}

.callout {
  background: var(--pale);
  border: 1px solid var(--border);
  border-left: 3px solid var(--green);
  border-radius: 6px;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  font-family: system-ui, sans-serif;
  font-size: 0.95rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  font-family: system-ui, sans-serif;
  font-size: 0.9rem;
}
th, td {
  border: 1px solid var(--border);
  padding: 0.65rem 0.85rem;
  text-align: left;
  vertical-align: top;
}
th { background: var(--pale); color: var(--blue); }

.toc {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.5rem;
  margin-bottom: 2.5rem;
  font-family: system-ui, sans-serif;
  font-size: 0.95rem;
}
.toc strong { display: block; margin-bottom: 0.5rem; }
.toc ol { padding-left: 1.25rem; margin: 0; }
.toc li { margin-bottom: 0.3rem; }
.toc a { color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--blue); }

/* ── Blog index & post extras ── */
.post-list { list-style: none; padding: 0; margin: 2rem 0 0; }

.post-list li {
  padding-bottom: 2rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}
.post-list li:last-child { border-bottom: none; }

.post-list h2 {
  font-size: 1.5rem;
  color: var(--blue);
  margin: 0 0 0.35rem;
}
.post-list a { text-decoration: none; }
.post-list a:hover h2 { color: var(--green); }

.post-meta {
  font-family: system-ui, sans-serif;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.6rem;
}

.post-list p { color: var(--muted); font-size: 1rem; }

.post-back {
  display: inline-block;
  margin-top: 3rem;
  font-family: system-ui, sans-serif;
  font-size: 0.9rem;
  color: var(--blue);
  text-decoration: none;
}
.post-back:hover { color: var(--green); }

/* Post body images shouldn't overflow the column */
.legal img { max-width: 100%; height: auto; border-radius: 6px; }

/* The line under the hero's call to action: why there's a waitlist at all. */
.hero-aside {
  font-family: system-ui, sans-serif;
  font-size: 0.9rem;
  color: var(--muted);
  max-width: 520px;
  margin: 1.5rem auto 0;
}

.hero-aside a { color: var(--blue); }

/* ── Waitlist dialog ── */
/* Sign-up is invite-only, so this is the site's primary call to action. The buttons
   on the page only open this; the form itself lives here and nowhere else. */
.waitlist-modal {
  border: 0;
  border-radius: 8px;
  padding: 0;
  width: min(30rem, calc(100vw - 2rem));
  color: var(--text);
  background: #fff;
  box-shadow: 0 20px 50px rgba(0, 31, 61, 0.3);
  /* The universal reset (margin: 0) clobbers the dialog's UA default of
     margin: auto, which is what centers a modal. Put it back. */
  margin: auto;
}

.waitlist-modal::backdrop { background: rgba(0, 31, 61, 0.55); }

.waitlist-modal-inner {
  position: relative;
  padding: 2.25rem 2rem 2rem;
}

.waitlist-modal h2 {
  font-size: 1.6rem;
  line-height: 1.25;
  color: var(--blue);
  margin-bottom: 0.6rem;
  padding-right: 2rem;
}

.waitlist-modal-lede {
  font-family: system-ui, sans-serif;
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.waitlist-modal-dismiss {
  position: absolute;
  top: 0.6rem;
  right: 0.75rem;
}

.waitlist-modal-dismiss button {
  background: none;
  border: 0;
  padding: 0.25rem 0.5rem;
  font-family: system-ui, sans-serif;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
}

.waitlist-modal-dismiss button:hover { color: var(--text); }

/* In the narrow dialog the fields stack, the same way they do on a phone. */
.waitlist-modal .waitlist-fields { flex-direction: column; }
/* Once stacked, the inputs' `flex: 1 1 12rem` basis would apply to their
   height (the main axis is now vertical). Reset to auto height, full width. */
.waitlist-modal .waitlist input { flex: 0 0 auto; width: 100%; }
.waitlist-modal .waitlist-note { margin-bottom: 0; }

/* The submit button sits in a bar along the bottom of the dialog. The footer
   breaks out of .waitlist-modal-inner's side and bottom padding to run edge to
   edge, then pays that padding back so the button lines up with the body. */
.waitlist-modal .waitlist-footer {
  margin: 1.5rem -2rem -2rem;
  padding: 1.25rem 2rem;
  border-top: 1px solid var(--border);
  background: var(--pale);
  border-radius: 0 0 8px 8px;
}
.waitlist-modal .waitlist-footer button { width: 100%; margin: 0; }

.waitlist {
  max-width: 520px;
  margin: 0 auto;
  font-family: system-ui, sans-serif;
}

.waitlist-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
}

.waitlist input {
  flex: 1 1 12rem;
  min-width: 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  background: #fff;
}

.waitlist input::placeholder { color: #8a9bab; }

.waitlist input:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
}

/* The submit button is .btn-primary, which carries a right margin for its
   side-by-side hero use. In the form, gap handles the spacing. */
.waitlist button {
  flex: 0 0 auto;
  margin-right: 0;
  border: 0;
  cursor: pointer;
  font-weight: 600;
}

/* The status line: empty (and so invisible) until the script has something to say. */
.waitlist-note {
  margin-top: 0.85rem;
  font-size: 0.9rem;
  min-height: 1.35rem;
  color: var(--muted);
}

.waitlist-note.waitlist-error { color: #b3261e; }

/* Labels exist for screen readers; the placeholder carries the visible cue. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  nav { flex-wrap: wrap; }

  /* Show the hamburger button */
  .nav-toggle-label {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 2.25rem;
    height: 2.25rem;
    cursor: pointer;
    padding: 0.4rem;
  }
  .nav-toggle-label span {
    display: block;
    height: 2px;
    width: 100%;
    background: #fff;
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.25s ease;
  }

  /* Collapsed menu */
  nav ul {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.25rem;
    width: 100%;
    padding: 1rem 0 0.5rem;
  }

  /* Expanded when checkbox is checked */
  .nav-toggle:checked ~ ul { display: flex; }

  /* Animate hamburger into an X */
  .nav-toggle:checked ~ .nav-toggle-label span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .nav-toggle:checked ~ .nav-toggle-label span:nth-child(2) {
    opacity: 0;
  }
  .nav-toggle:checked ~ .nav-toggle-label span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .nav-cta { display: inline-block; }

  .btn-primary, .btn-secondary { display: block; text-align: center; margin: 0.4rem 0; }

  /* One field per row, full-width button — the rule above already stacks it, this
     just undoes the stray vertical margin now that gap is doing the spacing. */
  .waitlist-fields { flex-direction: column; }
  /* Stacked: keep the 12rem flex-basis off the (now vertical) main axis. */
  .waitlist input { flex: 0 0 auto; width: 100%; }
  .waitlist button { width: 100%; margin: 0; }
}
