:root {
  --bg: #faf9f6;
  --text: #111;
  --muted: #666;
  --accent: #000;
  --max-width: 960px;
  --font-body: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

body {
  margin: 0;
  font-family: var(--font-body);
  color: #f4f4f4;
  background: var(--bg) url("/images/background-hans.jpg") center center / cover fixed no-repeat;
  line-height: 1.7;
  padding: 24px;
  position: relative;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
}

body.home {
  padding: 0;
  background: var(--bg) url("/images/background-hans.jpg") center center / cover fixed no-repeat !important;
  min-height: 100vh;
}

body.bio {
  color: #fff;
  background: #33271c url("/images/background-hans.jpg") center center / cover fixed no-repeat;
  background-blend-mode: screen;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 0;
  pointer-events: none;
}

main,
.site-header,
.site-footer {
  position: relative;
  z-index: 1;
}

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

a:hover {
  text-decoration: underline;
}

.page,
.post {
  max-width: var(--max-width);
  margin: 32px auto 64px;
  padding: 32px 24px;
  background: none;
  box-shadow: none;
  border: none;
  border-radius: 0;
}

body.home .page {
  max-width: none;
  margin: 0;
  padding: 0;
  background: none;
  box-shadow: none;
  border: none;
  border-radius: 0;
}

body.bio .page {
  background: none;
  box-shadow: none;
  border: none;
}

.bio-page {
  max-width: 780px;
  margin: 72px auto 96px;
  padding: 24px;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
  position: relative;
}

.bio-page::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 10px;
  filter: blur(12px);
  transform: scale(1.03);
  z-index: 0;
  pointer-events: none;
}

.bio-page > * {
  position: relative;
  z-index: 1;
}

.bio-page p {
  margin: 0 0 18px;
}

.bio-page img {
  margin: 20px auto;
  max-width: 100%;
  height: auto;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.25);
}

.projects-page {
  max-width: 920px;
  margin: 72px auto 96px;
  padding: 0 12px 32px;
  color: #111;
  text-shadow: none;
}

.project {
  display: grid;
  grid-template-columns: minmax(240px, 320px) 1fr;
  gap: 20px;
  align-items: center;
  background: #fff;
  border: 1px solid #e6e6e0;
  border-radius: 12px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.12);
  padding: 20px;
  margin: 28px 0;
}

.project-media img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
  margin-top: 0;
}

.project-body h2 {
  margin: 0 0 8px;
  color: rgba(111, 137, 66, 0.79);
}

.project-body .meta {
  margin: 0 0 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #444;
}

.project-body p {
  color: #222;
}

.project-body blockquote {
  margin: 10px 0 14px;
  padding-left: 14px;
  border-left: 3px solid #ccc;
  color: #333;
}

.project {
  align-items: start;
}

@media (max-width: 720px) {
  .project {
    grid-template-columns: 1fr;
  }
}

/* Header */
.site-header {
  max-width: var(--max-width);
  margin: 0 auto 24px;
  padding: 24px 24px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid #e0e0dc;
  position: relative;
  z-index: 2;
}

body.home .site-header {
  border-bottom: none;
  background: transparent;
}

.logo img {
  display: block;
  max-width: 120px;
  height: auto;
}

.nav {
  display: flex;
  gap: 18px;
  justify-content: center;
}

.nav a {
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 0.95rem;
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
}

.nav a.active {
  border-color: var(--accent);
}

.social {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  font-size: 0.95rem;
}

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

/* Footer */
.site-footer {
  max-width: var(--max-width);
  margin: 48px auto 0;
  padding: 16px;
  border-top: 1px solid #e0e0dc;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: center;
}

body.home .site-footer {
  background: transparent;
  border-top: none;
  margin-top: 24px;
}

body.home .site-footer .footer-links {
  display: none;
}

.footer-links {
  display: none;
}

.site-footer .social {
  justify-content: center;
}

.footer-meta {
  color: #f4f4f4;
  font-size: 0.95rem;
}

h1, h2, h3 {
  letter-spacing: -0.01em;
  line-height: 1.25;
  margin: 0 0 12px;
}

.lede {
  color: var(--muted);
  margin-top: 8px;
}

p {
  margin: 0 0 18px;
}

ul, ol {
  margin: 0 0 20px 20px;
  padding: 0;
}

.post-meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.post-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.post-list li {
  margin-bottom: 18px;
}

.pagination {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.pagination a[aria-current="page"] {
  font-weight: 700;
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 16px auto;
  border-radius: 4px;
}

.embed-video {
  position: relative;
  padding-top: 56.25%;
  margin: 20px 0;
  border-radius: 8px;
  overflow: hidden;
}

.embed-video iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 8px;
}

.carousel {
  overflow: hidden;
  padding: 8px 4px 16px;
}

.carousel-track {
  display: flex;
  gap: 12px;
  align-items: stretch;
  animation: carousel-pan 12s ease-in-out infinite;
  --carousel-shift: 75%;
}

.carousel-slide {
  flex: 0 0 auto;
}

.carousel-slide img {
  height: 240px;
  width: auto;
  display: block;
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
  object-fit: cover;
}

@media (max-width: 720px) {
  .carousel-slide img {
    height: 200px;
  }
}

@keyframes carousel-pan {
  0% { transform: translateX(0); }
  15% { transform: translateX(0); } /* pause at start */
  45% { transform: translateX(calc(-1 * var(--carousel-shift, 75%))); }
  60% { transform: translateX(calc(-1 * var(--carousel-shift, 75%))); } /* pause at end */
  100% { transform: translateX(0); }
}

blockquote {
  margin: 16px 0;
  padding: 12px 16px;
  border-left: 4px solid var(--accent);
  background: #f5f4f1;
}

code {
  background: #f0efeb;
  padding: 2px 4px;
  border-radius: 3px;
}

@media (max-width: 720px) {
  body {
    padding: 12px;
  }

  .site-header {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .nav {
    flex-wrap: wrap;
  }

  .social {
    justify-content: center;
  }

  .page,
  .post {
    padding: 20px 16px;
  }
}

.landing-hero {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 24px 80px;
}

.hero-logo-wrap {
  position: relative;
  display: inline-block;
  width: min(600px, 92vw);
  aspect-ratio: 3 / 1;
}

.landing-hero .hero-logo {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter:
    drop-shadow(0 12px 18px rgba(0, 0, 0, 0.65))
    drop-shadow(0 4px 12px rgba(0, 0, 0, 0.5));
  -webkit-filter:
    drop-shadow(0 12px 18px rgba(0, 0, 0, 0.65))
    drop-shadow(0 4px 12px rgba(0, 0, 0, 0.5));
}

.hero-logo-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 12px;
  transform: translateY(10px) scale(0.95);
  filter: blur(18px);
  z-index: 0;
  pointer-events: none;
}
