/* Shadelle website: one stylesheet, no framework, nothing loaded from another host.

   Built on the foundations of Radix Themes (MIT, github.com/radix-ui/themes): its 9-step type scale, 9-step
   space scale, 6-step radius scale, container sizes and breakpoints, and the role of each step of a Radix colour
   scale. The colours are Shadelle's own (Shared/Palette.swift: Porcelain and Nuit) and the display face is the
   app's Bodoni Moda (OFL). See web/README.md for what was taken and where our rules win. */

@font-face {
  font-family: "Bodoni Moda";
  src: url("/fonts/bodoni-moda-latin.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;

  /* Colour roles, named after the Radix scale step they fill (1-2 backgrounds, 3 component background,
     6 subtle border, 8 control border, 9 solid, 11 low-contrast text, 12 high-contrast text). Porcelain. */
  --gray-1: #FAF8F9;   /* canvas */
  --gray-2: #F4F1F3;   /* blush */
  --gray-3: #F2EEF0;   /* petal */
  --surface: #FFFFFF;  /* cards and the short-version box */
  --gray-6: #E8E1E5;   /* lace: hairlines */
  --gray-8: #8C7C84;   /* edge: focus-visible outlines on neutral controls */
  --gray-11: #6B5B63;  /* inkSoft: secondary text, 6.0:1 on canvas */
  --gray-12: #2B1F25;  /* ink: main text */
  --accent-9: #A8274D; /* cherry: the one accent */
  --accent-11: #A8274D;/* cherry as link text, 6.5:1 on canvas */
  --marker: #F7D3DC;   /* ballet: the marker behind "Not you." (used once) */
  --shot-shadow: 0 1px 2px rgb(43 31 37 / 0.06), 0 12px 32px -12px rgb(43 31 37 / 0.18);

  /* Radix Themes type scale (font-size-1 to 9) and its line heights. */
  --font-size-1: 12px;  --line-height-1: 16px;
  --font-size-2: 14px;  --line-height-2: 20px;
  --font-size-3: 16px;  --line-height-3: 24px;
  --font-size-4: 18px;  --line-height-4: 26px;
  --font-size-5: 20px;  --line-height-5: 28px;
  --font-size-6: 24px;  --line-height-6: 30px;
  --font-size-7: 28px;  --line-height-7: 36px;
  --font-size-8: 35px;  --line-height-8: 40px;
  --font-size-9: 60px;  --line-height-9: 60px;

  /* Radix Themes space scale, plus one step for the landing page's section rhythm (1.5 x space-9). */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 40px;
  --space-8: 48px;
  --space-9: 64px;
  --space-10: 96px;

  /* Radix Themes radius scale (radius "medium"). */
  --radius-1: 3px;
  --radius-2: 4px;
  --radius-3: 6px;
  --radius-4: 8px;
  --radius-5: 12px;
  --radius-6: 16px;

  /* Radix Themes container sizes 2 and 4. */
  --container-2: 688px;
  --container-4: 1136px;

  /* One easing curve for everything that moves, short durations (Emil Kowalski's design-engineering rules). */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --duration-press: 160ms;
  --duration-color: 150ms;

  /* The page gutter: 16 px, or more where the iPhone's rounded corners or notch need it in landscape. */
  --gutter-left: max(16px, env(safe-area-inset-left, 0px));
  --gutter-right: max(16px, env(safe-area-inset-right, 0px));

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Bodoni Moda", "Bodoni 72", Didot, "Bodoni MT", Georgia, serif;
}

@media (min-width: 768px) {
  :root {
    --gutter-left: max(32px, env(safe-area-inset-left, 0px));
    --gutter-right: max(32px, env(safe-area-inset-right, 0px));
  }
}

/* Nuit. */
@media (prefers-color-scheme: dark) {
  :root {
    --gray-1: #141213;
    --gray-2: #1A1719;
    --gray-3: #272325;
    --surface: #1D1A1C;
    --gray-6: #352F32;
    --gray-8: #7F7177;
    --gray-11: #B4A8AE;
    --gray-12: #F2ECEF;
    --accent-9: #FF9EB6;
    --accent-11: #FF9EB6;
    --marker: #4D2B39;
    --shot-shadow: none;
  }
}

/* Increase Contrast and Windows high contrast: secondary text becomes main text, hairlines become edges. */
@media (prefers-contrast: more) {
  :root {
    --gray-11: var(--gray-12);
    --gray-6: var(--gray-8);
  }
}

/* Base */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  background: var(--gray-1);
}

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

