:root {
  --bg: #ffffff;
  --fg: #171717;
  --muted: #737373;
  --faint: #e8e8e8;
  --link: #171717;
  --underline: #8a8a8a;
  --selection-bg: #171717;
  --selection-fg: #ffffff;
  color-scheme: light dark;
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100svh;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--fg);
  font-family: "STIX Two Text", Georgia, "Times New Roman", serif;
  font-size: 16px;
  line-height: 1.32;
  letter-spacing: 0;
}

main {
  display: flex;
  width: min(100% - 36px, 690px);
  min-height: 100svh;
  margin: 0 auto;
  padding: clamp(20px, 5vh, 46px) 0;
  flex-direction: column;
  justify-content: center;
}

.live-strip {
  margin: 0 0 18px;
  padding: 0 0 14px;
  border-bottom: 1px solid color-mix(in srgb, var(--fg) 14%, transparent);
  font-size: 13.5px;
  line-height: 1.28;
}

.live-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 9px;
}

.live-heading h2,
h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
}

.live-heading span,
.ai-line span,
.brief,
.stack,
.contact,
.project-list li > span:last-child {
  color: var(--muted);
}

.github-live {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}

.github-copy {
  min-width: 0;
}

.github-live p,
.live-line {
  margin: 0;
}

.github-window {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12.5px;
}

.news-live {
  margin-top: 9px;
  min-width: 0;
}

.ai-line {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.news-meta {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 7px;
  grid-template-rows: repeat(7, 7px);
  gap: 2px;
}

.activity-cell {
  width: 7px;
  height: 7px;
  border-radius: 1.5px;
  background: color-mix(in srgb, var(--fg) 7%, transparent);
}

.activity-cell[data-level="1"] {
  background: var(--activity-color, #9be9a8);
}

.activity-cell[data-level="2"] {
  background: var(--activity-color, #40c463);
}

.activity-cell[data-level="3"] {
  background: var(--activity-color, #30a14e);
}

.activity-cell[data-level="4"] {
  background: var(--activity-color, #216e39);
}

h1 {
  margin: 0 0 10px;
  font-size: 28px;
  font-weight: 600;
  line-height: 1.1;
}

h2 {
  margin: 14px 0 7px;
}

p {
  margin: 9px 0;
}

.intro {
  max-width: 650px;
  font-size: 18px;
  line-height: 1.28;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.project-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 20px;
  row-gap: 5px;
}

.project-list li {
  display: grid;
  grid-template-columns: minmax(96px, 0.82fr) minmax(0, 1fr);
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.project-list li > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-list li > a,
.project-list li > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stack,
.contact {
  font-size: 14px;
}

a,
.project-list li > span:first-child {
  color: var(--link);
  text-decoration-line: underline;
  text-decoration-color: var(--underline);
  text-decoration-thickness: 1px;
  text-underline-offset: 2.5px;
  transition: color 150ms ease, text-decoration-color 150ms ease;
}

a:hover,
a:focus-visible {
  color: var(--muted);
  text-decoration-color: var(--muted);
}

::selection {
  background: var(--selection-bg);
  color: var(--selection-fg);
}

@media (max-width: 700px) {
  body {
    font-size: 14.5px;
    line-height: 1.24;
  }

  main {
    width: min(100% - 28px, 585px);
    padding: 14px 0;
  }

  .live-strip {
    margin-bottom: 14px;
    padding-bottom: 12px;
    font-size: 12.5px;
  }

  .github-live {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .github-window {
    margin-top: 3px;
    font-size: 12px;
  }

  .news-meta {
    font-size: 12px;
  }

  .activity-grid {
    grid-auto-columns: 6px;
    grid-template-rows: repeat(7, 6px);
    gap: 2px;
  }

  .activity-cell {
    width: 6px;
    height: 6px;
    border-radius: 1px;
  }

  h1 {
    margin-bottom: 8px;
    font-size: 24px;
  }

  h2 {
    margin: 10px 0 6px;
  }

  .intro {
    font-size: 16px;
  }

  .brief {
    display: none;
  }

  .project-list {
    grid-template-columns: 1fr;
    row-gap: 4px;
  }

  .project-list li {
    grid-template-columns: 108px minmax(0, 1fr);
    gap: 8px;
  }

  .stack,
  .contact {
    margin: 7px 0 0;
    font-size: 13px;
  }
}

@media (max-height: 650px) {
  body {
    font-size: 14px;
  }

  main {
    padding: 12px 0;
  }

  .live-strip {
    margin-bottom: 12px;
    padding-bottom: 10px;
  }

  .intro {
    font-size: 16px;
  }

  .stack {
    display: none;
  }

  .news-meta {
    display: none;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0a0a;
    --fg: #ededed;
    --muted: #a3a3a3;
    --faint: #242424;
    --link: #ededed;
    --underline: #737373;
    --selection-bg: #ededed;
    --selection-fg: #0a0a0a;
  }

  .activity-cell[data-level="1"] {
    background: var(--activity-color, #0e4429);
  }

  .activity-cell[data-level="2"] {
    background: var(--activity-color, #006d32);
  }

  .activity-cell[data-level="3"] {
    background: var(--activity-color, #26a641);
  }

  .activity-cell[data-level="4"] {
    background: var(--activity-color, #39d353);
  }
}
