/*
 * Life Ledger landing page.
 * Colours, radii and type follow the app's own tokens (src/theme/tokens.ts):
 * warm paper, dark ink, moss for what was kept, honey for goals, rust for lapses.
 */

:root {
  --paper: #F5F0E8;
  --paper-deep: #ECE5D9;
  --card: #FBF8F2;
  --line: #E2D9CB;
  --line-strong: #CBBFAD;
  --ink: #1F1B16;
  --ink-soft: #5B544B;
  --ink-muted: #8C8478;
  --ink-faint: #B7AE9F;
  --moss: #2F5D50;
  --moss-soft: #DCE7E1;
  --rust: #B2542F;
  --rust-soft: #F3DED3;
  --honey: #C9A24A;

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --float: 0 8px 18px rgba(58, 46, 31, 0.08);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ---------- Base ---------- */

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

* {
  margin: 0;
}

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

body {
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

i,
b {
  font-style: normal;
  font-weight: inherit;
}

::selection {
  background: var(--moss-soft);
}

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

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 1em;
  height: 1em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.skip {
  position: absolute;
  left: 16px;
  top: -64px;
  z-index: 10;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 500;
  text-decoration: none;
}

.skip:focus {
  top: 16px;
}

.wrap {
  width: 100%;
  max-width: 1168px;
  margin-inline: auto;
  padding-inline: clamp(20px, 5vw, 48px);
}

/* ---------- Type ---------- */

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 500;
  text-wrap: balance;
}

/* Sized so the headline's second line always fits its column on one line. */
h1 {
  font-size: clamp(40px, 11.5vw, 84px);
  line-height: 1.02;
  letter-spacing: -0.025em;
}

@media (min-width: 960px) {
  h1 {
    font-size: clamp(52px, 5.6vw, 84px);
  }
}

h2 {
  font-size: clamp(34px, 4.6vw, 56px);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.lead {
  max-width: 34em;
  color: var(--ink-soft);
  font-size: clamp(18px, 1.5vw, 20px);
  line-height: 1.55;
}

.fine {
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.5;
}

/* ---------- Buttons and links ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 24px;
  border: 0;
  border-radius: 999px;
  font: 500 16px/1 var(--sans);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease-out, background-color 0.15s ease-out;
}

.btn:active {
  transform: scale(0.97);
}

.btn:focus-visible {
  border-radius: 999px;
}

.btn--primary {
  background: var(--ink);
  color: var(--paper);
}

.btn--primary:hover {
  background: #37302A;
}

.btn--secondary {
  background: var(--paper-deep);
  color: var(--ink);
}

.btn--secondary:hover {
  background: #E3DACB;
}

.btn--small {
  min-height: 44px;
  padding: 0 18px;
  font-size: 15px;
}

.link {
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 6px;
  transition: text-decoration-color 0.15s ease-out;
}

.link:hover {
  text-decoration-color: var(--ink);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 28px;
}

.actions--center {
  justify-content: center;
}

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

.site-header {
  padding-block: 20px;
}

.site-header__row {
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 500 21px/1 var(--serif);
  letter-spacing: -0.2px;
  text-decoration: none;
}

.site-nav {
  display: none;
  gap: 28px;
  margin-left: auto;
}

.site-nav a {
  color: var(--ink-soft);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s ease-out;
}

.site-nav a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 6px;
}

.site-header__cta {
  margin-left: auto;
}

@media (max-width: 419px) {
  .site-header__cta {
    display: none;
  }
}

@media (min-width: 900px) {
  .site-nav {
    display: flex;
  }

  .site-header__cta {
    margin-left: 8px;
  }
}

/* ---------- Hero ---------- */

.hero {
  padding-block: clamp(28px, 5vw, 64px) clamp(72px, 10vw, 128px);
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 56px;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-soft);
  font: 600 14px/1.2 var(--sans);
}

/* Tally marks, the app's way of counting: two inked, one still open. */
.status__marks {
  display: inline-flex;
  gap: 3px;
}

.status__marks i {
  width: 12px;
  height: 6px;
  border-radius: 999px;
  background: var(--line-strong);
}

.status__marks i.on {
  background: var(--moss);
}

.hero h1 {
  margin: 20px 0 24px;
}

.hero__second {
  display: block;
  color: var(--moss);
  font-style: italic;
  font-weight: 400;
}

.hero .actions {
  margin-top: 32px;
}

.hero .fine {
  margin-top: 16px;
}

.hero__preview {
  display: flex;
  justify-content: center;
}

@media (min-width: 960px) {
  .hero__grid {
    grid-template-columns: minmax(0, 1fr) 376px;
    align-items: center;
    gap: clamp(48px, 7vw, 112px);
  }
}

/* ---------- Sections ---------- */

.section {
  padding-block: clamp(72px, 10vw, 136px);
}

.section--deep {
  background: var(--paper-deep);
}

.section__head {
  margin-bottom: clamp(40px, 6vw, 72px);
}

.section__head h2 {
  max-width: 16em;
}

.section__head .lead {
  margin-top: 20px;
}

/* ---------- 2. Goals and commitments: a ledger with a margin ---------- */

.ledger {
  border-top: 1px solid var(--line-strong);
}

.entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  padding-block: 36px;
  border-bottom: 1px solid var(--line);
}

