/* OnePunto: ink on paper. The app's greys, its black, its letter (Jost) and
   its motion. The page is one idea: a paper calendar full of crosses turning
   into the grid of dots the app keeps for you. */
@font-face {
  font-family: Jost;
  src: url(fonts/Jost.ttf) format("truetype");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --page: #dcdcdd;
  --paper: #ebebec;
  --ink: #000;
  --text: #3c3c3c;
  --soft: #545454;
  --rule: #b6b6b6;
  --empty: #707070;
  --track: #d0d0d0;
  --on-ink: #dcdcdd;
  --curve: cubic-bezier(.05, .7, .1, 1);
  --exit: cubic-bezier(.3, 0, .8, .15);
  --pop: cubic-bezier(.34, 1.56, .64, 1);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --page: #000;
    --paper: #242424;
    --ink: #f7f7f7;
    --text: #e4e4e5;
    --soft: #bebebe;
    --rule: #3c3c3c;
    --empty: #949494;
    --track: #3c3c3c;
    --on-ink: #000;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-width: thin; scrollbar-color: var(--empty) transparent; }
body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: 400 19px/1.55 Jost, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "tnum";
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
::selection { background: var(--ink); color: var(--on-ink); }
h1, h2, h3 { color: var(--ink); font-weight: 500; margin: 0; text-wrap: balance; }
p { margin: 0; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 4px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; border-radius: 6px; }
.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding-inline: 40px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Header and footer */
header.top { display: flex; align-items: center; justify-content: space-between; height: 80px; }
.lockup { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 500; font-size: 22px; letter-spacing: -.01em; }
.lockup svg { width: 28px; height: 28px; }
.lang { font-size: 17px; color: var(--soft); }
footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 24px; padding-top: 32px; padding-bottom: 48px; font-size: 16px; color: var(--soft); }
footer nav { display: flex; gap: 24px; }

/* The opening: a field of days, the headline cut out of it. The dots arrive
   in one diagonal wave, then fill one after another up to today. */
.hero { position: relative; min-height: calc(100svh - 80px); display: grid; align-items: center; overflow: hidden; }
/* The words sit in the half of the year today is not in. */
.hero[data-copy="top"] { align-items: start; }
.hero[data-copy="bottom"] { align-items: end; }
.field { position: absolute; inset: 0; width: 100%; height: 100%; }
/* Without script there is no field; with reduced motion it is drawn once,
   settled, and never moves. */
html:not(.js) .field { display: none; }
.hero-in { position: relative; display: grid; justify-items: start; gap: 26px; padding-block: 72px 96px; }
.hero h1 { font-size: clamp(54px, 10.4vw, 148px); line-height: .92; letter-spacing: -.045em; }
.hero .lead { font-size: clamp(19px, 2.1vw, 27px); line-height: 1.35; color: var(--text); max-width: 34ch; text-wrap: balance; }
.hero .soon { font-size: clamp(16px, 1.4vw, 19px); }
.cue { position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); display: grid; justify-items: center; gap: 12px; color: var(--soft); font-size: 15px; text-decoration: none; }
.cue i { width: 9px; height: 9px; border-radius: 50%; background: var(--ink); }
.js:not(.still) .cue i { animation: fall 2.1s var(--curve) infinite; }
@keyframes fall { 0% { transform: translateY(-6px); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(15px); opacity: 0; } }

/* Scene: the paper calendar and what it becomes. */
.scene .sticky { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 64px; align-items: center; padding-top: 24px; padding-bottom: 64px; }
.copy { display: grid; align-content: center; gap: 28px; max-width: 560px; }
h1, .scene h2 { font-size: clamp(46px, 6.6vw, 100px); line-height: .98; letter-spacing: -.035em; }
.scene h2 { font-size: clamp(38px, 4.6vw, 76px); }
.period { display: inline-block; width: .15em; height: .15em; margin-left: .04em; border-radius: 50%; background: var(--ink); }
.beats { display: grid; font-size: clamp(21px, 2.1vw, 28px); line-height: 1.3; color: var(--text); min-height: 2.6em; }
.beat { grid-area: 1 / 1; max-width: 24ch; text-wrap: balance; }
.example { font-size: 15px; color: var(--soft); margin-top: -12px; }
.soon { display: inline-flex; align-items: center; gap: 12px; font-weight: 500; font-size: 18px; color: var(--ink); }
.soon i { width: 10px; height: 10px; border-radius: 50%; background: var(--ink); }

