:root {
  --bg: #fafafa;
  --fg: #171717;
  --fg-2: #4d4d4d;
  --line: #e5e5e5;
  --hover: rgb(0 0 0 / 0.045);
  --font: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gap: 24px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-6: 24px;
  --s-8: 32px;
  --s-12: 64px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0a0a;
    --fg: #ededed;
    --fg-2: #a1a1a1;
    --line: #262626;
    --hover: rgb(255 255 255 / 0.06);
  }
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--fg-2);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

@media (hover: hover) and (pointer: fine) {
  a:hover {
    text-decoration-color: var(--fg);
  }
}

:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 3px;
  border-radius: 2px;
}

.shell {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: var(--gap);
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
}

.prose {
  grid-column: 1 / span 7;
  max-width: 66ch;
}

/* Header and footer */

.header,
.footer {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--s-4);
}

.header {
  padding-top: var(--s-6);
}

.name {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.name a {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  text-decoration: none;
}

.name .logo {
  display: block;
  width: auto;
  height: 20px;
}

.header-link {
  color: var(--fg-2);
  font-size: 14px;
  text-decoration: none;
}

.header-link:hover {
  color: var(--fg);
}

.footer {
  padding-top: var(--s-12);
  padding-bottom: var(--s-8);
  color: var(--fg-2);
  font-size: 14px;
}

.footer p {
  margin: 0;
}

.footer a {
  color: inherit;
  text-decoration: none;
}

.footer a:hover {
  color: var(--fg);
}

/* Text */

.intro {
  margin-top: var(--s-12);
}

.lede {
  margin: 0 0 var(--s-6);
  font-size: clamp(22px, 2.8vw, 28px);
  line-height: 1.35;
  letter-spacing: -0.02em;
  text-wrap: pretty;
}

.body {
  margin: 0;
  color: var(--fg-2);
  text-wrap: pretty;
}

.section {
  margin-top: var(--s-12);
}

.h2 {
  margin: 0 0 var(--s-6);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

/* Products table */

.projects {
  width: calc(100% + var(--s-6));
  margin-inline: calc(var(--s-3) * -1);
  border-collapse: collapse;
}

.projects th,
.projects td {
  padding: var(--s-3);
  text-align: left;
  vertical-align: baseline;
  font-weight: 400;
}

.projects thead th {
  padding-block: 0 var(--s-2);
  color: var(--fg-2);
  font-size: 14px;
}

.projects .num {
  width: 1%;
  text-align: right;
  white-space: nowrap;
}

.projects td.n {
  font-weight: 500;
  white-space: nowrap;
}

.projects td.d {
  color: var(--fg-2);
  text-wrap: balance;
}

.projects td.num {
  color: var(--fg-2);
  font-size: 15px;
}

.projects tbody tr {
  position: relative;
}

/* The product name's link covers the whole row */
.projects .link::after {
  content: "";
  position: absolute;
  inset: 0;
}

@media (hover: hover) and (pointer: fine) {
  .projects tbody tr:hover {
    background: var(--hover);
  }

  .projects tbody tr:hover .link {
    text-decoration-color: var(--fg);
  }
}

.projects .inactive td.n,
.projects .inactive td.d {
  opacity: 0.6;
}

/* Label and value rows */

.rows {
  margin: 0;
}

.row {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
  padding-block: var(--s-3);
}

.row + .row {
  border-top: 1px solid var(--line);
}

.row dt {
  grid-column: 1 / span 4;
  display: flex;
  align-items: baseline;
  gap: var(--s-2);
  font-weight: 500;
}

.row dt .mark {
  flex: none;
  width: auto;
  height: 15px;
  transform: translateY(2px);
}

.row dd {
  grid-column: 5 / span 7;
  margin: 0;
  color: var(--fg-2);
}

/* Brand page */

.title {
  margin: 0 0 var(--s-6);
  font-size: 32px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-4);
}

.panel {
  display: grid;
  place-items: center;
  min-height: 220px;
  padding: var(--s-8);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.panel.is-dark {
  border-color: #262626;
  background: #0a0a0a;
}

.panel img {
  width: min(100%, 300px);
  height: auto;
}

.files {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-4);
  margin: var(--s-4) 0 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
}

.files a {
  color: var(--fg-2);
}

.files a:hover {
  color: var(--fg);
}

/* Small screens */

@media (max-width: 960px) {
  .prose {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  :root {
    --gap: 16px;
  }

  .projects thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .projects,
  .projects tbody {
    display: block;
  }

  .projects tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    row-gap: 2px;
    padding: var(--s-4) var(--s-3);
  }

  .projects th,
  .projects td {
    padding: 0;
  }

  .projects td.d {
    grid-column: 1 / -1;
    grid-row: 2;
    line-height: 1.45;
  }

  .projects .num {
    grid-column: 2;
    grid-row: 1;
    width: auto;
  }

  .row {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 2px;
  }

  .row dt,
  .row dd {
    grid-column: 1;
  }

  .panels {
    grid-template-columns: minmax(0, 1fr);
  }
}