.entry__name {
  font-size: 26px;
  line-height: 32px;
  letter-spacing: -0.3px;
}

.entry__text {
  max-width: 30em;
  color: var(--ink-soft);
  font-size: 18px;
}

.entry__specimen {
  max-width: 400px;
  margin-top: 12px;
}

/* Tablets: words on the left, the specimen on the right. */
@media (min-width: 760px) and (max-width: 959px) {
  .entry {
    grid-template-columns: minmax(0, 1fr) minmax(0, 400px);
    grid-template-rows: auto 1fr;
    align-items: start;
    column-gap: 48px;
  }

  .entry__name,
  .entry__text {
    grid-column: 1;
  }

  .entry__specimen {
    grid-column: 2;
    grid-row: 1 / span 2;
    margin-top: 0;
  }
}

@media (min-width: 960px) {
  .entry {
    grid-template-columns: 200px minmax(0, 1fr) 360px;
    align-items: start;
    column-gap: 48px;
    padding-block: 48px;
  }

  .entry__specimen {
    margin-top: 0;
  }
}

/* ---------- App mock: the app's own components, redrawn ---------- */

.app {
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: var(--ink);
  font: 400 16px/23px var(--sans);
  text-align: left;
}

.cap {
  color: var(--ink-muted);
  font-size: 13px;
  line-height: 18px;
}

.strong {
  font-weight: 500;
}

.label {
  color: var(--ink-muted);
  font: 600 13px/18px var(--sans);
  letter-spacing: 0.1px;
}

.icon--moss {
  color: var(--moss);
}

.icon--muted {
  color: var(--ink-muted);
}

/* Cover: the ink card at the head of every page. */
.cover {
  padding: 12px 16px 16px;
  border-radius: 22px;
  background: var(--ink);
  color: var(--paper);
}

.cover--home {
  padding-bottom: 8px;
}

.cover .cap {
  color: var(--ink-faint);
}

.cover__head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.cover__words {
  flex: 1;
  min-width: 0;
}

.cover__title {
  font: 500 34px/40px var(--serif);
  letter-spacing: -0.4px;
}

.cover__sub {
  color: var(--ink-faint);
}

.cover__rule {
  height: 1px;
  margin: 12px 0;
  background: var(--ink-soft);
}

.cover--home .cover__rule {
  margin-bottom: 4px;
}

.avatar,
.ring {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--ink-muted);
  border-radius: 50%;
  color: var(--paper);
}

.avatar {
  font: italic 400 16px/1 var(--serif);
  text-transform: uppercase;
}

.ring .icon {
  width: 20px;
  height: 20px;
}

.gauges {
  display: flex;
  gap: 24px;
  margin-top: 12px;
}

.gauge {
  flex: 1;
  min-width: 0;
}

