/* The app's own palette, so the site and the product are the same thing.
   Values copied from Nota Baby/NotaBabyDesignSystem.xcassets/Colors.

   Contrast, measured on --ground and --surface: every ink clears 4.5:1 in
   both themes, so any of them may carry body text. In light no hue does
   (--sleep only just, at 4.6), so a hue carries a fill, a glyph or a figure
   of 24px and up, and text in a hue uses --link. In dark every hue clears
   4.5:1. --ink-3 is 5:1 on the ground; the site's old #837B6C was 3.6:1
   and sat on every caption. */
:root {
  --ground: #F1EEE7;
  --surface: #FDFBF6;
  --ink: #1A1712;
  --ink-2: #4A4438;
  --ink-3: #6B6457;
  --rule: #DCD5C7;
  --now: #109793;
  --link: #0B7572;
  --sleep: #5A5AE0;
  --feed: #C57428; --nursing: #D66094; --diaper: #2994B5; --solids: #9A6B4A;
  --health: #D6453C; --growth: #3E8F5A; --tummy: #A67C00;
  /* A phone is near-black in both themes: in dark, --ink is cream, and a
     phone with a white bezel reads as a card. */
  --bezel: #14120F;
  --shadow: 0 30px 60px -34px rgb(26 23 18 / .5);

  --round: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  /* The wordmark's face, as in the app: the system serif, for "Nota." alone. */
  --serif: ui-serif, "New York", Georgia, "Times New Roman", serif;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --band: clamp(4rem, 10vw, 7.5rem);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ground: #232221;
    --surface: #2E2D2A;
    --ink: #F7F3EA;
    --ink-2: #D9D3C7;
    --ink-3: #A39D92;
    --rule: #45423D;
    --now: #35CFC7;
    --link: #35CFC7;
    --sleep: #8C8BFF;
    --feed: #F0A257; --nursing: #FF9AC6; --diaper: #59C3E3; --solids: #C79A78;
    --health: #FF8079; --growth: #6FC98A; --tummy: #F2C94C;
    --shadow: 0 30px 60px -30px rgb(0 0 0 / .7);
  }
}

/* A dark band, in either theme: the app's dark palette again, repeated
   because a media query's values can't be reached from a class. The page
   breaks its light bands with a dark one now and then, and the change of
   ground is the divider. In the dark theme the band steps darker than the
   page so it still reads as a band; the inks were measured on #232221 and
   a darker ground only raises them. */
