/*
 * headbalance.app — one stylesheet for the landing page and /privacy.
 * Mobile first. Fonts are hosted here (fonts/), never loaded from Google,
 * so visitors' addresses go nowhere but Cloudflare.
 */

@font-face {
  font-family: 'Fraunces';
  src: url('/fonts/fraunces.woff2') format('woff2');
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('/fonts/inter.woff2') format('woff2');
  font-weight: 400 650;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f7f4ec;
  --paper: #fffdf8;
  --ink: #1f2a24;
  --muted: #69706a;
  --line: rgb(31 42 36 / 9%);
  --sage: #7e9a7e;
  --sage-deep: #3f5f48;
  --sage-tint: #e5eedf;
  --blue-tint: #e3ecf3;
  --sand-tint: #f3e9da;
  --lavender-tint: #ebe6f4;
  --serif: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --radius: 28px;
  --shadow: 0 30px 80px -20px rgb(31 42 36 / 22%), 0 12px 30px -12px rgb(31 42 36 / 14%);
  --gutter: 20px;
  --max: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img {
  max-width: 100%;
}

a {
  color: inherit;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 500;
  letter-spacing: -0.01em;
}

h1,
h2 {
  font-family: var(--serif);
  font-optical-sizing: auto;
}

h1 em,
h2 em,
blockquote em {
  font-style: normal;
  color: var(--sage-deep);
}

/* A soft wash of colour behind the top of the page. */
.page-glow {
  position: absolute;
  inset: 0 0 auto;
  height: 900px;
  z-index: -1;
  background:
    radial-gradient(50% 45% at 85% 20%, rgb(207 224 202 / 75%), transparent 70%),
    radial-gradient(45% 40% at 10% 60%, rgb(214 228 239 / 70%), transparent 70%),
    radial-gradient(40% 35% at 60% 85%, rgb(243 233 218 / 80%), transparent 70%);
}

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100% - 2 * var(--gutter), var(--max));
  margin: 0 auto;
  padding: 18px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 15px;
}

.main-nav a:not(.pill-button) {
  color: var(--muted);
  text-decoration: none;
  display: none;
}

.main-nav a:not(.pill-button):hover {
  color: var(--ink);
}

.pill-button {
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper) !important;
  font-size: 14px;
  font-weight: 550;
  text-decoration: none;
}

/* Buttons and links */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 26px;
  border-radius: 999px;
  background: var(--sage-deep);
  color: var(--paper);
  font-weight: 550;
  text-decoration: none;
  box-shadow: 0 10px 24px -10px rgb(63 95 72 / 60%);
  transition: transform 0.2s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-light {
  background: var(--paper);
  color: var(--sage-deep);
  box-shadow: none;
}

.text-link {
  color: var(--sage-deep);
  font-weight: 550;
  text-decoration: none;
}

.text-link::after {
  content: ' →';
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  color: var(--sage-deep);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sage);
  box-shadow: 0 0 0 4px rgb(126 154 126 / 22%);
}

