@charset "UTF-8";

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(44, 44, 40, 0.01) 2px, rgba(44, 44, 40, 0.01) 4px),
    repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(44, 44, 40, 0.01) 2px, rgba(44, 44, 40, 0.01) 4px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.3;
}

html.dark-mode body::before {
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(232, 230, 226, 0.02) 2px, rgba(232, 230, 226, 0.02) 4px),
    repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(232, 230, 226, 0.02) 2px, rgba(232, 230, 226, 0.02) 4px);
}

.page-transition-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--color-bg);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
  will-change: opacity, transform;
}

.page-transition-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.page-transition-overlay::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(139, 115, 85, 0.03) 2px, rgba(139, 115, 85, 0.03) 4px),
    repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(139, 115, 85, 0.03) 2px, rgba(139, 115, 85, 0.03) 4px);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.page-transition-overlay.active::before {
  opacity: 1;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: "游明朝", "Yu Mincho", "ヒラギノ明朝 ProN W3", "Hiragino Mincho ProN", "HG明朝E", "ＭＳ Ｐ明朝", "MS PMincho", serif;
  font-size: 15px;
  line-height: 1.95;
  letter-spacing: 0.05em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  padding: 0 20px;
  overflow-x: hidden;
  transition: background-color 0.8s ease, color 0.8s ease;
  position: relative;
  min-height: 100vh;
}

body.page-loading {
  opacity: 0;
}

body.page-loaded {
  opacity: 1;
  transition: opacity 0.8s ease;
}

a {
  color: var(--color-text);
  text-decoration: none;
  transition: color 0.3s ease, opacity 0.3s ease;
}

a:hover {
  color: var(--color-uncanny);
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
}

.site-header {
  width: 100%;
  max-width: 900px;
  height: 120px;
  border-bottom: 1px solid var(--color-border-soft);
  margin: 0 auto;
  position: relative;
  padding: 0 20px;
  background-color: var(--color-bg);
  transition: border-color 0.8s ease, background-color 0.8s ease;
  z-index: 10;
}

.site-title {
  position: absolute;
  left: 20px;
  bottom: 24px;
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 0.12em;
  color: var(--color-text);
  transition: color 0.6s ease, transform 0.4s ease;
  will-change: transform;
}

.site-title:hover {
  color: var(--color-uncanny);
  transform: translateX(2px);
}

.site-header nav {
  position: absolute;
  right: 20px;
  bottom: 28px;
  font-size: 13px;
  letter-spacing: 0.15em;
  display: flex;
  align-items: center;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.site-header nav a {
  margin-left: 36px;
  position: relative;
  color: var(--color-text-soft);
  transition: color 0.5s ease, transform 0.3s ease;
}

.site-header nav a::before {
  content: "・";
  position: absolute;
  left: -16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-uncanny);
  opacity: 0;
  transition: opacity 0.4s ease, transform 0.4s ease;
  font-size: 16px;
}

.site-header nav a:hover {
  color: var(--color-text);
  transform: translateX(1px);
}

.site-header nav a:hover::before {
  opacity: 1;
  transform: translateY(-50%) translateX(-2px);
}

.theme-toggle {
  margin-left: 36px;
  cursor: pointer;
  font-size: 16px;
  user-select: none;
  transition: transform 0.4s ease, color 0.4s ease;
  background: none;
  border: 0;
  color: var(--color-text-soft);
  padding: 4px 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.theme-toggle:hover {
  transform: rotate(180deg) scale(1.1);
  color: var(--color-uncanny);
}

main {
  width: 100%;
  max-width: 900px;
  margin: 80px auto 120px;
  padding: 0 20px;
  position: relative;
  z-index: 1;
}

@media (max-width: 480px) {
  body {
    padding: 0 16px;
    font-size: 14px;
  }

  body::before {
    opacity: 0.2;
  }

  .site-header {
    padding: 0 16px;
    height: 100px;
  }

  .site-title {
    left: 16px;
    bottom: 20px;
    font-size: 19px;
    letter-spacing: 0.1em;
  }

  .site-header nav {
    right: 16px;
    bottom: 24px;
    font-size: 12px;
  }

  .site-header nav a {
    margin-left: 24px;
  }

  .theme-toggle {
    margin-left: 24px;
    font-size: 14px;
  }

  main {
    padding: 0 16px;
    margin: 60px auto 100px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
