/* Pour5 — one stylesheet, no build step. public/ is exactly what deploys.
   Palette is Bourbon & Navy, fixed in business/BRAND.md — never add a color
   here that isn't already a token below. Type is Outfit (headings) + Inter
   (body), the same pair the product itself uses. */

/* ---------- fonts ----------
   Loaded from Google Fonts, matching how the app itself loads them
   (src/styles/index.css). The app doesn't self-host these, so neither does
   the marketing site — one less thing to keep in sync between the two. */

:root {
  /* ---- light (default) ----
     Warmed half a step past stone on 2026-09-04 (full paper read too warm). The
     navy ink is untouched so the marketing mark (navy on light) still
     matches BRAND.md; only the ground and the rules carry the warmth. */
  --bg: #faf8f5;          /* halfway between stone-50 and paper */
  --bg-raise: #fffefc;
  --bg-sunk: #f4f1ec;      /* form fields, sunken panes */
  --ink: #102a43;          /* navy-900 */
  --ink-dim: #334e68;      /* navy-700 */
  --ink-faint: #6f645a;    /* warm grey; 4.5:1+ on --bg-sunk too */
  --rule: #e6e1db;
  --rule-soft: #efece7;
  --accent: #8b4e2c;       /* bourbon-700 — interactive */
  --accent-soft: #c17a3d;  /* bourbon-500 — decorative */
  --accent-ink: #fffaf5;   /* text on a filled accent surface */
  --danger: #b3261e;

  --heading: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --measure: 38rem;
  --gutter: clamp(1.25rem, 5vw, 2.5rem);
}

/* System dark, unless the light block below overrides it — no toggle on this
   site, just prefers-color-scheme. "Bourbon Bar at Night": warm dark, not
   cold blue-black, per BRAND.md. */
@media (prefers-color-scheme: dark) {
  :root {
    /* Warm brown-blacks, not stone. The stone-950 set this replaced
       (2026-09-04) read as neutral black in the browser, which is the
       "cold" BRAND.md rules out. Each step keeps a bourbon undertone so
       the accent sits in the ground instead of on top of it. */
    --bg: #15110d;          /* brown-black */
    --bg-raise: #201a15;    /* one step up: cards, compare panes */
    --bg-sunk: #1b1611;     /* one step down: form fields */
    --ink: #f4ede3;         /* warm off-white, same family as --accent-ink in light */
    --ink-dim: #d3c8ba;
    --ink-faint: #9c9083;
    --rule: #3f3529;
    --rule-soft: #28211a;
    --accent: #cf9457;      /* bourbon-400 — interactive in dark */
    --accent-soft: #a66434; /* bourbon-600 */
    --accent-ink: #1c1410;
    --danger: #ff8a80;
  }
}

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

/* ---------- background mark ----------
   The large ghost V, carried over from the beta one-pager's watermark
   treatment (business/assets/beta-onepager-front.svg): a single flat
   currentColor fill at low opacity, never the two-tone mark. Fixed to the
   viewport so it reads as part of the page rather than scrolling content.
   Opacity is deliberately low enough that it never dents body-text contrast
   below WCAG AA — it sits behind everything and .page stacks above it, so
   it only ever shows through empty background, never under a text glyph's
   own rendering (verified: navy-on-stone-50 and stone-100-on-stone-950 both
   run well past 4.5:1 before the mark is even added; a 6% wash moves the
   background luminance a fraction of a percent). */
.bg-mark {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}

/* One fixed size at every viewport. No clamp, no vw/vh, no breakpoint — this
   rule is the whole story, deliberately. Earlier versions scaled it and then
   stepped it at a 40rem media query, and the step read as a snap on the way
   down.

   The mark is square (viewBox 0 0 100 100), so height drives it and width
   follows. On a narrow screen most of it sits off the right edge, clipped by
   .bg-mark's overflow: hidden.

   Below 34rem it is hidden outright (see the rule after the dark-mode
   block). At phone width the text column spans the whole viewport, so the
   mark sits behind every paragraph and the compare panel instead of beside
   them; in a 2026-09-04 review it read as noise under the copy. Hiding is
   not the size-step this comment used to warn about: that was a scaling
   breakpoint that snapped while a desktop window was dragged narrower.
   Nobody drags a phone.

   Sits right of centre with its left edge 4rem left of centre. Measure is
   38rem, so the text column's right edge is at 50% + 19rem, which puts the
   overlap at 23rem — about half the mark. Anchored by its LEFT edge, so the
   overlap is the same on every screen. */