.band.dark {
  color-scheme: dark;
  --ground: #232221;
  --surface: #2E2D2A;
  --ink: #F7F3EA;
  --ink-2: #D9D3C7;
  --ink-3: #A39D92;
  --rule: #45423D;
  --now: #35CFC7;
  --link: #35CFC7;
  --sleep: #8C8BFF;
  --feed: #F0A257; --nursing: #FF9AC6; --diaper: #59C3E3; --solids: #C79A78;
  --health: #FF8079; --growth: #6FC98A; --tummy: #F2C94C;
  --shadow: 0 30px 60px -30px rgb(0 0 0 / .7);
  background: var(--ground);
  color: var(--ink);
}
@media (prefers-color-scheme: dark) {
  .band.dark { --ground: #161513; --surface: #232221; }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 1.0625rem/1.5 var(--round);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
img, svg { max-width: 100%; }
a { color: var(--link); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--now); outline-offset: 3px; border-radius: 6px; }
p, li { color: var(--ink-2); }
p { margin: 0 0 1rem; }
/* Two weights on the page: 400 to read and 600 to stand out. */
strong, b { color: var(--ink); font-weight: 600; }
h1, h2, h3 { color: var(--ink); font-family: var(--round); font-weight: 600; text-wrap: balance; }
h1 { font-size: clamp(2.4rem, 6.4vw, 4.1rem); line-height: 1.04; letter-spacing: -.02em; margin: 0 0 1.25rem; }
h2 { font-size: clamp(1.8rem, 4.2vw, 2.7rem); line-height: 1.08; letter-spacing: -.016em; margin: 0 0 1rem; }
h3 { font-size: 1.125rem; line-height: 1.3; letter-spacing: -.005em; margin: 0 0 .35rem; }
ul { padding-left: 1.2rem; margin: 0 0 1rem; }
li { margin-bottom: .45rem; }

.wrap { max-width: 70rem; margin: 0 auto; padding-inline: var(--gutter); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: 1rem; z-index: 10; background: var(--surface); padding: .5rem .8rem; }

/* The header, and on the landing page the list of its sections. Sticky, so
   the list is a way around a long page rather than something at its top. */
.top {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--ground) 90%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--rule);
}
.top .wrap { display: flex; align-items: center; gap: 1.5rem; min-height: 3.5rem; }
.wordmark {
  font-family: var(--serif);
  /* The app's `Font.notaDisplay`: semibold, tracked -0.4 at 32pt. */
  font-weight: 600;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--ink);
  text-decoration: none;
  flex: none;
  letter-spacing: -.0125em;
}
.wordmark span { color: var(--now); }
.top nav {
  margin-left: auto;
  display: flex; gap: .15rem;
  overflow-x: auto;
  scrollbar-width: none;
  /* The list scrolls sideways on a phone; the fade says there is more. */
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 1.5rem), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 1.5rem), transparent);
  padding-right: 1.25rem;
}
.top nav::-webkit-scrollbar { display: none; }
.top nav a {
  flex: none;
  color: var(--ink-2);
  text-decoration: none;
  font-size: .94rem;
  padding: .4rem .6rem;
  border-radius: 999px;
}
.top nav a:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 7%, transparent); }
.top nav a[aria-current="page"] { color: var(--ink); background: color-mix(in srgb, var(--ink) 8%, transparent); }
@media (min-width: 64rem) {
  .top nav { mask-image: none; -webkit-mask-image: none; padding-right: 0; }
}

/* Bands. Every section is one, and they alternate ground and surface so the
   page reads as a set of chapters without a rule between each. */
.band { padding-block: var(--band); scroll-margin-top: 3.5rem; }
.band.alt { background: var(--surface); }
/* A band that spans the page opens with its heading centred over it. */
.head { max-width: 40rem; margin: 0 auto clamp(2rem, 5vw, 3.5rem); text-align: center; }
.head p { font-size: 1.15rem; line-height: 1.55; }
.head p:last-child { margin-bottom: 0; }
.prose { max-width: 34rem; }
.prose > :last-child { margin-bottom: 0; }

/* Two columns, a picture and its words. .flip puts the picture second. */
.split {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 5.5rem);
  align-items: center;
}
.split.flip { grid-template-columns: minmax(0, 1fr) auto; }
.split.flip > :first-child { order: 2; }
.split + .split { margin-top: clamp(3.5rem, 8vw, 6rem); }
/* A column of words taller than its phone: the phone waits at the top of the
   screen while the words go by. */
.split.tall { align-items: start; }
.split.tall > figure { position: sticky; top: 5.5rem; }

.phone {
  display: block;
  width: min(330px, 78vw);
  height: auto;
  border-radius: 50px;
  border: 9px solid var(--bezel);
  background: #F1EEE7;
  box-shadow: 0 0 0 1px var(--rule), var(--shadow);
}
figure { margin: 0; }
figcaption { color: var(--ink-3); font-size: .9rem; line-height: 1.45; }

/* The one action colour is the links' teal, so everything to press on the
   page is the same hue. --surface on --link clears 5:1 in both themes. */
.store {
  display: inline-block;
  background: var(--link);
  color: var(--surface);
  text-decoration: none;
  font-weight: 600;
  padding: .85rem 1.6rem;
  border-radius: 999px;
}
.store:hover { background: color-mix(in srgb, var(--link) 88%, var(--ink)); }
@media (prefers-reduced-motion: no-preference) {
  .store, form.card button { transition: transform .12s; }
  .store:active, form.card button:active { transform: scale(.96); }
}

/* The hero. The headline is a full sentence, so it is set a step below the
   page-wide h1 or it runs to five lines beside the phone. */
