/* Swear It's public pages: a front door and the legal ones. They borrow the app's own look (DESIGN.md):
   cream and ink, flat stickers, faces that sit on a solid offset shadow and press into it, wide
   uppercase display type, springs. The legal pages stay plain on purpose: they have to load anywhere,
   read well on a phone, and be easy to keep true. */
/* The font is served from this site (fonts/, SIL Open Font License): nothing on these pages asks
   another company's server for anything, so reading the privacy policy tells nobody you did. */
@font-face { font-family: 'Host Grotesk'; font-weight: 400; font-style: normal; font-display: swap; src: url('fonts/HostGrotesk_400Regular.ttf') format('truetype'); }
@font-face { font-family: 'Host Grotesk'; font-weight: 500; font-style: normal; font-display: swap; src: url('fonts/HostGrotesk_500Medium.ttf') format('truetype'); }
@font-face { font-family: 'Host Grotesk'; font-weight: 600; font-style: normal; font-display: swap; src: url('fonts/HostGrotesk_600SemiBold.ttf') format('truetype'); }

:root {
  --cream: #fef7e6;
  --sunk: #f7edd6;
  --ink: #0e0e0e;
  --text2: #3a362f;
  --text3: #625c52;
  --navy: #2b3d73;
  --sunny: #ffd372;
  --tomato: #f15b40;
  --sky: #88c1f8;
  --sage: #acd084;
  --rule: rgba(14, 14, 14, 0.12);
  /* Two of the app's springs (app/src/theme/spring.ts). `release`: a face let go of, coming back out
     of its shadow. `drop`: a sticker landing. Where linear() is unknown, a curve stands in. */
  --release: cubic-bezier(0.3, 1.3, 0.5, 1);
  --drop-ease: cubic-bezier(0.34, 1.56, 0.64, 1);
}
@supports (transition-timing-function: linear(0, 1)) {
  :root {
    --release: linear(0, 0.006 1.2%, 0.022 2.5%, 0.058 4.2%, 0.105 5.8%, 0.207 8.8%, 0.472 15.4%, 0.582 18.3%, 0.681 21.2%, 0.767 24.2%, 0.839 27.1%, 0.898 30%, 0.944 32.9%, 0.979 35.8%, 1.004 38.8%, 1.023 42.1%, 1.033 45.4%, 1.038 49.6%, 1.035 55.8%, 1.005 79.6%, 1);
    --drop-ease: linear(0, 0.012 0.8%, 0.047 1.7%, 0.102 2.5%, 0.172 3.3%, 0.254 4.2%, 0.346 5%, 0.694 7.9%, 0.836 9.2%, 0.964 10.4%, 1.074 11.7%, 1.163 12.9%, 1.228 14.2%, 1.272 15.4%, 1.294 16.7%, 1.294 18.3%, 1.267 20%, 1.222 21.7%, 1.062 26.2%, 0.988 28.7%, 0.938 31.2%, 0.923 32.5%, 0.913 34.2%, 0.921 37.5%, 1.004 46.2%, 1.026 51.2%, 1.024 55%, 1 63.3%, 0.993 68.3%, 1.002 85%, 1);
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: 'Host Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  overflow-x: hidden;
}

img { max-width: 100%; }

/* ---- The frame every page shares ---- */

.page { max-width: 720px; margin: 0 auto; padding: 28px 20px 72px; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }

header.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 20px; border-bottom: 1.5px solid var(--ink); }
header.top a.mark { display: inline-flex; align-items: center; gap: 10px; color: var(--navy); font-weight: 600; font-size: 22px; letter-spacing: -0.02em; text-decoration: none; }
header.top a.mark img { display: block; width: 34px; height: 34px; border-radius: 9px; }
header.top nav { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 15px; }
header.top nav a { color: var(--text2); text-decoration: none; }
header.top nav a:hover, header.top nav a[aria-current='page'] { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }

h1 { margin: 36px 0 6px; font-weight: 500; font-size: 40px; line-height: 1.05; letter-spacing: -0.03em; }
h2 { margin: 40px 0 8px; font-weight: 600; font-size: 22px; line-height: 1.2; letter-spacing: -0.015em; }
h3 { margin: 24px 0 4px; font-weight: 600; font-size: 17px; }
p, li { color: var(--text2); }
p { margin: 10px 0; }
ul { padding-left: 22px; margin: 10px 0; }
li { margin: 6px 0; }
strong { color: var(--ink); font-weight: 600; }
a { color: var(--navy); text-underline-offset: 3px; }

.when { margin: 0 0 18px; color: var(--text3); font-size: 15px; }
.short { margin: 22px 0; padding: 16px 18px; border-radius: 18px; background: var(--sunk); }
.short p { margin: 6px 0; }
.fill { background: var(--sunny); padding: 0 4px; border-radius: 4px; color: var(--ink); }

table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 15.5px; }
th, td { text-align: left; vertical-align: top; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--rule); color: var(--text2); }
th { color: var(--ink); font-weight: 600; border-bottom: 1.5px solid var(--ink); }

footer { margin-top: 56px; padding-top: 18px; border-top: 1px solid var(--rule); color: var(--text3); font-size: 14.5px; display: flex; flex-wrap: wrap; gap: 6px 18px; }
footer a { color: var(--text3); }

/* ---- The front page: pieces of the app's look ---- */

.front header.top { position: relative; z-index: 4; padding: 22px 0 18px; border-bottom: 0; }
.front footer { margin-top: 0; padding: 24px 0 40px; border-top: 0; }

/* Display type: upper case, light, tight, as a promise's title is set in the app. */
.display { margin: 0; font-weight: 400; text-transform: uppercase; letter-spacing: -0.035em; line-height: 0.92; }

/* A caption: small, wide, upper case. */
.cap { margin: 0 0 10px; color: var(--text3); font-weight: 600; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; }

/* A pill on its shadow. Pressed, the face goes down into the shadow; let go, it springs back. */
.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 24px;
  border: 1.5px solid var(--ink); border-radius: 999px;
  background: #fff; color: var(--ink);
  font-weight: 500; font-size: 17px; white-space: nowrap; text-decoration: none;
  box-shadow: 0 4px 0 var(--ink);
  transition: transform 0.5s var(--release), box-shadow 0.5s var(--release);
}
.pill:active { transform: translateY(4px); box-shadow: 0 0 0 var(--ink); transition-duration: 0.07s; transition-timing-function: ease-out; }
.pill.sunny { background: var(--sunny); }
.pill:focus-visible, a:focus-visible { outline: 2.5px solid var(--sky); outline-offset: 3px; }