.bg-mark svg {
  position: absolute;
  top: 9rem;
  left: calc(50% - 4rem);
  right: auto;
  height: 48rem;
  width: auto;
  color: var(--ink);
  opacity: 0.05;
}

@media (prefers-color-scheme: dark) {
  .bg-mark svg {
    opacity: 0.07;
  }
}

@media (max-width: 34rem) {
  .bg-mark {
    display: none;
  }
}

html {
  -webkit-text-size-adjust: 100%;
  color-scheme: light dark;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection {
  background: var(--accent-soft);
  color: #1c1917;
}

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

img,
svg {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ---------- shell ---------- */

.page {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: calc(var(--measure) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: clamp(1.5rem, 5vw, 2.25rem) 0;
}

/* The mark's own viewBox carries roughly 7% padding each side, which at 1.8em
   adds about 0.13em of space the gap value does not account for. So the
   optical gap runs larger than the number here suggests. */
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.095em;
  font-family: var(--heading);
  font-weight: 700;
  font-size: 1.45rem;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-decoration: none;
}

.wordmark svg {
  /* Held at 2.07rem, the size it was at font-size 1.15rem, so growing the
     wordmark text does not grow the mark with it. */
  width: 1.428em;
  height: 1.428em;
  flex: none;
}

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

.mast-nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 1.75rem);
  font-family: var(--body);
  font-size: 0.875rem;
  font-weight: 500;
}

.mast-nav a {
  color: var(--ink-dim);
  text-decoration: none;
}

.mast-nav a:hover,
.mast-nav a[aria-current="page"] {
  color: var(--accent);
}

.mast-nav a[aria-current="page"] {
  cursor: default;
}

main {
  padding-block: clamp(2.5rem, 8vw, 4.5rem) 0;
}

/* ---------- type ---------- */

.lede {
  font-family: var(--heading);
  font-size: clamp(2rem, 1.5rem + 2.2vw, 3rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 1.1rem;
  text-wrap: balance;
  max-width: 22ch;
}

/* Essay pages only: the Published date, between the title and the lede-sub.
   Same size and colour as .entry-meta on the index so the two read as the
   same fact. */
.essay-date {
  display: block;
  font-size: 0.8125rem;
  color: var(--ink-faint);
  margin: -0.35rem 0 1rem;
}

.lede-sub {
  font-size: clamp(1.1rem, 1rem + 0.5vw, 1.25rem);
  line-height: 1.55;
  color: var(--ink-dim);
  margin: 0;
  max-width: 34rem;
  text-wrap: pretty;
}

p {
  text-wrap: pretty;
}

.label {
  font-family: var(--body);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1rem;
}

section {
  margin-block: clamp(3rem, 9vw, 5rem);
}

/* ---------- the mark as ornament ----------
   A small jigger between sections, the way a printed menu uses a fleuron:
   a hairline, the mark, a hairline, in bourbon, centred on the measure.
   The SVG is inline in the markup (build-essays.py, ORNAMENT) so it prints
   as vector; this rule only sizes, places and colours it. Replaces the
   full-page watermark on every page but the home page (2026-09-04). */
.ornament {
  display: flex;
  justify-content: center;
  color: var(--accent-soft);
  opacity: 0.85;
  margin-block: clamp(3rem, 9vw, 5rem);
}

.ornament svg {
  display: block;
  width: 9rem;
  height: 0.9rem;
}

/* The section margins would otherwise stack with the ornament's. */
.ornament + section {
  margin-top: 0;
}

section:has(+ .ornament) {
  margin-bottom: 0;
}

/* Quiet links (2026-09-05): body colour with a thin bourbon underline, and
   the text turns bourbon only on hover. A whole clause in accent colour read
   as a highlighted sentence rather than a link. Nav, footer and CTA links
   carry their own rules and are unaffected. */
a {
  color: inherit;
  text-decoration-color: var(--accent-soft);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}

a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

/* A pointer to another page ("See which part fixes which problem →"), as
   opposed to a link inside a sentence. Bourbon, no underline (the arrow
   already says "go"), on its own line so it never wraps mid-underline.
   Markdown: [text &rarr;](/path){: .more} */
a.more {
  display: block;
  margin-top: 0.6rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

a.more:hover {
  text-decoration: underline;
  text-decoration-color: var(--accent-soft);
}

h2 {
  font-family: var(--heading);
  font-weight: 700;
}

.prose p {
  margin: 0 0 1.25rem;
  color: var(--ink-dim);
  font-size: 1.0625rem;
}

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

.prose strong {
  color: var(--ink);
  font-weight: 600;
}

.section-title {
  font-family: var(--heading);
  font-size: clamp(1.35rem, 1.2rem + 0.6vw, 1.6rem);
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
  margin: 0 0 1rem;
  text-wrap: balance;
}

/* ---------- buttons / cta ---------- */

.cta {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--body);
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--accent-ink);
  background: var(--accent);
  padding: 0.85rem 1.5rem;
  border-radius: 4px; /* squarer than the 8px default: card stock, not app (2026-09-04) */
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease;
}

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

