/* Mackay Software — landing page.
   Colour, type, spacing and radius come from mackay-design-system/tokens.css.
   Those sizes are tuned for printed A4, so the web scale is set here.
   Rules of the house: hairlines not shadows, square corners, `signal` twice
   at most (the logo cursor and the availability badge). */

:root {
  --gutter: var(--space-4);
  --measure: 62ch;
  --rule: 1px solid var(--line);
  --shell: 1040px;
  --label-col: 170px;

  --web-display: clamp(30px, 6.2vw, 54px);
  --web-heading: clamp(17px, 2.2vw, 21px);
  --web-body: clamp(14px, 1.5vw, 16px);
  --web-lede: clamp(15px, 1.9vw, 19px);
  --web-mail: clamp(18px, 3.4vw, 30px);
  --web-label: clamp(12px, 1.3vw, 13px);
  --web-small: clamp(13px, 1.4vw, 15px);
  --web-foot: clamp(12px, 1.2vw, 13px);
}

/* tokens.css sets .t-label and .t-small to 11px for print. Everything that
   carries them on screen — section labels, nav, badge, technologies, contact
   and footer — re-scales here; the fixed line-heights go unitless with it. */
.t-label { font-size: var(--web-label); line-height: 1.5; }
.t-small { font-size: var(--web-small); line-height: 1.6; }

@media (min-width: 720px) {
  :root { --gutter: var(--space-8); }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: var(--web-body);
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, dl, dd { margin: 0; }
a { color: inherit; }

::selection { background: var(--ink); color: var(--paper); }

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

.skip { position: absolute; left: -9999px; }
.skip:focus {
  left: var(--gutter);
  top: var(--space-2);
  z-index: 2;
  background: var(--paper);
  padding: var(--space-2) var(--space-4);
  border: var(--rule);
  text-decoration: none;
}

/* Sections run full width so their hairlines reach the edges;
   .wrap holds the content on one measure. */
.wrap {
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ── Header ─────────────────────────────────────────────── */

.head-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  align-items: center;
  justify-content: space-between;
  padding-block: var(--space-4);
}

.lockup { display: inline-flex; }

.lockup img {
  display: block;
  height: 22px;
  width: auto;
}

.site-nav { display: flex; flex-wrap: wrap; gap: var(--space-4); }

.site-nav a,
.contact-links a {
  color: var(--ink-muted);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.contact-links a:hover,
.contact-links a:focus-visible {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

/* ── Hero ───────────────────────────────────────────────── */

.hero { border-top: var(--rule); }

.hero .wrap {
  padding-block: clamp(var(--space-8), 9vw, 104px) clamp(var(--space-8), 8vw, 88px);
}

.badge {
  display: inline-block;
  margin: 0 0 var(--space-4);
  padding: var(--space-1) var(--space-2);
  background: var(--signal-soft);
  color: var(--signal);
  border-radius: var(--radius-sm);
}

.badge { font-weight: 700; letter-spacing: -0.05em; }

.hero-title {
  font-size: var(--web-display);
  line-height: 1.12;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-8);
  text-wrap: balance;
}

.hero-lede {
  max-width: var(--measure);
  font-size: var(--web-lede);
  line-height: 1.6;
  color: var(--ink-muted);
}

.hero-note {
  margin-top: var(--space-4);
  max-width: var(--measure);
  color: var(--ink-muted);
}

.hero-actions {
  margin-top: var(--space-8);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2);
}

.action {
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  padding-bottom: 3px;
  font-weight: 500;
}

.action:hover,
.action:focus-visible { border-bottom-color: var(--ink); }

.sep { color: var(--ink-muted); }

/* ── Bands: label column left, content right ────────────── */

.band { border-top: var(--rule); }

.band-grid {
  display: grid;
  gap: var(--space-4);
  padding-block: clamp(var(--space-8), 5vw, 56px);
}

@media (min-width: 860px) {
  .band-grid {
    grid-template-columns: var(--label-col) minmax(0, 1fr);
    gap: var(--space-8);
  }
}

.band-label {
  color: var(--ink-muted);
  font-weight: 500;
}

.band-lede,
.contact-lede {
  max-width: var(--measure);
  color: var(--ink-muted);
}

/* ── Services ───────────────────────────────────────────── */

.services { display: grid; gap: var(--space-8); }

@media (min-width: 620px) {
  .services { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1060px) {
  .services[data-count="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.service { max-width: 46ch; }

.num { color: var(--ink-muted); margin: 0 0 var(--space-2); }

.service-h {
  font-size: var(--web-heading);
  line-height: 1.35;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: var(--space-2);
}

.service-p { color: var(--ink-muted); }

/* ── Technologies: one sorted run, separated by space ──── */

/* The column gap is the separator. A middot reads well mid-line but dangles at
   the end of a wrapped one, and which item lands there depends on the width,
   the font and the item count — space never has that problem. */
.tags {
  margin-top: var(--space-4);
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  column-gap: var(--space-8);
  row-gap: var(--space-2);
  max-width: var(--measure);
  color: var(--ink-muted);
}

/* ── Facts: invoice-style label / value pairs ───────────── */

.facts { margin-top: var(--space-8); border-top: var(--rule); }

.fact {
  display: grid;
  gap: var(--space-1);
  padding-block: var(--space-2);
  border-bottom: var(--rule);
}

@media (min-width: 620px) {
  .fact {
    grid-template-columns: var(--label-col) minmax(0, 1fr);
    gap: var(--space-4);
    align-items: baseline;
  }
}

.fact dt { color: var(--ink-muted); }

/* ── Contact ────────────────────────────────────────────── */

.contact { background: var(--paper-sunken); }

.contact-mail {
  margin-top: var(--space-4);
  font-size: var(--web-mail);
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.contact-mail a {
  text-decoration: none;
  border-bottom: 2px solid var(--line);
  padding-bottom: 4px;
}

.contact-mail a:hover,
.contact-mail a:focus-visible { border-bottom-color: var(--ink); }

.contact-links {
  margin-top: var(--space-8);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-8);
}

.contact-note {
  margin-top: var(--space-8);
  padding-top: var(--space-4);
  border-top: var(--rule);
  max-width: var(--measure);
  color: var(--ink-muted);
}

/* ── Footer ─────────────────────────────────────────────── */

/* A notch under .t-small: the registration line is reference, not reading.
   Its own size rather than a smaller --web-small, which the technologies
   run also carries. */
.site-foot {
  border-top: var(--rule);
  color: var(--ink-muted);
  font-size: var(--web-foot);
}

.foot-wrap {
  padding-block: var(--space-4) var(--space-8);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-8);
  justify-content: space-between;
}

/* ── Print: light theme, 20mm margins ───────────────────── */

/* The page is dark on screen, so paper gets the light token set back —
   the dark muted greys would print at about 3:1 on white. */
@media print {
  @page { margin: 20mm; }

  :root, :root[data-theme] {
    color-scheme: light;
    --paper: #FFFFFF;
    --paper-sunken: #FFFFFF;
    --line: #E2E2DF;
    --ink: #111111;
    --ink-muted: #6B6B68;
    --signal: #C8341B;
    --signal-soft: #FBEAE6;
  }

  body { background: var(--paper); color: var(--ink); }
  .wrap { max-width: none; padding-inline: 0; }
  .site-nav, .skip { display: none; }
  .hero .wrap { padding-block: var(--space-8); }
}

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