/* ─────────────── Design tokens ─────────────── */
:root {
  --accent: #00B0F0;          /* caidal blue (matches the app splash) */
  --accent-hover: rgba(255, 255, 255, .16);
  --ink: #1c1c1e;             /* near-black body text */
  --muted: #8a8a8e;           /* gray subheads / captions */
  --bg: #ffffff;
  --card-radius: 16px;
  --maxw: 1180px;             /* page container */
  --prose: 840px;             /* reading column for text sections */
  --header-h: 84px;
}

/* ─────────────── Base ─────────────── */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
img { max-width: 100%; display: block; }

/* ─────────────── Header ─────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--accent);
  color: #fff;
}

.header-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.logo-tile {
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  background: #fff;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
}
.logo-tile img { width: 80%; height: 80%; object-fit: contain; }

.wordmark {
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #fff;
}

/* Nav */
nav ul {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}
nav a {
  display: inline-block;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  padding: 8px 18px;
  border-radius: 999px;
  border: 2px solid transparent;
  transition: background .15s ease, border-color .15s ease;
}
nav a:hover { background: var(--accent-hover); }
nav a.active { border-color: #fff; }

/* Hamburger (mobile only) */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  width: 26px;
  height: 3px;
  background: #fff;
  border-radius: 2px;
}

/* ─────────────── Layout helpers ─────────────── */
.prose {
  max-width: var(--prose);
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

.section {
  /* Vertical only — longhand so it doesn't clobber .prose's left/right padding
     when an element is both .section and .prose (equal specificity, later wins). */
  padding-top: 44px;
  padding-bottom: 44px;
  scroll-margin-top: calc(var(--header-h) + 8px);
}

h2 {
  font-size: 1.85rem;
  font-weight: 800;
  margin: 0 0 .5rem;
}
.lead {
  font-weight: 700;
  margin: 0 0 1rem;
}
p { margin: 0 0 1rem; }

/* ─────────────── Hero ─────────────── */
.hero {
  padding-top: 64px;
  padding-bottom: 16px;
  scroll-margin-top: var(--header-h);
}
.hero-title {
  font-size: 2rem;
  font-weight: 400;
  line-height: 1.25;
  margin: 0;
}
.hero-sub {
  font-size: 1.4rem;
  line-height: 1.3;
  margin: .5rem 0 0;
}
.hero-badge {
  color: var(--muted);
  font-size: 1.05rem;
  margin-top: 1.25rem;
}

/* ─────────────── Value ─────────────── */
.value-item { margin-bottom: 1.6rem; }
.value-item h3 {
  color: var(--muted);
  font-size: 1.02rem;
  font-weight: 700;
  margin: 0 0 .3rem;
}
.value-item p { margin: 0; }

/* ─────────────── Features ─────────────── */
.features {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 44px 24px;
  scroll-margin-top: calc(var(--header-h) + 8px);
}
.features-title {
  text-align: center;
  font-size: 2.2rem;
  font-weight: 800;
  margin: 0 0 2rem;
}
.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}
.feature-card {
  display: flex;
  flex-direction: column;
  border: 2px solid var(--accent);
  border-radius: var(--card-radius);
  overflow: hidden;
  background: #fff;
}
.feature-card-head {
  background: var(--accent);
  color: #fff;
  text-align: center;
  padding: 16px 14px;
}
.feature-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  margin-bottom: 8px;
}
.feature-icon svg { width: 30px; height: 30px; }
.feature-card-head h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
}
.feature-card-body {
  flex: 1;
  padding: 16px 18px;
}
.feature-card-body p {
  margin: 0;
  font-size: .98rem;
  line-height: 1.5;
}

/* ─────────────── Footer ─────────────── */
.site-footer {
  border-top: 1px solid #eee;
  margin-top: 32px;
}
.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 28px 24px;
  color: var(--muted);
  font-size: .9rem;
}
.footer-inner p { margin: 0 0 .4rem; }
.footer-inner .disclaimer { font-size: .85rem; }

/* ─────────────── Responsive ─────────────── */
@media (max-width: 960px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 820px) {
  /* margin-left:auto pins the hamburger to the far right, overriding the
     3-item space-between spread (the absolutely-positioned nav collapses to 0).
     margin-right:-8px cancels the button's own 8px right padding so the visible
     bars sit at the 24px gutter — symmetric with the logo on the left — while
     keeping the full tap target. */
  .nav-toggle { display: flex; margin-left: auto; margin-right: -8px; }
  nav ul {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    background: var(--accent);
    padding: 10px 24px 18px;
    display: none;
    box-shadow: 0 8px 16px rgba(0, 0, 0, .12);
  }
  nav ul.open { display: flex; }
  nav a { padding: 12px 14px; }
  .wordmark { font-size: 1.6rem; }
}

@media (max-width: 560px) {
  .feature-grid { grid-template-columns: 1fr; }
  .hero-title { font-size: 1.7rem; }
  .hero-sub { font-size: 1.2rem; }
}

/* ─────────────── Buttons & links ─────────────── */
.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  padding: 12px 24px;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  transition: filter .15s ease;
}
.btn:hover { filter: brightness(.95); }

.link-btn {
  display: inline-block;
  background: none;
  border: 0;
  padding: 0;
  color: var(--accent);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}
.link-btn:hover { text-decoration: underline; }

.actions { margin-top: 1.75rem; display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }

/* ─────────────── Modal ─────────────── */
.modal[hidden] { display: none; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  justify-content: center;
  padding: 40px 16px;
  background: rgba(0, 0, 0, .45);
  overflow-y: auto;
}
.modal-dialog {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 720px;
  margin: auto;
  max-height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  border-bottom: 1px solid #eee;
}
.modal-head h3 { margin: 0; font-size: 1.2rem; font-weight: 800; }
.modal-close {
  background: none;
  border: 0;
  font-size: 1.7rem;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 2px 10px;
  border-radius: 8px;
}
.modal-close:hover { background: #f2f2f2; color: var(--ink); }
.modal-body { padding: 22px 24px 28px; overflow-y: auto; }
.modal-body h4 { font-size: 1.05rem; font-weight: 800; margin: 1.5em 0 .4em; }
.modal-body h4:first-child { margin-top: 0; }
.modal-body p { margin: 0 0 .9em; line-height: 1.6; }
.modal-body ul { margin: 0 0 1em; padding-left: 1.25em; }
.modal-body li { margin-bottom: .4em; line-height: 1.55; }
.modal-body .muted { color: var(--muted); font-size: .9rem; }