body {
  margin: 0;
  background: var(--gray-1);
  color: var(--gray-12);
  font-family: var(--sans);
  font-size: var(--font-size-3);
  line-height: 26px;
  overflow-wrap: break-word;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-weight: 400;
  color: var(--gray-12);
  text-wrap: balance;
  margin: 0;
}

p,
ul,
ol,
dl {
  margin: 0;
}

p {
  text-wrap: pretty;
}

strong {
  font-weight: 600;
}

a {
  color: var(--accent-11);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  touch-action: manipulation;
  transition: color var(--duration-color) ease, text-decoration-color var(--duration-color) ease;
}

@media (hover: hover) and (pointer: fine) {
  a:hover {
    text-decoration-thickness: 2px;
  }
}

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.container {
  width: 100%;
  max-width: calc(var(--container-4) + var(--gutter-left) + var(--gutter-right));
  margin-inline: auto;
  padding-left: var(--gutter-left);
  padding-right: var(--gutter-right);
}

/* Skip link: off screen until it gets keyboard focus. */
.skip {
  position: absolute;
  z-index: 10;
  left: var(--gutter-left);
  top: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: var(--surface);
  color: var(--accent-11);
  border: 1px solid var(--gray-6);
  border-radius: var(--radius-4);
  transform: translateY(calc(-100% - 24px));
}

.skip:focus {
  transform: none;
}

/* Header */

.site-header {
  padding-top: env(safe-area-inset-top, 0px);
}

.header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 var(--space-3);
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding-block: var(--space-2);
  color: var(--gray-12);
  text-decoration: none;
}

.brand img {
  width: 28px;
  height: 28px;
  border-radius: 22.4%;
}

.brand span {
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-size: var(--font-size-5);
  line-height: var(--line-height-5);
  letter-spacing: -0.005em;
}

.nav {
  display: flex;
  gap: 0 var(--space-1);
  padding: 0;
  margin: 0 calc(-1 * var(--space-1)) 0 0;
  list-style: none;
}

.nav a {
  display: block;
  padding: var(--space-3) var(--space-1);
  color: var(--gray-11);
  font-size: var(--font-size-2);
  line-height: var(--line-height-2);
  text-decoration: none;
}

.nav a[aria-current="page"] {
  color: var(--gray-12);
  text-decoration: underline;
  text-decoration-color: var(--gray-6);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

@media (hover: hover) and (pointer: fine) {
  .nav a:hover {
    color: var(--gray-12);
  }
}

@media (min-width: 768px) {
  .nav {
    gap: 0 var(--space-5);
  }

  .nav a {
    font-size: var(--font-size-3);
    line-height: var(--line-height-3);
  }

  .brand span {
    font-size: var(--font-size-6);
    line-height: var(--line-height-6);
    letter-spacing: -0.00625em;
  }
}

/* Landing: hero */

.hero {
  display: grid;
  gap: var(--space-8);
  padding-top: var(--space-8);
  padding-bottom: var(--space-9);
}

.hero h1 {
  font-size: var(--font-size-8);
  line-height: var(--line-height-8);
  letter-spacing: -0.01em;
  max-width: 14ch;
}

/* The marker behind "Not you.": a thick ballet-pink underline that sits behind the lower half of the letters,
   like a highlighter stroke (the app's welcome does the same, once). */
mark {
  background: none;
  color: inherit;
  text-decoration-line: underline;
  text-decoration-color: var(--marker);
  text-decoration-thickness: 0.32em;
  text-underline-offset: -0.18em;
  text-decoration-skip-ink: none;
}

.lede {
  font-size: var(--font-size-4);
  line-height: 28px;
  color: var(--gray-11);
}

.hero .lede {
  margin-top: var(--space-5);
  max-width: 34rem;
}

.availability {
  margin-top: var(--space-6);
  font-weight: 600;
  color: var(--gray-12);
}

.availability span {
  display: block;
  font-weight: 400;
  color: var(--gray-11);
}

.hero .text-link {
  margin-top: var(--space-4);
}

.text-link {
  display: inline-block;
  padding-block: var(--space-2);
  font-weight: 500;
}

/* Screenshots are shown whole, in the shape of the iPhone display (no drawn device around them). The corner
   radius is 13.6% of the width, the display's own corner on a 1206 x 2622 capture. */
.shot {
  width: 100%;
  border-radius: 13.6% / 6.26%;
  outline: 1px solid var(--gray-6);
  outline-offset: -1px;
  box-shadow: var(--shot-shadow);
  background: var(--surface);
}

.hero-shots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
  max-width: 520px;
  padding-bottom: var(--space-6);
}