.stage { display: flex; flex-wrap: wrap; gap: 32px; justify-content: center; }
.frame { --k: .62; position: relative; margin: 0; width: calc(560px * var(--k)); height: calc(692px * var(--k)); }
.frame figcaption { position: absolute; left: 0; top: -34px; font-size: 16px; color: var(--soft); }

/* The board: one 560 x 692 plane, scaled to fit. */
.board { position: absolute; left: 0; top: 0; width: 560px; height: 692px; transform: scale(var(--k)); transform-origin: 0 0; }
.sheet { position: absolute; left: 0; top: 0; width: 560px; height: var(--h, 496px); background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r, 3px); }
.board[data-state="card"] .sheet { --h: 532px; --r: 20px; }
.month { position: absolute; left: 27px; top: 34px; font-size: 30px; line-height: 1; letter-spacing: -.02em; color: var(--soft); }
.month b { font-weight: 500; color: var(--ink); }
.wd { position: absolute; top: 84px; left: var(--x); transform: translateX(-50%); font-size: 13px; font-weight: 500; color: var(--soft); }
.wd.weekend { color: var(--empty); }
.rules { position: absolute; left: -1px; top: -1px; width: 560px; height: 496px; stroke: var(--rule); stroke-width: 1; opacity: .8; }
.shade { position: absolute; left: 387px; top: 111px; width: 145px; height: 361px; background: var(--track); opacity: 0; }
.num { position: absolute; left: calc(var(--x) + 7px); top: calc(var(--y) + 5px); font-size: 14px; font-weight: 500; line-height: 1; color: var(--text); }
.num.weekend { color: var(--soft); }
.num.out { color: var(--empty); }
.ink { position: absolute; left: -1px; top: -1px; width: 560px; height: 496px; overflow: visible; fill: var(--ink); }
.ink path { transform-box: fill-box; transform-origin: center; }
.goal { position: absolute; left: 27px; top: 27px; font-size: 18px; font-weight: 500; line-height: 26px; color: var(--ink); }
.bar { position: absolute; left: 27px; right: 27px; top: 451px; height: 5px; border-radius: 5px; background: var(--track); overflow: hidden; }
.bar i { display: block; height: 100%; width: 100%; border-radius: inherit; background: var(--ink); transform-origin: left; transform: scaleX(var(--p)); transition: transform .42s var(--curve); }
.count { position: absolute; left: 27px; right: 27px; top: 470px; display: flex; justify-content: space-between; align-items: baseline; font-size: 16px; color: var(--soft); }
.count b { font-weight: 500; color: var(--ink); }
.count [data-n] { font-size: 30px; letter-spacing: -.02em; margin-right: 4px; }
.count [data-share] { font-size: 20px; }

.tokens { position: absolute; inset: 0; pointer-events: none; }
.tok { --ring: 2.4px; --halo: 0 0 0 4px var(--paper); position: absolute; left: 0; top: 0; width: 31.5px; height: 31.5px; margin: -15.75px 0 0 -15.75px; border-radius: 50%; background: var(--paper); box-shadow: inset 0 0 0 var(--ring) var(--empty), var(--halo); }
/* Each dot keeps a margin of paper around it, as ink covers the ruling it
   lands on: while the sheet turns into the card, no line runs through a dot. */
