/* mattmills.xyz — the hub. App pages under /<app>/ bring their own styles. */

:root {
  --bg: #ffffff;
  --ink: #16181d;
  --quiet: #5b6270;
  --faint: #e4e6ea;
  --tile-bg: #f6f7f9;
  --accent: #16181d;
  --measure: 660px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0e11;
    --ink: #e9ebef;
    --quiet: #939aa8;
    --faint: #22252c;
    --tile-bg: #15171c;
    --accent: #e9ebef;
  }
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Helvetica,
    Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 24px;
}

a {
  color: var(--ink);
  text-decoration-color: var(--faint);
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-color: currentColor;
}

/* ---------- intro ---------- */

.intro {
  padding: 96px 0 72px;
}

.intro h1 {
  font-size: clamp(30px, 7vw, 42px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 12px;
}

.lede {
  font-size: clamp(17px, 2.4vw, 19px);
  color: var(--quiet);
  margin: 0 0 36px;
  max-width: 46ch;
}

.facts {
  display: grid;
  gap: 22px;
  margin: 0 0 32px;
}

.facts dt {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--quiet);
  margin-bottom: 4px;
}

.facts dd {
  margin: 0;
}

/* ---------- social ---------- */

.social {
  display: flex;
  gap: 14px;
  align-items: center;
}

.social a {
  display: inline-flex;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--faint);
  border-radius: 999px;
  color: var(--quiet);
  transition: color 120ms ease, border-color 120ms ease;
}

.social a:hover {
  color: var(--ink);
  border-color: var(--ink);
}

.social svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

/* ---------- apps ---------- */

.apps {
  padding: 0 0 40px;
  border-top: 1px solid var(--faint);
}

.section-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--quiet);
  margin: 40px 0 24px;
}

.tiles {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.tile {
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid var(--faint);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  background: var(--bg);
  transition: border-color 140ms ease, transform 140ms ease;
}

.tile:hover {
  border-color: var(--quiet);
  transform: translateY(-2px);
}

/* Previews vary in shape and background, so the frame is fixed and the art sits inside it.
   Per-tile background is set with --preview on the element itself. */
.tile-media {
  aspect-ratio: 16 / 10;
  background: var(--preview, var(--tile-bg));
  border-bottom: 1px solid var(--faint);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.tile-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 14px;
  display: block;
}

/* A preview that is meant to fill the frame edge to edge opts out of the padding. */
.tile-media.bleed img {
  object-fit: cover;
  padding: 0;
}

.tile-body {
  padding: 18px 20px 22px;
  flex: 1;
}

.tile-body h3 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
}

.tile-body p {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--quiet);
}

.tile-meta {
  display: inline-block;
  margin-top: 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--quiet);
}

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--faint);
  padding: 32px 0 72px;
  font-size: 14px;
  color: var(--quiet);
}

.site-footer p {
  margin: 0;
}

@media (max-width: 640px) {
  .intro {
    padding: 64px 0 56px;
  }

  .tiles {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tile {
    transition: none;
  }

  .tile:hover {
    transform: none;
  }
}