.hero-shots .shot {
  --offset: 0px;
  transform: translateY(var(--offset));
}

.hero-shots .shot:nth-child(2) {
  --offset: var(--space-6);
}

/* One entrance, once: the two screens settle by 12 px. They are fully visible from the first frame (no opacity),
   so a paused tab, a screenshot or a crawler still sees them. Reduced motion: the last frame, no movement. */
@media (prefers-reduced-motion: no-preference) {
  .hero-shots .shot {
    animation: settle 640ms var(--ease-out) both;
  }

  .hero-shots .shot:nth-child(2) {
    animation-delay: 60ms;
  }
}

@keyframes settle {
  from { transform: translateY(calc(var(--offset) + 12px)); }
  to { transform: translateY(var(--offset)); }
}

@media (min-width: 768px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: var(--space-9);
    padding-top: var(--space-9);
    padding-bottom: var(--space-10);
  }

  .hero-shots {
    gap: var(--space-5);
    justify-self: end;
    width: 100%;
  }

  .hero-shots .shot:nth-child(2) {
    --offset: var(--space-8);
  }

  .hero-shots {
    padding-bottom: var(--space-8);
  }
}

@media (min-width: 1024px) {
  .hero h1 {
    font-size: var(--font-size-9);
    line-height: var(--line-height-9);
    letter-spacing: -0.025em;
  }
}

/* Landing: sections */

.section {
  padding-block: var(--space-9);
  border-top: 1px solid var(--gray-6);
}

@media (min-width: 768px) {
  .section {
    padding-block: var(--space-10);
  }
}

.section-head {
  max-width: 40rem;
  margin-bottom: var(--space-7);
}

.section-head h2,
.closing h2 {
  font-size: var(--font-size-7);
  line-height: var(--line-height-7);
  letter-spacing: -0.0075em;
}

.section-head p {
  margin-top: var(--space-3);
  color: var(--gray-11);
}

@media (min-width: 768px) {
  .section-head h2,
  .closing h2 {
    font-size: var(--font-size-8);
    line-height: var(--line-height-8);
    letter-spacing: -0.01em;
  }
}

/* Features: four blocks of text on a two-column grid. */
.features {
  display: grid;
  gap: var(--space-7) var(--space-8);
}

.feature h3 {
  font-size: var(--font-size-6);
  line-height: var(--line-height-6);
  font-weight: 500;
  letter-spacing: -0.00625em;
}

.feature ul {
  margin-top: var(--space-3);
  padding-left: 1.1em;
  color: var(--gray-11);
}

.feature li + li {
  margin-top: var(--space-2);
}

.feature li::marker {
  color: var(--gray-8);
}

@media (min-width: 768px) {
  .features {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Gallery: the app's screens, whole. A swipeable row on phones, five across from 1024 px. */
.gallery {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(62%, 240px);
  gap: var(--space-4);
  margin: 0 calc(-1 * var(--gutter-right)) 0 calc(-1 * var(--gutter-left));
  padding: var(--space-1) var(--gutter-right) var(--space-5) var(--gutter-left);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter-left) var(--gutter-right);
  list-style: none;
  scrollbar-width: thin;
  scrollbar-color: var(--gray-6) transparent;
}

.gallery li {
  scroll-snap-align: start;
}

.gallery figure {
  margin: 0;
}

.gallery figcaption {
  margin-top: var(--space-3);
  font-size: var(--font-size-2);
  line-height: var(--line-height-2);
  color: var(--gray-11);
}

.gallery figcaption strong {
  display: block;
  margin-bottom: 2px;
  font-weight: 500;
  color: var(--gray-12);
}

@media (min-width: 1024px) {
  .gallery {
    grid-auto-flow: row;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: var(--space-5);
    margin: 0;
    padding: 0;
    overflow: visible;
  }
}

/* Private by design: text, then the policies, with the health data policy first and largest (MHMDA,
   RCW 19.373.020(1)(b), asks for a prominent link on the homepage). */
.privacy-split {
  display: grid;
  gap: var(--space-7);
}

.privacy-split ul.plain {
  margin-top: var(--space-5);
  padding-left: 1.1em;
  color: var(--gray-11);
}

.privacy-split ul.plain li + li {
  margin-top: var(--space-2);
}

.privacy-split ul.plain li::marker {
  color: var(--gray-8);
}

@media (min-width: 768px) {
  .privacy-split {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: var(--space-9);
    align-items: start;
  }
}

.policy-links {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--gray-6);
}

