body {
  font-family: "Space Grotesk", sans-serif;
  margin: 10px auto;
  max-width: 650px;
  line-height: 1.6;
  font-size: 18px;
  /* color: #444; */
  padding: 0 10px;
  background-color: #faf9f5;
  /* margin-bottom: 50px; */
}

h1,
h2 {
  margin-top: 0;
  margin-bottom: 0; /* Adjust this value to reduce the space below h1 */
}

h1.post-title {
    color: #c96342;
}

h3 {
  margin-bottom: 0;
}

p {
  margin-top: 0;
}

em {
  color: #807c73;
}

.secret {
  font-size: 0;
}

#secret {
  color: #ffff;
}

.subtitle {
  margin-bottom: 1rem;
  width: 100%;
  margin: auto;
  max-width: 100%;
}

a {
  color: #c96342;
  margin-right: 0.3rem;
  /* border-bottom: 1px solid; */
  text-decoration: none;
}

a#misc {
  /* font-size: px; */
  text-decoration: none;
  border-bottom: 1px solid;
}

.header nav ul.flat li {
  display: inline-block;
  /* list-style: none; */
  margin-left: 0;
  margin-right: 10px;
  margin-top: 10px;
}

a:focus {
  color: #c96342ed;
}

header {
  /* display: grid; */
  grid-template-columns: 1fr auto;
  grid-auto-rows: auto;
  row-gap: 0;
  align-items: center;
}

header .nav.social {
  margin-top: 1rem;
  margin-bottom: 1rem;
}

/* header h1 {
  grid-column: 1 / -1;
}

header h2 {
  grid-column: 1;
}

header .nav.social {
  grid-column: 2;
} */

header h3,
header p {
  grid-column: 1 / -1;
  justify-self: start;
}

header .nav.social ul.flat {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 10px;
}

header .nav.social ul.flat a {
  display: inline-block;
}

.post-header {
  border-bottom: none;
  padding-bottom: 1rem;
}

.post-header h1 {
  margin: 0 0 0.5rem 0;
  font-size: 2rem;
}

.post-header time {
  color: #666;
  font-size: 0.9rem;
}

.post-content {
  margin-bottom: 3rem;
}

.post-content h2 {
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.post-nav {
  border-top: none;
  padding-top: 1rem;
}

.post-nav a {
  color: #666;
  text-decoration: none;
}

.post-nav a:hover {
  color: #333;
}

.footer {
  font-size: 5vw;
  color: #ffffff;
  position: fixed;
  margin: 1vw;
  bottom: 0;
  left: 0;
  right: 0;
  /* height: 60px; */
  background: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1vw;
  z-index: 1000;
  /* font-size: 30px; */
}

.footer-left {
  /* color: #666; */
  /* font-size: 14px; */
}

.footer-center {
  /* color: #666; */
  /* font-size: 14px; */
}

.footer-right {
  /* color: #666; */
  /* font-size: 14px; */
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
}

.footer-right:hover {
  /* color: #333; */
}

.footer-post {
  font-size: 5vw;
  color: #000000;
  position: fixed;
  margin: 1vw;
  bottom: 0;
  left: 0;
  right: 0;
  /* height: 60px; */
  background: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1vw;
  z-index: 1000;
  /* font-size: 30px; */
}

#threejs-container {
  position: fixed; /* Stay fixed in viewport */
  top: 0;
  left: 0;
  width: 100vw; /* Full viewport width */
  height: 100vh; /* Fallback for browsers without dvh */
  height: 100dvh; /* Use dynamic viewport height to avoid iOS Safari 100vh bugs */
  margin: 0;
  padding: 0;
  overflow: hidden;
  z-index: -1; /* Push it behind other elements */
}

/* Make the canvas fill its container */
#threejs-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Remove global hiding during loading to prevent layout from being stuck */

.loading-overlay {
  position: fixed;
  inset: 0;
  display: none; /* hidden by default; shown during load via JS */
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.25);
  color: #ffffff;
  font-weight: 600;
  font-size: clamp(16px, 4vw, 36px);
  letter-spacing: 0.05em;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 999;
}

@media (max-width: 768px) {
  body {
    margin: 10px 10px 10px 10px;
  }
}
