@charset "UTF-8";
@font-face {
  font-family: "Special Elite";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("./assets/fonts/special-elite.woff2") format("woff2");
}
@font-face {
  font-family: "Shippori Mincho";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("./assets/fonts/shippori-mincho-regular.woff2") format("woff2");
}
@font-face {
  font-family: "Shippori Mincho";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("./assets/fonts/shippori-mincho-semibold.woff2") format("woff2");
}
:root {
  --canvas: #fbf9f4;
  --paper: #ffffff;
  --ink: #2a2a2a;
  --pencil: #7a7670;
  --green: #3d6840;
  --serif:
    "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", "YuMincho",
    "Noto Serif CJK JP", "HiraMinProN-W3", "BIZ UDPMincho", serif;
  --mono: "Special Elite", "Courier New", Courier, "Courier Prime", monospace;
  --shadow-soft: 0 8px 24px rgba(60, 50, 40, 0.08);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100vh;
  background: var(--canvas);
  color: var(--ink);
  font: 1rem/1.8 var(--serif);
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(40, 30, 10, 0.04) 1px, transparent 0);
  background-size: 18px 18px;
  pointer-events: none;
  z-index: 100;
}
a {
  color: var(--green);
  text-underline-offset: 0.25em;
}
button {
  font: inherit;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 5px;
}
[hidden] {
  display: none !important;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.skip {
  position: absolute;
  top: -100px;
  left: 16px;
  background: white;
  padding: 12px;
  z-index: 300;
}
.skip:focus {
  top: 12px;
}
.forest-header {
  padding: 2.2rem clamp(24px, 5vw, 64px) 0.6rem;
  display: flex;
  justify-content: space-between;
  gap: 32px;
  align-items: flex-start;
}
.forest-brand {
  max-width: 540px;
  min-width: 0;
}
.typewriter-sub {
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  color: var(--pencil);
  margin: 0 0 0.4rem;
}
h1 {
  font-size: clamp(2rem, 4vw, 2.3rem);
  font-weight: 600;
  letter-spacing: 0.18em;
  line-height: 1.5;
  margin: 0 0 0.6rem;
}
.forest-desc {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--pencil);
  margin: 0;
  letter-spacing: 0.05em;
}
.forest-controls {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}
.btn-sketch {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  background: transparent;
  border: 1px dashed var(--pencil);
  padding: 0.5rem 1rem;
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--pencil);
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  min-height: 44px;
  transition: all 0.2s ease;
}
.btn-sketch:hover {
  border-color: var(--ink);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.7);
  transform: translateY(-1px);
}
.btn-sketch:disabled {
  opacity: 0.6;
  cursor: wait;
}
.forest-aside {
  text-align: right;
  flex-shrink: 0;
}
.hommage-badge {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: bold;
  line-height: 1.7;
  letter-spacing: 0.08em;
  color: var(--pencil);
  border: 1px dashed rgba(120, 110, 100, 0.25);
  border-radius: 4px;
  padding: 0.6rem 0.9rem;
  margin: 0;
  background: rgba(255, 255, 255, 0.4);
}
.forest-stage {
  position: relative;
  margin-top: 0.5rem;
  padding-bottom: 28px;
}
.hill-lines {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 560px;
  pointer-events: none;
}
.forest-field {
  position: relative;
  width: calc(100% - 48px);
  max-width: 1180px;
  margin: auto;
  padding: 60px 0 28px;
  min-height: 450px;
}
.forest-trees {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 48px;
  justify-items: center;
}
.forest-tree {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 180px;
  padding: 0;
  color: var(--ink);
  text-decoration: none;
  text-align: center;
  border: 0;
  background: transparent;
  font: inherit;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  touch-action: none;
  border-radius: 6px;
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.forest-tree:hover {
  transform: translateY(-6px);
}
.forest-tree * {
  pointer-events: none;
}
.tree-artwork {
  display: block;
  width: auto;
  height: 170px;
  max-width: 150px;
  object-fit: contain;
  mix-blend-mode: multiply;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.forest-tree[data-art="tree_blue.png"] .tree-artwork {
  height: 155px;
}
.forest-tree[data-art="tree_round.png"] .tree-artwork {
  height: 150px;
}
.forest-tree[data-art="tree_olive.png"] .tree-artwork {
  height: 145px;
}
.spot-label {
  display: block;
  max-width: 180px;
  margin-top: 0.25rem;
  padding: 0.25rem 0.65rem;
  border: 1px solid rgba(120, 110, 100, 0.15);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
  transition: all 0.2s ease;
}
.spot-title {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.6;
  letter-spacing: 0.05em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.spot-meta {
  display: block;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--pencil);
  line-height: 1.6;
  margin-top: 0.15rem;
  overflow-wrap: anywhere;
}
.forest-tree:hover .spot-label {
  border-color: var(--ink);
  background: #fff;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.06);
}
.forest-sprout {
  margin: 56px auto 0;
}
.forest-sprout .tree-artwork {
  height: 65px;
}
.forest-sprout .spot-title {
  font-size: 0.8rem;
}
.forest-stone-spot {
  position: absolute;
  left: 36px;
  bottom: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  touch-action: none;
  transition: transform 0.25s ease;
  z-index: 5;
}
.forest-stone-spot:hover {
  transform: translateY(-4px) scale(1.05);
}
.forest-stone-spot:focus-visible {
  outline: 2px dashed rgba(120, 110, 100, 0.4);
  outline-offset: 4px;
  border-radius: 50%;
}
.forest-stone-spot * {
  pointer-events: none;
}
.forest-stone-spot.is-dragging {
  cursor: grabbing;
  transition: none !important;
  transform: scale(1.1) translateY(-6px);
  z-index: 1000 !important;
  filter: drop-shadow(0 12px 12px rgba(60, 45, 30, 0.15));
}
.forest-stone-spot .stone-artwork {
  width: 54px;
  height: auto;
  mix-blend-mode: multiply;
  pointer-events: none;
}
.forest-field.is-arranged {
  padding: 0;
}
.is-arranged .forest-trees {
  display: contents;
}
.is-arranged .forest-tree {
  position: absolute;
  margin: 0;
  touch-action: none;
  cursor: grab;
}
.is-arranged .forest-tree.is-dragging {
  cursor: grabbing;
  transition: none !important;
  transform: scale(1.08) translateY(-8px);
  z-index: 1000 !important;
  filter: drop-shadow(0 14px 14px rgba(60, 45, 30, 0.12));
}
.forest-status {
  color: var(--pencil);
  text-align: center;
  font-size: 0.8rem;
  margin: 0.6rem 24px;
}
.forest-status:empty {
  display: none;
}
.more-trees {
  display: flex;
  margin: 20px auto;
}
.forest-footer {
  max-width: 1180px;
  margin: 28px auto 0;
  padding: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  color: var(--pencil);
  font-size: 0.8rem;
}
.footer-meta {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}
.footer-nav {
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
}
.forest-footer a {
  color: var(--pencil);
  text-decoration: none;
  transition: color 0.2s ease;
}
.forest-footer a:hover {
  color: var(--ink);
}
.book-panel {
  position: fixed;
  inset: auto 3.5rem 2.5rem auto;
  margin: 0;
  z-index: 200;
  color: var(--ink);
  background: var(--paper);
  width: 440px;
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 48px);
  padding: 2rem;
  border: 1px solid rgba(80, 70, 60, 0.2);
  border-radius: 8px;
  box-shadow:
    var(--shadow-soft),
    0 20px 40px rgba(40, 30, 20, 0.06);
  font-family: var(--serif);
}
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid rgba(100, 90, 80, 0.15);
  padding-bottom: 0.8rem;
  margin-bottom: 1.2rem;
}
.panel-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.6;
  letter-spacing: 0.05em;
  overflow-wrap: anywhere;
}
.panel-header .typewriter-sub {
  font-family: var(--mono);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  color: var(--pencil);
  margin: 0 0 0.2rem;
}
.panel-close {
  background: none;
  border: 0;
  color: var(--pencil);
  font-size: 1.4rem;
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
  flex-shrink: 0;
  transition: color 0.2s ease;
}
.panel-close:hover {
  color: var(--ink);
}
#panel-status {
  color: var(--pencil);
  font-size: 0.85rem;
}
#panel-status:empty {
  display: none;
}
.panel-episodes {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  list-style: none;
  padding: 0;
  margin: 1.2rem 0;
  max-height: 280px;
  overflow-y: auto;
}
.ep-row-item {
  margin: 0;
  padding: 0;
}
.ep-row {
  display: block;
  border-radius: 6px;
  background: #faf9f5;
  border: 1px solid rgba(100, 90, 80, 0.08);
  padding: 0.85rem 1rem;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}
