/*
 * The demo's preview and access-error pages (CNC-22; lib/demo/access/pages.ts).
 * Served without a pass, so it is on its own: no app stylesheet, no web font,
 * no script.
 *
 * COLOURS: every colour here is a `--pv-<token>` custom property whose value
 * is copied from the token of the same name in app/globals.css (`--color-<token>`),
 * light values in `:root`, dark values in the `prefers-color-scheme: dark`
 * block. `pnpm check:colours` fails if a value drifts from its token, if a
 * colour is written anywhere else in this file, or if a pair used below
 * loses its contrast.
 */

:root {
  color-scheme: light dark;
  --pv-th-bg-muted: #F3F6FF;
  --pv-th-text: #0A1433;
  --pv-th-text-secondary: #3A475A;
  --pv-th-border: #E0E6EE;
  --pv-th-primary-text: #1638B0;
  --pv-th-primary-text-hover: #0F2882;
  --pv-th-focus-page: #D04400;
  --pv-primary-600: #D04400;
  --pv-primary-700: #B03A00;
  --pv-surface: #FFFFFF;
}

@media (prefers-color-scheme: dark) {
  :root {
    --pv-th-bg-muted: #0C1638;
    --pv-th-text: #F1F5FF;
    --pv-th-text-secondary: #C9D4F2;
    --pv-th-border: #1D2F6C;
    --pv-th-primary-text: #9DB8FF;
    --pv-th-primary-text-hover: #C2D3FF;
    --pv-th-focus-page: #FF7A26;
  }
}

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

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

body {
  margin: 0;
  background: var(--pv-th-bg-muted);
  color: var(--pv-th-text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.5;
}

.pv-main {
  margin: 0 auto;
  max-width: 72rem;
  padding: 3rem 1rem 4rem;
}

.pv-intro {
  margin: 0 auto;
  max-width: 44rem;
  text-align: center;
}

h1 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  text-wrap: balance;
}

.pv-line {
  margin: 1rem auto 0;
  max-width: 38rem;
  color: var(--pv-th-text-secondary);
  text-wrap: pretty;
}

.pv-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 1.5rem;
  margin: 1.75rem 0 0;
}

.pv-primary,
.pv-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  font-weight: 600;
  text-align: center;
}

.pv-primary {
  padding: 0.625rem 1.5rem;
  border-radius: 0.5rem;
  background: var(--pv-primary-600);
  color: var(--pv-surface);
  text-decoration: none;
}

.pv-primary:hover {
  background: var(--pv-primary-700);
}

.pv-secondary {
  padding: 0.625rem 0.25rem;
  color: var(--pv-th-primary-text);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.pv-secondary:hover {
  color: var(--pv-th-primary-text-hover);
}

a:focus-visible {
  outline: 2px solid var(--pv-th-focus-page);
  outline-offset: 3px;
  border-radius: 0.5rem;
}

/* The picture: the home page as a framed sheet that dissolves at the bottom
   (frame and all: the mask fades the border with the picture; a mask only reads
   the opacity of its colour, so any opaque token does). */
.pv-shot {
  display: block;
  margin: 2.5rem auto 0;
  max-width: 64rem;
  overflow: hidden;
  border: 1px solid var(--pv-th-border);
  border-bottom: 0;
  border-radius: 0.75rem 0.75rem 0 0;
  -webkit-mask-image: linear-gradient(to bottom, var(--pv-surface) calc(100% - 16rem), transparent calc(100% - 2rem));
  mask-image: linear-gradient(to bottom, var(--pv-surface) calc(100% - 16rem), transparent calc(100% - 2rem));
}

.pv-shot:focus-visible {
  outline-offset: -2px;
  border-radius: 0.75rem 0.75rem 0 0;
}

.pv-shot picture,
.pv-shot img {
  display: block;
  width: 100%;
  height: auto;
}

.pv-actions-end {
  position: relative;
  margin-top: -4rem;
}

@media (min-width: 44rem) {
  .pv-main {
    padding: 4.5rem 2rem 5rem;
  }

  h1 {
    font-size: 2.75rem;
    line-height: 1.1;
  }

  body {
    font-size: 1.125rem;
  }
}

@media (max-width: 43.99rem) {
  .pv-shot {
    max-width: 24.375rem;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .pv-primary {
    transition: background-color 150ms ease;
  }
}
