/* Design tokens from the Liquid Carbon Design System (Figma). */
@font-face {
  font-family: "Noto Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/noto-sans-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Noto Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("assets/fonts/noto-sans-latin-600-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Noto Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("assets/fonts/noto-sans-latin-700-normal.woff2") format("woff2");
}

:root {
  color-scheme: light;

  --font-sans: "Noto Sans", "Helvetica Neue", Arial, sans-serif;

  --background: #ffffff;
  --foreground: #0e0e11;
  --muted: #f4f4f5;
  --muted-foreground: #71717a;
  --border: #e4e4e7;

  /* Merck brand colors */
  --vibrant-yellow: #ffc832;
  --rich-purple: #503291;
  /* green/800: Rich Green ramp step with AA contrast on Vibrant Yellow */
  --green-800: #175636;
  --green-900: #1b4330;

  --spacing-1: 4px;
  --spacing-2: 8px;
  --spacing-3: 12px;
  --spacing-4: 16px;
  --spacing-6: 24px;
  --spacing-8: 32px;
  --spacing-10: 40px;
  --spacing-12: 48px;
  --spacing-16: 64px;

  --container-max: 1280px;
  --container-padding-x: 24px;
  --section-padding-y: clamp(48px, 8vw, 96px);
  --radius-md: 8px;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
}

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

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

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 24px;
}

main {
  flex: 1 0 auto;
}

img {
  max-width: 100%;
}

a {
  color: inherit;
  text-underline-offset: 3px;
}

a:focus-visible,
.button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

/* Liquid Carbon's focus ring (primary at 40% opacity, flush with the button) is too faint on
   the yellow background, so buttons get a solid primary ring with a gap (5.6:1 on yellow). */
.button:focus-visible {
  outline-color: var(--green-800);
}

sup.reg {
  font-size: 0.6em;
  line-height: 0;
  vertical-align: 0.75em;
}

.skip-link {
  position: absolute;
  top: var(--spacing-2);
  left: var(--spacing-2);
  z-index: 10;
  padding: var(--spacing-2) var(--spacing-4);
  border-radius: var(--radius-md);
  background: var(--foreground);
  color: var(--background);
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-padding-x);
}

/* Header */
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-6);
  min-height: 96px;
}

.site-header .logo {
  display: block;
  margin-left: auto;
}

.site-header .logo img {
  display: block;
  width: clamp(112px, 16vw, 176px);
  height: auto;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-2);
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  text-decoration: none;
}

.back-link:hover {
  text-decoration: underline;
}

/* Landing page */
.page-home {
  background: var(--vibrant-yellow);
  color: var(--green-800);
}

.hero {
  /* Distance from the container edge to the viewport edge, used to bleed the image out. */
  --hero-bleed: calc(var(--container-padding-x) + max(0px, (100vw - var(--container-max)) / 2));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.hero .container {
  flex: 1 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 5fr);
  gap: var(--spacing-8);
  align-items: end;
}

.hero-content {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-8);
  align-self: center;
  padding-block: var(--spacing-8) var(--section-padding-y);
}

.hero h1 {
  margin: 0;
  font-weight: 700;
}

.hero .product-name {
  display: block;
  margin-bottom: var(--spacing-2);
  font-size: 24px;
  line-height: 32px;
}

.hero .headline {
  display: block;
  font-size: 48px;
  line-height: 52px;
}

.hero-text {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-4);
  max-width: 560px;
  font-size: 18px;
  line-height: 28px;
}

.hero-text p {
  margin: 0;
}

.download {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-4);
  container-type: inline-size;
}

.download-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 24px;
}

