/*
 * Marc marketing site. Plain CSS, no build step, no web fonts (system stacks only:
 * nothing to download, no layout shift, no third-party requests).
 * Every text/background pair below meets WCAG AA in both color schemes
 * (site/tests/test_marketing_site.py checks it in a real browser).
 *
 * The header (brand, nav, "Try Marc") is the part the owner signed off on: its rules
 * and the tokens it reads (including --accent) are kept as they were. Below it the page
 * is set like a short printed piece: serif headlines over sans reading text, hairline
 * rules, and one editor's red pen (--pen) for corrections. No letter-spaced capitals.
 */

/* ---- Tokens ------------------------------------------------------------ */

:root {
  color-scheme: light dark;

  --bg: #faf8f4;
  --bg-elev: #ffffff;
  --bg-sunk: #f3efe8;
  --ink: #18181b;
  --ink-2: #44413b;
  --ink-3: #635f56;
  --line: #e4ded3;
  --line-strong: #b9b2a5;
  --accent: #c2410c;
  --primary: #18181b;
  --primary-hover: #33333a;
  --on-primary: #faf8f4;
  --focus: #c2410c;
  --header-bg: rgb(250 248 244 / 0.86);
  /* Below the header only: corrections on the example, the number check. */
  --pen: #c8102e;

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: ui-serif, "New York", "Iowan Old Style", Charter, "Palatino Linotype", Palatino,
    Georgia, serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --radius-sm: 0.5rem;
  --radius: 0.75rem;
  --radius-lg: 1.25rem;
  --container: 72rem;
  --gutter: clamp(1rem, 4vw, 2rem);
  --section-pad: clamp(4rem, 3rem + 5vw, 7rem);
  --rule-gap: clamp(2.25rem, 1.75rem + 2.5vw, 4rem);
  --measure: 36rem;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131316;
    --bg-elev: #1c1c21;
    --bg-sunk: #18181c;
    --ink: #f1eee8;
    --ink-2: #cbc6bc;
    --ink-3: #a7a297;
    --line: #2d2c32;
    --line-strong: #4a4851;
    --accent: #ff9a62;
    --primary: #f1eee8;
    --primary-hover: #ffffff;
    --on-primary: #131316;
    --focus: #ff9a62;
    --header-bg: rgb(19 19 22 / 0.84);
    --pen: #ff7a7a;
  }
}

/* ---- Base -------------------------------------------------------------- */

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

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

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd,
figure {
  margin: 0;
}

h1,
h2 {
  font-family: var(--font-serif);
  font-weight: 600;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

h3 {
  font-size: 1.125rem;
  line-height: 1.35;
  font-weight: 650;
  letter-spacing: -0.005em;
}

p {
  text-wrap: pretty;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 2px;
}

svg {
  flex-shrink: 0;
}

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

[id] {
  scroll-margin-top: 5.5rem;
}

main:focus {
  outline: none;
}

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

.skip-link {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus-visible {
  transform: none;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---- Buttons ----------------------------------------------------------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.5rem 1.1rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font: 600 0.9375rem/1.2 var(--font-sans);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    transform 160ms var(--ease-out),
    background-color 160ms ease,
    border-color 160ms ease;
}

.button:hover {
  text-decoration: none;
}

.button:active {
  transform: scale(0.97);
}

.button-primary {
  background: var(--primary);
  color: var(--on-primary);
}

.button-secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}

.button-lg {
  min-height: 3.25rem;
  padding-inline: 1.5rem;
  font-size: 1.0625rem;
}

.button .arrow {
  transition: transform 200ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .button-primary:hover {
    background: var(--primary-hover);
  }

  .button-secondary:hover {
    background: var(--bg-sunk);
    border-color: var(--ink-3);
  }

  .button:hover .arrow {
    transform: translateX(2px);
  }
}

/* ---- Header ------------------------------------------------------------ */

.site-header {
  position: relative;
  z-index: 50;
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
}

@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .site-header {
    -webkit-backdrop-filter: saturate(1.4) blur(14px);
    backdrop-filter: saturate(1.4) blur(14px);
  }
}

.header-inner {
  display: grid;
  grid-template-columns: auto auto;
  grid-template-areas:
    "brand cta"
    "nav nav";
  align-items: center;
  justify-content: space-between;
  column-gap: 1rem;
  padding-block: 0.75rem 0.25rem;
}

.brand {
  grid-area: brand;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 2.75rem;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 1.375rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
}

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

.brand-mark .mark-stroke {
  stroke: var(--bg);
}

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

.primary-nav {
  grid-area: nav;
}

.primary-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  padding: 0;
  list-style: none;
}

