:root {
  --background: #faf9f5;
  --text: #282622;
  --muted: #68645d;
  --subtle: #746f67;
  --badge: #efede6;
  --code: #f1eee7;
  --link: #0757b8;
  --rule: #ddd8ce;
  --font: Georgia, "Times New Roman", Times, serif;
  --font-sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}

html[data-theme="dark"] {
  --background: #0a0a0a;
  --text: #e9e7e1;
  --muted: #aaa69f;
  --subtle: #9a958d;
  --badge: #1d1d1c;
  --code: #181817;
  --link: #8cb8f2;
  --rule: #343330;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
}

::selection {
  background: #d9e8fb;
  color: #152b43;
}

html[data-theme="dark"] ::selection {
  background: #294f78;
  color: #f7f5ef;
}

a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 0.055em;
  text-underline-offset: 0.12em;
  transition: color 120ms ease;
}

a:visited {
  color: #4f46a5;
}

html[data-theme="dark"] a:visited {
  color: #b6a9ff;
}

a:hover {
  color: #003d86;
}

html[data-theme="dark"] a:hover {
  color: #b9d6fa;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--text);
  background: var(--background);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 650;
  transform: translateY(-180%);
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  display: block;
  min-height: 100vh;
  padding: 2.4rem 1.4rem 4rem;
}

.page-wrap {
  position: relative;
  display: flex;
  width: 100%;
  max-width: 38rem;
  min-height: calc(100vh - 6.4rem);
  margin: 0 auto;
  flex-direction: column;
}

.page-content {
  flex: 1 0 auto;
  animation: page-arrive 160ms ease-out both;
}

.site-nav {
  color: #23211e;
  font-family: var(--font-sans);
  font-size: 0.87rem;
  line-height: 1.45;
}

.site-nav-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem;
}

.site-nav a,
.site-nav a:visited {
  color: var(--link);
}

.site-title,
.site-title:visited {
  display: inline-block;
  margin-bottom: 0.15rem;
  color: var(--text) !important;
  font-weight: 600;
  text-decoration: none;
}

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

.site-nav li {
  margin: 0;
}

.site-nav a[aria-current="page"] {
  position: relative;
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

.site-nav a[aria-current="page"]::before {
  position: absolute;
  right: calc(100% + 0.28rem);
  color: var(--link);
  content: "↳";
  font-family: var(--font-mono);
  font-weight: 400;
}

.site-nav-elsewhere {
  display: flex;
  gap: 0.32rem;
  margin: 0.7rem 0 0;
  color: var(--subtle);
  font-size: 0.78rem;
}

.site-theme-toggle,
.source-photo-toggle {
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--rule);
  background: transparent;
  padding: 0;
  cursor: pointer;
  transition: border-color 140ms ease, transform 140ms ease;
}

.site-theme-toggle {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 6px;
}

.site-theme-toggle:hover,
.source-photo-toggle:hover {
  border-color: var(--link);
  transform: translateY(-1px);
}

.site-theme-toggle img,
.source-photo-toggle img {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: cover;
  object-position: 50% 31%;
  transform: scale(1.38);
}

.source-intro {
  margin: 0 0 2rem;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1.4rem;
}

.source-eyebrow {
  margin: 0 0 0.75rem;
  color: var(--subtle);
  font-family: var(--font-mono);
  font-size: 0.7rem;
}

.source-intro-line {
  display: flex;
  align-items: center;
  gap: 0.28em;
  margin: 0;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: clamp(2.25rem, 7vw, 2.8rem);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1.08;
  white-space: nowrap;
  animation: headline-rise 240ms ease-out 20ms both;
}

.source-photo-toggle {
  width: 1.06em;
  height: 1.06em;
  flex: 0 0 1.06em;
  border-radius: 0.22em;
}

.source-name {
  position: relative;
  display: inline-block;
}

.source-name::after {
  position: absolute;
  right: 0;
  bottom: -0.14em;
  left: 0;
  height: 2px;
  background: var(--link);
  content: "";
  transform: scaleX(0);
  transform-origin: left;
  animation: underline-draw 320ms ease-out 210ms forwards;
}

