/* Mapes Bros: single-page lander. Mobile first. */

@font-face {
  font-family: "Chakra Petch";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/chakra-petch-600-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Chakra Petch";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/chakra-petch-700-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/fonts/atkinson-hyperlegible-next-latin.woff2") format("woff2");
}

/* Tokens: graphite, steel, gunmetal, gold */
:root {
  --paper: #fcfbf9;
  --surface: #f2f0eb;
  --ink: #1c1c1a;
  --steel: #575c61;
  --gold: #8a6200;
  --on-gold: #fcfbf9;
  --rule: #dcd8d0;
  --rule-strong: #8f8a80;

  --font-head: "Chakra Petch", "Arial Narrow", Arial, sans-serif;
  --font-body: "Atkinson Hyperlegible Next", Verdana, sans-serif;
  --wrap: 72rem;
  --gutter: 1rem;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #151515;
    --surface: #1f2123;
    --ink: #ecebe7;
    --steel: #a3a7ab;
    --gold: #e2b54a;
    --on-gold: #151515;
    --rule: #303336;
    --rule-strong: #6b6f73;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --paper: #151515;
  --surface: #1f2123;
  --ink: #ecebe7;
  --steel: #a3a7ab;
  --gold: #e2b54a;
  --on-gold: #151515;
  --rule: #303336;
  --rule-strong: #6b6f73;
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
}

h1, h2, h3 {
  font-family: var(--font-head);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0 0 1rem; max-width: 65ch; }

a { color: inherit; text-decoration-color: var(--gold); text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
a:hover { text-decoration-thickness: 2px; }

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

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

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  z-index: 10;
  padding: 0.5rem 0.75rem;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-head);
  font-weight: 600;
}
.skip:focus { top: 0.5rem; }

/* Top bar */
.bar { border-bottom: 1px solid var(--rule); }
.bar__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4rem; }

.wordmark {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.03em;
  text-decoration: none;
}
.wordmark::after { content: ""; display: inline-block; width: 0.5em; height: 0.5em; margin-left: 0.25em; background: var(--gold); }

.theme {
  font: 600 0.875rem/1 var(--font-head);
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--rule-strong);
  padding: 0.65rem 0.85rem;
  min-height: 2.75rem;
  cursor: pointer;
}
.theme:hover { border-color: var(--ink); }

/* Hero */
.hero { display: grid; gap: 2.5rem; padding-block: 3rem 3.5rem; }

.hero h1 { font-size: clamp(2.25rem, 1.4rem + 4.2vw, 4.25rem); max-width: 16ch; margin-bottom: 1.5rem; }

.lede { font-size: 1.1875rem; color: var(--ink); }

.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 2rem 0 0; }

.btn {
  display: inline-flex;
  align-items: center;
  min-height: 3rem;
  padding: 0.75rem 1.15rem;
  border: 2px solid var(--ink);
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
}
.btn:hover { background: var(--surface); }
.btn--solid { background: var(--gold); border-color: var(--gold); color: var(--on-gold); clip-path: polygon(0 0, calc(100% - 0.75rem) 0, 100% 0.75rem, 100% 100%, 0 100%); padding-right: 1.6rem; }
.btn--solid:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }

/* Spec panel: a nod to the tech-spec cards on the back of the box */
.spec {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 0;
  background: var(--surface);
  border-top: 4px solid var(--gold);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 1.5rem), calc(100% - 1.5rem) 100%, 0 100%);
  align-self: start;
}
.spec > div { padding: 1.1rem 1.25rem; border-bottom: 1px solid var(--rule); }
.spec > div:nth-child(odd) { border-right: 1px solid var(--rule); }
.spec > div:nth-last-child(-n + 2) { border-bottom: 0; }
.spec dt { font-size: 0.875rem; color: var(--steel); }
.spec dd { margin: 0.15rem 0 0; font-family: var(--font-head); font-weight: 700; font-size: clamp(1.5rem, 1.2rem + 1.5vw, 2.25rem); letter-spacing: -0.03em; line-height: 1.15; }

/* Sites */
.sites { padding-block: 3rem 4rem; border-top: 1px solid var(--rule); }
.sites:focus { outline: none; }
.sites h2 { font-size: clamp(1.75rem, 1.3rem + 2vw, 2.75rem); margin-bottom: 0.75rem; }
.sites__intro { color: var(--steel); margin-bottom: 2.5rem; }

.grid { display: grid; gap: 0 2.5rem; }

.entry { padding-block: 1.75rem 2rem; border-top: 1px solid var(--rule-strong); }
.entry h3 { font-size: clamp(1.4rem, 1.15rem + 1.1vw, 1.9rem); }
.entry--lead { border-top: 4px solid var(--ink); }
.entry--lead h3 { font-size: clamp(1.75rem, 1.3rem + 2vw, 2.6rem); }

.domain {
  margin: 0.4rem 0 1rem;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--gold);
}

.go { display: inline-block; padding-block: 0.4rem; font-family: var(--font-head); font-weight: 600; font-size: 1.0625rem; text-decoration-thickness: 2px; }

.follow { margin: 1.5rem 0 0.5rem; font-size: 0.875rem; color: var(--steel); }

.social { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0; padding: 0; list-style: none; }
.social a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--rule-strong);
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
}
.social a:hover { border-color: var(--gold); background: var(--surface); }

/* Footer */
.foot { border-top: 1px solid var(--rule); background: var(--surface); }
.foot__inner { padding-block: 2.5rem 3rem; font-size: 0.9375rem; color: var(--steel); }
.foot strong { color: var(--ink); font-family: var(--font-head); }

/* Tablet and up */
@media (min-width: 48rem) {
  :root { --gutter: 2rem; }

  .hero { grid-template-columns: 7fr 4fr; gap: 4rem; align-items: end; padding-block: 5rem 5rem; }

  .grid { grid-template-columns: repeat(12, 1fr); }
  .entry--lead { grid-column: 1 / -1; display: grid; grid-template-columns: 7fr 4fr; gap: 0 4rem; align-items: start; }
  .entry--lead .follow { margin-top: 0.4rem; }
  .entry--wide { grid-column: span 7; }
  .entry--narrow { grid-column: span 5; }
  .entry--quiet { grid-column: 1 / span 9; }

  .foot__inner { display: grid; grid-template-columns: 5fr 4fr 4fr; gap: 2.5rem; }
  .foot__inner p { margin: 0; }
}

@media (prefers-reduced-motion: no-preference) {
  .btn, .social a, .theme { transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease; }
}

@media print {
  .bar, .actions, .skip { display: none; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.8em; }
}
