/* Keepbook site. Colors match the app's Paper, Ink, Rule, Debit and accent. */

@font-face {
  font-family: 'Cabinet Grotesk';
  src: url('/fonts/cabinet-grotesk-variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Satoshi';
  src: url('/fonts/satoshi-variable.woff2') format('woff2');
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Typography */
  --font-display: 'Cabinet Grotesk', 'Helvetica Neue', sans-serif;
  --font-body: 'Satoshi', 'Helvetica Neue', sans-serif;

  /* Colors */
  --color-paper: #faf8f2;
  --color-card: #ffffff;
  --color-ink: #1a1d1b;
  --color-ink-muted: #565b57;
  --color-rule: #ddd8cb;
  --color-accent: #1f6b4a;
  --color-accent-dark: #17523a;
  --color-accent-tint: #e4ede7;
  --color-debit: #a3271e;
  --color-on-accent: #faf8f2;
  --color-on-accent-muted: #e0ece5;
  --color-on-accent-rule: rgba(250, 248, 242, 0.22);
  --color-on-ink-muted: #c9cbc6;
  --color-on-ink-accent: #8fd6b3;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 7rem;

  /* Layout */
  --page-width: 72rem;
  --text-width: 40rem;
  --gutter: 1.25rem;
  --radius: 1rem;

  /* Motion */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 200ms;
  --duration-slow: 700ms;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
}

::selection {
  background: var(--color-accent);
  color: var(--color-on-accent);
}

body {
  margin: 0;
  background: var(--color-paper);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.75rem, 7.5vw, 5.25rem);
}

h2 {
  font-size: clamp(2.125rem, 5vw, 3.5rem);
}

h3 {
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

a {
  color: var(--color-accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--color-accent-dark);
  text-decoration-thickness: 2px;
}

a:active {
  color: var(--color-ink);
}

:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 4px;
}

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

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  padding: 0.75rem 1rem;
  background: var(--color-ink);
  color: var(--color-paper);
  border-radius: 0.5rem;
  z-index: 10;
}

.skip:hover,
.skip:focus {
  color: var(--color-paper);
}

.skip:focus {
  top: var(--space-xs);
}

.amount {
  font-variant-numeric: tabular-nums;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--color-paper);
  border-bottom: 1px solid var(--color-rule);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  min-height: 4.5rem;
}

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

.brand:hover,
.brand:active {
  color: var(--color-accent);
}

.brand img {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.5rem;
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 0.75rem;
  border-radius: 0.5rem;
  color: var(--color-ink);
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  transition: background-color var(--duration-fast) ease;
}

.nav a:hover {
  background: var(--color-accent-tint);
}

.nav a:active {
  background: var(--color-rule);
}

.nav a[aria-current='page'] {
  color: var(--color-accent);
  font-weight: 700;
}

.nav .nav-wide {
  display: none;
}

/* Hero */

.hero {
  padding: var(--space-lg) 0 0;
  overflow: hidden;
}

.hero .wrap {
  display: grid;
  gap: var(--space-lg);
}

.hero-copy {
  max-width: 38rem;
}

.lede {
  margin-top: var(--space-md);
  max-width: 34rem;
  color: var(--color-ink-muted);
  font-size: 1.3125rem;
  line-height: 1.5;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs) var(--space-sm);
}

.status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: var(--space-md);
  font-weight: 700;
}

.hero-actions {
  margin-top: var(--space-sm);
}

.hero-actions .button {
  margin-top: 0;
}

.hero-note {
  margin-top: 0.75rem;
  color: var(--color-ink-muted);
  font-size: 1rem;
}

.status svg {
  flex: none;
}

.text-link {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 0.5rem;
  font-weight: 700;
}

.hero-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 1.5rem;
  margin: var(--space-md) 0 0;
  padding: var(--space-sm) 0 0;
  border-top: 1px solid var(--color-rule);
  list-style: none;
  color: var(--color-ink-muted);
  font-size: 1rem;
  font-weight: 500;
}

.hero-shot {
  justify-self: center;
  width: min(100%, 21rem);
}

.phone {
  padding: 0.625rem;
  border-radius: 3.25rem;
  background: var(--color-ink);
  box-shadow: 0 1px 2px rgba(26, 29, 27, 0.08), 0 24px 48px -24px rgba(26, 29, 27, 0.35);
}

.phone img {
  width: 100%;
  border-radius: 2.625rem;
  background: var(--color-paper);
}

/* In the hero the phone runs off the bottom edge, like a book on a desk. */
.hero .phone {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  padding-bottom: 0;
}

