/* Habitate site. One stylesheet, no build step. */

:root {
  --green: #86c34b;
  --blue: #4f8bff;
  --purple: #8e2db5;
  --brand-gradient: linear-gradient(120deg, var(--green) 0%, #5fa0c8 35%, var(--blue) 60%, var(--purple) 100%);

  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #eef1f7;
  --text: #16181d;
  --text-2: #5b6170;
  --border: #e1e5ee;
  --link: #2f6fe8;
  --code-bg: #eef1f7;
  --shadow: 0 1px 2px rgb(16 24 40 / 0.06), 0 8px 24px rgb(16 24 40 / 0.08);

  --radius: 18px;
  --wrap: 1120px;
  --prose: 740px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --font-display: -apple-system-headline, -apple-system, BlinkMacSystemFont, "SF Pro Rounded", "SF Pro Display", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --surface: #181b21;
    --surface-2: #20242c;
    --text: #eef0f4;
    --text-2: #a3a9b6;
    --border: #2a2f39;
    --link: #7aa7ff;
    --code-bg: #20242c;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 8px 24px rgb(0 0 0 / 0.35);
  }
}

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

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }

a { color: var(--link); text-underline-offset: 2px; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 18px;
}

.brand img { border-radius: 8px; }

.site-nav { display: flex; gap: 4px; }

.site-nav a {
  color: var(--text-2);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 999px;
}

.site-nav a:hover { color: var(--text); background: var(--surface-2); }
.site-nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }

/* ---------- App Store button ---------- */

.store-badge { display: inline-block; line-height: 0; }
.store-badge img { width: auto; }

.store-button {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 12px;
  background: #000;
  color: #fff;
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
  white-space: nowrap;
}

.store-button:hover { background: #222; }

@media (prefers-color-scheme: dark) {
  .site-footer .store-button { background: #fff; color: #000; }
}

/* ---------- Landing: hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  background: var(--brand-gradient);
  color: #fff;
}

/* The zigzag motif from the App Store art. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='160' viewBox='0 0 240 160'%3E%3Cpath d='M-10 40 L60 110 L130 40 L200 110 L270 40' fill='none' stroke='%23fff' stroke-opacity='0.16' stroke-width='22' stroke-linejoin='miter'/%3E%3C/svg%3E");
  background-size: 240px 160px;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 48px;
  padding-top: 72px;
  padding-bottom: 0;
}

.hero-copy { padding-bottom: 72px; }

.hero-icon {
  width: 88px;
  height: 88px;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgb(0 0 0 / 0.25);
  margin-bottom: 24px;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(44px, 7vw, 76px);
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin: 0 0 20px;
  text-wrap: balance;
}

.hero .lede {
  font-size: clamp(18px, 2.2vw, 21px);
  line-height: 1.5;
  max-width: 34ch;
  margin: 0 0 32px;
  color: rgb(255 255 255 / 0.92);
}

.hero .store-button { background: #fff; color: #000; }
.hero .store-button:hover { background: #f1f1f1; }

.hero-note { margin-top: 14px; font-size: 14px; color: rgb(255 255 255 / 0.8); }

.hero-shot {
  align-self: end;
  justify-self: center;
  width: min(340px, 100%);
}

.phone {
  display: block;
  border-radius: 44px 44px 0 0;
  border: 10px solid #111;
  border-bottom: 0;
  background: #111;
  box-shadow: 0 30px 60px rgb(0 0 0 / 0.3);
  overflow: hidden;
  /* Show the top ~70% of the screen, cut off by the hero's bottom edge. */
  aspect-ratio: 552 / 860;
}

.phone img { display: block; width: 100%; }

/* ---------- Landing: features ---------- */

.section { padding: 88px 0; }

.section-head { text-align: center; max-width: 640px; margin: 0 auto 56px; }

.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(32px, 4.5vw, 44px);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 12px;
}

.section-head p { color: var(--text-2); font-size: 19px; margin: 0; }

.feature {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 64px;
  max-width: 960px;
  margin: 0 auto;
  padding: 40px 0;
}

.feature + .feature { border-top: 1px solid var(--border); }

.feature:nth-of-type(even) .feature-shot { order: -1; }

.feature-kicker {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 8px;
}

.feature h3 {
  font-family: var(--font-display);
  font-size: clamp(26px, 3.4vw, 34px);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 14px;
}

.feature p { color: var(--text-2); margin: 0 0 12px; }

.feature ul { color: var(--text-2); padding-left: 20px; margin: 0; }
.feature li { margin: 4px 0; }

.feature-shot { justify-self: center; width: min(300px, 100%); }