.gauge .cap {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.figure {
  font: 500 26px/32px var(--serif);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.figure span {
  color: var(--ink-muted);
}

.figure--in {
  color: var(--moss-soft);
}

.display {
  margin-top: 8px;
  font: 500 44px/52px var(--serif);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.8px;
}

.marks {
  display: flex;
  align-items: flex-end;
  height: 18px;
  margin: 4px 0;
}

/* Tally marks: one short pill per thing counted, inked as each is done. */
.tally {
  display: flex;
  gap: 3px;
  width: 100%;
  height: 6px;
}

.tally i {
  flex: 1;
  border-radius: 999px;
  background: var(--track);
}

.tally i.on {
  background: var(--inked);
}

.tally--meals {
  --track: var(--ink-soft);
  --inked: var(--moss-soft);
}

.tally--tasks {
  --track: var(--paper-deep);
  --inked: var(--moss);
  margin: 12px 0 8px;
}

.tally--steps {
  --track: var(--paper-deep);
  --inked: var(--honey);
  height: 8px;
  margin-top: 10px;
}

/* A week of spending as seven bars: today in paper, days to come as stubs. */
.bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  width: 100%;
  max-width: 112px;
  height: 18px;
}

.bars > i {
  flex: 1;
  height: max(3px, calc(var(--h, 0) * 1%));
  border-radius: 2px;
  background: var(--ink-muted);
}

.bars > i.today {
  background: var(--paper);
}

.bars > i.ahead {
  height: 3px;
  background: var(--ink-soft);
}

.bars--large {
  max-width: none;
  height: auto;
  margin-top: 12px;
}

.bars--large > span {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: flex-end;
  height: 62px;
}

.bars--large > span > i {
  height: max(3px, calc(var(--h, 0) * 0.44px));
  border-radius: 2px;
  background: var(--ink-muted);
}

.bars--large b,
.col b,
.fooddays b {
  margin-top: 4px;
  color: var(--ink-muted);
  font: 400 11px/14px var(--sans);
  text-align: center;
}

.bars--large .is-today > i {
  background: var(--paper);
}

.bars--large .is-ahead > i {
  background: var(--ink-soft);
}

.bars--large .is-today b,
.col--today b,
.fooddays .is-today b {
  color: var(--paper);
}

/* Goal bar: ten gilt marks kept by hand, between a minus and a plus. */
.goal-head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 32px;
}

.goal-head > span:first-child {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.goal-head__figure {
  color: var(--honey);
  font: 500 19px/24px var(--serif);
  font-variant-numeric: tabular-nums;
}

.goalbar {
  --track: var(--paper-deep);
  display: flex;
  align-items: center;
  gap: 12px;
}

.goalbar--ink {
  --track: var(--ink-soft);
}

.goalbar__marks {
  display: flex;
  flex: 1;
  align-items: center;
  height: 32px;
}

.goalbar__marks i {
  flex: 1;
  height: 8px;
  margin: 0 1.5px;
  border-radius: 999px;
  background: var(--track);
}

.goalbar__marks i.on {
  background: var(--honey);
}

.nudge {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--paper-deep);
}

.nudge .icon {
  width: 16px;
  height: 16px;
}

.goalbar--ink .nudge {
  border: 1px solid var(--ink-muted);
  background: none;
  color: var(--paper);
}

/* Cards: card stock under the cover, one column. */
.card {
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--card);
}

.card--today {
  padding: 16px 16px 8px;
}

.card__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  min-height: 24px;
  padding-bottom: 4px;
}

.card--today .card__head {
  padding-bottom: 0;
}

.card__name {
  font: 500 19px/24px var(--serif);
}

.card__title {
  font: 500 21px/28px var(--serif);
}

.card__rule {
  height: 1px;
  margin: 14px 0 12px;
  background: var(--line);
}

.card .goalbar {
  margin-top: 4px;
}

/* Rows: a mark, the words, and the time at the row's end. */
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding-block: 6px;
}

.row__title {
  flex: 1;
  min-width: 0;
}

/* Home keeps each task to one line; the other lists let a title wrap. */
.card--today .row {
  padding-block: 0;
}

.card--today .row__title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.row__tag {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-muted);
  font-size: 13px;
  line-height: 18px;
}