.policy-links li {
  border-bottom: 1px solid var(--gray-6);
}

.policy-links a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 20px;
  gap: var(--space-1) var(--space-4);
  align-items: center;
  padding: var(--space-5) var(--space-2);
  margin-inline: calc(-1 * var(--space-2));
  border-radius: var(--radius-4);
  color: var(--gray-12);
  text-decoration: none;
  transition: background-color var(--duration-color) ease, transform var(--duration-press) var(--ease-out);
}

.policy-links a:active {
  background: var(--gray-3);
  transform: scale(0.99);
}

@media (hover: hover) and (pointer: fine) {
  .policy-links a:hover {
    background: var(--gray-2);
  }
}

.policy-links .title {
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-size: var(--font-size-5);
  line-height: var(--line-height-5);
  font-weight: 500;
  color: var(--accent-11);
}

.policy-links .first .title {
  font-size: var(--font-size-6);
  line-height: var(--line-height-6);
}

.policy-links .desc {
  grid-column: 1;
  font-size: var(--font-size-2);
  line-height: var(--line-height-2);
  color: var(--gray-11);
}

.policy-links svg {
  grid-column: 2;
  grid-row: 1 / span 2;
  width: 20px;
  height: 20px;
  color: var(--gray-11);
}

/* The note: Shadelle measures, it doesn't diagnose. Plain, no ornament (DESIGN law 2). */
.note {
  display: grid;
  gap: var(--space-3);
  max-width: var(--container-2);
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--gray-6);
  border-radius: var(--radius-6);
}

.gallery + .note {
  margin-top: var(--space-6);
}

@media (min-width: 1024px) {
  .gallery + .note {
    margin-top: var(--space-9);
  }
}

.note h2 {
  font-size: var(--font-size-5);
  line-height: var(--line-height-5);
  font-weight: 500;
}

.note p {
  color: var(--gray-11);
}

.note p strong {
  color: var(--gray-12);
}

@media (min-width: 768px) {
  .note {
    padding: var(--space-6);
  }
}

.closing p {
  margin-top: var(--space-4);
  font-size: var(--font-size-4);
  line-height: 28px;
  color: var(--gray-11);
}

.closing p.availability {
  margin-top: var(--space-5);
  font-size: var(--font-size-3);
  line-height: 26px;
  color: var(--gray-12);
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--gray-6);
  color: var(--gray-11);
  font-size: var(--font-size-2);
  line-height: var(--line-height-2);
}

.site-footer .container {
  display: grid;
  gap: var(--space-4);
  padding-top: var(--space-6);
  padding-bottom: calc(var(--space-8) + env(safe-area-inset-bottom, 0px));
}

.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-5);
  margin: 0 0 0 calc(-1 * var(--space-1));
  padding: 0;
  list-style: none;
}

.site-footer a {
  display: inline-block;
  padding: var(--space-2) var(--space-1);
  color: var(--gray-11);
}

@media (hover: hover) and (pointer: fine) {
  .site-footer a:hover {
    color: var(--gray-12);
  }
}

.site-footer p + p {
  margin-top: var(--space-1);
}

/* Policy pages: an article at reading width, with the table of contents beside it from 1024 px. */

.doc {
  padding-top: var(--space-7);
  padding-bottom: var(--space-9);
}

.doc-grid {
  display: block;
}

.doc-head h1 {
  font-size: var(--font-size-8);
  line-height: var(--line-height-8);
  letter-spacing: -0.01em;
}

.doc-head .meta {
  margin-top: var(--space-3);
  font-size: var(--font-size-2);
  line-height: var(--line-height-2);
  color: var(--gray-11);
  font-variant-numeric: tabular-nums;
}

.doc-head .lede {
  margin-top: var(--space-5);
}

.article {
  max-width: var(--container-2);
}