.cta:active {
  transform: scale(0.98);
}

.cta[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.cta-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--body);
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--ink);
  background: transparent;
  padding: 0.8rem 1.45rem;
  border-radius: 4px;
  border: 1px solid var(--rule);
  text-decoration: none;
  transition: border-color 160ms ease, color 160ms ease;
}

.cta-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-items: center;
  margin-top: 1.75rem;
}

.cta-note {
  font-size: 0.875rem;
  color: var(--ink-faint);
  margin: 0.9rem 0 0;
}

/* ---------- before / after ---------- */

.compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: 6px;
  overflow: hidden;
  margin: 1.75rem 0;
}

.compare > div {
  background: var(--bg-raise);
  padding: 1.5rem;
}

.compare h3 {
  font-family: var(--body);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0 0 0.75rem;
}

.compare .before h3 {
  color: var(--ink-faint);
}

.compare .after h3 {
  color: var(--accent);
}

.compare p {
  margin: 0;
  color: var(--ink-dim);
  font-size: 0.975rem;
  line-height: 1.6;
}

.compare .after p {
  color: var(--ink);
}

@media (max-width: 34rem) {
  .compare {
    grid-template-columns: 1fr;
  }
}

/* ---------- scope note (what it doesn't do) ---------- */

.scope {
  border-left: 3px solid var(--accent-soft);
  padding-left: clamp(1rem, 4vw, 1.5rem);
  margin: 1.75rem 0;
}

.scope p {
  margin: 0 0 0.9rem;
  color: var(--ink-dim);
  font-size: 1.0625rem;
}

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

/* ---------- steps (how it works) ---------- */

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* A step with no numeral (an unordered list, where a number would imply an
   order that does not exist) collapses the marker column instead of leaving
   a 3rem hole. */
.step:not(:has(.step-num)) {
  grid-template-columns: 1fr;
}

.step {
  display: grid;
  grid-template-columns: 3rem 1fr;
  gap: 0 1.25rem;
  padding-block: 1.5rem;
}

/* Rules between steps came out on 2026-09-04: with the ornament between
   sections, full-width hairlines everywhere else read as clutter. The bold
   step title and the spacing carry the separation. Same for .entries. */
.step + .step {
  padding-top: 0.5rem;
}

.step-num {
  font-family: var(--heading);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--accent-soft);
  line-height: 1.2;
}

.step-title {
  font-family: var(--heading);
  font-weight: 600;
  font-size: 1.0625rem;
  color: var(--ink);
  margin: 0 0 0.3rem;
  letter-spacing: 0.01em;
}

.step-meta {
  font-family: var(--body);
  font-size: 0.8125rem;
  font-weight: 600;
  font-style: italic;
  color: var(--ink-faint);
  margin: 0 0 0.6rem;
}

.step-body p {
  margin: 0 0 0.8rem;
  color: var(--ink-dim);
  font-size: 1rem;
  line-height: 1.6;
}

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

@media (max-width: 28rem) {
  .step {
    grid-template-columns: 2.25rem 1fr;
    gap: 0 0.85rem;
  }

  .step-num {
    font-size: 1.25rem;
  }
}

/* ---------- facts ---------- */

.facts {
  margin: 0;
}

.facts div {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 0.5rem 1rem;
  padding-block: 0.9rem;
  border-bottom: 1px solid var(--rule-soft);
}