.hero { padding-block: clamp(2.5rem, 7vw, 5.5rem) var(--band); }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.3rem); line-height: 1.08; }
.hero .split { grid-template-columns: minmax(0, 1fr) auto; }
.hero .sub { font-size: clamp(1.1rem, 2.2vw, 1.3rem); line-height: 1.5; color: var(--ink-2); max-width: 33rem; margin-bottom: 2rem; }
.fine { color: var(--ink-3); font-size: .92rem; margin: 1.25rem 0 0; max-width: 30rem; }

/* The Today section's close-up of the dial and its card: a screenshot
   cropped from the phone, so it takes a card's rounding rather than a bezel. */
.closeup { width: 26rem; max-width: 100%; }
.closeup img {
  display: block; width: 100%; height: auto;
  border-radius: 30px;
  box-shadow: 0 0 0 1px var(--rule), var(--shadow);
}

/* Three phones in a row; on a phone, a row to swipe through. */
.row {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1rem, 3vw, 2rem);
  margin-top: clamp(2.5rem, 6vw, 4rem);
}
.row .phone { width: 100%; border-width: 7px; border-radius: 40px; }
.row figcaption { margin-top: 1rem; text-align: center; }
.row figcaption strong { display: block; color: var(--ink); font-size: 1rem; margin-bottom: .1rem; }

/* A drawing inside a section's words: the nap plan and the visit summary. */
.inline-fig { margin: 2rem 0; max-width: 30rem; }
.inline-fig svg { display: block; width: 100%; height: auto; font: inherit; }
.inline-fig figcaption { margin-top: .6rem; }
.prose > .inline-fig:last-child { margin-bottom: 0; }

/* The nap plan. Outlines are planned and fills are logged, which is the dial's own language. */
.rhythm .track { fill: var(--rule); opacity: .55; }
.rhythm .guide { stroke: var(--rule); stroke-width: 1; stroke-dasharray: 2 4; }
.rhythm .hour { fill: var(--ink-3); font-size: 11px; }
.rhythm .label { fill: var(--ink-2); font-size: 12.5px; font-weight: 600; }
.rhythm .planned { fill: none; stroke: var(--sleep); stroke-width: 1.5; }
.rhythm .logged { fill: var(--sleep); opacity: .38; }
.rhythm .own { fill: var(--sleep); }
.rhythm .move { fill: none; stroke: var(--ink-3); stroke-width: 1; }

/* Sharing: the two notifications the other phone gets, over the log that
   names who wrote each line. */
.stage { position: relative; }
.banners {
  position: absolute; z-index: 1;
  /* Over the phone's edge and into the gap, never as far as the words. */
  left: calc(-.7 * clamp(2rem, 6vw, 5.5rem)); top: 13%;
  width: 19.5rem;
  display: grid; gap: .6rem;
}
.banner {
  display: grid; grid-template-columns: 2.4rem minmax(0, 1fr) auto; gap: .15rem .75rem;
  align-items: center;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border: 1px solid var(--rule);
  border-radius: 1.3rem;
  padding: .75rem .9rem;
  box-shadow: 0 14px 34px -18px rgb(26 23 18 / .45);
  font-size: .9rem; line-height: 1.3;
}
.banner img { grid-row: span 2; width: 2.4rem; height: 2.4rem; border-radius: .6rem; box-shadow: 0 0 0 1px var(--rule); }
.banner b { font-size: .95rem; }
.banner span { grid-column: 2 / 4; color: var(--ink-2); }
.banner small { color: var(--ink-3); font-size: .8rem; }

/* The Lock Screen: the real Live Activity. */
.lock { max-width: 28rem; }
.lock > img { display: block; width: 100%; height: auto; border-radius: 26px; box-shadow: var(--shadow); }

/* A card: the tiers, and the support page's form. */
.card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 18px;
  padding: clamp(1.25rem, 3vw, 1.75rem);
}
.band.alt .card { background: var(--ground); }
.card h3 { font-size: 1.2rem; }
.card p:last-child { margin-bottom: 0; }

/* Check-ups: the visit summary's pages, drawn in fixed colours because they
   are paper in both themes. */