.primary-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: var(--ink-2);
  font-size: 0.9375rem;
  font-weight: 550;
  text-decoration: none;
}

.primary-nav a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.primary-nav a[aria-current="page"] {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.45em;
}

.header-cta {
  grid-area: cta;
  justify-self: end;
}

@media (min-width: 48rem) {
  /* Keeps focused controls and anchor targets clear of the sticky header (WCAG 2.4.11). */
  html {
    scroll-padding-top: 5.5rem;
  }

  .site-header {
    position: sticky;
    top: 0;
  }

  .header-inner {
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "brand nav cta";
    min-height: 4.25rem;
    padding-block: 0.5rem;
  }

  .primary-nav ul {
    justify-content: flex-end;
    gap: 0 1.75rem;
  }
}


/* ---- Page text --------------------------------------------------------- */

/* Reading text stays in the sans stack; serif is for headlines, the lede and the notes. */
main {
  font-size: 1.0625rem;
  line-height: 1.65;
}

main h1,
main h2 {
  font-weight: 500;
  letter-spacing: -0.02em;
}

main h2 {
  font-size: clamp(1.75rem, 1.3rem + 1.8vw, 2.5rem);
  line-height: 1.12;
}

main a:not(.button) {
  text-decoration-color: var(--ink-3);
}

main a:not(.button):hover {
  text-decoration-color: currentColor;
}

/* Sections after the opening are divided by a hairline rule. */
.section {
  padding-bottom: var(--section-pad);
}

.section > .container::before {
  content: "";
  display: block;
  height: 1px;
  margin-bottom: var(--rule-gap);
  background: var(--line);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  margin-top: 2rem;
}

