/* The reader page in the look of the front page: the same ground, type, mark, field and button.
   System font stacks only; nothing is downloaded. Header and footer are styled as elements, so the page
   takes them when they arrive and opens with the ember dot until then. */

:root {
  /* The front page's tokens, value for value. Dim is for rules and edges only, never for text. */
  --soot: #080605;
  --dim: #918679;
  --ash: #bdb1a4;
  --bone: #efe6da;
  --ember: #ff6a1c;
  --ember-hot: #ffa766;
  --ember-deep: #7a3a17;
  --ring: #ffb27a;
  --line: rgba(239, 230, 218, 0.16);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --gutter: clamp(1rem, 5vw, 5.5rem);
  --bar-h: 4rem;
  --control: 3rem;
  --measure: 42rem;
  --ease-std: cubic-bezier(0.2, 0, 0, 1);
  color-scheme: dark;
}

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

html {
  background: var(--soot);
  color: var(--bone);
  font-family: var(--sans);
  font-size: 100%;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  display: flex;
  flex-direction: column;
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* The painted ground of the front page without its scene: the soot, and one glow along the floor at the right. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(70vmax 36vmax at 82% 108%, rgba(120, 44, 12, 0.3), rgba(120, 44, 12, 0) 72%),
    linear-gradient(180deg, #0e0a08 0%, var(--soot) 52%, #0c0907 100%);
}

[hidden] { display: none !important; }

body > header,
body > main,
body > footer {
  width: 100%;
  padding-left: calc(var(--gutter) + env(safe-area-inset-left));
  padding-right: calc(var(--gutter) + env(safe-area-inset-right));
}
body > main { flex: 1 0 auto; padding-top: clamp(1rem, 5vh, 3rem); padding-bottom: 3.5rem; }
main > * { max-width: var(--measure); }

:focus-visible { outline: 3px solid var(--ring); outline-offset: 3px; }
[tabindex="-1"]:focus { outline: none; }

a { color: var(--bone); text-decoration: underline; text-decoration-color: var(--ember); text-decoration-thickness: 2px; text-underline-offset: 0.3em; }
a:hover { text-decoration-color: var(--bone); }

/* The bar: the product name at the left gutter, small capitals with the ember dot. */
body > header { display: flex; align-items: center; min-height: calc(var(--bar-h) + env(safe-area-inset-top)); padding-top: env(safe-area-inset-top); }
header a {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  min-height: 44px;
  color: var(--bone);
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  text-decoration: none;
}
header a:not(:has(.brand-mark))::before,
.brand-mark,
body:not(:has(> header)) > main::before {
  content: "";
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--ember);
  box-shadow: 0 0 0.6rem 0.1rem rgba(255, 106, 28, 0.7);
}
/* Without a bar the page still opens with the dot. */
body:not(:has(> header)) > main::before { display: block; margin: 1rem 0 1.75rem; }

h1 {
  margin: 0;
  color: var(--bone);
  font-family: var(--serif);
  font-size: clamp(2.4rem, 4.2vw, 4.25rem);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -0.022em;
  text-wrap: balance;
}
h2 { margin: 0 0 0.5rem; font: 700 1.25rem/1.3 var(--sans); letter-spacing: -0.01em; overflow-wrap: anywhere; }
.lead { margin: 1rem 0 0; max-width: 32rem; color: var(--ash); font-size: clamp(1rem, 1.25vw, 1.1875rem); line-height: 1.5; }

/* The field, then the button under it, as on the front page. */
form { display: grid; gap: 0.5rem; margin-top: 1.5rem; }
label { color: var(--bone); font-size: 0.9375rem; font-weight: 600; }
textarea {
  width: 100%;
  min-height: 8.5rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--dim);
  border-radius: 4px;
  background: rgba(8, 6, 5, 0.94);
  color: var(--bone);
  caret-color: var(--ember);
  font: 1rem/1.5 var(--mono);
  letter-spacing: 0.01em;
  resize: vertical;
  overflow-wrap: anywhere;
}
textarea::placeholder { color: var(--ash); font-family: var(--sans); letter-spacing: 0; opacity: 1; }
textarea:hover { border-color: var(--ash); }
textarea:focus-visible { outline-offset: 2px; border-color: var(--bone); }

/* The button. The hover light is a layer under the label whose opacity changes; the fill is never repainted.
   The label on ember is soot: seven to one. */
button {
  position: relative;
  z-index: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: start;
  min-width: 44px;
  min-height: var(--control);
  margin-top: 0.35rem;
  padding: 0 1.25rem;
  border: 1px solid transparent;
  border-radius: 4px;
  background: var(--ember);
  color: var(--soot);
  font: 650 1rem/1.2 var(--sans);
  letter-spacing: 0.005em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 140ms var(--ease-std);
}
button::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: #ffd9b8;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms var(--ease-std);
}
button:hover::after { opacity: 0.22; }
button:active { transform: scale(0.975); }
button:disabled { background: var(--ember-deep); color: var(--bone); cursor: default; }
button:disabled::after { opacity: 0; }
button:disabled:active { transform: none; }

/* What was read: the card of the cleanup, a heading, ruled lines and the verdict with a rule at its left. */
#result { margin-top: 1.75rem; padding: 24px 22px; border: 1px solid var(--line); border-radius: 12px; background: var(--soot); }
#result ul { list-style: none; margin: 0; padding: 0; overflow-wrap: anywhere; }
#result li { padding: 7px 0; border-top: 1px solid var(--line); }
#result-verdict { margin: 1rem 0 0; padding: 0.15rem 0 0.15rem 0.75rem; border-left: 3px solid var(--bone); font-weight: 650; }
#result-verdict:empty { display: none; }
#result.foreign #result-verdict, #result.refused #result-verdict, #result.problem #result-verdict { border-left-color: var(--ember); }
@media (max-width: 420px) { #result { padding: 20px 16px; } }

.note { margin: 0.5rem 0 0; color: var(--ash); font-size: 0.9375rem; line-height: 1.5; }
section + .note, form + .note { margin-top: 1.75rem; }

/* The footer: a hairline, the small print in ash, the links with the ember underline. */
body > footer { margin-top: auto; padding-top: 1.25rem; padding-bottom: calc(2.5rem + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); color: var(--ash); font-size: 0.875rem; line-height: 1.5; }
footer p { margin: 0; max-width: 62ch; }
footer nav, footer ul { display: flex; flex-wrap: wrap; gap: 0 1.5rem; list-style: none; margin: 0 0 0.35rem; padding: 0; }
footer a { display: inline-flex; align-items: center; min-width: 44px; min-height: 44px; font-weight: 600; }

/* Motion is transform and opacity only; under reduced motion there is none. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