.tok.done { background: var(--ink); box-shadow: var(--halo); }
.tok.missed::after { content: ""; position: absolute; left: 34%; right: 34%; top: calc(50% - 1.2px); height: 2.4px; border-radius: 2px; background: var(--empty); }
.tok.today { box-shadow: inset 0 0 0 var(--ring) var(--ink), var(--halo); }
.tok.today::before { content: ""; position: absolute; inset: 26%; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--ink); }
.tok.today::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--ink); transform: scale(0); transition: transform .32s var(--curve); }
.tok.today.on::after { transform: scale(1); transition: transform .56s var(--pop); }
.tok.ring { overflow: visible; }
.tok .wave { position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 2px var(--ink); animation: wave .7s ease-out forwards; }
@keyframes wave { from { transform: scale(1); opacity: .5; } to { transform: scale(2.2); opacity: 0; } }

.board[data-state="paper"] .tok { opacity: 0; transform: translate(var(--x0), var(--y0)) scale(1.143); }
.board[data-state="card"] .tok { transform: translate(var(--x1), var(--y1)); }
.board[data-state="card"] :is(.month, .weekdays, .rules, .nums, .ink) { opacity: 0; }
.board[data-state="paper"] :is(.goal, .bar, .count, .square, .tip) { visibility: hidden; }

/* The square, as the app draws it: a continuous-cornered square that
   completes today with one tap and undoes it with another. */
.square, .w-square { position: relative; padding: 0; border: 0; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: scale .16s var(--curve); }
.square { position: absolute; left: 236px; top: 560px; width: 88px; height: 88px; }
.square svg, .w-square svg { position: absolute; left: -9px; top: -9px; width: calc(100% + 18px); height: calc(100% + 18px); overflow: visible; }
.sq-body { fill: var(--paper); stroke: var(--rule); stroke-width: 1.5; transition: fill .32s var(--curve), stroke .32s var(--curve); }
.sq-ring { fill: none; stroke: var(--ink); transition: stroke .32s var(--curve); }
.sq-dot { fill: var(--ink); transform-box: fill-box; transform-origin: center; transform: scale(0); transition: transform .32s var(--curve), fill .32s var(--curve); }
.sq-focus { fill: none; stroke: var(--ink); stroke-width: 3; opacity: 0; }
:is(.square, .w-square):hover .sq-body { stroke: var(--empty); }
:is(.square, .w-square):active { scale: .94; }
:is(.square, .w-square):focus-visible { outline: none; }
:is(.square, .w-square):focus-visible .sq-focus { opacity: 1; }
:is(.square, .w-square)[aria-pressed="true"] .sq-body { fill: var(--ink); stroke: var(--ink); transition-duration: .56s; }
:is(.square, .w-square)[aria-pressed="true"] .sq-ring { stroke: var(--on-ink); }
:is(.square, .w-square)[aria-pressed="true"] .sq-dot { fill: var(--on-ink); transform: scale(1); transition: transform .56s var(--pop), fill .32s var(--curve); }
@keyframes fill { from { transform: scale(.45); } to { transform: scale(1); } }
.tip { position: absolute; left: 0; right: 0; top: 662px; text-align: center; font-size: 16px; color: var(--soft); }

/* Live: the scene holds still while the page scrolls through it. */
.js:not(.still) .scene { height: 420vh; }
.js:not(.still) .scene .sticky { position: sticky; top: 0; height: 100svh; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); grid-template-rows: minmax(0, 1fr); padding-top: 32px; padding-bottom: 32px; }
.js:not(.still) .stage { align-self: stretch; align-items: center; min-height: 0; height: 100%; }
.js:not(.still) .still-only, .js:not(.still) .frame figcaption { display: none; }
.js:not(.still) .beat { opacity: 0; transform: translateY(.35em); transition: opacity .2s var(--exit), transform .2s var(--exit); }
.js:not(.still) .beat.shown { opacity: 1; transform: none; transition: opacity .34s var(--curve) .12s, transform .34s var(--curve) .12s; }
.js:not(.still) .beat.leaving { transform: translateY(-.35em); }
.js .beat:not(.shown) { visibility: hidden; }
.js:not(.still) .beat:not(.shown):is(.leaving) { visibility: visible; }
html:not(.js) .beat:not(:first-child), .still .beat:not(:first-child) { display: none; }