.source-description {
  max-width: 35rem;
  margin: 0.85rem 0 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.5;
}

h2,
h3 {
  color: var(--text);
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: -0.015em;
}

h2 {
  margin: 2.5rem 0 0.45rem;
  font-size: 1rem;
  line-height: 1.25;
  text-transform: lowercase;
}

.section-copy {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.repository-list {
  border-top: 1px solid var(--rule);
}

.repository {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  gap: 0.85rem;
  border-bottom: 1px solid var(--rule);
  padding: 1.3rem 0 1.45rem;
}

.repository-number {
  margin: 0.15rem 0 0;
  color: var(--subtle);
  font-family: var(--font-mono);
  font-size: 0.67rem;
  line-height: 1.45;
}

.repository-heading {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  justify-content: space-between;
}

.repository-heading h3 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.35;
}

.repository-meta {
  margin: 0;
  color: var(--subtle);
  font-family: var(--font-mono);
  font-size: 0.67rem;
  white-space: nowrap;
}

.repository-summary {
  margin: 0.58rem 0 0;
  font-size: 1rem;
  line-height: 1.5;
}

.repository-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin: 0.72rem 0 0;
  font-size: 0.82rem;
}

.clone-command {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin-top: 0.85rem;
  border: 1px solid var(--rule);
  border-radius: 5px;
  background: var(--code);
  padding: 0.56rem 0.62rem 0.56rem 0.72rem;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  line-height: 1.4;
}

.clone-command code {
  min-width: 0;
  overflow: hidden;
  color: inherit;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clone-command button {
  flex: 0 0 auto;
  border: 0;
  border-left: 1px solid var(--rule);
  background: transparent;
  padding: 0.08rem 0 0.08rem 0.65rem;
  color: var(--link);
  font: inherit;
  cursor: pointer;
}

.source-footer {
  margin-top: 2.8rem;
  border-top: 1px solid var(--rule);
  padding-top: 1rem;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.source-footer p {
  margin: 0 0 0.45rem;
}

.source-footer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.32rem;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.67rem;
}

.status-mark {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--link);
}

.motion-list > * {
  animation: list-arrive 220ms ease-out both;
}

.motion-list > :nth-child(2) {
  animation-delay: 35ms;
}

.motion-list > :nth-child(3) {
  animation-delay: 70ms;
}

@keyframes page-arrive {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes headline-rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes underline-draw {
  to { transform: scaleX(1); }
}

@keyframes list-arrive {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (min-width: 860px) {
  .site-nav {
    position: absolute;
    top: 0;
    left: calc(100% + 3.25rem);
    width: 9rem;
  }
}

@media (max-width: 859px) {
  .app-shell {
    padding: 1.25rem 1rem 3rem;
  }

  .page-wrap {
    min-height: calc(100vh - 4.25rem);
  }

  .site-nav {
    margin-bottom: 2.4rem;
    border-bottom: 1px solid var(--rule);
    padding-bottom: 0.75rem;
  }

  .site-nav-heading {
    align-items: center;
  }

  .site-title {
    margin-bottom: 0;
  }

  .site-nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem 0.75rem;
  }

  .site-nav li a {
    display: inline-flex;
    min-height: 32px;
    align-items: center;
  }

  .site-nav a[aria-current="page"]::before {
    position: static;
    margin-right: 0.22rem;
  }

  .site-nav-elsewhere {
    display: none;
  }
}

@media (max-width: 520px) {
  .source-intro-line {
    gap: 0.22em;
    font-size: clamp(1.85rem, 9.3vw, 2.2rem);
  }

  .repository {
    grid-template-columns: 1.55rem minmax(0, 1fr);
    gap: 0.45rem;
  }

  .repository-heading {
    display: block;
  }

  .repository-meta {
    margin-top: 0.2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-delay: 0ms !important;
    transition-duration: 1ms !important;
  }
}
