* {
  box-sizing: border-box;
}

@view-transition {
  navigation: auto;
}

:root {
  --page-bg: #fafafa;
  --text: #111;
  --muted: #444;
  --soft: #777;
  --page-pad: clamp(1.25rem, 5vw, 2rem);
  --content-width: 42rem;
}

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

body {
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  font-family: "Lato", Arial, sans-serif;
  background: var(--page-bg);
  color: var(--text);
}

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

a:hover,
a:focus-visible {
  text-decoration: underline;
}

.site-header {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  padding: 1.25rem var(--page-pad);
}

.site-title {
  display: inline-block;
  flex: 0 0 auto;
  font-weight: 700;
  line-height: 1;
  view-transition-name: alex-zhu-title;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 1.25rem;
}

.site-nav a {
  color: var(--muted);
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--text);
}

.home-page {
  text-align: center;
}

.home-content {
  width: min(100%, var(--content-width));
  margin: auto;
  padding: 2rem var(--page-pad);
}

.home-page h1 {
  display: inline-block;
  margin: 0 0 0.25rem;
  font-size: clamp(2.5rem, 13vw, 4rem);
  line-height: 1;
  view-transition-name: alex-zhu-title;
}

.tagline {
  min-height: 1.3em;
  margin: 0 0 3rem;
  font-size: clamp(1.25rem, 6vw, 1.75rem);
  color: var(--muted);
}

.subpage,
.about-page {
  text-align: center;
}

.page-content {
  width: min(100%, var(--content-width));
  margin: 2rem auto;
  padding: 0 var(--page-pad);
  text-align: left;
}

.page-content p {
  margin: 0.65rem 0;
  color: var(--muted);
  line-height: 1.6;
}

.page-content h1 {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 8vw, 3rem);
  line-height: 1.1;
}

.page-content h2 {
  margin: 2rem 0 0.5rem;
  font-size: 1rem;
}

.entry-list {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
}

.entry-list li {
  padding: 1rem 0;
  border-top: 1px solid #e6e6e6;
}

.entry-list a {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-weight: 700;
}

.entry-list time,
.entry-kicker {
  color: var(--soft);
  font-size: 0.875rem;
}

.entry-summary {
  font-size: 1.125rem;
}

.demo-placeholder {
  margin: 1.5rem 0;
}

.demo-placeholder canvas {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid #e6e6e6;
  background: #fff;
}

.site-footer {
  width: 100%;
  margin-top: auto;
  padding: 1.25rem var(--page-pad) 1.5rem;
  color: var(--muted);
  font-size: 0.875rem;
  text-align: center;
}

.site-footer a,
.site-footer span {
  display: inline-block;
  margin: 0 0.25rem;
}

.copyright {
  margin: 0.4rem 0 0;
  font-size: 0.75rem;
  color: var(--soft);
}

#typed-word {
  color: var(--text);
  font-weight: 700;
}

.cursor {
  display: inline-block;
  font-size: clamp(1.25rem, 6vw, 1.75rem);
  margin-left: -0.2em;
  animation: blink 1s infinite;
}

::view-transition-group(alex-zhu-title) {
  animation-duration: 520ms;
  animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}

::view-transition-old(alex-zhu-title),
::view-transition-new(alex-zhu-title) {
  height: 100%;
  object-fit: contain;
}

@media (max-width: 35rem) {
  .site-header {
    flex-direction: column;
    gap: 0.75rem;
  }

  .home-content {
    padding-top: 1rem;
  }

  .entry-list a {
    flex-direction: column;
    gap: 0.25rem;
  }
}

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

  ::view-transition-group(alex-zhu-title) {
    animation-duration: 1ms;
  }
}

@keyframes blink {
  0%, 50% {
    opacity: 1;
  }

  51%, 100% {
    opacity: 0;
  }
}
