:root {
  --bg-color: #F7F4EB;
  --text-color: #2C241B;
  --accent-color: #8A6B4E;
  --light-accent: #E8E1D3;
  --font-ui: 'Inter', sans-serif;
  --font-poem: 'Lora', serif;
}

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

html { scroll-behavior: smooth; }

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: var(--font-ui);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-size: 1rem;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem 4rem;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  font-size: 1.5rem;
}

.logo {
  font-family: var(--font-poem);
  font-size: 1.75rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: lowercase;
  cursor: pointer;
  text-decoration: none;
  color: var(--text-color);
}

.nav-links { display: flex; gap: 2.5rem; list-style: none; }

.nav-links a {
  text-decoration: none;
  color: var(--text-color);
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  text-transform: lowercase;
  position: relative;
  transition: color 0.3s ease;
  cursor: pointer;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background-color: var(--accent-color);
  transition: width 0.3s ease;
}

.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }
.nav-links a.active { color: var(--accent-color); }

main {
  flex: 1;
  width: 100%;
  animation: fadeIn 0.6s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.poems-index {
  max-width: 800px;
  margin: 0 auto;
  padding: 4rem 2rem 8rem;
}

.poems-index h2 {
  font-family: var(--font-poem);
  font-size: 2rem;
  font-weight: 400;
  text-align: center;
  margin-bottom: 3rem;
}

.poem-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.poem-list li:last-child .poem-item { border-bottom: 1px solid var(--light-accent); }

.poem-item {
  border-top: 1px solid var(--light-accent);
  padding: 2rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: padding 0.3s ease;
  text-decoration: none;
  color: inherit;
}

.poem-item:hover { padding-left: 1rem; padding-right: 1rem; }
.poem-item-content { flex: 1; }

.poem-item-title {
  font-family: var(--font-poem);
  font-size: 1.35rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
  transition: color 0.3s ease;
}

.poem-item:hover .poem-item-title { color: var(--accent-color); }

.poem-item-excerpt {
  font-size: 0.9rem;
  color: var(--accent-color);
  font-style: italic;
  max-width: 400px;
}

.poem-item-arrow {
  font-size: 1.5rem;
  color: var(--accent-color);
  opacity: 0;
  transform: translateX(-10px);
  transition: all 0.3s ease;
}

.poem-item:hover .poem-item-arrow { opacity: 1; transform: translateX(0); }

.poem-page {
  max-width: 700px;
  margin: 0 auto;
  padding: 4rem 2rem 8rem;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--accent-color);
  text-decoration: none;
  margin-bottom: 3rem;
  cursor: pointer;
  transition: color 0.3s ease;
}

.back-btn:hover { color: var(--text-color); }

.poem-page-title {
  font-family: var(--font-poem);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 400;
  text-align: center;
  margin-bottom: 3rem;
  position: relative;
}

.poem-page-title::after {
  content: '';
  display: block;
  width: 40px;
  height: 1px;
  background-color: var(--accent-color);
  margin: 1.5rem auto 0;
}

.poem-body {
  font-family: var(--font-poem);
  font-size: 1.15rem;
  line-height: 2;
  color: var(--text-color);
}

.stanza { margin-bottom: 2.5rem; }

.stanza sup.fn {
  font-family: var(--font-ui);
  font-size: 0.65em;
  color: var(--accent-color);
  margin-left: 1px;
}

.stanza.notes {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  line-height: 1.9;
  color: var(--accent-color);
  font-style: normal;
  border-top: 1px solid var(--light-accent);
  padding-top: 1.5rem;
}

.about-page {
  max-width: 650px;
  margin: 0 auto;
  padding: 4rem 2rem 8rem;
}

.about-page h2 {
  font-family: var(--font-poem);
  font-size: 2rem;
  font-weight: 400;
  text-align: center;
  margin-bottom: 2.5rem;
}

.about-page p {
  font-size: 1.05rem;
  line-height: 1.9;
  margin-bottom: 1.5rem;
  color: #4A3F31;
}

.about-page p:first-of-type::first-letter {
  font-family: var(--font-poem);
  font-size: 1.05rem;
  line-height: 1.9;
  margin-bottom: 1.5rem;
  color: #4A3F31;
}

footer {
  padding: 2rem;
  text-align: center;
  font-size: 0.75rem;
  color: #A89F91;
  letter-spacing: 0.05em;
  background-color: var(--light-accent);
}