/* Hero */
.hero {
  display: grid;
  gap: 36px;
  width: min(100% - 2 * var(--gutter), var(--max));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.hero h1 {
  font-size: clamp(40px, 10.5vw, 76px);
  line-height: 1.02;
  letter-spacing: -0.02em;
}

.lead {
  max-width: 30ch;
  margin: 18px 0 26px;
  color: var(--muted);
  font-size: 18px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 24px;
}

.hero-phone {
  position: relative;
  justify-self: center;
  width: min(62vw, 300px);
}

/* Shows the top of the screen and fades out — the page stays short. */
.hero-phone .phone {
  max-height: 470px;
  border-bottom: 0;
  border-radius: 38px 38px 0 0;
  -webkit-mask-image: linear-gradient(to bottom, #000 72%, transparent);
  mask-image: linear-gradient(to bottom, #000 72%, transparent);
}

.phone {
  margin: 0;
  overflow: hidden;
  border: 6px solid #1f2420;
  border-radius: 38px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

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

.float-chip {
  position: absolute;
  z-index: 1;
  padding: 8px 13px;
  border: 1px solid rgb(255 255 255 / 70%);
  border-radius: 999px;
  background: rgb(255 253 248 / 82%);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px -12px rgb(31 42 36 / 30%);
  font-size: 13px;
  font-weight: 550;
  white-space: nowrap;
}

.chip-a {
  top: 16%;
  left: -18%;
}

.chip-b {
  top: 42%;
  right: -16%;
}

.chip-c {
  top: 66%;
  left: -14%;
  color: var(--sage-deep);
}

/* Sections */
.section {
  width: min(100% - 2 * var(--gutter), var(--max));
  margin: 0 auto;
  padding: 56px 0;
}

.section-head {
  max-width: 640px;
  margin-bottom: 28px;
}

.section-head h2,
.beta h2 {
  font-size: clamp(30px, 7.4vw, 50px);
  line-height: 1.08;
}

/* How it works — swipeable cards on phones, four across on wide screens. */
.cards {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(80%, 300px);
  gap: 14px;
  margin: 0 calc(-1 * var(--gutter));
  padding: 4px var(--gutter) 18px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 var(--gutter);
  scrollbar-width: none;
}

.cards::-webkit-scrollbar {
  display: none;
}

.card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 460px;
  border-radius: var(--radius);
  scroll-snap-align: start;
}

.card-text {
  padding: 24px 24px 0;
}

.step {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-bottom: 14px;
  border-radius: 50%;
  background: rgb(255 253 248 / 85%);
  font-size: 13px;
  font-weight: 650;
}

.card h3 {
  font-size: 20px;
  line-height: 1.2;
}

.card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 15px;
}

/* A phone rising from the bottom of the card. */
.peek {
  width: 72%;
  margin: auto auto 0;
  padding-top: 22px;
}

.peek img {
  display: block;
  width: 100%;
  height: 250px;
  object-fit: cover;
  object-position: top;
  border: 5px solid #1f2420;
  border-bottom: 0;
  border-radius: 30px 30px 0 0;
  box-shadow: var(--shadow);
}

.tint-sage {
  background: var(--sage-tint);
}

.tint-blue {
  background: var(--blue-tint);
}

.tint-sand {
  background: var(--sand-tint);
}

.tint-lavender {
  background: var(--lavender-tint);
}

/* Principles */
.believe blockquote {
  max-width: 900px;
  margin: 0 0 36px;
}

.believe blockquote p {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(28px, 6.6vw, 48px);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.believe-grid {
  display: grid;
  gap: 18px;
}

.believe-grid div {
  padding-left: 16px;
  border-left: 2px solid var(--sage);
}

.believe-grid h3 {
  font-size: 17px;
  font-weight: 600;
}

.believe-grid p {
  margin: 4px 0 0;
  color: var(--muted);
}

.never {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 30px 0 0;
  padding: 0;
  list-style: none;
}

.never li {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  font-size: 14px;
  font-weight: 550;
}

/* Research */
.research-list {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.research-list li {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.research-list strong {
  color: var(--ink);
  font-weight: 600;
}

.research-list cite {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  font-style: normal;
  color: var(--sage-deep);
}

.fineprint {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 13.5px;
}

.center {
  text-align: center;
}

/* Plans */
.plans {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.plan {
  position: relative;
  padding: 18px 14px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--paper);
  text-align: center;
}

.plan h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

.price {
  margin: 6px 0 4px;
  font-family: var(--serif);
  font-size: clamp(22px, 5.6vw, 34px);
  line-height: 1.1;
}

.price span {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--muted);
}

.plan p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.4;
}

.featured {
  border-color: var(--sage);
  box-shadow:
    0 0 0 1px var(--sage),
    0 18px 40px -22px rgb(63 95 72 / 55%);
}

.badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--sage-deep);
  color: var(--paper);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

/* Beta */
.beta {
  width: min(100% - 2 * var(--gutter), var(--max));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.beta-card {
  padding: 44px 26px;
  border-radius: 34px;
  background:
    radial-gradient(60% 80% at 100% 0%, rgb(126 154 126 / 55%), transparent 70%),
    linear-gradient(160deg, #3f5f48, #2f4737);
  color: var(--paper);
  text-align: center;
}

.beta-card img {
  filter: brightness(1.9) saturate(0.6);
}

.beta-card h2 {
  margin: 14px auto 12px;
  max-width: 18ch;
}

.beta-card h2 em {
  color: #cfe0ca;
}

.beta-card > p {
  max-width: 34ch;
  margin: 0 auto 24px;
  color: rgb(255 253 248 / 78%);
}

.beta-privacy {
  margin: 22px auto 0 !important;
  font-size: 13px;
}

.beta-privacy a {
  color: var(--paper);
}

/* Footer */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 24px;
  width: min(100% - 2 * var(--gutter), var(--max));
  margin: 0 auto;
  padding: 28px 0 40px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.footer-links a {
  text-decoration: none;
}

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

/* Wider screens */
@media (min-width: 760px) {
  :root {
    --gutter: 32px;
  }

  .main-nav a:not(.pill-button) {
    display: inline;
  }

  .hero {
    grid-template-columns: 1.05fr 0.95fr;
    align-items: center;
    padding: 56px 0 80px;
  }

  .hero-phone {
    width: 320px;
  }

  .hero-phone .phone {
    max-height: 600px;
  }

  .section {
    padding: 80px 0;
  }

  .believe-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
  }

  .research-list {
    grid-template-columns: 1fr 1fr;
    column-gap: 40px;
  }

  .plans {
    max-width: 760px;
    margin: 0 auto;
    gap: 16px;
  }

  .plan {
    padding: 28px 20px;
  }

  .plan h3 {
    font-size: 15px;
  }

  .plan p:last-child {
    font-size: 14px;
  }

  .beta-card {
    padding: 64px 40px;
  }
}

@media (min-width: 1040px) {
  .cards {
    grid-auto-flow: row;
    grid-template-columns: repeat(4, 1fr);
    margin: 0;
    padding: 0;
    overflow: visible;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .button {
    transition: none;
  }
}

/* Privacy policy (/privacy) — built from docs/legal/privacy-policy.md. */
.legal {
  width: min(100% - 2 * var(--gutter), 760px);
  margin: 0 auto;
  padding: 24px 0 72px;
  line-height: 1.65;
}

.legal h1 {
  font-family: var(--serif);
  font-size: clamp(34px, 7vw, 48px);
  line-height: 1.1;
  margin: 0 0 12px;
}

.legal h2 {
  font-family: var(--serif);
  font-size: 24px;
  margin: 44px 0 10px;
  scroll-margin-top: 24px;
}

.legal h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 28px 0 8px;
}

.legal ul {
  padding-left: 1.2em;
}

.legal li + li {
  margin-top: 6px;
}

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

.legal-table {
  overflow-x: auto;
  margin: 16px 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
}

.legal-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.legal-table th,
.legal-table td {
  padding: 10px 14px;
  text-align: left;
  vertical-align: top;
}

.legal-table th {
  background: var(--sand-tint);
  font-weight: 600;
}

.legal-table tr + tr td {
  border-top: 1px solid var(--line);
}