.pages .sheet { fill: #FDFBF6; stroke: #DCD5C7; }
.pages .sheet.back { fill: #F4F0E8; }
.pages .ln { fill: #DCD5C7; } .pages .ln.strong { fill: #4A4438; }
.pages .p-fig { fill: #1A1712; font-size: 10px; font-weight: 700; }
.pages .p-time { fill: #4A4438; font-size: 6.5px; font-weight: 700; }
.pages .p-title { fill: #1A1712; font-size: 9.5px; font-weight: 700; }
.pages .p-hour { fill: #6B6457; font-size: 6.5px; }
.pages .p-track { fill: #EFEBE3; }
.pages .p-sleep { fill: #5A5AE0; opacity: .8; }
.pages .p-feed { fill: #C57428; }

/* Also in the app. */
.chips { display: flex; flex-wrap: wrap; gap: .55rem; margin: 0 0 1.5rem; padding: 0; list-style: none; }
.chips li {
  margin: 0;
  font-size: .95rem; font-weight: 600; color: var(--ink);
  background: var(--ground); border: 1px solid var(--rule); border-radius: 999px;
  padding: .35rem .95rem .35rem .75rem;
}
.chips li::before { content: ""; display: inline-block; width: .6em; height: .6em; border-radius: 50%; background: var(--c); margin-right: .5em; vertical-align: .02em; }

/* Privacy. */
.split.even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.flow { display: block; width: 100%; max-width: 30rem; height: auto; font: inherit; justify-self: center; }
.flow .device { fill: var(--ground); stroke: var(--ink); stroke-width: 2; }
.flow .notch { fill: var(--ink); }
.flow .dial { fill: none; stroke: var(--rule); stroke-width: 5; }
.flow .arc { fill: none; stroke: var(--sleep); stroke-width: 5; stroke-linecap: round; }
.flow .cloud { fill: var(--ground); stroke: var(--now); stroke-width: 2; stroke-linejoin: round; }
.flow .wire { stroke: var(--now); stroke-width: 2; stroke-dasharray: 1 6; stroke-linecap: round; fill: none; }
.flow .pulse { fill: var(--now); }
.flow .cap { fill: var(--ink-2); font-size: 12px; }
.flow .cap.strong { fill: var(--ink); font-weight: 600; }
.flow .cap.muted { fill: var(--ink-3); }
.flow .nothing { fill: none; stroke: var(--ink-3); stroke-width: 1.5; stroke-dasharray: 4 4; }
.zeros {
  list-style: none; padding: 1.75rem 0 0; margin: clamp(2.5rem, 6vw, 4rem) 0 0;
  border-top: 1px solid var(--rule);
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem;
}
.zeros li { margin: 0; color: var(--ink-2); font-size: .98rem; line-height: 1.35; }
/* Large type, so the hue's 3:1 is the bar it has to clear. */
.zeros b { display: block; font-size: 2.75rem; line-height: 1; color: var(--now); margin-bottom: .4rem; letter-spacing: -.02em; }

/* Free and Premium. */
.tiers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1rem, 2.5vw, 1.5rem); }
.tiers .card h3 { font-size: 1.35rem; margin-bottom: .2rem; }
.tiers .card > p { color: var(--ink-3); font-size: .95rem; margin-bottom: 1.1rem; }
.tiers ul { list-style: none; padding: 0; margin: 0; }
.tiers li { padding: .55rem 0 .55rem 1.6rem; margin: 0; border-top: 1px solid var(--rule); position: relative; line-height: 1.45; }
.tiers li::before {
  content: ""; position: absolute; left: .1rem; top: 1.02rem;
  width: .6rem; height: .6rem; border-radius: 50%;
  border: 2px solid var(--ink-3);
}
.tiers .premium { border: 2px solid var(--now); }
.tiers .premium li::before { border-color: var(--now); background: var(--now); }
.terms { max-width: 42rem; margin: clamp(2rem, 5vw, 3rem) auto 0; text-align: center; }
.terms .fine { margin-inline: auto; }
.terms .store { margin-top: .75rem; }

footer.foot { border-top: 1px solid var(--rule); padding-block: 2.5rem 3.5rem; color: var(--ink-3); font-size: .95rem; }
footer.foot .wrap { display: flex; flex-wrap: wrap; gap: .75rem 1.75rem; align-items: baseline; }
footer.foot .wordmark { font-size: 1.35rem; margin-right: auto; }
footer.foot a { color: var(--ink-2); }
footer.foot p { margin: 0; color: var(--ink-3); flex-basis: 100%; font-size: .88rem; }

@media (max-width: 860px) {
  .split, .split.flip, .split.even, .hero .split { grid-template-columns: minmax(0, 1fr); }
  .split.flip > :first-child { order: 0; }
  .split.tall > figure { position: static; }
  /* On one column a section opens with its heading, then its picture. */
  .split > .prose { order: -1; }
  .split > figure, .split > .stage, .split > .lock { justify-self: center; }
  .hero .split > figure { order: 2; }
  .tiers { grid-template-columns: minmax(0, 1fr); }
  .zeros { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 1.5rem; }
  .banners { position: static; width: auto; max-width: 22rem; margin: 0 auto 1.5rem; }
  .row {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
    margin-inline: calc(-1 * var(--gutter)); padding: 0 var(--gutter) .75rem;
    scroll-padding-inline: var(--gutter);
  }
  .row > figure { flex: 0 0 min(72%, 260px); scroll-snap-align: start; }
}

/* Support and Privacy: one column of reading. */
.page { max-width: 44rem; margin: 0 auto; padding: clamp(2.5rem, 7vw, 4.5rem) var(--gutter) 2rem; }
.page h1 { font-size: clamp(2.2rem, 6vw, 3.2rem); margin-bottom: .5rem; }
.page h2 { font-size: clamp(1.35rem, 3vw, 1.6rem); letter-spacing: -.012em; margin: 2.75rem 0 .75rem; }
.updated { color: var(--ink-3); font-size: .92rem; margin: 0 0 2rem; }
.lede { font-size: 1.15rem; line-height: 1.55; color: var(--ink); margin-bottom: 2rem; }
.page .card { margin: 0 0 1.25rem; }
/* The header and footer line up with the one column. */
.doc .top .wrap, .doc .foot .wrap { max-width: 44rem; }

/* The support page's questions: closed until asked, so the list can be read
   as a list. */
details.q { border-top: 1px solid var(--rule); }
details.q:last-of-type { border-bottom: 1px solid var(--rule); }
details.q summary {
  cursor: pointer; list-style: none;
  display: flex; justify-content: space-between; gap: 1rem; align-items: baseline;
  padding: 1rem 0; font-weight: 600; color: var(--ink); font-size: 1.05rem;
}
details.q summary::-webkit-details-marker { display: none; }
details.q summary::after { content: "+"; color: var(--ink-3); font-size: 1.35rem; line-height: 1; flex: none; }
details.q[open] summary::after { content: "\2212"; }
details.q > div { padding: 0 0 1rem; }
details.q > div p:last-child { margin-bottom: 0; }
.path { color: var(--ink); font-weight: 600; }

/* The support page's form. Same card, same ink; the button is the store link's. */
form.card label { display: block; font-weight: 600; font-size: .95rem; margin: 0 0 .35rem; color: var(--ink); }
form.card textarea, form.card input {
  display: block; width: 100%; margin: 0 0 1rem; padding: .7rem .85rem;
  font: inherit; color: var(--ink); background: var(--ground);
  border: 1px solid var(--rule); border-radius: 12px;
}
form.card textarea { resize: vertical; }
form.card textarea:focus-visible, form.card input:focus-visible { outline: 3px solid var(--now); outline-offset: 1px; }
form.card button {
  font: inherit; font-weight: 600; color: var(--surface); background: var(--link);
  border: 0; border-radius: 999px; padding: .75rem 1.6rem; cursor: pointer;
}
form.card button:disabled { opacity: .5; cursor: default; }
form.card #status { margin: .6rem 0 0; color: var(--ink-2); min-height: 1.6em; }
form.card #status:empty { margin: 0; min-height: 0; }
/* Off screen, not display:none, which the bots this is for know to skip. */
form.card .trap { position: absolute; left: -9999px; width: 1px; height: 1px; }
