/*
 * House style: one look for the Mainfield family of sites.
 *
 * Ampleton's site is the reference. The structure is shared: the type (Poppins for
 * headings, the system sans for reading), pills, cards, bands, the header and the
 * dark footer. A brand sets its own colours, by putting data-brand on <html>:
 *
 *   mainfield   white and black with a little maroon; the company record, and the default
 *   ampleton    terracotta, as on ampleton.ca
 *   lab         burgundy with a field-green band, for lab.mainfield.ca
 *
 * Flat colour only. No gradients, no shadows heavier than a hairline border.
 * No external requests: the font files sit beside this file in fonts/.
 */

@font-face { font-family: Poppins; font-weight: 600; font-style: normal; font-display: swap; src: url('fonts/poppins-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: Poppins; font-weight: 700; font-style: normal; font-display: swap; src: url('fonts/poppins-latin-700-normal.woff2') format('woff2'); }

:root {
  /* shared by every brand: type, shape, measure */
  --display: Poppins, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --text: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --radius: 24px;
  --measure: 46rem;
}

/* Mainfield & Co. Also the default, so a page with no data-brand gets it; named as well, so it
   holds when a Mainfield block sits inside a page of another brand. */
:root, [data-brand='mainfield'] {
  /* the brand's own colours. The default is Mainfield & Co: white and black, with a little
     maroon. Maroon is for the mark, link underlines and the focus ring, and nothing larger. */
  --ground: #FFFFFF;
  --card: #FFFFFF;
  --ink: #111111;
  --ink-soft: #333333;
  --muted: #5C5C5C;
  --line: #E3E3E3;
  --accent: #741313;
  --accent-dark: #5A0E0E;
  --accent-soft: #EEEEEE;
  --band: #FFFFFF;
  --band-line: var(--line);       /* a white band is marked off by hairlines instead of a tint */
  --action: var(--ink);           /* what primary buttons and filled bands are painted with */
  --action-hover: var(--ink-soft);
  --on-action: #FFFFFF;
  --eyebrow: var(--muted);
}
/* Ampleton and the lab share the warm neutrals: cream, brown ink, a sand hairline. */
[data-brand='ampleton'], [data-brand='lab'] { --ground: #FDF7EF; --card: #FFFFFF; --ink: #2B2118; --ink-soft: #4A3B2E; --muted: #6B5D4F; --line: #EADFD2; --band-line: transparent; }
[data-brand='ampleton'] { --accent: #D96C47; --accent-dark: #C25A38; --accent-soft: #F3C4B0; --band: #F6DFCC; --action: #D96C47; --action-hover: #C25A38; --eyebrow: #D96C47; }
[data-brand='lab'] { --accent: #741313; --accent-dark: #5A0E0E; --accent-soft: #F1DDDA; --band: #DCE5D6; --action: #741313; --action-hover: #5A0E0E; --eyebrow: #741313; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--ground); color: var(--ink); font: 1.0625rem/1.65 var(--text); -webkit-font-smoothing: antialiased; }
main { flex: 1 0 auto; }   /* a short page still ends with its footer at the bottom of the window */
::selection { background: var(--accent-soft); color: var(--ink); }
img { max-width: 100%; height: auto; }
a { color: var(--ink); text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

h1, h2, h3 { font-family: var(--display); font-weight: 700; color: var(--ink); letter-spacing: -0.02em; margin: 0; }
h1 { font-size: clamp(2.4rem, 7vw, 4.25rem); line-height: 1.04; }
h2 { font-size: clamp(1.45rem, 3vw, 1.9rem); line-height: 1.15; }
h3 { font-size: 1.3rem; line-height: 1.2; letter-spacing: -0.01em; }
p { margin: 0.55rem 0; }
.lede { font-size: clamp(1.15rem, 2.2vw, 1.4rem); color: var(--muted); max-width: 34em; margin-top: 1.1rem; }
.eyebrow { font-family: var(--display); font-weight: 700; font-size: 0.75rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--eyebrow); margin: 0 0 1rem; }
.muted { color: var(--muted); }
.big { font-family: var(--display); font-weight: 700; font-size: clamp(1.6rem, 4vw, 2.2rem); letter-spacing: -0.01em; margin: 0; }

.wrap { width: 100%; max-width: 72rem; margin: 0 auto; padding: 0 1.5rem; }
.narrow { max-width: var(--measure); }
.section { padding-block: 3.25rem; }   /* block only: .wrap owns the side gutters */
.hero { padding-block: 4.5rem 3rem; }

/* header: sticky, cream, a hairline under it; the mark, the name, pills on the right */
.site-header { position: sticky; top: 0; z-index: 10; background: var(--ground); border-bottom: 1px solid var(--line); }
.site-header .bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4rem; }
.brand { display: inline-flex; align-items: center; gap: 0.65rem; text-decoration: none; font-family: var(--display); font-weight: 700; font-size: 1.3rem; letter-spacing: -0.02em; color: var(--ink); }
.brand:hover { color: var(--ink); opacity: 0.8; }
/*
 * THE SIZE RULE, owner-set 2026-09-20. Beside the wordmark the mark is never
 * larger than the height of the wordmark's capital M, and by default it is
 * exactly that. Poppins declares a cap height of 0.705em but draws its M a shade
 * shorter, so the cap is 0.7em; em here is the wordmark's
 * own size, so the mark scales with it and cannot outgrow it. Alone (favicon,
 * app icon, a stamp) there is no wordmark and the rule does not apply.
 */
.brand img { display: block; width: auto; height: 0.7em; max-height: 0.7em; }
.site-header nav { display: flex; align-items: center; gap: 0.25rem; flex-wrap: wrap; justify-content: flex-end; }

/* pills: every button and nav item */
.pill, .donate { display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; padding: 0.7rem 1.4rem; font: 500 1rem/1.2 var(--text); text-decoration: none; border: 0; cursor: pointer; transition: background-color 0.15s ease, color 0.15s ease; }
.pill-primary, .donate { background: var(--action); color: var(--on-action); }
.pill-primary:hover, .donate:hover { background: var(--action-hover); color: var(--on-action); }
.pill-soft { background: var(--band); color: var(--ink); }
.pill-soft:hover { background: var(--accent-soft); color: var(--ink); }
.pill-ink { background: var(--ink); color: var(--ground); padding: 0.6rem 1.2rem; font-size: 0.9rem; }
.pill-ink:hover { background: var(--ink-soft); color: var(--ground); }
.pill-quiet { padding: 0.5rem 0.9rem; font-size: 0.9rem; color: var(--muted); }
.pill-quiet:hover { background: var(--band); color: var(--ink); }
.donate { display: flex; width: 100%; font-size: 1.1rem; padding: 0.95rem 1.6rem; margin-top: 1rem; }

/* cards and bands */
.grid { display: grid; gap: 1.25rem; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.75rem; }
.card > :first-child { margin-top: 0; } .card > :last-child { margin-bottom: 0; }
.card .pill { margin-top: 1.1rem; }
.band { background: var(--band); border-block: 1px solid var(--band-line, transparent); }
.band.accent { background: var(--action); color: var(--on-action); } .band.accent h2, .band.accent h3, .band.accent .eyebrow { color: var(--on-action); }
.split { display: flex; align-items: center; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }

/* long-form pages: plain headings and paragraphs inside .prose get the house rhythm */
.prose { max-width: var(--measure); padding-top: 3.5rem; padding-bottom: 3.5rem; }
.prose h1 { font-size: clamp(2.1rem, 6vw, 3.4rem); }
.prose h1 + p { font-size: clamp(1.1rem, 2vw, 1.3rem); color: var(--muted); margin-top: 1rem; }
.prose h2 { margin: 3rem 0 0.8rem; }
.prose .lockup { display: block; max-width: 15rem; width: 100%; margin: 0 0 2rem; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 0.9rem 1.1rem; }
figure { margin: 2rem 0; }
figure img { display: block; width: 100%; border-radius: var(--radius); }
figcaption { font-size: 0.875rem; color: var(--muted); margin-top: 0.6rem; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 2rem 0; }
.pair figure { margin: 0; } .pair img { aspect-ratio: 1 / 1; object-fit: cover; }
.counter { font-family: var(--display); font-weight: 700; font-size: 1.6rem; letter-spacing: -0.01em; margin: 1.5rem 0 0; padding: 0.3rem 0.6rem; border-radius: 12px; display: inline-block; transition: background-color 0.7s ease; }
.counter-bump { background-color: var(--accent-soft); }
.journal-entry { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem 1.6rem; margin: 1rem 0; }
.journal-title { font-family: var(--display); font-weight: 700; font-size: 1.2rem; letter-spacing: -0.01em; }
.journal-date { font-size: 0.875rem; color: var(--muted); margin: 0.15rem 0; }
.journal-excerpt { margin: 0.3rem 0 0; } .journal-paragraph { margin: 0.9rem 0; }
article h1 { margin-top: 0.5rem; }

/* footer: an ink band, as on ampleton.ca */
.site-footer { background: var(--ink); color: var(--ground); margin-top: 2rem; padding: 2.5rem 0; font-size: 0.9rem; }
.site-footer p { margin: 0.25rem 0; } .site-footer a { color: var(--ground); }

@media (max-width: 34rem) { .hero { padding-block: 3rem 2rem; } .section { padding-block: 2.5rem; } .pair { grid-template-columns: 1fr; } .brand { font-size: 1.15rem; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/*
 * Print. An accounts payable department prints the company page into a vendor
 * file. That is a real use, so it comes out as a clean one page record: no
 * navigation, no colour, and link targets spelled out.
 */
@media print {
  body { background: #fff; color: #000; font-size: 11pt; display: block; min-height: 0; }
  .site-header { position: static; border: 0; } .site-header nav { display: none; }
  .wrap, .prose { max-width: none; padding-left: 0; padding-right: 0; } .hero, .section, .prose { padding-top: 0.6rem; padding-bottom: 0.6rem; }
  .card, .band, .band.accent, .site-footer, .journal-entry { background: none; color: #000; border: 0; padding: 0; } .band.accent h2, .band.accent h3, .band.accent .eyebrow, .eyebrow { color: #000; }
  .pill, .donate { background: none !important; color: #000 !important; padding: 0; display: inline; }
  a { text-decoration: none; color: #000; } a[href^='http']::after { content: ' (' attr(href) ')'; font-size: 0.85em; }
  h1 { font-size: 22pt; } .site-footer { margin-top: 1rem; }
}
