/*
 * Chart Relay — public site (chartrelay.vet).
 *
 * This is the PUBLIC product site. The authenticated application is a separate
 * artifact served from app.chartrelay.vet; nothing here is shared with it at
 * runtime and nothing here reads application configuration.
 *
 * The palette and spacing below are the SAME tokens the application uses
 * (apps/web/src/styles/app.css), copied rather than imported so this page ships
 * as two static files with no build-time coupling to the app's bundle. The
 * names match so the two stay recognisably one design system: `--cr-color-navy`
 * is the exact ground the approved logo artwork is drawn on, and
 * `--cr-color-accent` is the logo's own "Relay" blue.
 *
 * Deliberately: no web fonts (the application uses the system stack, and a
 * font request is a third-party dependency this page does not need), no
 * JavaScript, no analytics, no dark mode — the application has none by
 * decision, and a public page that inverted itself would stop looking like the
 * product.
 */

:root {
  --cr-color-bg: #f7f8fa;
  --cr-color-surface: #ffffff;
  --cr-color-surface-sunken: #f4f6f8;
  --cr-color-border: #dde1e6;
  --cr-color-border-strong: #c3cad2;
  --cr-color-text: #1f2933;
  --cr-color-text-muted: #52606d;
  --cr-color-primary: #2454a8;

  --cr-color-navy: #00183a;
  --cr-color-navy-deep: #01152f;
  --cr-color-navy-raised: #0b3167;
  --cr-color-navy-border: rgba(255, 255, 255, 0.12);
  --cr-color-on-navy: #f2f6fc;
  --cr-color-on-navy-muted: #9db1cf;

  --cr-color-accent: #005feb;
  --cr-color-accent-on-navy: #4d97ff;

  --cr-space-xs: 0.25rem;
  --cr-space-sm: 0.5rem;
  --cr-space-md: 1rem;
  --cr-space-lg: 1.5rem;
  --cr-space-xl: 2rem;
  --cr-space-2xl: 3rem;

  --cr-radius: 6px;
  --cr-radius-lg: 10px;

  --cr-font-family:
    -apple-system, blinkmacsystemfont, 'Segoe UI', roboto, helvetica, arial, sans-serif;

  --cr-focus-ring-color: var(--cr-color-primary);
  --cr-focus-ring-width: 2px;
  --cr-focus-ring-offset: 2px;

  --cr-shell-max: 68rem;
  --cr-shell-gutter: 1.25rem;
}

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

html {
  scroll-behavior: smooth;
  /* The sticky header must not cover the heading an anchor jumps to. */
  scroll-padding-top: 6.5rem;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--cr-color-surface);
  color: var(--cr-color-text);
  font-family: var(--cr-font-family);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  color: var(--cr-color-navy);
  line-height: 1.2;
  text-wrap: balance;
  margin: 0;
}

p {
  margin: 0;
}

a {
  color: var(--cr-color-primary);
}

:focus-visible {
  outline: var(--cr-focus-ring-width) solid var(--cr-focus-ring-color);
  outline-offset: var(--cr-focus-ring-offset);
  border-radius: var(--cr-radius);
}

.section-navy :focus-visible {
  outline-color: var(--cr-color-accent-on-navy);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: var(--cr-space-sm) var(--cr-space-md);
  background: var(--cr-color-navy);
  color: var(--cr-color-on-navy);
  border-radius: 0 0 var(--cr-radius) 0;
  text-decoration: none;
}

.skip-link:focus {
  left: 0;
}

.shell {
  width: 100%;
  max-width: var(--cr-shell-max);
  margin-inline: auto;
  padding-inline: var(--cr-shell-gutter);
}

.shell.narrow {
  max-width: 46rem;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--cr-color-surface);
  border-bottom: 1px solid var(--cr-color-border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--cr-space-lg);
  min-height: 4.5rem;
  padding-block: var(--cr-space-sm);
}

.header-brand {
  display: block;
  flex: none;
  line-height: 0;
  border-radius: var(--cr-radius);
}

.header-brand img {
  display: block;
  width: 7.5rem;
  height: auto;
}

.header-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--cr-space-md) var(--cr-space-lg);
  justify-content: flex-end;
}

.header-nav a {
  color: var(--cr-color-text-muted);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  padding-block: var(--cr-space-xs);
  border-bottom: 2px solid transparent;
}

.header-nav a:hover {
  color: var(--cr-color-navy);
  border-bottom-color: var(--cr-color-accent);
}

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

.hero {
  background: var(--cr-color-surface);
  border-bottom: 1px solid var(--cr-color-border);
}

.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--cr-space-lg);
  padding-block: clamp(2.5rem, 6vw, 4.5rem);
}

.hero-mark {
  display: block;
  width: min(26rem, 100%);
  height: auto;
}

.hero h1 {
  font-size: clamp(2rem, 5.2vw, 3.25rem);
  letter-spacing: -0.02em;
  margin: 0;
}

