:root {
  --bg: #050505;
  --bg-soft: #0a0a0a;
  --panel: rgba(255, 255, 255, 0.03);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.18);
  --text: #f1f0ea;
  --muted: rgba(241, 240, 234, 0.62);
  --accent: #ffffff;
}

@font-face {
  font-family: "Noto Sans JP Local";
  src: url("assets/font/Noto_Sans_JP/NotoSansJP-VariableFont_wght.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    var(--bg);
  background-size: 28px 28px, 28px 28px, auto;
  color: var(--text);
  font-family: "Noto Sans JP Local", "Noto Sans JP", sans-serif;
}

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

button,
input {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(20px, 4vw, 52px);
  border-bottom: 1px solid var(--line);
  background: rgba(5, 5, 5, 0.88);
  backdrop-filter: blur(12px);
}

.brand {
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 0.92rem;
}

.site-nav {
  display: flex;
  gap: 18px;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
}

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

.site-nav a.is-current,
.site-nav a:hover {
  color: var(--text);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 1px;
  margin: 6px auto;
  background: var(--text);
}

.page-shell {
  width: min(1200px, calc(100% - 40px));
  margin: 0 auto;
  padding: 56px 0 120px;
}

.page-caption {
  margin: 0 0 18px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 800;
}

.page-home {
  overflow: hidden;
}

.page-hero h1,
.home-copy h1 {
  margin: 8px 0 0;
  font-size: clamp(2.5rem, 7vw, 6rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.05em;
}

.page-hero.compact h1 {
  font-size: clamp(2rem, 5vw, 4rem);
}

.eyebrow,
.panel-label,
.search-box span,
.filter-head,
.timeline span,
.info-table span {
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.lede,
.panel-text,
.text-block p,
.timeline p {
  color: var(--muted);
  line-height: 1.9;
}

.bio-section .text-block p,
.bio-section .timeline p,
.bio-section .info-table strong {
  color: var(--text);
}

.home-stage {
  position: relative;
  width: 100%;
  height: calc(100vh - 81px);
  padding: 0;
}

.button,
.text-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
}

.button:hover,
.text-link:hover {
  background: var(--panel);
}

.graph-shell {
  position: absolute;
  inset: 0;
  padding: 18px;
}

#graph-canvas,
.hover-info,
.filters,
.text-block,
.info-table,
.timeline article,
.work-card,
.work-detail-page,
.note-card {
  border: 1px solid var(--line);
  background: rgba(8, 8, 8, 0.72);
}

#graph-canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
  min-width: 0;
}

.home-title {
  position: absolute;
  top: 34px;
  left: 32px;
  z-index: 2;
  margin: 0;
  font-size: clamp(2.4rem, 7vw, 7rem);
  line-height: 0.92;
  letter-spacing: -0.06em;
  font-weight: 500;
  pointer-events: none;
}

.home-caption {
  position: absolute;
  top: 34px;
  left: 32px;
  z-index: 2;
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  pointer-events: none;
}

.mapping-controls {
  position: absolute;
  left: 32px;
  bottom: 32px;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-width: min(680px, calc(100vw - 64px));
  pointer-events: auto;
}

.tag-controls {
  position: absolute;
  left: 32px;
  bottom: 88px;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-width: min(760px, calc(100vw - 64px));
  pointer-events: auto;
}

.mapping-button {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  background: rgba(8, 8, 8, 0.42);
  color: var(--muted);
  cursor: pointer;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.74rem;
}

.tag-filter,
.mapping-button.is-active,
.tag-filter.is-active,
.tag-filter:hover,
.mapping-button:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.tag-filter {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  background: rgba(8, 8, 8, 0.42);
  color: var(--muted);
  cursor: pointer;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  pointer-events: auto;
}

.hover-info {
  position: absolute;
  top: 92px;
  right: 18px;
  width: min(50vw, 720px);
  max-height: calc(100vh - 128px);
  overflow: auto;
  padding: 28px;
  z-index: 2;
  pointer-events: auto;
  transition: opacity 120ms ease;
  min-height: min(68vh, 720px);
  background: rgba(8, 8, 8, 0.5);
  backdrop-filter: blur(14px);
  opacity: 1;
  transform: translateY(0);
}

.hover-thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  margin: 14px 0 18px;
  border: 1px solid var(--line);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.hover-info.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.hover-info::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.08) 0,
      rgba(255, 255, 255, 0.08) 2px,
      transparent 2px,
      transparent 8px
    );
  mix-blend-mode: screen;
}

