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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  line-height: 1.6;
  color: #222;
  background: #fff;
  max-width: 48rem;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  padding-top: 3.5rem;
}

/* Sticky nav */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-bottom: 1px solid #eee;
  padding: 0.5rem 1rem;
  text-align: center;
  z-index: 100;
  font-size: 0.85rem;
}

.site-nav a {
  color: #555;
  text-decoration: none;
  margin: 0 0.6rem;
}

.site-nav a:hover {
  color: #0366d6;
}

/* Offset anchors for fixed nav */
h2[id] {
  scroll-margin-top: 3rem;
}

a {
  color: #0366d6;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h2 {
  font-size: 1.25rem;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid #eee;
  padding-bottom: 0.25rem;
}

h2:first-child {
  margin-top: 0;
}

p {
  margin-bottom: 0.75rem;
}

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.9em;
  background: #f6f8fa;
  padding: 0.15em 0.3em;
  border-radius: 3px;
}

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

/* Bio section */
.bio-photo {
  float: right;
  width: 200px;
  margin: 0 0 1rem 1.5rem;
  border-radius: 4px;
  filter: grayscale(100%);
}

/* Now section */
.now-item {
  margin-bottom: 1rem;
}

.now-image {
  max-width: 100%;
  height: auto;
  margin-top: 0.5rem;
  border-radius: 2px;
}

.now-meta {
  font-size: 0.8rem;
  color: #666;
  text-transform: lowercase;
}

/* Now carousel (JS-enhanced) */
.now-carousel {
  border: 1px solid #e5e5e5;
  background: #fafafa;
  border-radius: 4px;
  padding: 1rem 1.25rem;
}

.now-carousel .now-item:last-child {
  margin-bottom: 0;
}

.now-carousel .now-controls {
  display: none;
}

.now-carousel.js-enabled .now-item {
  display: none;
  margin-bottom: 0.75rem;
}

.now-carousel.js-enabled .now-item.is-active {
  display: block;
}

.now-carousel.js-enabled .now-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.now-nav {
  background: none;
  border: 1px solid #ddd;
  color: #555;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0.25rem 0.6rem;
  cursor: pointer;
  border-radius: 2px;
  font-family: inherit;
}

.now-nav:hover {
  color: #222;
  border-color: #888;
}

.now-dots {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.now-dot {
  width: 0.5rem;
  height: 0.5rem;
  padding: 0;
  border: 1px solid #bbb;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
}

.now-dot.is-active {
  background: #555;
  border-color: #555;
}

.now-dot:hover {
  border-color: #555;
}

/* Contact icons */
.contact-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: center;
}

.contact-icons a {
  display: inline-block;
  width: 1.5rem;
  height: 1.5rem;
}

.contact-icons svg {
  width: 100%;
  height: 100%;
  fill: #888;
  transition: fill 0.15s;
}

.contact-icons a:hover svg {
  fill: #222;
}

/* Tablet */
@media (max-width: 768px) {
  .site-nav {
    font-size: 0.9rem;
    padding: 0.6rem 0.5rem;
  }

  .site-nav a {
    margin: 0 0.4rem;
  }
}

/* Mobile */
@media (max-width: 480px) {
  body {
    padding: 6.5rem 1rem 1.5rem;
  }

  h2[id] {
    scroll-margin-top: 6.5rem;
  }

  .site-nav {
    font-size: 0.95rem;
    padding: 0.75rem 0.5rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25rem 0;
  }

  .site-nav a {
    padding: 0.35rem 0.5rem;
    margin: 0;
  }

  .bio-photo {
    float: none;
    display: block;
    width: 180px;
    margin: 0 auto 1.25rem;
  }
}