.hero-lede {
  max-width: 44rem;
  font-size: clamp(1.0625rem, 1.7vw, 1.1875rem);
  color: var(--cr-color-text-muted);
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--cr-space-sm);
  margin-top: var(--cr-space-xs);
  color: var(--cr-color-accent);
  font-weight: 600;
  text-decoration: none;
  padding: var(--cr-space-sm) 0;
  border-bottom: 2px solid transparent;
}

.hero-cta:hover {
  border-bottom-color: var(--cr-color-accent);
}

.hero-cta-arrow {
  transition: transform 160ms ease;
}

.hero-cta:hover .hero-cta-arrow {
  transform: translateY(2px);
}

@media (prefers-reduced-motion: reduce) {
  .hero-cta-arrow {
    transition: none;
  }

  .hero-cta:hover .hero-cta-arrow {
    transform: none;
  }
}

/* ---------- sections ---------- */

.section {
  padding-block: clamp(3rem, 7vw, 5rem);
}

.section-alt {
  background: var(--cr-color-bg);
  border-block: 1px solid var(--cr-color-border);
}

.section-navy {
  background: var(--cr-color-navy);
  color: var(--cr-color-on-navy);
}

.section-navy h2,
.section-navy h3 {
  color: var(--cr-color-on-navy);
}

.eyebrow {
  margin-bottom: var(--cr-space-sm);
  color: var(--cr-color-accent);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow-on-navy {
  color: var(--cr-color-accent-on-navy);
}

.section h2 {
  font-size: clamp(1.5rem, 3.2vw, 2rem);
  letter-spacing: -0.01em;
}

.section-lede {
  max-width: 46rem;
  margin-top: var(--cr-space-md);
  color: var(--cr-color-text-muted);
  font-size: 1.0625rem;
}

.section-lede-on-navy {
  color: var(--cr-color-on-navy-muted);
}

/* ---------- how it works ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: var(--cr-space-lg);
  margin: var(--cr-space-2xl) 0 0;
  padding: 0;
  list-style: none;
  counter-reset: none;
}

.step {
  display: flex;
  flex-direction: column;
  gap: var(--cr-space-sm);
  padding: var(--cr-space-lg);
  background: var(--cr-color-surface);
  border: 1px solid var(--cr-color-border);
  border-top: 3px solid var(--cr-color-accent);
  border-radius: var(--cr-radius-lg);
}

.step-number {
  color: var(--cr-color-accent);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.step h3 {
  font-size: 1.125rem;
}

.step p:last-child {
  color: var(--cr-color-text-muted);
}

/* ---------- built for veterinary care ---------- */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: var(--cr-space-lg);
  margin: var(--cr-space-2xl) 0 0;
  padding: 0;
  list-style: none;
}

.feature {
  display: flex;
  flex-direction: column;
  gap: var(--cr-space-sm);
  padding-left: var(--cr-space-lg);
  border-left: 3px solid var(--cr-color-border-strong);
}

.feature h3 {
  font-size: 1.0625rem;
}

.feature p {
  color: var(--cr-color-text-muted);
}

/* ---------- security ---------- */

.trust-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: var(--cr-space-lg);
  margin: var(--cr-space-2xl) 0 0;
  padding: 0;
  list-style: none;
}

.trust-list li {
  display: flex;
  flex-direction: column;
  gap: var(--cr-space-sm);
  padding: var(--cr-space-lg);
  background: var(--cr-color-navy-deep);
  border: 1px solid var(--cr-color-navy-border);
  border-radius: var(--cr-radius-lg);
}

.trust-list h3 {
  font-size: 1.0625rem;
}

.trust-list p {
  color: var(--cr-color-on-navy-muted);
}

/* ---------- intelligent review ---------- */

.prose {
  display: flex;
  flex-direction: column;
  gap: var(--cr-space-md);
  max-width: 46rem;
  margin-top: var(--cr-space-lg);
}

.prose p {
  color: var(--cr-color-text-muted);
}

.callout {
  margin-top: var(--cr-space-sm);
  padding: var(--cr-space-lg);
  background: var(--cr-color-surface-sunken);
  border-left: 3px solid var(--cr-color-navy-raised);
  border-radius: 0 var(--cr-radius) var(--cr-radius) 0;
  color: var(--cr-color-text);
}

/* ---------- contact ---------- */

.contact-email {
  margin-top: var(--cr-space-lg);
  font-size: 1.125rem;
  font-weight: 600;
}

.contact-email a {
  color: var(--cr-color-accent);
}

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

.site-footer {
  background: var(--cr-color-navy);
  color: var(--cr-color-on-navy);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--cr-space-xs);
  text-align: center;
  padding-block: var(--cr-space-2xl);
}

.footer-wordmark {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.footer-tagline {
  color: var(--cr-color-accent-on-navy);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.footer-legal {
  margin-top: var(--cr-space-md);
  color: var(--cr-color-on-navy-muted);
  font-size: 0.875rem;
}

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

@media (max-width: 40rem) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--cr-space-sm);
  }

  .header-nav {
    justify-content: flex-start;
    gap: var(--cr-space-sm) var(--cr-space-md);
  }

  .header-brand img {
    width: 6.5rem;
  }
}
