/* Maddox Labs site shell: header, footer, home, projects, and simple pages.
   Loaded after the older theme in main.css; every class here starts with ml-.
   Sizes are in px because the theme sets html { font-size: 62.5% }. */

:root {
  --ml-ink: #1f2a33;
  --ml-muted: #5b6770;
  --ml-line: #dde2e5;
  --ml-paper: #ffffff;
  --ml-wash: #f3f4f4;
  --ml-accent: #0f6f68;
  --ml-accent-dark: #0a524d;
  --ml-radius: 10px;
  --ml-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* The theme sets Georgia on body; the new shell is sans-serif throughout. */
.ml-header,
.ml-main,
.ml-footer {
  font-family: var(--ml-sans);
}

.ml-wrap {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 20px;
}

.ml-narrow {
  max-width: 760px;
}

/* Phones: long hostnames, URLs and code must wrap instead of widening the
   page, and images never exceed their column. */
.ml-main {
  overflow-wrap: break-word;
}

.ml-main img {
  max-width: 100%;
  height: auto;
}

.ml-grid > *,
.ml-tiles > *,
.ml-postlist > *,
.ml-postrow > * {
  min-width: 0;
}

/* Header */
.ml-header {
  background: var(--ml-paper);
  border-bottom: 1px solid var(--ml-line);
}

.ml-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 24px;
  min-height: 64px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.ml-logo {
  font-family: var(--ml-sans);
  font-weight: 800;
  font-size: 20px;
  color: var(--ml-ink);
  letter-spacing: 0.01em;
}

.ml-logo:hover,
.ml-logo:focus {
  color: var(--ml-accent);
  text-decoration: none;
}

.ml-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.ml-nav a {
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--ml-ink);
  font-size: 15px;
  font-weight: 600;
}

.ml-nav a:hover,
.ml-nav a:focus {
  background: var(--ml-wash);
  color: var(--ml-accent);
  text-decoration: none;
}

/* Main content */
.ml-main {
  color: var(--ml-ink);
  font-size: 16px;
  line-height: 1.6;
  padding-bottom: 48px;
}

.ml-main h1,
.ml-main h2,
.ml-main h3 {
  font-family: var(--ml-sans);
  color: var(--ml-ink);
  line-height: 1.2;
}

.ml-main h1 {
  font-size: 40px;
  font-weight: 800;
  margin: 0 0 12px;
}

.ml-main h2 {
  font-size: 26px;
  font-weight: 800;
  margin: 0 0 12px;
}

.ml-main h3 {
  font-size: 19px;
  font-weight: 700;
  margin: 0 0 6px;
}

.ml-main p {
  margin: 0 0 14px;
}

.ml-main a {
  color: var(--ml-accent);
}

.ml-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 13px;
  font-weight: 700;
  color: var(--ml-accent);
}

.ml-lead {
  font-size: 19px;
  color: var(--ml-muted);
  max-width: 720px;
}

/* Hero */
.ml-hero {
  background: var(--ml-paper);
  border-bottom: 1px solid var(--ml-line);
  padding: 48px 0 40px;
}

.ml-hero h1 {
  max-width: 760px;
}

.ml-hero__lead p {
  font-size: 19px;
  color: var(--ml-muted);
  max-width: 720px;
}

.ml-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.ml-main .ml-button {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
  text-align: center;
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid var(--ml-accent);
  background: var(--ml-accent);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
}

.ml-main .ml-button:hover,
.ml-main .ml-button:focus {
  background: var(--ml-accent-dark);
  border-color: var(--ml-accent-dark);
  color: #fff;
  text-decoration: none;
}

.ml-main .ml-button--quiet {
  background: transparent;
  color: var(--ml-accent);
}

.ml-main .ml-button--quiet:hover,
.ml-main .ml-button--quiet:focus {
  background: var(--ml-wash);
  color: var(--ml-accent-dark);
}

/* Sections */
.ml-section {
  margin-top: 44px;
}

.ml-section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
  margin-bottom: 14px;
}

.ml-section__head h2,
.ml-section__head h3 {
  margin: 0;
}

.ml-section__head a {
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap;
}

.ml-page-head {
  padding: 36px 0 20px;
}

.ml-page-head--photo {
  display: flex;
  align-items: center;
  gap: 24px;
}

.ml-avatar {
  flex: none;
  width: 128px;
  height: 128px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--ml-paper);
  box-shadow: 0 2px 10px rgba(20, 40, 50, 0.15);
}

.ml-crumbs {
  padding-top: 24px;
  font-size: 14px;
  color: var(--ml-muted);
}

/* Grids and cards */
.ml-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 18px;
}