.hero .phone img {
  aspect-ratio: 644 / 1100;
  object-fit: cover;
  object-position: top;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

/* Sections */

.section {
  padding: var(--space-lg) 0;
  border-top: 1px solid var(--color-rule);
}

.section-head {
  max-width: var(--text-width);
}

.section-head p {
  margin-top: var(--space-sm);
  color: var(--color-ink-muted);
  font-size: 1.25rem;
  line-height: 1.5;
}

/* Data safety: the one solid green section */

.safety {
  background: var(--color-accent);
  color: var(--color-on-accent);
  border-top: 0;
}

.safety .section-head p {
  color: var(--color-on-accent-muted);
}

.safety-grid {
  display: grid;
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

.safety-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.safety-list li {
  padding: 1.5rem 0;
  border-top: 1px solid var(--color-on-accent-rule);
}

.safety-list li:last-child {
  border-bottom: 1px solid var(--color-on-accent-rule);
}

.safety-list p {
  margin-top: 0.5rem;
  max-width: 34rem;
  color: var(--color-on-accent-muted);
}

.safety-shot {
  align-self: start;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--color-paper);
}

.safety-shot img {
  width: 100%;
}

.safety-shot figcaption {
  padding: 0.875rem 1.25rem 1.125rem;
  color: var(--color-ink-muted);
  font-size: 1rem;
}

figure {
  margin: 0;
}

/* Feature rows, ruled like a register */

.ledger {
  margin: var(--space-lg) 0 0;
  padding: 0;
  list-style: none;
  border-top: 2px solid var(--color-ink);
}

.ledger li {
  display: grid;
  grid-template-columns: 1.75rem 1fr;
  gap: 0.25rem 1rem;
  align-content: start;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--color-rule);
}

.ledger svg {
  margin-top: 0.125rem;
}

.ledger p {
  grid-column: 2;
  color: var(--color-ink-muted);
}

/* Screens */

.screens {
  display: grid;
  gap: var(--space-lg);
  margin-top: var(--space-lg);
}

.screen {
  display: grid;
  gap: var(--space-md);
  justify-items: center;
}

.screen .phone {
  width: min(100%, 18rem);
}

.screen-copy {
  width: 100%;
  max-width: 26rem;
}

/* Switching */

.switching-grid {
  display: grid;
  gap: var(--space-lg);
  justify-items: center;
}

.switching-grid .section-head {
  width: 100%;
}

.switching-grid .phone {
  width: min(100%, 18rem);
}

.screen-copy p {
  margin-top: 0.5rem;
  color: var(--color-ink-muted);
}

/* Price */

.prices {
  display: grid;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

.price {
  padding: var(--space-md);
  border: 1px solid var(--color-rule);
  border-radius: var(--radius);
  background: var(--color-card);
}

.price-full {
  border: 2px solid var(--color-accent);
}

.price-name {
  color: var(--color-ink-muted);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.price-amount {
  margin-top: 0.5rem;
  font-family: var(--font-display);
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
}

.price-amount small {
  font-family: var(--font-body);
  font-size: 1.125rem;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--color-ink-muted);
}

.price ul {
  margin: var(--space-md) 0 0;
  padding: 0;
  list-style: none;
}

.price li {
  padding: 0.75rem 0;
  border-top: 1px solid var(--color-rule);
}

.price-note {
  margin-top: var(--space-md);
  max-width: var(--text-width);
  color: var(--color-ink-muted);
}

/* Closing band */

.closing {
  background: var(--color-ink);
  color: var(--color-paper);
  border-top: 0;
}

.closing p {
  margin-top: var(--space-sm);
  max-width: var(--text-width);
  color: var(--color-on-ink-muted);
  font-size: 1.25rem;
}

.closing .closing-note {
  font-size: 1rem;
}

.closing a {
  color: var(--color-on-ink-accent);
}

.closing a:hover,
.closing a:active {
  color: var(--color-paper);
}

.closing :focus-visible {
  outline-color: var(--color-on-ink-accent);
}

.closing .button {
  margin-top: var(--space-md);
  background: var(--color-paper);
  color: var(--color-ink);
}

.closing .button:hover {
  background: var(--color-accent-tint);
  color: var(--color-ink);
}

.closing .button:active {
  background: var(--color-rule);
  color: var(--color-ink);
}

/* Footer */

.site-footer {
  padding: var(--space-md) 0 var(--space-lg);
  border-top: 1px solid var(--color-rule);
  color: var(--color-ink-muted);
  font-size: 1rem;
}

.site-footer .wrap {
  display: grid;
  gap: var(--space-sm);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.5rem;
  margin: 0 0 0 -0.5rem;
  padding: 0;
  list-style: none;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 0.5rem;
}

/* Plain pages: privacy, support, not found */

.page {
  padding: var(--space-lg) 0;
}

.page .wrap {
  max-width: 46rem;
}

.page h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
}

