/* The logo top left, then the headline, then the product cards, then two
   short sections side by side. Each row stacks when the window gets narrow,
   so a phone gets one column. Nothing here moves. */

@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("fonts/AtkinsonHyperlegible-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("fonts/AtkinsonHyperlegible-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}

:root {
  --bg: #f3ead7;
  --fg: #2a1f1a;
  --muted: #5e4f45;
  --rule: #d9cdb4;
  /* A card's frame while pointed at: a couple of steps past the rule colour. */
  --rule-hover: #c2b195;
  --card: #e9dfc8;
  /* Link underlines: the brand's red, and the ink colour when pointed at. */
  --accent: #dc4f3c;
  --accent-hover: #2a1f1a;
  --logo-width: clamp(12rem, 9rem + 9vw, 17rem);
  --pull-x: 0rem;
  --pull-y: 0rem;
  --mark-pull: 0rem;
  --body: "Atkinson Hyperlegible", Verdana, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    /* The page is the logo's plate colour, so the logo sits on it with no box. */
    --bg: #2a1f1a;
    --fg: #f3ead7;
    --muted: #bfb09d;
    --rule: #4a3a30;
    --rule-hover: #65503f;
    --card: #33261f;
    --accent: #ec7f33;
    --accent-hover: #f2b632;
    /* The plate cannot be seen, so the logo moves out by the plate's own
       margin (55 across and 51.7 down, of 487.73 wide) and the M lines up
       with the text. */
    --pull-x: calc(var(--logo-width) * -55 / 487.73);
    --pull-y: calc(var(--logo-width) * -51.7 / 487.73);
    /* The footer mark the same way: 55 across, of 210 wide, at its own width. */
    --mark-pull: calc(2.75rem * -55 / 210);
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--body);
  font-size: 1.1875rem;
  line-height: 1.55;
}

.page {
  max-width: 64rem;
  margin: 0 auto;
  padding-block: clamp(2rem, 5vw, 4rem) 2.5rem;
  padding-left: max(clamp(1.25rem, 5vw, 4rem), env(safe-area-inset-left, 0px));
  padding-right: max(clamp(1.25rem, 5vw, 4rem), env(safe-area-inset-right, 0px));
}

h1 { margin: 0; }
h1 svg {
  display: block;
  width: var(--logo-width);
  height: auto;
  margin: var(--pull-y) 0 var(--pull-y) var(--pull-x);
}
/* The headline is in the ink colour, so orange stays on the logo and the
   link underlines. */
.lead {
  margin: clamp(1.75rem, 4.5vw, 3.25rem) 0 0;
  max-width: 25ch;
  color: var(--fg);
  font-size: clamp(1.75rem, 1.1rem + 2.8vw, 3rem);
  line-height: 1.18;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
/* Close under the headline, so the two read as one unit. The widest gap
   stays the one before "What has shipped". */
.sub {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: clamp(1.1875rem, 1rem + 0.6vw, 1.5rem);
}

main {
  margin-block: clamp(3rem, 8vw, 6rem) clamp(3rem, 6vw, 5rem);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: 3rem clamp(2rem, 5vw, 4rem);
}
section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 0;
}
.shipped { grid-column: 1 / -1; }
h2 {
  margin: 0 0 0.25rem;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
p {
  margin: 0;
  max-width: 46ch;
}

.products {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr));
  gap: 1.5rem;
}
/* The rule colour frames each card, so a bright screenshot has an edge
   against the page. */
.product {
  position: relative;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 0.875rem;
}
/* The picture's own corners sit exactly inside the card's border, so no
   sliver of card shows around them. */
.thumb {
  display: block;
  width: 100%;
  height: auto;
  border-bottom: 1px solid var(--rule);
  border-radius: calc(0.875rem - 1px) calc(0.875rem - 1px) 0 0;
}
.product div {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.25rem 1.5rem 1.5rem;
}
.name {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}
.icon {
  flex: none;
  width: 3rem;
  height: 3rem;
  border-radius: 0.6875rem;
}
.product strong { font-size: 1.625rem; }
/* The name's link covers the whole card, so the picture can be clicked too
   and there is still one link for each product. */
.name a::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 0.875rem;
}
/* Pointing anywhere on the card steps its frame up a shade, drawn over the
   border so nothing shifts. The keyboard ring goes round the whole card in
   the accent instead of round the name alone. */
.name a:hover::after { outline: 1px solid var(--rule-hover); outline-offset: -1px; }
.name a:focus-visible { outline: none; }
.name a:focus-visible::after { outline: 2px solid var(--accent); outline-offset: 3px; }
.where {
  color: var(--muted);
  font-size: 1rem;
}

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  /* Low enough to clear the tails of p and j, and never broken around them. */
  text-underline-offset: 0.28em;
  text-decoration-skip-ink: none;
  overflow-wrap: anywhere;
}
a:hover { text-decoration-color: var(--accent-hover); }
a:focus-visible {
  outline: 3px solid var(--fg);
  outline-offset: 3px;
  border-radius: 2px;
}

footer {
  display: flex;
  align-items: center;
  gap: 1rem;
  border-top: 1px solid var(--rule);
  padding-top: 1.25rem;
  color: var(--muted);
  font-size: 1rem;
}
footer svg {
  flex: none;
  width: 2.75rem;
  height: auto;
  margin-left: var(--mark-pull);
}
footer div {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  min-width: 0;
}

@media (min-width: 50rem) {
  footer div {
    flex: 1;
    flex-direction: row;
    justify-content: space-between;
    gap: 2rem;
  }
}