.row__tag .icon {
  width: 12px;
  height: 12px;
  color: var(--honey);
}

.row__end {
  color: var(--ink-muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  line-height: 18px;
  white-space: nowrap;
}

.row--done .row__title {
  color: var(--ink-muted);
  text-decoration: line-through;
}

.row--add .row__title {
  color: var(--ink-faint);
}

/* Things you finish are ticked in squares. */
.tick {
  display: grid;
  place-items: center;
  flex: none;
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--line-strong);
  border-radius: 6px;
}

.tick--done {
  border-color: var(--moss);
  background: var(--moss);
  color: var(--paper);
}

.tick .icon,
.check .icon {
  width: 14px;
  height: 14px;
  stroke-width: 2.5;
}

.plus {
  display: grid;
  place-items: center;
  flex: none;
  width: 22px;
  height: 22px;
  color: var(--ink-muted);
}

.plus .icon {
  width: 18px;
  height: 18px;
}

.plus--moss {
  color: var(--moss);
}

.quickadd {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0 8px;
}

.quickadd__field {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  padding-bottom: 6px;
  border-bottom: 1.5px solid var(--moss);
}

.quickadd__preview {
  color: var(--moss);
  font-size: 13px;
  line-height: 18px;
}

.quickadd__submit {
  display: grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--moss);
  color: var(--paper);
}

.quickadd__submit .icon {
  width: 16px;
  height: 16px;
}

.meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
}

.meta-row > .icon {
  width: 16px;
  height: 16px;
}

.meta-row__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.meta-row__link {
  color: var(--moss);
  font-size: 13px;
}

.toggle {
  position: relative;
  flex: none;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: var(--line-strong);
}

.toggle::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
}

.toggle.is-on {
  background: var(--moss);
}

.toggle.is-on::after {
  left: 21px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 4px;
}

.chip {
  height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--paper-deep);
  color: var(--ink-soft);
  font: 500 14px/36px var(--sans);
  white-space: nowrap;
}

.chip.is-on {
  background: var(--ink);
  color: var(--paper);
}

/* Commitments: a square a day, rust where a lapse was recorded. */
.commit__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.lapse {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--rust-soft);
  color: var(--rust);
}

.lapse .icon {
  width: 18px;
  height: 18px;
}

.rhythm {
  display: flex;
  justify-content: space-between;
  gap: 3px;
  margin: 8px 0 4px;
}

.day {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  max-width: 18px;
}

.day i {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 5px;
  background: var(--moss-soft);
}

.day i.lapsed {
  background: var(--rust);
  color: var(--paper);
}

.day i .icon {
  width: 10px;
  height: 10px;
  stroke-width: 3;
}

.day b {
  color: var(--ink-muted);
  font: 400 10px/14px var(--sans);
}

.day--today i {
  box-shadow: inset 0 0 0 1.5px var(--ink);
}

.day--today b {
  color: var(--ink);
  font-weight: 500;
}

/* Plans cover: the section switch, then the next seven days. */
.segments {
  display: flex;
  margin-top: 12px;
  padding: 2px;
  border: 1px solid var(--ink-soft);
  border-radius: 999px;
}

.segments span {
  flex: 1 1 auto;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--ink-faint);
  font: 500 14px/28px var(--sans);
  text-align: center;
  white-space: nowrap;
}

.segments .is-on {
  background: var(--paper);
  color: var(--ink);
}

.summary {
  display: flex;
  align-items: flex-end;
  gap: 24px;
  margin-top: 16px;
}

.summary__reading {
  flex: none;
}

.week {
  display: flex;
  flex: 1;
  align-items: flex-end;
  gap: 4px;
  min-width: 0;
}

.col {
  display: flex;
  flex: 1;
  flex-direction: column;
}

.stack {
  display: flex;
  flex-direction: column-reverse;
  gap: 3px;
  height: 32px;
}

.stack i {
  height: 4px;
  border-radius: 999px;
  background: var(--ink-muted);
}

.col--today .stack i {
  background: var(--paper);
}

.col--none .stack i {
  background: var(--ink-soft);
}

