/*
 * Be Preferred — bepreferred.ca
 *
 * The design idea is the citation. This business exists to make a small
 * business the thing an assistant names, so the page is built to look like a
 * good answer: a claim, then the source of the claim, marked in the margin.
 *
 * Everything here is one file, no webfonts and no scripts, because the product
 * is being read quickly by machines and people on phones. A site about being
 * findable that takes three seconds to paint is an argument against itself.
 */

:root {
  --paper: #fbfaf7;
  --ink: #15171c;
  --muted: #5f646d;
  --hairline: #e2e0d9;
  --panel: #f4f2ec;
  /* One accent, the blue of a reference link in a printed citation. */
  --accent: #1b3fd4;
  --accent-soft: #e8ecfd;
  /*
   * The marker. Used on exactly one phrase per screen, never more.
   *
   * Two different treatments rather than one colour flipped, because a
   * highlighter only works one way round. On paper the ink stays dark and the
   * band goes behind it. On a dark screen the same band behind light text is
   * just a smudge -- so there the marker becomes solid and the text goes dark,
   * which is what a highlighter actually looks like.
   */
  --mark-bg: linear-gradient(transparent 62%, #f7e463 62%);
  --mark-fg: inherit;
  --mark-pad: 0 0.1em;

  --measure: 34rem;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #101216;
    --ink: #ecebe6;
    --muted: #9aa0a9;
    --hairline: #282c33;
    --panel: #171a20;
    --accent: #93a9ff;
    --accent-soft: #1a2033;
    --mark-bg: #f2dc5a;
    --mark-fg: #14161a;
    --mark-pad: 0.04em 0.22em;
  }
}

:root[data-theme="dark"] {
  --paper: #101216;
  --ink: #ecebe6;
  --muted: #9aa0a9;
  --hairline: #282c33;
  --panel: #171a20;
  --accent: #93a9ff;
  --accent-soft: #1a2033;
  --mark-bg: #f2dc5a;
  --mark-fg: #14161a;
  --mark-pad: 0.04em 0.22em;
}

:root[data-theme="light"] {
  --paper: #fbfaf7;
  --ink: #15171c;
  --muted: #5f646d;
  --hairline: #e2e0d9;
  --panel: #f4f2ec;
  --accent: #1b3fd4;
  --accent-soft: #e8ecfd;
  --mark-bg: linear-gradient(transparent 62%, #f7e463 62%);
  --mark-fg: inherit;
  --mark-pad: 0 0.1em;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

.wrap {
  max-width: 46rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ---------- masthead ---------- */

.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--hairline);
}

.wordmark {
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}

.wordmark span { color: var(--accent); }

.lang {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 1px;
}

.lang:hover { color: var(--accent); border-color: currentColor; }

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

.hero { padding: 3.25rem 0 2rem; }

.hero h1 {
  margin: 0 0 1.1rem;
  font-size: clamp(1.7rem, 3.4vw, 2.25rem);
  line-height: 1.2;
  letter-spacing: -0.022em;
  font-weight: 700;
  text-wrap: balance;
  max-width: 24ch;
}

.lede {
  font-size: 1.06rem;
  line-height: 1.62;
  color: var(--ink);
  max-width: 40rem;
}

/* The one highlighted phrase on the page. */
.mark {
  background: var(--mark-bg);
  color: var(--mark-fg);
  padding: var(--mark-pad);
  /* Kept square. A rounded highlight reads as a UI chip, not a marker. */
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.hero p {
  margin: 0;
  max-width: 40rem;
  font-size: 1.06rem;
  color: var(--muted);
}

.hero p + p { margin-top: 0.85rem; }

/* ---------- the answer blocks ---------- */

section { padding: 2.5rem 0; border-top: 1px solid var(--hairline); }

.eyebrow {
  margin: 0 0 0.5rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

h2 {
  margin: 0 0 0.9rem;
  font-size: clamp(1.25rem, 3.2vw, 1.55rem);
  line-height: 1.25;
  letter-spacing: -0.015em;
  font-weight: 680;
  text-wrap: balance;
  max-width: 26ch;
}

h3 {
  margin: 1.75rem 0 0.4rem;
  font-size: 1.02rem;
  font-weight: 650;
  letter-spacing: -0.005em;
}

p, li { max-width: var(--measure); }

p { margin: 0 0 0.9rem; }

a { color: var(--accent); text-underline-offset: 0.18em; }

/* ---------- the steps ---------- */

/* Numbered because they genuinely happen in this order -- you cannot fix an
   answer before you know what it currently says. */
.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; }

.steps > li {
  counter-increment: step;
  position: relative;
  padding-left: 2.6rem;
  margin-bottom: 1.4rem;
}

.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.05rem;
  width: 1.75rem;
  height: 1.75rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 600;
}

.steps strong { display: block; font-weight: 650; }

.steps span { color: var(--muted); }

/* ---------- plain lists ---------- */

.plain { margin: 0 0 1rem; padding-left: 1.15rem; }
.plain li { margin-bottom: 0.35rem; }
.plain li::marker { color: var(--muted); }

/* ---------- question and answer ---------- */

.qa { border-top: 1px solid var(--hairline); padding: 1.15rem 0; }
.qa:first-of-type { border-top: 0; }
.qa h3 { margin: 0 0 0.45rem; }
.qa p:last-child { margin-bottom: 0; }

/* ---------- callout ---------- */

.note {
  background: var(--panel);
  border-left: 2px solid var(--accent);
  padding: 1rem 1.1rem;
  margin: 0 0 1rem;
  max-width: var(--measure);
}

.note p:last-child { margin-bottom: 0; }

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

.contact-line {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

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

footer {
  border-top: 1px solid var(--hairline);
  padding: 2rem 0 3rem;
  color: var(--muted);
  font-size: 0.86rem;
}

footer p { margin: 0 0 0.4rem; }

footer .mono { font-family: var(--mono); font-size: 0.78rem; }

/* ---------- focus, motion ---------- */

a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

@media (max-width: 34rem) {
  body { font-size: 16px; }
  .hero { padding: 2.5rem 0 2rem; }
  section { padding: 2rem 0; }
}

/* ---------- navigation ---------- */

/* Two links. A site with four pages does not get a menu, and a menu is one
   more thing to be confused by on a phone. */
.topnav {
  display: flex;
  align-items: baseline;
  gap: 1.1rem;
}

.topnav a {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 1px;
}

.topnav a:hover { color: var(--accent); border-color: currentColor; }

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

/* ---------- the enquiry form ---------- */

.enquiry {
  display: grid;
  gap: 1.15rem;
  max-width: var(--measure);
}

.enquiry label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
}

.enquiry .hint,
.enquiry .optional {
  font-weight: 400;
  font-size: 0.86rem;
  color: var(--muted);
}

.enquiry .optional { font-family: var(--mono); font-size: 0.72rem; }

.enquiry input[type="text"],
.enquiry input[type="email"],
.enquiry input[type="tel"],
.enquiry textarea {
  font: inherit;
  font-weight: 400;
  width: 100%;
  padding: 0.6rem 0.7rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: 4px;
}

.enquiry input:focus, .enquiry textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: transparent;
}

