/*
 * The holding page in the demo's look (apps/web/src/styles/index.css and its landing page): the same
 * colour roles, Fraunces for headings and Inter for text. npm run build:site copies the Latin
 * woff2 files named here from the web app's font packages, so nothing loads from another host.
 * Contrast on paper, light: ink 14.7:1, ink-muted 6.8:1, accent-strong 5.5:1;
 * dark: ink 14.7:1, ink-muted 7.2:1, accent-strong 6.7:1.
 */

@font-face {
  font-family: 'Fraunces Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/fonts/fraunces-latin-opsz-normal.woff2') format('woff2');
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC,
    U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Inter Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/fonts/inter-latin-opsz-normal.woff2') format('woff2');
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC,
    U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light dark;
  --font-sans: 'Inter Variable', ui-sans-serif, system-ui, sans-serif;
  --font-display: 'Fraunces Variable', ui-serif, Georgia, serif;

  --color-paper: #f6f2ea;
  --color-ink: #17202b;
  --color-ink-muted: #4a5563;
  --color-line: #e3dccf;
  /* For marks; text on paper uses accent-strong. */
  --color-accent: #e8743b;
  --color-accent-strong: #a3461a;
}

/* The same roles on a dark page: paper is the page, ink the text. */
@media (prefers-color-scheme: dark) {
  :root {
    --color-paper: #17202b;
    --color-ink: #f6f2ea;
    --color-ink-muted: #a3adba;
    --color-line: #2b3542;
    --color-accent-strong: #f08c5a;
  }
}

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

html {
  background-color: var(--color-paper);
  color: var(--color-ink);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
p {
  margin: 0;
}

svg {
  display: block;
}

a {
  color: var(--color-accent-strong);
  font-weight: 500;
  text-decoration-line: underline;
  text-underline-offset: 4px;
}

a:hover {
  color: var(--color-ink);
}

:focus-visible {
  outline: 2px solid var(--color-accent-strong);
  outline-offset: 3px;
}

.container {
  width: 100%;
  max-width: 72rem;
  margin-inline: auto;
  padding-inline: 1.25rem;
}

/* The page's one section sits in the middle of the space between the header and the footer. */
main {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
}

.site-header {
  border-bottom: 1px solid var(--color-line);
}

.site-header .container {
  padding-block: 1rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  border-radius: 0.375rem;
  color: inherit;
  font-weight: inherit;
  text-decoration: none;
}

.wordmark:hover {
  color: inherit;
}

.wordmark-mark {
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
}

.mark-tile {
  fill: var(--color-ink);
}

.mark-route {
  stroke: var(--color-paper);
}

.mark-origin {
  fill: var(--color-paper);
}

.mark-destination {
  fill: var(--color-accent);
}

.wordmark-name {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.025em;
}

.hero {
  display: grid;
  gap: 3rem;
  padding-block: 4rem;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.lede {
  max-width: 36rem;
  margin-top: 1.5rem;
  color: var(--color-ink-muted);
  font-size: 1.125rem;
  line-height: 1.75rem;
  text-wrap: pretty;
}

/* The brand line, at body size, leading the paragraph that explains it. */
.lede-lead {
  color: var(--color-ink);
  font-weight: 500;
}

.status {
  max-width: 36rem;
  margin-top: 2rem;
  padding-left: 1rem;
  border-left: 2px solid var(--color-accent);
  color: var(--color-ink-muted);
}

/* For the link to the demo, a one-line addition under the status (infra/README.md, "Main site"). */
.demo-link {
  margin-top: 1.25rem;
}

/* The dotted great-circle arc from New York to Lisbon, the brand's route motif. */
.route {
  justify-self: center;
  width: 100%;
  max-width: 28rem;
  height: auto;
  color: var(--color-ink);
}

.route-origin {
  fill: var(--color-ink);
}

.route-destination {
  fill: var(--color-accent);
}

.route-code {
  fill: var(--color-ink);
  font-family: var(--font-sans);
  font-size: 1.125rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.not-found {
  padding-block: 6rem;
}

.not-found h1 {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 600;
  line-height: 2.5rem;
  letter-spacing: -0.025em;
}

.not-found p {
  max-width: 36rem;
  margin-top: 1rem;
  color: var(--color-ink-muted);
}

.not-found .not-found-action {
  margin-top: 2rem;
}

.site-footer {
  border-top: 1px solid var(--color-line);
}

.site-footer .container {
  padding-block: 1.5rem;
  color: var(--color-ink-muted);
  font-size: 0.875rem;
  line-height: 1.25rem;
}

@media (min-width: 40rem) {
  .container {
    padding-inline: 2rem;
  }

  .hero {
    padding-block: 6rem;
  }

  .hero h1 {
    font-size: 3.75rem;
  }
}

@media (min-width: 64rem) {
  .hero {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
    align-items: center;
  }

  .hero h1 {
    font-size: 4.5rem;
  }

  .route {
    justify-self: end;
  }
}

/*
 * The arc draws itself from New York to Lisbon once, in under two seconds, then Lisbon's dot lands.
 * Nothing moves after that, and nothing moves at all for a visitor who asks for reduced motion.
 */
@media (prefers-reduced-motion: no-preference) {
  .route-reveal {
    stroke-dasharray: 1 1;
    animation: route-draw 1.4s cubic-bezier(0.65, 0, 0.35, 1) 0.15s both;
  }

  .route-destination {
    transform-box: fill-box;
    transform-origin: center;
    animation: route-land 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 1.45s both;
  }
}

/* Forced colours may repaint the mask's white, which would hide the arc. */
@media (forced-colors: active) {
  .route-path {
    mask: none;
  }
}

@keyframes route-draw {
  from {
    stroke-dashoffset: 1;
  }

  to {
    stroke-dashoffset: 0;
  }
}

@keyframes route-land {
  from {
    transform: scale(0);
  }

  to {
    transform: scale(1);
  }
}
