/* My Blood Tracker website. The world is the marketing posters: heavy navy type,
   soft pastel grounds borrowed from each poster, the app's dark card, and
   handwritten notes. No third-party requests: fonts are self-hosted. */

@font-face {
  font-family: 'Lexend';
  src: url('fonts/lexend-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Lexend';
  src: url('fonts/lexend-latin-ext.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Caveat';
  src: url('fonts/caveat-600.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}

:root {
  /* Poster world */
  --navy: #121852;
  --ink: #1d2347;
  --ink-2: #454c6e;
  --line: rgba(18, 24, 82, 0.12);
  --page: #f6f9ff;
  --sky: #e4effd;
  --mint: #e1f5ea;
  --lemon: #fff4cf;
  --lilac: #ebe7fb;
  --pink: #fde6f1;
  --coral: #e2405a;
  --swoosh: #3cb965;

  /* The app's dark theme (src/constants/theme.ts) */
  --app-bg: #0e1116;
  --app-surface: #171b22;
  --app-raised: #232a35;
  --app-border: #262c36;
  --app-text: #e6e9ee;
  --app-text-2: #9aa3b0;
  --app-accent: #7aa2f7;
  --app-in-range: #56a76a;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --radius: 20px;
  --gutter: clamp(16px, 4vw, 40px);
  --measure: 34rem;

  color-scheme: light;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scrollbar-color: #b9c1dd transparent;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: 'Lexend', system-ui, sans-serif;
  font-size: 1.125rem;
  line-height: 1.6;
  font-weight: 350;
  text-rendering: optimizeLegibility;
}

::selection {
  background: #c9d8ff;
  color: var(--navy);
}

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

a {
  color: var(--navy);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.2em;
}
a:hover {
  text-decoration-color: var(--coral);
}

:focus-visible {
  outline: 3px solid var(--navy);
  outline-offset: 3px;
  border-radius: 6px;
}

h1,
h2,
h3 {
  color: var(--navy);
  font-weight: 750;
  line-height: 1.05;
  letter-spacing: -0.035em;
  text-wrap: balance;
  margin: 0;
}

p {
  margin: 0;
  text-wrap: pretty;
}

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

.copy-link {
  margin-top: 24px;
  font-weight: 500;
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  padding: 10px 16px;
  background: var(--navy);
  color: #fff;
  border-radius: 10px;
  z-index: 10;
}
.skip:focus {
  top: 12px;
}

.wrap {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------------------------------------------------------------- header */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 20px;
  padding-bottom: 20px;
}

.brand {
  display: inline-flex;
  white-space: nowrap;
  align-items: center;
  gap: 10px;
  color: var(--navy);
  text-decoration: none;
  font-weight: 750;
  font-size: 1.25rem;
  letter-spacing: -0.03em;
}
.brand img {
  width: 30px;
  height: auto;
}

.top nav {
  display: flex;
  align-items: center;
  gap: clamp(12px, 3vw, 28px);
}
.top nav a:not(.btn) {
  font-weight: 500;
  font-size: 1rem;
  text-decoration: none;
}
.top nav a:not(.btn):hover {
  text-decoration: underline;
}

/* --------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  white-space: nowrap;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--navy);
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  box-shadow: 0 6px 16px -6px rgba(18, 24, 82, 0.5);
  transition:
    transform 140ms var(--ease-out),
    background-color 200ms ease,
    box-shadow 200ms ease;
}
.btn svg {
  width: 20px;
  height: 20px;
  flex: none;
}
.btn:active {
  transform: scale(0.97);
}
@media (hover: hover) and (pointer: fine) {
  .btn:hover {
    background: #222b7a;
    box-shadow: 0 10px 22px -8px rgba(18, 24, 82, 0.55);
  }
}
.btn-small {
  min-height: 44px;
  padding: 0 16px;
  font-size: 0.9375rem;
}

/* --------------------------------------------------------- handwriting */

.note {
  font-family: 'Caveat', 'Segoe Print', cursive;
  font-weight: 600;
  color: var(--navy);
  font-size: 1.75rem;
  line-height: 1.05;
  letter-spacing: 0;
}
.swoosh {
  display: block;
  width: 7.5em;
  height: 0.5em;
  margin-top: 0.15em;
  color: var(--swoosh);
}

/* ------------------------------------------------------------------ hero */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: center;
  gap: clamp(32px, 5vw, 72px);
  padding-top: clamp(24px, 6vw, 72px);
  padding-bottom: clamp(56px, 8vw, 104px);
}

.hero h1 {
  font-size: clamp(2.75rem, 1.4rem + 5.2vw, 5.5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 0.98;
}

.lede {
  margin-top: 24px;
  max-width: 30rem;
  font-size: clamp(1.1875rem, 1rem + 0.6vw, 1.4375rem);
  line-height: 1.45;
  color: var(--ink);
}

.hero-actions {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
}

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  font-weight: 500;
  font-size: 1rem;
  color: var(--ink-2);
}
.facts li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.facts svg {
  width: 20px;
  height: 20px;
  color: var(--swoosh);
  flex: none;
}

/* The diary: the app's Log screen, rebuilt so it can fill itself in. */

.diary {
  position: relative;
  margin: 0;
  justify-self: center;
  width: min(100%, 380px);
}

.device {
  background: var(--app-bg);
  color: var(--app-text);
  border-radius: 34px;
  padding: 22px 16px 18px;
  border: 6px solid #2a2f3a;
  box-shadow:
    0 2px 0 1px rgba(255, 255, 255, 0.04) inset,
    0 30px 60px -24px rgba(18, 24, 82, 0.55),
    0 12px 24px -12px rgba(18, 24, 82, 0.35);
  font-size: 0.9375rem;
  line-height: 1.4;
  font-weight: 400;
}

.device-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0 6px 14px;
}
.device-head b {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.device-head span {
  font-size: 0.75rem;
  color: var(--app-text-2);
}

.entry {
  background: var(--app-surface);
  border: 2px solid var(--app-accent);
  border-radius: 14px;
  padding: 10px 14px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.entry-value {
  font-size: 2.25rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  flex: 1;
  min-height: 1.2em;
  line-height: 1.2;
}
.entry-value .ch {
  display: inline-block;
}
.entry-unit {
  color: var(--app-text-2);
  font-size: 0.875rem;
}

.status {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 4px 4px 0;
  font-weight: 500;
}
.status svg {
  width: 18px;
  height: 18px;
  color: var(--app-in-range);
}

.save {
  margin: 8px 0 18px;
  min-height: 44px;
  border-radius: 999px;
  background: var(--app-accent);
  color: var(--app-bg);
  display: grid;
  place-items: center;
  font-weight: 600;
}

.day {
  padding: 0 6px 8px;
}
.day b {
  color: var(--app-accent);
  font-weight: 600;
}
.day small {
  display: block;
  color: var(--app-text-2);
  font-size: 0.8125rem;
}

.rows {
  list-style: none;
  margin: 0;
  padding: 0;
  border-radius: 12px;
  overflow: hidden;
  background: var(--app-surface);
}
.rows li {
  position: relative;
  display: grid;
  grid-template-columns: 3.4em 1fr auto 18px;
  align-items: center;
  gap: 8px;
  padding: 12px 12px 12px 16px;
  border-top: 1px solid var(--app-border);
}
.rows li:first-child {
  border-top: 0;
}
/* The app's 4px band stripe on each row */
.rows li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--app-in-range);
}
.rows time {
  color: var(--app-text-2);
  font-variant-numeric: tabular-nums;
}
.rows .v {
  font-weight: 600;
  font-size: 1.0625rem;
  font-variant-numeric: tabular-nums;
}
.rows svg {
  width: 18px;
  height: 18px;
  color: var(--app-in-range);
}
.rows .new {
  background: transparent;
}

/* Sits in the gap left of the card, arrow pointing at the value being typed. */
.diary-note {
  position: absolute;
  right: calc(100% + 4px);
  top: 2.4em;
  width: 5.6em;
  text-align: right;
  transform: rotate(-5deg);
  pointer-events: none;
}
.diary-note .arrow {
  width: 64px;
  height: 40px;
  margin: 4px 0 0 auto;
  color: var(--navy);
}

/* -------------------------------------------------------- record pages */

.page {
  padding: clamp(56px, 9vw, 112px) 0;
}
.page-sky {
  background: var(--sky);
}
.page-mint {
  background: var(--mint);
}
.page-lemon {
  background: var(--lemon);
}
.page-lilac {
  background: var(--lilac);
}
.page-pink {
  background: var(--pink);
}

.page .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(32px, 6vw, 96px);
}
.page.flip .copy {
  order: 2;
}

.copy h2 {
  font-size: clamp(2.25rem, 1.5rem + 2.8vw, 3.75rem);
  font-weight: 800;
  letter-spacing: -0.04em;
}
.copy > p {
  margin-top: 20px;
  max-width: var(--measure);
  font-size: clamp(1.125rem, 1rem + 0.35vw, 1.3125rem);
}
.copy ul {
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
  max-width: var(--measure);
  display: grid;
  gap: 10px;
}
.copy li {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 12px;
  align-items: start;
}
.copy li svg {
  width: 22px;
  height: 22px;
  margin-top: 0.2em;
  color: var(--navy);
}
.copy > .note {
  font-size: 1.75rem;
  max-width: none;
  margin-top: 28px;
  display: inline-block;
  transform: rotate(-3deg);
}

.poster {
  margin: 0;
  justify-self: center;
  width: min(100%, 420px);
}
.poster img {
  width: 100%;
  height: auto;
  aspect-ratio: 941 / 1672;
  border-radius: 28px;
  box-shadow:
    0 28px 56px -28px rgba(18, 24, 82, 0.45),
    0 0 0 1px rgba(18, 24, 82, 0.06);
}

/* ------------------------------------------------------------- close */

.close {
  background: var(--navy);
  color: #e9ecfb;
  padding: clamp(64px, 10vw, 120px) 0;
}
.close h2 {
  color: #fff;
  font-size: clamp(2.5rem, 1.5rem + 4vw, 4.75rem);
  font-weight: 800;
  letter-spacing: -0.04em;
}
.close .lede {
  color: #d5daf3;
  max-width: 36rem;
}
.close .btn {
  background: #fff;
  color: var(--navy);
  box-shadow: none;
}
@media (hover: hover) and (pointer: fine) {
  .close .btn:hover {
    background: #e4ebff;
  }
}
.close :focus-visible {
  outline-color: #fff;
}
.close .hero-actions {
  margin-top: 36px;
}
.important {
  margin-top: clamp(48px, 7vw, 80px);
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  max-width: 46rem;
  font-size: 1rem;
  color: #c9cfee;
}
.important strong {
  color: #fff;
  font-weight: 600;
}

/* ------------------------------------------------------------ footer */

.foot {
  padding-top: 32px;
  padding-bottom: 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  align-items: center;
  justify-content: space-between;
  font-size: 0.9375rem;
  color: var(--ink-2);
}
.foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}

