/* Whenabouts: the app's Almanac look. Paper and ink, serif names and numbers, small capitals for labels,
   one vermilion accent. System fonts only, no external requests. Colours are the app's own (Palette.swift). */
:root {
  color-scheme: light dark;
  --bg: #F5F0E6;
  --text: #1D1A16;
  --muted: #6B6253;
  --accent: #C2412D;
  --rule: rgb(29 26 22 / 16%);
  --strong-rule: #1D1A16;
  --serif: ui-serif, 'New York', 'Iowan Old Style', Georgia, serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --wrap: 1040px;
  --gut: 20px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1D1A16;
    --text: #F5F0E6;
    --muted: #A89F8F;
    --accent: #E0614A;
    --rule: rgb(245 240 230 / 16%);
    --strong-rule: #F5F0E6;
  }
}

* {
  box-sizing: border-box;
  margin: 0;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

a {
  color: var(--accent);
  text-underline-offset: 0.18em;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

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

.wrap {
  width: min(100% - 2 * var(--gut), var(--wrap));
  margin-inline: auto;
}

/* Small capitals, as the app sets its labels. */
.label {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Header */
.site-header {
  border-bottom: 1.5px solid var(--strong-rule);
}

.bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 24px;
  min-height: 72px;
  padding-block: 10px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--text);
  /* The name is the logo: on a narrow screen with very large text it stops growing rather than run off the edge. */
  font-size: min(1.375rem, 7.5vw);
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand img {
  width: 36px;
  height: 36px;
  border-radius: 9px;
}

.site-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 20px;
}

.site-header nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 0.9375rem;
  text-decoration: none;
}

.site-header nav a:hover,
.site-header nav a[aria-current='page'] {
  color: var(--accent);
}

/* Hero: what the app does, beside the ledger it keeps. */
.hero {
  padding-block: 56px 48px;
}

.hero .wrap {
  display: grid;
  gap: 48px;
  align-items: start;
}

.hero h1 {
  font-size: clamp(2.125rem, 1.3rem + 2.4vw, 3rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

/* Each sentence starts its own line; a narrow screen wraps within it. */
.hero h1 span {
  display: block;
}

.hero .lede {
  margin-top: 20px;
  max-width: 34rem;
  font-size: 1.1875rem;
}

.hero .status {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 18px;
}

.hero .status .label {
  color: var(--accent);
}

.hero .status p:last-child {
  color: var(--muted);
  font-size: 0.9375rem;
}

/* The ledger: a few rows of the app's list, set in type. */
.ledger {
  border-top: 1.5px solid var(--strong-rule);
}

.ledger .label {
  padding-block: 14px 4px;
}

.ledger ol {
  list-style: none;
  padding: 0;
}

/* The number and the name side by side; with very large text the name drops under the number. */
.ledger li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 16px;
  padding-block: 12px;
  border-bottom: 1px solid var(--rule);
}

.ledger .count {
  flex: 0 0 6.5rem;
}

.ledger .name {
  flex: 1 1 7rem;
  min-width: 0;
}

.ledger .count {
  white-space: nowrap;
  font-size: 2.75rem;
  font-weight: 500;
  line-height: 1;
  font-variant-numeric: lining-nums;
}

.ledger .count small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.875rem;
  font-style: italic;
  font-weight: 400;
}

.ledger .count--today {
  color: var(--accent);
  font-size: 1.875rem;
  font-weight: 600;
}

.ledger .name {
  display: block;
  font-size: 1.1875rem;
  font-weight: 600;
  line-height: 1.3;
}

/* Sections */
.section {
  padding-block: 56px;
  border-top: 1px solid var(--rule);
}

.section h2 {
  font-size: clamp(1.625rem, 1.3rem + 1.2vw, 2.125rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.section-lead {
  margin-top: 10px;
  max-width: 38rem;
  color: var(--muted);
}

.shots {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(10px, 3vw, 28px);
  margin-top: 32px;
}

.shots figure {
  display: grid;
  gap: 10px;
}

.shots img {
  border-radius: 22px;
  border: 1px solid var(--rule);
}

.shots figcaption {
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.4;
}

/* What it does: rows of the ledger again, a name and a sentence. */
.features {
  margin-top: 28px;
  display: grid;
  column-gap: 40px;
}

.features div {
  display: grid;
  gap: 4px;
  padding-block: 16px;
  border-top: 1px solid var(--rule);
}

.features dt {
  font-size: 1.1875rem;
  font-weight: 600;
}

.features dd {
  color: var(--text);
  max-width: 34rem;
}

.pro {
  color: var(--accent);
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Free and Pro */
.plans {
  display: grid;
  gap: 24px;
  margin-top: 28px;
}

.plan {
  padding-top: 16px;
  border-top: 1.5px solid var(--strong-rule);
}

.plan--pro {
  border-top-color: var(--accent);
}

.plan h3 {
  font-size: 1.375rem;
  font-weight: 700;
}

.plan .price {
  margin-top: 2px;
  color: var(--muted);
}

.plan ul {
  margin-top: 14px;
  padding-left: 1.1em;
}

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

.note {
  margin-top: 24px;
  max-width: 40rem;
  color: var(--muted);
}

/* Long pages: privacy, terms, FAQ */
.doc {
  padding-block: 48px 64px;
}

.prose {
  max-width: 44rem;
}

.prose h1 {
  font-size: clamp(2rem, 1.6rem + 2vw, 2.75rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.015em;
}

.prose .updated {
  margin-top: 10px;
}

.prose .intro {
  margin-top: 18px;
  font-size: 1.1875rem;
}

.prose h2 {
  margin-top: 40px;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.25;
}

.prose h3 {
  margin-top: 26px;
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.3;
}

.prose p,
.prose ul,
.prose ol {
  margin-top: 10px;
}

.prose ul,
.prose ol {
  padding-left: 1.2em;
}

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

.callout {
  margin-top: 40px;
  padding: 16px 18px;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
}

/* Footer */
.site-footer {
  padding-block: 28px 40px;
  border-top: 1.5px solid var(--strong-rule);
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.875rem;
}

.site-footer .wrap {
  display: grid;
  gap: 12px;
}

.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 20px;
  list-style: none;
  padding: 0;
}

.site-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--text);
}

@media (min-width: 760px) {
  .hero .wrap {
    grid-template-columns: 1.15fr 1fr;
    gap: 64px;
  }

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

  .plans {
    grid-template-columns: 1fr 1fr;
    gap: 40px;
  }
}

@media (max-width: 420px) {
  .ledger .count {
    flex-basis: 5.25rem;
  }

  .ledger .count {
    font-size: 2.25rem;
  }

  .ledger .count--today {
    font-size: 1.5rem;
  }

  .shots {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .shots figcaption {
    font-size: 0.75rem;
  }
}
