/*
 * Thrive Desktop's website. The colour tokens are the Thrive design system's two themes, from
 * thrive-health-product-hub's app_prototype/static/theme.css: thrive-personal (teal, for
 * patients) and thrive-clinical (navy, for providers). The tabs switch <html data-theme>.
 */

@font-face {
  font-family: 'Inter';
  src: url('/fonts/inter-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'Instrument Serif';
  src: url('/fonts/instrument-serif-latin-400-normal.woff2') format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'Instrument Serif';
  src: url('/fonts/instrument-serif-latin-400-italic.woff2') format('woff2');
  font-style: italic;
  font-display: swap;
}

:root,
[data-theme='thrive-clinical'] {
  --color-base-100: oklch(100% 0 0);
  --color-base-200: oklch(97.5% 0.006 250);
  --color-base-300: oklch(89% 0.008 250);
  --color-base-content: oklch(20% 0.015 256);
  --color-primary: oklch(28% 0.072 240);
  --color-primary-content: oklch(100% 0 0);
  --color-accent-ink: oklch(45% 0.1 175);
  --color-error: oklch(58% 0.13 25);
  --color-brand: #003a82;
  --glow: color-mix(in oklab, var(--color-primary) 30%, transparent);
}

[data-theme='thrive-personal'] {
  --color-base-100: oklch(100% 0 0);
  --color-base-200: oklch(94.5% 0.004 181);
  --color-base-300: oklch(90% 0.006 181);
  --color-base-content: oklch(22% 0.02 165);
  --color-primary: oklch(49% 0.12 175);
  --color-primary-content: oklch(100% 0 0);
  --color-accent-ink: oklch(45% 0.14 175);
  --color-error: oklch(58% 0.13 25);
  --color-brand: #003a82;
  --glow: color-mix(in oklab, var(--color-primary) 30%, transparent);
}

@media (prefers-color-scheme: dark) {
  :root,
  [data-theme='thrive-clinical'] {
    --color-base-100: oklch(20% 0.012 256);
    --color-base-200: oklch(14% 0.01 256);
    --color-base-300: oklch(36% 0.014 256);
    --color-base-content: oklch(96% 0.01 80);
    --color-primary: oklch(95% 0.01 80);
    --color-primary-content: oklch(15% 0.012 256);
    --color-accent-ink: oklch(75% 0.14 175);
    --color-error: oklch(72% 0.13 25);
    --color-brand: oklch(96% 0.01 80);
    --glow: oklch(70% 0.14 175 / 22%);
  }
  [data-theme='thrive-personal'] {
    --color-base-100: oklch(18% 0.014 165);
    --color-base-200: oklch(13% 0.012 165);
    --color-base-300: oklch(28% 0.016 165);
    --color-base-content: oklch(95% 0.012 165);
    --color-primary: oklch(65% 0.14 175);
    --color-primary-content: oklch(15% 0.012 165);
    --color-accent-ink: oklch(78% 0.18 175);
    --color-error: oklch(72% 0.13 25);
    --color-brand: oklch(95% 0.012 165);
    --glow: oklch(80% 0.22 180 / 18%);
  }
}

:root {
  --muted: color-mix(in oklab, var(--color-base-content) 68%, transparent);
  --radius-field: 0.375rem;
  --radius-box: 0.625rem;
  color-scheme: light dark;
}

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

body {
  min-height: 100vh;
  background: var(--color-base-200);
  color: var(--color-base-content);
  font: 400 1rem/1.5 'Inter', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
}

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

.wrap {
  width: min(1120px, 100% - 32px);
  margin-inline: auto;
}

.logo {
  display: block;
  height: 22px;
  width: auto;
  color: var(--color-brand);
}

.serif {
  font-family: 'Instrument Serif', 'Iowan Old Style', Georgia, serif;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.serif em {
  color: var(--color-accent-ink);
}

/* ---- Buttons ---- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 3rem;
  padding: 0 1.5rem;
  border: 0;
  border-radius: var(--radius-field);
  background: var(--color-primary);
  color: var(--color-primary-content);
  font: 600 1rem/1 'Inter', system-ui, sans-serif;
  text-decoration: none;
  cursor: pointer;
  transition: filter 0.15s ease, background-color 0.3s ease;
}

.btn:hover {
  filter: brightness(1.12);
}

.btn:disabled {
  opacity: 0.6;
  cursor: progress;
}

:focus-visible {
  outline: 3px solid color-mix(in oklab, var(--color-primary) 40%, transparent);
  outline-offset: 2px;
}

.btn svg {
  width: 1.125rem;
  height: 1.125rem;
}

/* ---- Page ---- */

.bar {
  padding: 28px 0;
}

.hero {
  padding: 40px 0 8px;
  text-align: center;
}

.app-icon {
  width: 96px;
  margin-inline: auto;
}

.hero h1 {
  margin-top: 12px;
  font-size: clamp(3.25rem, 9vw, 5.75rem);
  line-height: 1;
}

.lede {
  margin-top: 16px;
  font-size: 1.125rem;
  color: var(--muted);
}

.cta {
  margin-top: 32px;
  display: grid;
  justify-items: center;
  gap: 12px;
}

.meta {
  font-size: 0.8125rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.tabs {
  margin-top: 56px;
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--color-base-300);
  border-radius: 999px;
  background: var(--color-base-100);
}

.tabs button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 8px 22px;
  background: transparent;
  color: var(--muted);
  font: 500 0.9375rem/1.4 'Inter', system-ui, sans-serif;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.tabs button[aria-selected='true'] {
  background: var(--color-primary);
  color: var(--color-primary-content);
}

.panel {
  padding: 40px 0 112px;
}

.panel h2 {
  text-align: center;
  font-size: clamp(2.125rem, 5vw, 3.375rem);
  line-height: 1.1;
}

/* The app window, with the macOS buttons the screenshot leaves out. */
.window {
  position: relative;
  margin-top: 40px;
  border-radius: 12px;
  overflow: hidden;
  container-type: inline-size;
  box-shadow:
    0 0 0 1px color-mix(in oklab, var(--color-base-content) 12%, transparent),
    0 40px 100px -30px var(--glow),
    0 12px 32px -12px oklch(0% 0 0 / 18%);
}

.window img {
  width: 100%;
}

.lights {
  position: absolute;
  top: calc(18 / 1440 * 100cqw);
  left: calc(18 / 1440 * 100cqw);
  display: flex;
  gap: calc(8 / 1440 * 100cqw);
}

.lights span {
  width: calc(12 / 1440 * 100cqw);
  aspect-ratio: 1;
  border-radius: 50%;
  background: #ff5f57;
  box-shadow: inset 0 0 0 0.5px oklch(0% 0 0 / 18%);
}

.lights span:nth-child(2) {
  background: #febc2e;
}

.lights span:nth-child(3) {
  background: #28c840;
}

.tiles {
  list-style: none;
  padding: 0;
  margin-top: 56px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

/* A part of the window. Its card is the panel's own colour, so the picture sits in it seamlessly. */
.tile figure {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--color-base-300);
  border-radius: var(--radius-box);
  background: var(--color-base-100);
}

.tile figure.canvas {
  background: var(--color-base-200);
}

.tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: top;
}

.tile figure.canvas img {
  object-position: center;
}

.tile p {
  margin-top: 14px;
  font-weight: 500;
}

footer {
  border-top: 1px solid var(--color-base-300);
  padding: 24px 0 40px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.8125rem;
  color: var(--muted);
}

/* ---- Sign-in ---- */

.sign-in {
  display: grid;
  place-items: center;
  padding: 24px 16px;
}

.card {
  width: min(400px, 100%);
  padding: 40px 40px 32px;
  border: 1px solid var(--color-base-300);
  border-radius: var(--radius-box);
  background: var(--color-base-100);
}

.card h1 {
  margin-top: 40px;
  font-size: 2.75rem;
  line-height: 1.05;
}

.card form {
  margin-top: 32px;
  display: grid;
  gap: 8px;
}

.card label {
  font-size: 0.875rem;
  font-weight: 500;
}

.card input {
  height: 3rem;
  padding: 0 14px;
  border: 1px solid color-mix(in oklab, var(--color-base-content) 35%, var(--color-base-100));
  border-radius: var(--radius-field);
  background: var(--color-base-100);
  color: var(--color-base-content);
  font: 400 1rem 'Inter', system-ui, sans-serif;
}

.card input:focus-visible {
  outline-offset: 0;
  border-color: var(--color-base-content);
}

.card .btn {
  margin-top: 16px;
  width: 100%;
}

.error {
  font-size: 0.875rem;
  color: var(--color-error);
}

[hidden] {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