/* ------------------------------------------------------- privacy (Read) */

.doc {
  max-width: 44rem;
  padding-top: clamp(24px, 5vw, 56px);
  padding-bottom: clamp(56px, 8vw, 96px);
}
.doc h1 {
  font-size: clamp(2.5rem, 1.6rem + 3.6vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.04em;
}
.doc .updated {
  margin-top: 12px;
  color: var(--ink-2);
  font-size: 1rem;
}
.doc .short {
  margin: 32px 0 8px;
  padding: 24px 28px;
  background: var(--mint);
  border-radius: var(--radius);
}
.doc .short h2 {
  font-size: 1.375rem;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}
.doc .short ul {
  margin: 0;
}
.doc h2 {
  margin: 48px 0 12px;
  font-size: clamp(1.5rem, 1.2rem + 1vw, 1.875rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
}
.doc p + p,
.doc p + ul,
.doc ul + p {
  margin-top: 14px;
}
.doc ul {
  padding-left: 1.25em;
  margin: 14px 0 0;
}
.doc li + li {
  margin-top: 8px;
}
.doc li::marker {
  color: var(--coral);
}
.doc strong {
  font-weight: 600;
  color: var(--navy);
}

/* ------------------------------------------------------------ narrow */

@media (max-width: 860px) {
  .hero,
  .page .wrap {
    grid-template-columns: minmax(0, 1fr);
  }
  .page.flip .copy {
    order: 0;
  }
  .diary {
    margin-top: 8px;
  }
  .diary-note {
    position: static;
    width: auto;
    margin: 0 0 4px 8px;
    text-align: left;
    transform: rotate(-3deg);
  }
  .diary-note .arrow {
    margin: 10px 0 0 7.5em;
    transform: rotate(40deg);
  }
  .poster {
    width: min(100%, 360px);
  }
}

@media (max-width: 520px) {
  .top nav .hide-narrow {
    display: none;
  }
}

/* Too narrow for brand and button side by side; the hero's button is right below. */
@media (max-width: 420px) {
  .top nav {
    display: none;
  }
}