/* Widgets: always in the other theme, a night in a day page. */
.band {
  --page: #000; --paper: #242424; --ink: #f7f7f7; --text: #e4e4e5; --soft: #bebebe;
  --rule: #3c3c3c; --empty: #949494; --track: #3c3c3c; --on-ink: #000;
  background: var(--page); color: var(--text);
}
@media (prefers-color-scheme: dark) {
  .band {
    --page: #dcdcdd; --paper: #ebebec; --ink: #000; --text: #3c3c3c; --soft: #545454;
    --rule: #b6b6b6; --empty: #707070; --track: #d0d0d0; --on-ink: #dcdcdd;
  }
}
/* Inset from the page's edges, so the night reads as a panel set into the day
   page and never runs into the browser's own gutter. */
.band { margin-inline: 24px; border-radius: 28px; }
.band-in { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 64px; align-items: center; padding-top: 144px; padding-bottom: 144px; }
.band h2 { font-size: clamp(40px, 5.2vw, 76px); line-height: 1; letter-spacing: -.035em; }
.band-text p { margin-top: 24px; max-width: 30ch; font-size: 21px; color: var(--soft); }
.home { display: grid; grid-template-columns: repeat(2, 176px); grid-auto-rows: 176px; gap: 20px; }
.widget { position: relative; border-radius: 28px; background: var(--paper); padding: 17px 18px; overflow: hidden; }
.widget.medium { grid-column: span 2; display: flex; flex-direction: column; justify-content: space-between; gap: 12px; }
.w-title { font-size: 15px; font-weight: 500; line-height: 1.25; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-line { font-size: 15px; line-height: 1.3; color: var(--soft); }
.w-foot { position: absolute; left: 16px; right: 18px; bottom: 16px; display: flex; align-items: flex-end; justify-content: space-between; }
.w-square { width: 66px; height: 66px; flex: none; }
.w-square .sq-body { fill: var(--page); }
.w-streak { display: grid; justify-items: end; text-align: right; line-height: 1.1; }
.w-streak b { font-size: 38px; font-weight: 500; letter-spacing: -.02em; color: var(--ink); line-height: 1; }
.w-streak span { font-size: 12px; color: var(--soft); max-width: 7ch; }
.w-big { font-size: 64px; font-weight: 500; line-height: 1; letter-spacing: -.03em; color: var(--ink); margin-top: 10px; }
.w-unit { font-size: 14px; color: var(--soft); }
.w-row { position: absolute; left: 18px; right: 18px; bottom: 18px; display: flex; justify-content: space-between; }
.w-row i, .w-grid i { position: relative; width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--empty); }
.w-row i.on, .w-grid i.done { background: var(--ink); border-color: var(--ink); }
.w-row i.miss::after, .w-grid i.missed::after { content: ""; position: absolute; left: 2px; right: 2px; top: calc(50% - .75px); height: 1.5px; background: var(--empty); }
.w-grid i.today { border-color: var(--ink); }
.w-grid i.today::before { content: ""; position: absolute; inset: 1.8px; border-radius: 50%; border: 1.2px solid var(--ink); }
.w-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.w-head b { font-size: 16px; font-weight: 500; color: var(--ink); }
.w-grid { display: grid; grid-template-columns: repeat(18, 12px); justify-content: space-between; row-gap: 7px; }
.w-count { font-size: 14px; color: var(--soft); }

/* What it does not do: four lines, each closed by a dot that fills. */
.promises { display: grid; gap: 72px; padding-top: 168px; padding-bottom: 168px; }
.promise { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 16px 56px; align-items: end; }
.promise h3 { font-size: clamp(48px, 8vw, 118px); line-height: .95; letter-spacing: -.04em; }
.promise p { font-size: 20px; color: var(--soft); max-width: 32ch; padding-bottom: .5em; }
.stop { display: inline-block; width: .16em; height: .16em; margin-left: .04em; border-radius: 50%; background: var(--ink); box-shadow: inset 0 0 0 .028em var(--ink); }
.js:not(.still) .promise:not(.in) .stop { background: transparent; }
.js:not(.still) .promise.in .stop { animation: fill .56s var(--pop); }