/* Food cover: three slots for today, then a mark per meal for the week. */
.slots {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.slot {
  flex: 1;
  min-width: 0;
}

.slot i {
  display: block;
  height: 6px;
  margin-bottom: 8px;
  border-radius: 999px;
  background: var(--ink-soft);
}

.slot .strong {
  color: var(--ink-faint);
}

.cover .slot .cap {
  color: var(--ink-muted);
}

.slot.is-in i {
  background: var(--moss-soft);
}

.slot.is-in .strong {
  color: var(--paper);
}

.cover .slot.is-in .cap {
  color: var(--ink-faint);
}

.foodweek {
  display: flex;
  align-items: flex-end;
  gap: 24px;
}

.fooddays {
  display: flex;
  flex: 1;
  gap: 4px;
  min-width: 0;
}

.fooddays span {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 3px;
}

.fooddays i {
  height: 4px;
  border-radius: 999px;
  background: var(--ink-soft);
}

.fooddays i.in {
  background: var(--moss-soft);
}

.fooddays b {
  margin-top: 1px;
}

.mrow {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
}

.mrow__margin {
  flex: none;
  width: 78px;
  color: var(--ink-muted);
  font-size: 13px;
}

/* Finance rows: a ringed badge in the category's colour, amount at the end. */
.txrow {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
}

.txrow__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.txrow__amount {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  white-space: nowrap;
}

.txrow__amount--in {
  color: var(--moss);
}

.badge {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border: 1.5px solid var(--c);
  border-radius: 50%;
  background: var(--card);
  color: var(--c);
}

.badge .icon {
  width: 16px;
  height: 16px;
}

.choice {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  margin-top: 4px;
}

/* Dialogs float: paper, a hairline border, one soft shadow. */
.dialog {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--paper);
  box-shadow: var(--float);
}

.dialog__title {
  font: 500 19px/24px var(--serif);
}

.dialog .dialog__title + .cap {
  margin-top: 4px;
}

.composer {
  min-height: 128px;
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid var(--moss);
  border-radius: 22px;
  background: var(--card);
  font: 500 24px/32px var(--serif);
}

.composer::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 26px;
  margin-left: 3px;
  background: var(--moss);
  vertical-align: -5px;
}

.dialog__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.dialog__actions .pill {
  flex: 1;
}

.dialog__stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 24px;
}

.pill {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 24px;
  border-radius: 999px;
  font-weight: 500;
}

.pill--primary {
  background: var(--ink);
  color: var(--paper);
}

.pill--ghost {
  color: var(--ink-soft);
}

.iconbtn {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
}

.iconbtn .icon {
  width: 20px;
  height: 20px;
}

.review {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--card);
}

.review__head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.review__head > .icon {
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

.review__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.review .chips {
  margin: 16px 0 8px;
}

.check {
  display: grid;
  place-items: center;
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--moss);
  color: var(--paper);
}

.notif {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--card);
  box-shadow: var(--float);
}

.notif__body {
  flex: 1;
  min-width: 0;
}

.notif__app {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink-muted);
  font-size: 13px;
  line-height: 18px;
}

/* Tab bar: a floating capsule; the active tab opens into an ink pill. */
.tabbar {
  display: flex;
  align-items: stretch;
  min-height: 72px;
  padding: 8px 4px;
  border: 1px solid var(--line);
  border-radius: 36px;
  background: var(--card);
  box-shadow: var(--float);
}

.tab {
  display: flex;
  flex: 1 1 0;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 56px;
  border-radius: 999px;
  color: var(--ink-muted);
  transition: flex-grow 0.35s var(--ease), background-color 0.35s var(--ease), color 0.35s var(--ease);
}

.tab .icon {
  width: 20px;
  height: 20px;
  margin: 10px;
}

.tab__label {
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  font: 500 14px/18px var(--sans);
  white-space: nowrap;
  transition: max-width 0.35s var(--ease), opacity 0.35s var(--ease);
}

.tab.is-active {
  flex-grow: 2.6;
  background: var(--ink);
  color: var(--paper);
}

.tab.is-active .tab__label {
  max-width: 110px;
  padding-right: 10px;
  opacity: 1;
}