.chip { display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 5px 12px 5px 10px; border: 1.5px solid var(--ink); border-radius: 999px; background: #fff; color: var(--ink); font-weight: 500; font-size: 14px; }
.chip i { width: 9px; height: 9px; border-radius: 50%; background: var(--sage); border: 1.5px solid var(--ink); }

section { padding: 72px 0; }
section.after { padding-top: 0; }
section > .wrap > h2, .band > .wrap > h2 { margin: 0 0 6px; font-size: 34px; font-weight: 500; line-height: 1.04; letter-spacing: -0.03em; }
section > .wrap > .sub, .band > .wrap > .sub { margin: 0 0 32px; max-width: 34em; font-size: 18px; }

/* ---- The opening: the words on one side; on the other the wizard, swearing, with the light the
   app's first page has turning behind him and its six stickers round him. He stands on a band of
   navy that runs from side to side, and the buttons sit on it. ---- */

.hero {
  --w: 252px;                         /* how wide he is drawn */
  --h: calc(var(--w) * 2.0213);       /* his picture is 376 by 760 */
  --u: 380px;                         /* what the stickers are sized by */
  --top: 34px;                        /* the room above his hat */
  --band: 104px;                      /* the navy he stands on, where the buttons are */
  --reach: 820px;                     /* how far the light gets */
  position: relative; isolation: isolate; overflow: hidden;
}
/* The navy from side to side, under him and under the buttons. */
.hero::after { content: ''; position: absolute; z-index: 1; left: 0; right: 0; bottom: 0; height: var(--band); background: var(--navy); }

.hero .open { display: grid; grid-template-columns: minmax(0, 1fr) 480px; grid-template-rows: 1fr auto; column-gap: 12px; }
.hero .words { grid-column: 1; grid-row: 1; align-self: center; position: relative; z-index: 3; padding: 24px 0 44px; }
.hero h1.display { margin: 20px 0 0; font-size: clamp(46px, 7.5vw, 96px); }
.hero .lead { margin: 22px 0 0; max-width: 24em; font-size: 20px; line-height: 1.45; color: var(--text2); }
.hero .actions { grid-column: 1; grid-row: 2; position: relative; z-index: 3; display: flex; align-items: center; gap: 12px; height: var(--band); margin: 0; }

/* His feet come down two points into the navy, so no line of cream can show under them. */
.stage { grid-column: 2; grid-row: 1 / span 2; position: relative; height: calc(var(--top) + var(--h) + var(--band) - 2px); }
/* A box exactly where he is: the light, the twinkles and the stickers are all placed by it, in parts
   of his own size, so they keep their places round him on any screen. */
.cast { position: absolute; left: 50%; top: var(--top); width: var(--w); height: var(--h); margin-left: calc(var(--w) / -2); }
.cast .wizard { position: absolute; z-index: 3; left: 0; top: 0; width: 100%; height: 100%; max-width: none; }
/* The flat shadow a standing figure has in the app, under his feet: all of it on the navy. */
.cast::before { content: ''; position: absolute; z-index: 2; left: 4%; bottom: -13px; width: 95%; height: 13px; border-radius: 50%; background: rgba(14, 14, 14, 0.32); }

/* The light: sixteen rays from behind his head, fading as they go, a full turn every ninety seconds. */
.light { position: absolute; z-index: 0; left: 0; top: 0; width: 100%; height: 100%; }
.rays { position: absolute; left: 47.6%; top: 17.2%; width: calc(var(--reach) * 2); height: calc(var(--reach) * 2); margin: calc(var(--reach) * -1) 0 0 calc(var(--reach) * -1); animation: turn 90s linear infinite; }
@keyframes turn { to { transform: rotate(360deg); } }

/* Four-point twinkles in the light: each swells, turns a little and fades, on its own clock. */
.twinkle {
  position: absolute; left: var(--x); top: var(--y); width: var(--s, 13px); height: var(--s, 13px); background: var(--c, var(--navy));
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 0C12.8 7.4 16.6 11.2 24 12C16.6 12.8 12.8 16.6 12 24C11.2 16.6 7.4 12.8 0 12C7.4 11.2 11.2 7.4 12 0Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 0C12.8 7.4 16.6 11.2 24 12C16.6 12.8 12.8 16.6 12 24C11.2 16.6 7.4 12.8 0 12C7.4 11.2 11.2 7.4 12 0Z'/%3E%3C/svg%3E") center / contain no-repeat;
  animation: twinkle 2.2s var(--d, 0s) infinite backwards;
}
@keyframes twinkle {
  0%, 100% { opacity: 0.2; transform: scale(0.55) rotate(0deg); animation-timing-function: cubic-bezier(0.5, 1, 0.89, 1); }
  41% { opacity: 1; transform: scale(1) rotate(40deg); animation-timing-function: cubic-bezier(0.11, 0, 0.5, 0); }
}

/* The six stickers, three down each side of him. Each is thrown up into its place with a spin of its
   own, lands on the `drop` spring, and then bobs gently: a few points down and a few degrees round. */
.deco { position: absolute; z-index: 2; left: calc(50% + (var(--x) - 50%) * var(--spread, 1)); top: var(--y); width: calc(var(--u) * var(--s)); max-width: none; height: auto; transform: rotate(var(--tilt, 0deg)); animation: drift var(--dur, 3s) cubic-bezier(0.37, 0, 0.63, 1) calc(1.9s + var(--i, 0) * 0.2s) infinite alternate; }
@keyframes drift { to { translate: 0 var(--bob, 6px); rotate: var(--sway, 3deg); } }

/* The headline is typed in: each letter arrives in a colour and dries to ink. (site.js) */
.typein .ch { transition: color 0.28s ease-out; }
.typein .ch.wet { color: var(--c); }
.typein .ch.off { visibility: hidden; }

/* ---- How it works: three screens of the app ---- */

.steps { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 290px)); justify-content: space-between; gap: 28px; margin: 0; padding: 0; }
.steps li { margin: 0; }
.steps h3 { margin: 24px 0 4px; font-size: 20px; font-weight: 500; letter-spacing: -0.01em; color: var(--ink); }
.steps h3 b { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; margin-right: 9px; border: 1.5px solid var(--ink); border-radius: 50%; background: var(--sunny); font-weight: 600; font-size: 14px; letter-spacing: 0; vertical-align: 2px; }
.steps p { margin: 0; font-size: 15.5px; }
.phone { overflow: hidden; aspect-ratio: 600 / 1304; border: 1.5px solid var(--ink); border-radius: 40px; background: var(--cream); box-shadow: 0 6px 0 var(--ink); }
.phone img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* ---- What it costs: two cards on their shadows, the app's "cans" ---- */

