/* latespeed.com: one stylesheet for every page. Navy and gold are the LateSpeed logo's colors. */
:root {
  --navy: #143d59;
  --gold: #f4b41a;
  --bg: #f6f7f9;
  --card: #ffffff;
  --ink: #18222d;
  --muted: #5a6673;
  --line: #e2e6eb;
  --link: #0f5a8a;
  --shadow: 0 1px 2px rgb(16 32 48 / 6%), 0 4px 16px rgb(16 32 48 / 6%);
  --shadow-hover: 0 2px 4px rgb(16 32 48 / 8%), 0 10px 28px rgb(16 32 48 / 12%);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1620;
    --card: #16212c;
    --ink: #e6ebf0;
    --muted: #9aa7b4;
    --line: #253240;
    --link: #8cc8f2;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%);
    --shadow-hover: 0 8px 24px rgb(0 0 0 / 40%);
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

a {
  color: var(--link);
}

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

/* ---------------------------------------------------------------- header */

.site-header {
  background: var(--navy);
  color: #fff;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  min-height: 56px;
  flex-wrap: wrap;
}

/* the logo and "LateSpeed" in one compact bar (an h1 on the home page, a div elsewhere) */
.brand {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.01em;
}

.brand a {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
  color: #fff;
  text-decoration: none;
}

.brand img {
  display: block;
  width: 113px;
  height: 40px;
}

.brand-name span {
  color: var(--gold);
}

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

.site-nav a {
  color: #fff;
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  background: rgb(255 255 255 / 12%);
}

.site-nav a[aria-current="page"] {
  color: var(--gold);
}

/* ---------------------------------------------------------------- sections */

main section {
  padding: 32px 0 8px;
}

main section.about {
  padding-top: 48px;
}

h2 {
  margin: 0 0 20px;
  font-size: 26px;
  line-height: 1.2;
}

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

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.card:hover,
.card:focus-within {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

/* name and description first, then the screenshot; the body grows so screenshots line up across a row */
.card-body {
  flex: 1;
  padding: 16px 18px 18px;
}

.card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top left;
  border-top: 1px solid var(--line);
  background: var(--line);
}

.card h3 {
  margin: 0;
  font-size: 19px;
  line-height: 1.3;
}

.card h3 a {
  color: var(--ink);
  text-decoration: none;
}

/* the whole card is the link's click target */
.card h3 a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.card h3 a:focus-visible {
  outline: none;
}

.card:focus-within {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

.domain {
  margin: 2px 0 10px;
  color: var(--muted);
  font-size: 14px;
}

.card p:last-child {
  margin: 0;
}

.about p {
  max-width: 40em;
  margin: 0 0 12px;
}

/* ---------------------------------------------------------------- text pages */

.page {
  max-width: 44em;
  padding: 40px 0 16px;
}

.page h1 {
  margin: 0 0 4px;
  font-size: 32px;
  line-height: 1.2;
}

.page .effective {
  margin: 0 0 24px;
  color: var(--muted);
}

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

.site-footer {
  margin-top: 56px;
  border-top: 1px solid var(--line);
  padding: 24px 0 40px;
  color: var(--muted);
  font-size: 15px;
}

.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.site-footer a {
  color: var(--muted);
}

@media (max-width: 520px) {
  body {
    font-size: 16px;
  }

  .wrap {
    padding: 0 16px;
  }

  main section {
    padding-top: 24px;
  }

  /* the logo already reads LATESPEED, so on phones the name is for screen readers only and the bar stays one line */
  .brand-name {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .brand img {
    width: 102px;
    height: 36px;
  }

  .site-nav a {
    padding: 6px 9px;
  }
}

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

  .card:hover,
  .card:focus-within {
    transform: none;
  }
}