.fineprint {
  max-width: 28rem;
  color: var(--ink-3);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.fineprint a {
  color: var(--ink);
  font-weight: 600;
}

@media (max-width: 30rem) {
  .actions .button {
    flex: 1 1 100%;
  }
}

/* ---- Opening ----------------------------------------------------------- */

/* Short enough at the top that the example starts on the first screen of a laptop. */
.opening {
  padding-block: clamp(2rem, 1rem + 3vw, 4rem) clamp(3.5rem, 2.5rem + 4vw, 5.5rem);
}

.opening h1 {
  max-width: 14em;
  font-size: clamp(2.5rem, 1.45rem + 4.3vw, 4.75rem);
  line-height: 1.04;
  letter-spacing: -0.03em;
}

.lede {
  max-width: 38rem;
  margin-top: clamp(1.5rem, 1rem + 1.5vw, 2.25rem);
  color: var(--ink-2);
  font-family: var(--font-serif);
  font-size: clamp(1.1875rem, 1.1rem + 0.4vw, 1.375rem);
  line-height: 1.5;
}

/* ---- The example ------------------------------------------------------- */

.example h2,
.how h2 {
  margin-bottom: clamp(2rem, 1.5rem + 2vw, 3.25rem);
}

.pair {
  display: grid;
  gap: clamp(2.5rem, 2rem + 3vw, 4rem);
}

.email {
  min-width: 0;
  max-width: 38rem;
}

@media (min-width: 40rem) and (max-width: 61.99rem) {
  /* Stacked, the second email sits to the right: a reply on the desk, not a twin. */
  .email-person {
    margin-left: auto;
    width: min(100%, 30rem);
  }
}

@media (min-width: 62rem) {
  .pair {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    column-gap: clamp(2rem, 4vw, 4.5rem);
    align-items: start;
  }

  .email-person {
    padding-top: clamp(4rem, 2rem + 5vw, 7.5rem);
  }
}

/* A caption, not a label: no capitals, no tracking. */
.email-title {
  margin-bottom: 0.6rem;
  color: var(--ink-2);
  font: italic 400 1.0625rem/1.4 var(--font-serif);
  letter-spacing: 0;
}

.email-person .email-title {
  color: var(--ink);
}

.sheet {
  border: 1px solid var(--line);
  border-radius: 0.375rem;
  background: var(--bg-sunk);
}

.email-person .sheet {
  border-color: var(--line-strong);
  background: var(--bg-elev);
}

.sheet-meta {
  display: grid;
  gap: 0.15rem;
  padding: 0.7rem 1.1rem;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 0.8125rem;
  line-height: 1.45;
}

.sheet-key {
  display: inline-block;
  min-width: 4.25rem;
  color: var(--ink-3);
}

.sheet-body {
  padding: 1.1rem 1.1rem 1.3rem;
  color: var(--ink-2);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.email-person .sheet-body {
  color: var(--ink);
}

.sheet-body p + p {
  margin-top: 0.85em;
}

/* Stock phrases get a red pen line under them, drawn in once on load. */
.stock {
  padding-bottom: 2px;
  background-image: linear-gradient(var(--pen), var(--pen));
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 100% 2px;
}

.note-ref {
  margin-left: 0.1em;
  color: var(--pen);
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .stock {
    animation: pen 520ms var(--ease-out) 350ms both;
  }

  .stock[data-mark="2"] {
    animation-delay: 500ms;
  }

  .stock[data-mark="3"] {
    animation-delay: 650ms;
  }

  .stock[data-mark="4"] {
    animation-delay: 800ms;
  }
}

@keyframes pen {
  from {
    background-size: 0% 2px;
  }
}

/* The notes read like an editor's margin notes, in the same red pen. */
.notes {
  display: grid;
  gap: 0.3rem 2rem;
  margin: 1rem 0 0;
  padding: 0;
  color: var(--pen);
  font: italic 400 1.0625rem/1.4 var(--font-serif);
  list-style: none;
  counter-reset: note;
}

@media (min-width: 40rem) {
  .notes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.notes li {
  display: grid;
  grid-template-columns: 1.25rem minmax(0, 1fr);
  counter-increment: note;
}

.notes li::before {
  content: counter(note);
  padding-top: 0.15em;
  font: normal 700 0.75rem/1.4 var(--font-sans);
}

.word-count {
  margin-top: 0.85rem;
  color: var(--ink-3);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}

.example-caption {
  max-width: 40rem;
  margin-top: clamp(2.5rem, 2rem + 2vw, 3.5rem);
  color: var(--ink-3);
  font-size: 0.9375rem;
  line-height: 1.55;
}

/* ---- Writing it in Marc: text with its exhibit beside it ---------------- */

.beat {
  display: grid;
  gap: 1.25rem;
}

.beat + .beat {
  margin-top: clamp(2.25rem, 1.75rem + 2vw, 3.5rem);
}

.beat-text {
  max-width: var(--measure);
  color: var(--ink-2);
}

@media (min-width: 62rem) {
  .beat {
    grid-template-columns: minmax(0, 30rem) minmax(0, 1fr);
    column-gap: clamp(2.5rem, 6vw, 6rem);
    align-items: start;
  }

  .beat > .beat-text {
    grid-column: 1;
  }

  .beat > .brief,
  .beat > .flag {
    grid-column: 2;
    grid-row: 1 / span 2;
    justify-self: end;
    width: 100%;
    max-width: 32rem;
  }
}

/* The brief as typed: field names from the app's form, values in a typewriter face. */
.brief {
  display: grid;
  gap: 0.5rem;
  min-width: 0;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line-strong);
  border-radius: 0.375rem;
  background: var(--bg-elev);
  font-size: 0.875rem;
  line-height: 1.5;
}

.brief-line {
  display: grid;
  gap: 0.1rem;
}

@media (min-width: 30rem) {
  .brief-line {
    grid-template-columns: 7.5rem minmax(0, 1fr);
    column-gap: 0.75rem;
  }
}

.brief dt {
  color: var(--ink-3);
}

.brief dd {
  min-width: 0;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.6;
}

/* The number check, shown on the example's own facts. */
.flag {
  display: grid;
  gap: 0.5rem;
  min-width: 0;
  padding: 0.9rem 1.1rem;
  border-left: 3px solid var(--pen);
  background: var(--bg-sunk);
  color: var(--ink-2);
  font-size: 0.875rem;
  line-height: 1.5;
}

.flag-line {
  display: grid;
  gap: 0.1rem;
}

@media (min-width: 30rem) {
  .flag-line {
    grid-template-columns: 6.25rem minmax(0, 1fr);
    column-gap: 0.75rem;
  }
}

.flag-key {
  color: var(--ink-3);
  font-weight: 600;
}

.flag-bad {
  color: var(--ink);
  font-weight: 700;
  text-decoration: underline wavy var(--pen);
  text-decoration-skip-ink: none;
  text-underline-offset: 0.25em;
}

.flag-note {
  color: var(--ink);
}

.how-last {
  max-width: var(--measure);
  margin-top: clamp(2.25rem, 1.75rem + 2vw, 3.5rem);
  font-family: var(--font-serif);
  font-size: clamp(1.1875rem, 1.1rem + 0.4vw, 1.375rem);
  line-height: 1.45;
}

/* ---- Your text --------------------------------------------------------- */

@media (min-width: 62rem) {
  /* The one section with its heading in the margin: it is short and should look it. */
  .privacy .container {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  }

  .privacy .container::before {
    grid-column: 1 / -1;
  }
}

.privacy-body {
  max-width: var(--measure);
  color: var(--ink-2);
}

.privacy h2 + .privacy-body {
  margin-top: 1.25rem;
}

@media (min-width: 62rem) {
  .privacy h2 + .privacy-body {
    margin-top: 0.4rem;
  }
}

.more {
  margin-top: 1rem;
}

.more a {
  color: var(--ink);
  font-weight: 600;
}

/* ---- Closing: a short signed note --------------------------------------- */

.closing h2 {
  font-size: clamp(2rem, 1.3rem + 3vw, 3.25rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
}

.closing-text {
  max-width: var(--measure);
  margin-top: 1rem;
  color: var(--ink-2);
}

.closing-text a {
  color: var(--ink);
}

.signature {
  margin-top: 0.75rem;
  color: var(--ink);
  font: italic 400 1.25rem/1.4 var(--font-serif);
}

/* The homepage closing is a signed note; the button sits apart from it. */
.letter-try {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin-top: 2.5rem;
}

@media (max-width: 30rem) {
  .letter-try .button {
    flex: 1 1 100%;
  }
}

@media (min-width: 62rem) {
  .letter .container {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    align-items: end;
  }

  .letter .container::before {
    grid-column: 1 / -1;
  }

  .letter-try {
    justify-content: flex-end;
    margin-top: 0;
  }
}

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

.opening-about h1 {
  max-width: 13em;
}

.story {
  max-width: var(--measure);
  margin-top: clamp(1.75rem, 1.25rem + 2vw, 3rem);
  color: var(--ink-2);
}

.story p + p {
  margin-top: 1.1rem;
}

.story-lead {
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
  line-height: 1.45;
}

.founders {
  display: grid;
  gap: 2.5rem;
  min-width: 0;
  margin-top: clamp(1.75rem, 1.25rem + 2vw, 2.75rem);
  padding: 0;
  list-style: none;
}

@media (min-width: 40rem) {
  /* Two columns split by a hairline, like a masthead. */
  .founders {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 56rem;
    gap: 0;
  }

  .founder:first-child {
    padding-right: clamp(1.5rem, 3vw, 3rem);
  }

  .founder + .founder {
    padding-left: clamp(1.5rem, 3vw, 3rem);
    border-left: 1px solid var(--line);
  }
}

.founder {
  min-width: 0;
}

.founder h3 {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 1.5rem + 1vw, 2.25rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.founder-role {
  margin-top: 0.4rem;
  color: var(--ink-3);
  font-size: 0.9375rem;
  line-height: 1.4;
}

.founder p:not(.founder-role) {
  max-width: 30rem;
  margin-top: 0.9rem;
  color: var(--ink-2);
}

/* ---- Your text page and the 404 ---------------------------------------- */

.doc {
  padding-block: clamp(2.5rem, 1.5rem + 4vw, 5rem) var(--section-pad);
}

.doc h1 {
  max-width: 14em;
  font-size: clamp(2.25rem, 1.6rem + 2.6vw, 3.5rem);
  line-height: 1.06;
  letter-spacing: -0.025em;
}

.doc-lede {
  max-width: var(--measure);
  margin-top: 1.25rem;
  color: var(--ink-2);
  font-family: var(--font-serif);
  font-size: clamp(1.1875rem, 1.1rem + 0.4vw, 1.3125rem);
  line-height: 1.5;
}

.doc h2 {
  margin-top: clamp(2.25rem, 1.75rem + 1.5vw, 3rem);
  font-size: clamp(1.375rem, 1.2rem + 0.6vw, 1.625rem);
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.doc h2 + p,
.doc p + p {
  max-width: var(--measure);
  margin-top: 0.6rem;
  color: var(--ink-2);
}

.not-found {
  min-height: min(70vh, 40rem);
  padding-block: clamp(3rem, 2rem + 6vw, 8rem);
}

.not-found h1 {
  font-size: clamp(2.25rem, 1.6rem + 2.6vw, 3.5rem);
  line-height: 1.06;
  letter-spacing: -0.025em;
}

.not-found p {
  margin-top: 1rem;
  font-family: var(--font-serif);
  font-size: 1.25rem;
}

/* ---- Footer ------------------------------------------------------------ */

.site-footer {
  padding-block: 2.5rem 2rem;
  border-top: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink-2);
  font-size: 0.9375rem;
}

.footer-grid {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 48rem) {
  .footer-grid {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }
}

.footer-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  padding: 0;
  list-style: none;
}

.footer-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: var(--ink-2);
  text-decoration: none;
}

.footer-nav a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.footer-base {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 0.875rem;
}

/* ---- Forced colors ----------------------------------------------------- */

@media (forced-colors: active) {
  .button {
    border-color: ButtonText;
  }

  .stock {
    background: none;
    text-decoration: underline;
  }

  .flag {
    border-left-color: CanvasText;
  }
}