.spark-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 52px;
  padding: 0 24px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font: 500 16px/1 var(--sans);
  box-shadow: var(--float);
}

.spark-pill .icon {
  width: 20px;
  height: 20px;
}

/* ---------- Phone ---------- */

.phone {
  width: min(100%, 376px);
  padding: 10px;
  border-radius: 46px;
  background: var(--ink);
  box-shadow: 0 30px 60px -32px rgba(58, 46, 31, 0.55), var(--float);
}

.phone__screen {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 44px 16px 168px;
  border-radius: 36px;
  background: var(--paper);
}

.phone__screen::before,
.device::before {
  content: "";
  position: absolute;
  top: 16px;
  left: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ink);
  transform: translateX(-50%);
}

.phone__dock {
  position: absolute;
  right: 28px;
  bottom: 16px;
  left: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.phone__dock .tabbar {
  align-self: stretch;
}

/* ---------- 3. Four pages, one ledger ---------- */

.device {
  display: none;
}

.page + .page {
  margin-top: 64px;
}

.page__note h3 {
  font-size: clamp(28px, 3vw, 36px);
  line-height: 1.15;
  letter-spacing: -0.4px;
}

.page__note p {
  max-width: 28em;
  margin-top: 12px;
  color: var(--ink-soft);
  font-size: 18px;
}

.page__aside {
  max-width: 400px;
  margin-top: 24px;
}

/* Stacked layout (phones, and any browser without the script): each page is its own panel. */
.page__screen {
  max-width: 400px;
  margin-top: 24px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--paper);
}

/* Tablets: words on the left, the page's screen on the right. */
@media (min-width: 760px) {
  .page {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 400px);
    align-items: start;
    column-gap: 48px;
  }

  .page__screen {
    margin-top: 0;
  }
}

/* Desk layout: one phone stays in view and turns to the page being read. */
@media (min-width: 960px) {
  .js .pages {
    --device-h: min(748px, calc(100vh - 48px));
    --device-top: calc((100vh - var(--device-h)) / 2);
    display: grid;
    grid-template-columns: minmax(0, 1fr) 376px;
    column-gap: clamp(56px, 9vw, 136px);
  }

  .js .page {
    display: contents;
  }

  .js .page__note {
    display: flex;
    flex-direction: column;
    grid-column: 1;
    justify-content: center;
    min-height: 68vh;
    padding-block: 32px;
  }

  /* The first and last notes are as tall as the phone, so it is whole and in place beside both. */
  .js .device + .page .page__note,
  .js .page:last-child .page__note {
    min-height: var(--device-h);
  }

  .js .page__note h3 {
    color: var(--ink-soft);
    transition: color 0.3s ease-out;
  }

  .js .page.is-active .page__note h3 {
    color: var(--ink);
  }

  .js .device,
  .js .page__screen {
    position: sticky;
    grid-column: 2;
    grid-row: 1 / span 4;
    align-self: start;
  }

  .js .device {
    top: var(--device-top);
    z-index: 3;
    display: block;
    height: var(--device-h);
    border: 10px solid var(--ink);
    border-radius: 46px;
    box-shadow: 0 30px 60px -32px rgba(58, 46, 31, 0.55), var(--float);
    pointer-events: none;
  }

  .js .device::before {
    top: 16px;
  }

  .js .device .tabbar {
    position: absolute;
    right: 18px;
    bottom: 16px;
    left: 18px;
  }

  /* The outgoing page stays put until the incoming one has faded in over it. */
  .js .page__screen {
    top: calc(var(--device-top) + 10px);
    z-index: 1;
    visibility: hidden;
    overflow: hidden;
    max-width: none;
    height: calc(var(--device-h) - 20px);
    margin: 10px;
    padding: 44px 16px 0;
    border: 0;
    border-radius: 36px;
    opacity: 0;
    transition: opacity 0s linear 0.3s, visibility 0s linear 0.3s;
  }

  .js .page.is-active .page__screen {
    z-index: 2;
    visibility: visible;
    opacity: 1;
    transition: opacity 0.3s ease-out;
  }
}