.page h2 {
  margin-top: var(--space-lg);
  font-size: 1.75rem;
  letter-spacing: -0.01em;
}

.page p,
.page ul,
.page ol {
  margin-top: var(--space-sm);
}

.page ul,
.page ol {
  padding-left: 1.25rem;
}

.page li + li {
  margin-top: 0.5rem;
}

.page .lede {
  margin-top: var(--space-sm);
  max-width: none;
}

.page .meta {
  color: var(--color-ink-muted);
  font-size: 1rem;
}

.contact {
  margin-top: var(--space-md);
  padding: var(--space-md);
  border: 1px solid var(--color-rule);
  border-radius: var(--radius);
  background: var(--color-card);
}

.contact p:first-child {
  margin-top: 0;
}

.contact .contact-address {
  color: var(--color-ink-muted);
  font-size: 1rem;
  overflow-wrap: anywhere;
  user-select: all;
}

.button {
  display: inline-flex;
  align-items: center;
  min-height: 3.25rem;
  margin-top: var(--space-sm);
  padding: 0 1.5rem;
  border-radius: 999px;
  background: var(--color-accent);
  color: var(--color-on-accent);
  font-weight: 700;
  text-decoration: none;
  transition: background-color var(--duration-fast) ease, transform var(--duration-fast) ease;
}

button.button {
  border: 0;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.button:disabled {
  background: var(--color-rule);
  color: var(--color-ink-muted);
  cursor: default;
  transform: none;
}

.button:hover {
  background: var(--color-accent-dark);
  color: var(--color-on-accent);
}

.button:active {
  background: var(--color-ink);
  color: var(--color-on-accent);
  transform: scale(0.98);
}

/* Sign-up form */

.signup {
  margin-top: var(--space-md);
  max-width: 30rem;
}

.field label {
  display: block;
  font-weight: 700;
}

.field input {
  display: block;
  width: 100%;
  min-height: 3.25rem;
  margin-top: 0.5rem;
  padding: 0 1rem;
  border: 1px solid var(--color-ink-muted);
  border-radius: 0.75rem;
  background: var(--color-card);
  color: var(--color-ink);
  font: inherit;
}

.field input:hover {
  border-color: var(--color-ink);
}

.field input[aria-invalid='true'] {
  border-color: var(--color-debit);
  border-width: 2px;
}

.page .field-error,
.page .form-status {
  margin-top: 0.5rem;
  font-size: 1rem;
  font-weight: 500;
}

.field-error,
.form-status.is-error {
  color: var(--color-debit);
}

.form-status:empty {
  display: none;
}

.cf-turnstile {
  margin-top: var(--space-sm);
  min-height: 65px;
}

/* Off screen, not display none, so programs that fill every field still see it. */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.contact:focus {
  outline: none;
}

.contact h2 {
  margin-top: 0;
}

[hidden] {
  display: none !important;
}

/* Reveal on scroll. Only applies once the script has marked the page. */

.js .reveal {
  opacity: 0;
  transform: translateY(1.5rem);
  transition: opacity var(--duration-slow) ease, transform var(--duration-slow) var(--ease-out-expo);
}

.js .reveal.visible {
  opacity: 1;
  transform: none;
}

@media (min-width: 480px) {
  .hero-facts {
    display: flex;
    flex-wrap: wrap;
  }
}

@media (min-width: 640px) {
  .nav .nav-wide {
    display: block;
  }
}

@media (min-width: 768px) {
  :root {
    --gutter: 2rem;
  }

  .section {
    padding: var(--space-xl) 0;
  }

  .safety-grid {
    grid-template-columns: 1.2fr 1fr;
    gap: var(--space-lg);
    align-items: start;
  }

  .ledger {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: var(--space-lg);
  }

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

  .price {
    padding: 2.5rem;
  }

  .screens {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
  }

  .switching-grid {
    grid-template-columns: 1.2fr 1fr;
    align-items: center;
  }

  .safety-shot {
    position: sticky;
    top: 6.5rem;
  }

  .site-footer .wrap {
    grid-template-columns: 1fr auto;
    align-items: center;
  }
}

@media (min-width: 1024px) {
  .hero {
    padding-top: var(--space-xl);
  }

  .hero .wrap {
    grid-template-columns: 1.35fr 1fr;
    align-items: end;
    gap: var(--space-lg);
  }

  .hero-copy {
    padding-bottom: var(--space-xl);
  }

  .hero-shot {
    justify-self: end;
    width: min(100%, 23rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition-property: opacity, color, background-color, border-color !important;
    transition-duration: 200ms !important;
  }

  html {
    scroll-behavior: auto;
  }

  .js .reveal {
    transform: none;
  }
}