.facts div:last-child {
  border-bottom: 0;
}

/* Numbers that sit in a column line up: the pour-cost arithmetic, the
   dates on the essays index and under an essay title. */
.facts dd,
.entry-meta,
.essay-date {
  font-variant-numeric: tabular-nums;
}

.facts dt {
  font-family: var(--body);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding-top: 0.2rem;
}

.facts dd {
  margin: 0;
  color: var(--ink-dim);
  font-size: 1rem;
  line-height: 1.55;
}

@media (max-width: 32rem) {
  .facts div {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }

  .facts dt {
    padding-top: 0;
  }
}

/* ---------- form ---------- */

.form {
  margin-top: 1.75rem;
  max-width: 30rem;
}

.field {
  margin-bottom: 1.35rem;
}

.field label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.45rem;
}

.field .hint {
  display: block;
  font-size: 0.8125rem;
  color: var(--ink-faint);
  font-weight: 400;
  margin-top: 0.35rem;
}

.field input,
.field textarea {
  width: 100%;
  font-family: var(--body);
  font-size: 1rem;
  color: var(--ink);
  background: var(--bg-raise);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 0.75rem 0.9rem;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}

.field textarea {
  resize: vertical;
  min-height: 7rem;
  line-height: 1.5;
}

.form-status {
  margin-top: 1.1rem;
  font-size: 0.9375rem;
  padding: 0.85rem 1rem;
  border-radius: 4px;
  display: none;
}

.form-status.is-visible {
  display: block;
}

.form-status.is-success {
  background: color-mix(in srgb, var(--accent) 12%, var(--bg-raise));
  color: var(--ink);
  border: 1px solid var(--accent-soft);
}

.form-status.is-error {
  background: color-mix(in srgb, var(--danger) 10%, var(--bg-raise));
  color: var(--ink);
  border: 1px solid var(--danger);
}

/* ---------- entries (writing index) ---------- */

.entries {
  list-style: none;
  margin: 0;
  padding: 0;
}

.entry + .entry {
  margin-top: 0.75rem;
}

.entry-link {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 0 0.5rem;
  padding-block: 1.35rem;
  text-decoration: none;
  color: inherit;
}

.entry-name {
  font-family: var(--heading);
  font-weight: 600;
  font-size: 1.1875rem;
  line-height: 1.3;
  color: var(--ink);
  transition: color 160ms ease;
}

.entry-desc {
  grid-column: 1 / -1;
  margin: 0.4rem 0 0;
  color: var(--ink-dim);
  font-size: 0.975rem;
  line-height: 1.55;
}

.entry-meta {
  font-size: 0.8125rem;
  color: var(--ink-faint);
  white-space: nowrap;
}

.entry-link:hover .entry-name {
  color: var(--accent);
}

.empty-state {
  padding: 2.5rem 0;
  color: var(--ink-faint);
  font-size: 1rem;
}

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

.foot {
  /* The one full-width rule left on the page: it means "the page is over".
     Soft colour so it sits behind the ornament in weight. */
  border-top: 1px solid var(--rule-soft);
  margin-top: clamp(4rem, 12vw, 7rem);
  padding-block: 1.75rem clamp(2.5rem, 8vw, 4rem);
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  font-size: 0.8125rem;
  color: var(--ink-faint);
}

.foot-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.4rem;
}

.foot-nav a {
  color: var(--ink-dim);
  text-decoration: none;
}

.foot-nav a:hover {
  color: var(--accent);
}

.foot-nav a[aria-current="page"] {
  color: var(--ink-faint);
  cursor: default;
}

.foot-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1.5rem;
  justify-content: space-between;
}

.foot a {
  color: var(--ink-faint);
}

.foot a:hover {
  color: var(--accent);
}

.foot-note {
  margin: 0;
  line-height: 1.7;
  max-width: 32rem;
}

/* ---------- small screens ---------- */

@media (max-width: 32rem) {
  .entry-link {
    grid-template-columns: 1fr;
  }

  .entry-meta {
    grid-column: 1;
    margin-top: 0.4rem;
  }

  .entry-desc {
    grid-column: 1;
  }
}

/* Print: the watermark and both nav bars are no use on paper. The ornament
   is inline SVG and prints as it looks. */
@media print {
  .bg-mark,
  .mast-nav,
  .foot-nav {
    display: none;
  }
}

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