.hover-info.is-entering {
  animation: info-enter 360ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.hover-info.is-entering::after,
.hover-info.is-leaving::after {
  animation: info-glitch 320ms steps(6) both;
}

.hover-info.is-leaving {
  animation: info-leave 320ms cubic-bezier(0.4, 0, 0.2, 1) both;
}

.panel-index {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  letter-spacing: 0.16em;
}

.graph-panel h2 {
  margin: 0;
  font-size: clamp(2rem, 3vw, 3.2rem);
  font-weight: 400;
}

.panel-meta {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 1rem;
}

@keyframes info-enter {
  0% {
    opacity: 0;
    transform: translateY(18px);
  }
  20% {
    opacity: 0.32;
    transform: translateY(10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes info-leave {
  0% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(14px);
  }
}

@keyframes info-glitch {
  0% {
    opacity: 0;
    transform: translateX(0);
  }
  15% {
    opacity: 0.22;
    transform: translateX(-6px);
  }
  35% {
    opacity: 0.08;
    transform: translateX(5px);
  }
  55% {
    opacity: 0.2;
    transform: translateX(-3px);
  }
  100% {
    opacity: 0;
    transform: translateX(0);
  }
}

.hover-info .panel-text {
  font-size: 1rem;
  line-height: 1.95;
}

.info-link {
  width: 100%;
  margin-top: 20px;
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.04);
}

.info-link:hover {
  background: rgba(255, 255, 255, 0.08);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 16px 0 4px;
}

.tag {
  padding: 7px 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.96rem;
}

.tag.is-active,
.tag:hover {
  color: var(--text);
}

.axis-grid,
.info-table {
  display: grid;
  gap: 12px;
}

.axis-grid {
  grid-template-columns: repeat(3, 1fr);
  margin-top: auto;
}

.axis-grid div,
.info-table div {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.axis-grid strong,
.info-table strong {
  display: block;
  margin-top: 8px;
  font-size: 1rem;
  font-weight: 400;
}

.stack {
  width: min(1200px, calc(100% - 40px));
  margin: 0 auto;
  display: grid;
  gap: 16px;
}

.note-card,
.text-block,
.info-table {
  padding: 22px;
}

.filters {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 18px;
  padding: 18px;
}

.search-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.search-box input {
  min-height: 48px;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text);
  outline: none;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
}

.filter-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.filter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.filter-head button {
  padding: 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.results-head {
  margin: 20px 0 12px;
  color: var(--muted);
}

.works-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.work-card {
  display: flex;
  flex-direction: column;
}

.page-hero.compact {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.page-hero.compact h1 {
  font-size: clamp(1.3rem, 2.2vw, 1.8rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.work-visual,
.work-hero-visual {
  position: relative;
  min-height: 260px;
  border-bottom: 1px solid var(--line);
  background-color: #090909;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.work-card-body {
  padding: 18px;
  display: grid;
  gap: 10px;
}

.work-card-meta,
.detail-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.work-card h2,
.work-card h3,
.work-copy h1 {
  margin: 0;
  font-size: clamp(1rem, 1.6vw, 1.24rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.work-card p,
.work-copy p {
  color: var(--muted);
  line-height: 1.8;
}

.work-form {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.work-detail-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
  padding: 20px;
}

.work-copy {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.work-meta-stack,
.work-text {
  display: grid;
  gap: 10px;
}

.work-summary {
  font-size: 1.08rem;
  color: var(--text);
}

.work-stage {
  display: grid;
  gap: 14px;
}

.work-stage-head h1 {
  margin: 8px 0 10px;
  font-size: clamp(1.28rem, 2.2vw, 1.8rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.work-viewer {
  position: relative;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.work-media-shell {
  width: 100%;
  height: 100%;
  background: #050505;
}

.work-viewer img,
.work-viewer video {
  display: block;
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: contain;
  background: #050505;
}

.viewer-next {
  position: absolute;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: 1px solid var(--line-strong);
  background: rgba(5, 5, 5, 0.72);
  color: var(--text);
  cursor: pointer;
}

.viewer-caption {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.work-section {
  display: grid;
  gap: 14px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.work-section h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 400;
}

.work-section-media {
  display: grid;
  gap: 12px;
}

.work-section-media img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  background: #050505;
}

.work-section-copy {
  display: grid;
  gap: 10px;
}

.video-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  background: #050505;
}

.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-thumb {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
}

.video-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  min-width: 96px;
  min-height: 48px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(8, 8, 8, 0.56);
  color: var(--text);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.credits ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.8;
}

.media-gallery {
  display: grid;
  gap: 14px;
}

.media-item {
  margin: 0;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.media-item img,
.media-item video {
  display: block;
  width: 100%;
  height: auto;
}

.media-item figcaption {
  padding: 10px 12px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.6;
  word-break: break-word;
}

.bio-section {
  display: grid;
  gap: 24px;
}

.essay-shell {
  display: grid;
  gap: 18px;
}

.essay-list {
  display: grid;
  gap: 14px;
}

.essay-card {
  display: grid;
  gap: 12px;
}

.essay-card h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
}

.essay-card p {
  margin: 0;
}

.essay-lead {
  margin: 0;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.9;
}

.timeline {
  display: grid;
  gap: 12px;
}

.timeline article {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px;
  padding: 18px 20px;
}

.mail-link {
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  letter-spacing: -0.04em;
}

.bio-portrait {
  min-height: 520px;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.qr-block {
  display: flex;
  justify-content: center;
}

.qr-image {
  width: min(260px, 100%);
  height: auto;
}

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

  .works-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #graph-canvas {
    height: 100%;
  }

  .hover-info {
    top: auto;
    bottom: 18px;
    right: 18px;
    width: calc(100vw - 36px);
    min-height: 0;
    max-height: min(48vh, 520px);
    padding: 20px;
  }

  .mapping-controls {
    bottom: 18px;
    left: 18px;
    max-width: calc(100vw - 36px);
  }

  .tag-controls {
    bottom: 70px;
    left: 18px;
    max-width: calc(100vw - 36px);
  }
}

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

  .nav-toggle {
    display: block;
  }

  .site-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    padding-bottom: 8px;
  }

  .site-nav.is-open {
    display: flex;
  }

  .timeline article {
    grid-template-columns: 1fr;
  }
}