.ml-grid--posts {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.ml-grid--four {
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}

.ml-grid--featured {
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}

.ml-card,
.ml-post {
  display: flex;
  flex-direction: column;
  background: var(--ml-paper);
  border: 1px solid var(--ml-line);
  border-radius: var(--ml-radius);
  overflow: hidden;
  color: var(--ml-ink);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.ml-main a.ml-card,
.ml-main a.ml-post {
  color: var(--ml-ink);
}

.ml-card:hover,
.ml-card:focus,
.ml-post:hover,
.ml-post:focus {
  border-color: var(--ml-accent);
  box-shadow: 0 6px 18px rgba(20, 40, 50, 0.1);
  transform: translateY(-2px);
  text-decoration: none;
}

.ml-card:hover h3,
.ml-post:hover h3 {
  color: var(--ml-accent);
}

.ml-card__media,
.ml-post__media {
  aspect-ratio: 16 / 9;
  background: var(--ml-wash);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.ml-card__media img,
.ml-post__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ml-card__initials {
  font-weight: 800;
  font-size: 40px;
  color: var(--ml-cat, var(--ml-muted));
  letter-spacing: 0.02em;
}

/* Category colors: a strong tone for accents and a pale one for fills. */
.ml-cat--games { --ml-cat: #5b3f8c; --ml-cat-pale: #efeaf7; }
.ml-cat--site-owners { --ml-cat: #0f6f68; --ml-cat-pale: #e3f1ef; }
.ml-cat--writing { --ml-cat: #a4502a; --ml-cat-pale: #f8ece5; }
.ml-cat--developer { --ml-cat: #2d4f86; --ml-cat-pale: #e7edf7; }
.ml-cat--images { --ml-cat: #8a3d6b; --ml-cat-pale: #f6e8f0; }
.ml-cat--everyday { --ml-cat: #4c6b2f; --ml-cat-pale: #ebf2e3; }
.ml-cat--education { --ml-cat: #9a6a0c; --ml-cat-pale: #fbf1dc; }
.ml-cat--code { --ml-cat: #26323b; --ml-cat-pale: #e6eaed; }

.ml-card__media[class*="ml-cat--"] {
  background: var(--ml-cat-pale);
}

/* Category tiles on the home page */
.ml-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.ml-main a.ml-tile {
  display: block;
  padding: 16px 18px 14px;
  background: var(--ml-paper);
  border: 1px solid var(--ml-line);
  border-top: 4px solid var(--ml-cat);
  border-radius: var(--ml-radius);
  color: var(--ml-ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.ml-main a.ml-tile:hover,
.ml-main a.ml-tile:focus {
  box-shadow: 0 6px 18px rgba(20, 40, 50, 0.1);
  border-color: var(--ml-cat);
  text-decoration: none;
}

.ml-main .ml-tile h3 {
  color: var(--ml-cat);
}

.ml-tile h3 span {
  font-weight: 400;
  color: var(--ml-muted);
  font-size: 15px;
}

.ml-main .ml-tile p {
  font-size: 14.5px;
  color: var(--ml-muted);
  margin-bottom: 10px;
}

.ml-tile ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ml-tile li {
  font-size: 13px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--ml-cat-pale);
  color: var(--ml-ink);
}

.ml-tile li.ml-tile__more {
  background: transparent;
  color: var(--ml-muted);
}

.ml-card__body,
.ml-post__body {
  padding: 14px 16px 16px;
}

.ml-main .ml-card__body p,
.ml-main .ml-post__body p {
  font-size: 14.5px;
  color: var(--ml-muted);
  margin: 0;
}

.ml-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ml-muted);
  margin-bottom: 8px;
}

.ml-card__host {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ml-post time {
  display: block;
  font-size: 13px;
  color: var(--ml-muted);
  margin-bottom: 4px;
}

.ml-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: #e3f1ef;
  color: #0a524d;
}

.ml-badge--in-progress { background: #fff1d6; color: #7a4d00; }
.ml-badge--experimental { background: #ece6f7; color: #4b2f7a; }
.ml-badge--acquired { background: #e5edf8; color: #24477a; }
.ml-badge--classic { background: #eceeef; color: #4a545b; }

/* Category chips */
.ml-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.ml-main .ml-chips a {
  padding: 6px 12px;
  border: 1px solid var(--ml-line);
  border-radius: 999px;
  background: var(--ml-paper);
  color: var(--ml-ink);
  font-size: 14px;
  font-weight: 600;
}

.ml-chips a span {
  color: var(--ml-muted);
  font-weight: 400;
}

.ml-main .ml-chips a:hover,
.ml-main .ml-chips a:focus {
  border-color: var(--ml-accent);
  color: var(--ml-accent);
  text-decoration: none;
}

.ml-category {
  margin-top: 36px;
  scroll-margin-top: 16px;
}

.ml-category__intro {
  color: var(--ml-muted);
  max-width: 720px;
}

/* Project page */
.ml-project__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 440px);
  gap: 32px;
  align-items: center;
  padding: 20px 0 28px;
  border-bottom: 1px solid var(--ml-line);
  margin-bottom: 28px;
}

.ml-project__image {
  width: 100%;
  height: auto;
  border-radius: var(--ml-radius);
  border: 1px solid var(--ml-line);
}

/* Long-form text */
.ml-prose {
  max-width: 720px;
  font-size: 17px;
}

.ml-prose h2 {
  margin-top: 32px;
}

.ml-prose ul {
  padding-left: 22px;
  margin: 0 0 16px;
}

.ml-prose li {
  margin-bottom: 6px;
}

.ml-prose img {
  max-width: 100%;
  height: auto;
}

.ml-prose .gameplay-screenshot {
  max-width: min(100%, 360px);
  margin: 24px auto;
  border-radius: var(--ml-radius);
}

/* Newsletter box, restyled to match the shell */
.ml-main .mailchimp-signup {
  background: var(--ml-paper);
  border-color: var(--ml-line);
  border-radius: var(--ml-radius);
  margin-top: 44px;
}

.ml-main .mailchimp-signup button {
  background: var(--ml-accent);
  border-color: var(--ml-accent);
  border-radius: 8px;
}

.ml-main .mailchimp-signup button:hover,
.ml-main .mailchimp-signup button:focus {
  background: var(--ml-accent-dark);
}

/* iOS zooms the page when a field's text is under 16px, and the page then
   no longer fits the screen. */
.ml-main .mailchimp-signup__field input {
  font-size: 16px;
}

.ml-main .mailchimp-signup__field input:focus {
  border-color: var(--ml-accent);
  outline-color: var(--ml-accent);
}

.ml-prose code {
  font-size: 15px;
  overflow-wrap: anywhere;
}

.ml-prose pre code {
  overflow-wrap: normal;
}

.ml-prose pre {
  font-size: 14px;
  line-height: 1.5;
  padding: 14px 16px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 0 0 18px;
}

.ml-prose blockquote {
  margin: 0 0 16px;
  padding: 4px 16px;
  border-left: 4px solid var(--ml-line);
  color: var(--ml-muted);
}

.ml-prose table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 0 0 18px;
}

.ml-prose th,
.ml-prose td {
  border: 1px solid var(--ml-line);
  padding: 6px 10px;
}

.ml-prose .banner-image {
  max-width: 100%;
  border-radius: var(--ml-radius);
  margin: 8px 0 18px;
}

.ml-byline {
  font-size: 15px;
  color: var(--ml-muted);
}

/* Blog index and tag pages */
.ml-postlist {
  display: grid;
  gap: 16px;
}

.ml-postrow {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  padding: 16px;
  background: var(--ml-paper);
  border: 1px solid var(--ml-line);
  border-radius: var(--ml-radius);
}

.ml-postrow > div:only-child {
  grid-column: 1 / -1;
}

.ml-postrow__media {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 6px;
  background: var(--ml-wash);
}

.ml-postrow__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ml-postrow time {
  display: block;
  font-size: 13px;
  color: var(--ml-muted);
}

.ml-main .ml-postrow h2 {
  font-size: 21px;
  margin: 2px 0 6px;
}

.ml-main .ml-postrow h2 a {
  color: var(--ml-ink);
}

.ml-main .ml-postrow p {
  font-size: 15px;
  color: var(--ml-muted);
  margin: 0;
}

.ml-pager {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
}

/* Two columns at the bottom of the home page */
.ml-split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
  border-top: 1px solid var(--ml-line);
  padding-top: 32px;
}

/* Footer */
.ml-footer {
  background: #1f2a33;
  color: #c8d0d5;
  padding: 36px 0 20px;
  font-size: 14px;
}

.ml-footer__grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 24px;
}

.ml-footer .ml-logo {
  color: #fff;
}

.ml-footer h2 {
  font-family: var(--ml-sans);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #fff;
  margin: 4px 0 10px;
}

.ml-footer nav a {
  display: block;
  border: 0;
  color: #c8d0d5;
  padding: 3px 0;
}

.ml-footer a:hover,
.ml-footer a:focus {
  color: #fff;
}

.ml-footer__copy {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid #34424c;
  color: #8d999f;
}

@media (max-width: 760px) {
  .ml-main h1 {
    font-size: 30px;
  }

  .ml-hero {
    padding: 32px 0 28px;
  }

  .ml-project__head {
    grid-template-columns: 1fr;
  }

  .ml-postrow {
    grid-template-columns: 1fr;
  }

  .ml-page-head--photo {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .ml-avatar {
    width: 96px;
    height: 96px;
  }

  .ml-footer__grid {
    grid-template-columns: 1fr 1fr;
  }
}