.cans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.can { position: relative; padding: 24px 24px 26px; border: 1.5px solid var(--ink); border-radius: 28px; background: #fff; box-shadow: 0 6px 0 var(--ink); }
.can p { margin: 0; font-size: 15.5px; }
.can .tag { display: inline-block; margin: 0 0 16px; padding: 4px 11px; border: 1.5px solid var(--ink); border-radius: 999px; font-weight: 600; font-size: 12px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink); }
.can .tag.navy { background: var(--navy); color: var(--cream); }
.can .tag.tomato { background: var(--tomato); }
.can .price { margin: 0 0 12px; color: var(--ink); font-weight: 400; font-size: clamp(40px, 5vw, 52px); line-height: 1; letter-spacing: -0.035em; }
.can .price span { display: inline-block; color: var(--text3); font-size: 16px; line-height: 1.5; letter-spacing: 0; white-space: nowrap; }
/* A sticker sitting on a card's top edge, as the dumbbell sits on a promise in the app. */
.can .perch { position: absolute; right: 22px; top: -34px; width: 84px; max-width: none; height: auto; rotate: 8deg; }
.fine { margin: 26px 0 0; color: var(--text3); font-size: 15.5px; }

/* ---- The limits: one sunny surface, the numbers in ink ---- */

.band { padding: 72px 0; border-top: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); }
.band.sunny { background: var(--sunny); }
.band.sunny p { color: var(--ink); }
.band.sunny .cap { color: var(--ink); opacity: 0.72; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; margin: 34px 0 0; }
.stats div { padding-top: 16px; border-top: 1.5px solid var(--ink); }
.stats .n { margin: 0; color: var(--ink); font-weight: 400; font-size: clamp(46px, 6.4vw, 72px); line-height: 0.95; letter-spacing: -0.045em; }
.stats .n small { font-size: 0.4em; letter-spacing: -0.01em; }
.stats p:last-child { margin: 10px 0 0; font-size: 15.5px; line-height: 1.4; }

/* ---- How a missed day is charged ---- */

.rules { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 48px; margin: 0; padding: 0; border-top: 1.5px solid var(--ink); }
.rules li { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 18px; align-items: start; margin: 0; padding: 22px 0; border-bottom: 1px solid var(--rule); }
.rules img { display: block; width: 56px; height: 56px; object-fit: contain; }
.rules h3 { margin: 2px 0 2px; font-size: 18px; font-weight: 500; color: var(--ink); }
.rules p { margin: 0; font-size: 15.5px; }

/* ---- The close: navy, as the app's night pages are ---- */