.enquiry textarea { resize: vertical; }

.choices {
  border: 0;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.3rem;
}

.choices legend {
  padding: 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.choice {
  display: flex !important;
  align-items: center;
  gap: 0.45rem;
  font-weight: 400 !important;
  font-size: 0.95rem;
}

.enquiry button {
  font: inherit;
  font-weight: 650;
  justify-self: start;
  padding: 0.7rem 1.2rem;
  color: var(--paper);
  background: var(--ink);
  border: 0;
  border-radius: 5px;
  cursor: pointer;
}

.enquiry button:hover { background: var(--accent); }

.form-note {
  margin: 0;
  font-size: 0.84rem;
  color: var(--muted);
}

/* The honeypot. Off-screen rather than display:none, because some bots skip
   fields that are display:none and this one is meant to be filled in. */
.trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}


/* ---------- the answer figure ---------- */

/*
   The one piece of the page that shows the product instead of describing it.
   It carries the visual weight the oversized headline used to carry badly:
   a claim set in 46px type is just loud, whereas a plausible answer with one
   firm named in it makes the argument on its own.

   Styled as a quoted document rather than a chat window. Chat bubbles would
   imply a screenshot of a specific product, which would be a claim about a
   real answer; this reads as an illustration, which is what it is.
*/
.answer {
  margin: 0 0 0.5rem;
  padding: 1.4rem 1.5rem 1.25rem;
  border: 1px solid var(--hairline);
  border-radius: 6px;
  background: var(--panel);
}

.answer figcaption {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.9rem;
}

.answer-q {
  margin: 0 0 1.1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--hairline);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  max-width: none;
}

.answer-q::before { content: "\201C"; }
.answer-q::after  { content: "\201D"; }

.answer-a p { margin: 0 0 0.7rem; color: var(--muted); font-size: 0.95rem; max-width: none; }

.answer-a ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.5rem; }

.answer-a li {
  font-size: 0.95rem;
  color: var(--muted);
  padding-left: 0.95rem;
  border-left: 2px solid var(--hairline);
  max-width: none;
}

.answer-a strong { color: var(--ink); font-weight: 650; }

/* The single use of the marker on the page now, on two words instead of a
   whole clause. Same idea, a hundredth of the surface area. */
.named {
  background: var(--mark-bg);
  color: var(--mark-fg);
  padding: var(--mark-pad);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.answer-note {
  margin: 1.1rem 0 0;
  padding-top: 0.9rem;
  border-top: 1px solid var(--hairline);
  font-size: 0.88rem;
  color: var(--muted);
  max-width: none;
}

/* ---------- call to action ---------- */

.cta {
  display: inline-block;
  padding: 0.68rem 1.25rem;
  background: var(--ink);
  color: var(--paper);
  border-radius: 5px;
  font-size: 0.98rem;
  font-weight: 650;
  text-decoration: none;
}

.cta:hover { background: var(--accent); }

.contact-line { font-weight: 400; margin-bottom: 0.9rem; }

.quiet { font-size: 0.92rem; color: var(--muted); }

@media (max-width: 34rem) {
  .answer { padding: 1.1rem 1.1rem 1rem; }
}

/* ---------- the lockup ---------- */

/* "Be Preferred, powered by Daniel Nataf". The person's name is deliberately
   attached to the brand rather than hidden: an assistant needs a human to
   attribute the work to, and a buyer deciding whether to trust a small firm
   wants to know who is actually doing it. */
.lockup {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  font-weight: 650;
  color: var(--ink);
}

.lockup span {
  font-weight: 400;
  color: var(--muted);
}