/* The close */
.close { display: grid; justify-items: start; gap: 28px; padding-top: 40px; padding-bottom: 144px; }
.close-mark { color: var(--ink); }
.close-mark svg { display: block; width: 132px; height: 132px; margin-left: -18px; }
.close h2 { font-size: clamp(48px, 7vw, 104px); line-height: .98; letter-spacing: -.04em; }
.close p { font-size: 21px; color: var(--soft); max-width: 36ch; }

/* A page that is not there */
.missing { display: grid; justify-items: start; gap: 20px; padding-block: clamp(64px, 14vh, 160px) 120px; }
.missing-dot { width: 44px; height: 44px; border-radius: 50%; box-shadow: inset 0 0 0 3px var(--empty); }
.missing h1 { font-size: clamp(40px, 6vw, 84px); line-height: 1; letter-spacing: -.04em; }
.missing p { font-size: 20px; color: var(--soft); max-width: 42ch; }
.missing-back { font-size: 18px; color: var(--ink); }

/* Legal pages */
article.legal { max-width: 720px; padding: 24px 0 96px; }
article.legal h1 { font-size: clamp(40px, 6vw, 60px); line-height: 1.02; letter-spacing: -.03em; margin-bottom: 20px; }
article.legal h2 { font-size: 26px; letter-spacing: -.015em; margin: 48px 0 10px; }
article.legal p, article.legal li { color: var(--text); }
article.legal p + p { margin-top: 14px; }
article.legal li + li { margin-top: 6px; }
article.legal .updated { color: var(--soft); }
article.legal .summary { background: var(--paper); border: 1px solid var(--rule); border-radius: 20px; padding: 22px 26px; font-size: 20px; margin-top: 24px; }
article.legal strong { color: var(--ink); font-weight: 500; }

@media (max-width: 1100px) {
  .frame { --k: .56; }
}
@media (max-width: 900px) {
  .wrap { padding-inline: 24px; }
  .hero-in { padding-block: 40px 96px; }
  .scene .sticky { grid-template-columns: 1fr; row-gap: 32px; }
  .copy { gap: 18px; }
  .band-in { grid-template-columns: 1fr; gap: 48px; padding-top: 104px; padding-bottom: 104px; }
  .promise { grid-template-columns: 1fr; }
  .promises { gap: 56px; padding-top: 120px; padding-bottom: 120px; }
  .js:not(.still) .scene { height: 400vh; }
  .js:not(.still) .scene .sticky { display: flex; flex-direction: column; align-items: stretch; justify-content: center; gap: 24px; padding-top: 20px; padding-bottom: 20px; }
  .js:not(.still) .copy { gap: 10px; }
  .js:not(.still) .beats { min-height: 2.6em; }
  .js:not(.still) .stage { flex: none; height: auto; }
}
@media (max-width: 560px) {
  .wrap { padding-inline: 16px; }
  .band { margin-inline: 8px; border-radius: 24px; }
  .band .wrap { padding-inline: 16px; }
  header.top { height: 64px; }
  .frame { --k: .56; }
  .stage { gap: 48px; }
  .home { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: auto; gap: 14px; }
  .widget.small { aspect-ratio: 1; }
  .widget.medium { min-height: 176px; }
  .w-grid { grid-template-columns: repeat(18, 1fr); column-gap: 3px; row-gap: 5px; }
  .w-grid i { width: auto; aspect-ratio: 1; height: auto; }
  .w-square { width: 56px; height: 56px; }
  /* Phones: the sheet is small, so its printed type is set larger to stay
     legible once scaled down. */
  .month { font-size: 36px; top: 30px; }
  .wd { font-size: 17px; top: 80px; }
  .num { font-size: 18px; }
  .w-big { font-size: 52px; }
  .js:not(.still) .soon { font-size: 16px; }
}
@media (max-width: 380px) {
  .frame { --k: .5; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