/* ---------- 4. Spark ---------- */

.steps {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 56px;
  padding: 0;
  list-style: none;
}

.step h3 {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 24px;
  line-height: 30px;
  letter-spacing: -0.2px;
}

.step__n {
  color: var(--moss);
  font-style: italic;
  font-weight: 400;
}

.step > p {
  max-width: 30em;
  margin: 8px 0 24px;
  color: var(--ink-soft);
}

.step .app {
  max-width: 400px;
}

/* Tablets: each step is a ledger row, words on the left and the screen on the right. */
@media (min-width: 760px) and (max-width: 1099px) {
  .step {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 400px);
    grid-template-rows: auto 1fr;
    align-items: start;
    column-gap: 48px;
  }

  .step h3,
  .step > p {
    grid-column: 1;
  }

  .step .app {
    grid-column: 2;
    grid-row: 1 / span 2;
  }
}

/* Desks: the three steps side by side, with their screens starting on one line. */
@media (min-width: 1100px) {
  .steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: auto auto auto;
    gap: 0 32px;
  }

  .step {
    display: grid;
    grid-row: span 3;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: subgrid;
  }
}

.facts {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px 48px;
  margin-top: clamp(56px, 8vw, 104px);
  padding-top: 36px;
  border-top: 1px solid var(--line-strong);
}

.facts__title {
  font-size: 26px;
  line-height: 32px;
  letter-spacing: -0.3px;
}

.facts__list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px 48px;
}

.facts__list dt {
  font-weight: 600;
}

.facts__list dd {
  margin-top: 4px;
  color: var(--ink-soft);
}

@media (min-width: 640px) {
  .facts__list {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 960px) {
  .facts {
    grid-template-columns: 200px minmax(0, 1fr);
  }
}

/* ---------- 5. Invitation: a bookplate, the one framed thing on the page ---------- */

.section--invite {
  padding-top: 0;
}

.bookplate {
  position: relative;
  max-width: 760px;
  margin-inline: auto;
  padding: clamp(40px, 7vw, 72px) clamp(24px, 6vw, 72px);
  border: 2px solid var(--line-strong);
  border-radius: 28px;
  background: var(--card);
  text-align: center;
}

.bookplate::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid var(--line);
  border-radius: 20px;
  pointer-events: none;
}

.bookplate__seal {
  margin: 0 auto 20px;
}

.bookplate h2 {
  font-size: clamp(32px, 4.2vw, 48px);
}

.bookplate .lead {
  margin: 20px auto 0;
}

.bookplate__email {
  margin: 28px 0 24px;
  font: italic 400 clamp(22px, 3vw, 28px)/1.2 var(--serif);
  overflow-wrap: anywhere;
}

.bookplate__email a {
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 6px;
}

.bookplate__email a:hover {
  text-decoration-color: var(--ink);
}

.bookplate .lead + .actions {
  margin-top: 28px;
}

.bookplate .fine {
  margin-top: 16px;
}

.bookplate .fine:empty {
  display: none;
}

[data-copy] {
  display: none;
}

.js [data-copy] {
  display: inline-flex;
}

/* ---------- 6. Footer ---------- */

.site-footer {
  padding-block: 28px 40px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 15px;
}

.site-footer__row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 32px;
}

.site-footer__row {
  align-items: flex-start;
}

.site-footer__details p + p,
.site-footer__meta p {
  margin-top: 4px;
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 24px;
}

/* ---------- Pricing ---------- */

.plans {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.plan {
  display: flex;
  flex-direction: column;
  padding: 28px 24px 24px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--card);
}

.plan__name {
  font-size: 21px;
  line-height: 28px;
}

.plan__price {
  margin-top: 12px;
  font: 500 40px/1.1 var(--serif);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.6px;
}

.plan__price span {
  color: var(--ink-muted);
  font-size: 21px;
  letter-spacing: 0;
}

.plan__text {
  margin-top: 12px;
  color: var(--ink-soft);
}

.plan__list {
  display: grid;
  gap: 8px;
  margin: 20px 0 28px;
  padding: 20px 0 0 1.1em;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
}