.feature-shot img {
  display: block;
  border-radius: 36px;
  border: 8px solid #111;
  background: #111;
  box-shadow: var(--shadow);
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 960px;
  margin: 24px auto 0;
}

.mini {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.mini h4 { margin: 0 0 6px; font-size: 18px; }
.mini p { margin: 0; color: var(--text-2); font-size: 15px; line-height: 1.5; }

/* ---------- Landing: closing CTA ---------- */

.cta {
  position: relative;
  overflow: hidden;
  text-align: center;
  background: var(--brand-gradient);
  color: #fff;
  border-radius: 28px;
  padding: 64px 24px;
  max-width: 960px;
  margin: 0 auto;
}

.cta::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='160' viewBox='0 0 240 160'%3E%3Cpath d='M-10 40 L60 110 L130 40 L200 110 L270 40' fill='none' stroke='%23fff' stroke-opacity='0.14' stroke-width='22'/%3E%3C/svg%3E");
  background-size: 240px 160px;
  pointer-events: none;
}

.cta > * { position: relative; }

.cta h2 {
  font-family: var(--font-display);
  font-size: clamp(30px, 4.5vw, 42px);
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}

.cta p { margin: 0 auto 28px; max-width: 46ch; color: rgb(255 255 255 / 0.92); }

.cta .store-button { background: #fff; color: #000; }

/* ---------- Document pages (Markdown) ---------- */

.prose {
  max-width: calc(var(--prose) + 40px);
  padding-top: 48px;
  padding-bottom: 80px;
}

.prose h1 {
  font-family: var(--font-display);
  font-size: clamp(34px, 5vw, 46px);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 24px;
}

.prose h2 {
  font-size: 26px;
  letter-spacing: -0.01em;
  line-height: 1.25;
  margin: 48px 0 12px;
}

.prose h3 { font-size: 20px; line-height: 1.3; margin: 32px 0 8px; }
.prose h4 { font-size: 17px; margin: 24px 0 8px; }

.prose p, .prose ul, .prose ol, .prose table, .prose pre, .prose blockquote, .prose details { margin: 0 0 16px; }

.prose li { margin: 4px 0; }
.prose li > ul, .prose li > ol { margin: 4px 0; }

.prose hr {
  border: 0;
  height: 1px;
  background: var(--border);
  margin: 40px 0;
}

.prose code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--code-bg);
  border-radius: 6px;
  padding: 0.1em 0.35em;
}

.prose pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  overflow-x: auto;
  line-height: 1.5;
}

.prose pre code { background: none; padding: 0; font-size: 14px; white-space: pre-wrap; }

.prose blockquote {
  border-left: 4px solid var(--blue);
  background: var(--surface);
  border-radius: 0 12px 12px 0;
  padding: 12px 18px;
  color: var(--text-2);
}

.prose blockquote p:last-child { margin-bottom: 0; }

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  display: block;
  overflow-x: auto;
}

.prose th, .prose td {
  text-align: left;
  vertical-align: top;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.prose th { font-weight: 600; background: var(--surface-2); }

.prose details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 18px;
}

.prose summary { cursor: pointer; font-weight: 600; }
.prose details[open] summary { margin-bottom: 12px; }

.prose sub { font-size: 13px; color: var(--text-2); line-height: 1.5; display: inline-block; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 40px 0 24px;
  font-size: 15px;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
}

.footer-brand { display: flex; align-items: center; gap: 12px; }
.footer-brand img { border-radius: 10px; }
.footer-brand div { display: flex; flex-direction: column; line-height: 1.3; }
.footer-brand span { color: var(--text-2); font-size: 14px; }

.footer-nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.footer-nav a { color: var(--text-2); text-decoration: none; }
.footer-nav a:hover { color: var(--text); text-decoration: underline; }

.footer-legal p { margin: 24px 0 0; color: var(--text-2); font-size: 12px; line-height: 1.5; }

/* ---------- Small screens ---------- */

@media (max-width: 820px) {
  .hero-inner { grid-template-columns: 1fr; gap: 0; padding-top: 48px; text-align: center; }
  .hero-copy { padding-bottom: 40px; }
  .hero .lede { margin-left: auto; margin-right: auto; }
  .hero-shot { width: min(280px, 80%); }

  .section { padding: 64px 0; }

  .feature { grid-template-columns: 1fr; gap: 28px; text-align: center; padding: 32px 0; }
  .feature:nth-of-type(even) .feature-shot { order: 0; }
  .feature ul { display: inline-block; text-align: left; }
  .feature-shot { width: min(260px, 80%); }

  .mini-grid { grid-template-columns: 1fr; }

  .footer-inner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .brand span { display: none; }
  .site-nav a { padding: 6px 10px; }
  .prose { padding-top: 32px; }
}