.article > p,
.article > ul,
.article > ol,
.article > dl,
.article section > p,
.article section > ul,
.article section > ol,
.article section > dl {
  margin-top: var(--space-4);
}

.article ul,
.article ol {
  padding-left: 1.25em;
}

.article li + li {
  margin-top: var(--space-2);
}

.article li::marker {
  color: var(--gray-8);
}

.article ol > li::marker {
  color: var(--gray-11);
  font-variant-numeric: tabular-nums;
}

.article h2 {
  margin-top: var(--space-8);
  font-size: var(--font-size-6);
  line-height: var(--line-height-6);
  font-weight: 500;
  letter-spacing: -0.00625em;
  scroll-margin-top: var(--space-5);
}

.article h3 {
  margin-top: var(--space-6);
  font-size: var(--font-size-5);
  line-height: var(--line-height-5);
  font-weight: 500;
  scroll-margin-top: var(--space-5);
}

.article dt {
  margin-top: var(--space-4);
  font-weight: 600;
}

.article dd {
  margin: var(--space-1) 0 0;
}

.article .small {
  font-size: var(--font-size-2);
  line-height: var(--line-height-2);
  color: var(--gray-11);
}

/* The short version, and other boxed notes. A raised surface with a hairline, never a tint. */
.box {
  margin-top: var(--space-6);
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--gray-6);
  border-radius: var(--radius-6);
}

.box > h2,
.box > h3 {
  margin-top: 0;
  font-size: var(--font-size-5);
  line-height: var(--line-height-5);
}

.box > :first-child {
  margin-top: 0;
}

.box > p,
.box > ul {
  margin-top: var(--space-3);
}

@media (min-width: 768px) {
  .box {
    padding: var(--space-6);
  }
}

/* On this page */
.toc {
  margin-top: var(--space-7);
  padding-top: var(--space-5);
  border-top: 1px solid var(--gray-6);
}

.toc h2 {
  margin: 0;
  font-family: var(--sans);
  font-size: var(--font-size-2);
  line-height: var(--line-height-2);
  font-weight: 600;
  color: var(--gray-11);
  letter-spacing: 0;
}

.toc ol {
  margin: var(--space-2) 0 0;
  padding: 0;
  list-style: none;
  counter-reset: toc;
}

.toc li {
  counter-increment: toc;
}

.toc a {
  display: grid;
  grid-template-columns: 2ch minmax(0, 1fr);
  gap: var(--space-2);
  padding: 6px 0;
  color: var(--gray-12);
  font-size: var(--font-size-2);
  line-height: var(--line-height-2);
  text-decoration: none;
}

.toc a::before {
  content: counter(toc);
  color: var(--gray-11);
  font-variant-numeric: tabular-nums;
}

.toc.unnumbered a {
  grid-template-columns: minmax(0, 1fr);
}

.toc.unnumbered a::before {
  content: none;
}

@media (hover: hover) and (pointer: fine) {
  .toc a:hover {
    color: var(--accent-11);
  }
}

@media (min-width: 1024px) {
  .doc {
    padding-top: var(--space-9);
  }

  .doc-grid {
    display: grid;
    grid-template-columns: minmax(0, var(--container-2)) 240px;
    justify-content: space-between;
    gap: 0 var(--space-9);
    align-items: start;
  }

  .doc-grid > .article {
    grid-column: 1;
  }

  .doc-grid > .toc {
    grid-column: 2;
    grid-row: 1 / span 2;
    position: sticky;
    top: var(--space-5);
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    margin-top: 0;
    padding-top: var(--space-1);
    border-top: 0;
  }
}

/* 404 */
.lost {
  padding-top: var(--space-9);
  padding-bottom: var(--space-10);
  max-width: var(--container-2);
}

.lost h1 {
  font-size: var(--font-size-8);
  line-height: var(--line-height-8);
  letter-spacing: -0.01em;
}

.lost p {
  margin-top: var(--space-4);
  color: var(--gray-11);
}

.lost ul {
  margin-top: var(--space-6);
}

/* Print: the text, without the chrome. */
@media print {
  .skip,
  .nav,
  .toc,
  .site-footer ul {
    display: none;
  }

  html,
  body {
    background: #FFFFFF;
    color: #000000;
  }

  .box,
  .note {
    border-color: #999999;
  }

  .doc-grid {
    display: block;
  }
}