.band.navy { background: var(--navy); border-bottom: 0; }
.band.navy .wrap { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 40px; }
.band.navy h2.display { margin: 0; color: var(--cream); font-size: clamp(36px, 5.2vw, 60px); font-weight: 400; line-height: 0.95; letter-spacing: -0.035em; }
.band.navy p { margin: 18px 0 0; max-width: 32em; color: rgba(254, 247, 230, 0.86); font-size: 17px; }
.band.navy a { color: var(--cream); }
.band.navy .hands { display: block; width: 220px; max-width: none; height: auto; rotate: -6deg; }

/* ---- Arriving. Things below the first screen are moved, never hidden: a page that is captured
   or printed before anybody scrolls it still shows everything. Only the opening, which is on screen
   from the start, comes out of nothing. ---- */

.js .light { opacity: 0; }
.js .in .light { opacity: 1; transition: opacity 0.7s linear; }
.js .deco { opacity: 0; transform: translateY(160px) rotate(calc(var(--tilt, 0deg) + var(--spin, 120deg))) scale(0.5); }
.js .in .deco { opacity: 1; transform: rotate(var(--tilt, 0deg)); transition: transform 1.4s var(--drop-ease), opacity 0.16s linear; transition-delay: calc(0.2s + var(--i, 0) * 80ms); }

.js [data-rise] > * { transform: translateY(28px); }
.js [data-rise].in > * { transform: none; transition: transform 0.6s cubic-bezier(0.215, 0.61, 0.355, 1); transition-delay: calc(var(--i, 0) * 60ms); }
.js .pop { transform: scale(0.6) rotate(-14deg); }
.js .in .pop { transform: none; transition: transform 0.5s var(--release); transition-delay: calc(var(--i, 0) * 60ms + 160ms); }

/* ---- Smaller screens ---- */

@media (max-width: 960px) {
  .hero { --w: min(200px, 52vw); --u: min(300px, 78vw); --top: 22px; --band: 100px; --reach: 640px; }
  .hero .open { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
  .hero .words { grid-row: auto; padding: 18px 0 0; text-align: center; }
  .hero h1.display { font-size: clamp(44px, 11vw, 76px); }
  .hero .lead { margin-left: auto; margin-right: auto; }
  .stage { grid-column: 1; grid-row: auto; height: calc(var(--top) + var(--h) - 2px); }
  .hero .actions { grid-row: auto; justify-content: center; }
  .steps { grid-auto-flow: column; grid-auto-columns: min(72%, 290px); grid-template-columns: none; justify-content: start; gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -20px; padding: 4px 20px 16px; scrollbar-width: none; }
  .steps::-webkit-scrollbar { display: none; }
  .steps li { scroll-snap-align: center; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 20px; }
  .rules { grid-template-columns: minmax(0, 1fr); }
  .band.navy .wrap { grid-template-columns: minmax(0, 1fr); }
  .band.navy .hands { width: 150px; }
}

@media (max-width: 620px) {
  section, .band { padding: 52px 0; }
  section.after { padding-top: 0; }
  .cans { grid-template-columns: minmax(0, 1fr); gap: 44px; }
  section > .wrap > h2, .band > .wrap > h2 { font-size: 29px; }
  section > .wrap > .sub, .band > .wrap > .sub { font-size: 17px; }
  .hero .lead { font-size: 18px; }
  .pill { padding: 0 20px; font-size: 16px; }
}

@media (max-width: 520px) {
  .hero { --spread: 0.92; }           /* a narrow phone: the stickers stand a little closer to him */
  h1 { font-size: 32px; }
  header.top { flex-direction: column; align-items: flex-start; }
  .front header.top { gap: 10px; padding-top: 18px; }
}

/* Anybody who asked for less motion gets none: everything is simply there. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rays, .twinkle, .deco { animation: none; }
  .js .light, .js .deco { opacity: 1; transition: none; }
  .js .deco { transform: rotate(var(--tilt, 0deg)); }
  .js [data-rise] > *, .js .pop { transform: none; transition: none; }
  .pill { transition: none; }
}