.ep-row:hover {
  background: #f4f1e8;
  border-color: rgba(100, 90, 80, 0.25);
  transform: translateX(3px);
}
.ep-row.is-disabled {
  cursor: not-allowed;
  opacity: 0.7;
  background: #fdfcf9;
}
.ep-row.is-disabled:hover {
  transform: none;
  background: #fdfcf9;
  border-color: rgba(100, 90, 80, 0.08);
}
.ep-row-top {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--pencil);
  margin-bottom: 0.2rem;
}
.ep-row-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.ep-row-note {
  font-size: 0.8rem;
  color: var(--pencil);
  margin-top: 0.25rem;
  line-height: 1.6;
  letter-spacing: 0.02em;
}
.panel-join {
  padding-top: 14px;
  border-top: 1px solid rgba(100, 90, 80, 0.15);
  font-size: 0.82rem;
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}
.panel-join.is-guide {
  display: block;
  padding: 0;
  border: 0;
}
.panel-join.is-guide p {
  margin: 0 0 1rem;
}
.panel-join.is-guide a {
  display: inline-block;
  margin: 0 12px 12px 0;
}
.panel-join:empty {
  display: none;
}
.panel-join p {
  margin: 0;
}
.panel-join a {
  color: var(--pencil);
  text-decoration: none;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  transition: color 0.2s ease;
}
.panel-join a:hover {
  color: var(--ink);
}
@media (max-width: 650px) {
  .forest-header {
    padding: 28px 24px 12px;
    flex-direction: column;
    gap: 24px;
  }
  .forest-desc {
    font-size: 0.9rem;
  }
  .forest-aside {
    text-align: left;
    width: 100%;
  }
  .hommage-badge {
    display: inline-block;
    font-size: 0.65rem;
    padding: 0.4rem 0.7rem;
  }
  nav {
    justify-content: flex-start;
    margin-top: 12px;
    gap: 20px;
  }
  .forest-controls {
    gap: 12px;
  }
  .forest-field {
    width: calc(100% - 32px);
  }
  .forest-footer {
    flex-direction: column;
    gap: 8px;
  }
  .book-panel {
    inset: auto 16px 16px auto;
    padding: 20px;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .book-panel[open] {
    animation: open-book 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .forest-tree:not(.is-dragging) .tree-artwork {
    transition: transform 0.2s;
  }
  .forest-tree:hover .tree-artwork {
    transform: translateY(-4px);
  }
}
@keyframes open-book {
  from {
    opacity: 0;
    transform: translateY(120%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* A paper forest: fixed horizon, straight travel, original drawings. */
.forest-viewport {
  position: relative;
}
.forest-stage:has(.is-depth) {
  padding-bottom: 0;
}
.forest-stage:has(.is-depth) .forest-viewport {
  position: sticky;
  top: 0;
  /* Walking exposes the full screen, even after the heading scrolls away. */
  height: 100dvh;
  --forest-scene-height: max(
    160px,
    calc(
      100dvh - var(--forest-entry-inset, 0px) - 16px -
        env(safe-area-inset-bottom)
    )
  );
  overflow: clip;
}
.forest-stage:has(.is-depth) .hill-lines {
  height: var(--forest-scene-height);
}
.forest-field.is-depth {
  width: 100%;
  max-width: 1180px;
  /* Fill the visible screen as the heading leaves, before depth travel starts. */
  height: var(--forest-scene-height);
  min-height: 0;
  padding: 0;
  perspective: 650px;
  perspective-origin: 50% 44%;
}
.is-depth .forest-trees {
  display: contents;
}
.is-depth .forest-tree,
.is-depth .forest-stone-spot {
  position: absolute;
  left: 50%;
  top: 44%;
  bottom: auto;
  right: auto;
  margin: 0;
  transform-origin: 50% 100%;
  transform: translate3d(
    calc(-50% + var(--tree-x, 0px)),
    calc(-100% + var(--tree-y, 210px)),
    var(--tree-z, 0px)
  );
  transition: none;
  touch-action: pan-y pinch-zoom;
  cursor: grab;
}
.is-depth .forest-tree {
  width: clamp(128px, 40vw, 180px);
}
.is-depth .spot-label {
  max-width: 100%;
}
.is-depth .forest-tree .tree-artwork {
  height: var(--tree-art-height, 230px);
  max-width: 100%;
  transition: none;
  transform-origin: 50% 100%;
}
.is-depth .forest-sprout .tree-artwork {
  height: 65px;
}
.is-depth .forest-tree:hover .tree-artwork {
  transform: none;
}
.is-depth .is-dragging,
.is-depth .forest-tree.is-dragging {
  cursor: grabbing;
}
.is-depth .forest-tree:focus-visible {
  outline-offset: 8px;
}
.forest-stage:has(.is-depth) .forest-status {
  position: absolute;
  top: 14px;
  left: 0;
  width: 100%;
  pointer-events: none;
}
.forest-stage:has(.is-depth) .forest-status {
  top: 40px;
  margin: 0;
}
@media (prefers-reduced-motion: no-preference) {
  .is-depth .forest-tree:not(.is-dragging) .tree-artwork {
    animation: forest-breath 11s ease-in-out infinite alternate;
  }
  .is-depth .forest-tree:nth-child(2n) .tree-artwork {
    animation-delay: -5s;
    animation-duration: 13s;
  }
}
@keyframes forest-breath {
  from {
    transform: rotate(-0.25deg);
  }
  to {
    transform: rotate(0.25deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .forest-page *,
  .forest-page *::before {
    animation: none !important;
    transition: none !important;
  }
}