/* The store buttons share the size of the larger one, stacked or side by side. */
.download-links {
  display: inline-grid;
  grid-auto-rows: 1fr;
  align-self: flex-start;
  gap: var(--spacing-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.download-links .button {
  width: 100%;
  height: 100%;
}

/* Side by side once two buttons as wide as the Android label (340px) fit. */
@container (min-width: 692px) {
  .download-links {
    grid-auto-columns: 1fr;
    grid-auto-flow: column;
  }
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-2);
  min-height: 40px;
  padding: var(--spacing-2) var(--spacing-6);
  border-radius: var(--radius-md);
  background: var(--green-800);
  box-shadow: var(--shadow-xs);
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  text-align: center;
  text-decoration: none;
}

.button:hover {
  background: var(--green-900);
}

.hero-media {
  justify-self: end;
  width: min(calc(100% + var(--hero-bleed)), 880px);
  margin-right: calc(-1 * var(--hero-bleed));
  line-height: 0;
}

.hero-media img {
  display: block;
  width: 100%;
  height: auto;
}

/* Legal pages */
.legal {
  padding-block: var(--spacing-12) var(--section-padding-y);
}

.legal .container {
  max-width: calc(720px + 2 * var(--container-padding-x));
}

.legal h1 {
  margin: 0;
  font-size: 48px;
  font-weight: 700;
  line-height: 52px;
}

.legal .doc-meta {
  margin: var(--spacing-4) 0 0;
  color: var(--muted-foreground);
  font-size: 14px;
  line-height: 20px;
}

.legal h2 {
  margin: var(--spacing-12) 0 0;
  padding-bottom: var(--spacing-2);
  border-bottom: 1px solid var(--border);
  font-size: 30px;
  font-weight: 700;
  line-height: 36px;
}

.legal h3 {
  margin: var(--spacing-8) 0 0;
  font-size: 24px;
  font-weight: 700;
  line-height: 32px;
}

.legal h2,
.legal h3 {
  scroll-margin-top: var(--spacing-6);
}

.legal p,
.legal address {
  margin: var(--spacing-6) 0 0;
}

.legal address {
  font-style: normal;
}

.legal ul,
.legal ol {
  margin: var(--spacing-6) 0 0;
  padding-left: var(--spacing-6);
}

.legal li + li {
  margin-top: var(--spacing-2);
}

.legal ol.list-roman {
  list-style-type: lower-roman;
}

.legal a {
  overflow-wrap: anywhere;
}

.toc {
  margin-top: var(--spacing-10);
  padding: var(--spacing-6);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--muted);
}

.toc h2 {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 20px;
  line-height: 28px;
}

.toc ol {
  margin: var(--spacing-4) 0 0;
  padding: 0;
  list-style: none;
}

.toc ol ol {
  margin-top: var(--spacing-2);
  padding-left: var(--spacing-6);
}

.toc li + li {
  margin-top: var(--spacing-2);
}

.toc a {
  text-decoration: none;
}

.toc a:hover {
  text-decoration: underline;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--background);
  color: var(--muted-foreground);
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-4) var(--spacing-8);
  padding-block: var(--spacing-8);
}

.site-footer p {
  margin: 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-2) var(--spacing-8);
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-links a {
  text-decoration: none;
}

.footer-links a:hover,
.footer-links a[aria-current="page"] {
  color: var(--foreground);
  text-decoration: underline;
}

@media (max-width: 900px) {
  .hero .container {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .hero-content {
    padding-bottom: var(--spacing-8);
  }

  .hero-media {
    width: min(calc(100% + var(--hero-bleed)), 560px);
  }
}

@media (max-width: 640px) {
  .site-header .container {
    min-height: 72px;
  }

  .hero .product-name {
    font-size: 20px;
    line-height: 28px;
  }

  .hero .headline,
  .legal h1 {
    font-size: 36px;
    line-height: 40px;
  }

  .legal h2 {
    font-size: 24px;
    line-height: 32px;
  }

  .legal h3 {
    font-size: 20px;
    line-height: 28px;
  }

  .download-links {
    align-self: stretch;
  }

  .site-footer .container {
    flex-direction: column;
    align-items: flex-start;
  }
}
