* {
  box-sizing: border-box;
}

:root {
  color-scheme: light;
  --text: #171717;
  --muted: #626262;
  --border: #e7e7e7;
  --surface: #fff;
  --surface-hover: #fafafa;
  --focus: #555;
}

body {
  max-width: 840px;
  margin: 0 auto;
  padding: 48px 24px;
  color: var(--text);
  background: var(--surface);
  font-family: Inter, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, p, ul {
  margin-top: 0;
}

h1 {
  margin-bottom: 4px;
  font-size: clamp(2rem, 5vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.045em;
  font-weight: 700;
}

h2 {
  margin-bottom: 8px;
  font-size: 1.05rem;
  line-height: 1.4;
  letter-spacing: -0.015em;
  font-weight: 600;
}

.site-header {
  margin-bottom: 28px;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.5;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  text-decoration: none;
}

.social-links a:hover,
.links a:hover {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.intro {
  margin-bottom: 22px;
}

.intro p {
  max-width: 62ch;
  margin-bottom: 0;
}

.services {
  margin-bottom: 20px;
}

.services-description {
  margin-bottom: 8px;
}

.services ol {
  margin-top: 0;
  margin-bottom: 0;
  padding-left: 40px;
}

.services ul {
  margin-bottom: 0;
  padding-left: 40px;
}

.link-cards {
  display: grid;
  gap: 8px;
}

.card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  transition: background-color 140ms ease, border-color 140ms ease;
}

.card:hover {
  border-color: #d8d8d8;
}

.card summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 14px;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}

.card summary::-webkit-details-marker {
  display: none;
}

.card summary::after {
  content: "+";
  color: var(--muted);
  font-size: 1.15rem;
  font-weight: 400;
  line-height: 1;
}

.card[open] summary::after {
  content: "−";
}

.card summary:hover {
  background: var(--surface-hover);
}

.card summary:focus-visible,
.social-links a:focus-visible,
.links a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 2px;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  padding: 0 14px 12px;
}

.links a {
  color: var(--text);
  text-decoration: none;
  text-underline-offset: 3px;
}

/* Books page */
.back-link {
  display: inline-block;
  margin-bottom: 2px;
  color: var(--accent, #087eaa);
  font-size: 14px;
  text-decoration: none;
}

.back-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.page-header {
  margin-bottom: 30px;
}

.subtitle {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.year-section h2 {
  margin-bottom: 14px;
  font-size: 1.2rem;
}

/* Books page */
.back-link {
  display: inline-block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
}

.back-link:hover {
  color: var(--text);
  text-decoration: underline;
}

.page-header {
  margin-bottom: 28px;
}

.subtitle {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.year-section h2 {
  margin-bottom: 14px;
  font-size: 1.2rem;
}

.book-list {
  margin: 0;
  padding-left: 24px;
}

.book {
  padding-left: 4px;
  margin-bottom: 18px;
}

.book-title {
  margin-bottom: 10px;
  font-weight: 500;
}

.book-title a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.book-title a:hover {
  color: var(--muted);
}

.book-title span:not(.badge) {
  color: var(--muted);
  font-weight: 400;
}

.book-note {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.75;
}

.badge {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 7px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 520px) {
  .page-header {
    margin-bottom: 24px;
  }

  .book-list {
    padding-left: 20px;
  }

  .book {
    margin-bottom: 20px;
  }
}

/* Articles page */
.article-list {
  margin: 0;
  padding-left: 24px;
}

.article {
  padding-left: 4px;
  margin-bottom: 18px;
}

.article-title {
  margin-bottom: 10px;
  font-weight: 500;
}

.article-title a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.article-title a:hover {
  color: var(--muted);
}

.article-title span {
  color: var(--muted);
  font-weight: 400;
}

.article-note {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.75;
}

/* Vertical timeline */
.timeline {
  position: relative;
  margin-left: 8px;
  padding-left: 28px;
  border-left: 2px dotted var(--border);
}

.timeline-item {
  position: relative;
  padding-bottom: 28px;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -35px;
  top: 7px;
  width: 10px;
  height: 10px;
  border: 2px solid var(--text);
  border-radius: 50%;
  background: var(--surface);
}

.timeline-item h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.timeline-date {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 8px;
}

/* Bytings page */
.subscribe-note {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 46px 0 32px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-hover);
}

.subscribe-note p {
  margin: 0;
  color: var(--muted);
}

.subscribe-note a {
  color: var(--text);
  font-weight: 600;
}

.bytings-section h2 {
  margin-bottom: 14px;
  font-size: 1.2rem;
}

.bytings-list {
  margin: 0;
  padding-left: 24px;
}

.bytings-list li {
  padding-left: 4px;
  margin-bottom: 10px;
}

/* Tinkering videos */
.video-list {
  margin-top: 32px;
}

.video-item {
  padding-bottom: 32px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.video-item:last-child {
  border-bottom: 0;
}

.video-embed {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  overflow: hidden;
  background: var(--surface-hover);
}

.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-item h2 {
  margin: 12px 0 0;
  font-size: 1rem;
}

.video-item h2 a {
  color: var(--text);
  text-underline-offset: 4px;
}

@media (max-width: 520px) {
  .video-list {
    margin-top: 24px;
  }

  .video-item {
    margin-bottom: 24px;
    padding-bottom: 24px;
  }
}

.bytings-list li::marker {
  color: var(--muted);
}

.bytings-list a {
  color: var(--text);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.bytings-list a:hover {
  color: var(--muted);
}

/* Projects page */
/* Projects page */
.project {
  padding: 0 0 32px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.project:last-child {
  border-bottom: 0;
  margin-bottom: 0;
  padding-bottom: 0;
}

.project h3 {
  margin: 0 0 22px;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.6;
}

.project h3 a {
  color: var(--text);
  text-underline-offset: 4px;
}

.project-stack,
.project-features-label {
  margin-bottom: 22px;
}

.project-stack strong,
.project-features-label strong {
  font-weight: 600;
}

.project-features {
  padding-left: 24px;
  color: var(--muted);
}

.project-features li {
  padding-left: 8px;
  margin-bottom: 10px;
}

.project-status {
  display: inline-block;
  padding: 2px 7px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  vertical-align: 2px;
}

.site-footer {
  margin-top: 48px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.site-footer p {
  margin: 0;
}

@media (max-width: 520px) {
  .project {
    margin-bottom: 24px;
    padding-bottom: 24px;
  }
}

@media (max-width: 520px) {
  .subscribe-note {
    margin: 32px 0 26px;
    padding: 12px 14px;
  }

  .bytings-list {
    padding-left: 20px;
  }
}

@media (max-width: 520px) {
  .article-list {
    padding-left: 20px;
  }

  .article {
    margin-bottom: 20px;
  }
}

@media (max-width: 520px) {
  body {
    padding: 36px 16px;
  }

  .site-header {
    margin-bottom: 24px;
  }
}

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