@font-face {
  font-family: 'gbx';
  src: url('gbx.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root { --font-ui: 'gbx', 'Inter', sans-serif; }
body { font-family: 'gbx', 'Inter', sans-serif; }

.walker-scene {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--light-accent);
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.walker-label {
  position: absolute;
  top: 1.6rem;
  left: 4rem;
  z-index: 5;
  font-size: 1rem;
  letter-spacing: 0.12em;
  color: var(--accent-color);
}

.walker-viewport {
  position: relative;
  height: 480px;
  overflow: hidden;
}

.walker-world {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  will-change: transform;
}

.walker-ground {
  position: absolute;
  left: -2000px;
  right: -2000px;
  bottom: 40px;
  height: 32px;
  background-image: url('img/ground.svg');
  background-repeat: repeat-x;
  background-size: auto 100%;
  opacity: 0.9;
}

.walker {
  position: absolute;
  left: 50%;
  bottom: 52px;
  width: 96px;
  transform: translateX(-50%);
  z-index: 3;
  pointer-events: none;
}

.walker img { display: block; width: 100%; height: auto; }
.walker.facing-left img { transform: scaleX(-1); }

.signpost {
  position: absolute;
  bottom: 62px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 2;
}

.sign-read {
  position: absolute;
  top: -2rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  background: var(--text-color);
  color: var(--bg-color);
  padding: 0.25rem 0.6rem;
  border-radius: 2px;
  opacity: 0;
  transition: opacity 0.3s ease;
  white-space: nowrap;
}

.signpost.active .sign-read { opacity: 1; }

.sign-board {
  display: block;
  line-height: 0;
  background: transparent;
  border: none;
  padding: 0;
  text-decoration: none;
  transition: transform 0.3s ease, filter 0.3s ease;
}

.sign-board-img { display: block; width: 205px; height: auto; }

.sign-board-text {
  max-width: 180px;
  background: var(--bg-color);
  border: 1.5px solid var(--text-color);
  border-radius: 3px;
  padding: 0.6rem 0.9rem;
  font-family: var(--font-poem);
  font-size: 0.95rem;
  line-height: 1.35;
  text-align: center;
  color: var(--text-color);
  box-shadow: 3px 3px 0 var(--light-accent);
}

.signpost.tilt-l .sign-board { transform: rotate(-2deg); }
.signpost.tilt-r .sign-board { transform: rotate(1.7deg); }

.signpost.active .sign-board {
  transform: rotate(0deg) translateY(-6px) scale(1.04);
  filter: drop-shadow(0 8px 6px rgba(44, 36, 27, 0.14));
}

.sign-pole {
  width: 3px;
  height: 70px;
  background: var(--text-color);
  border-radius: 2px;
  margin-top: -2px;
}

.walker-caption {
  position: absolute;
  left: 2rem;
  right: 12rem;
  bottom: 1.4rem;
  z-index: 5;
  font-size: 0.85rem;
  font-style: italic;
  color: var(--accent-color);
  text-align: center;
}

.walker-caption strong { font-style: normal; font-weight: 600; color: var(--text-color); }
.walker-caption a { color: var(--text-color); }

.poem-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--light-accent);
  font-size: 0.85rem;
}

.poem-nav a {
  color: var(--accent-color);
  text-decoration: none;
  max-width: 45%;
  transition: color 0.3s ease;
}

.poem-nav a:hover { color: var(--text-color); }
.poem-nav .pn-next { text-align: right; margin-left: auto; }

.poem-missing {
  font-family: var(--font-poem);
  font-style: italic;
  text-align: center;
  color: var(--accent-color);
  padding: 3rem 0;
}

.poem-missing a { color: var(--text-color); }

@media (max-width: 768px) {
  nav {
    padding: 1.5rem 2rem;
    flex-direction: column;
    gap: 1.5rem;
  }
  .nav-links { gap: 1.5rem; }
  .poems-index, .poem-page, .about-page { padding: 3rem 1.5rem 6rem; }
  .poem-body { font-size: 1.05rem; line-height: 1.9; }
  .poem-item { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .poem-item-arrow { display: none; }
  .walker-label { left: 1.5rem; }
  .walker-viewport { height: 400px; }
  .walker-caption { left: 1rem; right: 1rem; bottom: 5rem; }
  .sign-board-img { width: 150px; }
  .sign-board-text { max-width: 140px; font-size: 0.85rem; }
}