.plan__action {
  align-self: flex-start;
  margin-top: auto;
}

/* The plan most people will use is set in ink, like a page's cover. */
.plan--featured {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.plan--featured .plan__text,
.plan--featured .plan__list {
  color: var(--ink-faint);
}

.plan--featured .plan__list {
  border-top-color: var(--ink-soft);
}

.btn--light {
  background: var(--paper);
  color: var(--ink);
}

.btn--light:hover {
  background: var(--card);
}

.plan--featured .btn:focus-visible {
  outline-color: var(--moss-soft);
}

@media (min-width: 900px) {
  .plans {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* The invitation follows a tinted section, so it needs its own top space again. */
.section--deep + .section--invite {
  padding-top: clamp(72px, 10vw, 136px);
}

/* ---------- Install steps and the about note ---------- */

.install {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px 48px;
  max-width: 760px;
  margin: clamp(40px, 6vw, 64px) auto 0;
  padding-top: 32px;
  border-top: 1px solid var(--line-strong);
}

.install__title {
  font-size: 26px;
  line-height: 32px;
  letter-spacing: -0.3px;
}

.install__steps {
  display: grid;
  gap: 12px;
  padding-left: 1.3em;
  color: var(--ink-soft);
}

.install__steps li::marker {
  color: var(--moss);
  font-family: var(--serif);
  font-style: italic;
}

.install__verify {
  margin-top: 20px;
  overflow-wrap: anywhere;
}

.install__verify code {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 13px;
}

@media (min-width: 760px) {
  .install {
    grid-template-columns: 200px minmax(0, 1fr);
  }
}

.section--about {
  padding-top: 0;
}

.about {
  max-width: 760px;
  margin-inline: auto;
}

.about h2 {
  font-size: clamp(28px, 3.4vw, 40px);
}

.about .lead {
  max-width: none;
  margin-top: 16px;
}

/* ---------- Privacy and terms pages ---------- */

.doc {
  max-width: 44em;
  padding-block: clamp(32px, 6vw, 72px) clamp(64px, 9vw, 112px);
}

.doc h1 {
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.doc h2 {
  margin-top: 40px;
  font-size: 26px;
  line-height: 32px;
  letter-spacing: -0.3px;
}

.doc p,
.doc ul {
  margin-top: 12px;
  color: var(--ink-soft);
}

.doc ul {
  display: grid;
  gap: 8px;
  padding-left: 1.2em;
}

.doc .doc__date {
  margin-top: 16px;
  font-size: 14px;
}

.doc a {
  text-decoration-color: var(--line-strong);
  text-underline-offset: 4px;
}

.site-footer a {
  text-decoration-color: var(--line-strong);
  text-underline-offset: 4px;
}

.site-footer a:hover {
  color: var(--ink);
  text-decoration-color: var(--ink);
}

/* ---------- Small phones: draw the mocks a little smaller ---------- */

@media (max-width: 399px) {
  .phone,
  .entry__specimen,
  .page__screen,
  .page__aside,
  .step .app {
    zoom: 0.88;
  }
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }

  /* One moment on load: the phone settles, then the day's marks take their ink. */
  .hero .phone {
    animation: settle 0.8s var(--ease) both;
  }

  .hero .bars > i:not(.ahead) {
    transform-origin: bottom;
    animation: grow 0.5s var(--ease) both;
    animation-delay: calc(0.55s + var(--i, 0) * 0.07s);
  }

  .hero .inks > i.on {
    animation: ink 0.22s ease-out both;
    animation-delay: calc(0.75s + var(--i, 0) * 0.13s);
  }

  /* Spark's three steps arrive in order, once, when they come into view. */
  .js .steps[data-reveal] .step {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.5s ease-out, transform 0.5s var(--ease);
    transition-delay: calc(var(--i, 0) * 0.14s);
  }

  .js .steps[data-reveal].is-inview .step {
    opacity: 1;
    transform: none;
  }
}

@keyframes settle {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
}

@keyframes grow {
  from {
    transform: scaleY(0);
  }
}

@keyframes ink {
  from {
    background-color: var(--track);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
}
