/* ------------------------------------------------------------------
   resale-classifier
   Type + metrics carried over 1:1 from the Canva prototype
   (1366 x 768 artboard, 18.6669px mono, 1.4 line-height, 30px margins)
   ------------------------------------------------------------------ */

:root {
  --ink: #000000;
  --paper: #ffffff;

  --fs: 12px;
  --lh: 1.4;
  --line: calc(var(--fs) * var(--lh)); /* 16.8px - one blank line */
  --margin: 30px;

  /* The artboard's prose column is exactly 71 monospace characters. Held in
     `ch` it stays 71 characters at any size or mono face, so the prototype's
     line breaks are reproduced rather than approximated. */
  --prose-w: 71ch;
  --demo-w: 756.17px;

  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas,
    "DejaVu Sans Mono", monospace;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--mono);
  font-size: var(--fs);
  line-height: var(--lh);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------------------------------------------------------------- nav */

.nav {
  position: absolute;
  top: var(--margin);
  left: var(--margin);
  right: var(--margin);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--line);
  z-index: 2;
}

.nav__right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
}

/* One empty line between the two right-hand links, as in the prototype. */
.nav__right a + a {
  margin-top: var(--line);
}

.nav a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.nav a:hover,
.nav a:focus-visible {
  text-decoration-thickness: 2px;
}

.nav a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

/* --------------------------------------------------------------- page */

/* The artboard is a single fixed screen with the content optically
   centred, so each page fills the viewport and centres its content. */
.page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--margin) * 3.5) var(--margin);
}

/* -------------------------------------------------------------- prose */

.prose {
  width: 100%;
  max-width: var(--prose-w);
  text-align: center;
  /* Deliberately NOT text-wrap: pretty/balance — the artboard's line breaks
     are plain greedy wrapping, and rebalancing shifts them. */
  text-wrap: wrap;
}

.prose p {
  margin: 0;
}

/* Paragraphs are separated by one blank line on the artboard. */
.prose p + p {
  margin-top: var(--line);
}

/* --------------------------------------------------------------- demo */

.demo {
  display: block;
  width: 100%;
  max-width: var(--demo-w);
  height: auto;
  aspect-ratio: 16 / 9;
}

/* ------------------------------------------------------- screenreader */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------- responsive */

/* 12px is already the floor for legibility, so the type never steps down.
   The 71ch column clears every viewport above ~570px; below that it simply
   fills the width and rewraps. Only the margins tighten. */
@media (max-width: 820px) {
  :root {
    --margin: 22px;
  }
}

@media (max-width: 560px) {
  :root {
    --margin: 18px;
  }

  .nav {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--line);
  }

  .nav__right {
    align-items: flex-start;
    text-align: left;
  }

  .page {
    padding-top: calc(var(--margin) + var(--line) * 5);
    padding-bottom: calc(var(--margin) * 2);
  }
}

@media (prefers-reduced-motion: reduce) {
  .nav a {
    transition: none;
  }
}
